@aquera/nile-elements 1.9.6 → 1.9.7
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.
- package/README.md +3 -0
- package/dist/index-178e1e57.cjs.js +2 -0
- package/dist/index-178e1e57.cjs.js.map +1 -0
- package/dist/index-1faa963c.esm.js +1 -0
- package/dist/index-249de90a.esm.js +1 -0
- package/dist/index-353172ed.esm.js +1 -0
- package/dist/index-6f3fa4ab.esm.js +1 -0
- package/dist/index-89c520e9.cjs.js +5 -0
- package/dist/index-89c520e9.cjs.js.map +1 -0
- package/dist/index-920675c4.esm.js +1 -0
- package/dist/index-b387a9f4.cjs.js +2 -0
- package/dist/index-b387a9f4.cjs.js.map +1 -0
- package/dist/index-cc1385e0.cjs.js +2 -0
- package/dist/index-cc1385e0.cjs.js.map +1 -0
- package/dist/index-dedc38a6.esm.js +1 -0
- package/dist/index-df196058.cjs.js +2 -0
- package/dist/index-df196058.cjs.js.map +1 -0
- package/dist/index-f956f56d.cjs.js +7 -0
- package/dist/index-f956f56d.cjs.js.map +1 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.js +3595 -629
- package/dist/internal/glyph.cjs.js +2 -0
- package/dist/internal/glyph.cjs.js.map +1 -0
- package/dist/internal/glyph.esm.js +5 -0
- package/dist/nile-auto-complete/index.cjs.js +1 -1
- package/dist/nile-auto-complete/nile-auto-complete.cjs.js +1 -1
- package/dist/nile-auto-complete/portal-manager.cjs.js +1 -1
- package/dist/nile-auto-complete/portal-utils.cjs.js +1 -1
- package/dist/nile-code-editor/extensionSetup.cjs.js +7 -7
- package/dist/nile-code-editor/extensionSetup.cjs.js.map +1 -1
- package/dist/nile-code-editor/extensionSetup.esm.js +1 -1
- package/dist/nile-code-editor/index.cjs.js +1 -1
- package/dist/nile-code-editor/index.esm.js +1 -1
- package/dist/nile-code-editor/nile-code-editor.cjs.js +2 -2
- package/dist/nile-code-editor/nile-code-editor.cjs.js.map +1 -1
- package/dist/nile-code-editor/nile-code-editor.esm.js +1 -1
- package/dist/nile-color-picker/index.cjs.js +1 -1
- package/dist/nile-color-picker/nile-color-picker.cjs.js +1 -1
- package/dist/nile-combobox/index.cjs.js +1 -1
- package/dist/nile-combobox/index.esm.js +1 -1
- package/dist/nile-combobox/nile-combobox.cjs.js +1 -1
- package/dist/nile-combobox/nile-combobox.esm.js +1 -1
- package/dist/nile-combobox/portal-manager.cjs.js +1 -1
- package/dist/nile-context-menu/index.cjs.js +1 -1
- package/dist/nile-context-menu/nile-context-menu.cjs.js +1 -1
- package/dist/nile-context-submenu/index.cjs.js +1 -1
- package/dist/nile-context-submenu/nile-context-submenu.cjs.js +1 -1
- package/dist/nile-detail/index.cjs.js +1 -1
- package/dist/nile-detail/index.esm.js +1 -1
- package/dist/nile-detail/nile-detail.cjs.js +1 -1
- package/dist/nile-detail/nile-detail.esm.js +1 -1
- package/dist/nile-dropdown/index.cjs.js +1 -1
- package/dist/nile-dropdown/nile-dropdown.cjs.js +1 -1
- package/dist/nile-dropdown/portal-manager.cjs.js +1 -1
- package/dist/nile-file-upload/index.cjs.js +1 -1
- package/dist/nile-file-upload/nile-file-upload.cjs.js +1 -1
- package/dist/nile-file-upload/nile-file-upload.template.cjs.js +1 -1
- package/dist/nile-floating-panel/index.cjs.js +1 -1
- package/dist/nile-floating-panel/nile-floating-panel.cjs.js +1 -1
- package/dist/nile-lite-tooltip/index.cjs.js +1 -1
- package/dist/nile-lite-tooltip/nile-lite-tooltip.cjs.js +1 -1
- package/dist/nile-markdown-editor/index.cjs.js +1 -1
- package/dist/nile-markdown-editor/nile-markdown-editor.cjs.js +1 -1
- package/dist/nile-popover/index.cjs.js +1 -1
- package/dist/nile-popover/nile-popover.cjs.js +1 -1
- package/dist/nile-popover/portal-manager.cjs.js +1 -1
- package/dist/nile-popup/index.cjs.js +1 -1
- package/dist/nile-popup/nile-popup.cjs.js +1 -1
- package/dist/nile-select/index.cjs.js +1 -1
- package/dist/nile-select/nile-select.cjs.js +1 -1
- package/dist/nile-select/portal-manager.cjs.js +1 -1
- package/dist/nile-side-bar-action/index.cjs.js +1 -1
- package/dist/nile-side-bar-action/nile-side-bar-action.cjs.js +1 -1
- package/dist/nile-side-bar-action/portal-manager.cjs.js +1 -1
- package/dist/nile-tooltip/index.cjs.js +1 -1
- package/dist/nile-tooltip/nile-tooltip.cjs.js +1 -1
- package/dist/nile-virtual-select/index.cjs.js +1 -1
- package/dist/nile-virtual-select/nile-virtual-select.cjs.js +1 -1
- package/dist/nile-virtual-select/portal-manager.cjs.js +1 -1
- package/dist/nile-virtual-select/renderer.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/emoji.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/emoji.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/emoji.esm.js +1 -0
- package/dist/nile-wysiwyg-editor/engine/commands.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/engine/commands.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/engine/commands.esm.js +1 -0
- package/dist/nile-wysiwyg-editor/engine/create-state.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/engine/create-state.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/engine/create-state.esm.js +1 -0
- package/dist/nile-wysiwyg-editor/engine/export.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/engine/export.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/engine/export.esm.js +1 -0
- package/dist/nile-wysiwyg-editor/engine/index.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/engine/index.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/engine/index.esm.js +1 -0
- package/dist/nile-wysiwyg-editor/engine/inputrules.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/engine/inputrules.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/engine/inputrules.esm.js +1 -0
- package/dist/nile-wysiwyg-editor/engine/keymap.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/engine/keymap.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/engine/keymap.esm.js +1 -0
- package/dist/nile-wysiwyg-editor/engine/markdown-parse.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/engine/markdown-parse.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/engine/markdown-parse.esm.js +1 -0
- package/dist/nile-wysiwyg-editor/engine/markdown.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/engine/markdown.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/engine/markdown.esm.js +1 -0
- package/dist/nile-wysiwyg-editor/engine/office-paste.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/engine/office-paste.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/engine/office-paste.esm.js +1 -0
- package/dist/nile-wysiwyg-editor/engine/plugins/code-highlight.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/engine/plugins/code-highlight.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/engine/plugins/code-highlight.esm.js +1 -0
- package/dist/nile-wysiwyg-editor/engine/plugins/embed-view.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/engine/plugins/embed-view.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/engine/plugins/embed-view.esm.js +1 -0
- package/dist/nile-wysiwyg-editor/engine/plugins/embeds.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/engine/plugins/embeds.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/engine/plugins/embeds.esm.js +1 -0
- package/dist/nile-wysiwyg-editor/engine/plugins/find-replace.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/engine/plugins/find-replace.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/engine/plugins/find-replace.esm.js +1 -0
- package/dist/nile-wysiwyg-editor/engine/plugins/format-painter.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/engine/plugins/format-painter.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/engine/plugins/format-painter.esm.js +1 -0
- package/dist/nile-wysiwyg-editor/engine/plugins/image-view.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/engine/plugins/image-view.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/engine/plugins/image-view.esm.js +1 -0
- package/dist/nile-wysiwyg-editor/engine/plugins/image.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/engine/plugins/image.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/engine/plugins/image.esm.js +1 -0
- package/dist/nile-wysiwyg-editor/engine/plugins/link.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/engine/plugins/link.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/engine/plugins/link.esm.js +1 -0
- package/dist/nile-wysiwyg-editor/engine/plugins/math-view.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/engine/plugins/math-view.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/engine/plugins/math-view.esm.js +1 -0
- package/dist/nile-wysiwyg-editor/engine/plugins/max-length.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/engine/plugins/max-length.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/engine/plugins/max-length.esm.js +1 -0
- package/dist/nile-wysiwyg-editor/engine/plugins/paste.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/engine/plugins/paste.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/engine/plugins/paste.esm.js +1 -0
- package/dist/nile-wysiwyg-editor/engine/plugins/placeholder.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/engine/plugins/placeholder.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/engine/plugins/placeholder.esm.js +1 -0
- package/dist/nile-wysiwyg-editor/engine/plugins/single-line.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/engine/plugins/single-line.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/engine/plugins/single-line.esm.js +1 -0
- package/dist/nile-wysiwyg-editor/engine/plugins/suggestions.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/engine/plugins/suggestions.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/engine/plugins/suggestions.esm.js +1 -0
- package/dist/nile-wysiwyg-editor/engine/plugins/tables.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/engine/plugins/tables.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/engine/plugins/tables.esm.js +1 -0
- package/dist/nile-wysiwyg-editor/engine/plugins/task-list.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/engine/plugins/task-list.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/engine/plugins/task-list.esm.js +1 -0
- package/dist/nile-wysiwyg-editor/engine/sanitize.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/engine/sanitize.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/engine/sanitize.esm.js +1 -0
- package/dist/nile-wysiwyg-editor/engine/schema.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/engine/schema.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/engine/schema.esm.js +1 -0
- package/dist/nile-wysiwyg-editor/engine/selection-state.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/engine/selection-state.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/engine/selection-state.esm.js +1 -0
- package/dist/nile-wysiwyg-editor/engine/serializer.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/engine/serializer.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/engine/serializer.esm.js +1 -0
- package/dist/nile-wysiwyg-editor/index.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/index.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/index.esm.js +1 -0
- package/dist/nile-wysiwyg-editor/nile-wysiwyg-editor.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/nile-wysiwyg-editor.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/nile-wysiwyg-editor.css.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/nile-wysiwyg-editor.css.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/nile-wysiwyg-editor.css.esm.js +780 -0
- package/dist/nile-wysiwyg-editor/nile-wysiwyg-editor.esm.js +97 -0
- package/dist/nile-wysiwyg-editor/nile-wysiwyg-toolbar/index.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/nile-wysiwyg-toolbar/index.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/nile-wysiwyg-toolbar/index.esm.js +1 -0
- package/dist/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.css.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.css.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.css.esm.js +244 -0
- package/dist/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.esm.js +137 -0
- package/dist/nile-wysiwyg-editor/types.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/types.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/types.esm.js +1 -0
- package/dist/nile-wysiwyg-editor/ui/bookmark-panel.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/ui/bookmark-panel.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/ui/bookmark-panel.esm.js +97 -0
- package/dist/nile-wysiwyg-editor/ui/bubble-menu.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/ui/bubble-menu.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/ui/bubble-menu.esm.js +67 -0
- package/dist/nile-wysiwyg-editor/ui/code-block-menu.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/ui/code-block-menu.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/ui/code-block-menu.esm.js +65 -0
- package/dist/nile-wysiwyg-editor/ui/embed-menu.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/ui/embed-menu.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/ui/embed-menu.esm.js +64 -0
- package/dist/nile-wysiwyg-editor/ui/embed-panel.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/ui/embed-panel.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/ui/embed-panel.esm.js +68 -0
- package/dist/nile-wysiwyg-editor/ui/emoji-picker.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/ui/emoji-picker.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/ui/emoji-picker.esm.js +96 -0
- package/dist/nile-wysiwyg-editor/ui/find-replace.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/ui/find-replace.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/ui/find-replace.esm.js +112 -0
- package/dist/nile-wysiwyg-editor/ui/image-menu.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/ui/image-menu.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/ui/image-menu.esm.js +64 -0
- package/dist/nile-wysiwyg-editor/ui/image-panel.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/ui/image-panel.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/ui/image-panel.esm.js +171 -0
- package/dist/nile-wysiwyg-editor/ui/insert-menu.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/ui/insert-menu.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/ui/insert-menu.esm.js +90 -0
- package/dist/nile-wysiwyg-editor/ui/link-editor.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/ui/link-editor.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/ui/link-editor.esm.js +114 -0
- package/dist/nile-wysiwyg-editor/ui/markdown-panel.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/ui/markdown-panel.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/ui/markdown-panel.esm.js +80 -0
- package/dist/nile-wysiwyg-editor/ui/math-panel.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/ui/math-panel.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/ui/math-panel.esm.js +92 -0
- package/dist/nile-wysiwyg-editor/ui/shortcut-help.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/ui/shortcut-help.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/ui/shortcut-help.esm.js +147 -0
- package/dist/nile-wysiwyg-editor/ui/source-view.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/ui/source-view.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/ui/source-view.esm.js +79 -0
- package/dist/nile-wysiwyg-editor/ui/special-chars.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/ui/special-chars.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/ui/special-chars.esm.js +96 -0
- package/dist/nile-wysiwyg-editor/ui/suggest-list.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/ui/suggest-list.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/ui/suggest-list.esm.js +67 -0
- package/dist/nile-wysiwyg-editor/ui/table-grid-picker.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/ui/table-grid-picker.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/ui/table-grid-picker.esm.js +100 -0
- package/dist/nile-wysiwyg-editor/ui/table-menu.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/ui/table-menu.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/ui/table-menu.esm.js +58 -0
- package/dist/src/index.d.ts +24 -0
- package/dist/src/index.js +19 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/internal/glyph.d.ts +6 -0
- package/dist/src/internal/glyph.js +13 -0
- package/dist/src/internal/glyph.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/emoji.d.ts +5 -0
- package/dist/src/nile-wysiwyg-editor/emoji.js +138 -0
- package/dist/src/nile-wysiwyg-editor/emoji.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/engine/commands.d.ts +69 -0
- package/dist/src/nile-wysiwyg-editor/engine/commands.js +863 -0
- package/dist/src/nile-wysiwyg-editor/engine/commands.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/engine/create-state.d.ts +35 -0
- package/dist/src/nile-wysiwyg-editor/engine/create-state.js +67 -0
- package/dist/src/nile-wysiwyg-editor/engine/create-state.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/engine/export.d.ts +38 -0
- package/dist/src/nile-wysiwyg-editor/engine/export.js +208 -0
- package/dist/src/nile-wysiwyg-editor/engine/export.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/engine/export.test.d.ts +1 -0
- package/dist/src/nile-wysiwyg-editor/engine/export.test.js +96 -0
- package/dist/src/nile-wysiwyg-editor/engine/export.test.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/engine/index.d.ts +37 -0
- package/dist/src/nile-wysiwyg-editor/engine/index.js +29 -0
- package/dist/src/nile-wysiwyg-editor/engine/index.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/engine/inputrules.d.ts +12 -0
- package/dist/src/nile-wysiwyg-editor/engine/inputrules.js +144 -0
- package/dist/src/nile-wysiwyg-editor/engine/inputrules.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/engine/keymap.d.ts +15 -0
- package/dist/src/nile-wysiwyg-editor/engine/keymap.js +94 -0
- package/dist/src/nile-wysiwyg-editor/engine/keymap.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/engine/markdown-parse.d.ts +22 -0
- package/dist/src/nile-wysiwyg-editor/engine/markdown-parse.js +287 -0
- package/dist/src/nile-wysiwyg-editor/engine/markdown-parse.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/engine/markdown-parse.test.d.ts +1 -0
- package/dist/src/nile-wysiwyg-editor/engine/markdown-parse.test.js +106 -0
- package/dist/src/nile-wysiwyg-editor/engine/markdown-parse.test.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/engine/markdown.d.ts +10 -0
- package/dist/src/nile-wysiwyg-editor/engine/markdown.js +162 -0
- package/dist/src/nile-wysiwyg-editor/engine/markdown.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/engine/office-paste.d.ts +13 -0
- package/dist/src/nile-wysiwyg-editor/engine/office-paste.js +182 -0
- package/dist/src/nile-wysiwyg-editor/engine/office-paste.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/engine/plugins/code-highlight.d.ts +10 -0
- package/dist/src/nile-wysiwyg-editor/engine/plugins/code-highlight.js +165 -0
- package/dist/src/nile-wysiwyg-editor/engine/plugins/code-highlight.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/engine/plugins/embed-view.d.ts +17 -0
- package/dist/src/nile-wysiwyg-editor/engine/plugins/embed-view.js +69 -0
- package/dist/src/nile-wysiwyg-editor/engine/plugins/embed-view.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/engine/plugins/embeds.d.ts +17 -0
- package/dist/src/nile-wysiwyg-editor/engine/plugins/embeds.js +96 -0
- package/dist/src/nile-wysiwyg-editor/engine/plugins/embeds.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/engine/plugins/find-replace.d.ts +26 -0
- package/dist/src/nile-wysiwyg-editor/engine/plugins/find-replace.js +123 -0
- package/dist/src/nile-wysiwyg-editor/engine/plugins/find-replace.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/engine/plugins/format-painter.d.ts +28 -0
- package/dist/src/nile-wysiwyg-editor/engine/plugins/format-painter.js +72 -0
- package/dist/src/nile-wysiwyg-editor/engine/plugins/format-painter.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/engine/plugins/image-view.d.ts +41 -0
- package/dist/src/nile-wysiwyg-editor/engine/plugins/image-view.js +176 -0
- package/dist/src/nile-wysiwyg-editor/engine/plugins/image-view.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/engine/plugins/image.d.ts +15 -0
- package/dist/src/nile-wysiwyg-editor/engine/plugins/image.js +64 -0
- package/dist/src/nile-wysiwyg-editor/engine/plugins/image.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/engine/plugins/link.d.ts +11 -0
- package/dist/src/nile-wysiwyg-editor/engine/plugins/link.js +42 -0
- package/dist/src/nile-wysiwyg-editor/engine/plugins/link.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/engine/plugins/math-view.d.ts +18 -0
- package/dist/src/nile-wysiwyg-editor/engine/plugins/math-view.js +46 -0
- package/dist/src/nile-wysiwyg-editor/engine/plugins/math-view.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/engine/plugins/max-length.d.ts +7 -0
- package/dist/src/nile-wysiwyg-editor/engine/plugins/max-length.js +26 -0
- package/dist/src/nile-wysiwyg-editor/engine/plugins/max-length.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/engine/plugins/paste.d.ts +31 -0
- package/dist/src/nile-wysiwyg-editor/engine/plugins/paste.js +55 -0
- package/dist/src/nile-wysiwyg-editor/engine/plugins/paste.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/engine/plugins/placeholder.d.ts +7 -0
- package/dist/src/nile-wysiwyg-editor/engine/plugins/placeholder.js +25 -0
- package/dist/src/nile-wysiwyg-editor/engine/plugins/placeholder.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/engine/plugins/single-line.d.ts +10 -0
- package/dist/src/nile-wysiwyg-editor/engine/plugins/single-line.js +48 -0
- package/dist/src/nile-wysiwyg-editor/engine/plugins/single-line.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/engine/plugins/suggestions.d.ts +29 -0
- package/dist/src/nile-wysiwyg-editor/engine/plugins/suggestions.js +87 -0
- package/dist/src/nile-wysiwyg-editor/engine/plugins/suggestions.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/engine/plugins/tables.d.ts +8 -0
- package/dist/src/nile-wysiwyg-editor/engine/plugins/tables.js +11 -0
- package/dist/src/nile-wysiwyg-editor/engine/plugins/tables.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/engine/plugins/task-list.d.ts +16 -0
- package/dist/src/nile-wysiwyg-editor/engine/plugins/task-list.js +49 -0
- package/dist/src/nile-wysiwyg-editor/engine/plugins/task-list.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/engine/pm.test.d.ts +1 -0
- package/dist/src/nile-wysiwyg-editor/engine/pm.test.js +883 -0
- package/dist/src/nile-wysiwyg-editor/engine/pm.test.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/engine/productivity.test.d.ts +1 -0
- package/dist/src/nile-wysiwyg-editor/engine/productivity.test.js +129 -0
- package/dist/src/nile-wysiwyg-editor/engine/productivity.test.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/engine/sanitize.d.ts +13 -0
- package/dist/src/nile-wysiwyg-editor/engine/sanitize.js +155 -0
- package/dist/src/nile-wysiwyg-editor/engine/sanitize.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/engine/schema.d.ts +20 -0
- package/dist/src/nile-wysiwyg-editor/engine/schema.js +823 -0
- package/dist/src/nile-wysiwyg-editor/engine/schema.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/engine/selection-state.d.ts +70 -0
- package/dist/src/nile-wysiwyg-editor/engine/selection-state.js +138 -0
- package/dist/src/nile-wysiwyg-editor/engine/selection-state.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/engine/serializer.d.ts +18 -0
- package/dist/src/nile-wysiwyg-editor/engine/serializer.js +63 -0
- package/dist/src/nile-wysiwyg-editor/engine/serializer.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/index.d.ts +3 -0
- package/dist/src/nile-wysiwyg-editor/index.js +3 -0
- package/dist/src/nile-wysiwyg-editor/index.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-editor.css.d.ts +1 -0
- package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-editor.css.js +782 -0
- package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-editor.css.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-editor.d.ts +364 -0
- package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-editor.js +2038 -0
- package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-editor.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-editor.test.d.ts +1 -0
- package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-editor.test.js +636 -0
- package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-editor.test.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-toolbar/index.d.ts +1 -0
- package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-toolbar/index.js +2 -0
- package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-toolbar/index.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.css.d.ts +6 -0
- package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.css.js +251 -0
- package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.css.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.d.ts +41 -0
- package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.js +700 -0
- package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/types.d.ts +49 -0
- package/dist/src/nile-wysiwyg-editor/types.js +8 -0
- package/dist/src/nile-wysiwyg-editor/types.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/ui/bookmark-panel.d.ts +20 -0
- package/dist/src/nile-wysiwyg-editor/ui/bookmark-panel.js +159 -0
- package/dist/src/nile-wysiwyg-editor/ui/bookmark-panel.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/ui/bubble-menu.d.ts +21 -0
- package/dist/src/nile-wysiwyg-editor/ui/bubble-menu.js +125 -0
- package/dist/src/nile-wysiwyg-editor/ui/bubble-menu.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/ui/code-block-menu.d.ts +18 -0
- package/dist/src/nile-wysiwyg-editor/ui/code-block-menu.js +107 -0
- package/dist/src/nile-wysiwyg-editor/ui/code-block-menu.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/ui/embed-menu.d.ts +19 -0
- package/dist/src/nile-wysiwyg-editor/ui/embed-menu.js +123 -0
- package/dist/src/nile-wysiwyg-editor/ui/embed-menu.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/ui/embed-panel.d.ts +27 -0
- package/dist/src/nile-wysiwyg-editor/ui/embed-panel.js +146 -0
- package/dist/src/nile-wysiwyg-editor/ui/embed-panel.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/ui/emoji-picker.d.ts +21 -0
- package/dist/src/nile-wysiwyg-editor/ui/emoji-picker.js +154 -0
- package/dist/src/nile-wysiwyg-editor/ui/emoji-picker.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/ui/find-replace.d.ts +26 -0
- package/dist/src/nile-wysiwyg-editor/ui/find-replace.js +178 -0
- package/dist/src/nile-wysiwyg-editor/ui/find-replace.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/ui/image-menu.d.ts +18 -0
- package/dist/src/nile-wysiwyg-editor/ui/image-menu.js +129 -0
- package/dist/src/nile-wysiwyg-editor/ui/image-menu.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/ui/image-panel.d.ts +56 -0
- package/dist/src/nile-wysiwyg-editor/ui/image-panel.js +349 -0
- package/dist/src/nile-wysiwyg-editor/ui/image-panel.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/ui/insert-menu.d.ts +25 -0
- package/dist/src/nile-wysiwyg-editor/ui/insert-menu.js +142 -0
- package/dist/src/nile-wysiwyg-editor/ui/insert-menu.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/ui/link-editor.d.ts +30 -0
- package/dist/src/nile-wysiwyg-editor/ui/link-editor.js +189 -0
- package/dist/src/nile-wysiwyg-editor/ui/link-editor.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/ui/markdown-panel.d.ts +24 -0
- package/dist/src/nile-wysiwyg-editor/ui/markdown-panel.js +144 -0
- package/dist/src/nile-wysiwyg-editor/ui/markdown-panel.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/ui/math-panel.d.ts +31 -0
- package/dist/src/nile-wysiwyg-editor/ui/math-panel.js +172 -0
- package/dist/src/nile-wysiwyg-editor/ui/math-panel.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/ui/shortcut-help.d.ts +30 -0
- package/dist/src/nile-wysiwyg-editor/ui/shortcut-help.js +296 -0
- package/dist/src/nile-wysiwyg-editor/ui/shortcut-help.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/ui/source-view.d.ts +19 -0
- package/dist/src/nile-wysiwyg-editor/ui/source-view.js +120 -0
- package/dist/src/nile-wysiwyg-editor/ui/source-view.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/ui/special-chars.d.ts +20 -0
- package/dist/src/nile-wysiwyg-editor/ui/special-chars.js +199 -0
- package/dist/src/nile-wysiwyg-editor/ui/special-chars.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/ui/suggest-list.d.ts +31 -0
- package/dist/src/nile-wysiwyg-editor/ui/suggest-list.js +133 -0
- package/dist/src/nile-wysiwyg-editor/ui/suggest-list.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/ui/table-grid-picker.d.ts +23 -0
- package/dist/src/nile-wysiwyg-editor/ui/table-grid-picker.js +177 -0
- package/dist/src/nile-wysiwyg-editor/ui/table-grid-picker.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/ui/table-menu.d.ts +16 -0
- package/dist/src/nile-wysiwyg-editor/ui/table-menu.js +101 -0
- package/dist/src/nile-wysiwyg-editor/ui/table-menu.js.map +1 -0
- package/dist/src/version.js +1 -1
- package/dist/src/version.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +18 -2
- package/src/index.ts +57 -1
- package/src/internal/glyph.ts +13 -0
- package/src/nile-wysiwyg-editor/emoji.ts +137 -0
- package/src/nile-wysiwyg-editor/engine/commands.ts +1035 -0
- package/src/nile-wysiwyg-editor/engine/create-state.ts +117 -0
- package/src/nile-wysiwyg-editor/engine/export.test.ts +113 -0
- package/src/nile-wysiwyg-editor/engine/export.ts +242 -0
- package/src/nile-wysiwyg-editor/engine/index.ts +69 -0
- package/src/nile-wysiwyg-editor/engine/inputrules.ts +169 -0
- package/src/nile-wysiwyg-editor/engine/keymap.ts +146 -0
- package/src/nile-wysiwyg-editor/engine/markdown-parse.test.ts +148 -0
- package/src/nile-wysiwyg-editor/engine/markdown-parse.ts +337 -0
- package/src/nile-wysiwyg-editor/engine/markdown.ts +165 -0
- package/src/nile-wysiwyg-editor/engine/office-paste.ts +199 -0
- package/src/nile-wysiwyg-editor/engine/plugins/code-highlight.ts +173 -0
- package/src/nile-wysiwyg-editor/engine/plugins/embed-view.ts +85 -0
- package/src/nile-wysiwyg-editor/engine/plugins/embeds.ts +99 -0
- package/src/nile-wysiwyg-editor/engine/plugins/find-replace.ts +155 -0
- package/src/nile-wysiwyg-editor/engine/plugins/format-painter.ts +80 -0
- package/src/nile-wysiwyg-editor/engine/plugins/image-view.ts +220 -0
- package/src/nile-wysiwyg-editor/engine/plugins/image.ts +80 -0
- package/src/nile-wysiwyg-editor/engine/plugins/link.ts +42 -0
- package/src/nile-wysiwyg-editor/engine/plugins/math-view.ts +56 -0
- package/src/nile-wysiwyg-editor/engine/plugins/max-length.ts +24 -0
- package/src/nile-wysiwyg-editor/engine/plugins/paste.ts +74 -0
- package/src/nile-wysiwyg-editor/engine/plugins/placeholder.ts +24 -0
- package/src/nile-wysiwyg-editor/engine/plugins/single-line.ts +47 -0
- package/src/nile-wysiwyg-editor/engine/plugins/suggestions.ts +110 -0
- package/src/nile-wysiwyg-editor/engine/plugins/tables.ts +12 -0
- package/src/nile-wysiwyg-editor/engine/plugins/task-list.ts +65 -0
- package/src/nile-wysiwyg-editor/engine/pm.test.ts +1088 -0
- package/src/nile-wysiwyg-editor/engine/productivity.test.ts +163 -0
- package/src/nile-wysiwyg-editor/engine/sanitize.ts +156 -0
- package/src/nile-wysiwyg-editor/engine/schema.ts +859 -0
- package/src/nile-wysiwyg-editor/engine/selection-state.ts +210 -0
- package/src/nile-wysiwyg-editor/engine/serializer.ts +78 -0
- package/src/nile-wysiwyg-editor/index.ts +3 -0
- package/src/nile-wysiwyg-editor/nile-wysiwyg-editor.css.ts +782 -0
- package/src/nile-wysiwyg-editor/nile-wysiwyg-editor.test.ts +750 -0
- package/src/nile-wysiwyg-editor/nile-wysiwyg-editor.ts +2155 -0
- package/src/nile-wysiwyg-editor/nile-wysiwyg-toolbar/index.ts +1 -0
- package/src/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.css.ts +251 -0
- package/src/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.ts +772 -0
- package/src/nile-wysiwyg-editor/types.ts +83 -0
- package/src/nile-wysiwyg-editor/ui/bookmark-panel.ts +155 -0
- package/src/nile-wysiwyg-editor/ui/bubble-menu.ts +135 -0
- package/src/nile-wysiwyg-editor/ui/code-block-menu.ts +105 -0
- package/src/nile-wysiwyg-editor/ui/embed-menu.ts +133 -0
- package/src/nile-wysiwyg-editor/ui/embed-panel.ts +143 -0
- package/src/nile-wysiwyg-editor/ui/emoji-picker.ts +152 -0
- package/src/nile-wysiwyg-editor/ui/find-replace.ts +174 -0
- package/src/nile-wysiwyg-editor/ui/image-menu.ts +140 -0
- package/src/nile-wysiwyg-editor/ui/image-panel.ts +337 -0
- package/src/nile-wysiwyg-editor/ui/insert-menu.ts +142 -0
- package/src/nile-wysiwyg-editor/ui/link-editor.ts +180 -0
- package/src/nile-wysiwyg-editor/ui/markdown-panel.ts +143 -0
- package/src/nile-wysiwyg-editor/ui/math-panel.ts +169 -0
- package/src/nile-wysiwyg-editor/ui/shortcut-help.ts +311 -0
- package/src/nile-wysiwyg-editor/ui/source-view.ts +119 -0
- package/src/nile-wysiwyg-editor/ui/special-chars.ts +209 -0
- package/src/nile-wysiwyg-editor/ui/suggest-list.ts +138 -0
- package/src/nile-wysiwyg-editor/ui/table-grid-picker.ts +173 -0
- package/src/nile-wysiwyg-editor/ui/table-menu.ts +109 -0
- package/vscode-html-custom-data.json +450 -0
- package/web-dev-server.config.mjs +6 -2
- package/dist/index-5fef1a0d.esm.js +0 -1
- package/dist/index-8f38fae3.cjs.js +0 -2
- package/dist/index-8f38fae3.cjs.js.map +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
System.register([],function(_export,_context){"use strict";var t,e,a,c,d,g,w,b,v,A,C,D,O,L,N,$,P,z,F,U,J,G,K,_,X,Q,Z,tt,et,it,nt,ht,lt,ot,ut,ft,at,ct,dt,pt,mt,gt,yt,xt,St,At,Dt,Et,It,Tt,Bt,Lt,$t,jt,zt,Gt,Kt,_t,Xt,Yt,Qt,Zt,te,ee,ie,se,re,we,be,ve,De,Oe,Ee,Re,Le,Ne,$e,je,Pe,ze,He,Fe,We,Ve,qe,Ue,Je,Ge,Ke,_e,ti,ri,ni,hi,li,oi,ui,ci,di,pi,mi,wi,bi,vi,ki,Mi,xi,Si,Ai,_i62,_arr,_t53,_e56,_i63,Di,Oi,Ii,Li,ji,Pi,zi,Hi,Fi,Wi,Vi,qi,Ui,Ji,Gi,Ki,_i,Xi,Yi,Zi,ts,es,is,ss,rs,ns,hs,ls,os,us,as,ds,ps,ms,gs,bs,Ts,Bs,Ns,$s,zs,Ws,Vs,qs,Js,Gs,Ks,_s,Zs,ir,sr,rr,nr,or,ur,cr,dr,pr,gr,wr,br,vr,kr,yr,xr,Sr,Ar,Cr,Or,Er,Tr,Br,Lr,Nr,Pr,zr,Fr,Wr,Vr,qr,Ur,Jr,Kr,_r,Xr,Yr,tn,en,sn,rn,nn,ln,un,fn,an,dn,pn,mn,wn,kn,yn,xn,Sn,Cn,On,En,In,Rn,Tn,Bn,Nn,$n,jn,Pn,zn,Hn,Fn,Wn,Vn,qn,Un,Jn,Kn,Yn,Qn,Zn,th,sh,rh,nh,lh,oh,uh,fh,ah,ch,dh,ph,wh,bh,kh,yh,xh,Sh,Ah,Ch,Dh,Oh,Ih,Th,Nh,$h,jh,Ph,zh,Hh,Fh,Vh,Jh,Gh,Kh,_h,Xh,Yh,Qh,Zh,tl,el,il,sl,rl,nl,hl,ll,fl,al,pl,ml,wl,bl,kl,xl,Sl,Al,Cl,Ol,Il,Rl,Tl,$l,jl,Fl,Wl,Vl,ql,Jl,Gl,Xl,Yl,Ql,Zl,to,eo,io,so,ro,no,ho,lo,oo,uo,fo,ao,co,_t230,_e205,po,mo,wo,bo,ko,Mo,xo,So,Co,Do,Oo,Eo,Io,Ro,To,Bo,jo,Po,Wo,Jo,Ko,_o,tu,eu,su,ou,uu,fu,du,pu,mu,gu,wu,bu,vu,ku,xu,Su,Au,Cu,Du,Ou,Eu,Iu,Tu,Bu,Lu,zu,Hu,Fu,Wu,Vu,_i177,_arr2,_arr2$_i,_t247,_e218,Gu,Ku,_u,Yu,tf,ef,sf,rf,nf,lf,of,uf,ff,af,pf,mf,kf,yf,Mf,Ef,If,Nf,$f,zf,Hf,qf,Uf,Kf,_f,Yf,Qf,Zf,ta,ea,ia,na,ha,la,oa,ua,da,ga,va,ka,ya,Ma,xa,Sa,Aa,Ca,Ea,Ia,Ra,Ta,Ba,La,Na,ja,Pa,za,Ha,Fa,Va,Ga,Ka,_a,Xa,Ya,Qa,Za,tc,ic,sc,rc,nc,hc,ac,cc,dc,pc,gc,wc,vc,kc,yc,Ac,Oc,Ec,Rc,Tc,Bc,Lc,Nc,zc,Wc,Vc,qc,Uc,Gc,_c,Xc,Yc,Qc,Zc,ed,sd,rd,nd,hd,ld,od,ud,fd,ad,cd,dd,pd,md,gd,wd,bd,vd,xd,Sd,Ad,Dd,Od,Ed,Id,Rd,Td,Nd,$d,jd,Jd,Gd,_d,Xd,Qd,Zd,tp,ep,ip,np,hp,lp,fp,ap,cp,pp,wp,bp,vp;function _defineProperty(e,r,t){return(r=_toPropertyKey(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e;}function _toConsumableArray(r){return _arrayWithoutHoles(r)||_iterableToArray(r)||_unsupportedIterableToArray(r)||_nonIterableSpread();}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _iterableToArray(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r);}function _arrayWithoutHoles(r){if(Array.isArray(r))return _arrayLikeToArray(r);}function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _n127=0,F=function F(){};return{s:F,n:function n(){return _n127>=r.length?{done:!0}:{done:!1,value:r[_n127++]};},e:function e(r){throw r;},f:F};}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}var o,a=!0,u=!1;return{s:function s(){t=t.call(r);},n:function n(){var r=t.next();return a=r.done,r;},e:function e(r){u=!0,o=r;},f:function f(){try{a||null==t["return"]||t["return"]();}finally{if(u)throw o;}}};}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e));}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t);}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e;}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t;})();}function _superPropGet(t,o,e,r){var p=_get(_getPrototypeOf(1&r?t.prototype:t),o,e);return 2&r&&"function"==typeof p?function(t){return p.apply(e,t);}:p;}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var p=_superPropBase(e,t);if(p){var n=Object.getOwnPropertyDescriptor(p,t);return n.get?n.get.call(arguments.length<3?e:r):n.value;}},_get.apply(null,arguments);}function _superPropBase(t,o){for(;!{}.hasOwnProperty.call(t,o)&&null!==(t=_getPrototypeOf(t)););return t;}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t);},_getPrototypeOf(t);}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e);}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t;},_setPrototypeOf(t,e);}function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}function _slicedToArray(r,e){return _arrayWithHoles(r)||_iterableToArrayLimit(r,e)||_unsupportedIterableToArray(r,e)||_nonIterableRest();}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0;}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n;}function _iterableToArrayLimit(r,l){var t=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=t){var e,n,i,u,a=[],f=!0,o=!1;try{if(i=(t=t.call(r)).next,0===l){if(Object(t)!==t)return;f=!1;}else for(;!(f=(e=i.call(t)).done)&&(a.push(e.value),a.length!==l);f=!0);}catch(r){o=!0,n=r;}finally{try{if(!f&&null!=t["return"]&&(u=t["return"](),Object(u)!==u))return;}finally{if(o)throw n;}}return a;}}function _arrayWithHoles(r){if(Array.isArray(r))return r;}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function");}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o);}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+"";}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return("string"===r?String:Number)(t);}function i(i){if(i<768)return!1;for(var _s2=0,_r2=t.length;;){var _n2=_s2+_r2>>1;if(i<t[_n2])_r2=_n2;else{if(!(i>=e[_n2]))return!0;_s2=_n2+1;}if(_s2==_r2)return!1;}}function s(t){return t>=127462&&t<=127487;}function r(t,e){var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!0;var s=arguments.length>3&&arguments[3]!==undefined?arguments[3]:!0;return(i?n:h)(t,e,s);}function n(t,e,r){if(e==t.length)return e;e&&o(t.charCodeAt(e))&&u(t.charCodeAt(e-1))&&e--;var n=l(t,e);for(e+=f(n);e<t.length;){var _h2=l(t,e);if(8205==n||8205==_h2||r&&i(_h2))e+=f(_h2),n=_h2;else{if(!s(_h2))break;{var _i2=0,_r4=e-2;for(;_r4>=0&&s(l(t,_r4));)_i2++,_r4-=2;if(_i2%2==0)break;e+=2;}}}return e;}function h(t,e,i){for(;e>0;){var _s4=n(t,e-2,i);if(_s4<e)return _s4;e--;}return 0;}function l(t,e){var i=t.charCodeAt(e);if(!u(i)||e+1==t.length)return i;var s=t.charCodeAt(e+1);return o(s)?s-56320+(i-55296<<10)+65536:i;}function o(t){return t>=56320&&t<57344;}function u(t){return t>=55296&&t<56320;}function f(t){return t<65536?1:2;}function p(t,e){var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;var s=arguments.length>3&&arguments[3]!==undefined?arguments[3]:1e9;for(var _r14=0,_n10=0,_h9=!0;_n10<t.length&&_r14<=s;_n10++){var _l8=t[_n10],_o4=_r14+_l8.length;_o4>=i&&(_o4>s&&(_l8=_l8.slice(0,s-_r14)),_r14<i&&(_l8=_l8.slice(i-_r14)),_h9?(e[e.length-1]+=_l8,_h9=!1):e.push(_l8)),_r14=_o4+1;}return e;}function m(t,e,i){return p(t,[""],e,i);}function k(t,e,i){return[e=Math.max(0,Math.min(t.length,e)),Math.max(e,Math.min(t.length,i))];}function y(t,e){var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!0;var s=arguments.length>3&&arguments[3]!==undefined?arguments[3]:!0;return r(t,e,i,s);}function M(t,e){var i=t.charCodeAt(e);if(!(s=i,s>=55296&&s<56320&&e+1!=t.length))return i;var s;var r=t.charCodeAt(e+1);return function(t){return t>=56320&&t<57344;}(r)?r-56320+(i-55296<<10)+65536:i;}function x(t){return t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode(55296+(t>>10),56320+(1023&t)));}function S(t){return t<65536?1:2;}function E(t,e,i){var s=arguments.length>3&&arguments[3]!==undefined?arguments[3]:!1;if(0==e&&i<=0)return;var r=t.length-2;r>=0&&i<=0&&i==t[r+1]?t[r]+=e:r>=0&&0==e&&0==t[r]?t[r+1]+=i:s?(t[r]+=e,t[r+1]+=i):t.push(e,i);}function I(t,e,i){if(0==i.length)return;var s=e.length-2>>1;if(s<t.length)t[t.length-1]=t[t.length-1].append(i);else{for(;t.length<s;)t.push(a.empty);t.push(i);}}function R(t,e,i){var s=t.inserted;for(var _r22=0,_n17=0,_h15=0;_h15<t.sections.length;){var _l12=t.sections[_h15++],_o7=t.sections[_h15++];if(_o7<0)_r22+=_l12,_n17+=_l12;else{var _u3=_r22,_f3=_n17,_c3=a.empty;for(;_u3+=_l12,_f3+=_o7,_o7&&s&&(_c3=_c3.append(s[_h15-2>>1])),!(i||_h15==t.sections.length||t.sections[_h15+1]<0);)_l12=t.sections[_h15++],_o7=t.sections[_h15++];e(_r22,_u3,_n17,_f3,_c3),_r22=_u3,_n17=_f3;}}}function T(t,e,i){var s=arguments.length>3&&arguments[3]!==undefined?arguments[3]:!1;var r=[],n=s?[]:null,h=new L(t),l=new L(e);for(var _t8=-1;;){if(h.done&&l.len||l.done&&h.len)throw new Error("Mismatched change set lengths");if(-1==h.ins&&-1==l.ins){var _t9=Math.min(h.len,l.len);E(r,_t9,-1),h.forward(_t9),l.forward(_t9);}else if(l.ins>=0&&(h.ins<0||_t8==h.i||0==h.off&&(l.len<h.len||l.len==h.len&&!i))){var _e17=l.len;for(E(r,l.ins,-1);_e17;){var _i12=Math.min(h.len,_e17);h.ins>=0&&_t8<h.i&&h.len<=_i12&&(E(r,0,h.ins),n&&I(n,r,h.text),_t8=h.i),h.forward(_i12),_e17-=_i12;}l.next();}else{if(!(h.ins>=0)){if(h.done&&l.done)return n?O.createSet(r,n):D.create(r);throw new Error("Mismatched change set lengths");}{var _e18=0,_i13=h.len;for(;_i13;)if(-1==l.ins){var _t10=Math.min(_i13,l.len);_e18+=_t10,_i13-=_t10,l.forward(_t10);}else{if(!(0==l.ins&&l.len<_i13))break;_i13-=l.len,l.next();}E(r,_e18,_t8<h.i?h.ins:0),n&&_t8<h.i&&I(n,r,h.text),_t8=h.i,h.forward(h.len-_i13);}}}}function B(t,e){var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!1;var s=[],r=i?[]:null,n=new L(t),h=new L(e);for(var _t11=!1;;){if(n.done&&h.done)return r?O.createSet(s,r):D.create(s);if(0==n.ins)E(s,n.len,0,_t11),n.next();else if(0!=h.len||h.done){if(n.done||h.done)throw new Error("Mismatched change set lengths");{var _e19=Math.min(n.len2,h.len),_i14=s.length;if(-1==n.ins){var _i15=-1==h.ins?-1:h.off?0:h.ins;E(s,_e19,_i15,_t11),r&&_i15&&I(r,s,h.text);}else-1==h.ins?(E(s,n.off?0:n.len,_e19,_t11),r&&I(r,s,n.textBit(_e19))):(E(s,n.off?0:n.len,h.off?0:h.ins,_t11),r&&!h.off&&I(r,s,h.text));_t11=(n.ins>_e19||h.ins>=0&&h.len>_e19)&&(_t11||s.length>_i14),n.forward2(_e19),h.forward(_e19);}}else E(s,0,h.ins,_t11),r&&I(r,s,h.text),h.next();}}function j(t,e){var _iterator11=_createForOfIteratorHelper(t.ranges),_step11;try{for(_iterator11.s();!(_step11=_iterator11.n()).done;){var _i19=_step11.value;if(_i19.to>e)throw new RangeError("Selection points outside of document");}}catch(err){_iterator11.e(err);}finally{_iterator11.f();}}function H(t,e){return t==e||t.length==e.length&&t.every(function(t,i){return t===e[i];});}function W(t,e,i){if(t.length!=e.length)return!1;for(var _s17=0;_s17<t.length;_s17++)if(!i(t[_s17],e[_s17]))return!1;return!0;}function V(t,e){var i=!1;var _iterator13=_createForOfIteratorHelper(e),_step13;try{for(_iterator13.s();!(_step13=_iterator13.n()).done;){var _s18=_step13.value;1&st(t,_s18)&&(i=!0);}}catch(err){_iterator13.e(err);}finally{_iterator13.f();}return i;}function q(t,e,i){var s=i.map(function(e){return t[e.id];}),r=i.map(function(t){return t.type;}),n=s.filter(function(t){return!(1&t);}),h=t[e.id]>>1;function l(t){var i=[];for(var _e21=0;_e21<s.length;_e21++){var _n19=rt(t,s[_e21]);if(2==r[_e21]){var _iterator14=_createForOfIteratorHelper(_n19),_step14;try{for(_iterator14.s();!(_step14=_iterator14.n()).done;){var _t12=_step14.value;i.push(_t12);}}catch(err){_iterator14.e(err);}finally{_iterator14.f();}}else i.push(_n19);}return e.combine(i);}return{create:function create(t){var _iterator15=_createForOfIteratorHelper(s),_step15;try{for(_iterator15.s();!(_step15=_iterator15.n()).done;){var _e22=_step15.value;st(t,_e22);}}catch(err){_iterator15.e(err);}finally{_iterator15.f();}return t.values[h]=l(t),1;},update:function update(t,i){if(!V(t,n))return 0;var s=l(t);return e.compare(s,t.values[h])?0:(t.values[h]=s,1);},reconfigure:function reconfigure(t,r){var n=V(t,s),o=r.config.facets[e.id],u=r.facet(e);if(o&&!n&&H(i,o))return t.values[h]=u,0;var f=l(t);return e.compare(f,u)?(t.values[h]=u,0):(t.values[h]=f,1);}};}function Y(t){return function(e){return new Z(e,t);};}function st(t,e){if(1&e)return 2;var i=e>>1,s=t.status[i];if(4==s)throw new Error("Cyclic dependency between fields and/or facets");if(2&s)return s;t.status[i]=4;var r=t.computeSlot(t,t.config.dynamicSlots[i]);return t.status[i]=2|r;}function rt(t,e){return 1&e?t.config.staticValues[e>>1]:t.values[e>>1];}function wt(t,e){var i=[];for(var _s22=0,_r26=0;;){var _n20=void 0,_h17=void 0;if(_s22<t.length&&(_r26==e.length||e[_r26]>=t[_s22]))_n20=t[_s22++],_h17=t[_s22++];else{if(!(_r26<e.length))return i;_n20=e[_r26++],_h17=e[_r26++];}!i.length||i[i.length-1]<_n20?i.push(_n20,_h17):i[i.length-1]<_h17&&(i[i.length-1]=_h17);}}function bt(t,e,i){var s;var r,n,h;return i?(r=e.changes,n=O.empty(e.changes.length),h=t.changes.compose(e.changes)):(r=e.changes.map(t.changes),n=t.changes.mapDesc(e.changes,!0),h=t.changes.compose(r)),{changes:h,selection:e.selection?e.selection.map(n):null===(s=t.selection)||void 0===s?void 0:s.map(r),effects:mt.mapEffects(t.effects,r).concat(mt.mapEffects(e.effects,n)),annotations:t.annotations.length?t.annotations.concat(e.annotations):e.annotations,scrollIntoView:t.scrollIntoView||e.scrollIntoView};}function vt(t,e,i){var s=e.selection,r=Mt(e.annotations);return e.userEvent&&(r=r.concat(gt.userEvent.of(e.userEvent))),{changes:e.changes instanceof O?e.changes:O.of(e.changes||[],i,t.facet(lt)),selection:s&&(s instanceof $?s:$.single(s.anchor,s.head)),effects:Mt(e.effects),annotations:r,scrollIntoView:!!e.scrollIntoView};}function kt(t,e,i){var s=vt(t,e.length?e[0]:{},t.doc.length);e.length&&!1===e[0].filter&&(i=!1);for(var _r27=1;_r27<e.length;_r27++){!1===e[_r27].filter&&(i=!1);var _n21=!!e[_r27].sequential;s=bt(s,vt(t,e[_r27],_n21?s.changes.newLength:t.doc.length),_n21);}var r=gt.create(t,s.changes,s.selection,s.effects,s.annotations,s.scrollIntoView);return function(t){var e=t.startState,i=e.facet(ft),s=t;for(var _r28=i.length-1;_r28>=0;_r28--){var _n22=i[_r28](t);_n22&&Object.keys(_n22).length&&(s=bt(s,vt(e,_n22,t.changes.newLength),!0));}return s==t?t:gt.create(e,t.changes,t.selection,s.effects,s.annotations,s.scrollIntoView);}(i?function(t){var e=t.startState,i=!0;var _iterator21=_createForOfIteratorHelper(e.facet(ot)),_step21;try{for(_iterator21.s();!(_step21=_iterator21.n()).done;){var _s24=_step21.value;var _e28=_s24(t);if(!1===_e28){i=!1;break;}Array.isArray(_e28)&&(i=!0===i?_e28:wt(i,_e28));}}catch(err){_iterator21.e(err);}finally{_iterator21.f();}if(!0!==i){var _s23,_r29;if(!1===i)_r29=t.changes.invertedDesc,_s23=O.empty(e.doc.length);else{var _e27=t.changes.filter(i);_s23=_e27.changes,_r29=_e27.filtered.mapDesc(_e27.changes).invertedDesc;}t=gt.create(e,_s23,t.selection&&t.selection.map(_r29),mt.mapEffects(t.effects,_r29),t.annotations,t.scrollIntoView);}var s=e.facet(ut);for(var _i23=s.length-1;_i23>=0;_i23--){var _r30=s[_i23](t);t=_r30 instanceof gt?_r30:Array.isArray(_r30)&&1==_r30.length&&_r30[0]instanceof gt?_r30[0]:kt(e,Mt(_r30),!1);}return t;}(r):r);}function Mt(t){return null==t?yt:Array.isArray(t)?t:[t];}function Ct(t){return function(e){if(!/\S/.test(e))return xt.Space;if(function(t){if(At)return At.test(t);for(var _e29=0;_e29<t.length;_e29++){var _i24=t[_e29];if(/\w/.test(_i24)||_i24>""&&(_i24.toUpperCase()!=_i24.toLowerCase()||St.test(_i24)))return!0;}return!1;}(e))return xt.Word;for(var _i25=0;_i25<t.length;_i25++)if(e.indexOf(t[_i25])>-1)return xt.Word;return xt.Other;};}function Ot(t,e){var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};var s={};var _iterator26=_createForOfIteratorHelper(t),_step26;try{for(_iterator26.s();!(_step26=_iterator26.n()).done;){var _e33=_step26.value;for(var _i29=0,_Object$keys=Object.keys(_e33);_i29<_Object$keys.length;_i29++){var _t21=_Object$keys[_i29];var _r33=_e33[_t21],_n25=s[_t21];if(void 0===_n25)s[_t21]=_r33;else if(_n25===_r33||void 0===_r33);else{if(!Object.hasOwnProperty.call(i,_t21))throw new Error("Config merge conflict for field "+_t21);s[_t21]=i[_t21](_n25,_r33);}}}}catch(err){_iterator26.e(err);}finally{_iterator26.f();}for(var _t20 in e)void 0===s[_t20]&&(s[_t20]=e[_t20]);return s;}function Rt(t,e){return t.from-e.from||t.value.startSide-e.value.startSide;}function Nt(t,e,i){var s=new Map();var _iterator29=_createForOfIteratorHelper(t),_step29;try{for(_iterator29.s();!(_step29=_iterator29.n()).done;){var _e36=_step29.value;for(var _t26=0;_t26<_e36.chunk.length;_t26++)_e36.chunk[_t26].maxPoint<=0&&s.set(_e36.chunk[_t26],_e36.chunkPos[_t26]);}}catch(err){_iterator29.e(err);}finally{_iterator29.f();}var r=new Set();var _iterator30=_createForOfIteratorHelper(e),_step30;try{for(_iterator30.s();!(_step30=_iterator30.n()).done;){var _t27=_step30.value;for(var _e37=0;_e37<_t27.chunk.length;_e37++){var _n30=s.get(_t27.chunk[_e37]);null==_n30||(i?i.mapPos(_n30):_n30)!=_t27.chunkPos[_e37]||(null==i?void 0:i.touchesRange(_n30,_n30+_t27.chunk[_e37].length))||r.add(_t27.chunk[_e37]);}}}catch(err){_iterator30.e(err);}finally{_iterator30.f();}return r;}function Pt(t,e){for(var _i36=t[e];;){var _s32=1+(e<<1);if(_s32>=t.length)break;var _r40=t[_s32];if(_s32+1<t.length&&_r40.compare(t[_s32+1])>=0&&(_r40=t[_s32+1],_s32++),_i36.compare(_r40)<0)break;t[_s32]=_i36,t[e]=_r40,e=_s32;}}function Ht(t,e,i,s,r,n){t["goto"](e),i["goto"](s);var h=s+r,l=s,o=s-e;for(;;){var _e41=t.to+o-i.to,_s34=_e41||t.endSide-i.endSide,_r41=_s34<0?t.to+o:i.to,_u6=Math.min(_r41,h);if(t.point||i.point?t.point&&i.point&&(t.point==i.point||t.point.eq(i.point))&&Ft(t.activeForPoint(t.to),i.activeForPoint(i.to))||n.comparePoint(l,_u6,t.point,i.point):_u6>l&&!Ft(t.active,i.active)&&n.compareRange(l,_u6,t.active,i.active),_r41>h)break;(_e41||t.openEnd!=i.openEnd)&&n.boundChange&&n.boundChange(_r41),l=_r41,_s34<=0&&t.next(),_s34>=0&&i.next();}}function Ft(t,e){if(t.length!=e.length)return!1;for(var _i39=0;_i39<t.length;_i39++)if(t[_i39]!=e[_i39]&&!t[_i39].eq(e[_i39]))return!1;return!0;}function Wt(t,e){for(var _i40=e,_s35=t.length-1;_i40<_s35;_i40++)t[_i40]=t[_i40+1];t.pop();}function Vt(t,e,i){for(var _i41=t.length-1;_i41>=e;_i41--)t[_i41+1]=t[_i41];t[e]=i;}function qt(t,e){var i=-1,s=1e9;for(var _r42=0;_r42<e.length;_r42++)(e[_r42]-s||t[_r42].endSide-t[i].endSide)<0&&(i=_r42,s=e[_r42]);return i;}function Ut(t,e){var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:t.length;var s=0;for(var _r43=0;_r43<i&&_r43<t.length;)9==t.charCodeAt(_r43)?(s+=e-s%e,_r43++):(s++,_r43=y(t,_r43));return s;}function Jt(t,e,i,s){for(var _s36=0,_r44=0;;){if(_r44>=e)return _s36;if(_s36==t.length)break;_r44+=9==t.charCodeAt(_s36)?i-_r44%i:1,_s36=y(t,_s36);}return!0===s?-1:t.length;}function ne(t){var e;return e=11==t.nodeType?t.getSelection?t:t.ownerDocument:t,e.getSelection();}function he(t,e){return!!e&&(t==e||t.contains(1!=e.nodeType?e.parentNode:e));}function le(t,e){if(!e.anchorNode)return!1;try{return he(t,e.anchorNode);}catch(t){return!1;}}function oe(t){return 3==t.nodeType?ye(t,0,t.nodeValue.length).getClientRects():1==t.nodeType?t.getClientRects():[];}function ue(t,e,i,s){return!!i&&(ce(t,e,i,s,-1)||ce(t,e,i,s,1));}function fe(t){for(var e=0;;e++)if(!(t=t.previousSibling))return e;}function ae(t){return 1==t.nodeType&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(t.nodeName);}function ce(t,e,i,s,r){for(;;){if(t==i&&e==s)return!0;if(e==(r<0?0:de(t))){if("DIV"==t.nodeName)return!1;var _i44=t.parentNode;if(!_i44||1!=_i44.nodeType)return!1;e=fe(t)+(r<0?0:1),t=_i44;}else{if(1!=t.nodeType)return!1;if(1==(t=t.childNodes[e+(r<0?-1:0)]).nodeType&&"false"==t.contentEditable)return!1;e=r<0?de(t):0;}}}function de(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length;}function pe(t,e){var i=e?t.left:t.right;return{left:i,right:i,top:t.top,bottom:t.bottom};}function me(t){var e=t.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.innerWidth,top:0,bottom:t.innerHeight};}function ge(t,e){var i=e.width/t.offsetWidth,s=e.height/t.offsetHeight;return(i>.995&&i<1.005||!isFinite(i)||Math.abs(e.width-t.offsetWidth)<1)&&(i=1),(s>.995&&s<1.005||!isFinite(s)||Math.abs(e.height-t.offsetHeight)<1)&&(s=1),{scaleX:i,scaleY:s};}function ke(t){if(t.setActive)return t.setActive();if(ve)return t.focus(ve);var e=[];for(var _i45=t;_i45&&(e.push(_i45,_i45.scrollTop,_i45.scrollLeft),_i45!=_i45.ownerDocument);_i45=_i45.parentNode);if(t.focus(null==ve?{get preventScroll(){return ve={preventScroll:!0},!0;}}:void 0),!ve){ve=!1;for(var _t35=0;_t35<e.length;){var _i46=e[_t35++],_s37=e[_t35++],_r45=e[_t35++];_i46.scrollTop!=_s37&&(_i46.scrollTop=_s37),_i46.scrollLeft!=_r45&&(_i46.scrollLeft=_r45);}}}function ye(t,e){var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:e;var s=be||(be=document.createRange());return s.setEnd(t,i),s.setStart(t,e),s;}function Me(t,e,i,s){var _s38;var r={key:e,code:e,keyCode:i,which:i,cancelable:!0};s&&(_s38=s,r.altKey=_s38.altKey,r.ctrlKey=_s38.ctrlKey,r.shiftKey=_s38.shiftKey,r.metaKey=_s38.metaKey,_s38);var n=new KeyboardEvent("keydown",r);n.synthetic=!0,t.dispatchEvent(n);var h=new KeyboardEvent("keyup",r);return h.synthetic=!0,t.dispatchEvent(h),n.defaultPrevented||h.defaultPrevented;}function xe(t){for(;t.attributes.length;)t.removeAttributeNode(t.attributes[0]);}function Se(t){return t.scrollTop>Math.max(1,t.scrollHeight-t.clientHeight-4);}function Ae(t,e){for(var _i47=t,_s39=e;;){if(3==_i47.nodeType&&_s39>0)return{node:_i47,offset:_s39};if(1==_i47.nodeType&&_s39>0){if("false"==_i47.contentEditable)return null;_i47=_i47.childNodes[_s39-1],_s39=de(_i47);}else{if(!_i47.parentNode||ae(_i47))return null;_s39=fe(_i47),_i47=_i47.parentNode;}}}function Ce(t,e){for(var _i48=t,_s40=e;;){if(3==_i48.nodeType&&_s40<_i48.nodeValue.length)return{node:_i48,offset:_s40};if(1==_i48.nodeType&&_s40<_i48.childNodes.length){if("false"==_i48.contentEditable)return null;_i48=_i48.childNodes[_s40],_s40=0;}else{if(!_i48.parentNode||ae(_i48))return null;_s40=fe(_i48)+1,_i48=_i48.parentNode;}}}function Ie(t){var e=t.nextSibling;return t.parentNode.removeChild(t),e;}function Te(t,e,i,s,r,n,h,l,o){var u=t.children,f=u.length?u[e]:null,a=n.length?n[n.length-1]:null,c=a?a.breakAfter:h;if(!(e==s&&f&&!h&&!c&&n.length<2&&f.merge(i,r,n.length?a:null,0==i,l,o))){if(s<u.length){var _t42=u[s];_t42&&(r<_t42.length||_t42.breakAfter&&(null==a?void 0:a.breakAfter))?(e==s&&(_t42=_t42.split(r),r=0),!c&&a&&_t42.merge(0,r,a,!0,0,o)?n[n.length-1]=_t42:((r||_t42.children.length&&!_t42.children[0].length)&&_t42.merge(0,r,null,!1,0,o),n.push(_t42))):(null==_t42?void 0:_t42.breakAfter)&&(a?a.breakAfter=1:h=1),s++;}for(f&&(f.breakAfter=h,i>0&&(!h&&n.length&&f.merge(i,f.length,n[0],!1,l,0)?f.breakAfter=n.shift().breakAfter:(i<f.length||f.children.length&&0==f.children[f.children.length-1].length)&&f.merge(i,f.length,null,!1,l,0),e++));e<s&&n.length;)if(u[s-1].become(n[n.length-1]))s--,n.pop(),o=n.length?0:l;else{if(!u[e].become(n[0]))break;e++,n.shift(),l=n.length?0:o;}!n.length&&e&&s<u.length&&!u[e-1].breakAfter&&u[s].merge(0,0,u[e-1],!1,l,o)&&e--,(e<s||n.length)&&t.replaceChildren(e,s,n);}}function Be(t,e,i,s,r,n){var h=t.childCursor(),_h$findPos=h.findPos(i,1),l=_h$findPos.i,o=_h$findPos.off,_h$findPos2=h.findPos(e,-1),u=_h$findPos2.i,f=_h$findPos2.off,a=e-i;var _iterator37=_createForOfIteratorHelper(s),_step37;try{for(_iterator37.s();!(_step37=_iterator37.n()).done;){var _t43=_step37.value;a+=_t43.length;}}catch(err){_iterator37.e(err);}finally{_iterator37.f();}t.length+=a,Te(t,u,f,l,o,s,0,r,n);}function Xe(t,e){var i=t.dom,s=t.children,r=0;for(var _t47=0;r<s.length;r++){var _n35=s[r],_h24=_t47+_n35.length;if(!(_h24==_t47&&_n35.getSide()<=0)){if(e>_t47&&e<_h24&&_n35.dom.parentNode==i)return _n35.domAtPos(e-_t47);if(e<=_t47)break;_t47=_h24;}}for(var _t48=r;_t48>0;_t48--){var _e52=s[_t48-1];if(_e52.dom.parentNode==i)return _e52.domAtPos(_e52.length);}for(var _t49=r;_t49<s.length;_t49++){var _e53=s[_t49];if(_e53.dom.parentNode==i)return _e53.domAtPos(0);}return new De(i,0);}function Ye(t,e,i){var s,r=t.children;i>0&&e instanceof Ge&&r.length&&(s=r[r.length-1])instanceof Ge&&s.mark.eq(e.mark)?Ye(s,e.children[0],i-1):(r.push(e),e.setParent(t)),t.length+=e.length;}function Qe(t,e,i){var s=null,r=-1,n=null,h=-1;!function t(e,l){for(var _o11=0,_u8=0;_o11<e.children.length&&_u8<=l;_o11++){var _f6=e.children[_o11],_a5=_u8+_f6.length;_a5>=l&&(_f6.children.length?t(_f6,l-_u8):(!n||n.isHidden&&i>0)&&(_a5>l||_u8==_a5&&_f6.getSide()>0)?(n=_f6,h=l-_u8):(_u8<l||_u8==_a5&&_f6.getSide()<0&&!_f6.isHidden)&&(s=_f6,r=l-_u8)),_u8=_a5;}}(t,e);var l=(i<0?s:n)||s||n;return l?l.coordsAt(Math.max(0,l==s?r:h),i):function(t){var e=t.dom.lastChild;if(!e)return t.dom.getBoundingClientRect();var i=oe(e);return i[i.length-1]||null;}(t);}function Ze(t,e){for(var _i54 in t)"class"==_i54&&e["class"]?e["class"]+=" "+t["class"]:"style"==_i54&&e.style?e.style+=";"+t.style:e[_i54]=t[_i54];return e;}function ei(t,e,i){if(t==e)return!0;t||(t=ti),e||(e=ti);var s=Object.keys(t),r=Object.keys(e);if(s.length-(i&&s.indexOf(i)>-1?1:0)!=r.length-(i&&r.indexOf(i)>-1?1:0))return!1;for(var _i55=0,_s45=s;_i55<_s45.length;_i55++){var _n36=_s45[_i55];if(_n36!=i&&(-1==r.indexOf(_n36)||t[_n36]!==e[_n36]))return!1;}return!0;}function ii(t,e,i){var s=!1;if(e)for(var _r47 in e)i&&_r47 in i||(s=!0,"style"==_r47?t.style.cssText="":t.removeAttribute(_r47));if(i)for(var _r48 in i)e&&e[_r48]==i[_r48]||(s=!0,"style"==_r48?t.style.cssText=i[_r48]:t.setAttribute(_r48,i[_r48]));return s;}function si(t){var e=Object.create(null);for(var _i56=0;_i56<t.attributes.length;_i56++){var _s46=t.attributes[_i56];e[_s46.name]=_s46.value;}return e;}function fi(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!1;var i=t.inclusiveStart,s=t.inclusiveEnd;return null==i&&(i=t.inclusive),null==s&&(s=t.inclusive),{start:null!=i?i:e,end:null!=s?s:e};}function ai(t,e,i){var s=arguments.length>3&&arguments[3]!==undefined?arguments[3]:0;var r=i.length-1;r>=0&&i[r]+s>=t?i[r]=Math.max(i[r],e):i.push(t,e);}function gi(t,e){var _iterator41=_createForOfIteratorHelper(e),_step41;try{for(_iterator41.s();!(_step41=_iterator41.n()).done;){var _i60=_step41.value;t=new Ge(_i60,[t],t.length);}}catch(err){_iterator41.e(err);}finally{_iterator41.f();}return t;}function yi(t){var e=[];for(var _i61=0;_i61<t.length;_i61++)e.push(1<<+t[_i61]);return e;}function Ci(t){return t<=247?Mi[t]:1424<=t&&t<=1524?2:1536<=t&&t<=1785?xi[t-1536]:1774<=t&&t<=2220?4:8192<=t&&t<=8204?256:64336<=t&&t<=65023?4:1;}function Ei(t,e){if(t.length!=e.length)return!1;for(var _i64=0;_i64<t.length;_i64++){var _s52=t[_i64],_r51=e[_i64];if(_s52.from!=_r51.from||_s52.to!=_r51.to||_s52.direction!=_r51.direction||!Ei(_s52.inner,_r51.inner))return!1;}return!0;}function Ri(t,e,i,s,r,n,h){var l=s%2?2:1;if(s%2==r%2)for(var _o13=e,_u10=0;_o13<i;){var _e57=!0,_f7=!1;if(_u10==n.length||_o13<n[_u10].from){var _t54=Ii[_o13];_t54!=l&&(_e57=!1,_f7=16==_t54);}var _a6=_e57||1!=l?null:[],_c5=_e57?s:s+1,_d2=_o13;t:for(;;)if(_u10<n.length&&_d2==n[_u10].from){if(_f7)break t;var _p=n[_u10];if(!_e57)for(var _t55=_p.to,_e58=_u10+1;;){if(_t55==i)break t;if(!(_e58<n.length&&n[_e58].from==_t55)){if(Ii[_t55]==l)break t;break;}_t55=n[_e58++].to;}if(_u10++,_a6)_a6.push(_p);else{_p.from>_o13&&h.push(new Oi(_o13,_p.from,_c5)),Ti(t,_p.direction==vi!=!(_c5%2)?s+1:s,r,_p.inner,_p.from,_p.to,h),_o13=_p.to;}_d2=_p.to;}else{if(_d2==i||(_e57?Ii[_d2]!=l:Ii[_d2]==l))break;_d2++;}_a6?Ri(t,_o13,_d2,s+1,r,_a6,h):_o13<_d2&&h.push(new Oi(_o13,_d2,_c5)),_o13=_d2;}else for(var _o14=i,_u11=n.length;_o14>e;){var _i65=!0,_f8=!1;if(!_u11||_o14>n[_u11-1].to){var _t56=Ii[_o14-1];_t56!=l&&(_i65=!1,_f8=16==_t56);}var _a7=_i65||1!=l?null:[],_c6=_i65?s:s+1,_d3=_o14;t:for(;;)if(_u11&&_d3==n[_u11-1].to){if(_f8)break t;var _p2=n[--_u11];if(!_i65)for(var _t57=_p2.from,_i66=_u11;;){if(_t57==e)break t;if(!_i66||n[_i66-1].to!=_t57){if(Ii[_t57-1]==l)break t;break;}_t57=n[--_i66].from;}if(_a7)_a7.push(_p2);else{_p2.to<_o14&&h.push(new Oi(_p2.to,_o14,_c6)),Ti(t,_p2.direction==vi!=!(_c6%2)?s+1:s,r,_p2.inner,_p2.from,_p2.to,h),_o14=_p2.from;}_d3=_p2.from;}else{if(_d3==e||(_i65?Ii[_d3-1]!=l:Ii[_d3-1]==l))break;_d3--;}_a7?Ri(t,_d3,_o14,s+1,r,_a7,h):_d3<_o14&&h.push(new Oi(_d3,_o14,_c6)),_o14=_d3;}}function Ti(t,e,i,s,r,n,h){var l=e%2?2:1;!function(t,e,i,s,r){for(var _n41=0;_n41<=s.length;_n41++){var _h26=_n41?s[_n41-1].to:e,_l20=_n41<s.length?s[_n41].from:i,_o15=_n41?256:r;for(var _e59=_h26,_i67=_o15,_s53=_o15;_e59<_l20;_e59++){var _r52=Ci(t.charCodeAt(_e59));512==_r52?_r52=_i67:8==_r52&&4==_s53&&(_r52=16),Ii[_e59]=4==_r52?2:_r52,7&_r52&&(_s53=_r52),_i67=_r52;}for(var _t58=_h26,_e60=_o15,_s54=_o15;_t58<_l20;_t58++){var _r53=Ii[_t58];if(128==_r53)_t58<_l20-1&&_e60==Ii[_t58+1]&&24&_e60?_r53=Ii[_t58]=_e60:Ii[_t58]=256;else if(64==_r53){var _r54=_t58+1;for(;_r54<_l20&&64==Ii[_r54];)_r54++;var _n42=_t58&&8==_e60||_r54<i&&8==Ii[_r54]?1==_s54?1:8:256;for(var _e61=_t58;_e61<_r54;_e61++)Ii[_e61]=_n42;_t58=_r54-1;}else 8==_r53&&1==_s54&&(Ii[_t58]=1);_e60=_r53,7&_r53&&(_s54=_r53);}}}(t,r,n,s,l),function(t,e,i,s,r){var n=1==r?2:1;for(var _h27=0,_l21=0,_o16=0;_h27<=s.length;_h27++){var _u12=_h27?s[_h27-1].to:e,_f9=_h27<s.length?s[_h27].from:i;for(var _e62,_i68,_s55,_h28=_u12;_h28<_f9;_h28++)if(_i68=Si[_e62=t.charCodeAt(_h28)]){if(_i68<0){for(var _t59=_l21-3;_t59>=0;_t59-=3)if(Ai[_t59+1]==-_i68){var _e63=Ai[_t59+2],_i69=2&_e63?r:4&_e63?1&_e63?n:r:0;_i69&&(Ii[_h28]=Ii[Ai[_t59]]=_i69),_l21=_t59;break;}}else{if(189==Ai.length)break;Ai[_l21++]=_h28,Ai[_l21++]=_e62,Ai[_l21++]=_o16;}}else if(2==(_s55=Ii[_h28])||1==_s55){var _t60=_s55==r;_o16=_t60?0:1;for(var _e64=_l21-3;_e64>=0;_e64-=3){var _i70=Ai[_e64+2];if(2&_i70)break;if(_t60)Ai[_e64+2]|=2;else{if(4&_i70)break;Ai[_e64+2]|=4;}}}}}(t,r,n,s,l),function(t,e,i,s){for(var _r55=0,_n43=s;_r55<=i.length;_r55++){var _h29=_r55?i[_r55-1].to:t,_l22=_r55<i.length?i[_r55].from:e;for(var _o17=_h29;_o17<_l22;){var _h30=Ii[_o17];if(256==_h30){var _h31=_o17+1;for(;;)if(_h31==_l22){if(_r55==i.length)break;_h31=i[_r55++].to,_l22=_r55<i.length?i[_r55].from:e;}else{if(256!=Ii[_h31])break;_h31++;}var _u13=1==_n43,_f10=_u13==(1==(_h31<e?Ii[_h31]:s))?_u13?1:2:s;for(var _e65=_h31,_s56=_r55,_n44=_s56?i[_s56-1].to:t;_e65>_o17;)_e65==_n44&&(_e65=i[--_s56].from,_n44=_s56?i[_s56-1].to:t),Ii[--_e65]=_f10;_o17=_h31;}else _n43=_h30,_o17++;}}}(r,n,s,l),Ri(t,r,n,e,i,s,h);}function Bi(t){return[new Oi(0,t,0)];}function Ni(t,e,i,s,r){var n;var h=s.head-t.from,l=Oi.find(e,h,null!==(n=s.bidiLevel)&&void 0!==n?n:-1,s.assoc),o=e[l],u=o.side(r,i);if(h==u){var _t61=l+=r?1:-1;if(_t61<0||_t61>=e.length)return null;o=e[l=_t61],h=o.side(!r,i),u=o.side(r,i);}var f=y(t.text,h,o.forward(r,i));(f<o.from||f>o.to)&&(f=u),Li=t.text.slice(Math.min(h,f),Math.max(h,f));var a=l==(r?e.length-1:0)?null:e[l+(r?1:-1)];return a&&f==u&&a.level+(r?0:1)<o.level?$.cursor(a.side(!r,i)+t.from,a.forward(r,i)?1:-1,a.level):$.cursor(f+t.from,o.forward(r,i)?-1:1,o.level);}function $i(t,e,i){for(var _s57=e;_s57<i;_s57++){var _e66=Ci(t.charCodeAt(_s57));if(1==_e66)return vi;if(2==_e66||4==_e66)return ki;}return vi;}function Qi(t,e,i){var s=t.facet(Hi);s.length?s[0](e):window.onerror?window.onerror(String(e),i,void 0,void 0,e):i?console.error(i+":",e):console.error(e);}function fs(t,e){var i=t.state.facet(us);if(!i.length)return i;var s=i.map(function(e){return e instanceof Function?e(t):e;}),r=[];return Bt.spans(s,e.from,e.to,{point:function point(){},span:function span(t,i,s,n){var h=t-e.from,l=i-e.from,o=r;for(var _t63=s.length-1;_t63>=0;_t63--,n--){var _i71=void 0,_r56=s[_t63].spec.bidiIsolate;if(null==_r56&&(_r56=$i(e.text,h,l)),n>0&&o.length&&(_i71=o[o.length-1]).to==h&&_i71.direction==_r56)_i71.to=l,o=_i71.inner;else{var _t64={from:h,to:l,direction:_r56,inner:[]};o.push(_t64),o=_t64.inner;}}}}),r;}function cs(t){var e=0,i=0,s=0,r=0;var _iterator42=_createForOfIteratorHelper(t.state.facet(as)),_step42;try{for(_iterator42.s();!(_step42=_iterator42.n()).done;){var _n45=_step42.value;var _h32=_n45(t);_h32&&(null!=_h32.left&&(e=Math.max(e,_h32.left)),null!=_h32.right&&(i=Math.max(i,_h32.right)),null!=_h32.top&&(s=Math.max(s,_h32.top)),null!=_h32.bottom&&(r=Math.max(r,_h32.bottom)));}}catch(err){_iterator42.e(err);}finally{_iterator42.f();}return{left:e,right:i,top:s,bottom:r};}function ws(t,e){var i=t.observer.selectionRange;if(!i.focusNode)return null;var s=Ae(i.focusNode,i.focusOffset),r=Ce(i.focusNode,i.focusOffset),n=s||r;if(r&&s&&r.node!=s.node){var _e85=Ee.get(r.node);if(!_e85||_e85 instanceof Je&&_e85.text!=r.node.nodeValue)n=r;else if(t.docView.lastCompositionAfterCursor){var _t84=Ee.get(s.node);!_t84||_t84 instanceof Je&&_t84.text!=s.node.nodeValue||(n=r);}}if(t.docView.lastCompositionAfterCursor=n!=s,!n)return null;var h=e-n.offset;return{from:h,to:h+n.node.nodeValue.length,node:n.node};}function vs(t,e){return e.left>t?e.left-t:Math.max(0,t-e.right);}function ks(t,e){return e.top>t?e.top-t:Math.max(0,t-e.bottom);}function ys(t,e){return t.top<e.bottom-1&&t.bottom>e.top+1;}function Ms(t,e){return e<t.top?{top:e,left:t.left,right:t.right,bottom:t.bottom}:t;}function xs(t,e){return e>t.bottom?{top:t.top,left:t.left,right:t.right,bottom:e}:t;}function Ss(t,e,i){var s,r,n,h,l,o,u,f,a=!1;for(var _c9=t.firstChild;_c9;_c9=_c9.nextSibling){var _t85=oe(_c9);for(var _d6=0;_d6<_t85.length;_d6++){var _p5=_t85[_d6];r&&ys(r,_p5)&&(_p5=Ms(xs(_p5,r.bottom),r.top));var _m3=vs(e,_p5),_g3=ks(i,_p5);if(0==_m3&&0==_g3)return 3==_c9.nodeType?As(_c9,e,i):Ss(_c9,e,i);if(!s||h>_g3||h==_g3&&n>_m3){s=_c9,r=_p5,n=_m3,h=_g3;var _l27=_g3?i<_p5.top?-1:1:_m3?e<_p5.left?-1:1:0;a=!_l27||(_l27>0?_d6<_t85.length-1:_d6>0);}0==_m3?i>_p5.bottom&&(!u||u.bottom<_p5.bottom)?(l=_c9,u=_p5):i<_p5.top&&(!f||f.top>_p5.top)&&(o=_c9,f=_p5):u&&ys(u,_p5)?u=xs(u,_p5.bottom):f&&ys(f,_p5)&&(f=Ms(f,_p5.top));}}if(u&&u.bottom>=i?(s=l,r=u):f&&f.top<=i&&(s=o,r=f),!s)return{node:t,offset:0};var c=Math.max(r.left,Math.min(r.right,e));return 3==s.nodeType?As(s,c,i):a&&"false"!=s.contentEditable?Ss(s,c,i):{node:t,offset:Array.prototype.indexOf.call(t.childNodes,s)+(e>=(r.left+r.right)/2?1:0)};}function As(t,e,i){var s=t.nodeValue.length,r=-1,n=1e9,h=0;for(var _l28=0;_l28<s;_l28++){var _s69=ye(t,_l28,_l28+1).getClientRects();for(var _o22=0;_o22<_s69.length;_o22++){var _u17=_s69[_o22];if(_u17.top==_u17.bottom)continue;h||(h=e-_u17.left);var _f14=(_u17.top>i?_u17.top-i:i-_u17.bottom)-1;if(_u17.left-1<=e&&_u17.right+1>=e&&_f14<n){var _i78=e>=(_u17.left+_u17.right)/2,_s70=_i78;if(Ue.chrome||Ue.gecko){ye(t,_l28).getBoundingClientRect().left==_u17.right&&(_s70=!_i78);}if(_f14<=0)return{node:t,offset:_l28+(_s70?1:0)};r=_l28+(_s70?1:0),n=_f14;}}}return{node:t,offset:r>-1?r:h>0?t.nodeValue.length:0};}function Cs(t,e,i){var s=arguments.length>3&&arguments[3]!==undefined?arguments[3]:-1;var r,n;var h,l=t.contentDOM.getBoundingClientRect(),o=l.top+t.viewState.paddingTop,u=t.viewState.docHeight,f=e.x,a=e.y,c=a-o;if(c<0)return 0;if(c>u)return t.state.doc.length;for(var _e86=t.viewState.heightOracle.textHeight/2,_r61=!1;h=t.elementAtHeight(c),h.type!=ni.Text;)for(;c=s>0?h.bottom+_e86:h.top-_e86,!(c>=0&&c<=u);){if(_r61)return i?null:0;_r61=!0,s=-s;}a=o+c;var d=h.from;if(d<t.viewport.from)return 0==t.viewport.from?0:i?null:Ds(t,l,h,f,a);if(d>t.viewport.to)return t.viewport.to==t.state.doc.length?t.state.doc.length:i?null:Ds(t,l,h,f,a);var p=t.dom.ownerDocument,m=t.root.elementFromPoint?t.root:p,g=m.elementFromPoint(f,a);g&&!t.contentDOM.contains(g)&&(g=null),g||(f=Math.max(l.left+1,Math.min(l.right-1,f)),g=m.elementFromPoint(f,a),g&&!t.contentDOM.contains(g)&&(g=null));var w,b=-1;if(g&&0!=(null===(r=t.docView.nearest(g))||void 0===r?void 0:r.isEditable)){if(p.caretPositionFromPoint){var _t87;var _t86=p.caretPositionFromPoint(f,a);_t86&&(_t87=_t86,w=_t87.offsetNode,b=_t87.offset,_t87);}else if(p.caretRangeFromPoint){var _e87=p.caretRangeFromPoint(f,a);_e87&&(w=_e87.startContainer,b=_e87.startOffset,(!t.contentDOM.contains(w)||Ue.safari&&function(t,e,i){var s;if(3!=t.nodeType||e!=(s=t.nodeValue.length))return!1;for(var _e88=t.nextSibling;_e88;_e88=_e88.nextSibling)if(1!=_e88.nodeType||"BR"!=_e88.nodeName)return!1;return ye(t,s-1,s).getBoundingClientRect().left>i;}(w,b,f)||Ue.chrome&&function(t,e,i){if(0!=e)return!1;for(var _e89=t;;){var _t88=_e89.parentNode;if(!_t88||1!=_t88.nodeType||_t88.firstChild!=_e89)return!1;if(_t88.classList.contains("cm-line"))break;_e89=_t88;}var s=1==t.nodeType?t.getBoundingClientRect():ye(t,0,Math.max(t.nodeValue.length,1)).getBoundingClientRect();return i-s.left>5;}(w,b,f))&&(w=void 0));}w&&(b=Math.min(de(w),b));}if(!w||!t.docView.dom.contains(w)){var _e90=ci.find(t.docView,d);if(!_e90)return c>h.top+h.height/2?h.to:h.from;var _Ss=Ss(_e90.dom,f,a);w=_Ss.node;b=_Ss.offset;}var v=t.docView.nearest(w);if(!v)return null;if(v.isWidget&&1==(null===(n=v.dom)||void 0===n?void 0:n.nodeType)){var _t89=v.dom.getBoundingClientRect();return e.y<_t89.top||e.y<=_t89.bottom&&e.x<=(_t89.left+_t89.right)/2?v.posAtStart:v.posAtEnd;}return v.localPosFromDOM(w,b)+v.posAtStart;}function Ds(t,e,i,s,r){var n=Math.round((s-e.left)*t.defaultCharacterWidth);if(t.lineWrapping&&i.height>1.5*t.defaultLineHeight){var _e91=t.viewState.heightOracle.textHeight;n+=Math.floor((r-i.top-.5*(t.defaultLineHeight-_e91))/_e91)*t.viewState.heightOracle.lineLength;}var h=t.state.sliceDoc(i.from,i.to);return i.from+Jt(h,n,t.state.tabSize);}function Os(t,e){var i=t.lineBlockAt(e);if(Array.isArray(i.type)){var _iterator50=_createForOfIteratorHelper(i.type),_step50;try{for(_iterator50.s();!(_step50=_iterator50.n()).done;){var _t90=_step50.value;if(_t90.to>e||_t90.to==e&&(_t90.to==i.to||_t90.type==ni.Text))return _t90;}}catch(err){_iterator50.e(err);}finally{_iterator50.f();}}return i;}function Es(t,e,i,s){var r=t.state.doc.lineAt(e.head),n=t.bidiSpans(r),h=t.textDirectionAt(r.from);for(var _l29=e,_o23=null;;){var _e92=Ni(r,n,h,_l29,i),_u18=Li;if(!_e92){if(r.number==(i?t.state.doc.lines:1))return _l29;_u18="\n",r=t.state.doc.line(r.number+(i?1:-1)),n=t.bidiSpans(r),_e92=t.visualLineSide(r,!i);}if(_o23){if(!_o23(_u18))return _l29;}else{if(!s)return _e92;_o23=s(_u18);}_l29=_e92;}}function Is(t,e,i){var _loop5=function _loop5(){var s=0;var _iterator51=_createForOfIteratorHelper(t),_step51;try{for(_iterator51.s();!(_step51=_iterator51.n()).done;){var _r62=_step51.value;_r62.between(e-1,e+1,function(t,r,n){if(e>t&&e<r){var _n53=s||i||(e-t<r-e?-1:1);e=_n53<0?t:r,s=_n53;}});}}catch(err){_iterator51.e(err);}finally{_iterator51.f();}if(!s)return{v:e};},_ret;for(;;){_ret=_loop5();if(_ret)return _ret.v;}}function Rs(t,e,i){var s=Is(t.state.facet(os).map(function(e){return e(t);}),i.from,e.head>i.from?-1:1);return s==i.from?i:$.cursor(s,s<i.from?1:-1);}function Ls(t,e,i){for(;;){if(!e||i<de(e))return!1;if(e==t)return!0;i=fe(e)+1,e=e.parentNode;}}function js(t,e){var i,s=e.newSel,r=t.state.selection.main,n=t.inputState.lastKeyTime>Date.now()-100?t.inputState.lastKeyCode:-1;if(e.bounds){var _e$bounds=e.bounds,_s74=_e$bounds.from,_h39=_e$bounds.to,_l31=r.from,_o24=null;(8===n||Ue.android&&e.text.length<_h39-_s74)&&(_l31=r.to,_o24="end");var _u19=function(t,e,i,s){var r=Math.min(t.length,e.length),n=0;for(;n<r&&t.charCodeAt(n)==e.charCodeAt(n);)n++;if(n==r&&t.length==e.length)return null;var h=t.length,l=e.length;for(;h>0&&l>0&&t.charCodeAt(h-1)==e.charCodeAt(l-1);)h--,l--;if("end"==s){i-=h+Math.max(0,n-Math.min(h,l))-n;}if(h<n&&t.length<e.length){n-=i<=n&&i>=h?n-i:0,l=n+(l-h),h=n;}else if(l<n){n-=i<=n&&i>=l?n-i:0,h=n+(h-l),l=n;}return{from:n,toA:h,toB:l};}(t.state.doc.sliceString(_s74,_h39,Ts),e.text,_l31-_s74,_o24);_u19&&(Ue.chrome&&13==n&&_u19.toB==_u19.from+2&&e.text.slice(_u19.from,_u19.toB)==Ts+Ts&&_u19.toB--,i={from:_s74+_u19.from,to:_s74+_u19.toA,insert:a.of(e.text.slice(_u19.from,_u19.toB).split(Ts))});}else s&&(!t.hasFocus&&t.state.facet(Zi)||s.main.eq(r))&&(s=null);if(!i&&!s)return!1;if(!i&&e.typeOver&&!r.empty&&s&&s.main.empty?i={from:r.from,to:r.to,insert:t.state.doc.slice(r.from,r.to)}:(Ue.mac||Ue.android)&&i&&i.from==i.to&&i.from==r.head-1&&/^\. ?$/.test(i.insert.toString())&&"off"==t.contentDOM.getAttribute("autocorrect")?(s&&2==i.insert.length&&(s=$.single(s.main.anchor-1,s.main.head-1)),i={from:i.from,to:i.to,insert:a.of([i.insert.toString().replace("."," ")])}):i&&i.from>=r.from&&i.to<=r.to&&(i.from!=r.from||i.to!=r.to)&&r.to-r.from-(i.to-i.from)<=4?i={from:r.from,to:r.to,insert:t.state.doc.slice(r.from,i.from).append(i.insert).append(t.state.doc.slice(i.to,r.to))}:Ue.chrome&&i&&i.from==i.to&&i.from==r.head&&"\n "==i.insert.toString()&&t.lineWrapping&&(s&&(s=$.single(s.main.anchor-1,s.main.head-1)),i={from:r.from,to:r.to,insert:a.of([" "])}),i)return Ps(t,i,s,n);if(s&&!s.main.eq(r)){var _e97=!1,_i85="select";return t.inputState.lastSelectionTime>Date.now()-50&&("select"==t.inputState.lastSelectionOrigin&&(_e97=!0),_i85=t.inputState.lastSelectionOrigin),t.dispatch({selection:s,scrollIntoView:_e97,userEvent:_i85}),!0;}return!1;}function Ps(t,e,i){var s=arguments.length>3&&arguments[3]!==undefined?arguments[3]:-1;if(Ue.ios&&t.inputState.flushIOSKey(e))return!0;var r=t.state.selection.main;if(Ue.android&&(e.to==r.to&&(e.from==r.from||e.from==r.from-1&&" "==t.state.sliceDoc(e.from,r.from))&&1==e.insert.length&&2==e.insert.lines&&Me(t.contentDOM,"Enter",13)||(e.from==r.from-1&&e.to==r.to&&0==e.insert.length||8==s&&e.insert.length<e.to-e.from&&e.to>r.head)&&Me(t.contentDOM,"Backspace",8)||e.from==r.from&&e.to==r.to+1&&0==e.insert.length&&Me(t.contentDOM,"Delete",46)))return!0;var n,h=e.insert.toString();t.inputState.composing>=0&&t.inputState.composing++;var l=function l(){return n||(n=function(t,e,i){var s,r=t.state,n=r.selection.main;if(e.from>=n.from&&e.to<=n.to&&e.to-e.from>=(n.to-n.from)/3&&(!i||i.main.empty&&i.main.from==e.from+e.insert.length)&&t.inputState.composing<0){var _i86=n.from<e.from?r.sliceDoc(n.from,e.from):"",_h40=n.to>e.to?r.sliceDoc(e.to,n.to):"";s=r.replaceSelection(t.state.toText(_i86+e.insert.sliceString(0,void 0,t.state.lineBreak)+_h40));}else{var _h41=r.changes(e),_l32=i&&i.main.to<=_h41.newLength?i.main:void 0;if(r.selection.ranges.length>1&&t.inputState.composing>=0&&e.to<=n.to&&e.to>=n.to-10){var _o25,_u20=t.state.sliceDoc(e.from,e.to),_f15=i&&ws(t,i.main.head);if(_f15){var _t93=e.insert.length-(e.to-e.from);_o25={from:_f15.from,to:_f15.to-_t93};}else _o25=t.state.doc.lineAt(n.head);var _a10=n.to-e.to,_c10=n.to-n.from;s=r.changeByRange(function(i){if(i.from==n.from&&i.to==n.to)return{changes:_h41,range:_l32||i.map(_h41)};var s=i.to-_a10,f=s-_u20.length;if(i.to-i.from!=_c10||t.state.sliceDoc(f,s)!=_u20||i.to>=_o25.from&&i.from<=_o25.to)return{range:i};var d=r.changes({from:f,to:s,insert:e.insert}),p=i.to-n.to;return{changes:d,range:_l32?$.range(Math.max(0,_l32.anchor+p),Math.max(0,_l32.head+p)):i.map(d)};});}else s={changes:_h41,selection:_l32&&r.selection.replaceRange(_l32)};}var h="input.type";(t.composing||t.inputState.compositionPendingChange&&t.inputState.compositionEndedAt>Date.now()-50)&&(t.inputState.compositionPendingChange=!1,h+=".compose",t.inputState.compositionFirstChange&&(h+=".start",t.inputState.compositionFirstChange=!1));return r.update(s,{userEvent:h,scrollIntoView:!0});}(t,e,i));};return t.state.facet(Wi).some(function(i){return i(t,e.from,e.to,h,l);})||t.dispatch(l()),!0;}function Hs(t,e){return function(i,s){try{return e.call(t,s,i);}catch(t){Qi(i.state,t);}};}function Fs(t){var e=Object.create(null);function i(t){return e[t]||(e[t]={observers:[],handlers:[]});}var _iterator58=_createForOfIteratorHelper(t),_step58;try{for(_iterator58.s();!(_step58=_iterator58.n()).done;){var _e98=_step58.value;var _t100=_e98.spec;if(_t100&&_t100.domEventHandlers)for(var _s76 in _t100.domEventHandlers){var _r67=_t100.domEventHandlers[_s76];_r67&&i(_s76).handlers.push(Hs(_e98.value,_r67));}if(_t100&&_t100.domEventObservers)for(var _s77 in _t100.domEventObservers){var _r68=_t100.domEventObservers[_s77];_r68&&i(_s77).observers.push(Hs(_e98.value,_r68));}}}catch(err){_iterator58.e(err);}finally{_iterator58.f();}for(var _t98 in Gs)i(_t98).handlers.push(Gs[_t98]);for(var _t99 in Ks)i(_t99).observers.push(Ks[_t99]);return e;}function Us(t){return .7*Math.max(0,t)+8;}function Xs(t,e,i){var _iterator59=_createForOfIteratorHelper(t.facet(e)),_step59;try{for(_iterator59.s();!(_step59=_iterator59.n()).done;){var _s79=_step59.value;i=_s79(i,t);}}catch(err){_iterator59.e(err);}finally{_iterator59.f();}return i;}function Ys(t,e){e=Xs(t.state,qi,e);var i,s=t.state,r=1,n=s.toText(e),h=n.lines==s.selection.ranges.length;if(null!=or&&s.selection.ranges.every(function(t){return t.empty;})&&or==n.toString()){var _t104=-1;i=s.changeByRange(function(i){var l=s.doc.lineAt(i.from);if(l.from==_t104)return{range:i};_t104=l.from;var o=s.toText((h?n.line(r++).text:e)+s.lineBreak);return{changes:{from:l.from,insert:o},range:$.cursor(i.from+o.length)};});}else i=h?s.changeByRange(function(t){var e=n.line(r++);return{changes:{from:t.from,to:t.to,insert:e.text},range:$.cursor(t.from+e.length)};}):s.replaceSelection(n);t.dispatch(i,{userEvent:"input.paste",scrollIntoView:!0});}function Qs(t,e,i,s){if(1==s)return $.cursor(e,i);if(2==s)return function(t,e){var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:1;var s=t.charCategorizer(e),r=t.doc.lineAt(e),n=e-r.from;if(0==r.length)return $.cursor(e);0==n?i=1:n==r.length&&(i=-1);var h=n,l=n;i<0?h=y(r.text,n,!1):l=y(r.text,n);var o=s(r.text.slice(h,l));for(;h>0;){var _t105=y(r.text,h,!1);if(s(r.text.slice(_t105,h))!=o)break;h=_t105;}for(;l<r.length;){var _t106=y(r.text,l);if(s(r.text.slice(l,_t106))!=o)break;l=_t106;}return $.range(h+r.from,l+r.from);}(t.state,e,i);{var _i90=ci.find(t.docView,e),_s80=t.state.doc.lineAt(_i90?_i90.posAtEnd:e),_r71=_i90?_i90.posAtStart:_s80.from,_n58=_i90?_i90.posAtEnd:_s80.to;return _n58<t.state.doc.length&&_n58==_s80.to&&_n58++,$.range(_r71,_n58);}}function tr(t,e,i,s){var r=ci.find(t.docView,e);if(!r)return 1;var n=e-r.posAtStart;if(0==n)return 1;if(n==r.length)return-1;var h=r.coordsAt(n,-1);if(h&&Zs(i,s,h))return-1;var l=r.coordsAt(n,1);return l&&Zs(i,s,l)?1:h&&h.bottom>=s?-1:1;}function er(t,e){var i=t.posAtCoords({x:e.clientX,y:e.clientY},!1);return{pos:i,bias:tr(t,i,e.clientX,e.clientY)};}function hr(t){if(!ir)return t.detail;var e=sr,i=nr;return sr=t,nr=Date.now(),rr=!e||i>Date.now()-400&&Math.abs(e.clientX-t.clientX)<2&&Math.abs(e.clientY-t.clientY)<2?(rr+1)%3:1;}function lr(t,e,i,s){if(!(i=Xs(t.state,qi,i)))return;var r=t.posAtCoords({x:e.clientX,y:e.clientY},!1),n=t.inputState.draggedContent,h=s&&n&&function(t,e){var i=t.state.facet(Pi);return i.length?i[0](e):Ue.mac?!e.altKey:!e.ctrlKey;}(t,e)?{from:n.from,to:n.to}:null,l={from:r,insert:i},o=t.state.changes(h?[h,l]:l);t.focus(),t.dispatch({changes:o,selection:{anchor:o.mapPos(r,-1),head:o.mapPos(r,1)},userEvent:h?"move.drop":"input.drop"}),t.inputState.draggedContent=null;}function fr(t,e){var i=[];var _iterator63=_createForOfIteratorHelper(t.facet(Vi)),_step63;try{for(_iterator63.s();!(_step63=_iterator63.n()).done;){var _s88=_step63.value;var _r77=_s88(t,e);_r77&&i.push(_r77);}}catch(err){_iterator63.e(err);}finally{_iterator63.f();}return i?t.update({effects:i,annotations:ur.of(!0)}):null;}function ar(t){setTimeout(function(){var e=t.hasFocus;if(e!=t.inputState.notifiedFocused){var _i93=fr(t.state,e);_i93?t.dispatch(_i93):t.update([]);}},10);}function mr(){pr=!1;}function Mr(t,e){return t==e?t:(t.constructor!=e.constructor&&(pr=!0),e);}function Dr(t,e){var i,s;null==t[e]&&(i=t[e-1])instanceof Ar&&(s=t[e+1])instanceof Ar&&t.splice(e-1,3,new Ar(i.length+1+s.length));}function Ir(t,e){var i=t.getBoundingClientRect(),s=t.ownerDocument,r=s.defaultView||window,n=Math.max(0,i.left),h=Math.min(r.innerWidth,i.right),l=Math.max(0,i.top),o=Math.min(r.innerHeight,i.bottom);for(var _e112=t.parentNode;_e112&&_e112!=s.body;)if(1==_e112.nodeType){var _i100=_e112,_s95=window.getComputedStyle(_i100);if((_i100.scrollHeight>_i100.clientHeight||_i100.scrollWidth>_i100.clientWidth)&&"visible"!=_s95.overflow){var _s96=_i100.getBoundingClientRect();n=Math.max(n,_s96.left),h=Math.min(h,_s96.right),l=Math.max(l,_s96.top),o=Math.min(_e112==t.parentNode?r.innerHeight:o,_s96.bottom);}_e112="absolute"==_s95.position||"fixed"==_s95.position?_i100.offsetParent:_i100.parentNode;}else{if(11!=_e112.nodeType)break;_e112=_e112.host;}return{left:n-i.left,right:Math.max(n,h)-i.left,top:l-(i.top+e),bottom:Math.max(l,o)-(i.top+e)};}function Rr(t,e){var i=t.getBoundingClientRect();return{left:0,right:i.right-i.left,top:e,bottom:i.bottom-(i.top+e)};}function $r(_ref10,i){var t=_ref10.total,e=_ref10.ranges;if(i<=0)return e[0].from;if(i>=1)return e[e.length-1].to;var s=Math.floor(t*i);for(var _t124=0;;_t124++){var _e$_t=e[_t124],_i113=_e$_t.from,_r86=_e$_t.to,_n70=_r86-_i113;if(s<=_n70)return _i113+s;s-=_n70;}}function jr(t,e){var i=0;var _iterator71=_createForOfIteratorHelper(t.ranges),_step71;try{for(_iterator71.s();!(_step71=_iterator71.n()).done;){var _step71$value=_step71.value,_s100=_step71$value.from,_r87=_step71$value.to;if(e<=_r87){i+=e-_s100;break;}i+=_r87-_s100;}}catch(err){_iterator71.e(err);}finally{_iterator71.f();}return i/t.total;}function Hr(t,e){if(1==e.scale)return t;var i=e.toDOM(t.top),s=e.toDOM(t.bottom);return new br(t.from,t.length,i,s-i,Array.isArray(t._content)?t._content.map(function(t){return Hr(t,e);}):t._content);}function Gr(t,e,i){return new Xt(e,{finish:function finish(e){return /&/.test(e)?e.replace(/&\w*/,function(e){if("&"==e)return t;if(!i||!i[e])throw new RangeError("Unsupported selector: ".concat(e));return i[e];}):t+" "+e;}});}function Qr(t,e,i){for(;e;){var _s104=Ee.get(e);if(_s104&&_s104.parent==t)return _s104;var _r91=e.parentNode;e=_r91!=t.dom?_r91:i>0?e.nextSibling:e.previousSibling;}return null;}function Zr(t,e){var _ref12;var i=e.startContainer,s=e.startOffset,r=e.endContainer,n=e.endOffset,h=t.docView.domAtPos(t.state.selection.main.anchor);return ue(h.node,h.offset,r,n)&&(_ref12=[r,n,i,s],i=_ref12[0],s=_ref12[1],r=_ref12[2],n=_ref12[3],_ref12),{anchorNode:i,anchorOffset:s,focusNode:r,focusOffset:n};}function hn(t,e,i){for(var _s111=t.state.facet(e),_r96=_s111.length-1;_r96>=0;_r96--){var _e135=_s111[_r96],_n74="function"==typeof _e135?_e135(t):_e135;_n74&&Ze(_n74,i);}return i;}function on(t,e,i){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),!1!==i&&e.shiftKey&&(t="Shift-"+t),t;}function cn(t){var e=t.facet(fn),i=an.get(e);return i||an.set(e,i=function(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:ln;var i=Object.create(null),s=Object.create(null),r=function r(t,e){var i=s[t];if(null==i)s[t]=e;else if(i!=e)throw new Error("Key binding "+t+" is used both as a regular binding and as a multi-stroke prefix");},n=function n(t,s,_n75,h,l){var o,u;var f=i[t]||(i[t]=Object.create(null)),a=s.split(/ (?!$)/).map(function(t){return function(t,e){var i=t.split(/-(?!$)/);var s,r,n,h,l=i[i.length-1];"Space"==l&&(l=" ");for(var _t154=0;_t154<i.length-1;++_t154){var _l41=i[_t154];if(/^(cmd|meta|m)$/i.test(_l41))h=!0;else if(/^a(lt)?$/i.test(_l41))s=!0;else if(/^(c|ctrl|control)$/i.test(_l41))r=!0;else if(/^s(hift)?$/i.test(_l41))n=!0;else{if(!/^mod$/i.test(_l41))throw new Error("Unrecognized modifier name: "+_l41);"mac"==e?h=!0:r=!0;}}return s&&(l="Alt-"+l),r&&(l="Ctrl-"+l),h&&(l="Meta-"+l),n&&(l="Shift-"+l),l;}(t,e);});var _loop8=function _loop8(){var i=a.slice(0,_e136).join(" ");r(i,!0),f[i]||(f[i]={preventDefault:!0,stopPropagation:!1,run:[function(e){var s=dn={view:e,prefix:i,scope:t};return setTimeout(function(){dn==s&&(dn=null);},pn),!0;}]});};for(var _e136=1;_e136<a.length;_e136++){_loop8();}var c=a.join(" ");r(c,!1);var d=f[c]||(f[c]={preventDefault:!1,stopPropagation:!1,run:(null===(u=null===(o=f._any)||void 0===o?void 0:o.run)||void 0===u?void 0:u.slice())||[]});_n75&&d.run.push(_n75),h&&(d.preventDefault=!0),l&&(d.stopPropagation=!0);};var _iterator97=_createForOfIteratorHelper(t),_step97;try{for(_iterator97.s();!(_step97=_iterator97.n()).done;){var _s112=_step97.value;var _t155=_s112.scope?_s112.scope.split(" "):["editor"];if(_s112.any){var _iterator98=_createForOfIteratorHelper(_t155),_step98;try{var _loop9=function _loop9(){var e=_step98.value;var t=i[e]||(i[e]=Object.create(null));t._any||(t._any={preventDefault:!1,stopPropagation:!1,run:[]});var r=_s112.any;for(var _e137 in t)t[_e137].run.push(function(t){return r(t,mn);});};for(_iterator98.s();!(_step98=_iterator98.n()).done;){_loop9();}}catch(err){_iterator98.e(err);}finally{_iterator98.f();}}var _r97=_s112[e]||_s112.key;if(_r97){var _iterator99=_createForOfIteratorHelper(_t155),_step99;try{for(_iterator99.s();!(_step99=_iterator99.n()).done;){var _e138=_step99.value;n(_e138,_r97,_s112.run,_s112.preventDefault,_s112.stopPropagation),_s112.shift&&n(_e138,"Shift-"+_r97,_s112.shift,_s112.preventDefault,_s112.stopPropagation);}}catch(err){_iterator99.e(err);}finally{_iterator99.f();}}}}catch(err){_iterator97.e(err);}finally{_iterator97.f();}return i;}(e.reduce(function(t,e){return t.concat(e);},[]))),i;}function gn(t,e,i,s){mn=e;var r=function(t){var e=!(ee&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||ie&&t.shiftKey&&t.key&&1==t.key.length||"Unidentified"==t.key)&&t.key||(t.shiftKey?te:Zt)[t.keyCode]||t.key||"Unidentified";return"Esc"==e&&(e="Escape"),"Del"==e&&(e="Delete"),"Left"==e&&(e="ArrowLeft"),"Up"==e&&(e="ArrowUp"),"Right"==e&&(e="ArrowRight"),"Down"==e&&(e="ArrowDown"),e;}(e),n=S(M(r,0))==r.length&&" "!=r,h="",l=!1,o=!1,u=!1;dn&&dn.view==i&&dn.scope==s&&(h=dn.prefix+" ",qs.indexOf(e.keyCode)<0&&(o=!0,dn=null));var f,a,c=new Set(),d=function d(t){if(t){var _iterator100=_createForOfIteratorHelper(t.run),_step100;try{for(_iterator100.s();!(_step100=_iterator100.n()).done;){var _e139=_step100.value;if(!c.has(_e139)&&(c.add(_e139),_e139(i)))return t.stopPropagation&&(u=!0),!0;}}catch(err){_iterator100.e(err);}finally{_iterator100.f();}t.preventDefault&&(t.stopPropagation&&(u=!0),o=!0);}return!1;},p=t[s];return p&&(d(p[h+on(r,e,!n)])?l=!0:n&&(e.altKey||e.metaKey||e.ctrlKey)&&!(Ue.windows&&e.ctrlKey&&e.altKey)&&(f=Zt[e.keyCode])&&f!=r?(d(p[h+on(f,e,!0)])||e.shiftKey&&(a=te[e.keyCode])!=r&&a!=f&&d(p[h+on(a,e,!1)]))&&(l=!0):n&&e.shiftKey&&d(p[h+on(r,e,!0)])&&(l=!0),!l&&d(p._any)&&(l=!0)),o&&(l=!0),l&&u&&e.stopPropagation(),mn=null,l;}function bn(t){var e=t.scrollDOM.getBoundingClientRect();return{left:(t.textDirection==bi.LTR?e.left:e.right-t.scrollDOM.clientWidth*t.scaleX)-t.scrollDOM.scrollLeft*t.scaleX,top:e.top-t.scrollDOM.scrollTop*t.scaleY};}function vn(t,e,i,s){var r=t.coordsAtPos(e,2*i);if(!r)return s;var n=t.dom.getBoundingClientRect(),h=(r.top+r.bottom)/2,l=t.posAtCoords({x:n.left+1,y:h}),o=t.posAtCoords({x:n.right-1,y:h});return null==l||null==o?s:{from:Math.max(s.from,Math.min(l,o)),to:Math.min(s.to,Math.max(l,o))};}function Mn(t){return[is.define(function(e){return new kn(e,t);}),yn.of(t)];}function An(t){return t.startState.facet(Sn)!=t.state.facet(Sn);}function Dn(t,e){e.style.animationDuration=t.facet(Sn).cursorBlinkRate+"ms";}function Ln(t,e,i,s,r){e.lastIndex=0;for(var _n78,_h50=t.iterRange(i,s),_l43=i;!_h50.next().done;_l43+=_h50.value.length)if(!_h50.lineBreak)for(;_n78=e.exec(_h50.value);)r(_l43+_n78.index,_n78);}function Gn(t){return is.fromClass(/*#__PURE__*/function(){function _class3(e){_classCallCheck(this,_class3);this.view=e,this.placeholder=t?hi.set([hi.widget({widget:new Jn(t),side:1}).range(0)]):hi.none;}return _createClass(_class3,[{key:"decorations",get:function get(){return this.view.state.doc.length?hi.none:this.placeholder;}}]);}(),{decorations:function decorations(t){return t.decorations;}});}function _n(t,e){var i=t.posAtCoords({x:e.clientX,y:e.clientY},!1),s=t.state.doc.lineAt(i),r=i-s.from,n=r>Kn?-1:r==s.length?function(t,e){var i=t.coordsAtPos(t.viewport.from);return i?Math.round(Math.abs((i.left-e)/t.defaultCharacterWidth)):-1;}(t,e.clientX):Ut(s.text,t.state.tabSize,i-s.from);return{line:s.number,col:n,off:r};}function Xn(t,e){var i=_n(t,e),s=t.state.selection;return i?{update:function update(t){if(t.docChanged){var _e146=t.changes.mapPos(t.startState.doc.line(i.line).from),_r106=t.state.doc.lineAt(_e146);i={line:_r106.number,col:i.col,off:Math.min(i.off,_r106.length)},s=s.map(t.changes);}},get:function get(e,r,n){var h=_n(t,e);if(!h)return s;var l=function(t,e,i){var s=Math.min(e.line,i.line),r=Math.max(e.line,i.line),n=[];if(e.off>Kn||i.off>Kn||e.col<0||i.col<0){var _h51=Math.min(e.off,i.off),_l45=Math.max(e.off,i.off);for(var _e147=s;_e147<=r;_e147++){var _i128=t.doc.line(_e147);_i128.length<=_l45&&n.push($.range(_i128.from+_h51,_i128.to+_l45));}}else{var _h52=Math.min(e.col,i.col),_l46=Math.max(e.col,i.col);for(var _e148=s;_e148<=r;_e148++){var _i129=t.doc.line(_e148),_s121=Jt(_i129.text,_h52,t.tabSize,!0);if(_s121<0)n.push($.cursor(_i129.to));else{var _e149=Jt(_i129.text,_l46,t.tabSize);n.push($.range(_i129.from+_s121,_i129.from+_e149));}}}return n;}(t.state,i,h);return l.length?n?$.create(l.concat(s.ranges)):$.create(l):s;}}:null;}function eh(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return sh.of(t);}function ih(t){var e=t.win;return{top:0,left:0,bottom:e.innerHeight,right:e.innerWidth};}function hh(t,e){var i=parseInt(t.style.left,10);(isNaN(i)||Math.abs(e-i)>1)&&(t.style.left=e+"px");}function mh(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var i=mt.define(),s=J.define({create:function create(){return[];},update:function update(t,s){if(t.length&&(e.hideOnChange&&(s.docChanged||s.selection)?t=[]:e.hideOn&&(t=t.filter(function(t){return!e.hideOn(s,t);})),s.docChanged)){var _e160=[];var _iterator123=_createForOfIteratorHelper(t),_step123;try{for(_iterator123.s();!(_step123=_iterator123.n()).done;){var _i134=_step123.value;var _t170=s.changes.mapPos(_i134.pos,-1,C.TrackDel);if(null!=_t170){var _r108=Object.assign(Object.create(null),_i134);_r108.pos=_t170,null!=_r108.end&&(_r108.end=s.changes.mapPos(_r108.end)),_e160.push(_r108);}}}catch(err){_iterator123.e(err);}finally{_iterator123.f();}t=_e160;}var _iterator124=_createForOfIteratorHelper(s.effects),_step124;try{for(_iterator124.s();!(_step124=_iterator124.n()).done;){var _e161=_step124.value;_e161.is(i)&&(t=_e161.value),_e161.is(wh)&&(t=[]);}}catch(err){_iterator124.e(err);}finally{_iterator124.f();}return t;},provide:function provide(t){return fh.from(t);}});return{active:s,extension:[s,is.define(function(r){return new dh(r,t,s,i,e.hoverTime||300);}),ch]};}function gh(t,e){var i=t.plugin(nh);if(!i)return null;var s=i.manager.tooltips.indexOf(e);return s<0?null:i.manager.tooltipViews[s];}function vh(t,e){var i=t.plugin(kh),s=i?i.specs.indexOf(e):-1;return s>-1?i.panels[s]:null;}function Mh(t){var e=t.nextSibling;return t.remove(),e;}function Eh(t){return[Rh(),Oh.of(Object.assign(Object.assign({},Dh),t))];}function Rh(t){var e=[Th];return t&&!1===t.fixed&&e.push(Ih.of(!0)),e;}function Bh(t){return Array.isArray(t)?t:[t];}function Lh(t,e,i){for(;t.value&&t.from<=i;)t.from==i&&e.push(t.value),t.next();}function Wh(t,e){return t.state.facet(Hh).formatNumber(e,t.state);}function qh(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return[Hh.of(t),Rh(),Vh];}function Uh(t){var e=9;for(;e<t;)e=10*e+9;return e;}function ol(t,e,i,s){switch(t){case-2:return i<e;case-1:return s>=e&&i<e;case 0:return i<e&&s>e;case 1:return i<=e&&s>e;case 2:return s>e;case 4:return!0;}}function ul(t,e,i,s){for(var r;t.from==t.to||(i<1?t.from>=e:t.from>e)||(i>-1?t.to<=e:t.to<e);){var _e188=!s&&t instanceof al&&t.index<0?null:t.parent;if(!_e188)return t;t=_e188;}var n=s?0:rl.IgnoreOverlays;if(s)for(var _s137=t,_h60=_s137.parent;_h60;_s137=_h60,_h60=_s137.parent)_s137 instanceof al&&_s137.index<0&&(null===(r=_h60.enter(e,i,n))||void 0===r?void 0:r.from)!=_s137.from&&(t=_h60);for(;;){var _s138=t.enter(e,i,n);if(!_s138)return t;t=_s138;}}function cl(t,e,i,s){var r=t.cursor(),n=[];if(!r.firstChild())return n;if(null!=i)for(var _t204=!1;!_t204;)if(_t204=r.type.is(i),!r.nextSibling())return n;for(;;){if(null!=s&&r.type.is(s))return n;if(r.type.is(e)&&n.push(r.node),!r.nextSibling())return null==s?n:[];}}function dl(t,e){var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:e.length-1;for(var _s139=t;i>=0;_s139=_s139.parent){if(!_s139)return!1;if(!_s139.type.isAnonymous){if(e[i]&&e[i]!=_s139.name)return!1;i--;}}return!0;}function gl(t){if(!t.length)return null;var e=0,i=t[0];for(var _s140=1;_s140<t.length;_s140++){var _r121=t[_s140];(_r121.from>i.from||_r121.to<i.to)&&(i=_r121,e=_s140);}var s=i instanceof al&&i.index<0?null:i.parent,r=t.slice();return s?r[e]=s:r.splice(e,1),new wl(r,i);}function vl(t){return t.children.some(function(t){return t instanceof ll||!t.type.isAnonymous||vl(t);});}function yl(t,e){if(!t.isAnonymous||e instanceof ll||e.type!=t)return 1;var i=kl.get(e);if(null==i){i=1;var _iterator156=_createForOfIteratorHelper(e.children),_step156;try{for(_iterator156.s();!(_step156=_iterator156.n()).done;){var _s145=_step156.value;if(_s145.type!=t||!(_s145 instanceof nl)){i=1;break;}i+=yl(t,_s145);}}catch(err){_iterator156.e(err);}finally{_iterator156.f();}kl.set(e,i);}return i;}function Ml(t,e,i,s,r,n,h,l,o){var u=0;for(var _i155=s;_i155<r;_i155++)u+=yl(t,e[_i155]);var f=Math.ceil(1.5*u/8),a=[],c=[];return function e(i,s,r,h,l){for(var _u28=r;_u28<h;){var _r125=_u28,_d10=s[_u28],_p7=yl(t,i[_u28]);for(_u28++;_u28<h;_u28++){var _e190=yl(t,i[_u28]);if(_p7+_e190>=f)break;_p7+=_e190;}if(_u28==_r125+1){if(_p7>f){var _t210=i[_r125];e(_t210.children,_t210.positions,0,_t210.children.length,s[_r125]+l);continue;}a.push(i[_r125]);}else{var _e191=s[_u28-1]+i[_u28-1].length-_d10;a.push(Ml(t,i,s,_r125,_u28,_d10,_e191,null,o));}c.push(_d10+l-n);}}(e,i,s,r,0),(l||o)(a,c,h);}function Dl(t){return function(e,i,s,r){return new Tl(e,t,i,s,r);};}function El(t){if(!t.length||t.some(function(t){return t.from>=t.to;}))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(t));}function Bl(t,e,i){var _iterator160=_createForOfIteratorHelper(t),_step160;try{for(_iterator160.s();!(_step160=_iterator160.n()).done;){var _s146=_step160.value;if(_s146.from>=i)break;if(_s146.to>e)return _s146.from<=e&&_s146.to>=i?2:1;}}catch(err){_iterator160.e(err);}finally{_iterator160.f();}return 0;}function Ll(t,e,i,s,r,n){if(e<i){var _h66=t.buffer[e+1];s.push(t.slice(e,i,_h66)),r.push(_h66-n);}}function Nl(t){var e=t.node,i=[],s=e.context.buffer;do{i.push(t.index),t.parent();}while(!t.tree);var r=t.tree,n=r.children.indexOf(s),h=r.children[n],l=h.buffer,o=[n];r.children[n]=function t(s,r,n,u,f,a){var c=i[a],d=[],p=[];Ll(h,s,c,d,p,u);var m=l[c+1],g=l[c+2];o.push(d.length);var w=a?t(c+4,l[c+3],h.set.types[l[c]],m,g-m,a-1):e.toTree();return d.push(w),p.push(m-u),Ll(h,l[c+3],r,d,p,u),new nl(n,d,p,f);}(0,l.length,tl.none,0,h.length,i.length-1);for(var _i159=0,_o38=o;_i159<_o38.length;_i159++){var _e195=_o38[_i159];var _i160=t.tree.children[_e195],_s147=t.tree.positions[_e195];t["yield"](new al(_i160,_s147+t.from,_e195,t._tree));}}function Pl(t,e){var i=null,s=e;for(var _r128=1,_n95=0;_r128<t.length;_r128++){var _h67=t[_r128-1].to,_l58=t[_r128].from;for(;_n95<s.length;_n95++){var _t221=s[_n95];if(_t221.from>=_l58)break;_t221.to<=_h67||(i||(s=i=e.slice()),_t221.from<_h67?(i[_n95]=new Xh(_t221.from,_h67),_t221.to>_l58&&i.splice(_n95+1,0,new Xh(_l58,_t221.to))):_t221.to>_l58?i[_n95--]=new Xh(_l58,_t221.to):i.splice(_n95--,1));}}return s;}function zl(t,e,i,s){var r=0,n=0,h=!1,l=!1,o=-1e9,u=[];for(;;){var _f23=r==t.length?1e9:h?t[r].to:t[r].from,_a17=n==e.length?1e9:l?e[n].to:e[n].from;if(h!=l){var _t222=Math.max(o,i),_e199=Math.min(_f23,_a17,s);_t222<_e199&&u.push(new Xh(_t222,_e199));}if(o=Math.min(_f23,_a17),1e9==o)break;_f23==o&&(h?(h=!1,r++):h=!0),_a17==o&&(l?(l=!1,n++):l=!0);}return u;}function Hl(t,e){var i=[];var _iterator161=_createForOfIteratorHelper(t),_step161;try{var _loop14=function _loop14(){var _step161$value=_step161.value,s=_step161$value.pos,r=_step161$value.mount,n=_step161$value.frag;var t=s+(r.overlay?r.overlay[0].from:0),h=t+r.tree.length,l=Math.max(n.from,t),o=Math.min(n.to,h);if(r.overlay){var _h68=zl(e,r.overlay.map(function(t){return new Xh(t.from+s,t.to+s);}),l,o);for(var _e200=0,_s148=l;;_e200++){var _l59=_e200==_h68.length,_u30=_l59?o:_h68[_e200].from;if(_u30>_s148&&i.push(new Sl(_s148,_u30,r.tree,-t,n.from>=_s148||n.openStart,n.to<=_u30||n.openEnd)),_l59)break;_s148=_h68[_e200].to;}}else i.push(new Sl(l,o,r.tree,-t,n.from>=t||n.openStart,n.to<=h||n.openEnd));};for(_iterator161.s();!(_step161=_iterator161.n()).done;){_loop14();}}catch(err){_iterator161.e(err);}finally{_iterator161.f();}return i;}function Ul(t){var e=Object.create(null);for(var _i164 in t){var _s150=t[_i164];Array.isArray(_s150)||(_s150=[_s150]);var _iterator167=_createForOfIteratorHelper(_i164.split(" ")),_step167;try{for(_iterator167.s();!(_step167=_iterator167.n()).done;){var _t226=_step167.value;if(_t226){var _i165=[],_r130=2,_n96=_t226;for(var _e203=0;;){if("..."==_n96&&_e203>0&&_e203+3==_t226.length){_r130=1;break;}var _s151=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(_n96);if(!_s151)throw new RangeError("Invalid path: "+_t226);if(_i165.push("*"==_s151[0]?"":'"'==_s151[0][0]?JSON.parse(_s151[0]):_s151[0]),_e203+=_s151[0].length,_e203==_t226.length)break;var _h69=_t226[_e203++];if(_e203==_t226.length&&"!"==_h69){_r130=0;break;}if("/"!=_h69)throw new RangeError("Invalid path: "+_t226);_n96=_t226.slice(_e203);}var _h70=_i165.length-1,_l60=_i165[_h70];if(!_l60)throw new RangeError("Invalid path: "+_t226);var _o39=new Gl(_s150,_r130,_h70>0?_i165.slice(0,_h70):null);e[_l60]=_o39.sort(e[_l60]);}}}catch(err){_iterator167.e(err);}finally{_iterator167.f();}}return Jl.add(e);}function Kl(t,e){var i=Object.create(null);var _iterator168=_createForOfIteratorHelper(t),_step168;try{for(_iterator168.s();!(_step168=_iterator168.n()).done;){var _e204=_step168.value;if(Array.isArray(_e204.tag)){var _iterator171=_createForOfIteratorHelper(_e204.tag),_step171;try{for(_iterator171.s();!(_step171=_iterator171.n()).done;){var _t228=_step171.value;i[_t228.id]=_e204["class"];}}catch(err){_iterator171.e(err);}finally{_iterator171.f();}}else i[_e204.tag.id]=_e204["class"];}}catch(err){_iterator168.e(err);}finally{_iterator168.f();}var _ref17=e||{},s=_ref17.scope,_ref17$all=_ref17.all,r=_ref17$all===void 0?null:_ref17$all;return{style:function style(t){var e=r;var _iterator169=_createForOfIteratorHelper(t),_step169;try{for(_iterator169.s();!(_step169=_iterator169.n()).done;){var _s152=_step169.value;var _iterator170=_createForOfIteratorHelper(_s152.set),_step170;try{for(_iterator170.s();!(_step170=_iterator170.n()).done;){var _t227=_step170.value;var _s153=i[_t227.id];if(_s153){e=e?e+" "+_s153:_s153;break;}}}catch(err){_iterator170.e(err);}finally{_iterator170.f();}}}catch(err){_iterator169.e(err);}finally{_iterator169.f();}return e;},scope:s};}function _l(t,e,i){var s=arguments.length>3&&arguments[3]!==undefined?arguments[3]:0;var r=arguments.length>4&&arguments[4]!==undefined?arguments[4]:t.length;var n=new Xl(s,Array.isArray(e)?e:[e],i);n.highlightRange(t.cursor(),s,r,"",n.highlighters),n.flush(r);}function go(t){return z.define({combine:t?function(e){return e.concat(t);}:void 0});}function vo(t,e,i){var s=t.facet(Io),r=yo(t).topNode;if(!s||s.allowsNesting)for(var _t233=r;_t233;_t233=_t233.enter(e,i,rl.ExcludeBuffers))_t233.type.isTop&&(r=_t233);return r;}function yo(t){var e=t.field(bo.state,!1);return e?e.tree:nl.empty;}function Ao(t,e,i){return Sl.applyChanges(t,[{fromA:e,toA:i,fromB:e,toB:i}]);}function Lo(t){var e=t.facet(Bo);return 9==e.charCodeAt(0)?t.tabSize*e.length:e.length;}function No(t,e){var i="",s=t.tabSize,r=t.facet(Bo)[0];if("\t"==r){for(;e>=s;)i+="\t",e-=s;r=" ";}for(var _t236=0;_t236<e;_t236++)i+=r;return i;}function $o(t,e){t instanceof Dt&&(t=new jo(t));var _iterator178=_createForOfIteratorHelper(t.state.facet(To)),_step178;try{for(_iterator178.s();!(_step178=_iterator178.n()).done;){var _i170=_step178.value;var _s159=_i170(t,e);if(void 0!==_s159)return _s159;}}catch(err){_iterator178.e(err);}finally{_iterator178.f();}var i=yo(t.state);return i.length>=e?function(t,e,i){var s=e.resolveStack(i),r=e.resolveInner(i,-1).resolve(i,0).enterUnfinishedNodesBefore(i);if(r!=s.node){var _t237=[];for(var _e212=r;_e212&&(_e212.from!=s.node.from||_e212.type!=s.node.type);_e212=_e212.parent)_t237.push(_e212);for(var _e213=_t237.length-1;_e213>=0;_e213--)s={node:_t237[_e213],next:s};}return zo(s,t,i);}(t,i,e):null;}function zo(t,e,i){for(var _s160=t;_s160;_s160=_s160.next){var _t239=Ho(_s160.node);if(_t239)return _t239(Wo.create(e,i,_s160));}return 0;}function Ho(t){var e=t.type.prop(Po);if(e)return e;var i,s=t.firstChild;if(s&&(i=s.type.prop(Yh.closedBy))){var _e214=t.lastChild,_s161=_e214&&i.indexOf(_e214.name)>-1;return function(t){return Uo(t,!0,1,void 0,_s161&&!function(t){return t.pos==t.options.simulateBreak&&t.options.simulateDoubleBreak;}(t)?_e214.from:void 0);};}return null==t.parent?Fo:null;}function Fo(){return 0;}function Vo(t,e){for(var _i172=e;_i172;_i172=_i172.parent)if(t==_i172)return!0;return!1;}function qo(_ref18){var t=_ref18.closing,_ref18$align=_ref18.align,e=_ref18$align===void 0?!0:_ref18$align,_ref18$units=_ref18.units,i=_ref18$units===void 0?1:_ref18$units;return function(s){return Uo(s,e,i,t);};}function Uo(t,e,i,s,r){var n=t.textAfter,h=n.match(/^\s*/)[0].length,l=s&&n.slice(h,h+s.length)==s||r==t.pos+h,o=e?function(t){var e=t.node,i=e.childAfter(e.from),s=e.lastChild;if(!i)return null;var r=t.options.simulateBreak,n=t.state.doc.lineAt(i.from),h=null==r||r<=n.from?n.to:Math.min(n.to,r);for(var _t240=i.to;;){var _r133=e.childAfter(_t240);if(!_r133||_r133==s)return null;if(!_r133.type.isSkipped){if(_r133.from>=h)return null;var _t241=/^ */.exec(n.text.slice(i.to-n.from))[0].length;return{from:i.from,to:i.to+_t241};}_t240=_r133.to;}}(t):null;return o?l?t.column(o.from):t.column(o.to):t.baseIndent+(l?0:t.unit*i);}function Go(){var _ref19=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},t=_ref19.except,_ref19$units=_ref19.units,e=_ref19$units===void 0?1:_ref19$units;return function(i){var s=t&&t.test(i.textAfter);return i.baseIndent+(s?0:e*i.unit);};}function Xo(t){var e=t.firstChild,i=t.lastChild;return e&&e.to<i.from?{from:e.to,to:i.type.isError?t.to:i.from}:null;}function Yo(t){var e=t.lastChild;return e&&e.to==t.to&&e.type.isError;}function Qo(t,e,i){var _iterator179=_createForOfIteratorHelper(t.facet(Ko)),_step179;try{for(_iterator179.s();!(_step179=_iterator179.n()).done;){var _s163=_step179.value;var _r134=_s163(t,e,i);if(_r134)return _r134;}}catch(err){_iterator179.e(err);}finally{_iterator179.f();}return function(t,e,i){var s=yo(t);if(s.length<i)return null;var r=null;for(var _n98=s.resolveStack(i,1);_n98;_n98=_n98.next){var _h71=_n98.node;if(_h71.to<=i||_h71.from>i)continue;if(r&&_h71.from<e)break;var _l61=_h71.type.prop(_o);if(_l61&&(_h71.to<s.length-50||s.length==t.doc.length||!Yo(_h71))){var _s162=_l61(_h71,t);_s162&&_s162.from<=i&&_s162.from>=e&&_s162.to>i&&(r=_s162);}}return r;}(t,e,i);}function Zo(t,e){var i=e.mapPos(t.from,1),s=e.mapPos(t.to,-1);return i>=s?void 0:{from:i,to:s};}function iu(t){var e=[];var _iterator180=_createForOfIteratorHelper(t.state.selection.ranges),_step180;try{var _loop15=function _loop15(){var i=_step180.value.head;e.some(function(t){return t.from<=i&&t.to>=i;})||e.push(t.lineBlockAt(i));};for(_iterator180.s();!(_step180=_iterator180.n()).done;){_loop15();}}catch(err){_iterator180.e(err);}finally{_iterator180.f();}return e;}function ru(t,e,i){var s;var r=null;return null===(s=t.field(su,!1))||void 0===s||s.between(e,i,function(t,e){(!r||r.from>t)&&(r={from:t,to:e});}),r;}function nu(t,e,i){var s=!1;return t.between(e,e,function(t,r){t==e&&r==i&&(s=!0);}),s;}function hu(t,e){return t.field(su,!1)?e:e.concat(mt.appendConfig.of(au()));}function lu(t,e){var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!0;var s=t.state.doc.lineAt(e.from).number,r=t.state.doc.lineAt(e.to).number;return en.announce.of("".concat(t.state.phrase(i?"Folded lines":"Unfolded lines")," ").concat(s," ").concat(t.state.phrase("to")," ").concat(r,"."));}function au(t){var e=[su,wu];return t&&e.push(fu.of(t)),e;}function cu(t,e){var i=t.state,s=i.facet(fu),r=function r(e){var i=t.lineBlockAt(t.posAtDOM(e.target)),s=ru(t.state,i.from,i.to);s&&t.dispatch({effects:eu.of(s)}),e.preventDefault();};if(s.placeholderDOM)return s.placeholderDOM(t,r,e);var n=document.createElement("span");return n.textContent=s.placeholderText,n.setAttribute("aria-label",i.phrase("folded code")),n.title=i.phrase("unfold"),n.className="cm-foldPlaceholder",n.onclick=r,n;}function yu(t){var e=t.facet(vu);return e.length?e:t.facet(ku);}function Mu(t,e){var i,s=[Su];return t instanceof bu&&(t.module&&s.push(en.styleModule.of(t.module)),i=t.themeType),(null==e?void 0:e.fallback)?s.push(ku.of(t)):i?s.push(vu.computeN([en.darkTheme],function(e){return e.facet(en.darkTheme)==("dark"==i)?[t]:[];})):s.push(vu.of(t)),s;}function Ru(t){var e=[],i=t.matched?Eu:Iu;return e.push(i.range(t.start.from,t.start.to)),t.end&&e.push(i.range(t.end.from,t.end.to)),e;}function Nu(t,e,i){var s=t.prop(e<0?Yh.openedBy:Yh.closedBy);if(s)return s;if(1==t.name.length){var _s170=i.indexOf(t.name);if(_s170>-1&&_s170%2==(e<0?1:0))return[i[_s170+e]];}return null;}function $u(t){var e=t.type.prop(Lu);return e?e(t.node):t;}function ju(t,e,i){var s=arguments.length>3&&arguments[3]!==undefined?arguments[3]:{};var r=s.maxScanDistance||1e4,n=s.brackets||Du,h=yo(t),l=h.resolveInner(e,i);for(var _s171=l;_s171;_s171=_s171.parent){var _r140=Nu(_s171.type,i,n);if(_r140&&_s171.from<_s171.to){var _h72=$u(_s171);if(_h72&&(i>0?e>=_h72.from&&e<_h72.to:e>_h72.from&&e<=_h72.to))return Pu(t,e,i,_s171,_h72,_r140,n);}}return function(t,e,i,s,r,n,h){var l=i<0?t.sliceDoc(e-1,e):t.sliceDoc(e,e+1),o=h.indexOf(l);if(o<0||o%2==0!=i>0)return null;var u={from:i<0?e-1:e,to:i>0?e+1:e},f=t.doc.iterRange(e,i>0?t.doc.length:0),a=0;for(var _t243=0;!f.next().done&&_t243<=n;){var _n100=f.value;i<0&&(_t243+=_n100.length);var _l62=e+_t243*i;for(var _t244=i>0?0:_n100.length-1,_e216=i>0?_n100.length:-1;_t244!=_e216;_t244+=i){var _e217=h.indexOf(_n100[_t244]);if(!(_e217<0||s.resolveInner(_l62+_t244,1).type!=r))if(_e217%2==0==i>0)a++;else{if(1==a)return{start:u,end:{from:_l62+_t244,to:_l62+_t244+1},matched:_e217>>1==o>>1};a--;}}i>0&&(_t243+=_n100.length);}return f.done?{start:u,matched:!1}:null;}(t,e,i,h,l.type,r,n);}function Pu(t,e,i,s,r,n,h){var l=s.parent,o={from:r.from,to:r.to},u=0,f=null==l?void 0:l.cursor();if(f&&(i<0?f.childBefore(s.from):f.childAfter(s.to)))do{if(i<0?f.to<=s.from:f.from>=s.to){if(0==u&&n.indexOf(f.type.name)>-1&&f.from<f.to){var _t245=$u(f);return{start:o,end:_t245?{from:_t245.from,to:_t245.to}:void 0,matched:!0};}if(Nu(f.type,i,h))u++;else if(Nu(f.type,-i,h)){if(0==u){var _t246=$u(f);return{start:o,end:_t246&&_t246.from<_t246.to?{from:_t246.from,to:_t246.to}:void 0,matched:!1};}u--;}}}while(i<0?f.prevSibling():f.nextSibling());return{start:o,matched:!1};}function qu(t,e){Fu.indexOf(t)>-1||(Fu.push(t),console.warn(e));}function Uu(t,e){var i=[];var _iterator186=_createForOfIteratorHelper(e.split(" ")),_step186;try{for(_iterator186.s();!(_step186=_iterator186.n()).done;){var _s172=_step186.value;var _e219=[];var _iterator187=_createForOfIteratorHelper(_s172.split(".")),_step187;try{for(_iterator187.s();!(_step187=_iterator187.n()).done;){var _i178=_step187.value;var _s173=t[_i178]||co[_i178];_s173?"function"==typeof _s173?_e219.length?_e219=_e219.map(_s173):qu(_i178,"Modifier ".concat(_i178," used at start of tag")):_e219.length?qu(_i178,"Tag ".concat(_i178," used as modifier")):_e219=Array.isArray(_s173)?_s173:[_s173]:qu(_i178,"Unknown highlighting tag ".concat(_i178));}}catch(err){_iterator187.e(err);}finally{_iterator187.f();}var _iterator188=_createForOfIteratorHelper(_e219),_step188;try{for(_iterator188.s();!(_step188=_iterator188.n()).done;){var _t248=_step188.value;i.push(_t248);}}catch(err){_iterator188.e(err);}finally{_iterator188.f();}}}catch(err){_iterator186.e(err);}finally{_iterator186.f();}if(!i.length)return 0;var s=e.replace(/ /g,"_"),r=s+" "+i.map(function(t){return t.id;}),n=Wu[r];if(n)return n.id;var h=Wu[r]=tl.define({id:Hu.length,name:s,props:[Ul(_defineProperty({},s,i))]});return Hu.push(h),h.id;}function Ju(t,e){return function(_ref20){var i=_ref20.state,s=_ref20.dispatch;if(i.readOnly)return!1;var r=t(e,i);return!!r&&(s(i.update(r)),!0);};}function Xu(t,e){var i=t.languageDataAt("commentTokens",e);return i.length?i[0]:{};}function Qu(t,e){var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:e.selection.ranges;var s=i.map(function(t){return Xu(e,t.from).block;});if(!s.every(function(t){return t;}))return null;var r=i.map(function(t,i){return function(t,_ref21,s,r){var e=_ref21.open,i=_ref21.close;var n,h,l=t.sliceDoc(s-Yu,s),o=t.sliceDoc(r,r+Yu),u=/\s*$/.exec(l)[0].length,f=/^\s*/.exec(o)[0].length,a=l.length-u;if(l.slice(a-e.length,a)==e&&o.slice(f,f+i.length)==i)return{open:{pos:s-u,margin:u&&1},close:{pos:r+f,margin:f&&1}};r-s<=2*Yu?n=h=t.sliceDoc(s,r):(n=t.sliceDoc(s,s+Yu),h=t.sliceDoc(r-Yu,r));var c=/^\s*/.exec(n)[0].length,d=/\s*$/.exec(h)[0].length,p=h.length-d-i.length;return n.slice(c,c+e.length)==e&&h.slice(p,p+i.length)==i?{open:{pos:s+c+e.length,margin:/\s/.test(n.charAt(c+e.length))?1:0},close:{pos:r-d-i.length,margin:/\s/.test(h.charAt(p-1))?1:0}}:null;}(e,s[i],t.from,t.to);});if(2!=t&&!r.every(function(t){return t;}))return{changes:e.changes(i.map(function(t,e){return r[e]?[]:[{from:t.from,insert:s[e].open+" "},{from:t.to,insert:" "+s[e].close}];}))};if(1!=t&&r.some(function(t){return t;})){var _t249=[];for(var _e220,_i180=0;_i180<r.length;_i180++)if(_e220=r[_i180]){var _r142=s[_i180],_e221=_e220,_n102=_e221.open,_h73=_e221.close;_t249.push({from:_n102.pos-_r142.open.length,to:_n102.pos+_n102.margin},{from:_h73.pos-_h73.margin,to:_h73.pos+_r142.close.length});}return{changes:_t249};}return null;}function Zu(t,e){var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:e.selection.ranges;var s=[],r=-1;var _iterator190=_createForOfIteratorHelper(i),_step190;try{for(_iterator190.s();!(_step190=_iterator190.n()).done;){var _step190$value=_step190.value,_t252=_step190$value.from,_n105=_step190$value.to;var _i184=s.length,_h75=1e9,_l63=Xu(e,_t252).line;if(_l63){for(var _i185=_t252;_i185<=_n105;){var _o40=e.doc.lineAt(_i185);if(_o40.from>r&&(_t252==_n105||_n105>_o40.from)){r=_o40.from;var _t253=/^\s*/.exec(_o40.text)[0].length,_e224=_t253==_o40.length,_i186=_o40.text.slice(_t253,_t253+_l63.length)==_l63?_t253:-1;_t253<_o40.text.length&&_t253<_h75&&(_h75=_t253),s.push({line:_o40,comment:_i186,token:_l63,indent:_t253,empty:_e224,single:!1});}_i185=_o40.to+1;}if(_h75<1e9)for(var _t254=_i184;_t254<s.length;_t254++)s[_t254].indent<s[_t254].line.text.length&&(s[_t254].indent=_h75);s.length==_i184+1&&(s[_i184].single=!0);}}}catch(err){_iterator190.e(err);}finally{_iterator190.f();}if(2!=t&&s.some(function(t){return t.comment<0&&(!t.empty||t.single);})){var _t250=[];var _iterator191=_createForOfIteratorHelper(s),_step191;try{for(_iterator191.s();!(_step191=_iterator191.n()).done;){var _step191$value=_step191.value,_e222=_step191$value.line,_i182=_step191$value.token,_r143=_step191$value.indent,_n103=_step191$value.empty,_h74=_step191$value.single;!_h74&&_n103||_t250.push({from:_e222.from+_r143,insert:_i182+" "});}}catch(err){_iterator191.e(err);}finally{_iterator191.f();}var _i181=e.changes(_t250);return{changes:_i181,selection:e.selection.map(_i181,1)};}if(1!=t&&s.some(function(t){return t.comment>=0;})){var _t251=[];var _iterator192=_createForOfIteratorHelper(s),_step192;try{for(_iterator192.s();!(_step192=_iterator192.n()).done;){var _step192$value=_step192.value,_e223=_step192$value.line,_i183=_step192$value.comment,_r144=_step192$value.token;if(_i183>=0){var _s175=_e223.from+_i183,_n104=_s175+_r144.length;" "==_e223.text[_n104-_e223.from]&&_n104++,_t251.push({from:_s175,to:_n104});}}}catch(err){_iterator192.e(err);}finally{_iterator192.f();}return{changes:_t251};}return null;}function hf(t,e){return function(_ref22){var i=_ref22.state,s=_ref22.dispatch;if(!e&&i.readOnly)return!1;var r=i.field(nf,!1);if(!r)return!1;var n=r.pop(t,i,e);return!!n&&(s(n),!0);};}function cf(t,e,i,s){var r=e+1>i+20?e-i-1:0,n=t.slice(r,e);return n.push(s),n;}function df(t,e){return t.length?e.length?t.concat(e):t:e;}function gf(t,e){if(t.length){var _i187=t[t.length-1],_s177=_i187.selectionsAfter.slice(Math.max(0,_i187.selectionsAfter.length-mf));return _s177.length&&_s177[_s177.length-1].eq(e)?t:(_s177.push(e),cf(t,t.length-1,1e9,_i187.setSelAfter(_s177)));}return[af.selection([e])];}function wf(t){var e=t[t.length-1],i=t.slice();return i[t.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),i;}function bf(t,e){if(!t.length)return t;var i=t.length,s=pf;for(;i;){var _r146=vf(t[i-1],e,s);if(_r146.changes&&!_r146.changes.empty||_r146.effects.length){var _e226=t.slice(0,i);return _e226[i-1]=_r146,_e226;}e=_r146.mapped,i--,s=_r146.selectionsAfter;}return s.length?[af.selection(s)]:pf;}function vf(t,e,i){var s=df(t.selectionsAfter.length?t.selectionsAfter.map(function(t){return t.map(e);}):pf,i);if(!t.changes)return af.selection(s);var r=t.changes.map(e),n=e.mapDesc(t.changes,!0),h=t.mapped?t.mapped.composeDesc(n):n;return new af(r,mt.mapEffects(t.effects,e),h,t.startSelection.map(n),s);}function xf(t,e){return $.create(t.ranges.map(e),t.mainIndex);}function Sf(t,e){return t.update({selection:e,scrollIntoView:!0,userEvent:"select"});}function Af(_ref23,i){var t=_ref23.state,e=_ref23.dispatch;var s=xf(t.selection,i);return!s.eq(t.selection,!0)&&(e(Sf(t,s)),!0);}function Cf(t,e){return $.cursor(e?t.to:t.from);}function Df(t,e){return Af(t,function(i){return i.empty?t.moveByChar(i,e):Cf(i,e);});}function Of(t){return t.textDirectionAt(t.state.selection.main.head)==bi.LTR;}function Rf(t,e){return Af(t,function(i){return i.empty?t.moveByGroup(i,e):Cf(i,e);});}function Tf(t,e,i){if(e.type.prop(i))return!0;var s=e.to-e.from;return s&&(s>2||/[^\s,.;:]/.test(t.sliceDoc(e.from,e.to)))||e.firstChild;}function Bf(t,e,i){var s,r,n=yo(t).resolveInner(e.head),h=i?Yh.closedBy:Yh.openedBy;for(var _s178=e.head;;){var _e228=i?n.childAfter(_s178):n.childBefore(_s178);if(!_e228)break;Tf(t,_e228,h)?n=_e228:_s178=i?_e228.to:_e228.from;}return r=n.type.prop(h)&&(s=i?ju(t,n.from,1):ju(t,n.to,-1))&&s.matched?i?s.end.to:s.end.from:i?n.to:n.from,$.cursor(r,i?-1:1);}function Lf(t,e){return Af(t,function(i){if(!i.empty)return Cf(i,e);var s=t.moveVertically(i,e);return s.head!=i.head?s:t.moveToLineBoundary(i,e);});}function jf(t){var e,i=t.scrollDOM.clientHeight<t.scrollDOM.scrollHeight-2,s=0,r=0;if(i){var _iterator194=_createForOfIteratorHelper(t.state.facet(en.scrollMargins)),_step194;try{for(_iterator194.s();!(_step194=_iterator194.n()).done;){var _e229=_step194.value;var _i189=_e229(t);(null==_i189?void 0:_i189.top)&&(s=Math.max(null==_i189?void 0:_i189.top,s)),(null==_i189?void 0:_i189.bottom)&&(r=Math.max(null==_i189?void 0:_i189.bottom,r));}}catch(err){_iterator194.e(err);}finally{_iterator194.f();}e=t.scrollDOM.clientHeight-s-r;}else e=(t.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:s,marginBottom:r,selfScroll:i,height:Math.max(t.defaultLineHeight,e-5)};}function Pf(t,e){var i,s=jf(t),r=t.state,n=xf(r.selection,function(i){return i.empty?t.moveVertically(i,e,s.height):Cf(i,e);});if(n.eq(r.selection))return!1;if(s.selfScroll){var _e230=t.coordsAtPos(r.selection.main.head),_h78=t.scrollDOM.getBoundingClientRect(),_l64=_h78.top+s.marginTop,_o41=_h78.bottom-s.marginBottom;_e230&&_e230.top>_l64&&_e230.bottom<_o41&&(i=en.scrollIntoView(n.main.head,{y:"start",yMargin:_e230.top-_l64}));}return t.dispatch(Sf(r,n),{effects:i}),!0;}function Ff(t,e,i){var s=t.lineBlockAt(e.head),r=t.moveToLineBoundary(e,i);if(r.head==e.head&&r.head!=(i?s.to:s.from)&&(r=t.moveToLineBoundary(e,i,!1)),!i&&r.head==s.from&&s.length){var _i190=/^\s*/.exec(t.state.sliceDoc(s.from,Math.min(s.from+100,s.to)))[0].length;_i190&&e.head!=s.from+_i190&&(r=$.cursor(s.from+_i190));}return r;}function Wf(t,e){var i=xf(t.state.selection,function(t){var i=e(t);return $.range(t.anchor,i.head,i.goalColumn,i.bidiLevel||void 0);});return!i.eq(t.state.selection)&&(t.dispatch(Sf(t.state,i)),!0);}function Vf(t,e){return Wf(t,function(i){return t.moveByChar(i,e);});}function Jf(t,e){return Wf(t,function(i){return t.moveByGroup(i,e);});}function Gf(t,e){return Wf(t,function(i){return t.moveVertically(i,e);});}function Xf(t,e){return Wf(t,function(i){return t.moveVertically(i,e,jf(t).height);});}function sa(t,e){if(t.state.readOnly)return!1;var i="delete.selection",s=t.state,r=s.changeByRange(function(s){var r=s.from,n=s.to;if(r==n){var _h79=e(s);_h79<r?(i="delete.backward",_h79=ra(t,_h79,!1)):_h79>r&&(i="delete.forward",_h79=ra(t,_h79,!0)),r=Math.min(r,_h79),n=Math.max(n,_h79);}else r=ra(t,r,!1),n=ra(t,n,!0);return r==n?{range:s}:{changes:{from:r,to:n},range:$.cursor(r,r<s.head?-1:1)};});return!r.changes.empty&&(t.dispatch(s.update(r,{scrollIntoView:!0,userEvent:i,effects:"delete.selection"==i?en.announce.of(s.phrase("Selection deleted")):void 0})),!0);}function ra(t,e,i){if(t instanceof en){var _iterator195=_createForOfIteratorHelper(t.state.facet(en.atomicRanges).map(function(e){return e(t);})),_step195;try{for(_iterator195.s();!(_step195=_iterator195.n()).done;){var _s179=_step195.value;_s179.between(e,e,function(t,s){t<e&&s>e&&(e=i?s:t);});}}catch(err){_iterator195.e(err);}finally{_iterator195.f();}}return e;}function fa(t){var e=[],i=-1;var _iterator196=_createForOfIteratorHelper(t.selection.ranges),_step196;try{for(_iterator196.s();!(_step196=_iterator196.n()).done;){var _s180=_step196.value;var _r147=t.doc.lineAt(_s180.from),_n107=t.doc.lineAt(_s180.to);if(_s180.empty||_s180.to!=_n107.from||(_n107=t.doc.lineAt(_s180.to-1)),i>=_r147.number){var _t258=e[e.length-1];_t258.to=_n107.to,_t258.ranges.push(_s180);}else e.push({from:_r147.from,to:_n107.to,ranges:[_s180]});i=_n107.number+1;}}catch(err){_iterator196.e(err);}finally{_iterator196.f();}return e;}function aa(t,e,i){if(t.readOnly)return!1;var s=[],r=[];var _iterator197=_createForOfIteratorHelper(fa(t)),_step197;try{for(_iterator197.s();!(_step197=_iterator197.n()).done;){var _e232=_step197.value;if(i?_e232.to==t.doc.length:0==_e232.from)continue;var _n108=t.doc.lineAt(i?_e232.to+1:_e232.from-1),_h80=_n108.length+1;if(i){s.push({from:_e232.to,to:_n108.to},{from:_e232.from,insert:_n108.text+t.lineBreak});var _iterator198=_createForOfIteratorHelper(_e232.ranges),_step198;try{for(_iterator198.s();!(_step198=_iterator198.n()).done;){var _i191=_step198.value;r.push($.range(Math.min(t.doc.length,_i191.anchor+_h80),Math.min(t.doc.length,_i191.head+_h80)));}}catch(err){_iterator198.e(err);}finally{_iterator198.f();}}else{s.push({from:_n108.from,to:_e232.from},{from:_e232.to,insert:t.lineBreak+_n108.text});var _iterator199=_createForOfIteratorHelper(_e232.ranges),_step199;try{for(_iterator199.s();!(_step199=_iterator199.n()).done;){var _t259=_step199.value;r.push($.range(_t259.anchor-_h80,_t259.head-_h80));}}catch(err){_iterator199.e(err);}finally{_iterator199.f();}}}}catch(err){_iterator197.e(err);}finally{_iterator197.f();}return!!s.length&&(e(t.update({changes:s,scrollIntoView:!0,selection:$.create(r,t.selection.mainIndex),userEvent:"move.line"})),!0);}function ca(t,e,i){if(t.readOnly)return!1;var s=[];var _iterator200=_createForOfIteratorHelper(fa(t)),_step200;try{for(_iterator200.s();!(_step200=_iterator200.n()).done;){var _e233=_step200.value;i?s.push({from:_e233.from,insert:t.doc.slice(_e233.from,_e233.to)+t.lineBreak}):s.push({from:_e233.to,insert:t.lineBreak+t.doc.slice(_e233.from,_e233.to)});}}catch(err){_iterator200.e(err);}finally{_iterator200.f();}return e(t.update({changes:s,scrollIntoView:!0,userEvent:"input.copyline"})),!0;}function pa(t){return function(_ref28){var e=_ref28.state,i=_ref28.dispatch;if(e.readOnly)return!1;var s=e.changeByRange(function(i){var _h81;var s=i.from,r=i.to,n=e.doc.lineAt(s),h=!t&&s==r&&function(t,e){if(/\(\)|\[\]|\{\}/.test(t.sliceDoc(e-1,e+1)))return{from:e,to:e};var i,s=yo(t).resolveInner(e),r=s.childBefore(e),n=s.childAfter(e);return r&&n&&r.to<=e&&n.from>=e&&(i=r.type.prop(Yh.closedBy))&&i.indexOf(n.name)>-1&&t.doc.lineAt(r.to).from==t.doc.lineAt(n.from).from&&!/\S/.test(t.sliceDoc(r.to,n.from))?{from:r.to,to:n.from}:null;}(e,s);t&&(s=r=(r<=n.to?n:e.doc.lineAt(r)).to);var l=new jo(e,{simulateBreak:s,simulateDoubleBreak:!!h}),o=$o(l,s);for(null==o&&(o=Ut(/^\s*/.exec(e.doc.lineAt(s).text)[0],e.tabSize));r<n.to&&/\s/.test(n.text[r-n.from]);)r++;h?(_h81=h,s=_h81.from,r=_h81.to,_h81):s>n.from&&s<n.from+100&&!/\S/.test(n.text.slice(0,s))&&(s=n.from);var u=["",No(e,o)];return h&&u.push(No(e,l.lineIndent(n.from,-1))),{changes:{from:s,to:r,insert:a.of(u)},range:$.cursor(s+1+u[1].length)};});return i(e.update(s,{scrollIntoView:!0,userEvent:"input"})),!0;};}function ma(t,e){var i=-1;return t.changeByRange(function(s){var r=[];for(var _n109=s.from;_n109<=s.to;){var _h82=t.doc.lineAt(_n109);_h82.number>i&&(s.empty||s.to>_h82.from)&&(e(_h82,r,s),i=_h82.number),_n109=_h82.to+1;}var n=t.changes(r);return{changes:r,range:$.range(n.mapPos(s.anchor,1),n.mapPos(s.head,1))};});}function wa(){var t=arguments[0];"string"==typeof t&&(t=document.createElement(t));var e=1,i=arguments[1];if(i&&"object"==_typeof(i)&&null==i.nodeType&&!Array.isArray(i)){for(var s in i)if(Object.prototype.hasOwnProperty.call(i,s)){var r=i[s];"string"==typeof r?t.setAttribute(s,r):null!=r&&(t[s]=r);}e++;}for(;e<arguments.length;e++)ba(t,arguments[e]);return t;}function ba(t,e){if("string"==typeof e)t.appendChild(document.createTextNode(e));else if(null==e);else if(null!=e.nodeType)t.appendChild(e);else{if(!Array.isArray(e))throw new RangeError("Unsupported child node: "+e);for(var i=0;i<e.length;i++)ba(t,e[i]);}}function Da(t,e){if(e>=t.length)return e;var i,s=t.lineAt(e);for(;e<s.to&&(i=s.text.charCodeAt(e-s.from))>=56320&&i<57344;)e++;return e;}function Oa(t){var e=wa("input",{"class":"cm-textfield",name:"line",value:String(t.state.doc.lineAt(t.state.selection.main.head).number)});function i(){var i=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(e.value);if(!i)return;var s=t.state,r=s.doc.lineAt(s.selection.main.head),_i196=_slicedToArray(i,5),n=_i196[1],h=_i196[2],l=_i196[3],o=_i196[4],u=l?+l.slice(1):0,f=h?+h:r.number;if(h&&o){var _t268=f/100;n&&(_t268=_t268*("-"==n?-1:1)+r.number/s.doc.lines),f=Math.round(s.doc.lines*_t268);}else h&&n&&(f=f*("-"==n?-1:1)+r.number);var a=s.doc.line(Math.max(1,Math.min(s.doc.lines,f))),c=$.cursor(a.from+Math.max(0,Math.min(u,a.length)));t.dispatch({effects:[Ea.of(!1),en.scrollIntoView(c.from,{y:"center"})],selection:c}),t.focus();}return{dom:wa("form",{"class":"cm-gotoLine",onkeydown:function onkeydown(e){27==e.keyCode?(e.preventDefault(),t.dispatch({effects:Ea.of(!1)}),t.focus()):13==e.keyCode&&(e.preventDefault(),i());},onsubmit:function onsubmit(t){t.preventDefault(),i();}},wa("label",t.state.phrase("Go to line"),": ",e)," ",wa("button",{"class":"cm-button",type:"submit"},t.state.phrase("go")))};}function $a(t,e,i,s){return!(0!=i&&t(e.sliceDoc(i-1,i))==xt.Word||s!=e.doc.length&&t(e.sliceDoc(s,s+1))==xt.Word);}function Wa(t,e,i,s){return new ka(e.doc,t.unquoted,i,s,t.caseSensitive?void 0:function(t){return t.toLowerCase();},t.wholeWord?function(t,e){return function(i,s,r,n){return(n>i||n+r.length<s)&&(n=Math.max(0,i-2),r=t.sliceString(n,Math.min(t.length,s+2))),!(e(Ua(r,i-n))==xt.Word&&e(Ja(r,i-n))==xt.Word||e(Ja(r,s-n))==xt.Word&&e(Ua(r,s-n))==xt.Word);};}(e.doc,e.charCategorizer(e.selection.main.head)):void 0);}function qa(t,e,i,s){return new xa(e.doc,t.search,{ignoreCase:!t.caseSensitive,test:t.wholeWord?(r=e.charCategorizer(e.selection.main.head),function(t,e,i){return!i[0].length||(r(Ua(i.input,i.index))!=xt.Word||r(Ja(i.input,i.index))!=xt.Word)&&(r(Ja(i.input,i.index+i[0].length))!=xt.Word||r(Ua(i.input,i.index+i[0].length))!=xt.Word);}):void 0},i,s);var r;}function Ua(t,e){return t.slice(y(t,e,!1),e);}function Ja(t,e){return t.slice(e,y(t,e));}function ec(t){return function(e){var i=e.state.field(Xa,!1);return i&&i.query.spec.valid?t(e,i):ac(e);};}function lc(t){return t.state.facet(za).createPanel(t);}function oc(t,e){var i,s,r,n,h;var l=t.selection.main,o=l.empty||l.to>l.from+100?"":t.sliceDoc(l.from,l.to);if(e&&!o)return e;var u=t.facet(za);return new Ha({search:(null!==(i=null==e?void 0:e.literal)&&void 0!==i?i:u.literal)?o:o.replace(/\n/g,"\\n"),caseSensitive:null!==(s=null==e?void 0:e.caseSensitive)&&void 0!==s?s:u.caseSensitive,literal:null!==(r=null==e?void 0:e.literal)&&void 0!==r?r:u.literal,regexp:null!==(n=null==e?void 0:e.regexp)&&void 0!==n?n:u.regexp,wholeWord:null!==(h=null==e?void 0:e.wholeWord)&&void 0!==h?h:u.wholeWord});}function uc(t){var e=vh(t,lc);return e&&e.dom.querySelector("[main-field]");}function fc(t){var e=uc(t);e&&e==t.root.activeElement&&e.select();}function mc(t,e){return t.state.phrase(e);}function bc(t,_ref54){var e=_ref54.from,i=_ref54.to;var s=t.state.doc.lineAt(e),r=t.state.doc.lineAt(i).to,n=Math.max(s.from,e-gc),h=Math.min(r,i+gc),l=t.state.sliceDoc(n,h);if(n!=s.from)for(var _t273=0;_t273<gc;_t273++)if(!wc.test(l[_t273+1])&&wc.test(l[_t273])){l=l.slice(_t273);break;}if(h!=r)for(var _t274=l.length-1;_t274>l.length-gc;_t274--)if(!wc.test(l[_t274-1])&&wc.test(l[_t274])){l=l.slice(0,_t274);break;}return en.announce.of("".concat(t.state.phrase("current match"),". ").concat(l," ").concat(t.state.phrase("on line")," ").concat(s.number,"."));}function Mc(t){var e=Object.keys(t).join(""),i=/\w/.test(e);return i&&(e=e.replace(/\w/g,"")),"[".concat(i?"\\w":"").concat(e.replace(/[^\w\s]/g,"\\$&"),"]");}function xc(t){var e=t.map(function(t){return"string"==typeof t?{label:t}:t;}),_ref55=e.every(function(t){return /^\w+$/.test(t.label);})?[/\w*$/,/\w+$/]:function(t){var e=Object.create(null),i=Object.create(null);var _iterator206=_createForOfIteratorHelper(t),_step206;try{for(_iterator206.s();!(_step206=_iterator206.n()).done;){var _s190=_step206.value.label;e[_s190[0]]=!0;for(var _t275=1;_t275<_s190.length;_t275++)i[_s190[_t275]]=!0;}}catch(err){_iterator206.e(err);}finally{_iterator206.f();}var s=Mc(e)+Mc(i)+"*$";return[new RegExp("^"+s),new RegExp(s)];}(e),_ref56=_slicedToArray(_ref55,2),i=_ref56[0],s=_ref56[1];return function(t){var r=t.matchBefore(s);return r||t.explicit?{from:r?r.from:t.pos,options:e,validFor:i}:null;};}function Sc(t,e){return function(i){for(var _e243=yo(i.state).resolveInner(i.pos,-1);_e243;_e243=_e243.parent){if(t.indexOf(_e243.name)>-1)return null;if(_e243.type.isTop)break;}return e(i);};}function Cc(t){return t.selection.main.from;}function Dc(t,e){var i;var s=t.source,r=e&&"^"!=s[0],n="$"!=s[s.length-1];return r||n?new RegExp("".concat(r?"^":"","(?:").concat(s,")").concat(n?"$":""),null!==(i=t.flags)&&void 0!==i?i:t.ignoreCase?"i":""):t;}function Ic(t){if(!Array.isArray(t))return t;var e=Ec.get(t);return e||Ec.set(t,e=xc(t)),e;}function $c(t,e){return t?e?t+" "+e:t:e;}function jc(t,e,i,s,r,n){var h,l,o=t.textDirection==bi.RTL,u=o,f=!1,a="top",c=e.left-r.left,d=r.right-e.right,p=s.right-s.left,m=s.bottom-s.top;if(u&&c<Math.min(p,d)?u=!1:!u&&d<Math.min(p,c)&&(u=!0),p<=(u?c:d))h=Math.max(r.top,Math.min(i.top,r.bottom-m))-e.top,l=Math.min(400,u?c:d);else{f=!0,l=Math.min(400,(o?e.right:r.right-e.left)-30);var _t277=r.bottom-e.bottom;_t277>=m||_t277>e.top?h=i.bottom-e.top:(a="bottom",h=e.bottom-i.top);}return{style:"".concat(a,": ").concat(h/((e.bottom-e.top)/n.offsetHeight),"px; max-width: ").concat(l/((e.right-e.left)/n.offsetWidth),"px"),"class":"cm-completionInfo-"+(f?o?"left-narrow":"right-narrow":u?"left":"right")};}function Pc(t,e,i){if(t<=i)return{from:0,to:t};if(e<0&&(e=0),e<=t>>1){var _t278=Math.floor(e/i);return{from:_t278*i,to:(_t278+1)*i};}var s=Math.floor((t-e)/i);return{from:t-(s+1)*i,to:t-s*i};}function Hc(t,e){return function(i){return new zc(i,t,e);};}function Fc(t){return 100*(t.boost||0)+(t.apply?10:0)+(t.info?5:0)+(t.type?1:0);}function Jc(t,e){var i={"aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":t};return e>-1&&(i["aria-activedescendant"]=t+"-"+e),i;}function Kc(t,e){if(t.isUserEvent("input.complete")){var _i213=t.annotation(Oc);if(_i213&&e.activateOnCompletion(_i213))return 12;}var i=t.isUserEvent("input.type");return i&&e.activateOnTyping?5:i?1:t.isUserEvent("delete.backward")?2:t.selection?8:t.docChanged?16:0;}function td(t,e){var i=e.completion.apply||e.completion.label;var s=t.state.field(Zc).active.find(function(t){return t.source==e.source;});return s instanceof Xc&&("string"==typeof i?t.dispatch(Object.assign(Object.assign({},function(t,e,i,s){var r=t.selection.main,n=i-r.from,h=s-r.from;return Object.assign(Object.assign({},t.changeByRange(function(l){if(l!=r&&i!=s&&t.sliceDoc(l.from+n,l.from+h)!=t.sliceDoc(i,s))return{range:l};var o=t.toText(e);return{changes:{from:l.from+n,to:s==r.from?l.to:l.from+h,insert:o},range:$.cursor(l.from+n+o.length)};})),{scrollIntoView:!0,userEvent:"input.complete"});}(t.state,i,s.from,s.to)),{annotations:Oc.of(e.completion)})):i(t,e.completion,s.from,s.to),!0);}function id(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:"option";return function(i){var s=i.state.field(Zc,!1);if(!s||!s.open||s.open.disabled||Date.now()-s.open.timestamp<i.state.facet(Nc).interactionDelay)return!1;var r,n=1;"page"==e&&(r=gh(i,s.open.tooltip))&&(n=Math.max(2,Math.floor(r.dom.offsetHeight/r.dom.querySelector("li").offsetHeight)-1));var h=s.open.options.length,l=s.open.selected>-1?s.open.selected+n*(t?1:-1):t?0:h-1;return l<0?l="page"==e?0:h-1:l>=h&&(l="page"==e?h-1:0),i.dispatch({effects:Qc.of(l)}),!0;};}function kd(t,e){return $.create(t.filter(function(t){return t.field==e;}).map(function(t){return $.range(t.from,t.to);}));}function yd(t){var e=dd.parse(t);return function(t,i,s,r){var _e$instantiate=e.instantiate(t.state,s),n=_e$instantiate.text,h=_e$instantiate.ranges,l=t.state.selection.main,o={changes:{from:s,to:r==l.from?l.to:r,insert:a.of(n)},scrollIntoView:!0,annotations:i?[Oc.of(i),gt.userEvent.of("input.complete")]:void 0};if(h.length&&(o.selection=kd(h,0)),h.some(function(t){return t.field>0;})){var _e265=new gd(h,0),_i219=o.effects=[wd.of(_e265)];void 0===t.state.field(vd,!1)&&_i219.push(mt.appendConfig.of([vd,Ad,Dd,fd]));}t.dispatch(t.state.update(o));};}function Md(t){return function(_ref57){var e=_ref57.state,i=_ref57.dispatch;var s=e.field(vd,!1);if(!s||t<0&&0==s.active)return!1;var r=s.active+t,n=t>0&&!s.ranges.some(function(e){return e.field==r+t;});return i(e.update({selection:kd(s.ranges,r),effects:wd.of(n?null:new gd(s.ranges,r)),scrollIntoView:!0})),!0;};}function Cd(t,e){return Object.assign(Object.assign({},e),{apply:yd(t)});}function Bd(t){for(var _e266=0;_e266<8;_e266+=2)if(Td.charCodeAt(_e266)==t)return Td.charAt(_e266+1);return x(t<128?t:t+1);}function Ld(t,e){return t.languageDataAt("closeBrackets",e)[0]||Od;}function Pd(t,e){var i=!1;return t.field(Rd).between(0,t.doc.length,function(t){t==e&&(i=!0);}),i;}function zd(t,e){var i=t.sliceString(e,e+2);return i.slice(0,S(M(i,0)));}function Hd(t,e,i,s){var r=null,n=t.changeByRange(function(n){if(!n.empty)return{changes:[{insert:e,from:n.from},{insert:i,from:n.to}],effects:Ed.of(n.to+e.length),range:$.range(n.anchor+e.length,n.head+e.length)};var h=zd(t.doc,n.head);return!h||/\s/.test(h)||s.indexOf(h)>-1?{changes:{insert:e+i,from:n.head},effects:Ed.of(n.head+e.length),range:$.cursor(n.head+e.length)}:{range:r=n};});return r?null:t.update(n,{scrollIntoView:!0,userEvent:"input.type"});}function Fd(t,e,i){var s=null,r=t.changeByRange(function(e){return e.empty&&zd(t.doc,e.head)==i?{changes:{from:e.head,to:e.head+i.length,insert:i},range:$.cursor(e.head+i.length)}:s={range:e};});return s?null:t.update(r,{scrollIntoView:!0,userEvent:"input.type"});}function Wd(t,e,i,s){var r=s.stringPrefixes||Od.stringPrefixes,n=null,h=t.changeByRange(function(s){if(!s.empty)return{changes:[{insert:e,from:s.from},{insert:e,from:s.to}],effects:Ed.of(s.to+e.length),range:$.range(s.anchor+e.length,s.head+e.length)};var h,l=s.head,o=zd(t.doc,l);if(o==e){if(Vd(t,l))return{changes:{insert:e+e,from:l},effects:Ed.of(l+e.length),range:$.cursor(l+e.length)};if(Pd(t,l)){var _s202=i&&t.sliceDoc(l,l+3*e.length)==e+e+e?e+e+e:e;return{changes:{from:l,to:l+_s202.length,insert:_s202},range:$.cursor(l+_s202.length)};}}else{if(i&&t.sliceDoc(l-2*e.length,l)==e+e&&(h=qd(t,l-2*e.length,r))>-1&&Vd(t,h))return{changes:{insert:e+e+e+e,from:l},effects:Ed.of(l+e.length),range:$.cursor(l+e.length)};if(t.charCategorizer(l)(o)!=xt.Word&&qd(t,l,r)>-1&&!function(t,e,i,s){var r=yo(t).resolveInner(e,-1),n=s.reduce(function(t,e){return Math.max(t,e.length);},0);for(var _h92=0;_h92<5;_h92++){var _h93=t.sliceDoc(r.from,Math.min(r.to,r.from+i.length+n)),_l71=_h93.indexOf(i);if(!_l71||_l71>-1&&s.indexOf(_h93.slice(0,_l71))>-1){var _e267=r.firstChild;for(;_e267&&_e267.from==r.from&&_e267.to-_e267.from>i.length+_l71;){if(t.sliceDoc(_e267.to-i.length,_e267.to)==i)return!1;_e267=_e267.firstChild;}return!0;}var _o47=r.to==e&&r.parent;if(!_o47)break;r=_o47;}return!1;}(t,l,e,r))return{changes:{insert:e+e,from:l},effects:Ed.of(l+e.length),range:$.cursor(l+e.length)};}return{range:n=s};});return n?null:t.update(h,{scrollIntoView:!0,userEvent:"input.type"});}function Vd(t,e){var i=yo(t).resolveInner(e+1);return i.parent&&i.from==e;}function qd(t,e,i){var s=t.charCategorizer(e);if(s(t.sliceDoc(e-1,e))!=xt.Word)return e;var _iterator235=_createForOfIteratorHelper(i),_step235;try{for(_iterator235.s();!(_step235=_iterator235.n()).done;){var _r171=_step235.value;var _i222=e-_r171.length;if(t.sliceDoc(_i222,e)==_r171&&s(t.sliceDoc(_i222-1,_i222))!=xt.Word)return _i222;}}catch(err){_iterator235.e(err);}finally{_iterator235.f();}return-1;}function Ud(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return[ud,Zc,Nc.of(t),ld,Gd,fd];}function Kd(t){var e=t.field(Zc,!1);return e&&e.active.some(function(t){return t.isPending;})?"pending":e&&e.active.some(function(t){return 0!=t.state;})?"active":null;}function Yd(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:null;var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;var s=null;return t.between(i,1e9,function(t,i,_ref60){var r=_ref60.spec;if(!(e&&r.diagnostics.indexOf(e)<0))if(s){if(r.diagnostics.indexOf(s.diagnostic)<0)return!1;s=new _d(s.from,i,s.diagnostic);}else s=new _d(t,i,e||r.diagnostics[0]);}),s;}function sp(t,e,i){var s,_t$state$field=t.state.field(ep),r=_t$state$field.diagnostics,n=-1,h=-1;r.between(e-(i<0?1:0),e+(i>0?1:0),function(t,r,_ref61){var l=_ref61.spec;if(e>=t&&e<=r&&(t==r||(e>t||i>0)&&(e<r||i<0)))return s=l.diagnostics,n=t,h=r,!1;});var l=t.state.facet(lp).tooltipFilter;return s&&l&&(s=l(s,t.state)),s?{pos:n,end:h,above:t.state.doc.lineAt(n).to<h,create:function create(){return{dom:rp(t,s)};}}:null;}function rp(t,e){return wa("ul",{"class":"cm-tooltip-lint"},e.map(function(e){return up(t,e,!1);}));}function op(t){var e=[];if(t){var _iterator237=_createForOfIteratorHelper(t),_step237;try{t:for(_iterator237.s();!(_step237=_iterator237.n()).done;){var _i226=_step237.value.name;var _loop21=function _loop21(){var s=_i226[_t301];if(/[a-zA-Z]/.test(s)&&!e.some(function(t){return t.toLowerCase()==s.toLowerCase();})){e.push(s);return 1;// continue t
|
|
2
|
-
}};for(var _t301=0;_t301<_i226.length;_t301++){if(_loop21())continue t;}e.push("");}}catch(err){_iterator237.e(err);}finally{_iterator237.f();}}return e;}function up(t,e,i){var s;var r=i?op(e.actions):[];return wa("li",{"class":"cm-diagnostic cm-diagnostic-"+e.severity},wa("span",{"class":"cm-diagnosticText"},e.renderMessage?e.renderMessage(t):e.message),null===(s=e.actions)||void 0===s?void 0:s.map(function(i,s){var n=!1,h=function h(s){if(s.preventDefault(),n)return;n=!0;var r=Yd(t.state.field(ep).diagnostics,e);r&&i.apply(t,r.from,r.to);},l=i.name,o=r[s]?l.indexOf(r[s]):-1,u=o<0?l:[l.slice(0,o),wa("u",l.slice(o,o+1)),l.slice(o+1)];return wa("button",{type:"button","class":"cm-diagnosticAction",onclick:h,onmousedown:h,"aria-label":" Action: ".concat(l).concat(o<0?"":" (access key \"".concat(r[s],")\""),".")},u);}),e.source&&wa("div",{"class":"cm-diagnosticSource"},e.source));}function dp(t){return function(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:'viewBox="0 0 40 40"';return"url('data:image/svg+xml,<svg xmlns=\"http://www.w3.org/2000/svg\" ".concat(e,">").concat(encodeURIComponent(t),"</svg>')");}("<path d=\"m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0\" stroke=\"".concat(t,"\" fill=\"none\" stroke-width=\".7\"/>"),'width="6" height="3"');}function mp(t){return"error"==t?4:"warning"==t?3:"info"==t?2:1;}function gp(t){var e="hint",i=1;var _iterator240=_createForOfIteratorHelper(t),_step240;try{for(_iterator240.s();!(_step240=_iterator240.n()).done;){var _s206=_step240.value;var _t303=mp(_s206.severity);_t303>i&&(i=_t303,e=_s206.severity);}}catch(err){_iterator240.e(err);}finally{_iterator240.f();}return e;}_export({F:qh,G:Gn,H:Mu,J:eh,c:Go,d:qo,g:Xo,j:Sc,k:xc,l:yo,n:Cd,p:go,r:Dl,s:Ul,x:Ud,z:Kd,I:void 0});return{setters:[],execute:function execute(){t=[],e=[];(function(){var i="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(function(t){return t?parseInt(t,36):1;});for(var _s3=0,_r3=0;_s3<i.length;_s3++)(_s3%2?e:t).push(_r3+=i[_s3]);})();a=/*#__PURE__*/function(){function a(){_classCallCheck(this,a);}return _createClass(a,[{key:"lineAt",value:function lineAt(t){if(t<0||t>this.length)throw new RangeError("Invalid position ".concat(t," in document of length ").concat(this.length));return this.lineInner(t,!1,1,0);}},{key:"line",value:function line(t){if(t<1||t>this.lines)throw new RangeError("Invalid line number ".concat(t," in ").concat(this.lines,"-line document"));return this.lineInner(t,!0,1,0);}},{key:"replace",value:function replace(t,e,i){var _k=k(this,t,e);var _k2=_slicedToArray(_k,2);t=_k2[0];e=_k2[1];var s=[];return this.decompose(0,t,s,2),i.length&&i.decompose(0,i.length,s,3),this.decompose(e,this.length,s,1),d.from(s,this.length-(e-t)+i.length);}},{key:"append",value:function append(t){return this.replace(this.length,this.length,t);}},{key:"slice",value:function slice(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:this.length;var _k3=k(this,t,e);var _k4=_slicedToArray(_k3,2);t=_k4[0];e=_k4[1];var i=[];return this.decompose(t,e,i,0),d.from(i,e-t);}},{key:"eq",value:function eq(t){if(t==this)return!0;if(t.length!=this.length||t.lines!=this.lines)return!1;var e=this.scanIdentical(t,1),i=this.length-this.scanIdentical(t,-1),s=new g(this),r=new g(t);for(var _t2=e,_n3=e;;){if(s.next(_t2),r.next(_t2),_t2=0,s.lineBreak!=r.lineBreak||s.done!=r.done||s.value!=r.value)return!1;if(_n3+=s.value.length,s.done||_n3>=i)return!0;}}},{key:"iter",value:function iter(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;return new g(this,t);}},{key:"iterRange",value:function iterRange(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:this.length;return new w(this,t,e);}},{key:"iterLines",value:function iterLines(t,e){var i;if(null==t)i=this.iter();else{null==e&&(e=this.lines+1);var _s5=this.line(t).from;i=this.iterRange(_s5,Math.max(_s5,e==this.lines+1?this.length:e<=1?0:this.line(e-1).to));}return new b(i);}},{key:"toString",value:function toString(){return this.sliceString(0);}},{key:"toJSON",value:function toJSON(){var t=[];return this.flatten(t),t;}}],[{key:"of",value:function of(t){if(0==t.length)throw new RangeError("A document must have at least one line");return 1!=t.length||t[0]?t.length<=32?new c(t):d.from(c.split(t,[])):a.empty;}}]);}();c=/*#__PURE__*/function(_a2){function c(t){var _this;var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:function(t){var e=-1;var _iterator=_createForOfIteratorHelper(t),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var _i3=_step.value;e+=_i3.length+1;}}catch(err){_iterator.e(err);}finally{_iterator.f();}return e;}(t);_classCallCheck(this,c);_this=_callSuper(this,c),_this.text=t,_this.length=e;return _this;}_inherits(c,_a2);return _createClass(c,[{key:"lines",get:function get(){return this.text.length;}},{key:"children",get:function get(){return null;}},{key:"lineInner",value:function lineInner(t,e,i,s){for(var _r5=0;;_r5++){var _n4=this.text[_r5],_h3=s+_n4.length;if((e?i:_h3)>=t)return new v(s,_h3,i,_n4);s=_h3+1,i++;}}},{key:"decompose",value:function decompose(t,e,i,s){var r=t<=0&&e>=this.length?this:new c(m(this.text,t,e),Math.min(e,this.length)-Math.max(0,t));if(1&s){var _t3=i.pop(),_e2=p(r.text,_t3.text.slice(),0,r.length);if(_e2.length<=32)i.push(new c(_e2,_t3.length+r.length));else{var _t4=_e2.length>>1;i.push(new c(_e2.slice(0,_t4)),new c(_e2.slice(_t4)));}}else i.push(r);}},{key:"replace",value:function replace(t,e,i){if(!(i instanceof c))return _superPropGet(c,"replace",this,3)([t,e,i]);var _k5=k(this,t,e);var _k6=_slicedToArray(_k5,2);t=_k6[0];e=_k6[1];var s=p(this.text,p(i.text,m(this.text,0,t)),e),r=this.length+i.length-(e-t);return s.length<=32?new c(s,r):d.from(c.split(s,[]),r);}},{key:"sliceString",value:function sliceString(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:this.length;var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:"\n";var _k7=k(this,t,e);var _k8=_slicedToArray(_k7,2);t=_k8[0];e=_k8[1];var s="";for(var _r6=0,_n5=0;_r6<=e&&_n5<this.text.length;_n5++){var _h4=this.text[_n5],_l2=_r6+_h4.length;_r6>t&&_n5&&(s+=i),t<_l2&&e>_r6&&(s+=_h4.slice(Math.max(0,t-_r6),e-_r6)),_r6=_l2+1;}return s;}},{key:"flatten",value:function flatten(t){var _iterator2=_createForOfIteratorHelper(this.text),_step2;try{for(_iterator2.s();!(_step2=_iterator2.n()).done;){var _e3=_step2.value;t.push(_e3);}}catch(err){_iterator2.e(err);}finally{_iterator2.f();}}},{key:"scanIdentical",value:function scanIdentical(){return 0;}}],[{key:"split",value:function split(t,e){var i=[],s=-1;var _iterator3=_createForOfIteratorHelper(t),_step3;try{for(_iterator3.s();!(_step3=_iterator3.n()).done;){var _r7=_step3.value;i.push(_r7),s+=_r7.length+1,32==i.length&&(e.push(new c(i,s)),i=[],s=-1);}}catch(err){_iterator3.e(err);}finally{_iterator3.f();}return s>-1&&e.push(new c(i,s)),e;}}]);}(a);d=/*#__PURE__*/function(_a3){function d(t,e){var _this2;_classCallCheck(this,d);_this2=_callSuper(this,d),_this2.children=t,_this2.length=e,_this2.lines=0;var _iterator4=_createForOfIteratorHelper(t),_step4;try{for(_iterator4.s();!(_step4=_iterator4.n()).done;){var _e4=_step4.value;_this2.lines+=_e4.lines;}}catch(err){_iterator4.e(err);}finally{_iterator4.f();}return _this2;}_inherits(d,_a3);return _createClass(d,[{key:"lineInner",value:function lineInner(t,e,i,s){for(var _r8=0;;_r8++){var _n6=this.children[_r8],_h5=s+_n6.length,_l3=i+_n6.lines-1;if((e?_l3:_h5)>=t)return _n6.lineInner(t,e,i,s);s=_h5+1,i=_l3+1;}}},{key:"decompose",value:function decompose(t,e,i,s){for(var _r9=0,_n7=0;_n7<=e&&_r9<this.children.length;_r9++){var _h6=this.children[_r9],_l4=_n7+_h6.length;if(t<=_l4&&e>=_n7){var _r10=s&((_n7<=t?1:0)|(_l4>=e?2:0));_n7>=t&&_l4<=e&&!_r10?i.push(_h6):_h6.decompose(t-_n7,e-_n7,i,_r10);}_n7=_l4+1;}}},{key:"replace",value:function replace(t,e,i){var _k9,_k10;if(_k9=k(this,t,e),_k10=_slicedToArray(_k9,2),t=_k10[0],e=_k10[1],i.lines<this.lines)for(var _s6=0,_r11=0;_s6<this.children.length;_s6++){var _n8=this.children[_s6],_h7=_r11+_n8.length;if(t>=_r11&&e<=_h7){var _l5=_n8.replace(t-_r11,e-_r11,i),_o2=this.lines-_n8.lines+_l5.lines;if(_l5.lines<_o2>>4&&_l5.lines>_o2>>6){var _r12=this.children.slice();return _r12[_s6]=_l5,new d(_r12,this.length-(e-t)+i.length);}return _superPropGet(d,"replace",this,3)([_r11,_h7,_l5]);}_r11=_h7+1;}return _superPropGet(d,"replace",this,3)([t,e,i]);}},{key:"sliceString",value:function sliceString(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:this.length;var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:"\n";var _k11=k(this,t,e);var _k12=_slicedToArray(_k11,2);t=_k12[0];e=_k12[1];var s="";for(var _r13=0,_n9=0;_r13<this.children.length&&_n9<=e;_r13++){var _h8=this.children[_r13],_l6=_n9+_h8.length;_n9>t&&_r13&&(s+=i),t<_l6&&e>_n9&&(s+=_h8.sliceString(t-_n9,e-_n9,i)),_n9=_l6+1;}return s;}},{key:"flatten",value:function flatten(t){var _iterator5=_createForOfIteratorHelper(this.children),_step5;try{for(_iterator5.s();!(_step5=_iterator5.n()).done;){var _e5=_step5.value;_e5.flatten(t);}}catch(err){_iterator5.e(err);}finally{_iterator5.f();}}},{key:"scanIdentical",value:function scanIdentical(t,e){if(!(t instanceof d))return 0;var i=0,_ref=e>0?[0,0,this.children.length,t.children.length]:[this.children.length-1,t.children.length-1,-1,-1],_ref2=_slicedToArray(_ref,4),s=_ref2[0],r=_ref2[1],n=_ref2[2],h=_ref2[3];for(;;s+=e,r+=e){if(s==n||r==h)return i;var _l7=this.children[s],_o3=t.children[r];if(_l7!=_o3)return i+_l7.scanIdentical(_o3,e);i+=_l7.length+1;}}}],[{key:"from",value:function from(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:t.reduce(function(t,e){return t+e.length+1;},-1);var i=0;var _iterator6=_createForOfIteratorHelper(t),_step6;try{for(_iterator6.s();!(_step6=_iterator6.n()).done;){var _e8=_step6.value;i+=_e8.lines;}}catch(err){_iterator6.e(err);}finally{_iterator6.f();}if(i<32){var _i4=[];var _iterator7=_createForOfIteratorHelper(t),_step7;try{for(_iterator7.s();!(_step7=_iterator7.n()).done;){var _e6=_step7.value;_e6.flatten(_i4);}}catch(err){_iterator7.e(err);}finally{_iterator7.f();}return new c(_i4,e);}var s=Math.max(32,i>>5),r=s<<1,n=s>>1,h=[],l=0,o=-1,u=[];function f(t){var e;if(t.lines>r&&t instanceof d){var _iterator8=_createForOfIteratorHelper(t.children),_step8;try{for(_iterator8.s();!(_step8=_iterator8.n()).done;){var _e7=_step8.value;f(_e7);}}catch(err){_iterator8.e(err);}finally{_iterator8.f();}}else t.lines>n&&(l>n||!l)?(a(),h.push(t)):t instanceof c&&l&&(e=u[u.length-1])instanceof c&&t.lines+e.lines<=32?(l+=t.lines,o+=t.length+1,u[u.length-1]=new c(e.text.concat(t.text),e.length+1+t.length)):(l+t.lines>s&&a(),l+=t.lines,o+=t.length+1,u.push(t));}function a(){0!=l&&(h.push(1==u.length?u[0]:d.from(u,o)),o=-1,l=u.length=0);}var _iterator9=_createForOfIteratorHelper(t),_step9;try{for(_iterator9.s();!(_step9=_iterator9.n()).done;){var _e9=_step9.value;f(_e9);}}catch(err){_iterator9.e(err);}finally{_iterator9.f();}return a(),1==h.length?h[0]:new d(h,e);}}]);}(a);a.empty=new c([""],0);g=/*#__PURE__*/function(){function g(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;_classCallCheck(this,g);this.dir=e,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[t],this.offsets=[e>0?1:(t instanceof c?t.text.length:t.children.length)<<1];}return _createClass(g,[{key:"nextInner",value:function nextInner(t,e){for(this.done=this.lineBreak=!1;;){var _i5=this.nodes.length-1,_s7=this.nodes[_i5],_r15=this.offsets[_i5],_n11=_r15>>1,_h10=_s7 instanceof c?_s7.text.length:_s7.children.length;if(_n11==(e>0?_h10:0)){if(0==_i5)return this.done=!0,this.value="",this;e>0&&this.offsets[_i5-1]++,this.nodes.pop(),this.offsets.pop();}else if((1&_r15)==(e>0?0:1)){if(this.offsets[_i5]+=e,0==t)return this.lineBreak=!0,this.value="\n",this;t--;}else if(_s7 instanceof c){var _r16=_s7.text[_n11+(e<0?-1:0)];if(this.offsets[_i5]+=e,_r16.length>Math.max(0,t))return this.value=0==t?_r16:e>0?_r16.slice(t):_r16.slice(0,_r16.length-t),this;t-=_r16.length;}else{var _r17=_s7.children[_n11+(e<0?-1:0)];t>_r17.length?(t-=_r17.length,this.offsets[_i5]+=e):(e<0&&this.offsets[_i5]--,this.nodes.push(_r17),this.offsets.push(e>0?1:(_r17 instanceof c?_r17.text.length:_r17.children.length)<<1));}}}},{key:"next",value:function next(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return t<0&&(this.nextInner(-t,-this.dir),t=this.value.length),this.nextInner(t,this.dir);}}]);}();w=/*#__PURE__*/function(){function w(t,e,i){_classCallCheck(this,w);this.value="",this.done=!1,this.cursor=new g(t,e>i?-1:1),this.pos=e>i?t.length:0,this.from=Math.min(e,i),this.to=Math.max(e,i);}return _createClass(w,[{key:"nextInner",value:function nextInner(t,e){if(e<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;t+=Math.max(0,e<0?this.pos-this.to:this.from-this.pos);var i=e<0?this.pos-this.from:this.to-this.pos;t>i&&(t=i),i-=t;var _this$cursor$next=this.cursor.next(t),s=_this$cursor$next.value;return this.pos+=(s.length+t)*e,this.value=s.length<=i?s:e<0?s.slice(s.length-i):s.slice(0,i),this.done=!this.value,this;}},{key:"next",value:function next(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return t<0?t=Math.max(t,this.from-this.pos):t>0&&(t=Math.min(t,this.to-this.pos)),this.nextInner(t,this.cursor.dir);}},{key:"lineBreak",get:function get(){return this.cursor.lineBreak&&""!=this.value;}}]);}();b=/*#__PURE__*/function(){function b(t){_classCallCheck(this,b);this.inner=t,this.afterBreak=!0,this.value="",this.done=!1;}return _createClass(b,[{key:"next",value:function next(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var _this$inner$next=this.inner.next(t),e=_this$inner$next.done,i=_this$inner$next.lineBreak,s=_this$inner$next.value;return e&&this.afterBreak?(this.value="",this.afterBreak=!1):e?(this.done=!0,this.value=""):i?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=s,this.afterBreak=!1),this;}},{key:"lineBreak",get:function get(){return!1;}}]);}();"undefined"!=typeof Symbol&&(a.prototype[Symbol.iterator]=function(){return this.iter();},g.prototype[Symbol.iterator]=w.prototype[Symbol.iterator]=b.prototype[Symbol.iterator]=function(){return this;});v=/*#__PURE__*/function(){function v(t,e,i,s){_classCallCheck(this,v);this.from=t,this.to=e,this.number=i,this.text=s;}return _createClass(v,[{key:"length",get:function get(){return this.to-this.from;}}]);}();A=/\r\n?|\n/;C=function(t){return t[t.Simple=0]="Simple",t[t.TrackDel=1]="TrackDel",t[t.TrackBefore=2]="TrackBefore",t[t.TrackAfter=3]="TrackAfter",t;}(C||(C={}));D=/*#__PURE__*/function(){function D(t){_classCallCheck(this,D);this.sections=t;}return _createClass(D,[{key:"length",get:function get(){var t=0;for(var _e10=0;_e10<this.sections.length;_e10+=2)t+=this.sections[_e10];return t;}},{key:"newLength",get:function get(){var t=0;for(var _e11=0;_e11<this.sections.length;_e11+=2){var _i6=this.sections[_e11+1];t+=_i6<0?this.sections[_e11]:_i6;}return t;}},{key:"empty",get:function get(){return 0==this.sections.length||2==this.sections.length&&this.sections[1]<0;}},{key:"iterGaps",value:function iterGaps(t){for(var _e12=0,_i7=0,_s8=0;_e12<this.sections.length;){var _r18=this.sections[_e12++],_n12=this.sections[_e12++];_n12<0?(t(_i7,_s8,_r18),_s8+=_r18):_s8+=_n12,_i7+=_r18;}}},{key:"iterChangedRanges",value:function iterChangedRanges(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!1;R(this,t,e);}},{key:"invertedDesc",get:function get(){var t=[];for(var _e13=0;_e13<this.sections.length;){var _i8=this.sections[_e13++],_s9=this.sections[_e13++];_s9<0?t.push(_i8,_s9):t.push(_s9,_i8);}return new D(t);}},{key:"composeDesc",value:function composeDesc(t){return this.empty?t:t.empty?this:B(this,t);}},{key:"mapDesc",value:function mapDesc(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!1;return t.empty?this:T(this,t,e);}},{key:"mapPos",value:function mapPos(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:-1;var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:C.Simple;var s=0,r=0;for(var _n13=0;_n13<this.sections.length;){var _h11=this.sections[_n13++],_l9=this.sections[_n13++],_o5=s+_h11;if(_l9<0){if(_o5>t)return r+(t-s);r+=_h11;}else{if(i!=C.Simple&&_o5>=t&&(i==C.TrackDel&&s<t&&_o5>t||i==C.TrackBefore&&s<t||i==C.TrackAfter&&_o5>t))return null;if(_o5>t||_o5==t&&e<0&&!_h11)return t==s||e<0?r:r+_l9;r+=_l9;}s=_o5;}if(t>s)throw new RangeError("Position ".concat(t," is out of range for changeset of length ").concat(s));return r;}},{key:"touchesRange",value:function touchesRange(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:t;for(var _i9=0,_s10=0;_i9<this.sections.length&&_s10<=e;){var _r19=_s10+this.sections[_i9++];if(this.sections[_i9++]>=0&&_s10<=e&&_r19>=t)return!(_s10<t&&_r19>e)||"cover";_s10=_r19;}return!1;}},{key:"toString",value:function toString(){var t="";for(var _e14=0;_e14<this.sections.length;){var _i10=this.sections[_e14++],_s11=this.sections[_e14++];t+=(t?" ":"")+_i10+(_s11>=0?":"+_s11:"");}return t;}},{key:"toJSON",value:function toJSON(){return this.sections;}}],[{key:"fromJSON",value:function fromJSON(t){if(!Array.isArray(t)||t.length%2||t.some(function(t){return"number"!=typeof t;}))throw new RangeError("Invalid JSON representation of ChangeDesc");return new D(t);}},{key:"create",value:function create(t){return new D(t);}}]);}();O=/*#__PURE__*/function(_D){function O(t,e){var _this3;_classCallCheck(this,O);_this3=_callSuper(this,O,[t]),_this3.inserted=e;return _this3;}_inherits(O,_D);return _createClass(O,[{key:"apply",value:function apply(t){if(this.length!=t.length)throw new RangeError("Applying change set to a document with the wrong length");return R(this,function(e,i,s,r,n){return t=t.replace(s,s+(i-e),n);},!1),t;}},{key:"mapDesc",value:function mapDesc(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!1;return T(this,t,e,!0);}},{key:"invert",value:function invert(t){var e=this.sections.slice(),i=[];for(var _s12=0,_r20=0;_s12<e.length;_s12+=2){var _n14=e[_s12],_h12=e[_s12+1];if(_h12>=0){e[_s12]=_h12,e[_s12+1]=_n14;var _l10=_s12>>1;for(;i.length<_l10;)i.push(a.empty);i.push(_n14?t.slice(_r20,_r20+_n14):a.empty);}_r20+=_n14;}return new O(e,i);}},{key:"compose",value:function compose(t){return this.empty?t:t.empty?this:B(this,t,!0);}},{key:"map",value:function map(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!1;return t.empty?this:T(this,t,e,!0);}},{key:"iterChanges",value:function iterChanges(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!1;R(this,t,e);}},{key:"desc",get:function get(){return D.create(this.sections);}},{key:"filter",value:function filter(t){var e=[],i=[],s=[],r=new L(this);t:for(var _n15=0,_h13=0;;){var _l11=_n15==t.length?1e9:t[_n15++];for(;_h13<_l11||_h13==_l11&&0==r.len;){if(r.done)break t;var _t5=Math.min(r.len,_l11-_h13);E(s,_t5,-1);var _n16=-1==r.ins?-1:0==r.off?r.ins:0;E(e,_t5,_n16),_n16>0&&I(i,e,r.text),r.forward(_t5),_h13+=_t5;}var _o6=t[_n15++];for(;_h13<_o6;){if(r.done)break t;var _t6=Math.min(r.len,_o6-_h13);E(e,_t6,-1),E(s,_t6,-1==r.ins?-1:0==r.off?r.ins:0),r.forward(_t6),_h13+=_t6;}}return{changes:new O(e,i),filtered:D.create(s)};}},{key:"toJSON",value:function toJSON(){var t=[];for(var _e15=0;_e15<this.sections.length;_e15+=2){var _i11=this.sections[_e15],_s13=this.sections[_e15+1];_s13<0?t.push(_i11):0==_s13?t.push([_i11]):t.push([_i11].concat(this.inserted[_e15>>1].toJSON()));}return t;}}],[{key:"of",value:function of(t,e,i){var s=[],r=[],n=0,h=null;function l(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:!1;if(!t&&!s.length)return;n<e&&E(s,e-n,-1);var i=new O(s,r);h=h?h.compose(i.map(h)):i,s=[],r=[],n=0;}return function t(o){if(Array.isArray(o)){var _iterator10=_createForOfIteratorHelper(o),_step10;try{for(_iterator10.s();!(_step10=_iterator10.n()).done;){var _e16=_step10.value;t(_e16);}}catch(err){_iterator10.e(err);}finally{_iterator10.f();}}else if(o instanceof O){if(o.length!=e)throw new RangeError("Mismatched change set length (got ".concat(o.length,", expected ").concat(e,")"));l(),h=h?h.compose(o.map(h)):o;}else{var _t7=o.from,_o$to=o.to,_h14=_o$to===void 0?_t7:_o$to,_u2=o.insert;if(_t7>_h14||_t7<0||_h14>e)throw new RangeError("Invalid change range ".concat(_t7," to ").concat(_h14," (in doc of length ").concat(e,")"));var _f2=_u2?"string"==typeof _u2?a.of(_u2.split(i||A)):_u2:a.empty,_c2=_f2.length;if(_t7==_h14&&0==_c2)return;_t7<n&&l(),_t7>n&&E(s,_t7-n,-1),E(s,_h14-_t7,_c2),I(r,s,_f2),n=_h14;}}(t),l(!h),h;}},{key:"empty",value:function empty(t){return new O(t?[t,-1]:[],[]);}},{key:"fromJSON",value:function fromJSON(t){if(!Array.isArray(t))throw new RangeError("Invalid JSON representation of ChangeSet");var e=[],i=[];for(var _s14=0;_s14<t.length;_s14++){var _r21=t[_s14];if("number"==typeof _r21)e.push(_r21,-1);else{if(!Array.isArray(_r21)||"number"!=typeof _r21[0]||_r21.some(function(t,e){return e&&"string"!=typeof t;}))throw new RangeError("Invalid JSON representation of ChangeSet");if(1==_r21.length)e.push(_r21[0],0);else{for(;i.length<_s14;)i.push(a.empty);i[_s14]=a.of(_r21.slice(1)),e.push(_r21[0],i[_s14].length);}}}return new O(e,i);}},{key:"createSet",value:function createSet(t,e){return new O(t,e);}}]);}(D);L=/*#__PURE__*/function(){function L(t){_classCallCheck(this,L);this.set=t,this.i=0,this.next();}return _createClass(L,[{key:"next",value:function next(){var t=this.set.sections;this.i<t.length?(this.len=t[this.i++],this.ins=t[this.i++]):(this.len=0,this.ins=-2),this.off=0;}},{key:"done",get:function get(){return-2==this.ins;}},{key:"len2",get:function get(){return this.ins<0?this.len:this.ins;}},{key:"text",get:function get(){var t=this.set.inserted,e=this.i-2>>1;return e>=t.length?a.empty:t[e];}},{key:"textBit",value:function textBit(t){var e=this.set.inserted,i=this.i-2>>1;return i>=e.length&&!t?a.empty:e[i].slice(this.off,null==t?void 0:this.off+t);}},{key:"forward",value:function forward(t){t==this.len?this.next():(this.len-=t,this.off+=t);}},{key:"forward2",value:function forward2(t){-1==this.ins?this.forward(t):t==this.ins?this.next():(this.ins-=t,this.off+=t);}}]);}();N=/*#__PURE__*/function(){function N(t,e,i){_classCallCheck(this,N);this.from=t,this.to=e,this.flags=i;}return _createClass(N,[{key:"anchor",get:function get(){return 32&this.flags?this.to:this.from;}},{key:"head",get:function get(){return 32&this.flags?this.from:this.to;}},{key:"empty",get:function get(){return this.from==this.to;}},{key:"assoc",get:function get(){return 8&this.flags?-1:16&this.flags?1:0;}},{key:"bidiLevel",get:function get(){var t=7&this.flags;return 7==t?null:t;}},{key:"goalColumn",get:function get(){var t=this.flags>>6;return 16777215==t?void 0:t;}},{key:"map",value:function map(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:-1;var i,s;return this.empty?i=s=t.mapPos(this.from,e):(i=t.mapPos(this.from,1),s=t.mapPos(this.to,-1)),i==this.from&&s==this.to?this:new N(i,s,this.flags);}},{key:"extend",value:function extend(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:t;if(t<=this.anchor&&e>=this.anchor)return $.range(t,e);var i=Math.abs(t-this.anchor)>Math.abs(e-this.anchor)?t:e;return $.range(this.anchor,i);}},{key:"eq",value:function eq(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!1;return!(this.anchor!=t.anchor||this.head!=t.head||e&&this.empty&&this.assoc!=t.assoc);}},{key:"toJSON",value:function toJSON(){return{anchor:this.anchor,head:this.head};}}],[{key:"fromJSON",value:function fromJSON(t){if(!t||"number"!=typeof t.anchor||"number"!=typeof t.head)throw new RangeError("Invalid JSON representation for SelectionRange");return $.range(t.anchor,t.head);}},{key:"create",value:function create(t,e,i){return new N(t,e,i);}}]);}();_export("m",$=/*#__PURE__*/function(){function $(t,e){_classCallCheck(this,$);this.ranges=t,this.mainIndex=e;}return _createClass($,[{key:"map",value:function map(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:-1;return t.empty?this:$.create(this.ranges.map(function(i){return i.map(t,e);}),this.mainIndex);}},{key:"eq",value:function eq(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!1;if(this.ranges.length!=t.ranges.length||this.mainIndex!=t.mainIndex)return!1;for(var _i16=0;_i16<this.ranges.length;_i16++)if(!this.ranges[_i16].eq(t.ranges[_i16],e))return!1;return!0;}},{key:"main",get:function get(){return this.ranges[this.mainIndex];}},{key:"asSingle",value:function asSingle(){return 1==this.ranges.length?this:new $([this.main],0);}},{key:"addRange",value:function addRange(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!0;return $.create([t].concat(this.ranges),e?0:this.mainIndex+1);}},{key:"replaceRange",value:function replaceRange(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:this.mainIndex;var i=this.ranges.slice();return i[e]=t,$.create(i,this.mainIndex);}},{key:"toJSON",value:function toJSON(){return{ranges:this.ranges.map(function(t){return t.toJSON();}),main:this.mainIndex};}}],[{key:"fromJSON",value:function fromJSON(t){if(!t||!Array.isArray(t.ranges)||"number"!=typeof t.main||t.main>=t.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new $(t.ranges.map(function(t){return N.fromJSON(t);}),t.main);}},{key:"single",value:function single(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:t;return new $([$.range(t,e)],0);}},{key:"create",value:function create(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;if(0==t.length)throw new RangeError("A selection needs at least one range");for(var _i17=0,_s15=0;_s15<t.length;_s15++){var _r23=t[_s15];if(_r23.empty?_r23.from<=_i17:_r23.from<_i17)return $.normalized(t.slice(),e);_i17=_r23.to;}return new $(t,e);}},{key:"cursor",value:function cursor(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var i=arguments.length>2?arguments[2]:undefined;var s=arguments.length>3?arguments[3]:undefined;return N.create(t,t,(0==e?0:e<0?8:16)|(null==i?7:Math.min(6,i))|(null!=s?s:16777215)<<6);}},{key:"range",value:function range(t,e,i,s){var r=(null!=i?i:16777215)<<6|(null==s?7:Math.min(6,s));return e<t?N.create(e,t,48|r):N.create(t,e,(e>t?8:0)|r);}},{key:"normalized",value:function normalized(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var i=t[e];t.sort(function(t,e){return t.from-e.from;}),e=t.indexOf(i);for(var _i18=1;_i18<t.length;_i18++){var _s16=t[_i18],_r24=t[_i18-1];if(_s16.empty?_s16.from<=_r24.to:_s16.from<_r24.to){var _n18=_r24.from,_h16=Math.max(_s16.to,_r24.to);_i18<=e&&e--,t.splice(--_i18,2,_s16.anchor>_s16.head?$.range(_h16,_n18):$.range(_n18,_h16));}}return new $(t,e);}}]);}());P=0;z=/*#__PURE__*/function(){function z(t,e,i,s,r){_classCallCheck(this,z);this.combine=t,this.compareInput=e,this.compare=i,this.isStatic=s,this.id=P++,this["default"]=t([]),this.extensions="function"==typeof r?r(this):r;}return _createClass(z,[{key:"reader",get:function get(){return this;}},{key:"of",value:function of(t){return new F([],this,0,t);}},{key:"compute",value:function compute(t,e){if(this.isStatic)throw new Error("Can't compute a static facet");return new F(t,this,1,e);}},{key:"computeN",value:function computeN(t,e){if(this.isStatic)throw new Error("Can't compute a static facet");return new F(t,this,2,e);}},{key:"from",value:function from(t,e){return e||(e=function e(t){return t;}),this.compute([t],function(i){return e(i.field(t));});}}],[{key:"define",value:function define(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return new z(t.combine||function(t){return t;},t.compareInput||function(t,e){return t===e;},t.compare||(t.combine?function(t,e){return t===e;}:H),!!t["static"],t.enables);}}]);}();F=/*#__PURE__*/function(){function F(t,e,i,s){_classCallCheck(this,F);this.dependencies=t,this.facet=e,this.type=i,this.value=s,this.id=P++;}return _createClass(F,[{key:"dynamicSlot",value:function dynamicSlot(t){var _this4=this;var e;var i=this.value,s=this.facet.compareInput,r=this.id,n=t[r]>>1,h=2==this.type,l=!1,o=!1,u=[];var _iterator12=_createForOfIteratorHelper(this.dependencies),_step12;try{for(_iterator12.s();!(_step12=_iterator12.n()).done;){var _i20=_step12.value;"doc"==_i20?l=!0:"selection"==_i20?o=!0:1&(null!==(e=t[_i20.id])&&void 0!==e?e:1)||u.push(t[_i20.id]);}}catch(err){_iterator12.e(err);}finally{_iterator12.f();}return{create:function create(t){return t.values[n]=i(t),1;},update:function update(t,e){if(l&&e.docChanged||o&&(e.docChanged||e.selection)||V(t,u)){var _e20=i(t);if(h?!W(_e20,t.values[n],s):!s(_e20,t.values[n]))return t.values[n]=_e20,1;}return 0;},reconfigure:function reconfigure(t,e){var l,o=e.config.address[r];if(null!=o){var _r25=rt(e,o);if(_this4.dependencies.every(function(i){return i instanceof z?e.facet(i)===t.facet(i):!(i instanceof J)||e.field(i,!1)==t.field(i,!1);})||(h?W(l=i(t),_r25,s):s(l=i(t),_r25)))return t.values[n]=_r25,0;}else l=i(t);return t.values[n]=l,1;}};}}]);}();U=z.define({"static":!0});J=/*#__PURE__*/function(){function J(t,e,i,s,r){_classCallCheck(this,J);this.id=t,this.createF=e,this.updateF=i,this.compareF=s,this.spec=r,this.provides=void 0;}return _createClass(J,[{key:"create",value:function create(t){var _this5=this;var e=t.facet(U).find(function(t){return t.field==_this5;});return((null==e?void 0:e.create)||this.createF)(t);}},{key:"slot",value:function slot(t){var _this6=this;var e=t[this.id]>>1;return{create:function create(t){return t.values[e]=_this6.create(t),1;},update:function update(t,i){var s=t.values[e],r=_this6.updateF(s,i);return _this6.compareF(s,r)?0:(t.values[e]=r,1);},reconfigure:function reconfigure(t,i){var s,r=t.facet(U),n=i.facet(U);return(s=r.find(function(t){return t.field==_this6;}))&&s!=n.find(function(t){return t.field==_this6;})?(t.values[e]=s.create(t),1):null!=i.config.address[_this6.id]?(t.values[e]=i.field(_this6),0):(t.values[e]=_this6.create(t),1);}};}},{key:"init",value:function init(t){return[this,U.of({field:this,create:t})];}},{key:"extension",get:function get(){return this;}}],[{key:"define",value:function define(t){var e=new J(P++,t.create,t.update,t.compare||function(t,e){return t===e;},t);return t.provide&&(e.provides=t.provide(e)),e;}}]);}();G=4,K=3,_=2,X=1;Q={highest:Y(0),high:Y(X),"default":Y(_),low:Y(K),lowest:Y(G)};Z=/*#__PURE__*/_createClass(function Z(t,e){_classCallCheck(this,Z);this.inner=t,this.prec=e;});_export("C",tt=/*#__PURE__*/function(){function tt(){_classCallCheck(this,tt);}return _createClass(tt,[{key:"of",value:function of(t){return new et(this,t);}},{key:"reconfigure",value:function reconfigure(t){return tt.reconfigure.of({compartment:this,extension:t});}},{key:"get",value:function get(t){return t.config.compartments.get(this);}}]);}());et=/*#__PURE__*/_createClass(function et(t,e){_classCallCheck(this,et);this.compartment=t,this.inner=e;});it=/*#__PURE__*/function(){function it(t,e,i,s,r,n){_classCallCheck(this,it);for(this.base=t,this.compartments=e,this.dynamicSlots=i,this.address=s,this.staticValues=r,this.facets=n,this.statusTemplate=[];this.statusTemplate.length<i.length;)this.statusTemplate.push(0);}return _createClass(it,[{key:"staticFacet",value:function staticFacet(t){var e=this.address[t.id];return null==e?t["default"]:this.staticValues[e>>1];}}],[{key:"resolve",value:function resolve(t,e,i){var s=[],r=Object.create(null),n=new Map();var _iterator16=_createForOfIteratorHelper(function(t,e,i){var s=[[],[],[],[],[]],r=new Map();function n(t,h){var l=r.get(t);if(null!=l){if(l<=h)return;var _e23=s[l].indexOf(t);_e23>-1&&s[l].splice(_e23,1),t instanceof et&&i["delete"](t.compartment);}if(r.set(t,h),Array.isArray(t)){var _iterator17=_createForOfIteratorHelper(t),_step17;try{for(_iterator17.s();!(_step17=_iterator17.n()).done;){var _e24=_step17.value;n(_e24,h);}}catch(err){_iterator17.e(err);}finally{_iterator17.f();}}else if(t instanceof et){if(i.has(t.compartment))throw new RangeError("Duplicate use of compartment in extensions");var _s20=e.get(t.compartment)||t.inner;i.set(t.compartment,_s20),n(_s20,h);}else if(t instanceof Z)n(t.inner,t.prec);else if(t instanceof J)s[h].push(t),t.provides&&n(t.provides,h);else if(t instanceof F)s[h].push(t),t.facet.extensions&&n(t.facet.extensions,_);else{var _e25=t.extension;if(!_e25)throw new Error("Unrecognized extension value in extension set (".concat(t,"). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks."));n(_e25,h);}}return n(t,_),s.reduce(function(t,e){return t.concat(e);});}(t,e,n)),_step16;try{for(_iterator16.s();!(_step16=_iterator16.n()).done;){var _i22=_step16.value;_i22 instanceof J?s.push(_i22):(r[_i22.facet.id]||(r[_i22.facet.id]=[])).push(_i22);}}catch(err){_iterator16.e(err);}finally{_iterator16.f();}var h=Object.create(null),l=[],o=[];var _loop=function _loop(){var t=_s19[_i21];h[t.id]=o.length<<1,o.push(function(e){return t.slot(e);});};for(var _i21=0,_s19=s;_i21<_s19.length;_i21++){_loop();}var u=null==i?void 0:i.config.facets;var _loop2=function _loop2(){var e=r[_t13],s=e[0].facet,n=u&&u[_t13]||[];if(e.every(function(t){return 0==t.type;})){if(h[s.id]=l.length<<1|1,H(n,e))l.push(i.facet(s));else{var _t14=s.combine(e.map(function(t){return t.value;}));l.push(i&&s.compare(_t14,i.facet(s))?i.facet(s):_t14);}}else{var _iterator18=_createForOfIteratorHelper(e),_step18;try{var _loop3=function _loop3(){var t=_step18.value;0==t.type?(h[t.id]=l.length<<1|1,l.push(t.value)):(h[t.id]=o.length<<1,o.push(function(e){return t.dynamicSlot(e);}));};for(_iterator18.s();!(_step18=_iterator18.n()).done;){_loop3();}}catch(err){_iterator18.e(err);}finally{_iterator18.f();}h[s.id]=o.length<<1,o.push(function(t){return q(t,s,e);});}};for(var _t13 in r){_loop2();}var f=o.map(function(t){return t(h);});return new it(t,n,f,h,l,r);}}]);}();nt=z.define(),ht=z.define({combine:function combine(t){return t.some(function(t){return t;});},"static":!0}),lt=z.define({combine:function combine(t){return t.length?t[0]:void 0;},"static":!0}),ot=z.define(),ut=z.define(),ft=z.define(),at=z.define({combine:function combine(t){return!!t.length&&t[0];}});ct=/*#__PURE__*/function(){function ct(t,e){_classCallCheck(this,ct);this.type=t,this.value=e;}return _createClass(ct,null,[{key:"define",value:function define(){return new dt();}}]);}();dt=/*#__PURE__*/function(){function dt(){_classCallCheck(this,dt);}return _createClass(dt,[{key:"of",value:function of(t){return new ct(this,t);}}]);}();pt=/*#__PURE__*/function(){function pt(t){_classCallCheck(this,pt);this.map=t;}return _createClass(pt,[{key:"of",value:function of(t){return new mt(this,t);}}]);}();mt=/*#__PURE__*/function(){function mt(t,e){_classCallCheck(this,mt);this.type=t,this.value=e;}return _createClass(mt,[{key:"map",value:function map(t){var e=this.type.map(this.value,t);return void 0===e?void 0:e==this.value?this:new mt(this.type,e);}},{key:"is",value:function is(t){return this.type==t;}}],[{key:"define",value:function define(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return new pt(t.map||function(t){return t;});}},{key:"mapEffects",value:function mapEffects(t,e){if(!t.length)return t;var i=[];var _iterator19=_createForOfIteratorHelper(t),_step19;try{for(_iterator19.s();!(_step19=_iterator19.n()).done;){var _s21=_step19.value;var _t15=_s21.map(e);_t15&&i.push(_t15);}}catch(err){_iterator19.e(err);}finally{_iterator19.f();}return i;}}]);}();mt.reconfigure=mt.define(),mt.appendConfig=mt.define();gt=/*#__PURE__*/function(){function gt(t,e,i,s,r,n){_classCallCheck(this,gt);this.startState=t,this.changes=e,this.selection=i,this.effects=s,this.annotations=r,this.scrollIntoView=n,this._doc=null,this._state=null,i&&j(i,e.newLength),r.some(function(t){return t.type==gt.time;})||(this.annotations=r.concat(gt.time.of(Date.now())));}return _createClass(gt,[{key:"newDoc",get:function get(){return this._doc||(this._doc=this.changes.apply(this.startState.doc));}},{key:"newSelection",get:function get(){return this.selection||this.startState.selection.map(this.changes);}},{key:"state",get:function get(){return this._state||this.startState.applyTransaction(this),this._state;}},{key:"annotation",value:function annotation(t){var _iterator20=_createForOfIteratorHelper(this.annotations),_step20;try{for(_iterator20.s();!(_step20=_iterator20.n()).done;){var _e26=_step20.value;if(_e26.type==t)return _e26.value;}}catch(err){_iterator20.e(err);}finally{_iterator20.f();}}},{key:"docChanged",get:function get(){return!this.changes.empty;}},{key:"reconfigured",get:function get(){return this.startState.config!=this.state.config;}},{key:"isUserEvent",value:function isUserEvent(t){var e=this.annotation(gt.userEvent);return!(!e||!(e==t||e.length>t.length&&e.slice(0,t.length)==t&&"."==e[t.length]));}}],[{key:"create",value:function create(t,e,i,s,r,n){return new gt(t,e,i,s,r,n);}}]);}();gt.time=ct.define(),gt.userEvent=ct.define(),gt.addToHistory=ct.define(),gt.remote=ct.define();yt=[];xt=function(t){return t[t.Word=0]="Word",t[t.Space=1]="Space",t[t.Other=2]="Other",t;}(xt||(xt={}));St=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;try{At=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u");}catch(t){}_export("A",Dt=/*#__PURE__*/function(){function Dt(t,e,i,s,r,n){_classCallCheck(this,Dt);this.config=t,this.doc=e,this.selection=i,this.values=s,this.status=t.statusTemplate.slice(),this.computeSlot=r,n&&(n._state=this);for(var _t16=0;_t16<this.config.dynamicSlots.length;_t16++)st(this,_t16<<1);this.computeSlot=null;}return _createClass(Dt,[{key:"field",value:function field(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!0;var i=this.config.address[t.id];if(null!=i)return st(this,i),rt(this,i);if(e)throw new RangeError("Field is not present in this state");}},{key:"update",value:function update(){for(var _len=arguments.length,t=new Array(_len),_key=0;_key<_len;_key++){t[_key]=arguments[_key];}return kt(this,t,!0);}},{key:"applyTransaction",value:function applyTransaction(t){var _this7=this;var e,i=this.config,_i26=i,s=_i26.base,r=_i26.compartments;var _iterator22=_createForOfIteratorHelper(t.effects),_step22;try{for(_iterator22.s();!(_step22=_iterator22.n()).done;){var _e30=_step22.value;_e30.is(tt.reconfigure)?(i&&(r=new Map(),i.compartments.forEach(function(t,e){return r.set(e,t);}),i=null),r.set(_e30.value.compartment,_e30.value.extension)):_e30.is(mt.reconfigure)?(i=null,s=_e30.value):_e30.is(mt.appendConfig)&&(i=null,s=Mt(s).concat(_e30.value));}}catch(err){_iterator22.e(err);}finally{_iterator22.f();}if(i)e=t.startState.values.slice();else{i=it.resolve(s,r,this),e=new Dt(i,this.doc,this.selection,i.dynamicSlots.map(function(){return null;}),function(t,e){return e.reconfigure(t,_this7);},null).values;}var n=t.startState.facet(ht)?t.newSelection:t.newSelection.asSingle();new Dt(i,t.newDoc,n,e,function(e,i){return i.update(e,t);},t);}},{key:"replaceSelection",value:function replaceSelection(t){return"string"==typeof t&&(t=this.toText(t)),this.changeByRange(function(e){return{changes:{from:e.from,to:e.to,insert:t},range:$.cursor(e.from+t.length)};});}},{key:"changeByRange",value:function changeByRange(t){var e=this.selection,i=t(e.ranges[0]),s=this.changes(i.changes),r=[i.range],n=Mt(i.effects);for(var _i27=1;_i27<e.ranges.length;_i27++){var _h18=t(e.ranges[_i27]),_l13=this.changes(_h18.changes),_o8=_l13.map(s);for(var _t17=0;_t17<_i27;_t17++)r[_t17]=r[_t17].map(_o8);var _u4=s.mapDesc(_l13,!0);r.push(_h18.range.map(_u4)),s=s.compose(_o8),n=mt.mapEffects(n,_o8).concat(mt.mapEffects(Mt(_h18.effects),_u4));}return{changes:s,selection:$.create(r,e.mainIndex),effects:n};}},{key:"changes",value:function changes(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];return t instanceof O?t:O.of(t,this.doc.length,this.facet(Dt.lineSeparator));}},{key:"toText",value:function toText(t){return a.of(t.split(this.facet(Dt.lineSeparator)||A));}},{key:"sliceDoc",value:function sliceDoc(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:this.doc.length;return this.doc.sliceString(t,e,this.lineBreak);}},{key:"facet",value:function facet(t){var e=this.config.address[t.id];return null==e?t["default"]:(st(this,e),rt(this,e));}},{key:"toJSON",value:function toJSON(t){var e={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(t)for(var _i28 in t){var _s25=t[_i28];_s25 instanceof J&&null!=this.config.address[_s25.id]&&(e[_i28]=_s25.spec.toJSON(this.field(t[_i28]),this));}return e;}},{key:"tabSize",get:function get(){return this.facet(Dt.tabSize);}},{key:"lineBreak",get:function get(){return this.facet(Dt.lineSeparator)||"\n";}},{key:"readOnly",get:function get(){return this.facet(at);}},{key:"phrase",value:function phrase(t){for(var _len2=arguments.length,e=new Array(_len2>1?_len2-1:0),_key2=1;_key2<_len2;_key2++){e[_key2-1]=arguments[_key2];}var _iterator23=_createForOfIteratorHelper(this.facet(Dt.phrases)),_step23;try{for(_iterator23.s();!(_step23=_iterator23.n()).done;){var _e31=_step23.value;if(Object.prototype.hasOwnProperty.call(_e31,t)){t=_e31[t];break;}}}catch(err){_iterator23.e(err);}finally{_iterator23.f();}return e.length&&(t=t.replace(/\$(\$|\d*)/g,function(t,i){if("$"==i)return"$";var s=+(i||1);return!s||s>e.length?t:e[s-1];})),t;}},{key:"languageDataAt",value:function languageDataAt(t,e){var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:-1;var s=[];var _iterator24=_createForOfIteratorHelper(this.facet(nt)),_step24;try{for(_iterator24.s();!(_step24=_iterator24.n()).done;){var _r31=_step24.value;var _iterator25=_createForOfIteratorHelper(_r31(this,e,i)),_step25;try{for(_iterator25.s();!(_step25=_iterator25.n()).done;){var _n23=_step25.value;Object.prototype.hasOwnProperty.call(_n23,t)&&s.push(_n23[t]);}}catch(err){_iterator25.e(err);}finally{_iterator25.f();}}}catch(err){_iterator24.e(err);}finally{_iterator24.f();}return s;}},{key:"charCategorizer",value:function charCategorizer(t){return Ct(this.languageDataAt("wordChars",t).join(""));}},{key:"wordAt",value:function wordAt(t){var _this$doc$lineAt=this.doc.lineAt(t),e=_this$doc$lineAt.text,i=_this$doc$lineAt.from,s=_this$doc$lineAt.length,r=this.charCategorizer(t),n=t-i,h=t-i;for(;n>0;){var _t18=y(e,n,!1);if(r(e.slice(_t18,n))!=xt.Word)break;n=_t18;}for(;h<s;){var _t19=y(e,h);if(r(e.slice(h,_t19))!=xt.Word)break;h=_t19;}return n==h?null:$.range(n+i,h+i);}}],[{key:"fromJSON",value:function fromJSON(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var i=arguments.length>2?arguments[2]:undefined;if(!t||"string"!=typeof t.doc)throw new RangeError("Invalid JSON representation for EditorState");var s=[];if(i){var _loop4=function _loop4(){if(Object.prototype.hasOwnProperty.call(t,_e32)){var _r32=i[_e32],_n24=t[_e32];s.push(_r32.init(function(t){return _r32.spec.fromJSON(_n24,t);}));}};for(var _e32 in i){_loop4();}}return Dt.create({doc:t.doc,selection:$.fromJSON(t.selection),extensions:e.extensions?s.concat([e.extensions]):s});}},{key:"create",value:function create(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var e=it.resolve(t.extensions||[],new Map()),i=t.doc instanceof a?t.doc:a.of((t.doc||"").split(e.staticFacet(Dt.lineSeparator)||A)),s=t.selection?t.selection instanceof $?t.selection:$.single(t.selection.anchor,t.selection.head):$.single(0);return j(s,i.length),e.staticFacet(ht)||(s=s.asSingle()),new Dt(e,i,s,e.dynamicSlots.map(function(){return null;}),function(t,e){return e.create(t);},null);}}]);}());Dt.allowMultipleSelections=ht,Dt.tabSize=z.define({combine:function combine(t){return t.length?t[0]:4;}}),Dt.lineSeparator=lt,Dt.readOnly=at,Dt.phrases=z.define({compare:function compare(t,e){var i=Object.keys(t),s=Object.keys(e);return i.length==s.length&&i.every(function(i){return t[i]==e[i];});}}),Dt.languageData=nt,Dt.changeFilter=ot,Dt.transactionFilter=ut,Dt.transactionExtender=ft,tt.reconfigure=mt.define();Et=/*#__PURE__*/function(){function Et(){_classCallCheck(this,Et);}return _createClass(Et,[{key:"eq",value:function eq(t){return this==t;}},{key:"range",value:function range(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:t;return It.create(t,e,this);}}]);}();Et.prototype.startSide=Et.prototype.endSide=0,Et.prototype.point=!1,Et.prototype.mapMode=C.TrackDel;It=/*#__PURE__*/function(){function t(_t22,e,i){_classCallCheck(this,t);this.from=_t22,this.to=e,this.value=i;}return _createClass(t,null,[{key:"create",value:function create(e,i,s){return new t(e,i,s);}}]);}();Tt=/*#__PURE__*/function(){function Tt(t,e,i,s){_classCallCheck(this,Tt);this.from=t,this.to=e,this.value=i,this.maxPoint=s;}return _createClass(Tt,[{key:"length",get:function get(){return this.to[this.to.length-1];}},{key:"findIndex",value:function findIndex(t,e,i){var s=arguments.length>3&&arguments[3]!==undefined?arguments[3]:0;var r=i?this.to:this.from;for(var _n26=s,_h19=r.length;;){if(_n26==_h19)return _n26;var _s26=_n26+_h19>>1,_l14=r[_s26]-t||(i?this.value[_s26].endSide:this.value[_s26].startSide)-e;if(_s26==_n26)return _l14>=0?_n26:_h19;_l14>=0?_h19=_s26:_n26=_s26+1;}}},{key:"between",value:function between(t,e,i,s){for(var _r34=this.findIndex(e,-1e9,!0),_n27=this.findIndex(i,1e9,!1,_r34);_r34<_n27;_r34++)if(!1===s(this.from[_r34]+t,this.to[_r34]+t,this.value[_r34]))return!1;}},{key:"map",value:function map(t,e){var i=[],s=[],r=[],n=-1,h=-1;for(var _l15=0;_l15<this.value.length;_l15++){var _o9=void 0,_u5=void 0,_f4=this.value[_l15],_a4=this.from[_l15]+t,_c4=this.to[_l15]+t;if(_a4==_c4){var _t23=e.mapPos(_a4,_f4.startSide,_f4.mapMode);if(null==_t23)continue;if(_o9=_u5=_t23,_f4.startSide!=_f4.endSide&&(_u5=e.mapPos(_a4,_f4.endSide),_u5<_o9))continue;}else if(_o9=e.mapPos(_a4,_f4.startSide),_u5=e.mapPos(_c4,_f4.endSide),_o9>_u5||_o9==_u5&&_f4.startSide>0&&_f4.endSide<=0)continue;(_u5-_o9||_f4.endSide-_f4.startSide)<0||(n<0&&(n=_o9),_f4.point&&(h=Math.max(h,_u5-_o9)),i.push(_f4),s.push(_o9-n),r.push(_u5-n));}return{mapped:i.length?new Tt(s,r,i,h):null,pos:n};}}]);}();Bt=/*#__PURE__*/function(){function Bt(t,e,i,s){_classCallCheck(this,Bt);this.chunkPos=t,this.chunk=e,this.nextLayer=i,this.maxPoint=s;}return _createClass(Bt,[{key:"length",get:function get(){var t=this.chunk.length-1;return t<0?0:Math.max(this.chunkEnd(t),this.nextLayer.length);}},{key:"size",get:function get(){if(this.isEmpty)return 0;var t=this.nextLayer.size;var _iterator27=_createForOfIteratorHelper(this.chunk),_step27;try{for(_iterator27.s();!(_step27=_iterator27.n()).done;){var _e34=_step27.value;t+=_e34.value.length;}}catch(err){_iterator27.e(err);}finally{_iterator27.f();}return t;}},{key:"chunkEnd",value:function chunkEnd(t){return this.chunkPos[t]+this.chunk[t].length;}},{key:"update",value:function update(t){var _t$add=t.add,e=_t$add===void 0?[]:_t$add,_t$sort=t.sort,i=_t$sort===void 0?!1:_t$sort,_t$filterFrom=t.filterFrom,s=_t$filterFrom===void 0?0:_t$filterFrom,_t$filterTo=t.filterTo,r=_t$filterTo===void 0?this.length:_t$filterTo,n=t.filter;if(0==e.length&&!n)return this;if(i&&(e=e.slice().sort(Rt)),this.isEmpty)return e.length?Bt.of(e):this;var h=new $t(this,null,-1)["goto"](0),l=0,o=[],u=new Lt();for(;h.value||l<e.length;)if(l<e.length&&(h.from-e[l].from||h.startSide-e[l].value.startSide)>=0){var _t24=e[l++];u.addInner(_t24.from,_t24.to,_t24.value)||o.push(_t24);}else 1==h.rangeIndex&&h.chunkIndex<this.chunk.length&&(l==e.length||this.chunkEnd(h.chunkIndex)<e[l].from)&&(!n||s>this.chunkEnd(h.chunkIndex)||r<this.chunkPos[h.chunkIndex])&&u.addChunk(this.chunkPos[h.chunkIndex],this.chunk[h.chunkIndex])?h.nextChunk():((!n||s>h.to||r<h.from||n(h.from,h.to,h.value))&&(u.addInner(h.from,h.to,h.value)||o.push(It.create(h.from,h.to,h.value))),h.next());return u.finishInner(this.nextLayer.isEmpty&&!o.length?Bt.empty:this.nextLayer.update({add:o,filter:n,filterFrom:s,filterTo:r}));}},{key:"map",value:function map(t){if(t.empty||this.isEmpty)return this;var e=[],i=[],s=-1;for(var _r35=0;_r35<this.chunk.length;_r35++){var _n28=this.chunkPos[_r35],_h20=this.chunk[_r35],_l16=t.touchesRange(_n28,_n28+_h20.length);if(!1===_l16)s=Math.max(s,_h20.maxPoint),e.push(_h20),i.push(t.mapPos(_n28));else if(!0===_l16){var _h20$map=_h20.map(_n28,t),_r36=_h20$map.mapped,_l17=_h20$map.pos;_r36&&(s=Math.max(s,_r36.maxPoint),e.push(_r36),i.push(_l17));}}var r=this.nextLayer.map(t);return 0==e.length?r:new Bt(i,e,r||Bt.empty,s);}},{key:"between",value:function between(t,e,i){if(!this.isEmpty){for(var _s27=0;_s27<this.chunk.length;_s27++){var _r37=this.chunkPos[_s27],_n29=this.chunk[_s27];if(e>=_r37&&t<=_r37+_n29.length&&!1===_n29.between(_r37,t-_r37,e-_r37,i))return;}this.nextLayer.between(t,e,i);}}},{key:"iter",value:function iter(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return jt.from([this])["goto"](t);}},{key:"isEmpty",get:function get(){return this.nextLayer==this;}}],[{key:"create",value:function create(t,e,i,s){return new Bt(t,e,i,s);}},{key:"iter",value:function iter(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;return jt.from(t)["goto"](e);}},{key:"compare",value:function compare(t,e,i,s){var r=arguments.length>4&&arguments[4]!==undefined?arguments[4]:-1;var n=t.filter(function(t){return t.maxPoint>0||!t.isEmpty&&t.maxPoint>=r;}),h=e.filter(function(t){return t.maxPoint>0||!t.isEmpty&&t.maxPoint>=r;}),l=Nt(n,h,i),o=new zt(n,l,r),u=new zt(h,l,r);i.iterGaps(function(t,e,i){return Ht(o,t,u,e,i,s);}),i.empty&&0==i.length&&Ht(o,0,u,0,0,s);}},{key:"eq",value:function eq(t,e){var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;var s=arguments.length>3?arguments[3]:undefined;null==s&&(s=999999999);var r=t.filter(function(t){return!t.isEmpty&&e.indexOf(t)<0;}),n=e.filter(function(e){return!e.isEmpty&&t.indexOf(e)<0;});if(r.length!=n.length)return!1;if(!r.length)return!0;var h=Nt(r,n),l=new zt(r,h,0)["goto"](i),o=new zt(n,h,0)["goto"](i);for(;;){if(l.to!=o.to||!Ft(l.active,o.active)||l.point&&(!o.point||!l.point.eq(o.point)))return!1;if(l.to>s)return!0;l.next(),o.next();}}},{key:"spans",value:function spans(t,e,i,s){var r=arguments.length>4&&arguments[4]!==undefined?arguments[4]:-1;var n=new zt(t,null,r)["goto"](e),h=e,l=n.openStart;for(;;){var _t25=Math.min(n.to,i);if(n.point){var _i30=n.activeForPoint(n.to),_r38=n.pointFrom<e?_i30.length+1:n.point.startSide<0?_i30.length:Math.min(_i30.length,l);s.point(h,_t25,n.point,_i30,_r38,n.pointRank),l=Math.min(n.openEnd(_t25),_i30.length);}else _t25>h&&(s.span(h,_t25,n.active,l),l=n.openEnd(_t25));if(n.to>i)return l+(n.point&&n.to>i?1:0);h=n.to,n.next();}}},{key:"of",value:function of(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!1;var i=new Lt();var _iterator28=_createForOfIteratorHelper(t instanceof It?[t]:e?function(t){if(t.length>1)for(var _e35=t[0],_i31=1;_i31<t.length;_i31++){var _s28=t[_i31];if(Rt(_e35,_s28)>0)return t.slice().sort(Rt);_e35=_s28;}return t;}(t):t),_step28;try{for(_iterator28.s();!(_step28=_iterator28.n()).done;){var _s29=_step28.value;i.add(_s29.from,_s29.to,_s29.value);}}catch(err){_iterator28.e(err);}finally{_iterator28.f();}return i.finish();}},{key:"join",value:function join(t){if(!t.length)return Bt.empty;var e=t[t.length-1];for(var _i32=t.length-2;_i32>=0;_i32--)for(var _s30=t[_i32];_s30!=Bt.empty;_s30=_s30.nextLayer)e=new Bt(_s30.chunkPos,_s30.chunk,e,Math.max(_s30.maxPoint,e.maxPoint));return e;}}]);}();Bt.empty=new Bt([],[],null,-1),Bt.empty.nextLayer=Bt.empty;Lt=/*#__PURE__*/function(){function Lt(){_classCallCheck(this,Lt);this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null;}return _createClass(Lt,[{key:"finishChunk",value:function finishChunk(t){this.chunks.push(new Tt(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,t&&(this.from=[],this.to=[],this.value=[]);}},{key:"add",value:function add(t,e,i){this.addInner(t,e,i)||(this.nextLayer||(this.nextLayer=new Lt())).add(t,e,i);}},{key:"addInner",value:function addInner(t,e,i){var s=t-this.lastTo||i.startSide-this.last.endSide;if(s<=0&&(t-this.lastFrom||i.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return!(s<0)&&(250==this.from.length&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=t),this.from.push(t-this.chunkStart),this.to.push(e-this.chunkStart),this.last=i,this.lastFrom=t,this.lastTo=e,this.value.push(i),i.point&&(this.maxPoint=Math.max(this.maxPoint,e-t)),!0);}},{key:"addChunk",value:function addChunk(t,e){if((t-this.lastTo||e.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,e.maxPoint),this.chunks.push(e),this.chunkPos.push(t);var i=e.value.length-1;return this.last=e.value[i],this.lastFrom=e.from[i]+t,this.lastTo=e.to[i]+t,!0;}},{key:"finish",value:function finish(){return this.finishInner(Bt.empty);}},{key:"finishInner",value:function finishInner(t){if(this.from.length&&this.finishChunk(!1),0==this.chunks.length)return t;var e=Bt.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(t):t,this.setMaxPoint);return this.from=null,e;}}]);}();$t=/*#__PURE__*/function(){function $t(t,e,i){var s=arguments.length>3&&arguments[3]!==undefined?arguments[3]:0;_classCallCheck(this,$t);this.layer=t,this.skip=e,this.minPoint=i,this.rank=s;}return _createClass($t,[{key:"startSide",get:function get(){return this.value?this.value.startSide:0;}},{key:"endSide",get:function get(){return this.value?this.value.endSide:0;}},{key:"goto",value:function _goto(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:-1e9;return this.chunkIndex=this.rangeIndex=0,this.gotoInner(t,e,!1),this;}},{key:"gotoInner",value:function gotoInner(t,e,i){for(;this.chunkIndex<this.layer.chunk.length;){var _e38=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(_e38)||this.layer.chunkEnd(this.chunkIndex)<t||_e38.maxPoint<this.minPoint))break;this.chunkIndex++,i=!1;}if(this.chunkIndex<this.layer.chunk.length){var _s31=this.layer.chunk[this.chunkIndex].findIndex(t-this.layer.chunkPos[this.chunkIndex],e,!0);(!i||this.rangeIndex<_s31)&&this.setRangeIndex(_s31);}this.next();}},{key:"forward",value:function forward(t,e){(this.to-t||this.endSide-e)<0&&this.gotoInner(t,e,!0);}},{key:"next",value:function next(){for(;;){if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break;}{var _t28=this.layer.chunkPos[this.chunkIndex],_e39=this.layer.chunk[this.chunkIndex],_i33=_t28+_e39.from[this.rangeIndex];if(this.from=_i33,this.to=_t28+_e39.to[this.rangeIndex],this.value=_e39.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break;}}}},{key:"setRangeIndex",value:function setRangeIndex(t){if(t==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex<this.layer.chunk.length&&this.skip.has(this.layer.chunk[this.chunkIndex]);)this.chunkIndex++;this.rangeIndex=0;}else this.rangeIndex=t;}},{key:"nextChunk",value:function nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next();}},{key:"compare",value:function compare(t){return this.from-t.from||this.startSide-t.startSide||this.rank-t.rank||this.to-t.to||this.endSide-t.endSide;}}]);}();jt=/*#__PURE__*/function(){function jt(t){_classCallCheck(this,jt);this.heap=t;}return _createClass(jt,[{key:"startSide",get:function get(){return this.value?this.value.startSide:0;}},{key:"goto",value:function _goto2(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:-1e9;var _iterator31=_createForOfIteratorHelper(this.heap),_step31;try{for(_iterator31.s();!(_step31=_iterator31.n()).done;){var _i34=_step31.value;_i34["goto"](t,e);}}catch(err){_iterator31.e(err);}finally{_iterator31.f();}for(var _t29=this.heap.length>>1;_t29>=0;_t29--)Pt(this.heap,_t29);return this.next(),this;}},{key:"forward",value:function forward(t,e){var _iterator32=_createForOfIteratorHelper(this.heap),_step32;try{for(_iterator32.s();!(_step32=_iterator32.n()).done;){var _i35=_step32.value;_i35.forward(t,e);}}catch(err){_iterator32.e(err);}finally{_iterator32.f();}for(var _t30=this.heap.length>>1;_t30>=0;_t30--)Pt(this.heap,_t30);(this.to-t||this.value.endSide-e)<0&&this.next();}},{key:"next",value:function next(){if(0==this.heap.length)this.from=this.to=1e9,this.value=null,this.rank=-1;else{var _t31=this.heap[0];this.from=_t31.from,this.to=_t31.to,this.value=_t31.value,this.rank=_t31.rank,_t31.value&&_t31.next(),Pt(this.heap,0);}}}],[{key:"from",value:function from(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:null;var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:-1;var s=[];for(var _r39=0;_r39<t.length;_r39++)for(var _n31=t[_r39];!_n31.isEmpty;_n31=_n31.nextLayer)_n31.maxPoint>=i&&s.push(new $t(_n31,e,i,_r39));return 1==s.length?s[0]:new jt(s);}}]);}();zt=/*#__PURE__*/function(){function zt(t,e,i){_classCallCheck(this,zt);this.minPoint=i,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=jt.from(t,e,i);}return _createClass(zt,[{key:"goto",value:function _goto3(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:-1e9;return this.cursor["goto"](t,e),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=t,this.endSide=e,this.openStart=-1,this.next(),this;}},{key:"forward",value:function forward(t,e){for(;this.minActive>-1&&(this.activeTo[this.minActive]-t||this.active[this.minActive].endSide-e)<0;)this.removeActive(this.minActive);this.cursor.forward(t,e);}},{key:"removeActive",value:function removeActive(t){Wt(this.active,t),Wt(this.activeTo,t),Wt(this.activeRank,t),this.minActive=qt(this.active,this.activeTo);}},{key:"addActive",value:function addActive(t){var e=0,_this$cursor=this.cursor,i=_this$cursor.value,s=_this$cursor.to,r=_this$cursor.rank;for(;e<this.activeRank.length&&(r-this.activeRank[e]||s-this.activeTo[e])>0;)e++;Vt(this.active,e,i),Vt(this.activeTo,e,s),Vt(this.activeRank,e,r),t&&Vt(t,e,this.cursor.from),this.minActive=qt(this.active,this.activeTo);}},{key:"next",value:function next(){var t=this.to,e=this.point;this.point=null;var i=this.openStart<0?[]:null;for(;;){var _s33=this.minActive;if(_s33>-1&&(this.activeTo[_s33]-this.cursor.from||this.active[_s33].endSide-this.cursor.startSide)<0){if(this.activeTo[_s33]>t){this.to=this.activeTo[_s33],this.endSide=this.active[_s33].endSide;break;}this.removeActive(_s33),i&&Wt(i,_s33);}else{if(!this.cursor.value){this.to=this.endSide=1e9;break;}if(this.cursor.from>t){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break;}{var _t32=this.cursor.value;if(_t32.point){if(!(e&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)){this.point=_t32,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=_t32.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break;}this.cursor.next();}else this.addActive(i),this.cursor.next();}}}if(i){this.openStart=0;for(var _e40=i.length-1;_e40>=0&&i[_e40]<t;_e40--)this.openStart++;}}},{key:"activeForPoint",value:function activeForPoint(t){if(!this.active.length)return this.active;var e=[];for(var _i37=this.active.length-1;_i37>=0&&!(this.activeRank[_i37]<this.pointRank);_i37--)(this.activeTo[_i37]>t||this.activeTo[_i37]==t&&this.active[_i37].endSide>=this.point.endSide)&&e.push(this.active[_i37]);return e.reverse();}},{key:"openEnd",value:function openEnd(t){var e=0;for(var _i38=this.activeTo.length-1;_i38>=0&&this.activeTo[_i38]>t;_i38--)e++;return e;}}]);}();Gt="undefined"==typeof Symbol?"__ͼ":Symbol["for"]("ͼ"),Kt="undefined"==typeof Symbol?"__styleSet"+Math.floor(1e8*Math.random()):Symbol("styleSet"),_t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:{};Xt=/*#__PURE__*/function(){function Xt(t,e){_classCallCheck(this,Xt);this.rules=[];var _ref3=e||{},i=_ref3.finish;function s(t){return /^@/.test(t)?[t]:t.split(/,\s*/);}function r(t,e,n,h){var l=[],o=/^@(\w+)\b/.exec(t[0]),u=o&&"keyframes"==o[1];if(o&&null==e)return n.push(t[0]+";");for(var _i42 in e){var _h21=e[_i42];if(/&/.test(_i42))r(_i42.split(/,\s*/).map(function(e){return t.map(function(t){return e.replace(/&/,t);});}).reduce(function(t,e){return t.concat(e);}),_h21,n);else if(_h21&&"object"==_typeof(_h21)){if(!o)throw new RangeError("The value of a property ("+_i42+") should be a primitive value.");r(s(_i42),_h21,l,u);}else null!=_h21&&l.push(_i42.replace(/_.*/,"").replace(/[A-Z]/g,function(t){return"-"+t.toLowerCase();})+": "+_h21+";");}(l.length||u)&&n.push((!i||o||h?t:t.map(i)).join(", ")+" {"+l.join(" ")+"}");}for(var _e42 in t)r(s(_e42),t[_e42],this.rules);}return _createClass(Xt,[{key:"getRules",value:function getRules(){return this.rules.join("\n");}}],[{key:"newName",value:function newName(){var t=_t[Gt]||1;return _t[Gt]=t+1,"ͼ"+t.toString(36);}},{key:"mount",value:function mount(t,e,i){var s=t[Kt],r=i&&i.nonce;s?r&&s.setNonce(r):s=new Qt(t,r),s.mount(Array.isArray(e)?e:[e],t);}}]);}();Yt=new Map();Qt=/*#__PURE__*/function(){function Qt(t,e){_classCallCheck(this,Qt);var i=t.ownerDocument||t,s=i.defaultView;if(!t.head&&t.adoptedStyleSheets&&s.CSSStyleSheet){var _e43=Yt.get(i);if(_e43)return t[Kt]=_e43;this.sheet=new s.CSSStyleSheet(),Yt.set(i,this);}else this.styleTag=i.createElement("style"),e&&this.styleTag.setAttribute("nonce",e);this.modules=[],t[Kt]=this;}return _createClass(Qt,[{key:"mount",value:function mount(t,e){var i=this.sheet,s=0,r=0;for(var _e44=0;_e44<t.length;_e44++){var _n32=t[_e44],_h22=this.modules.indexOf(_n32);if(_h22<r&&_h22>-1&&(this.modules.splice(_h22,1),r--,_h22=-1),-1==_h22){if(this.modules.splice(r++,0,_n32),i)for(var _t33=0;_t33<_n32.rules.length;_t33++)i.insertRule(_n32.rules[_t33],s++);}else{for(;r<_h22;)s+=this.modules[r++].rules.length;s+=_n32.rules.length,r++;}}if(i)e.adoptedStyleSheets.indexOf(this.sheet)<0&&(e.adoptedStyleSheets=[this.sheet].concat(_toConsumableArray(e.adoptedStyleSheets)));else{var _t34="";for(var _e45=0;_e45<this.modules.length;_e45++)_t34+=this.modules[_e45].getRules()+"\n";this.styleTag.textContent=_t34;var _i43=e.head||e;this.styleTag.parentNode!=_i43&&_i43.insertBefore(this.styleTag,_i43.firstChild);}}},{key:"setNonce",value:function setNonce(t){this.styleTag&&this.styleTag.getAttribute("nonce")!=t&&this.styleTag.setAttribute("nonce",t);}}]);}();for(Zt={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},te={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},ee="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),ie="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),se=0;se<10;se++)Zt[48+se]=Zt[96+se]=String(se);for(se=1;se<=24;se++)Zt[se+111]="F"+se;for(se=65;se<=90;se++)Zt[se]=String.fromCharCode(se+32),te[se]=String.fromCharCode(se);for(re in Zt)te.hasOwnProperty(re)||(te[re]=Zt[re]);we=/*#__PURE__*/function(){function we(){_classCallCheck(this,we);this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0;}return _createClass(we,[{key:"eq",value:function eq(t){return this.anchorNode==t.anchorNode&&this.anchorOffset==t.anchorOffset&&this.focusNode==t.focusNode&&this.focusOffset==t.focusOffset;}},{key:"setRange",value:function setRange(t){var e=t.anchorNode,i=t.focusNode;this.set(e,Math.min(t.anchorOffset,e?de(e):0),i,Math.min(t.focusOffset,i?de(i):0));}},{key:"set",value:function set(t,e,i,s){this.anchorNode=t,this.anchorOffset=e,this.focusNode=i,this.focusOffset=s;}}]);}();ve=null;De=/*#__PURE__*/function(){function De(t,e){var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!0;_classCallCheck(this,De);this.node=t,this.offset=e,this.precise=i;}return _createClass(De,null,[{key:"before",value:function before(t,e){return new De(t.parentNode,fe(t),e);}},{key:"after",value:function after(t,e){return new De(t.parentNode,fe(t)+1,e);}}]);}();Oe=[];Ee=/*#__PURE__*/function(){function Ee(){_classCallCheck(this,Ee);this.parent=null,this.dom=null,this.flags=2;}return _createClass(Ee,[{key:"overrideDOMText",get:function get(){return null;}},{key:"posAtStart",get:function get(){return this.parent?this.parent.posBefore(this):0;}},{key:"posAtEnd",get:function get(){return this.posAtStart+this.length;}},{key:"posBefore",value:function posBefore(t){var e=this.posAtStart;var _iterator33=_createForOfIteratorHelper(this.children),_step33;try{for(_iterator33.s();!(_step33=_iterator33.n()).done;){var _i49=_step33.value;if(_i49==t)return e;e+=_i49.length+_i49.breakAfter;}}catch(err){_iterator33.e(err);}finally{_iterator33.f();}throw new RangeError("Invalid child in posBefore");}},{key:"posAfter",value:function posAfter(t){return this.posBefore(t)+t.length;}},{key:"sync",value:function sync(t,e){if(2&this.flags){var _i50,_s41=this.dom,_r46=null;var _iterator34=_createForOfIteratorHelper(this.children),_step34;try{for(_iterator34.s();!(_step34=_iterator34.n()).done;){var _n33=_step34.value;if(7&_n33.flags){if(!_n33.dom&&(_i50=_r46?_r46.nextSibling:_s41.firstChild)){var _t36=Ee.get(_i50);(!_t36||!_t36.parent&&_t36.canReuseDOM(_n33))&&_n33.reuseDOM(_i50);}_n33.sync(t,e),_n33.flags&=-8;}if(_i50=_r46?_r46.nextSibling:_s41.firstChild,e&&!e.written&&e.node==_s41&&_i50!=_n33.dom&&(e.written=!0),_n33.dom.parentNode==_s41)for(;_i50&&_i50!=_n33.dom;)_i50=Ie(_i50);else _s41.insertBefore(_n33.dom,_i50);_r46=_n33.dom;}}catch(err){_iterator34.e(err);}finally{_iterator34.f();}for(_i50=_r46?_r46.nextSibling:_s41.firstChild,_i50&&e&&e.node==_s41&&(e.written=!0);_i50;)_i50=Ie(_i50);}else if(1&this.flags){var _iterator35=_createForOfIteratorHelper(this.children),_step35;try{for(_iterator35.s();!(_step35=_iterator35.n()).done;){var _i51=_step35.value;7&_i51.flags&&(_i51.sync(t,e),_i51.flags&=-8);}}catch(err){_iterator35.e(err);}finally{_iterator35.f();}}}},{key:"reuseDOM",value:function reuseDOM(t){}},{key:"localPosFromDOM",value:function localPosFromDOM(t,e){var i;if(t==this.dom)i=this.dom.childNodes[e];else{var _s42=0==de(t)?0:0==e?-1:1;for(;;){var _e46=t.parentNode;if(_e46==this.dom)break;0==_s42&&_e46.firstChild!=_e46.lastChild&&(_s42=t==_e46.firstChild?-1:1),t=_e46;}i=_s42<0?t:t.nextSibling;}if(i==this.dom.firstChild)return 0;for(;i&&!Ee.get(i);)i=i.nextSibling;if(!i)return this.length;for(var _t37=0,_e47=0;;_t37++){var _s43=this.children[_t37];if(_s43.dom==i)return _e47;_e47+=_s43.length+_s43.breakAfter;}}},{key:"domBoundsAround",value:function domBoundsAround(t,e){var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;var s=-1,r=-1,n=-1,h=-1;for(var _l18=0,_o10=i,_u7=i;_l18<this.children.length;_l18++){var _i52=this.children[_l18],_f5=_o10+_i52.length;if(_o10<t&&_f5>e)return _i52.domBoundsAround(t,e,_o10);if(_f5>=t&&-1==s&&(s=_l18,r=_o10),_o10>e&&_i52.dom.parentNode==this.dom){n=_l18,h=_u7;break;}_u7=_f5,_o10=_f5+_i52.breakAfter;}return{from:r,to:h<0?i+this.length:h,startDOM:(s?this.children[s-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:n<this.children.length&&n>=0?this.children[n].dom:null};}},{key:"markDirty",value:function markDirty(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:!1;this.flags|=2,this.markParentsDirty(t);}},{key:"markParentsDirty",value:function markParentsDirty(t){for(var _e48=this.parent;_e48;_e48=_e48.parent){if(t&&(_e48.flags|=2),1&_e48.flags)return;_e48.flags|=1,t=!1;}}},{key:"setParent",value:function setParent(t){this.parent!=t&&(this.parent=t,7&this.flags&&this.markParentsDirty(!0));}},{key:"setDOM",value:function setDOM(t){this.dom!=t&&(this.dom&&(this.dom.cmView=null),this.dom=t,t.cmView=this);}},{key:"rootView",get:function get(){for(var _t38=this;;){var _e49=_t38.parent;if(!_e49)return _t38;_t38=_e49;}}},{key:"replaceChildren",value:function replaceChildren(t,e){var _this$children;var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:Oe;this.markDirty();for(var _s44=t;_s44<e;_s44++){var _t39=this.children[_s44];_t39.parent==this&&i.indexOf(_t39)<0&&_t39.destroy();}i.length<250?(_this$children=this.children).splice.apply(_this$children,[t,e-t].concat(_toConsumableArray(i))):this.children=[].concat(this.children.slice(0,t),i,this.children.slice(e));for(var _t40=0;_t40<i.length;_t40++)i[_t40].setParent(this);}},{key:"ignoreMutation",value:function ignoreMutation(t){return!1;}},{key:"ignoreEvent",value:function ignoreEvent(t){return!1;}},{key:"childCursor",value:function childCursor(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:this.length;return new Re(this.children,t,this.children.length);}},{key:"childPos",value:function childPos(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;return this.childCursor().findPos(t,e);}},{key:"toString",value:function toString(){var t=this.constructor.name.replace("View","");return t+(this.children.length?"("+this.children.join()+")":this.length?"["+("Text"==t?this.text:this.length)+"]":"")+(this.breakAfter?"#":"");}},{key:"isEditable",get:function get(){return!0;}},{key:"isWidget",get:function get(){return!1;}},{key:"isHidden",get:function get(){return!1;}},{key:"merge",value:function merge(t,e,i,s,r,n){return!1;}},{key:"become",value:function become(t){return!1;}},{key:"canReuseDOM",value:function canReuseDOM(t){return t.constructor==this.constructor&&!(8&(this.flags|t.flags));}},{key:"getSide",value:function getSide(){return 0;}},{key:"destroy",value:function destroy(){var _iterator36=_createForOfIteratorHelper(this.children),_step36;try{for(_iterator36.s();!(_step36=_iterator36.n()).done;){var _t41=_step36.value;_t41.parent==this&&_t41.destroy();}}catch(err){_iterator36.e(err);}finally{_iterator36.f();}this.parent=null;}}],[{key:"get",value:function get(t){return t.cmView;}}]);}();Ee.prototype.breakAfter=0;Re=/*#__PURE__*/function(){function Re(t,e,i){_classCallCheck(this,Re);this.children=t,this.pos=e,this.i=i,this.off=0;}return _createClass(Re,[{key:"findPos",value:function findPos(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;for(;;){if(t>this.pos||t==this.pos&&(e>0||0==this.i||this.children[this.i-1].breakAfter))return this.off=t-this.pos,this;var _i53=this.children[--this.i];this.pos-=_i53.length+_i53.breakAfter;}}}]);}();Le="undefined"!=typeof navigator?navigator:{userAgent:"",vendor:"",platform:""},Ne="undefined"!=typeof document?document:{documentElement:{style:{}}};$e=/Edge\/(\d+)/.exec(Le.userAgent),je=/MSIE \d/.test(Le.userAgent),Pe=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Le.userAgent),ze=!!(je||Pe||$e),He=!ze&&/gecko\/(\d+)/i.test(Le.userAgent),Fe=!ze&&/Chrome\/(\d+)/.exec(Le.userAgent),We="webkitFontSmoothing"in Ne.documentElement.style,Ve=!ze&&/Apple Computer/.test(Le.vendor),qe=Ve&&(/Mobile\/\w+/.test(Le.userAgent)||Le.maxTouchPoints>2);Ue={mac:qe||/Mac/.test(Le.platform),windows:/Win/.test(Le.platform),linux:/Linux|X11/.test(Le.platform),ie:ze,ie_version:je?Ne.documentMode||6:Pe?+Pe[1]:$e?+$e[1]:0,gecko:He,gecko_version:He?+(/Firefox\/(\d+)/.exec(Le.userAgent)||[0,0])[1]:0,chrome:!!Fe,chrome_version:Fe?+Fe[1]:0,ios:qe,android:/Android\b/.test(Le.userAgent),webkit:We,safari:Ve,webkit_version:We?+(/\bAppleWebKit\/(\d+)/.exec(Le.userAgent)||[0,0])[1]:0,tabSize:null!=Ne.documentElement.style.tabSize?"tab-size":"-moz-tab-size"};Je=/*#__PURE__*/function(_Ee){function Je(t){var _this8;_classCallCheck(this,Je);_this8=_callSuper(this,Je),_this8.text=t;return _this8;}_inherits(Je,_Ee);return _createClass(Je,[{key:"length",get:function get(){return this.text.length;}},{key:"createDOM",value:function createDOM(t){this.setDOM(t||document.createTextNode(this.text));}},{key:"sync",value:function sync(t,e){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(e&&e.node==this.dom&&(e.written=!0),this.dom.nodeValue=this.text);}},{key:"reuseDOM",value:function reuseDOM(t){3==t.nodeType&&this.createDOM(t);}},{key:"merge",value:function merge(t,e,i){return!(8&this.flags||i&&(!(i instanceof Je)||this.length-(e-t)+i.length>256||8&i.flags))&&(this.text=this.text.slice(0,t)+(i?i.text:"")+this.text.slice(e),this.markDirty(),!0);}},{key:"split",value:function split(t){var e=new Je(this.text.slice(t));return this.text=this.text.slice(0,t),this.markDirty(),e.flags|=8&this.flags,e;}},{key:"localPosFromDOM",value:function localPosFromDOM(t,e){return t==this.dom?e:e?this.text.length:0;}},{key:"domAtPos",value:function domAtPos(t){return new De(this.dom,t);}},{key:"domBoundsAround",value:function domBoundsAround(t,e,i){return{from:i,to:i+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling};}},{key:"coordsAt",value:function coordsAt(t,e){return function(t,e,i){var s=t.nodeValue.length;e>s&&(e=s);var r=e,n=e,h=0;0==e&&i<0||e==s&&i>=0?Ue.chrome||Ue.gecko||(e?(r--,h=1):n<s&&(n++,h=-1)):i<0?r--:n<s&&n++;var l=ye(t,r,n).getClientRects();if(!l.length)return null;var o=l[(h?h<0:i>=0)?0:l.length-1];Ue.safari&&!h&&0==o.width&&(o=Array.prototype.find.call(l,function(t){return t.width;})||o);return h?pe(o,h<0):o||null;}(this.dom,t,e);}}]);}(Ee);Ge=/*#__PURE__*/function(_Ee2){function Ge(t){var _this9;var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[];var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;_classCallCheck(this,Ge);_this9=_callSuper(this,Ge),_this9.mark=t,_this9.children=e,_this9.length=i;var _iterator38=_createForOfIteratorHelper(e),_step38;try{for(_iterator38.s();!(_step38=_iterator38.n()).done;){var _t44=_step38.value;_t44.setParent(_this9);}}catch(err){_iterator38.e(err);}finally{_iterator38.f();}return _this9;}_inherits(Ge,_Ee2);return _createClass(Ge,[{key:"setAttrs",value:function setAttrs(t){if(xe(t),this.mark["class"]&&(t.className=this.mark["class"]),this.mark.attrs)for(var _e50 in this.mark.attrs)t.setAttribute(_e50,this.mark.attrs[_e50]);return t;}},{key:"canReuseDOM",value:function canReuseDOM(t){return _superPropGet(Ge,"canReuseDOM",this,3)([t])&&!(8&(this.flags|t.flags));}},{key:"reuseDOM",value:function reuseDOM(t){t.nodeName==this.mark.tagName.toUpperCase()&&(this.setDOM(t),this.flags|=6);}},{key:"sync",value:function sync(t,e){this.dom?4&this.flags&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),_superPropGet(Ge,"sync",this,3)([t,e]);}},{key:"merge",value:function merge(t,e,i,s,r,n){return(!i||!(!(i instanceof Ge&&i.mark.eq(this.mark))||t&&r<=0||e<this.length&&n<=0))&&(Be(this,t,e,i?i.children.slice():[],r-1,n-1),this.markDirty(),!0);}},{key:"split",value:function split(t){var e=[],i=0,s=-1,r=0;var _iterator39=_createForOfIteratorHelper(this.children),_step39;try{for(_iterator39.s();!(_step39=_iterator39.n()).done;){var _n34=_step39.value;var _h23=i+_n34.length;_h23>t&&e.push(i<t?_n34.split(t-i):_n34),s<0&&i>=t&&(s=r),i=_h23,r++;}}catch(err){_iterator39.e(err);}finally{_iterator39.f();}var n=this.length-t;return this.length=t,s>-1&&(this.children.length=s,this.markDirty()),new Ge(this.mark,e,n);}},{key:"domAtPos",value:function domAtPos(t){return Xe(this,t);}},{key:"coordsAt",value:function coordsAt(t,e){return Qe(this,t,e);}}]);}(Ee);Ke=/*#__PURE__*/function(_Ee3){function Ke(t,e,i){var _this10;_classCallCheck(this,Ke);_this10=_callSuper(this,Ke),_this10.widget=t,_this10.length=e,_this10.side=i,_this10.prevWidget=null;return _this10;}_inherits(Ke,_Ee3);return _createClass(Ke,[{key:"split",value:function split(t){var e=Ke.create(this.widget,this.length-t,this.side);return this.length-=t,e;}},{key:"sync",value:function sync(t){this.dom&&this.widget.updateDOM(this.dom,t)||(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(t)),this.widget.editable||(this.dom.contentEditable="false"));}},{key:"getSide",value:function getSide(){return this.side;}},{key:"merge",value:function merge(t,e,i,s,r,n){return!(i&&(!(i instanceof Ke&&this.widget.compare(i.widget))||t>0&&r<=0||e<this.length&&n<=0))&&(this.length=t+(i?i.length:0)+(this.length-e),!0);}},{key:"become",value:function become(t){return t instanceof Ke&&t.side==this.side&&this.widget.constructor==t.widget.constructor&&(this.widget.compare(t.widget)||this.markDirty(!0),this.dom&&!this.prevWidget&&(this.prevWidget=this.widget),this.widget=t.widget,this.length=t.length,!0);}},{key:"ignoreMutation",value:function ignoreMutation(){return!0;}},{key:"ignoreEvent",value:function ignoreEvent(t){return this.widget.ignoreEvent(t);}},{key:"overrideDOMText",get:function get(){if(0==this.length)return a.empty;var t=this;for(;t.parent;)t=t.parent;var _t45=t,e=_t45.view,i=e&&e.state.doc,s=this.posAtStart;return i?i.slice(s,s+this.length):a.empty;}},{key:"domAtPos",value:function domAtPos(t){return(this.length?0==t:this.side>0)?De.before(this.dom):De.after(this.dom,t==this.length);}},{key:"domBoundsAround",value:function domBoundsAround(){return null;}},{key:"coordsAt",value:function coordsAt(t,e){var i=this.widget.coordsAt(this.dom,t,e);if(i)return i;var s=this.dom.getClientRects(),r=null;if(!s.length)return null;var n=this.side?this.side<0:t>0;for(var _e51=n?s.length-1:0;r=s[_e51],!(t>0?0==_e51:_e51==s.length-1||r.top<r.bottom);_e51+=n?-1:1);return pe(r,!n);}},{key:"isEditable",get:function get(){return!1;}},{key:"isWidget",get:function get(){return!0;}},{key:"isHidden",get:function get(){return this.widget.isHidden;}},{key:"destroy",value:function destroy(){_superPropGet(Ke,"destroy",this,3)([]),this.dom&&this.widget.destroy(this.dom);}}],[{key:"create",value:function create(t,e,i){return new Ke(t,e,i);}}]);}(Ee);_e=/*#__PURE__*/function(_Ee4){function _e(t){var _this11;_classCallCheck(this,_e);_this11=_callSuper(this,_e),_this11.side=t;return _this11;}_inherits(_e,_Ee4);return _createClass(_e,[{key:"length",get:function get(){return 0;}},{key:"merge",value:function merge(){return!1;}},{key:"become",value:function become(t){return t instanceof _e&&t.side==this.side;}},{key:"split",value:function split(){return new _e(this.side);}},{key:"sync",value:function sync(){if(!this.dom){var _t46=document.createElement("img");_t46.className="cm-widgetBuffer",_t46.setAttribute("aria-hidden","true"),this.setDOM(_t46);}}},{key:"getSide",value:function getSide(){return this.side;}},{key:"domAtPos",value:function domAtPos(t){return this.side>0?De.before(this.dom):De.after(this.dom);}},{key:"localPosFromDOM",value:function localPosFromDOM(){return 0;}},{key:"domBoundsAround",value:function domBoundsAround(){return null;}},{key:"coordsAt",value:function coordsAt(t){return this.dom.getBoundingClientRect();}},{key:"overrideDOMText",get:function get(){return a.empty;}},{key:"isHidden",get:function get(){return!0;}}]);}(Ee);Je.prototype.children=Ke.prototype.children=_e.prototype.children=Oe;ti=Object.create(null);ri=/*#__PURE__*/function(){function ri(){_classCallCheck(this,ri);}return _createClass(ri,[{key:"eq",value:function eq(t){return!1;}},{key:"updateDOM",value:function updateDOM(t,e){return!1;}},{key:"compare",value:function compare(t){return this==t||this.constructor==t.constructor&&this.eq(t);}},{key:"estimatedHeight",get:function get(){return-1;}},{key:"lineBreaks",get:function get(){return 0;}},{key:"ignoreEvent",value:function ignoreEvent(t){return!0;}},{key:"coordsAt",value:function coordsAt(t,e,i){return null;}},{key:"isHidden",get:function get(){return!1;}},{key:"editable",get:function get(){return!1;}},{key:"destroy",value:function destroy(t){}}]);}();ni=function(t){return t[t.Text=0]="Text",t[t.WidgetBefore=1]="WidgetBefore",t[t.WidgetAfter=2]="WidgetAfter",t[t.WidgetRange=3]="WidgetRange",t;}(ni||(ni={}));hi=/*#__PURE__*/function(_Et){function hi(t,e,i,s){var _this12;_classCallCheck(this,hi);_this12=_callSuper(this,hi),_this12.startSide=t,_this12.endSide=e,_this12.widget=i,_this12.spec=s;return _this12;}_inherits(hi,_Et);return _createClass(hi,[{key:"heightRelevant",get:function get(){return!1;}},{key:"hasHeight",value:function hasHeight(){return!!this.widget&&this.widget.estimatedHeight>-1;}}],[{key:"mark",value:function mark(t){return new li(t);}},{key:"widget",value:function widget(t){var e=Math.max(-1e4,Math.min(1e4,t.side||0)),i=!!t.block;return e+=i&&!t.inlineOrder?e>0?3e8:-4e8:e>0?1e8:-1e8,new ui(t,e,e,i,t.widget||null,!1);}},{key:"replace",value:function replace(t){var e,i,s=!!t.block;if(t.isBlockGap)e=-5e8,i=4e8;else{var _fi=fi(t,s),_r49=_fi.start,_n37=_fi.end;e=(_r49?s?-3e8:-1:5e8)-1,i=1+(_n37?s?2e8:1:-6e8);}return new ui(t,e,i,s,t.widget||null,!0);}},{key:"line",value:function line(t){return new oi(t);}},{key:"set",value:function set(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!1;return Bt.of(t,e);}}]);}(Et);hi.none=Bt.empty;li=/*#__PURE__*/function(_hi){function li(t){var _this13;_classCallCheck(this,li);var _fi2=fi(t),e=_fi2.start,i=_fi2.end;_this13=_callSuper(this,li,[e?-1:5e8,i?1:-6e8,null,t]),_this13.tagName=t.tagName||"span",_this13["class"]=t["class"]||"",_this13.attrs=t.attributes||null;return _this13;}_inherits(li,_hi);return _createClass(li,[{key:"eq",value:function eq(t){var e,i;return this==t||t instanceof li&&this.tagName==t.tagName&&(this["class"]||(null===(e=this.attrs)||void 0===e?void 0:e["class"]))==(t["class"]||(null===(i=t.attrs)||void 0===i?void 0:i["class"]))&&ei(this.attrs,t.attrs,"class");}},{key:"range",value:function range(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:t;if(t>=e)throw new RangeError("Mark decorations may not be empty");return _superPropGet(li,"range",this,3)([t,e]);}}]);}(hi);li.prototype.point=!1;oi=/*#__PURE__*/function(_hi2){function oi(t){_classCallCheck(this,oi);return _callSuper(this,oi,[-2e8,-2e8,null,t]);}_inherits(oi,_hi2);return _createClass(oi,[{key:"eq",value:function eq(t){return t instanceof oi&&this.spec["class"]==t.spec["class"]&&ei(this.spec.attributes,t.spec.attributes);}},{key:"range",value:function range(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:t;if(e!=t)throw new RangeError("Line decoration ranges must be zero-length");return _superPropGet(oi,"range",this,3)([t,e]);}}]);}(hi);oi.prototype.mapMode=C.TrackBefore,oi.prototype.point=!0;ui=/*#__PURE__*/function(_hi3){function ui(t,e,i,s,r,n){var _this14;_classCallCheck(this,ui);_this14=_callSuper(this,ui,[e,i,r,t]),_this14.block=s,_this14.isReplace=n,_this14.mapMode=s?e<=0?C.TrackBefore:C.TrackAfter:C.TrackDel;return _this14;}_inherits(ui,_hi3);return _createClass(ui,[{key:"type",get:function get(){return this.startSide!=this.endSide?ni.WidgetRange:this.startSide<=0?ni.WidgetBefore:ni.WidgetAfter;}},{key:"heightRelevant",get:function get(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0);}},{key:"eq",value:function eq(t){return t instanceof ui&&(e=this.widget,i=t.widget,e==i||!!(e&&i&&e.compare(i)))&&this.block==t.block&&this.startSide==t.startSide&&this.endSide==t.endSide;var e,i;}},{key:"range",value:function range(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:t;if(this.isReplace&&(t>e||t==e&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&e!=t)throw new RangeError("Widget decorations can only have zero-length ranges");return _superPropGet(ui,"range",this,3)([t,e]);}}]);}(hi);ui.prototype.point=!0;ci=/*#__PURE__*/function(_Ee5){function ci(){var _this15;_classCallCheck(this,ci);_this15=_callSuper(this,ci,arguments),_this15.children=[],_this15.length=0,_this15.prevAttrs=void 0,_this15.attrs=null,_this15.breakAfter=0;return _this15;}_inherits(ci,_Ee5);return _createClass(ci,[{key:"merge",value:function merge(t,e,i,s,r,n){if(i){if(!(i instanceof ci))return!1;this.dom||i.transferDOM(this);}return s&&this.setDeco(i?i.attrs:null),Be(this,t,e,i?i.children.slice():[],r,n),!0;}},{key:"split",value:function split(t){var e=new ci();if(e.breakAfter=this.breakAfter,0==this.length)return e;var _this$childPos=this.childPos(t),i=_this$childPos.i,s=_this$childPos.off;s&&(e.append(this.children[i].split(s),0),this.children[i].merge(s,this.children[i].length,null,!1,0,0),i++);for(var _t50=i;_t50<this.children.length;_t50++)e.append(this.children[_t50],0);for(;i>0&&0==this.children[i-1].length;)this.children[--i].destroy();return this.children.length=i,this.markDirty(),this.length=t,e;}},{key:"transferDOM",value:function transferDOM(t){this.dom&&(this.markDirty(),t.setDOM(this.dom),t.prevAttrs=void 0===this.prevAttrs?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null);}},{key:"setDeco",value:function setDeco(t){ei(this.attrs,t)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=t);}},{key:"append",value:function append(t,e){Ye(this,t,e);}},{key:"addLineDeco",value:function addLineDeco(t){var e=t.spec.attributes,i=t.spec["class"];e&&(this.attrs=Ze(e,this.attrs||{})),i&&(this.attrs=Ze({"class":i},this.attrs||{}));}},{key:"domAtPos",value:function domAtPos(t){return Xe(this,t);}},{key:"reuseDOM",value:function reuseDOM(t){"DIV"==t.nodeName&&(this.setDOM(t),this.flags|=6);}},{key:"sync",value:function sync(t,e){var i;this.dom?4&this.flags&&(xe(this.dom),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0):(this.setDOM(document.createElement("div")),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0),void 0!==this.prevAttrs&&(ii(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),_superPropGet(ci,"sync",this,3)([t,e]);var s=this.dom.lastChild;for(;s&&Ee.get(s)instanceof Ge;)s=s.lastChild;if(!(s&&this.length&&("BR"==s.nodeName||0!=(null===(i=Ee.get(s))||void 0===i?void 0:i.isEditable)||Ue.ios&&this.children.some(function(t){return t instanceof Je;})))){var _t51=document.createElement("BR");_t51.cmIgnore=!0,this.dom.appendChild(_t51);}}},{key:"measureTextSize",value:function measureTextSize(){if(0==this.children.length||this.length>20)return null;var t,e=0;var _iterator40=_createForOfIteratorHelper(this.children),_step40;try{for(_iterator40.s();!(_step40=_iterator40.n()).done;){var _i57=_step40.value;if(!(_i57 instanceof Je)||/[^ -~]/.test(_i57.text))return null;var _s47=oe(_i57.dom);if(1!=_s47.length)return null;e+=_s47[0].width,t=_s47[0].height;}}catch(err){_iterator40.e(err);}finally{_iterator40.f();}return e?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:e/this.length,textHeight:t}:null;}},{key:"coordsAt",value:function coordsAt(t,e){var i=Qe(this,t,e);if(!this.children.length&&i&&this.parent){var _t52=this.parent.view.viewState.heightOracle,_e54=i.bottom-i.top;if(Math.abs(_e54-_t52.lineHeight)<2&&_t52.textHeight<_e54){var _s48=(_e54-_t52.textHeight)/2;return{top:i.top+_s48,bottom:i.bottom-_s48,left:i.left,right:i.left};}}return i;}},{key:"become",value:function become(t){return t instanceof ci&&0==this.children.length&&0==t.children.length&&ei(this.attrs,t.attrs)&&this.breakAfter==t.breakAfter;}},{key:"covers",value:function covers(){return!0;}}],[{key:"find",value:function find(t,e){for(var _i58=0,_s49=0;_i58<t.children.length;_i58++){var _r50=t.children[_i58],_n38=_s49+_r50.length;if(_n38>=e){if(_r50 instanceof ci)return _r50;if(_n38>e)break;}_s49=_n38+_r50.breakAfter;}return null;}}]);}(Ee);di=/*#__PURE__*/function(_Ee6){function di(t,e,i){var _this16;_classCallCheck(this,di);_this16=_callSuper(this,di),_this16.widget=t,_this16.length=e,_this16.deco=i,_this16.breakAfter=0,_this16.prevWidget=null;return _this16;}_inherits(di,_Ee6);return _createClass(di,[{key:"merge",value:function merge(t,e,i,s,r,n){return!(i&&(!(i instanceof di&&this.widget.compare(i.widget))||t>0&&r<=0||e<this.length&&n<=0))&&(this.length=t+(i?i.length:0)+(this.length-e),!0);}},{key:"domAtPos",value:function domAtPos(t){return 0==t?De.before(this.dom):De.after(this.dom,t==this.length);}},{key:"split",value:function split(t){var e=this.length-t;this.length=t;var i=new di(this.widget,e,this.deco);return i.breakAfter=this.breakAfter,i;}},{key:"children",get:function get(){return Oe;}},{key:"sync",value:function sync(t){this.dom&&this.widget.updateDOM(this.dom,t)||(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(t)),this.widget.editable||(this.dom.contentEditable="false"));}},{key:"overrideDOMText",get:function get(){return this.parent?this.parent.view.state.doc.slice(this.posAtStart,this.posAtEnd):a.empty;}},{key:"domBoundsAround",value:function domBoundsAround(){return null;}},{key:"become",value:function become(t){return t instanceof di&&t.widget.constructor==this.widget.constructor&&(t.widget.compare(this.widget)||this.markDirty(!0),this.dom&&!this.prevWidget&&(this.prevWidget=this.widget),this.widget=t.widget,this.length=t.length,this.deco=t.deco,this.breakAfter=t.breakAfter,!0);}},{key:"ignoreMutation",value:function ignoreMutation(){return!0;}},{key:"ignoreEvent",value:function ignoreEvent(t){return this.widget.ignoreEvent(t);}},{key:"isEditable",get:function get(){return!1;}},{key:"isWidget",get:function get(){return!0;}},{key:"coordsAt",value:function coordsAt(t,e){var i=this.widget.coordsAt(this.dom,t,e);return i||(this.widget instanceof pi?null:pe(this.dom.getBoundingClientRect(),this.length?0==t:e<=0));}},{key:"destroy",value:function destroy(){_superPropGet(di,"destroy",this,3)([]),this.dom&&this.widget.destroy(this.dom);}},{key:"covers",value:function covers(t){var _this$deco=this.deco,e=_this$deco.startSide,i=_this$deco.endSide;return e!=i&&(t<0?e<0:i>0);}}]);}(Ee);pi=/*#__PURE__*/function(_ri){function pi(t){var _this17;_classCallCheck(this,pi);_this17=_callSuper(this,pi),_this17.height=t;return _this17;}_inherits(pi,_ri);return _createClass(pi,[{key:"toDOM",value:function toDOM(){var t=document.createElement("div");return t.className="cm-gap",this.updateDOM(t),t;}},{key:"eq",value:function eq(t){return t.height==this.height;}},{key:"updateDOM",value:function updateDOM(t){return t.style.height=this.height+"px",!0;}},{key:"editable",get:function get(){return!0;}},{key:"estimatedHeight",get:function get(){return this.height;}},{key:"ignoreEvent",value:function ignoreEvent(){return!1;}}]);}(ri);mi=/*#__PURE__*/function(){function mi(t,e,i,s){_classCallCheck(this,mi);this.doc=t,this.pos=e,this.end=i,this.disallowBlockEffectsFor=s,this.content=[],this.curLine=null,this.breakAtStart=0,this.pendingBuffer=0,this.bufferMarks=[],this.atCursorPos=!0,this.openStart=-1,this.openEnd=-1,this.text="",this.textOff=0,this.cursor=t.iter(),this.skip=e;}return _createClass(mi,[{key:"posCovered",value:function posCovered(){if(0==this.content.length)return!this.breakAtStart&&this.doc.lineAt(this.pos).from!=this.pos;var t=this.content[this.content.length-1];return!(t.breakAfter||t instanceof di&&t.deco.endSide<0);}},{key:"getLine",value:function getLine(){return this.curLine||(this.content.push(this.curLine=new ci()),this.atCursorPos=!0),this.curLine;}},{key:"flushBuffer",value:function flushBuffer(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:this.bufferMarks;this.pendingBuffer&&(this.curLine.append(gi(new _e(-1),t),t.length),this.pendingBuffer=0);}},{key:"addBlockWidget",value:function addBlockWidget(t){this.flushBuffer(),this.curLine=null,this.content.push(t);}},{key:"finish",value:function finish(t){this.pendingBuffer&&t<=this.bufferMarks.length?this.flushBuffer():this.pendingBuffer=0,this.posCovered()||t&&this.content.length&&this.content[this.content.length-1]instanceof di||this.getLine();}},{key:"buildText",value:function buildText(t,e,i){for(;t>0;){if(this.textOff==this.text.length){var _this$cursor$next2=this.cursor.next(this.skip),_e55=_this$cursor$next2.value,_i59=_this$cursor$next2.lineBreak,_s50=_this$cursor$next2.done;if(this.skip=0,_s50)throw new Error("Ran out of text content when drawing inline views");if(_i59){this.posCovered()||this.getLine(),this.content.length?this.content[this.content.length-1].breakAfter=1:this.breakAtStart=1,this.flushBuffer(),this.curLine=null,this.atCursorPos=!0,t--;continue;}this.text=_e55,this.textOff=0;}var _s51=Math.min(this.text.length-this.textOff,t,512);this.flushBuffer(e.slice(e.length-i)),this.getLine().append(gi(new Je(this.text.slice(this.textOff,this.textOff+_s51)),e),i),this.atCursorPos=!0,this.textOff+=_s51,t-=_s51,i=0;}}},{key:"span",value:function span(t,e,i,s){this.buildText(e-t,i,s),this.pos=e,this.openStart<0&&(this.openStart=s);}},{key:"point",value:function point(t,e,i,s,r,n){if(this.disallowBlockEffectsFor[n]&&i instanceof ui){if(i.block)throw new RangeError("Block decorations may not be specified via plugins");if(e>this.doc.lineAt(this.pos).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins");}var h=e-t;if(i instanceof ui){if(i.block)i.startSide>0&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new di(i.widget||wi.block,h,i));else{var _n39=Ke.create(i.widget||wi.inline,h,h?0:i.startSide),_l19=this.atCursorPos&&!_n39.isEditable&&r<=s.length&&(t<e||i.startSide>0),_o12=!_n39.isEditable&&(t<e||r>s.length||i.startSide<=0),_u9=this.getLine();2!=this.pendingBuffer||_l19||_n39.isEditable||(this.pendingBuffer=0),this.flushBuffer(s),_l19&&(_u9.append(gi(new _e(1),s),r),r=s.length+Math.max(0,r-s.length)),_u9.append(gi(_n39,s),r),this.atCursorPos=_o12,this.pendingBuffer=_o12?t<e||r>s.length?1:2:0,this.pendingBuffer&&(this.bufferMarks=s.slice());}}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(i);h&&(this.textOff+h<=this.text.length?this.textOff+=h:(this.skip+=h-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=e),this.openStart<0&&(this.openStart=r);}}],[{key:"build",value:function build(t,e,i,s,r){var n=new mi(t,e,i,r);return n.openEnd=Bt.spans(s,e,i,n),n.openStart<0&&(n.openStart=n.openEnd),n.finish(n.openEnd),n;}}]);}();wi=/*#__PURE__*/function(_ri2){function wi(t){var _this18;_classCallCheck(this,wi);_this18=_callSuper(this,wi),_this18.tag=t;return _this18;}_inherits(wi,_ri2);return _createClass(wi,[{key:"eq",value:function eq(t){return t.tag==this.tag;}},{key:"toDOM",value:function toDOM(){return document.createElement(this.tag);}},{key:"updateDOM",value:function updateDOM(t){return t.nodeName.toLowerCase()==this.tag;}},{key:"isHidden",get:function get(){return!0;}}]);}(ri);wi.inline=new wi("span"),wi.block=new wi("div");bi=function(t){return t[t.LTR=0]="LTR",t[t.RTL=1]="RTL",t;}(bi||(bi={}));vi=bi.LTR,ki=bi.RTL;Mi=yi("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),xi=yi("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),Si=Object.create(null),Ai=[];for(_i62=0,_arr=["()","[]","{}"];_i62<_arr.length;_i62++){_t53=_arr[_i62];_e56=_t53.charCodeAt(0),_i63=_t53.charCodeAt(1);Si[_e56]=_i63,Si[_i63]=-_e56;}Di=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;Oi=/*#__PURE__*/function(){function Oi(t,e,i){_classCallCheck(this,Oi);this.from=t,this.to=e,this.level=i;}return _createClass(Oi,[{key:"dir",get:function get(){return this.level%2?ki:vi;}},{key:"side",value:function side(t,e){return this.dir==e==t?this.to:this.from;}},{key:"forward",value:function forward(t,e){return t==(this.dir==e);}}],[{key:"find",value:function find(t,e,i,s){var r=-1;for(var _n40=0;_n40<t.length;_n40++){var _h25=t[_n40];if(_h25.from<=e&&_h25.to>=e){if(_h25.level==i)return _n40;(r<0||(0!=s?s<0?_h25.from<e:_h25.to>e:t[r].level>_h25.level))&&(r=_n40);}}if(r<0)throw new RangeError("Index out of range");return r;}}]);}();Ii=[];Li="";ji=z.define(),Pi=z.define(),zi=z.define(),Hi=z.define(),Fi=z.define(),Wi=z.define(),Vi=z.define(),qi=z.define(),Ui=z.define(),Ji=z.define({combine:function combine(t){return t.some(function(t){return t;});}}),Gi=z.define({combine:function combine(t){return t.some(function(t){return t;});}}),Ki=z.define();_i=/*#__PURE__*/function(){function _i(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:"nearest";var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:"nearest";var s=arguments.length>3&&arguments[3]!==undefined?arguments[3]:5;var r=arguments.length>4&&arguments[4]!==undefined?arguments[4]:5;var n=arguments.length>5&&arguments[5]!==undefined?arguments[5]:!1;_classCallCheck(this,_i);this.range=t,this.y=e,this.x=i,this.yMargin=s,this.xMargin=r,this.isSnapshot=n;}return _createClass(_i,[{key:"map",value:function map(t){return t.empty?this:new _i(this.range.map(t),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot);}},{key:"clip",value:function clip(t){return this.range.to<=t.doc.length?this:new _i($.cursor(t.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot);}}]);}();Xi=mt.define({map:function map(t,e){return t.map(e);}}),Yi=mt.define();Zi=z.define({combine:function combine(t){return!t.length||t[0];}});ts=0;es=z.define();is=/*#__PURE__*/function(){function is(t,e,i,s,r){_classCallCheck(this,is);this.id=t,this.create=e,this.domEventHandlers=i,this.domEventObservers=s,this.extension=r(this);}return _createClass(is,null,[{key:"define",value:function define(t,e){var _ref4=e||{},i=_ref4.eventHandlers,s=_ref4.eventObservers,r=_ref4.provide,n=_ref4.decorations;return new is(ts++,t,i,s,function(t){var e=[es.of(t)];return n&&e.push(hs.of(function(e){var i=e.plugin(t);return i?n(i):hi.none;})),r&&e.push(r(t)),e;});}},{key:"fromClass",value:function fromClass(t,e){return is.define(function(e){return new t(e);},e);}}]);}();ss=/*#__PURE__*/function(){function ss(t){_classCallCheck(this,ss);this.spec=t,this.mustUpdate=null,this.value=null;}return _createClass(ss,[{key:"update",value:function update(t){if(this.value){if(this.mustUpdate){var _t62=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(_t62);}catch(e){if(Qi(_t62.state,e,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy();}catch(t){}this.deactivate();}}}else if(this.spec)try{this.value=this.spec.create(t);}catch(e){Qi(t.state,e,"CodeMirror plugin crashed"),this.deactivate();}return this;}},{key:"destroy",value:function destroy(t){var e;if(null===(e=this.value)||void 0===e?void 0:e.destroy)try{this.value.destroy();}catch(e){Qi(t.state,e,"CodeMirror plugin crashed");}}},{key:"deactivate",value:function deactivate(){this.spec=this.value=null;}}]);}();rs=z.define(),ns=z.define(),hs=z.define(),ls=z.define(),os=z.define(),us=z.define();as=z.define();ds=z.define();ps=/*#__PURE__*/function(){function ps(t,e,i,s){_classCallCheck(this,ps);this.fromA=t,this.toA=e,this.fromB=i,this.toB=s;}return _createClass(ps,[{key:"join",value:function join(t){return new ps(Math.min(this.fromA,t.fromA),Math.max(this.toA,t.toA),Math.min(this.fromB,t.fromB),Math.max(this.toB,t.toB));}},{key:"addToSet",value:function addToSet(t){var e=t.length,i=this;for(;e>0;e--){var _s58=t[e-1];if(!(_s58.fromA>i.toA)){if(_s58.toA<i.fromA)break;i=i.join(_s58),t.splice(e-1,1);}}return t.splice(e,0,i),t;}}],[{key:"extendWithRanges",value:function extendWithRanges(t,e){if(0==e.length)return t;var i=[];for(var _s59=0,_r57=0,_n46=0,_h33=0;;_s59++){var _l23=_s59==t.length?null:t[_s59],_o18=_n46-_h33,_u14=_l23?_l23.fromB:1e9;for(;_r57<e.length&&e[_r57]<_u14;){var _t65=e[_r57],_s60=e[_r57+1],_n47=Math.max(_h33,_t65),_l24=Math.min(_u14,_s60);if(_n47<=_l24&&new ps(_n47+_o18,_l24+_o18,_n47,_l24).addToSet(i),_s60>_u14)break;_r57+=2;}if(!_l23)return i;new ps(_l23.fromA,_l23.toA,_l23.fromB,_l23.toB).addToSet(i),_n46=_l23.toA,_h33=_l23.toB;}}}]);}();ms=/*#__PURE__*/function(){function ms(t,e,i){_classCallCheck(this,ms);this.view=t,this.state=e,this.transactions=i,this.flags=0,this.startState=t.state,this.changes=O.empty(this.startState.doc.length);var _iterator43=_createForOfIteratorHelper(i),_step43;try{for(_iterator43.s();!(_step43=_iterator43.n()).done;){var _t66=_step43.value;this.changes=this.changes.compose(_t66.changes);}}catch(err){_iterator43.e(err);}finally{_iterator43.f();}var s=[];this.changes.iterChangedRanges(function(t,e,i,r){return s.push(new ps(t,e,i,r));}),this.changedRanges=s;}return _createClass(ms,[{key:"viewportChanged",get:function get(){return(4&this.flags)>0;}},{key:"viewportMoved",get:function get(){return(8&this.flags)>0;}},{key:"heightChanged",get:function get(){return(2&this.flags)>0;}},{key:"geometryChanged",get:function get(){return this.docChanged||(18&this.flags)>0;}},{key:"focusChanged",get:function get(){return(1&this.flags)>0;}},{key:"docChanged",get:function get(){return!this.changes.empty;}},{key:"selectionSet",get:function get(){return this.transactions.some(function(t){return t.selection;});}},{key:"empty",get:function get(){return 0==this.flags&&0==this.transactions.length;}}],[{key:"create",value:function create(t,e,i){return new ms(t,e,i);}}]);}();gs=/*#__PURE__*/function(_Ee7){function gs(t){var _this19;_classCallCheck(this,gs);_this19=_callSuper(this,gs),_this19.view=t,_this19.decorations=[],_this19.dynamicDecorationMap=[!1],_this19.domChanged=null,_this19.hasComposition=null,_this19.markedForComposition=new Set(),_this19.editContextFormatting=hi.none,_this19.lastCompositionAfterCursor=!1,_this19.minWidth=0,_this19.minWidthFrom=0,_this19.minWidthTo=0,_this19.impreciseAnchor=null,_this19.impreciseHead=null,_this19.forceSelection=!1,_this19.lastUpdate=Date.now(),_this19.setDOM(t.contentDOM),_this19.children=[new ci()],_this19.children[0].setParent(_assertThisInitialized(_this19)),_this19.updateDeco(),_this19.updateInner([new ps(0,0,0,t.state.doc.length)],0,null);return _this19;}_inherits(gs,_Ee7);return _createClass(gs,[{key:"length",get:function get(){return this.view.state.doc.length;}},{key:"update",value:function update(t){var _this20=this;var e;var i=t.changedRanges;this.minWidth>0&&i.length&&(i.every(function(_ref5){var t=_ref5.fromA,e=_ref5.toA;return e<_this20.minWidthFrom||t>_this20.minWidthTo;})?(this.minWidthFrom=t.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=t.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(t);var s=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&((null===(e=this.domChanged)||void 0===e?void 0:e.newSel)?s=this.domChanged.newSel.head:function(t,e){var i=!1;e&&t.iterChangedRanges(function(t,s){t<e.to&&s>e.from&&(i=!0);});return i;}(t.changes,this.hasComposition)||t.selectionSet||(s=t.state.selection.main.head));var r=s>-1?function(t,e,i){var s=ws(t,i);if(!s)return null;var r=s.node,n=s.from,h=s.to,l=r.nodeValue;if(/[\n\r]/.test(l))return null;if(t.state.doc.sliceString(s.from,s.to)!=l)return null;var o=e.invertedDesc,u=new ps(o.mapPos(n),o.mapPos(h),n,h),f=[];for(var _e67=r.parentNode;;_e67=_e67.parentNode){var _i72=Ee.get(_e67);if(_i72 instanceof Ge)f.push({node:_e67,deco:_i72.mark});else{if(_i72 instanceof ci||"DIV"==_e67.nodeName&&_e67.parentNode==t.contentDOM)return{range:u,text:r,marks:f,line:_e67};if(_e67==t.contentDOM)return null;f.push({node:_e67,deco:new li({inclusive:!0,attributes:si(_e67),tagName:_e67.tagName.toLowerCase()})});}}}(this.view,t.changes,s):null;if(this.domChanged=null,this.hasComposition){this.markedForComposition.clear();var _this$hasComposition=this.hasComposition,_e68=_this$hasComposition.from,_s61=_this$hasComposition.to;i=new ps(_e68,_s61,t.changes.mapPos(_e68,-1),t.changes.mapPos(_s61,1)).addToSet(i.slice());}this.hasComposition=r?{from:r.range.fromB,to:r.range.toB}:null,(Ue.ie||Ue.chrome)&&!r&&t&&t.state.doc.lines!=t.startState.doc.lines&&(this.forceSelection=!0);var n=function(t,e,i){var s=new bs();return Bt.compare(t,e,i,s),s.changes;}(this.decorations,this.updateDeco(),t.changes);return i=ps.extendWithRanges(i,n),!!(7&this.flags||0!=i.length)&&(this.updateInner(i,t.startState.doc.length,r),t.transactions.length&&(this.lastUpdate=Date.now()),!0);}},{key:"updateInner",value:function updateInner(t,e,i){var _this21=this;this.view.viewState.mustMeasureContent=!0,this.updateChildren(t,e,i);var s=this.view.observer;s.ignore(function(){_this21.dom.style.height=_this21.view.viewState.contentHeight/_this21.view.scaleY+"px",_this21.dom.style.flexBasis=_this21.minWidth?_this21.minWidth+"px":"";var t=Ue.chrome||Ue.ios?{node:s.selectionRange.focusNode,written:!1}:void 0;_this21.sync(_this21.view,t),_this21.flags&=-8,t&&(t.written||s.selectionRange.focusNode!=t.node)&&(_this21.forceSelection=!0),_this21.dom.style.height="";}),this.markedForComposition.forEach(function(t){return t.flags&=-9;});var r=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length){var _iterator44=_createForOfIteratorHelper(this.children),_step44;try{for(_iterator44.s();!(_step44=_iterator44.n()).done;){var _t67=_step44.value;_t67 instanceof di&&_t67.widget instanceof pi&&r.push(_t67.dom);}}catch(err){_iterator44.e(err);}finally{_iterator44.f();}}s.updateGaps(r);}},{key:"updateChildren",value:function updateChildren(t,e,i){var s=i?i.range.addToSet(t.slice()):t,r=this.childCursor(e);for(var _t68=s.length-1;;_t68--){var _e69=_t68>=0?s[_t68]:null;if(!_e69)break;var _n48=void 0,_h34=void 0,_l25=void 0,_o19=void 0,_u15=_e69.fromA,_f11=_e69.toA,_a8=_e69.fromB,_c7=_e69.toB;if(i&&i.range.fromB<_c7&&i.range.toB>_a8){var _t69=mi.build(this.view.state.doc,_a8,i.range.fromB,this.decorations,this.dynamicDecorationMap),_e70=mi.build(this.view.state.doc,i.range.toB,_c7,this.decorations,this.dynamicDecorationMap);_h34=_t69.breakAtStart,_l25=_t69.openStart,_o19=_e70.openEnd;var _s62=this.compositionView(i);_e70.breakAtStart?_s62.breakAfter=1:_e70.content.length&&_s62.merge(_s62.length,_s62.length,_e70.content[0],!1,_e70.openStart,0)&&(_s62.breakAfter=_e70.content[0].breakAfter,_e70.content.shift()),_t69.content.length&&_s62.merge(0,0,_t69.content[_t69.content.length-1],!0,0,_t69.openEnd)&&_t69.content.pop(),_n48=_t69.content.concat(_s62).concat(_e70.content);}else{var _mi$build=mi.build(this.view.state.doc,_a8,_c7,this.decorations,this.dynamicDecorationMap);_n48=_mi$build.content;_h34=_mi$build.breakAtStart;_l25=_mi$build.openStart;_o19=_mi$build.openEnd;}var _r$findPos=r.findPos(_f11,1),_d4=_r$findPos.i,_p3=_r$findPos.off,_r$findPos2=r.findPos(_u15,-1),_m=_r$findPos2.i,_g=_r$findPos2.off;Te(this,_m,_g,_d4,_p3,_n48,_h34,_l25,_o19);}i&&this.fixCompositionDOM(i);}},{key:"updateEditContextFormatting",value:function updateEditContextFormatting(t){this.editContextFormatting=this.editContextFormatting.map(t.changes);var _iterator45=_createForOfIteratorHelper(t.transactions),_step45;try{for(_iterator45.s();!(_step45=_iterator45.n()).done;){var _e71=_step45.value;var _iterator46=_createForOfIteratorHelper(_e71.effects),_step46;try{for(_iterator46.s();!(_step46=_iterator46.n()).done;){var _t70=_step46.value;_t70.is(Yi)&&(this.editContextFormatting=_t70.value);}}catch(err){_iterator46.e(err);}finally{_iterator46.f();}}}catch(err){_iterator45.e(err);}finally{_iterator45.f();}}},{key:"compositionView",value:function compositionView(t){var e=new Je(t.text.nodeValue);e.flags|=8;var _iterator47=_createForOfIteratorHelper(t.marks),_step47;try{for(_iterator47.s();!(_step47=_iterator47.n()).done;){var _i73=_step47.value.deco;e=new Ge(_i73,[e],e.length);}}catch(err){_iterator47.e(err);}finally{_iterator47.f();}var i=new ci();return i.append(e,0),i;}},{key:"fixCompositionDOM",value:function fixCompositionDOM(t){var _this22=this;var e=function e(t,_e72){_e72.flags|=8|(_e72.children.some(function(t){return 7&t.flags;})?1:0),_this22.markedForComposition.add(_e72);var i=Ee.get(t);i&&i!=_e72&&(i.dom=null),_e72.setDOM(t);},i=this.childPos(t.range.fromB,1),s=this.children[i.i];e(t.line,s);for(var _r58=t.marks.length-1;_r58>=-1;_r58--)i=s.childPos(i.off,1),s=s.children[i.i],e(_r58>=0?t.marks[_r58].node:t.text,s);}},{key:"updateSelection",value:function updateSelection(){var _this23=this;var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:!1;var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!1;!t&&this.view.observer.selectionRange.focusNode||this.view.observer.readSelectionRange();var i=this.view.root.activeElement,s=i==this.dom,r=!s&&!(this.view.state.facet(Zi)||this.dom.tabIndex>-1)&&le(this.dom,this.view.observer.selectionRange)&&!(i&&this.dom.contains(i));if(!(s||e||r))return;var n=this.forceSelection;this.forceSelection=!1;var h=this.view.state.selection.main,l=this.moveToLine(this.domAtPos(h.anchor)),o=h.empty?l:this.moveToLine(this.domAtPos(h.head));if(Ue.gecko&&h.empty&&!this.hasComposition&&1==(u=l).node.nodeType&&u.node.firstChild&&(0==u.offset||"false"==u.node.childNodes[u.offset-1].contentEditable)&&(u.offset==u.node.childNodes.length||"false"==u.node.childNodes[u.offset].contentEditable)){var _t71=document.createTextNode("");this.view.observer.ignore(function(){return l.node.insertBefore(_t71,l.node.childNodes[l.offset]||null);}),l=o=new De(_t71,0),n=!0;}var u;var f=this.view.observer.selectionRange;!n&&f.focusNode&&(ue(l.node,l.offset,f.anchorNode,f.anchorOffset)&&ue(o.node,o.offset,f.focusNode,f.focusOffset)||this.suppressWidgetCursorChange(f,h))||(this.view.observer.ignore(function(){Ue.android&&Ue.chrome&&_this23.dom.contains(f.focusNode)&&function(t,e){for(var _i74=t;_i74&&_i74!=e;_i74=_i74.assignedSlot||_i74.parentNode)if(1==_i74.nodeType&&"false"==_i74.contentEditable)return!0;return!1;}(f.focusNode,_this23.dom)&&(_this23.dom.blur(),_this23.dom.focus({preventScroll:!0}));var t=ne(_this23.view.root);if(t){if(h.empty){if(Ue.gecko){var _t72=(e=l.node,s=l.offset,1!=e.nodeType?0:(s&&"false"==e.childNodes[s-1].contentEditable?1:0)|(s<e.childNodes.length&&"false"==e.childNodes[s].contentEditable?2:0));if(_t72&&3!=_t72){var _e73=(1==_t72?Ae:Ce)(l.node,l.offset);_e73&&(l=new De(_e73.node,_e73.offset));}}t.collapse(l.node,l.offset),null!=h.bidiLevel&&void 0!==t.caretBidiLevel&&(t.caretBidiLevel=h.bidiLevel);}else if(t.extend){t.collapse(l.node,l.offset);try{t.extend(o.node,o.offset);}catch(t){}}else{var _ref6;var _e74=document.createRange();h.anchor>h.head&&(_ref6=[o,l],l=_ref6[0],o=_ref6[1],_ref6),_e74.setEnd(o.node,o.offset),_e74.setStart(l.node,l.offset),t.removeAllRanges(),t.addRange(_e74);}}else;var e,s;r&&_this23.view.root.activeElement==_this23.dom&&(_this23.dom.blur(),i&&i.focus());}),this.view.observer.setSelectionRange(l,o)),this.impreciseAnchor=l.precise?null:new De(f.anchorNode,f.anchorOffset),this.impreciseHead=o.precise?null:new De(f.focusNode,f.focusOffset);}},{key:"suppressWidgetCursorChange",value:function suppressWidgetCursorChange(t,e){return this.hasComposition&&e.empty&&ue(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)&&this.posFromDOM(t.focusNode,t.focusOffset)==e.head;}},{key:"enforceCursorAssoc",value:function enforceCursorAssoc(){if(this.hasComposition)return;var t=this.view,e=t.state.selection.main,i=ne(t.root),_t$observer$selection=t.observer.selectionRange,s=_t$observer$selection.anchorNode,r=_t$observer$selection.anchorOffset;if(!(i&&e.empty&&e.assoc&&i.modify))return;var n=ci.find(this,e.head);if(!n)return;var h=n.posAtStart;if(e.head==h||e.head==h+n.length)return;var l=this.coordsAt(e.head,-1),o=this.coordsAt(e.head,1);if(!l||!o||l.bottom>o.top)return;var u=this.domAtPos(e.head+e.assoc);i.collapse(u.node,u.offset),i.modify("move",e.assoc<0?"forward":"backward","lineboundary"),t.observer.readSelectionRange();var f=t.observer.selectionRange;t.docView.posFromDOM(f.anchorNode,f.anchorOffset)!=e.from&&i.collapse(s,r);}},{key:"moveToLine",value:function moveToLine(t){var e,i=this.dom;if(t.node!=i)return t;for(var _s63=t.offset;!e&&_s63<i.childNodes.length;_s63++){var _t73=Ee.get(i.childNodes[_s63]);_t73 instanceof ci&&(e=_t73.domAtPos(0));}for(var _s64=t.offset-1;!e&&_s64>=0;_s64--){var _t74=Ee.get(i.childNodes[_s64]);_t74 instanceof ci&&(e=_t74.domAtPos(_t74.length));}return e?new De(e.node,e.offset,!0):t;}},{key:"nearest",value:function nearest(t){for(var _e75=t;_e75;){var _t75=Ee.get(_e75);if(_t75&&_t75.rootView==this)return _t75;_e75=_e75.parentNode;}return null;}},{key:"posFromDOM",value:function posFromDOM(t,e){var i=this.nearest(t);if(!i)throw new RangeError("Trying to find position for a DOM position outside of the document");return i.localPosFromDOM(t,e)+i.posAtStart;}},{key:"domAtPos",value:function domAtPos(t){var _this$childCursor$fin=this.childCursor().findPos(t,-1),e=_this$childCursor$fin.i,i=_this$childCursor$fin.off;for(;e<this.children.length-1;){var _t76=this.children[e];if(i<_t76.length||_t76 instanceof ci)break;e++,i=0;}return this.children[e].domAtPos(i);}},{key:"coordsAt",value:function coordsAt(t,e){var i=null,s=0;for(var _r59=this.length,_n49=this.children.length-1;_n49>=0;_n49--){var _h35=this.children[_n49],_l26=_r59-_h35.breakAfter,_o20=_l26-_h35.length;if(_l26<t)break;if(_o20<=t&&(_o20<t||_h35.covers(-1))&&(_l26>t||_h35.covers(1))&&(!i||_h35 instanceof ci&&!(i instanceof ci&&e>=0)))i=_h35,s=_o20;else if(i&&_o20==t&&_l26==t&&_h35 instanceof di&&Math.abs(e)<2){if(_h35.deco.startSide<0)break;_n49&&(i=null);}_r59=_o20;}return i?i.coordsAt(t-s,e):null;}},{key:"coordsForChar",value:function coordsForChar(t){var _this$childPos2=this.childPos(t,1),e=_this$childPos2.i,i=_this$childPos2.off,s=this.children[e];if(!(s instanceof ci))return null;for(;s.children.length;){var _s$childPos=s.childPos(i,1),_t77=_s$childPos.i,_e76=_s$childPos.off;for(;;_t77++){if(_t77==s.children.length)return null;if((s=s.children[_t77]).length)break;}i=_e76;}if(!(s instanceof Je))return null;var r=y(s.text,i);if(r==i)return null;var n=ye(s.dom,i,r).getClientRects();for(var _t78=0;_t78<n.length;_t78++){var _e77=n[_t78];if(_t78==n.length-1||_e77.top<_e77.bottom&&_e77.left<_e77.right)return _e77;}return null;}},{key:"measureVisibleLineHeights",value:function measureVisibleLineHeights(t){var e=[],i=t.from,s=t.to,r=this.view.contentDOM.clientWidth,n=r>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,h=-1,l=this.view.textDirection==bi.LTR;for(var _t79=0,_o21=0;_o21<this.children.length;_o21++){var _u16=this.children[_o21],_f12=_t79+_u16.length;if(_f12>s)break;if(_t79>=i){var _i75=_u16.dom.getBoundingClientRect();if(e.push(_i75.height),n){var _e78=_u16.dom.lastChild,_s65=_e78?oe(_e78):[];if(_s65.length){var _e79=_s65[_s65.length-1],_n50=l?_e79.right-_i75.left:_i75.right-_e79.left;_n50>h&&(h=_n50,this.minWidth=r,this.minWidthFrom=_t79,this.minWidthTo=_f12);}}}_t79=_f12+_u16.breakAfter;}return e;}},{key:"textDirectionAt",value:function textDirectionAt(t){var _this$childPos3=this.childPos(t,1),e=_this$childPos3.i;return"rtl"==getComputedStyle(this.children[e].dom).direction?bi.RTL:bi.LTR;}},{key:"measureTextSize",value:function measureTextSize(){var _this24=this;var _iterator48=_createForOfIteratorHelper(this.children),_step48;try{for(_iterator48.s();!(_step48=_iterator48.n()).done;){var _t80=_step48.value;if(_t80 instanceof ci){var _e80=_t80.measureTextSize();if(_e80)return _e80;}}}catch(err){_iterator48.e(err);}finally{_iterator48.f();}var t,e,i,s=document.createElement("div");return s.className="cm-line",s.style.width="99999px",s.style.position="absolute",s.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(function(){_this24.dom.appendChild(s);var r=oe(s.firstChild)[0];t=s.getBoundingClientRect().height,e=r?r.width/27:7,i=r?r.height:t,s.remove();}),{lineHeight:t,charWidth:e,textHeight:i};}},{key:"childCursor",value:function childCursor(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:this.length;var e=this.children.length;return e&&(t-=this.children[--e].length),new Re(this.children,t,e);}},{key:"computeBlockGapDeco",value:function computeBlockGapDeco(){var t=[],e=this.view.viewState;for(var _i76=0,_s66=0;;_s66++){var _r60=_s66==e.viewports.length?null:e.viewports[_s66],_n51=_r60?_r60.from-1:this.length;if(_n51>_i76){var _s67=(e.lineBlockAt(_n51).bottom-e.lineBlockAt(_i76).top)/this.view.scaleY;t.push(hi.replace({widget:new pi(_s67),block:!0,inclusive:!0,isBlockGap:!0}).range(_i76,_n51));}if(!_r60)break;_i76=_r60.to+1;}return hi.set(t);}},{key:"updateDeco",value:function updateDeco(){var _this25=this;var t=1,e=this.view.state.facet(hs).map(function(e){return(_this25.dynamicDecorationMap[t++]="function"==typeof e)?e(_this25.view):e;}),i=!1,s=this.view.state.facet(ls).map(function(t,e){var s="function"==typeof t;return s&&(i=!0),s?t(_this25.view):t;});for(s.length&&(this.dynamicDecorationMap[t++]=i,e.push(Bt.join(s))),this.decorations=[this.editContextFormatting].concat(_toConsumableArray(e),[this.computeBlockGapDeco(),this.view.viewState.lineGapDeco]);t<this.decorations.length;)this.dynamicDecorationMap[t++]=!1;return this.decorations;}},{key:"scrollIntoView",value:function scrollIntoView(t){if(t.isSnapshot){var _e81=this.view.viewState.lineBlockAt(t.range.head);return this.view.scrollDOM.scrollTop=_e81.top-t.yMargin,void(this.view.scrollDOM.scrollLeft=t.xMargin);}var _iterator49=_createForOfIteratorHelper(this.view.state.facet(Ki)),_step49;try{for(_iterator49.s();!(_step49=_iterator49.n()).done;){var _e84=_step49.value;try{if(_e84(this.view,t.range,t))return!0;}catch(t){Qi(this.view.state,t,"scroll handler");}}}catch(err){_iterator49.e(err);}finally{_iterator49.f();}var e,i=t.range,s=this.coordsAt(i.head,i.empty?i.assoc:i.head>i.anchor?-1:1);if(!s)return;!i.empty&&(e=this.coordsAt(i.anchor,i.anchor>i.head?-1:1))&&(s={left:Math.min(s.left,e.left),top:Math.min(s.top,e.top),right:Math.max(s.right,e.right),bottom:Math.max(s.bottom,e.bottom)});var r=cs(this.view),n={left:s.left-r.left,top:s.top-r.top,right:s.right+r.right,bottom:s.bottom+r.bottom},_this$view$scrollDOM=this.view.scrollDOM,h=_this$view$scrollDOM.offsetWidth,l=_this$view$scrollDOM.offsetHeight;!function(t,e,i,s,r,n,h,l){var o=t.ownerDocument,u=o.defaultView||window;for(var _f13=t,_a9=!1;_f13&&!_a9;)if(1==_f13.nodeType){var _t81=void 0,_c8=_f13==o.body,_d5=1,_p4=1;if(_c8)_t81=me(u);else{var _ge;if(/^(fixed|sticky)$/.test(getComputedStyle(_f13).position)&&(_a9=!0),_f13.scrollHeight<=_f13.clientHeight&&_f13.scrollWidth<=_f13.clientWidth){_f13=_f13.assignedSlot||_f13.parentNode;continue;}var _e82=_f13.getBoundingClientRect();_ge=ge(_f13,_e82),_d5=_ge.scaleX,_p4=_ge.scaleY,_t81={left:_e82.left,right:_e82.left+_f13.clientWidth*_d5,top:_e82.top,bottom:_e82.top+_f13.clientHeight*_p4};}var _m2=0,_g2=0;if("nearest"==r)e.top<_t81.top?(_g2=-(_t81.top-e.top+h),i>0&&e.bottom>_t81.bottom+_g2&&(_g2=e.bottom-_t81.bottom+_g2+h)):e.bottom>_t81.bottom&&(_g2=e.bottom-_t81.bottom+h,i<0&&e.top-_g2<_t81.top&&(_g2=-(_t81.top+_g2-e.top+h)));else{var _s68=e.bottom-e.top,_n52=_t81.bottom-_t81.top;_g2=("center"==r&&_s68<=_n52?e.top+_s68/2-_n52/2:"start"==r||"center"==r&&i<0?e.top-h:e.bottom-_n52+h)-_t81.top;}if("nearest"==s?e.left<_t81.left?(_m2=-(_t81.left-e.left+n),i>0&&e.right>_t81.right+_m2&&(_m2=e.right-_t81.right+_m2+n)):e.right>_t81.right&&(_m2=e.right-_t81.right+n,i<0&&e.left<_t81.left+_m2&&(_m2=-(_t81.left+_m2-e.left+n))):_m2=("center"==s?e.left+(e.right-e.left)/2-(_t81.right-_t81.left)/2:"start"==s==l?e.left-n:e.right-(_t81.right-_t81.left)+n)-_t81.left,_m2||_g2)if(_c8)u.scrollBy(_m2,_g2);else{var _t82=0,_i77=0;if(_g2){var _t83=_f13.scrollTop;_f13.scrollTop+=_g2/_p4,_i77=(_f13.scrollTop-_t83)*_p4;}if(_m2){var _e83=_f13.scrollLeft;_f13.scrollLeft+=_m2/_d5,_t82=(_f13.scrollLeft-_e83)*_d5;}e={left:e.left-_t82,top:e.top-_i77,right:e.right-_t82,bottom:e.bottom-_i77},_t82&&Math.abs(_t82-_m2)<1&&(s="nearest"),_i77&&Math.abs(_i77-_g2)<1&&(r="nearest");}if(_c8)break;_f13=_f13.assignedSlot||_f13.parentNode;}else{if(11!=_f13.nodeType)break;_f13=_f13.host;}}(this.view.scrollDOM,n,i.head<i.anchor?-1:1,t.x,t.y,Math.max(Math.min(t.xMargin,h),-h),Math.max(Math.min(t.yMargin,l),-l),this.view.textDirection==bi.LTR);}}]);}(Ee);bs=/*#__PURE__*/function(){function bs(){_classCallCheck(this,bs);this.changes=[];}return _createClass(bs,[{key:"compareRange",value:function compareRange(t,e){ai(t,e,this.changes);}},{key:"comparePoint",value:function comparePoint(t,e){ai(t,e,this.changes);}},{key:"boundChange",value:function boundChange(t){ai(t,t,this.changes);}}]);}();Ts="";Bs=/*#__PURE__*/function(){function Bs(t,e){_classCallCheck(this,Bs);this.points=t,this.text="",this.lineSeparator=e.facet(Dt.lineSeparator);}return _createClass(Bs,[{key:"append",value:function append(t){this.text+=t;}},{key:"lineBreak",value:function lineBreak(){this.text+=Ts;}},{key:"readRange",value:function readRange(t,e){if(!t)return this;var i=t.parentNode;for(var _s71=t;;){this.findPointBefore(i,_s71);var _t91=this.text.length;this.readNode(_s71);var _r63=_s71.nextSibling;if(_r63==e)break;var _n54=Ee.get(_s71),_h36=Ee.get(_r63);(_n54&&_h36?_n54.breakAfter:(_n54?_n54.breakAfter:ae(_s71))||ae(_r63)&&("BR"!=_s71.nodeName||_s71.cmIgnore)&&this.text.length>_t91)&&this.lineBreak(),_s71=_r63;}return this.findPointBefore(i,e),this;}},{key:"readTextNode",value:function readTextNode(t){var e=t.nodeValue;var _iterator52=_createForOfIteratorHelper(this.points),_step52;try{for(_iterator52.s();!(_step52=_iterator52.n()).done;){var _i80=_step52.value;_i80.node==t&&(_i80.pos=this.text.length+Math.min(_i80.offset,e.length));}}catch(err){_iterator52.e(err);}finally{_iterator52.f();}for(var _i79=0,_s72=this.lineSeparator?null:/\r\n?|\n/g;;){var _r64=void 0,_n55=-1,_h37=1;if(this.lineSeparator?(_n55=e.indexOf(this.lineSeparator,_i79),_h37=this.lineSeparator.length):(_r64=_s72.exec(e))&&(_n55=_r64.index,_h37=_r64[0].length),this.append(e.slice(_i79,_n55<0?e.length:_n55)),_n55<0)break;if(this.lineBreak(),_h37>1){var _iterator53=_createForOfIteratorHelper(this.points),_step53;try{for(_iterator53.s();!(_step53=_iterator53.n()).done;){var _e93=_step53.value;_e93.node==t&&_e93.pos>this.text.length&&(_e93.pos-=_h37-1);}}catch(err){_iterator53.e(err);}finally{_iterator53.f();}}_i79=_n55+_h37;}}},{key:"readNode",value:function readNode(t){if(t.cmIgnore)return;var e=Ee.get(t),i=e&&e.overrideDOMText;if(null!=i){this.findPointInside(t,i.length);for(var _t92=i.iter();!_t92.next().done;)_t92.lineBreak?this.lineBreak():this.append(_t92.value);}else 3==t.nodeType?this.readTextNode(t):"BR"==t.nodeName?t.nextSibling&&this.lineBreak():1==t.nodeType&&this.readRange(t.firstChild,null);}},{key:"findPointBefore",value:function findPointBefore(t,e){var _iterator54=_createForOfIteratorHelper(this.points),_step54;try{for(_iterator54.s();!(_step54=_iterator54.n()).done;){var _i81=_step54.value;_i81.node==t&&t.childNodes[_i81.offset]==e&&(_i81.pos=this.text.length);}}catch(err){_iterator54.e(err);}finally{_iterator54.f();}}},{key:"findPointInside",value:function findPointInside(t,e){var _iterator55=_createForOfIteratorHelper(this.points),_step55;try{for(_iterator55.s();!(_step55=_iterator55.n()).done;){var _i82=_step55.value;(3==t.nodeType?_i82.node==t:t.contains(_i82.node))&&(_i82.pos=this.text.length+(Ls(t,_i82.node,_i82.offset)?e:0));}}catch(err){_iterator55.e(err);}finally{_iterator55.f();}}}]);}();Ns=/*#__PURE__*/_createClass(function Ns(t,e){_classCallCheck(this,Ns);this.node=t,this.offset=e,this.pos=-1;});$s=/*#__PURE__*/_createClass(function $s(t,e,i,s){_classCallCheck(this,$s);this.typeOver=s,this.bounds=null,this.text="",this.domChanged=e>-1;var _t$docView=t.docView,r=_t$docView.impreciseHead,n=_t$docView.impreciseAnchor;if(t.state.readOnly&&e>-1)this.newSel=null;else if(e>-1&&(this.bounds=t.docView.domBoundsAround(e,i,0))){var _e94=r||n?[]:function(t){var e=[];if(t.root.activeElement!=t.contentDOM)return e;var _t$observer$selection2=t.observer.selectionRange,i=_t$observer$selection2.anchorNode,s=_t$observer$selection2.anchorOffset,r=_t$observer$selection2.focusNode,n=_t$observer$selection2.focusOffset;i&&(e.push(new Ns(i,s)),r==i&&n==s||e.push(new Ns(r,n)));return e;}(t),_i83=new Bs(_e94,t.state);_i83.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=_i83.text,this.newSel=function(t,e){if(0==t.length)return null;var i=t[0].pos,s=2==t.length?t[1].pos:i;return i>-1&&s>-1?$.single(i+e,s+e):null;}(_e94,this.bounds.from);}else{var _e95=t.observer.selectionRange,_i84=r&&r.node==_e95.focusNode&&r.offset==_e95.focusOffset||!he(t.contentDOM,_e95.focusNode)?t.state.selection.main.head:t.docView.posFromDOM(_e95.focusNode,_e95.focusOffset),_s73=n&&n.node==_e95.anchorNode&&n.offset==_e95.anchorOffset||!he(t.contentDOM,_e95.anchorNode)?t.state.selection.main.anchor:t.docView.posFromDOM(_e95.anchorNode,_e95.anchorOffset),_h38=t.viewport;if((Ue.ios||Ue.chrome)&&t.state.selection.main.empty&&_i84!=_s73&&(_h38.from>0||_h38.to<t.state.doc.length)){var _e96=Math.min(_i84,_s73),_r65=Math.max(_i84,_s73),_n56=_h38.from-_e96,_l30=_h38.to-_r65;0!=_n56&&1!=_n56&&0!=_e96||0!=_l30&&-1!=_l30&&_r65!=t.state.doc.length||(_i84=0,_s73=t.state.doc.length);}this.newSel=$.single(_s73,_i84);}});zs=/*#__PURE__*/function(){function zs(t){_classCallCheck(this,zs);this.view=t,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=t.hasFocus,Ue.safari&&t.contentDOM.addEventListener("input",function(){return null;}),Ue.gecko&&function(t){cr.has(t)||(cr.add(t),t.addEventListener("copy",function(){}),t.addEventListener("cut",function(){}));}(t.contentDOM.ownerDocument);}return _createClass(zs,[{key:"setSelectionOrigin",value:function setSelectionOrigin(t){this.lastSelectionOrigin=t,this.lastSelectionTime=Date.now();}},{key:"handleEvent",value:function handleEvent(t){(function(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(var _i87,_s75=e.target;_s75!=t.contentDOM;_s75=_s75.parentNode)if(!_s75||11==_s75.nodeType||(_i87=Ee.get(_s75))&&_i87.ignoreEvent(e))return!1;return!0;})(this.view,t)&&!this.ignoreDuringComposition(t)&&("keydown"==t.type&&this.keydown(t)||this.runHandlers(t.type,t));}},{key:"runHandlers",value:function runHandlers(t,e){var i=this.handlers[t];if(i){var _iterator56=_createForOfIteratorHelper(i.observers),_step56;try{for(_iterator56.s();!(_step56=_iterator56.n()).done;){var _t94=_step56.value;_t94(this.view,e);}}catch(err){_iterator56.e(err);}finally{_iterator56.f();}var _iterator57=_createForOfIteratorHelper(i.handlers),_step57;try{for(_iterator57.s();!(_step57=_iterator57.n()).done;){var _t95=_step57.value;if(e.defaultPrevented)break;if(_t95(this.view,e)){e.preventDefault();break;}}}catch(err){_iterator57.e(err);}finally{_iterator57.f();}}}},{key:"ensureHandlers",value:function ensureHandlers(t){var e=Fs(t),i=this.handlers,s=this.view.contentDOM;for(var _t96 in e)if("scroll"!=_t96){var _r66=!e[_t96].handlers.length,_n57=i[_t96];_n57&&_r66!=!_n57.handlers.length&&(s.removeEventListener(_t96,this.handleEvent),_n57=null),_n57||s.addEventListener(_t96,this.handleEvent,{passive:_r66});}for(var _t97 in i)"scroll"==_t97||e[_t97]||s.removeEventListener(_t97,this.handleEvent);this.handlers=e;}},{key:"keydown",value:function keydown(t){var _this26=this;if(this.lastKeyCode=t.keyCode,this.lastKeyTime=Date.now(),9==t.keyCode&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&27!=t.keyCode&&qs.indexOf(t.keyCode)<0&&(this.tabFocusMode=-1),Ue.android&&Ue.chrome&&!t.synthetic&&(13==t.keyCode||8==t.keyCode))return this.view.observer.delayAndroidKey(t.key,t.keyCode),!0;var e;return!Ue.ios||t.synthetic||t.altKey||t.metaKey||!((e=Ws.find(function(e){return e.keyCode==t.keyCode;}))&&!t.ctrlKey||Vs.indexOf(t.key)>-1&&t.ctrlKey&&!t.shiftKey)?(229!=t.keyCode&&this.view.observer.forceFlush(),!1):(this.pendingIOSKey=e||t,setTimeout(function(){return _this26.flushIOSKey();},250),!0);}},{key:"flushIOSKey",value:function flushIOSKey(t){var e=this.pendingIOSKey;return!!e&&!("Enter"==e.key&&t&&t.from<t.to&&/^\S+$/.test(t.insert.toString()))&&(this.pendingIOSKey=void 0,Me(this.view.contentDOM,e.key,e.keyCode,e instanceof KeyboardEvent?e:void 0));}},{key:"ignoreDuringComposition",value:function ignoreDuringComposition(t){return!!/^key/.test(t.type)&&(this.composing>0||!!(Ue.safari&&!Ue.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100)&&(this.compositionPendingKey=!1,!0));}},{key:"startMouseSelection",value:function startMouseSelection(t){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=t;}},{key:"update",value:function update(t){this.view.observer.update(t),this.mouseSelection&&this.mouseSelection.update(t),this.draggedContent&&t.docChanged&&(this.draggedContent=this.draggedContent.map(t.changes)),t.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0);}},{key:"destroy",value:function destroy(){this.mouseSelection&&this.mouseSelection.destroy();}}]);}();Ws=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],Vs="dthko",qs=[16,17,18,20,91,92,224,225];Js=/*#__PURE__*/function(){function Js(t,e,i,s){_classCallCheck(this,Js);this.view=t,this.startEvent=e,this.style=i,this.mustSelect=s,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=e,this.scrollParents=function(t){var e,i,s=t.ownerDocument;for(var _r69=t.parentNode;_r69&&!(_r69==s.body||e&&i);)if(1==_r69.nodeType)!i&&_r69.scrollHeight>_r69.clientHeight&&(i=_r69),!e&&_r69.scrollWidth>_r69.clientWidth&&(e=_r69),_r69=_r69.assignedSlot||_r69.parentNode;else{if(11!=_r69.nodeType)break;_r69=_r69.host;}return{x:e,y:i};}(t.contentDOM),this.atoms=t.state.facet(os).map(function(e){return e(t);});var r=t.contentDOM.ownerDocument;r.addEventListener("mousemove",this.move=this.move.bind(this)),r.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=e.shiftKey,this.multiple=t.state.facet(Dt.allowMultipleSelections)&&function(t,e){var i=t.state.facet(ji);return i.length?i[0](e):Ue.mac?e.metaKey:e.ctrlKey;}(t,e),this.dragging=!(!function(t,e){var i=t.state.selection.main;if(i.empty)return!1;var s=ne(t.root);if(!s||0==s.rangeCount)return!0;var r=s.getRangeAt(0).getClientRects();for(var _t101=0;_t101<r.length;_t101++){var _i88=r[_t101];if(_i88.left<=e.clientX&&_i88.right>=e.clientX&&_i88.top<=e.clientY&&_i88.bottom>=e.clientY)return!0;}return!1;}(t,e)||1!=hr(e))&&null;}return _createClass(Js,[{key:"start",value:function start(t){!1===this.dragging&&this.select(t);}},{key:"move",value:function move(t){var _this$scrollParents$x,_this$scrollParents$y;if(0==t.buttons)return this.destroy();if(this.dragging||null==this.dragging&&(e=this.startEvent,i=t,Math.max(Math.abs(e.clientX-i.clientX),Math.abs(e.clientY-i.clientY))<10))return;var e,i;this.select(this.lastEvent=t);var s=0,r=0,n=0,h=0,l=this.view.win.innerWidth,o=this.view.win.innerHeight;this.scrollParents.x&&(_this$scrollParents$x=this.scrollParents.x.getBoundingClientRect(),n=_this$scrollParents$x.left,l=_this$scrollParents$x.right,_this$scrollParents$x),this.scrollParents.y&&(_this$scrollParents$y=this.scrollParents.y.getBoundingClientRect(),h=_this$scrollParents$y.top,o=_this$scrollParents$y.bottom,_this$scrollParents$y);var u=cs(this.view);t.clientX-u.left<=n+6?s=-Us(n-t.clientX):t.clientX+u.right>=l-6&&(s=Us(t.clientX-l)),t.clientY-u.top<=h+6?r=-Us(h-t.clientY):t.clientY+u.bottom>=o-6&&(r=Us(t.clientY-o)),this.setScrollSpeed(s,r);}},{key:"up",value:function up(t){null==this.dragging&&this.select(this.lastEvent),this.dragging||t.preventDefault(),this.destroy();}},{key:"destroy",value:function destroy(){this.setScrollSpeed(0,0);var t=this.view.contentDOM.ownerDocument;t.removeEventListener("mousemove",this.move),t.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null;}},{key:"setScrollSpeed",value:function setScrollSpeed(t,e){var _this27=this;this.scrollSpeed={x:t,y:e},t||e?this.scrolling<0&&(this.scrolling=setInterval(function(){return _this27.scroll();},50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1);}},{key:"scroll",value:function scroll(){var _this$scrollSpeed=this.scrollSpeed,t=_this$scrollSpeed.x,e=_this$scrollSpeed.y;t&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=t,t=0),e&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=e,e=0),(t||e)&&this.view.win.scrollBy(t,e),!1===this.dragging&&this.select(this.lastEvent);}},{key:"skipAtoms",value:function skipAtoms(t){var e=null;for(var _i89=0;_i89<t.ranges.length;_i89++){var _s78=t.ranges[_i89],_r70=null;if(_s78.empty){var _t102=Is(this.atoms,_s78.from,0);_t102!=_s78.from&&(_r70=$.cursor(_t102,-1));}else{var _t103=Is(this.atoms,_s78.from,-1),_e99=Is(this.atoms,_s78.to,1);_t103==_s78.from&&_e99==_s78.to||(_r70=$.range(_s78.from==_s78.anchor?_t103:_e99,_s78.from==_s78.head?_t103:_e99));}_r70&&(e||(e=t.ranges.slice()),e[_i89]=_r70);}return e?$.create(e,t.mainIndex):t;}},{key:"select",value:function select(t){var e=this.view,i=this.skipAtoms(this.style.get(t,this.extend,this.multiple));!this.mustSelect&&i.eq(e.state.selection,!1===this.dragging)||this.view.dispatch({selection:i,userEvent:"select.pointer"}),this.mustSelect=!1;}},{key:"update",value:function update(t){var _this28=this;t.transactions.some(function(t){return t.isUserEvent("input.type");})?this.destroy():this.style.update(t)&&setTimeout(function(){return _this28.select(_this28.lastEvent);},20);}}]);}();Gs=Object.create(null),Ks=Object.create(null),_s=Ue.ie&&Ue.ie_version<15||Ue.ios&&Ue.webkit_version<604;Ks.scroll=function(t){t.inputState.lastScrollTop=t.scrollDOM.scrollTop,t.inputState.lastScrollLeft=t.scrollDOM.scrollLeft;},Gs.keydown=function(t,e){return t.inputState.setSelectionOrigin("select"),27==e.keyCode&&0!=t.inputState.tabFocusMode&&(t.inputState.tabFocusMode=Date.now()+2e3),!1;},Ks.touchstart=function(t,e){t.inputState.lastTouchTime=Date.now(),t.inputState.setSelectionOrigin("select.pointer");},Ks.touchmove=function(t){t.inputState.setSelectionOrigin("select.pointer");},Gs.mousedown=function(t,e){if(t.observer.flush(),t.inputState.lastTouchTime>Date.now()-2e3)return!1;var i=null;var _iterator60=_createForOfIteratorHelper(t.state.facet(zi)),_step60;try{for(_iterator60.s();!(_step60=_iterator60.n()).done;){var _s83=_step60.value;if(i=_s83(t,e),i)break;}}catch(err){_iterator60.e(err);}finally{_iterator60.f();}if(i||0!=e.button||(i=function(t,e){var i=er(t,e),s=hr(e),r=t.state.selection;return{update:function update(t){t.docChanged&&(i.pos=t.changes.mapPos(i.pos),r=r.map(t.changes));},get:function get(e,n,h){var l,o=er(t,e),u=Qs(t,o.pos,o.bias,s);if(i.pos!=o.pos&&!n){var _e100=Qs(t,i.pos,i.bias,s),_r72=Math.min(_e100.from,u.from),_n59=Math.max(_e100.to,u.to);u=_r72<u.from?$.range(_r72,_n59):$.range(_n59,_r72);}return n?r.replaceRange(r.main.extend(u.from,u.to)):h&&1==s&&r.ranges.length>1&&(l=function(t,e){for(var _i91=0;_i91<t.ranges.length;_i91++){var _t$ranges$_i=t.ranges[_i91],_s81=_t$ranges$_i.from,_r73=_t$ranges$_i.to;if(_s81<=e&&_r73>=e)return $.create(t.ranges.slice(0,_i91).concat(t.ranges.slice(_i91+1)),t.mainIndex==_i91?0:t.mainIndex-(t.mainIndex>_i91?1:0));}return null;}(r,o.pos))?l:h?r.addRange(u):$.create([u]);}};}(t,e)),i){var _s82=!t.hasFocus;t.inputState.startMouseSelection(new Js(t,e,i,_s82)),_s82&&t.observer.ignore(function(){ke(t.contentDOM);var e=t.root.activeElement;e&&!e.contains(t.contentDOM)&&e.blur();});var _r74=t.inputState.mouseSelection;if(_r74)return _r74.start(e),!1===_r74.dragging;}return!1;};Zs=function Zs(t,e,i){return e>=i.top&&e<=i.bottom&&t>=i.left&&t<=i.right;};ir=Ue.ie&&Ue.ie_version<=11;sr=null,rr=0,nr=0;Gs.dragstart=function(t,e){var i=t.state.selection.main;if(e.target.draggable){var _s84=t.docView.nearest(e.target);if(_s84&&_s84.isWidget){var _t107=_s84.posAtStart,_e101=_t107+_s84.length;(_t107>=i.to||_e101<=i.from)&&(i=$.range(_t107,_e101));}}var s=t.inputState;return s.mouseSelection&&(s.mouseSelection.dragging=!0),s.draggedContent=i,e.dataTransfer&&(e.dataTransfer.setData("Text",Xs(t.state,Ui,t.state.sliceDoc(i.from,i.to))),e.dataTransfer.effectAllowed="copyMove"),!1;},Gs.dragend=function(t){return t.inputState.draggedContent=null,!1;},Gs.drop=function(t,e){if(!e.dataTransfer)return!1;if(t.state.readOnly)return!0;var i=e.dataTransfer.files;if(i&&i.length){var _s85=Array(i.length),_r75=0,_n60=function _n60(){++_r75==i.length&&lr(t,e,_s85.filter(function(t){return null!=t;}).join(t.state.lineBreak),!1);};var _loop6=function _loop6(_t108){var e=new FileReader();e.onerror=_n60,e.onload=function(){/[\x00-\x08\x0e-\x1f]{2}/.test(e.result)||(_s85[_t108]=e.result),_n60();},e.readAsText(i[_t108]);};for(var _t108=0;_t108<i.length;_t108++){_loop6(_t108);}return!0;}{var _i92=e.dataTransfer.getData("Text");if(_i92)return lr(t,e,_i92,!0),!0;}return!1;},Gs.paste=function(t,e){if(t.state.readOnly)return!0;t.observer.flush();var i=_s?null:e.clipboardData;return i?(Ys(t,i.getData("text/plain")||i.getData("text/uri-list")),!0):(function(t){var e=t.dom.parentNode;if(!e)return;var i=e.appendChild(document.createElement("textarea"));i.style.cssText="position: fixed; left: -10000px; top: 10px",i.focus(),setTimeout(function(){t.focus(),i.remove(),Ys(t,i.value);},50);}(t),!1);};or=null;Gs.copy=Gs.cut=function(t,e){var _ref7=function(t){var e=[],i=[],s=!1;var _iterator61=_createForOfIteratorHelper(t.selection.ranges),_step61;try{for(_iterator61.s();!(_step61=_iterator61.n()).done;){var _s87=_step61.value;_s87.empty||(e.push(t.sliceDoc(_s87.from,_s87.to)),i.push(_s87));}}catch(err){_iterator61.e(err);}finally{_iterator61.f();}if(!e.length){var _r76=-1;var _iterator62=_createForOfIteratorHelper(t.selection.ranges),_step62;try{for(_iterator62.s();!(_step62=_iterator62.n()).done;){var _s86=_step62.value.from;var _n61=t.doc.lineAt(_s86);_n61.number>_r76&&(e.push(_n61.text),i.push({from:_n61.from,to:Math.min(t.doc.length,_n61.to+1)})),_r76=_n61.number;}}catch(err){_iterator62.e(err);}finally{_iterator62.f();}s=!0;}return{text:Xs(t,Ui,e.join(t.lineBreak)),ranges:i,linewise:s};}(t.state),i=_ref7.text,s=_ref7.ranges,r=_ref7.linewise;if(!i&&!r)return!1;or=r?i:null,"cut"!=e.type||t.state.readOnly||t.dispatch({changes:s,scrollIntoView:!0,userEvent:"delete.cut"});var n=_s?null:e.clipboardData;return n?(n.clearData(),n.setData("text/plain",i),!0):(function(t,e){var i=t.dom.parentNode;if(!i)return;var s=i.appendChild(document.createElement("textarea"));s.style.cssText="position: fixed; left: -10000px; top: 10px",s.value=e,s.focus(),s.selectionEnd=e.length,s.selectionStart=0,setTimeout(function(){s.remove(),t.focus();},50);}(t,i),!1);};ur=ct.define();Ks.focus=function(t){t.inputState.lastFocusTime=Date.now(),t.scrollDOM.scrollTop||!t.inputState.lastScrollTop&&!t.inputState.lastScrollLeft||(t.scrollDOM.scrollTop=t.inputState.lastScrollTop,t.scrollDOM.scrollLeft=t.inputState.lastScrollLeft),ar(t);},Ks.blur=function(t){t.observer.clearSelectionRange(),ar(t);},Ks.compositionstart=Ks.compositionupdate=function(t){t.observer.editContext||(null==t.inputState.compositionFirstChange&&(t.inputState.compositionFirstChange=!0),t.inputState.composing<0&&(t.inputState.composing=0));},Ks.compositionend=function(t){t.observer.editContext||(t.inputState.composing=-1,t.inputState.compositionEndedAt=Date.now(),t.inputState.compositionPendingKey=!0,t.inputState.compositionPendingChange=t.observer.pendingRecords().length>0,t.inputState.compositionFirstChange=null,Ue.chrome&&Ue.android?t.observer.flushSoon():t.inputState.compositionPendingChange?Promise.resolve().then(function(){return t.observer.flush();}):setTimeout(function(){t.inputState.composing<0&&t.docView.hasComposition&&t.update([]);},50));},Ks.contextmenu=function(t){t.inputState.lastContextMenu=Date.now();},Gs.beforeinput=function(t,e){var i,s;if("insertReplacementText"==e.inputType&&t.observer.editContext){var _s89=null===(i=e.dataTransfer)||void 0===i?void 0:i.getData("text/plain"),_r78=e.getTargetRanges();if(_s89&&_r78.length){var _e102=_r78[0],_i94=t.posAtDOM(_e102.startContainer,_e102.startOffset),_n62=t.posAtDOM(_e102.endContainer,_e102.endOffset);return Ps(t,{from:_i94,to:_n62,insert:t.state.toText(_s89)},null),!0;}}var r;if(Ue.chrome&&Ue.android&&(r=Ws.find(function(t){return t.inputType==e.inputType;}))&&(t.observer.delayAndroidKey(r.key,r.keyCode),"Backspace"==r.key||"Delete"==r.key)){var _e103=(null===(s=window.visualViewport)||void 0===s?void 0:s.height)||0;setTimeout(function(){var i;((null===(i=window.visualViewport)||void 0===i?void 0:i.height)||0)>_e103+10&&t.hasFocus&&(t.contentDOM.blur(),t.focus());},100);}return Ue.ios&&"deleteContentForward"==e.inputType&&t.observer.flushSoon(),Ue.safari&&"insertText"==e.inputType&&t.inputState.composing>=0&&setTimeout(function(){return Ks.compositionend(t,e);},20),!1;};cr=new Set();dr=["pre-wrap","normal","pre-line","break-spaces"];pr=!1;gr=/*#__PURE__*/function(){function gr(t){_classCallCheck(this,gr);this.lineWrapping=t,this.doc=a.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30;}return _createClass(gr,[{key:"heightForGap",value:function heightForGap(t,e){var i=this.doc.lineAt(e).number-this.doc.lineAt(t).number+1;return this.lineWrapping&&(i+=Math.max(0,Math.ceil((e-t-i*this.lineLength*.5)/this.lineLength))),this.lineHeight*i;}},{key:"heightForLine",value:function heightForLine(t){if(!this.lineWrapping)return this.lineHeight;return(1+Math.max(0,Math.ceil((t-this.lineLength)/(this.lineLength-5))))*this.lineHeight;}},{key:"setDoc",value:function setDoc(t){return this.doc=t,this;}},{key:"mustRefreshForWrapping",value:function mustRefreshForWrapping(t){return dr.indexOf(t)>-1!=this.lineWrapping;}},{key:"mustRefreshForHeights",value:function mustRefreshForHeights(t){var e=!1;for(var _i95=0;_i95<t.length;_i95++){var _s90=t[_i95];_s90<0?_i95++:this.heightSamples[Math.floor(10*_s90)]||(e=!0,this.heightSamples[Math.floor(10*_s90)]=!0);}return e;}},{key:"refresh",value:function refresh(t,e,i,s,r,n){var h=dr.indexOf(t)>-1,l=Math.round(e)!=Math.round(this.lineHeight)||this.lineWrapping!=h;if(this.lineWrapping=h,this.lineHeight=e,this.charWidth=i,this.textHeight=s,this.lineLength=r,l){this.heightSamples={};for(var _t109=0;_t109<n.length;_t109++){var _e104=n[_t109];_e104<0?_t109++:this.heightSamples[Math.floor(10*_e104)]=!0;}}return l;}}]);}();wr=/*#__PURE__*/function(){function wr(t,e){_classCallCheck(this,wr);this.from=t,this.heights=e,this.index=0;}return _createClass(wr,[{key:"more",get:function get(){return this.index<this.heights.length;}}]);}();br=/*#__PURE__*/function(){function br(t,e,i,s,r){_classCallCheck(this,br);this.from=t,this.length=e,this.top=i,this.height=s,this._content=r;}return _createClass(br,[{key:"type",get:function get(){return"number"==typeof this._content?ni.Text:Array.isArray(this._content)?this._content:this._content.type;}},{key:"to",get:function get(){return this.from+this.length;}},{key:"bottom",get:function get(){return this.top+this.height;}},{key:"widget",get:function get(){return this._content instanceof ui?this._content.widget:null;}},{key:"widgetLineBreaks",get:function get(){return"number"==typeof this._content?this._content:0;}},{key:"join",value:function join(t){var e=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(t._content)?t._content:[t]);return new br(this.from,this.length+t.length,this.top,this.height+t.height,e);}}]);}();vr=function(t){return t[t.ByPos=0]="ByPos",t[t.ByHeight=1]="ByHeight",t[t.ByPosNoHeight=2]="ByPosNoHeight",t;}(vr||(vr={}));kr=.001;yr=/*#__PURE__*/function(){function yr(t,e){var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:2;_classCallCheck(this,yr);this.length=t,this.height=e,this.flags=i;}return _createClass(yr,[{key:"outdated",get:function get(){return(2&this.flags)>0;},set:function set(t){this.flags=(t?2:0)|-3&this.flags;}},{key:"setHeight",value:function setHeight(t){this.height!=t&&(Math.abs(this.height-t)>kr&&(pr=!0),this.height=t);}},{key:"replace",value:function replace(t,e,i){return yr.of(i);}},{key:"decomposeLeft",value:function decomposeLeft(t,e){e.push(this);}},{key:"decomposeRight",value:function decomposeRight(t,e){e.push(this);}},{key:"applyChanges",value:function applyChanges(t,e,i,s){var r=this,n=i.doc;for(var _h42=s.length-1;_h42>=0;_h42--){var _s$_h=s[_h42],_l33=_s$_h.fromA,_o26=_s$_h.toA,_u21=_s$_h.fromB,_f16=_s$_h.toB,_a11=r.lineAt(_l33,vr.ByPosNoHeight,i.setDoc(e),0,0),_c11=_a11.to>=_o26?_a11:r.lineAt(_o26,vr.ByPosNoHeight,i,0,0);for(_f16+=_c11.to-_o26,_o26=_c11.to;_h42>0&&_a11.from<=s[_h42-1].toA;)_l33=s[_h42-1].fromA,_u21=s[_h42-1].fromB,_h42--,_l33<_a11.from&&(_a11=r.lineAt(_l33,vr.ByPosNoHeight,i,0,0));_u21+=_a11.from-_l33,_l33=_a11.from;var _d7=Or.build(i.setDoc(n),t,_u21,_f16);r=Mr(r,r.replace(_l33,_o26,_d7));}return r.updateHeight(i,0);}}],[{key:"empty",value:function empty(){return new Sr(0,0);}},{key:"of",value:function of(t){if(1==t.length)return t[0];var e=0,i=t.length,s=0,r=0;for(;;)if(e==i){if(s>2*r){var _r79=t[e-1];_r79["break"]?t.splice(--e,1,_r79.left,null,_r79.right):t.splice(--e,1,_r79.left,_r79.right),i+=1+_r79["break"],s-=_r79.size;}else{if(!(r>2*s))break;{var _e105=t[i];_e105["break"]?t.splice(i,1,_e105.left,null,_e105.right):t.splice(i,1,_e105.left,_e105.right),i+=2+_e105["break"],r-=_e105.size;}}}else if(s<r){var _i96=t[e++];_i96&&(s+=_i96.size);}else{var _e106=t[--i];_e106&&(r+=_e106.size);}var n=0;return null==t[e-1]?(n=1,e--):null==t[e]&&(n=1,i++),new Cr(yr.of(t.slice(0,e)),n,yr.of(t.slice(i)));}}]);}();yr.prototype.size=1;xr=/*#__PURE__*/function(_yr){function xr(t,e,i){var _this29;_classCallCheck(this,xr);_this29=_callSuper(this,xr,[t,e]),_this29.deco=i;return _this29;}_inherits(xr,_yr);return _createClass(xr,[{key:"blockAt",value:function blockAt(t,e,i,s){return new br(s,this.length,i,this.height,this.deco||0);}},{key:"lineAt",value:function lineAt(t,e,i,s,r){return this.blockAt(0,i,s,r);}},{key:"forEachLine",value:function forEachLine(t,e,i,s,r,n){t<=r+this.length&&e>=r&&n(this.blockAt(0,i,s,r));}},{key:"updateHeight",value:function updateHeight(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!1;var s=arguments.length>3?arguments[3]:undefined;return s&&s.from<=e&&s.more&&this.setHeight(s.heights[s.index++]),this.outdated=!1,this;}},{key:"toString",value:function toString(){return"block(".concat(this.length,")");}}]);}(yr);Sr=/*#__PURE__*/function(_xr){function Sr(t,e){var _this30;_classCallCheck(this,Sr);_this30=_callSuper(this,Sr,[t,e,null]),_this30.collapsed=0,_this30.widgetHeight=0,_this30.breaks=0;return _this30;}_inherits(Sr,_xr);return _createClass(Sr,[{key:"blockAt",value:function blockAt(t,e,i,s){return new br(s,this.length,i,this.height,this.breaks);}},{key:"replace",value:function replace(t,e,i){var s=i[0];return 1==i.length&&(s instanceof Sr||s instanceof Ar&&4&s.flags)&&Math.abs(this.length-s.length)<10?(s instanceof Ar?s=new Sr(s.length,this.height):s.height=this.height,this.outdated||(s.outdated=!1),s):yr.of(i);}},{key:"updateHeight",value:function updateHeight(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!1;var s=arguments.length>3?arguments[3]:undefined;return s&&s.from<=e&&s.more?this.setHeight(s.heights[s.index++]):(i||this.outdated)&&this.setHeight(Math.max(this.widgetHeight,t.heightForLine(this.length-this.collapsed))+this.breaks*t.lineHeight),this.outdated=!1,this;}},{key:"toString",value:function toString(){return"line(".concat(this.length).concat(this.collapsed?-this.collapsed:"").concat(this.widgetHeight?":"+this.widgetHeight:"",")");}}]);}(xr);Ar=/*#__PURE__*/function(_yr2){function Ar(t){_classCallCheck(this,Ar);return _callSuper(this,Ar,[t,0]);}_inherits(Ar,_yr2);return _createClass(Ar,[{key:"heightMetrics",value:function heightMetrics(t,e){var i,s=t.doc.lineAt(e).number,r=t.doc.lineAt(e+this.length).number,n=r-s+1,h=0;if(t.lineWrapping){var _e107=Math.min(this.height,t.lineHeight*n);i=_e107/n,this.length>n+1&&(h=(this.height-_e107)/(this.length-n-1));}else i=this.height/n;return{firstLine:s,lastLine:r,perLine:i,perChar:h};}},{key:"blockAt",value:function blockAt(t,e,i,s){var _this$heightMetrics=this.heightMetrics(e,s),r=_this$heightMetrics.firstLine,n=_this$heightMetrics.lastLine,h=_this$heightMetrics.perLine,l=_this$heightMetrics.perChar;if(e.lineWrapping){var _r80=s+(t<e.lineHeight?0:Math.round(Math.max(0,Math.min(1,(t-i)/this.height))*this.length)),_n63=e.doc.lineAt(_r80),_o27=h+_n63.length*l,_u22=Math.max(i,t-_o27/2);return new br(_n63.from,_n63.length,_u22,_o27,0);}{var _s91=Math.max(0,Math.min(n-r,Math.floor((t-i)/h))),_e$doc$line=e.doc.line(r+_s91),_l34=_e$doc$line.from,_o28=_e$doc$line.length;return new br(_l34,_o28,i+h*_s91,h,0);}}},{key:"lineAt",value:function lineAt(t,e,i,s,r){if(e==vr.ByHeight)return this.blockAt(t,i,s,r);if(e==vr.ByPosNoHeight){var _i$doc$lineAt=i.doc.lineAt(t),_e108=_i$doc$lineAt.from,_s92=_i$doc$lineAt.to;return new br(_e108,_s92-_e108,0,0,0);}var _this$heightMetrics2=this.heightMetrics(i,r),n=_this$heightMetrics2.firstLine,h=_this$heightMetrics2.perLine,l=_this$heightMetrics2.perChar,o=i.doc.lineAt(t),u=h+o.length*l,f=o.number-n,a=s+h*f+l*(o.from-r-f);return new br(o.from,o.length,Math.max(s,Math.min(a,s+this.height-u)),u,0);}},{key:"forEachLine",value:function forEachLine(t,e,i,s,r,n){t=Math.max(t,r),e=Math.min(e,r+this.length);var _this$heightMetrics3=this.heightMetrics(i,r),h=_this$heightMetrics3.firstLine,l=_this$heightMetrics3.perLine,o=_this$heightMetrics3.perChar;for(var _u23=t,_f17=s;_u23<=e;){var _e109=i.doc.lineAt(_u23);if(_u23==t){var _i97=_e109.number-h;_f17+=l*_i97+o*(t-r-_i97);}var _s93=l+o*_e109.length;n(new br(_e109.from,_e109.length,_f17,_s93,0)),_f17+=_s93,_u23=_e109.to+1;}}},{key:"replace",value:function replace(t,e,i){var s=this.length-e;if(s>0){var _t110=i[i.length-1];_t110 instanceof Ar?i[i.length-1]=new Ar(_t110.length+s):i.push(null,new Ar(s-1));}if(t>0){var _e110=i[0];_e110 instanceof Ar?i[0]=new Ar(t+_e110.length):i.unshift(new Ar(t-1),null);}return yr.of(i);}},{key:"decomposeLeft",value:function decomposeLeft(t,e){e.push(new Ar(t-1),null);}},{key:"decomposeRight",value:function decomposeRight(t,e){e.push(null,new Ar(this.length-t-1));}},{key:"updateHeight",value:function updateHeight(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!1;var s=arguments.length>3?arguments[3]:undefined;var r=e+this.length;if(s&&s.from<=e+this.length&&s.more){var _i98=[],_n64=Math.max(e,s.from),_h43=-1;for(s.from>e&&_i98.push(new Ar(s.from-e-1).updateHeight(t,e));_n64<=r&&s.more;){var _e111=t.doc.lineAt(_n64).length;_i98.length&&_i98.push(null);var _r81=s.heights[s.index++];-1==_h43?_h43=_r81:Math.abs(_r81-_h43)>=kr&&(_h43=-2);var _l35=new Sr(_e111,_r81);_l35.outdated=!1,_i98.push(_l35),_n64+=_e111+1;}_n64<=r&&_i98.push(null,new Ar(r-_n64).updateHeight(t,_n64));var _l36=yr.of(_i98);return(_h43<0||Math.abs(_l36.height-this.height)>=kr||Math.abs(_h43-this.heightMetrics(t,e).perLine)>=kr)&&(pr=!0),Mr(this,_l36);}return(i||this.outdated)&&(this.setHeight(t.heightForGap(e,e+this.length)),this.outdated=!1),this;}},{key:"toString",value:function toString(){return"gap(".concat(this.length,")");}}]);}(yr);Cr=/*#__PURE__*/function(_yr3){function Cr(t,e,i){var _this31;_classCallCheck(this,Cr);_this31=_callSuper(this,Cr,[t.length+e+i.length,t.height+i.height,e|(t.outdated||i.outdated?2:0)]),_this31.left=t,_this31.right=i,_this31.size=t.size+i.size;return _this31;}_inherits(Cr,_yr3);return _createClass(Cr,[{key:"break",get:function get(){return 1&this.flags;}},{key:"blockAt",value:function blockAt(t,e,i,s){var r=i+this.left.height;return t<r?this.left.blockAt(t,e,i,s):this.right.blockAt(t,e,r,s+this.left.length+this["break"]);}},{key:"lineAt",value:function lineAt(t,e,i,s,r){var n=s+this.left.height,h=r+this.left.length+this["break"],l=e==vr.ByHeight?t<n:t<h,o=l?this.left.lineAt(t,e,i,s,r):this.right.lineAt(t,e,i,n,h);if(this["break"]||(l?o.to<h:o.from>h))return o;var u=e==vr.ByPosNoHeight?vr.ByPosNoHeight:vr.ByPos;return l?o.join(this.right.lineAt(h,u,i,n,h)):this.left.lineAt(h,u,i,s,r).join(o);}},{key:"forEachLine",value:function forEachLine(t,e,i,s,r,n){var h=s+this.left.height,l=r+this.left.length+this["break"];if(this["break"])t<l&&this.left.forEachLine(t,e,i,s,r,n),e>=l&&this.right.forEachLine(t,e,i,h,l,n);else{var _o29=this.lineAt(l,vr.ByPos,i,s,r);t<_o29.from&&this.left.forEachLine(t,_o29.from-1,i,s,r,n),_o29.to>=t&&_o29.from<=e&&n(_o29),e>_o29.to&&this.right.forEachLine(_o29.to+1,e,i,h,l,n);}}},{key:"replace",value:function replace(t,e,i){var s=this.left.length+this["break"];if(e<s)return this.balanced(this.left.replace(t,e,i),this.right);if(t>this.left.length)return this.balanced(this.left,this.right.replace(t-s,e-s,i));var r=[];t>0&&this.decomposeLeft(t,r);var n=r.length;var _iterator64=_createForOfIteratorHelper(i),_step64;try{for(_iterator64.s();!(_step64=_iterator64.n()).done;){var _t112=_step64.value;r.push(_t112);}}catch(err){_iterator64.e(err);}finally{_iterator64.f();}if(t>0&&Dr(r,n-1),e<this.length){var _t111=r.length;this.decomposeRight(e,r),Dr(r,_t111);}return yr.of(r);}},{key:"decomposeLeft",value:function decomposeLeft(t,e){var i=this.left.length;if(t<=i)return this.left.decomposeLeft(t,e);e.push(this.left),this["break"]&&(i++,t>=i&&e.push(null)),t>i&&this.right.decomposeLeft(t-i,e);}},{key:"decomposeRight",value:function decomposeRight(t,e){var i=this.left.length,s=i+this["break"];if(t>=s)return this.right.decomposeRight(t-s,e);t<i&&this.left.decomposeRight(t,e),this["break"]&&t<s&&e.push(null),e.push(this.right);}},{key:"balanced",value:function balanced(t,e){return t.size>2*e.size||e.size>2*t.size?yr.of(this["break"]?[t,null,e]:[t,e]):(this.left=Mr(this.left,t),this.right=Mr(this.right,e),this.setHeight(t.height+e.height),this.outdated=t.outdated||e.outdated,this.size=t.size+e.size,this.length=t.length+this["break"]+e.length,this);}},{key:"updateHeight",value:function updateHeight(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!1;var s=arguments.length>3?arguments[3]:undefined;var r=this.left,n=this.right,h=e+r.length+this["break"],l=null;return s&&s.from<=e+r.length&&s.more?l=r=r.updateHeight(t,e,i,s):r.updateHeight(t,e,i),s&&s.from<=h+n.length&&s.more?l=n=n.updateHeight(t,h,i,s):n.updateHeight(t,h,i),l?this.balanced(r,n):(this.height=this.left.height+this.right.height,this.outdated=!1,this);}},{key:"toString",value:function toString(){return this.left+(this["break"]?" ":"-")+this.right;}}]);}(yr);Or=/*#__PURE__*/function(){function Or(t,e){_classCallCheck(this,Or);this.pos=t,this.oracle=e,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=t;}return _createClass(Or,[{key:"isCovered",get:function get(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering;}},{key:"span",value:function span(t,e){if(this.lineStart>-1){var _t113=Math.min(e,this.lineEnd),_i99=this.nodes[this.nodes.length-1];_i99 instanceof Sr?_i99.length+=_t113-this.pos:(_t113>this.pos||!this.isCovered)&&this.nodes.push(new Sr(_t113-this.pos,-1)),this.writtenTo=_t113,e>_t113&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1);}this.pos=e;}},{key:"point",value:function point(t,e,i){if(t<e||i.heightRelevant){var _s94=i.widget?i.widget.estimatedHeight:0,_r82=i.widget?i.widget.lineBreaks:0;_s94<0&&(_s94=this.oracle.lineHeight);var _n65=e-t;i.block?this.addBlock(new xr(_n65,_s94,i)):(_n65||_r82||_s94>=5)&&this.addLineDeco(_s94,_r82,_n65);}else e>t&&this.span(t,e);this.lineEnd>-1&&this.lineEnd<this.pos&&(this.lineEnd=this.oracle.doc.lineAt(this.pos).to);}},{key:"enterLine",value:function enterLine(){if(this.lineStart>-1)return;var _this$oracle$doc$line=this.oracle.doc.lineAt(this.pos),t=_this$oracle$doc$line.from,e=_this$oracle$doc$line.to;this.lineStart=t,this.lineEnd=e,this.writtenTo<t&&((this.writtenTo<t-1||null==this.nodes[this.nodes.length-1])&&this.nodes.push(this.blankContent(this.writtenTo,t-1)),this.nodes.push(null)),this.pos>t&&this.nodes.push(new Sr(this.pos-t,-1)),this.writtenTo=this.pos;}},{key:"blankContent",value:function blankContent(t,e){var i=new Ar(e-t);return this.oracle.doc.lineAt(t).to==e&&(i.flags|=4),i;}},{key:"ensureLine",value:function ensureLine(){this.enterLine();var t=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(t instanceof Sr)return t;var e=new Sr(0,-1);return this.nodes.push(e),e;}},{key:"addBlock",value:function addBlock(t){this.enterLine();var e=t.deco;e&&e.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(t),this.writtenTo=this.pos=this.pos+t.length,e&&e.endSide>0&&(this.covering=t);}},{key:"addLineDeco",value:function addLineDeco(t,e,i){var s=this.ensureLine();s.length+=i,s.collapsed+=i,s.widgetHeight=Math.max(s.widgetHeight,t),s.breaks+=e,this.writtenTo=this.pos=this.pos+i;}},{key:"finish",value:function finish(t){var e=0==this.nodes.length?null:this.nodes[this.nodes.length-1];!(this.lineStart>-1)||e instanceof Sr||this.isCovered?(this.writtenTo<this.pos||null==e)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos)):this.nodes.push(new Sr(0,-1));var i=t;var _iterator65=_createForOfIteratorHelper(this.nodes),_step65;try{for(_iterator65.s();!(_step65=_iterator65.n()).done;){var _t114=_step65.value;_t114 instanceof Sr&&_t114.updateHeight(this.oracle,i),i+=_t114?_t114.length:1;}}catch(err){_iterator65.e(err);}finally{_iterator65.f();}return this.nodes;}}],[{key:"build",value:function build(t,e,i,s){var r=new Or(i,t);return Bt.spans(e,i,s,r,0),r.finish(i);}}]);}();Er=/*#__PURE__*/function(){function Er(){_classCallCheck(this,Er);this.changes=[];}return _createClass(Er,[{key:"compareRange",value:function compareRange(){}},{key:"comparePoint",value:function comparePoint(t,e,i,s){(t<e||i&&i.heightRelevant||s&&s.heightRelevant)&&ai(t,e,this.changes,5);}}]);}();Tr=/*#__PURE__*/function(){function Tr(t,e,i,s){_classCallCheck(this,Tr);this.from=t,this.to=e,this.size=i,this.displaySize=s;}return _createClass(Tr,[{key:"draw",value:function draw(t,e){return hi.replace({widget:new Br(this.displaySize*(e?t.scaleY:t.scaleX),e)}).range(this.from,this.to);}}],[{key:"same",value:function same(t,e){if(t.length!=e.length)return!1;for(var _i101=0;_i101<t.length;_i101++){var _s97=t[_i101],_r83=e[_i101];if(_s97.from!=_r83.from||_s97.to!=_r83.to||_s97.size!=_r83.size)return!1;}return!0;}}]);}();Br=/*#__PURE__*/function(_ri3){function Br(t,e){var _this32;_classCallCheck(this,Br);_this32=_callSuper(this,Br),_this32.size=t,_this32.vertical=e;return _this32;}_inherits(Br,_ri3);return _createClass(Br,[{key:"eq",value:function eq(t){return t.size==this.size&&t.vertical==this.vertical;}},{key:"toDOM",value:function toDOM(){var t=document.createElement("div");return this.vertical?t.style.height=this.size+"px":(t.style.width=this.size+"px",t.style.height="2px",t.style.display="inline-block"),t;}},{key:"estimatedHeight",get:function get(){return this.vertical?this.size:-1;}}]);}(ri);Lr=/*#__PURE__*/function(){function Lr(t){var _this33=this;_classCallCheck(this,Lr);this.state=t,this.pixelViewport={left:0,right:window.innerWidth,top:0,bottom:0},this.inView=!0,this.paddingTop=0,this.paddingBottom=0,this.contentDOMWidth=0,this.contentDOMHeight=0,this.editorHeight=0,this.editorWidth=0,this.scrollTop=0,this.scrolledToBottom=!1,this.scaleX=1,this.scaleY=1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=Pr,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=bi.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;var e=t.facet(ns).some(function(t){return"function"!=typeof t&&"cm-lineWrapping"==t["class"];});this.heightOracle=new gr(e),this.stateDeco=t.facet(hs).filter(function(t){return"function"!=typeof t;}),this.heightMap=yr.empty().applyChanges(this.stateDeco,a.empty,this.heightOracle.setDoc(t.doc),[new ps(0,0,0,t.doc.length)]);for(var _t115=0;_t115<2&&(this.viewport=this.getViewport(0,null),this.updateForViewport());_t115++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=hi.set(this.lineGaps.map(function(t){return t.draw(_this33,!1);})),this.computeVisibleRanges();}return _createClass(Lr,[{key:"updateForViewport",value:function updateForViewport(){var _this34=this;var t=[this.viewport],e=this.state.selection.main;var _loop7=function _loop7(){var s=_i102?e.head:e.anchor;if(!t.some(function(_ref8){var t=_ref8.from,e=_ref8.to;return s>=t&&s<=e;})){var _this34$lineBlockAt=_this34.lineBlockAt(s),_e113=_this34$lineBlockAt.from,_i103=_this34$lineBlockAt.to;t.push(new Nr(_e113,_i103));}};for(var _i102=0;_i102<=1;_i102++){_loop7();}return this.viewports=t.sort(function(t,e){return t.from-e.from;}),this.updateScaler();}},{key:"updateScaler",value:function updateScaler(){var t=this.scaler;return this.scaler=this.heightMap.height<=7e6?Pr:new zr(this.heightOracle,this.heightMap,this.viewports),t.eq(this.scaler)?0:2;}},{key:"updateViewportLines",value:function updateViewportLines(){var _this35=this;this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,function(t){_this35.viewportLines.push(Hr(t,_this35.scaler));});}},{key:"update",value:function update(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:null;this.state=t.state;var i=this.stateDeco;this.stateDeco=this.state.facet(hs).filter(function(t){return"function"!=typeof t;});var s=t.changedRanges,r=ps.extendWithRanges(s,function(t,e,i){var s=new Er();return Bt.compare(t,e,i,s,0),s.changes;}(i,this.stateDeco,t?t.changes:O.empty(this.state.doc.length))),n=this.heightMap.height,h=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);mr(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,t.startState.doc,this.heightOracle.setDoc(this.state.doc),r),(this.heightMap.height!=n||pr)&&(t.flags|=2),h?(this.scrollAnchorPos=t.changes.mapPos(h.from,-1),this.scrollAnchorHeight=h.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=this.heightMap.height);var l=r.length?this.mapViewport(this.viewport,t.changes):this.viewport;(e&&(e.range.head<l.from||e.range.head>l.to)||!this.viewportIsAppropriate(l))&&(l=this.getViewport(0,e));var o=l.from!=this.viewport.from||l.to!=this.viewport.to;this.viewport=l,t.flags|=this.updateForViewport(),(o||!t.changes.empty||2&t.flags)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,t.changes))),t.flags|=this.computeVisibleRanges(t.changes),e&&(this.scrollTarget=e),!this.mustEnforceCursorAssoc&&t.selectionSet&&t.view.lineWrapping&&t.state.selection.main.empty&&t.state.selection.main.assoc&&!t.state.facet(Gi)&&(this.mustEnforceCursorAssoc=!0);}},{key:"measure",value:function measure(t){var e=t.contentDOM,i=window.getComputedStyle(e),s=this.heightOracle,r=i.whiteSpace;this.defaultTextDirection="rtl"==i.direction?bi.RTL:bi.LTR;var n=this.heightOracle.mustRefreshForWrapping(r),h=e.getBoundingClientRect(),l=n||this.mustMeasureContent||this.contentDOMHeight!=h.height;this.contentDOMHeight=h.height,this.mustMeasureContent=!1;var o=0,u=0;if(h.width&&h.height){var _ge2=ge(e,h),_t116=_ge2.scaleX,_i104=_ge2.scaleY;(_t116>.005&&Math.abs(this.scaleX-_t116)>.005||_i104>.005&&Math.abs(this.scaleY-_i104)>.005)&&(this.scaleX=_t116,this.scaleY=_i104,o|=16,n=l=!0);}var f=(parseInt(i.paddingTop)||0)*this.scaleY,c=(parseInt(i.paddingBottom)||0)*this.scaleY;this.paddingTop==f&&this.paddingBottom==c||(this.paddingTop=f,this.paddingBottom=c,o|=18),this.editorWidth!=t.scrollDOM.clientWidth&&(s.lineWrapping&&(l=!0),this.editorWidth=t.scrollDOM.clientWidth,o|=16);var d=t.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=d&&(this.scrollAnchorHeight=-1,this.scrollTop=d),this.scrolledToBottom=Se(t.scrollDOM);var p=(this.printing?Rr:Ir)(e,this.paddingTop),m=p.top-this.pixelViewport.top,g=p.bottom-this.pixelViewport.bottom;this.pixelViewport=p;var w=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(w!=this.inView&&(this.inView=w,w&&(l=!0)),!this.inView&&!this.scrollTarget&&!function(t){var e=t.getBoundingClientRect(),i=t.ownerDocument.defaultView||window;return e.left<i.innerWidth&&e.right>0&&e.top<i.innerHeight&&e.bottom>0;}(t.dom))return 0;var b=h.width;if(this.contentDOMWidth==b&&this.editorHeight==t.scrollDOM.clientHeight||(this.contentDOMWidth=h.width,this.editorHeight=t.scrollDOM.clientHeight,o|=16),l){var _e114=t.docView.measureVisibleLineHeights(this.viewport);if(s.mustRefreshForHeights(_e114)&&(n=!0),n||s.lineWrapping&&Math.abs(b-this.contentDOMWidth)>s.charWidth){var _t$docView$measureTex=t.docView.measureTextSize(),_i105=_t$docView$measureTex.lineHeight,_h44=_t$docView$measureTex.charWidth,_l37=_t$docView$measureTex.textHeight;n=_i105>0&&s.refresh(r,_i105,_h44,_l37,b/_h44,_e114),n&&(t.docView.minWidth=0,o|=16);}m>0&&g>0?u=Math.max(m,g):m<0&&g<0&&(u=Math.min(m,g)),mr();var _iterator66=_createForOfIteratorHelper(this.viewports),_step66;try{for(_iterator66.s();!(_step66=_iterator66.n()).done;){var _i106=_step66.value;var _r84=_i106.from==this.viewport.from?_e114:t.docView.measureVisibleLineHeights(_i106);this.heightMap=(n?yr.empty().applyChanges(this.stateDeco,a.empty,this.heightOracle,[new ps(0,0,0,t.state.doc.length)]):this.heightMap).updateHeight(s,0,n,new wr(_i106.from,_r84));}}catch(err){_iterator66.e(err);}finally{_iterator66.f();}pr&&(o|=2);}var v=!this.viewportIsAppropriate(this.viewport,u)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return v&&(2&o&&(o|=this.updateScaler()),this.viewport=this.getViewport(u,this.scrollTarget),o|=this.updateForViewport()),(2&o||v)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(n?[]:this.lineGaps,t)),o|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,t.docView.enforceCursorAssoc()),o;}},{key:"visibleTop",get:function get(){return this.scaler.fromDOM(this.pixelViewport.top);}},{key:"visibleBottom",get:function get(){return this.scaler.fromDOM(this.pixelViewport.bottom);}},{key:"getViewport",value:function getViewport(t,e){var i=.5-Math.max(-.5,Math.min(.5,t/1e3/2)),s=this.heightMap,r=this.heightOracle,n=this.visibleTop,h=this.visibleBottom,l=new Nr(s.lineAt(n-1e3*i,vr.ByHeight,r,0,0).from,s.lineAt(h+1e3*(1-i),vr.ByHeight,r,0,0).to);if(e){var _t117=e.range.head;if(_t117<l.from||_t117>l.to){var _i107,_n66=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),_h45=s.lineAt(_t117,vr.ByPos,r,0,0);_i107="center"==e.y?(_h45.top+_h45.bottom)/2-_n66/2:"start"==e.y||"nearest"==e.y&&_t117<l.from?_h45.top:_h45.bottom-_n66,l=new Nr(s.lineAt(_i107-500,vr.ByHeight,r,0,0).from,s.lineAt(_i107+_n66+500,vr.ByHeight,r,0,0).to);}}return l;}},{key:"mapViewport",value:function mapViewport(t,e){var i=e.mapPos(t.from,-1),s=e.mapPos(t.to,1);return new Nr(this.heightMap.lineAt(i,vr.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(s,vr.ByPos,this.heightOracle,0,0).to);}},{key:"viewportIsAppropriate",value:function viewportIsAppropriate(_ref9){var t=_ref9.from,e=_ref9.to;var i=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;if(!this.inView)return!0;var _this$heightMap$lineA=this.heightMap.lineAt(t,vr.ByPos,this.heightOracle,0,0),s=_this$heightMap$lineA.top,_this$heightMap$lineA2=this.heightMap.lineAt(e,vr.ByPos,this.heightOracle,0,0),r=_this$heightMap$lineA2.bottom,n=this.visibleTop,h=this.visibleBottom;return(0==t||s<=n-Math.max(10,Math.min(-i,250)))&&(e==this.state.doc.length||r>=h+Math.max(10,Math.min(i,250)))&&s>n-2e3&&r<h+2e3;}},{key:"mapLineGaps",value:function mapLineGaps(t,e){if(!t.length||e.empty)return t;var i=[];var _iterator67=_createForOfIteratorHelper(t),_step67;try{for(_iterator67.s();!(_step67=_iterator67.n()).done;){var _s98=_step67.value;e.touchesRange(_s98.from,_s98.to)||i.push(new Tr(e.mapPos(_s98.from),e.mapPos(_s98.to),_s98.size,_s98.displaySize));}}catch(err){_iterator67.e(err);}finally{_iterator67.f();}return i;}},{key:"ensureLineGaps",value:function ensureLineGaps(t,e){var _this36=this;var i=this.heightOracle.lineWrapping,s=i?1e4:2e3,r=s>>1,n=s<<1;if(this.defaultTextDirection!=bi.LTR&&!i)return[];var h=[],_l38=function l(s,n,o,u){if(n-s<r)return;var f=_this36.state.selection.main,a=[f.from];f.empty||a.push(f.to);for(var _i108=0,_a12=a;_i108<_a12.length;_i108++){var _t118=_a12[_i108];if(_t118>s&&_t118<n)return _l38(s,_t118-10,o,u),void _l38(_t118+10,n,o,u);}var c=function(t,e){var _iterator68=_createForOfIteratorHelper(t),_step68;try{for(_iterator68.s();!(_step68=_iterator68.n()).done;){var _i109=_step68.value;if(e(_i109))return _i109;}}catch(err){_iterator68.e(err);}finally{_iterator68.f();}return;}(t,function(t){return t.from>=o.from&&t.to<=o.to&&Math.abs(t.from-s)<r&&Math.abs(t.to-n)<r&&!a.some(function(e){return t.from<e&&t.to>e;});});if(!c){if(n<o.to&&e&&i&&e.visibleRanges.some(function(t){return t.from<=n&&t.to>=n;})){var _t119=e.moveToLineBoundary($.cursor(n),!1,!0).head;_t119>s&&(n=_t119);}var _t120=_this36.gapSize(o,s,n,u);c=new Tr(s,n,_t120,i||_t120<2e6?_t120:2e6);}h.push(c);},o=function o(e){if(e.length<n||e.type!=ni.Text)return;var r=function(t,e,i){var s=[],r=t,n=0;Bt.spans(i,t,e,{span:function span(){},point:function point(t,e){t>r&&(s.push({from:r,to:t}),n+=t-r),r=e;}},20),r<e&&(s.push({from:r,to:e}),n+=e-r);return{total:n,ranges:s};}(e.from,e.to,_this36.stateDeco);if(r.total<n)return;var h,o,u=_this36.scrollTarget?_this36.scrollTarget.range.head:null;if(i){var _t121,_i110,_n67=s/_this36.heightOracle.lineLength*_this36.heightOracle.lineHeight;if(null!=u){var _s99=jr(r,u),_h46=((_this36.visibleBottom-_this36.visibleTop)/2+_n67)/e.height;_t121=_s99-_h46,_i110=_s99+_h46;}else _t121=(_this36.visibleTop-e.top-_n67)/e.height,_i110=(_this36.visibleBottom-e.top+_n67)/e.height;h=$r(r,_t121),o=$r(r,_i110);}else{var _i111=r.total*_this36.heightOracle.charWidth,_n68=s*_this36.heightOracle.charWidth,_l39=0;if(_i111>2e6){var _iterator69=_createForOfIteratorHelper(t),_step69;try{for(_iterator69.s();!(_step69=_iterator69.n()).done;){var _i112=_step69.value;_i112.from>=e.from&&_i112.from<e.to&&_i112.size!=_i112.displaySize&&_i112.from*_this36.heightOracle.charWidth+_l39<_this36.pixelViewport.left&&(_l39=_i112.size-_i112.displaySize);}}catch(err){_iterator69.e(err);}finally{_iterator69.f();}}var _f18,_a13,_c12=_this36.pixelViewport.left+_l39,_d8=_this36.pixelViewport.right+_l39;if(null!=u){var _t122=jr(r,u),_e115=((_d8-_c12)/2+_n68)/_i111;_f18=_t122-_e115,_a13=_t122+_e115;}else _f18=(_c12-_n68)/_i111,_a13=(_d8+_n68)/_i111;h=$r(r,_f18),o=$r(r,_a13);}h>e.from&&_l38(e.from,h,e,r),o<e.to&&_l38(o,e.to,e,r);};var _iterator70=_createForOfIteratorHelper(this.viewportLines),_step70;try{for(_iterator70.s();!(_step70=_iterator70.n()).done;){var _t123=_step70.value;Array.isArray(_t123.type)?_t123.type.forEach(o):o(_t123);}}catch(err){_iterator70.e(err);}finally{_iterator70.f();}return h;}},{key:"gapSize",value:function gapSize(t,e,i,s){var r=jr(s,i)-jr(s,e);return this.heightOracle.lineWrapping?t.height*r:s.total*this.heightOracle.charWidth*r;}},{key:"updateLineGaps",value:function updateLineGaps(t){var _this37=this;Tr.same(t,this.lineGaps)||(this.lineGaps=t,this.lineGapDeco=hi.set(t.map(function(t){return t.draw(_this37,_this37.heightOracle.lineWrapping);})));}},{key:"computeVisibleRanges",value:function computeVisibleRanges(t){var e=this.stateDeco;this.lineGaps.length&&(e=e.concat(this.lineGapDeco));var i=[];Bt.spans(e,this.viewport.from,this.viewport.to,{span:function span(t,e){i.push({from:t,to:e});},point:function point(){}},20);var s=0;if(i.length!=this.visibleRanges.length)s=12;else for(var _e116=0;_e116<i.length&&!(8&s);_e116++){var _r85=this.visibleRanges[_e116],_n69=i[_e116];_r85.from==_n69.from&&_r85.to==_n69.to||(s|=4,t&&t.mapPos(_r85.from,-1)==_n69.from&&t.mapPos(_r85.to,1)==_n69.to||(s|=8));}return this.visibleRanges=i,s;}},{key:"lineBlockAt",value:function lineBlockAt(t){return t>=this.viewport.from&&t<=this.viewport.to&&this.viewportLines.find(function(e){return e.from<=t&&e.to>=t;})||Hr(this.heightMap.lineAt(t,vr.ByPos,this.heightOracle,0,0),this.scaler);}},{key:"lineBlockAtHeight",value:function lineBlockAtHeight(t){return t>=this.viewportLines[0].top&&t<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(function(e){return e.top<=t&&e.bottom>=t;})||Hr(this.heightMap.lineAt(this.scaler.fromDOM(t),vr.ByHeight,this.heightOracle,0,0),this.scaler);}},{key:"scrollAnchorAt",value:function scrollAnchorAt(t){var e=this.lineBlockAtHeight(t+8);return e.from>=this.viewport.from||this.viewportLines[0].top-t>200?e:this.viewportLines[0];}},{key:"elementAtHeight",value:function elementAtHeight(t){return Hr(this.heightMap.blockAt(this.scaler.fromDOM(t),this.heightOracle,0,0),this.scaler);}},{key:"docHeight",get:function get(){return this.scaler.toDOM(this.heightMap.height);}},{key:"contentHeight",get:function get(){return this.docHeight+this.paddingTop+this.paddingBottom;}}]);}();Nr=/*#__PURE__*/_createClass(function Nr(t,e){_classCallCheck(this,Nr);this.from=t,this.to=e;});Pr={toDOM:function toDOM(t){return t;},fromDOM:function fromDOM(t){return t;},scale:1,eq:function eq(t){return t==this;}};zr=/*#__PURE__*/function(){function zr(t,e,i){_classCallCheck(this,zr);var s=0,r=0,n=0;this.viewports=i.map(function(_ref11){var i=_ref11.from,r=_ref11.to;var n=e.lineAt(i,vr.ByPos,t,0,0).top,h=e.lineAt(r,vr.ByPos,t,0,0).bottom;return s+=h-n,{from:i,to:r,top:n,bottom:h,domTop:0,domBottom:0};}),this.scale=(7e6-s)/(e.height-s);var _iterator72=_createForOfIteratorHelper(this.viewports),_step72;try{for(_iterator72.s();!(_step72=_iterator72.n()).done;){var _t125=_step72.value;_t125.domTop=n+(_t125.top-r)*this.scale,n=_t125.domBottom=_t125.domTop+(_t125.bottom-_t125.top),r=_t125.bottom;}}catch(err){_iterator72.e(err);}finally{_iterator72.f();}}return _createClass(zr,[{key:"toDOM",value:function toDOM(t){for(var _e117=0,_i114=0,_s101=0;;_e117++){var _r88=_e117<this.viewports.length?this.viewports[_e117]:null;if(!_r88||t<_r88.top)return _s101+(t-_i114)*this.scale;if(t<=_r88.bottom)return _r88.domTop+(t-_r88.top);_i114=_r88.bottom,_s101=_r88.domBottom;}}},{key:"fromDOM",value:function fromDOM(t){for(var _e118=0,_i115=0,_s102=0;;_e118++){var _r89=_e118<this.viewports.length?this.viewports[_e118]:null;if(!_r89||t<_r89.domTop)return _i115+(t-_s102)/this.scale;if(t<=_r89.domBottom)return _r89.top+(t-_r89.domTop);_i115=_r89.bottom,_s102=_r89.domBottom;}}},{key:"eq",value:function eq(t){return t instanceof zr&&this.scale==t.scale&&this.viewports.length==t.viewports.length&&this.viewports.every(function(e,i){return e.from==t.viewports[i].from&&e.to==t.viewports[i].to;});}}]);}();Fr=z.define({combine:function combine(t){return t.join(" ");}}),Wr=z.define({combine:function combine(t){return t.indexOf(!0)>-1;}}),Vr=Xt.newName(),qr=Xt.newName(),Ur=Xt.newName(),Jr={"&light":"."+qr,"&dark":"."+Ur};Kr=Gr("."+Vr,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",insetInlineStart:0,zIndex:200},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",borderRight:"1px solid #ddd"},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:'url(\'data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="20"><path stroke="%23888" stroke-width="1" fill="none" d="M1 10H196L190 5M190 15L196 10M197 4L197 16"/></svg>\')',backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},Jr),_r={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},Xr=Ue.ie&&Ue.ie_version<=11;Yr=/*#__PURE__*/function(){function Yr(t){var _this38=this;_classCallCheck(this,Yr);this.view=t,this.active=!1,this.editContext=null,this.selectionRange=new we(),this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=t.contentDOM,this.observer=new MutationObserver(function(e){var _iterator73=_createForOfIteratorHelper(e),_step73;try{for(_iterator73.s();!(_step73=_iterator73.n()).done;){var _t126=_step73.value;_this38.queue.push(_t126);}}catch(err){_iterator73.e(err);}finally{_iterator73.f();}(Ue.ie&&Ue.ie_version<=11||Ue.ios&&t.composing)&&e.some(function(t){return"childList"==t.type&&t.removedNodes.length||"characterData"==t.type&&t.oldValue.length>t.target.nodeValue.length;})?_this38.flushSoon():_this38.flush();}),!window.EditContext||!1===t.constructor.EDIT_CONTEXT||Ue.chrome&&Ue.chrome_version<126||(this.editContext=new tn(t),t.state.facet(Zi)&&(t.contentDOM.editContext=this.editContext.editContext)),Xr&&(this.onCharData=function(t){_this38.queue.push({target:t.target,type:"characterData",oldValue:t.prevValue}),_this38.flushSoon();}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),"function"==typeof ResizeObserver&&(this.resizeScroll=new ResizeObserver(function(){var t;(null===(t=_this38.view.docView)||void 0===t?void 0:t.lastUpdate)<Date.now()-75&&_this38.onResize();}),this.resizeScroll.observe(t.scrollDOM)),this.addWindowListeners(this.win=t.win),this.start(),"function"==typeof IntersectionObserver&&(this.intersection=new IntersectionObserver(function(t){_this38.parentCheck<0&&(_this38.parentCheck=setTimeout(_this38.listenForScroll.bind(_this38),1e3)),t.length>0&&t[t.length-1].intersectionRatio>0!=_this38.intersecting&&(_this38.intersecting=!_this38.intersecting,_this38.intersecting!=_this38.view.inView&&_this38.onScrollChanged(document.createEvent("Event")));},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(function(t){t.length>0&&t[t.length-1].intersectionRatio>0&&_this38.onScrollChanged(document.createEvent("Event"));},{})),this.listenForScroll(),this.readSelectionRange();}return _createClass(Yr,[{key:"onScrollChanged",value:function onScrollChanged(t){this.view.inputState.runHandlers("scroll",t),this.intersecting&&this.view.measure();}},{key:"onScroll",value:function onScroll(t){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(t);}},{key:"onResize",value:function onResize(){var _this39=this;this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(function(){_this39.resizeTimeout=-1,_this39.view.requestMeasure();},50));}},{key:"onPrint",value:function onPrint(t){var _this40=this;("change"!=t.type&&t.type||t.matches)&&(this.view.viewState.printing=!0,this.view.measure(),setTimeout(function(){_this40.view.viewState.printing=!1,_this40.view.requestMeasure();},500));}},{key:"updateGaps",value:function updateGaps(t){if(this.gapIntersection&&(t.length!=this.gaps.length||this.gaps.some(function(e,i){return e!=t[i];}))){this.gapIntersection.disconnect();var _iterator74=_createForOfIteratorHelper(t),_step74;try{for(_iterator74.s();!(_step74=_iterator74.n()).done;){var _e119=_step74.value;this.gapIntersection.observe(_e119);}}catch(err){_iterator74.e(err);}finally{_iterator74.f();}this.gaps=t;}}},{key:"onSelectionChange",value:function onSelectionChange(t){var e=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;var i=this.view,s=this.selectionRange;if(i.state.facet(Zi)?i.root.activeElement!=this.dom:!le(this.dom,s))return;var r=s.anchorNode&&i.docView.nearest(s.anchorNode);r&&r.ignoreEvent(t)?e||(this.selectionChanged=!1):(Ue.ie&&Ue.ie_version<=11||Ue.android&&Ue.chrome)&&!i.state.selection.main.empty&&s.focusNode&&ue(s.focusNode,s.focusOffset,s.anchorNode,s.anchorOffset)?this.flushSoon():this.flush(!1);}},{key:"readSelectionRange",value:function readSelectionRange(){var t=this.view,e=ne(t.root);if(!e)return!1;var i=Ue.safari&&11==t.root.nodeType&&t.root.activeElement==this.dom&&function(t,e){if(e.getComposedRanges){var _i116=e.getComposedRanges(t.root)[0];if(_i116)return Zr(t,_i116);}var i=null;function s(t){t.preventDefault(),t.stopImmediatePropagation(),i=t.getTargetRanges()[0];}return t.contentDOM.addEventListener("beforeinput",s,!0),t.dom.ownerDocument.execCommand("indent"),t.contentDOM.removeEventListener("beforeinput",s,!0),i?Zr(t,i):null;}(this.view,e)||e;if(!i||this.selectionRange.eq(i))return!1;var s=le(this.dom,i);return s&&!this.selectionChanged&&t.inputState.lastFocusTime>Date.now()-200&&t.inputState.lastTouchTime<Date.now()-300&&function(t,e){var i=e.focusNode,s=e.focusOffset;if(!i||e.anchorNode!=i||e.anchorOffset!=s)return!1;for(s=Math.min(s,de(i));;)if(s){if(1!=i.nodeType)return!1;var _t127=i.childNodes[s-1];"false"==_t127.contentEditable?s--:(i=_t127,s=de(i));}else{if(i==t)return!0;s=fe(i),i=i.parentNode;}}(this.dom,i)?(this.view.inputState.lastFocusTime=0,t.docView.updateSelection(),!1):(this.selectionRange.setRange(i),s&&(this.selectionChanged=!0),!0);}},{key:"setSelectionRange",value:function setSelectionRange(t,e){this.selectionRange.set(t.node,t.offset,e.node,e.offset),this.selectionChanged=!1;}},{key:"clearSelectionRange",value:function clearSelectionRange(){this.selectionRange.set(null,0,null,0);}},{key:"listenForScroll",value:function listenForScroll(){this.parentCheck=-1;var t=0,e=null;for(var _i117=this.dom;_i117;)if(1==_i117.nodeType)!e&&t<this.scrollTargets.length&&this.scrollTargets[t]==_i117?t++:e||(e=this.scrollTargets.slice(0,t)),e&&e.push(_i117),_i117=_i117.assignedSlot||_i117.parentNode;else{if(11!=_i117.nodeType)break;_i117=_i117.host;}if(t<this.scrollTargets.length&&!e&&(e=this.scrollTargets.slice(0,t)),e){var _iterator75=_createForOfIteratorHelper(this.scrollTargets),_step75;try{for(_iterator75.s();!(_step75=_iterator75.n()).done;){var _t128=_step75.value;_t128.removeEventListener("scroll",this.onScroll);}}catch(err){_iterator75.e(err);}finally{_iterator75.f();}var _iterator76=_createForOfIteratorHelper(this.scrollTargets=e),_step76;try{for(_iterator76.s();!(_step76=_iterator76.n()).done;){var _t129=_step76.value;_t129.addEventListener("scroll",this.onScroll);}}catch(err){_iterator76.e(err);}finally{_iterator76.f();}}}},{key:"ignore",value:function ignore(t){if(!this.active)return t();try{return this.stop(),t();}finally{this.start(),this.clear();}}},{key:"start",value:function start(){this.active||(this.observer.observe(this.dom,_r),Xr&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0);}},{key:"stop",value:function stop(){this.active&&(this.active=!1,this.observer.disconnect(),Xr&&this.dom.removeEventListener("DOMCharacterDataModified",this.onCharData));}},{key:"clear",value:function clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1;}},{key:"delayAndroidKey",value:function delayAndroidKey(t,e){var _this41=this;var i;if(!this.delayedAndroidKey){var _t130=function _t130(){var t=_this41.delayedAndroidKey;if(t){_this41.clearDelayedAndroidKey(),_this41.view.inputState.lastKeyCode=t.keyCode,_this41.view.inputState.lastKeyTime=Date.now(),!_this41.flush()&&t.force&&Me(_this41.dom,t.key,t.keyCode);}};this.flushingAndroidKey=this.view.win.requestAnimationFrame(_t130);}this.delayedAndroidKey&&"Enter"!=t||(this.delayedAndroidKey={key:t,keyCode:e,force:this.lastChange<Date.now()-50||!!(null===(i=this.delayedAndroidKey)||void 0===i?void 0:i.force)});}},{key:"clearDelayedAndroidKey",value:function clearDelayedAndroidKey(){this.win.cancelAnimationFrame(this.flushingAndroidKey),this.delayedAndroidKey=null,this.flushingAndroidKey=-1;}},{key:"flushSoon",value:function flushSoon(){var _this42=this;this.delayedFlush<0&&(this.delayedFlush=this.view.win.requestAnimationFrame(function(){_this42.delayedFlush=-1,_this42.flush();}));}},{key:"forceFlush",value:function forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush();}},{key:"pendingRecords",value:function pendingRecords(){var _iterator77=_createForOfIteratorHelper(this.observer.takeRecords()),_step77;try{for(_iterator77.s();!(_step77=_iterator77.n()).done;){var _t131=_step77.value;this.queue.push(_t131);}}catch(err){_iterator77.e(err);}finally{_iterator77.f();}return this.queue;}},{key:"processRecords",value:function processRecords(){var t=this.pendingRecords();t.length&&(this.queue=[]);var e=-1,i=-1,s=!1;var _iterator78=_createForOfIteratorHelper(t),_step78;try{for(_iterator78.s();!(_step78=_iterator78.n()).done;){var _t133;var _r90=_step78.value;var _t132=this.readMutation(_r90);_t132&&(_t132.typeOver&&(s=!0),-1==e?(_t133=_t132,e=_t133.from,i=_t133.to,_t133):(e=Math.min(_t132.from,e),i=Math.max(_t132.to,i)));}}catch(err){_iterator78.e(err);}finally{_iterator78.f();}return{from:e,to:i,typeOver:s};}},{key:"readChange",value:function readChange(){var _this$processRecords=this.processRecords(),t=_this$processRecords.from,e=_this$processRecords.to,i=_this$processRecords.typeOver,s=this.selectionChanged&&le(this.dom,this.selectionRange);if(t<0&&!s)return null;t>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;var r=new $s(this.view,t,e,i);return this.view.docView.domChanged={newSel:r.newSel?r.newSel.main:null},r;}},{key:"flush",value:function flush(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:!0;if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;t&&this.readSelectionRange();var e=this.readChange();if(!e)return this.view.requestMeasure(),!1;var i=this.view.state,s=js(this.view,e);return this.view.state==i&&(e.domChanged||e.newSel&&!e.newSel.main.eq(this.view.state.selection.main))&&this.view.update([]),s;}},{key:"readMutation",value:function readMutation(t){var e=this.view.docView.nearest(t.target);if(!e||e.ignoreMutation(t))return null;if(e.markDirty("attributes"==t.type),"attributes"==t.type&&(e.flags|=4),"childList"==t.type){var _i118=Qr(e,t.previousSibling||t.target.previousSibling,-1),_s103=Qr(e,t.nextSibling||t.target.nextSibling,1);return{from:_i118?e.posAfter(_i118):e.posAtStart,to:_s103?e.posBefore(_s103):e.posAtEnd,typeOver:!1};}return"characterData"==t.type?{from:e.posAtStart,to:e.posAtEnd,typeOver:t.target.nodeValue==t.oldValue}:null;}},{key:"setWindow",value:function setWindow(t){t!=this.win&&(this.removeWindowListeners(this.win),this.win=t,this.addWindowListeners(this.win));}},{key:"addWindowListeners",value:function addWindowListeners(t){t.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):t.addEventListener("beforeprint",this.onPrint),t.addEventListener("scroll",this.onScroll),t.document.addEventListener("selectionchange",this.onSelectionChange);}},{key:"removeWindowListeners",value:function removeWindowListeners(t){t.removeEventListener("scroll",this.onScroll),t.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):t.removeEventListener("beforeprint",this.onPrint),t.document.removeEventListener("selectionchange",this.onSelectionChange);}},{key:"update",value:function update(t){this.editContext&&(this.editContext.update(t),t.startState.facet(Zi)!=t.state.facet(Zi)&&(t.view.contentDOM.editContext=t.state.facet(Zi)?this.editContext.editContext:null));}},{key:"destroy",value:function destroy(){var t,e,i;this.stop(),null===(t=this.intersection)||void 0===t||t.disconnect(),null===(e=this.gapIntersection)||void 0===e||e.disconnect(),null===(i=this.resizeScroll)||void 0===i||i.disconnect();var _iterator79=_createForOfIteratorHelper(this.scrollTargets),_step79;try{for(_iterator79.s();!(_step79=_iterator79.n()).done;){var _t134=_step79.value;_t134.removeEventListener("scroll",this.onScroll);}}catch(err){_iterator79.e(err);}finally{_iterator79.f();}this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy());}}]);}();tn=/*#__PURE__*/function(){function tn(t){var _this43=this;_classCallCheck(this,tn);this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(t.state);var e=this.editContext=new window.EditContext({text:t.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,t.state.selection.main.anchor))),selectionEnd:this.toContextPos(t.state.selection.main.head)});this.handlers.textupdate=function(e){var i=t.state.selection.main,s=i.anchor,r=i.head,n=_this43.toEditorPos(e.updateRangeStart),h=_this43.toEditorPos(e.updateRangeEnd);t.inputState.composing>=0&&!_this43.composing&&(_this43.composing={contextBase:e.updateRangeStart,editorBase:n,drifted:!1});var l={from:n,to:h,insert:a.of(e.text.split("\n"))};if(l.from==_this43.from&&s<_this43.from?l.from=s:l.to==_this43.to&&s>_this43.to&&(l.to=s),l.from!=l.to||l.insert.length){if((Ue.mac||Ue.android)&&l.from==r-1&&/^\. ?$/.test(e.text)&&"off"==t.contentDOM.getAttribute("autocorrect")&&(l={from:n,to:h,insert:a.of([e.text.replace("."," ")])}),_this43.pendingContextChange=l,!t.state.readOnly){var _i119=_this43.to-_this43.from+(l.to-l.from+l.insert.length);Ps(t,l,$.single(_this43.toEditorPos(e.selectionStart,_i119),_this43.toEditorPos(e.selectionEnd,_i119)));}_this43.pendingContextChange&&(_this43.revertPending(t.state),_this43.setSelection(t.state));}else{var _s105=$.single(_this43.toEditorPos(e.selectionStart),_this43.toEditorPos(e.selectionEnd));_s105.main.eq(i)||t.dispatch({selection:_s105,userEvent:"select"});}},this.handlers.characterboundsupdate=function(i){var s=[],r=null;for(var _e120=_this43.toEditorPos(i.rangeStart),_n71=_this43.toEditorPos(i.rangeEnd);_e120<_n71;_e120++){var _i120=t.coordsForChar(_e120);r=_i120&&new DOMRect(_i120.left,_i120.top,_i120.right-_i120.left,_i120.bottom-_i120.top)||r||new DOMRect(),s.push(r);}e.updateCharacterBounds(i.rangeStart,s);},this.handlers.textformatupdate=function(e){var i=[];var _iterator80=_createForOfIteratorHelper(e.getTextFormats()),_step80;try{for(_iterator80.s();!(_step80=_iterator80.n()).done;){var _t135=_step80.value;var _e121=_t135.underlineStyle,_s106=_t135.underlineThickness;if("None"!=_e121&&"None"!=_s106){var _r92=_this43.toEditorPos(_t135.rangeStart),_n72=_this43.toEditorPos(_t135.rangeEnd);if(_r92<_n72){var _t136="text-decoration: underline ".concat("Dashed"==_e121?"dashed ":"Squiggle"==_e121?"wavy ":"").concat("Thin"==_s106?1:2,"px");i.push(hi.mark({attributes:{style:_t136}}).range(_r92,_n72));}}}}catch(err){_iterator80.e(err);}finally{_iterator80.f();}t.dispatch({effects:Yi.of(hi.set(i))});},this.handlers.compositionstart=function(){t.inputState.composing<0&&(t.inputState.composing=0,t.inputState.compositionFirstChange=!0);},this.handlers.compositionend=function(){if(t.inputState.composing=-1,t.inputState.compositionFirstChange=null,_this43.composing){var _e122=_this43.composing.drifted;_this43.composing=null,_e122&&_this43.reset(t.state);}};for(var _t137 in this.handlers)e.addEventListener(_t137,this.handlers[_t137]);this.measureReq={read:function read(t){_this43.editContext.updateControlBounds(t.contentDOM.getBoundingClientRect());var e=ne(t.root);e&&e.rangeCount&&_this43.editContext.updateSelectionBounds(e.getRangeAt(0).getBoundingClientRect());}};}return _createClass(tn,[{key:"applyEdits",value:function applyEdits(t){var _this44=this;var e=0,i=!1,s=this.pendingContextChange;return t.changes.iterChanges(function(r,n,h,l,o){if(i)return;var u=o.length-(n-r);if(s&&n>=s.to){if(s.from==r&&s.to==n&&s.insert.eq(o))return s=_this44.pendingContextChange=null,e+=u,void(_this44.to+=u);s=null,_this44.revertPending(t.state);}if(r+=e,(n+=e)<=_this44.from)_this44.from+=u,_this44.to+=u;else if(r<_this44.to){if(r<_this44.from||n>_this44.to||_this44.to-_this44.from+o.length>3e4)return void(i=!0);_this44.editContext.updateText(_this44.toContextPos(r),_this44.toContextPos(n),o.toString()),_this44.to+=u;}e+=u;}),s&&!i&&this.revertPending(t.state),!i;}},{key:"update",value:function update(t){var _this45=this;var e=this.pendingContextChange;this.composing&&(this.composing.drifted||t.transactions.some(function(t){return!t.isUserEvent("input.type")&&t.changes.touchesRange(_this45.from,_this45.to);}))?(this.composing.drifted=!0,this.composing.editorBase=t.changes.mapPos(this.composing.editorBase)):this.applyEdits(t)&&this.rangeIsValid(t.state)?(t.docChanged||t.selectionSet||e)&&this.setSelection(t.state):(this.pendingContextChange=null,this.reset(t.state)),(t.geometryChanged||t.docChanged||t.selectionSet)&&t.view.requestMeasure(this.measureReq);}},{key:"resetRange",value:function resetRange(t){var e=t.selection.main.head;this.from=Math.max(0,e-1e4),this.to=Math.min(t.doc.length,e+1e4);}},{key:"reset",value:function reset(t){this.resetRange(t),this.editContext.updateText(0,this.editContext.text.length,t.doc.sliceString(this.from,this.to)),this.setSelection(t);}},{key:"revertPending",value:function revertPending(t){var e=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(e.from),this.toContextPos(e.from+e.insert.length),t.doc.sliceString(e.from,e.to));}},{key:"setSelection",value:function setSelection(t){var e=t.selection.main,i=this.toContextPos(Math.max(this.from,Math.min(this.to,e.anchor))),s=this.toContextPos(e.head);this.editContext.selectionStart==i&&this.editContext.selectionEnd==s||this.editContext.updateSelection(i,s);}},{key:"rangeIsValid",value:function rangeIsValid(t){var e=t.selection.main.head;return!(this.from>0&&e-this.from<500||this.to<t.doc.length&&this.to-e<500||this.to-this.from>3e4);}},{key:"toEditorPos",value:function toEditorPos(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:this.to-this.from;t=Math.min(t,e);var i=this.composing;return i&&i.drifted?i.editorBase+(t-i.contextBase):t+this.from;}},{key:"toContextPos",value:function toContextPos(t){var e=this.composing;return e&&e.drifted?e.contextBase+(t-e.editorBase):t-this.from;}},{key:"destroy",value:function destroy(){for(var _t138 in this.handlers)this.editContext.removeEventListener(_t138,this.handlers[_t138]);}}]);}();_export("E",en=/*#__PURE__*/function(){function en(){var _this46=this;var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,en);var e;this.plugins=[],this.pluginMap=new Map(),this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),t.parent&&t.parent.appendChild(this.dom);var i=t.dispatch;this.dispatchTransactions=t.dispatchTransactions||i&&function(t){return t.forEach(function(t){return i(t,_this46);});}||function(t){return _this46.update(t);},this.dispatch=this.dispatch.bind(this),this._root=t.root||function(t){for(;t;){if(t&&(9==t.nodeType||11==t.nodeType&&t.host))return t;t=t.assignedSlot||t.parentNode;}return null;}(t.parent)||document,this.viewState=new Lr(t.state||Dt.create(t)),t.scrollTo&&t.scrollTo.is(Xi)&&(this.viewState.scrollTarget=t.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(es).map(function(t){return new ss(t);});var _iterator81=_createForOfIteratorHelper(this.plugins),_step81;try{for(_iterator81.s();!(_step81=_iterator81.n()).done;){var _t139=_step81.value;_t139.update(this);}}catch(err){_iterator81.e(err);}finally{_iterator81.f();}this.observer=new Yr(this),this.inputState=new zs(this),this.inputState.ensureHandlers(this.plugins),this.docView=new gs(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),(null===(e=document.fonts)||void 0===e?void 0:e.ready)&&document.fonts.ready.then(function(){return _this46.requestMeasure();});}return _createClass(en,[{key:"state",get:function get(){return this.viewState.state;}},{key:"viewport",get:function get(){return this.viewState.viewport;}},{key:"visibleRanges",get:function get(){return this.viewState.visibleRanges;}},{key:"inView",get:function get(){return this.viewState.inView;}},{key:"composing",get:function get(){return this.inputState.composing>0;}},{key:"compositionStarted",get:function get(){return this.inputState.composing>=0;}},{key:"root",get:function get(){return this._root;}},{key:"win",get:function get(){return this.dom.ownerDocument.defaultView||window;}},{key:"dispatch",value:function dispatch(){var _this$state;for(var _len3=arguments.length,t=new Array(_len3),_key3=0;_key3<_len3;_key3++){t[_key3]=arguments[_key3];}var e=1==t.length&&t[0]instanceof gt?t:1==t.length&&Array.isArray(t[0])?t[0]:[(_this$state=this.state).update.apply(_this$state,t)];this.dispatchTransactions(e,this);}},{key:"update",value:function update(t){var _this47=this;if(0!=this.updateState)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");var e,i=!1,s=!1,r=this.state;var _iterator82=_createForOfIteratorHelper(t),_step82;try{for(_iterator82.s();!(_step82=_iterator82.n()).done;){var _e124=_step82.value;if(_e124.startState!=r)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");r=_e124.state;}}catch(err){_iterator82.e(err);}finally{_iterator82.f();}if(this.destroyed)return void(this.viewState.state=r);var n=this.hasFocus,h=0,l=null;t.some(function(t){return t.annotation(ur);})?(this.inputState.notifiedFocused=n,h=1):n!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=n,l=fr(r,n),l||(h=1));var o=this.observer.delayedAndroidKey,u=null;if(o?(this.observer.clearDelayedAndroidKey(),u=this.observer.readChange(),(u&&!this.state.doc.eq(r.doc)||!this.state.selection.eq(r.selection))&&(u=null)):this.observer.clear(),r.facet(Dt.phrases)!=this.state.facet(Dt.phrases))return this.setState(r);e=ms.create(this,r,t),e.flags|=h;var f=this.viewState.scrollTarget;try{this.updateState=2;var _iterator83=_createForOfIteratorHelper(t),_step83;try{for(_iterator83.s();!(_step83=_iterator83.n()).done;){var _e123=_step83.value;if(f&&(f=f.map(_e123.changes)),_e123.scrollIntoView){var _t140=_e123.state.selection.main;f=new _i(_t140.empty?_t140:$.cursor(_t140.head,_t140.head>_t140.anchor?-1:1));}var _iterator84=_createForOfIteratorHelper(_e123.effects),_step84;try{for(_iterator84.s();!(_step84=_iterator84.n()).done;){var _t141=_step84.value;_t141.is(Xi)&&(f=_t141.value.clip(this.state));}}catch(err){_iterator84.e(err);}finally{_iterator84.f();}}}catch(err){_iterator83.e(err);}finally{_iterator83.f();}this.viewState.update(e,f),this.bidiCache=nn.update(this.bidiCache,e.changes),e.empty||(this.updatePlugins(e),this.inputState.update(e)),i=this.docView.update(e),this.state.facet(ds)!=this.styleModules&&this.mountStyles(),s=this.updateAttrs(),this.showAnnouncements(t),this.docView.updateSelection(i,t.some(function(t){return t.isUserEvent("select.pointer");}));}finally{this.updateState=0;}if(e.startState.facet(Fr)!=e.state.facet(Fr)&&(this.viewState.mustMeasureContent=!0),(i||s||f||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),i&&this.docViewUpdate(),!e.empty){var _iterator85=_createForOfIteratorHelper(this.state.facet(Fi)),_step85;try{for(_iterator85.s();!(_step85=_iterator85.n()).done;){var _t142=_step85.value;try{_t142(e);}catch(t){Qi(this.state,t,"update listener");}}}catch(err){_iterator85.e(err);}finally{_iterator85.f();}}(l||u)&&Promise.resolve().then(function(){l&&_this47.state==l.startState&&_this47.dispatch(l),u&&!js(_this47,u)&&o.force&&Me(_this47.contentDOM,o.key,o.keyCode);});}},{key:"setState",value:function setState(t){if(0!=this.updateState)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed)return void(this.viewState.state=t);this.updateState=2;var e=this.hasFocus;try{var _iterator86=_createForOfIteratorHelper(this.plugins),_step86;try{for(_iterator86.s();!(_step86=_iterator86.n()).done;){var _t143=_step86.value;_t143.destroy(this);}}catch(err){_iterator86.e(err);}finally{_iterator86.f();}this.viewState=new Lr(t),this.plugins=t.facet(es).map(function(t){return new ss(t);}),this.pluginMap.clear();var _iterator87=_createForOfIteratorHelper(this.plugins),_step87;try{for(_iterator87.s();!(_step87=_iterator87.n()).done;){var _t144=_step87.value;_t144.update(this);}}catch(err){_iterator87.e(err);}finally{_iterator87.f();}this.docView.destroy(),this.docView=new gs(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[];}finally{this.updateState=0;}e&&this.focus(),this.requestMeasure();}},{key:"updatePlugins",value:function updatePlugins(t){var e=t.startState.facet(es),i=t.state.facet(es);if(e!=i){var _s107=[];var _iterator88=_createForOfIteratorHelper(i),_step88;try{for(_iterator88.s();!(_step88=_iterator88.n()).done;){var _r93=_step88.value;var _i121=e.indexOf(_r93);if(_i121<0)_s107.push(new ss(_r93));else{var _e125=this.plugins[_i121];_e125.mustUpdate=t,_s107.push(_e125);}}}catch(err){_iterator88.e(err);}finally{_iterator88.f();}var _iterator89=_createForOfIteratorHelper(this.plugins),_step89;try{for(_iterator89.s();!(_step89=_iterator89.n()).done;){var _e126=_step89.value;_e126.mustUpdate!=t&&_e126.destroy(this);}}catch(err){_iterator89.e(err);}finally{_iterator89.f();}this.plugins=_s107,this.pluginMap.clear();}else{var _iterator90=_createForOfIteratorHelper(this.plugins),_step90;try{for(_iterator90.s();!(_step90=_iterator90.n()).done;){var _e127=_step90.value;_e127.mustUpdate=t;}}catch(err){_iterator90.e(err);}finally{_iterator90.f();}}for(var _t145=0;_t145<this.plugins.length;_t145++)this.plugins[_t145].update(this);e!=i&&this.inputState.ensureHandlers(this.plugins);}},{key:"docViewUpdate",value:function docViewUpdate(){var _iterator91=_createForOfIteratorHelper(this.plugins),_step91;try{for(_iterator91.s();!(_step91=_iterator91.n()).done;){var _t146=_step91.value;var _e128=_t146.value;if(_e128&&_e128.docViewUpdate)try{_e128.docViewUpdate(this);}catch(t){Qi(this.state,t,"doc view update listener");}}}catch(err){_iterator91.e(err);}finally{_iterator91.f();}}},{key:"measure",value:function measure(){var _this48=this;var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:!0;if(this.destroyed)return;if(this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey)return this.measureScheduled=-1,void this.requestMeasure();this.measureScheduled=0,t&&this.observer.forceFlush();var e=null,i=this.scrollDOM,s=i.scrollTop*this.scaleY,_this$viewState=this.viewState,r=_this$viewState.scrollAnchorPos,n=_this$viewState.scrollAnchorHeight;Math.abs(s-this.viewState.scrollTop)>1&&(n=-1),this.viewState.scrollAnchorHeight=-1;try{for(var _t147=0;;_t147++){var _ref13;if(n<0)if(Se(i))r=-1,n=this.viewState.heightMap.height;else{var _t148=this.viewState.scrollAnchorAt(s);r=_t148.from,n=_t148.top;}this.updateState=1;var _h47=this.viewState.measure(this);if(!_h47&&!this.measureRequests.length&&null==this.viewState.scrollTarget)break;if(_t147>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break;}var _l40=[];4&_h47||(_ref13=[_l40,this.measureRequests],this.measureRequests=_ref13[0],_l40=_ref13[1],_ref13);var _o30=_l40.map(function(t){try{return t.read(_this48);}catch(t){return Qi(_this48.state,t),rn;}}),_u24=ms.create(this,this.state,[]),_f19=!1;_u24.flags|=_h47,e?e.flags|=_h47:e=_u24,this.updateState=2,_u24.empty||(this.updatePlugins(_u24),this.inputState.update(_u24),this.updateAttrs(),_f19=this.docView.update(_u24),_f19&&this.docViewUpdate());for(var _t149=0;_t149<_l40.length;_t149++)if(_o30[_t149]!=rn)try{var _e129=_l40[_t149];_e129.write&&_e129.write(_o30[_t149],this);}catch(t){Qi(this.state,t);}if(_f19&&this.docView.updateSelection(!0),!_u24.viewportChanged&&0==this.measureRequests.length){if(this.viewState.editorHeight){if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,n=-1;continue;}{var _t150=(r<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(r).top)-n;if(_t150>1||_t150<-1){s+=_t150,i.scrollTop=s/this.scaleY,n=-1;continue;}}}break;}}}finally{this.updateState=0,this.measureScheduled=-1;}if(e&&!e.empty){var _iterator92=_createForOfIteratorHelper(this.state.facet(Fi)),_step92;try{for(_iterator92.s();!(_step92=_iterator92.n()).done;){var _t151=_step92.value;_t151(e);}}catch(err){_iterator92.e(err);}finally{_iterator92.f();}}}},{key:"themeClasses",get:function get(){return Vr+" "+(this.state.facet(Wr)?Ur:qr)+" "+this.state.facet(Fr);}},{key:"updateAttrs",value:function updateAttrs(){var _this49=this;var t=hn(this,rs,{"class":"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),e={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(Zi)?"true":"false","class":"cm-content",style:"".concat(Ue.tabSize,": ").concat(this.state.tabSize),role:"textbox","aria-multiline":"true"};this.state.readOnly&&(e["aria-readonly"]="true"),hn(this,ns,e);var i=this.observer.ignore(function(){var i=ii(_this49.contentDOM,_this49.contentAttrs,e),s=ii(_this49.dom,_this49.editorAttrs,t);return i||s;});return this.editorAttrs=t,this.contentAttrs=e,i;}},{key:"showAnnouncements",value:function showAnnouncements(t){var e=!0;var _iterator93=_createForOfIteratorHelper(t),_step93;try{for(_iterator93.s();!(_step93=_iterator93.n()).done;){var _i122=_step93.value;var _iterator94=_createForOfIteratorHelper(_i122.effects),_step94;try{for(_iterator94.s();!(_step94=_iterator94.n()).done;){var _t152=_step94.value;if(_t152.is(en.announce)){e&&(this.announceDOM.textContent=""),e=!1,this.announceDOM.appendChild(document.createElement("div")).textContent=_t152.value;}}}catch(err){_iterator94.e(err);}finally{_iterator94.f();}}}catch(err){_iterator93.e(err);}finally{_iterator93.f();}}},{key:"mountStyles",value:function mountStyles(){this.styleModules=this.state.facet(ds);var t=this.state.facet(en.cspNonce);Xt.mount(this.root,this.styleModules.concat(Kr).reverse(),t?{nonce:t}:void 0);}},{key:"readMeasured",value:function readMeasured(){if(2==this.updateState)throw new Error("Reading the editor layout isn't allowed during an update");0==this.updateState&&this.measureScheduled>-1&&this.measure(!1);}},{key:"requestMeasure",value:function requestMeasure(t){var _this50=this;if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(function(){return _this50.measure();})),t){if(this.measureRequests.indexOf(t)>-1)return;if(null!=t.key)for(var _e130=0;_e130<this.measureRequests.length;_e130++)if(this.measureRequests[_e130].key===t.key)return void(this.measureRequests[_e130]=t);this.measureRequests.push(t);}}},{key:"plugin",value:function plugin(t){var e=this.pluginMap.get(t);return(void 0===e||e&&e.spec!=t)&&this.pluginMap.set(t,e=this.plugins.find(function(e){return e.spec==t;})||null),e&&e.update(this).value;}},{key:"documentTop",get:function get(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop;}},{key:"documentPadding",get:function get(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom};}},{key:"scaleX",get:function get(){return this.viewState.scaleX;}},{key:"scaleY",get:function get(){return this.viewState.scaleY;}},{key:"elementAtHeight",value:function elementAtHeight(t){return this.readMeasured(),this.viewState.elementAtHeight(t);}},{key:"lineBlockAtHeight",value:function lineBlockAtHeight(t){return this.readMeasured(),this.viewState.lineBlockAtHeight(t);}},{key:"viewportLineBlocks",get:function get(){return this.viewState.viewportLines;}},{key:"lineBlockAt",value:function lineBlockAt(t){return this.viewState.lineBlockAt(t);}},{key:"contentHeight",get:function get(){return this.viewState.contentHeight;}},{key:"moveByChar",value:function moveByChar(t,e,i){return Rs(this,t,Es(this,t,e,i));}},{key:"moveByGroup",value:function moveByGroup(t,e){var _this51=this;return Rs(this,t,Es(this,t,e,function(e){return function(t,e,i){var s=t.state.charCategorizer(e),r=s(i);return function(t){var e=s(t);return r==xt.Space&&(r=e),r==e;};}(_this51,t.head,e);}));}},{key:"visualLineSide",value:function visualLineSide(t,e){var i=this.bidiSpans(t),s=this.textDirectionAt(t.from),r=i[e?i.length-1:0];return $.cursor(r.side(e,s)+t.from,r.forward(!e,s)?1:-1);}},{key:"moveToLineBoundary",value:function moveToLineBoundary(t,e){var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!0;return function(t,e,i,s){var r=Os(t,e.head),n=s&&r.type==ni.Text&&(t.lineWrapping||r.widgetLineBreaks)?t.coordsAtPos(e.assoc<0&&e.head>r.from?e.head-1:e.head):null;if(n){var _e131=t.dom.getBoundingClientRect(),_s108=t.textDirectionAt(r.from),_h48=t.posAtCoords({x:i==(_s108==bi.LTR)?_e131.right-1:_e131.left+1,y:(n.top+n.bottom)/2});if(null!=_h48)return $.cursor(_h48,i?-1:1);}return $.cursor(i?r.to:r.from,i?-1:1);}(this,t,e,i);}},{key:"moveVertically",value:function moveVertically(t,e,i){return Rs(this,t,function(t,e,i,s){var r=e.head,n=i?1:-1;if(r==(i?t.state.doc.length:0))return $.cursor(r,e.assoc);var h,l=e.goalColumn,o=t.contentDOM.getBoundingClientRect(),u=t.coordsAtPos(r,e.assoc||-1),f=t.documentTop;if(u)null==l&&(l=u.left-o.left),h=n<0?u.top:u.bottom;else{var _e132=t.viewState.lineBlockAt(r);null==l&&(l=Math.min(o.right-o.left,t.defaultCharacterWidth*(r-_e132.from))),h=(n<0?_e132.top:_e132.bottom)+f;}var a=o.left+l,c=null!=s?s:t.viewState.heightOracle.textHeight>>1;for(var _e133=0;;_e133+=10){var _i123=h+(c+_e133)*n,_s109=Cs(t,{x:a,y:_i123},!1,n);if(_i123<o.top||_i123>o.bottom||(n<0?_s109<r:_s109>r)){var _e134=t.docView.coordsForChar(_s109),_r94=!_e134||_i123<_e134.top?-1:1;return $.cursor(_s109,_r94,void 0,l);}}}(this,t,e,i));}},{key:"domAtPos",value:function domAtPos(t){return this.docView.domAtPos(t);}},{key:"posAtDOM",value:function posAtDOM(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;return this.docView.posFromDOM(t,e);}},{key:"posAtCoords",value:function posAtCoords(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!0;return this.readMeasured(),Cs(this,t,e);}},{key:"coordsAtPos",value:function coordsAtPos(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;this.readMeasured();var i=this.docView.coordsAt(t,e);if(!i||i.left==i.right)return i;var s=this.state.doc.lineAt(t),r=this.bidiSpans(s);return pe(i,r[Oi.find(r,t-s.from,-1,e)].dir==bi.LTR==e>0);}},{key:"coordsForChar",value:function coordsForChar(t){return this.readMeasured(),this.docView.coordsForChar(t);}},{key:"defaultCharacterWidth",get:function get(){return this.viewState.heightOracle.charWidth;}},{key:"defaultLineHeight",get:function get(){return this.viewState.heightOracle.lineHeight;}},{key:"textDirection",get:function get(){return this.viewState.defaultTextDirection;}},{key:"textDirectionAt",value:function textDirectionAt(t){return!this.state.facet(Ji)||t<this.viewport.from||t>this.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(t));}},{key:"lineWrapping",get:function get(){return this.viewState.heightOracle.lineWrapping;}},{key:"bidiSpans",value:function bidiSpans(t){if(t.length>sn)return Bi(t.length);var e,i=this.textDirectionAt(t.from);var _iterator95=_createForOfIteratorHelper(this.bidiCache),_step95;try{for(_iterator95.s();!(_step95=_iterator95.n()).done;){var _s110=_step95.value;if(_s110.from==t.from&&_s110.dir==i&&(_s110.fresh||Ei(_s110.isolates,e=fs(this,t))))return _s110.order;}}catch(err){_iterator95.e(err);}finally{_iterator95.f();}e||(e=fs(this,t));var s=function(t,e,i){if(!t)return[new Oi(0,0,e==ki?1:0)];if(e==vi&&!i.length&&!Di.test(t))return Bi(t.length);if(i.length)for(;t.length>Ii.length;)Ii[Ii.length]=256;var s=[],r=e==vi?0:1;return Ti(t,r,r,i,0,t.length,s),s;}(t.text,i,e);return this.bidiCache.push(new nn(t.from,t.to,i,e,!0,s)),s;}},{key:"hasFocus",get:function get(){var t;return(this.dom.ownerDocument.hasFocus()||Ue.safari&&(null===(t=this.inputState)||void 0===t?void 0:t.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM;}},{key:"focus",value:function focus(){var _this52=this;this.observer.ignore(function(){ke(_this52.contentDOM),_this52.docView.updateSelection();});}},{key:"setRoot",value:function setRoot(t){this._root!=t&&(this._root=t,this.observer.setWindow((9==t.nodeType?t:t.ownerDocument).defaultView||window),this.mountStyles());}},{key:"destroy",value:function destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();var _iterator96=_createForOfIteratorHelper(this.plugins),_step96;try{for(_iterator96.s();!(_step96=_iterator96.n()).done;){var _t153=_step96.value;_t153.destroy(this);}}catch(err){_iterator96.e(err);}finally{_iterator96.f();}this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0;}},{key:"scrollSnapshot",value:function scrollSnapshot(){var _this$scrollDOM=this.scrollDOM,t=_this$scrollDOM.scrollTop,e=_this$scrollDOM.scrollLeft,i=this.viewState.scrollAnchorAt(t);return Xi.of(new _i($.cursor(i.from),"start","start",i.top-t,e,!0));}},{key:"setTabFocusMode",value:function setTabFocusMode(t){null==t?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:"boolean"==typeof t?this.inputState.tabFocusMode=t?0:-1:0!=this.inputState.tabFocusMode&&(this.inputState.tabFocusMode=Date.now()+t);}}],[{key:"scrollIntoView",value:function scrollIntoView(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};return Xi.of(new _i("number"==typeof t?$.cursor(t):t,e.y,e.x,e.yMargin,e.xMargin));}},{key:"domEventHandlers",value:function domEventHandlers(t){return is.define(function(){return{};},{eventHandlers:t});}},{key:"domEventObservers",value:function domEventObservers(t){return is.define(function(){return{};},{eventObservers:t});}},{key:"theme",value:function theme(t,e){var i=Xt.newName(),s=[Fr.of(i),ds.of(Gr(".".concat(i),t))];return e&&e.dark&&s.push(Wr.of(!0)),s;}},{key:"baseTheme",value:function baseTheme(t){return Q.lowest(ds.of(Gr("."+Vr,t,Jr)));}},{key:"findFromDOM",value:function findFromDOM(t){var e;var i=t.querySelector(".cm-content"),s=i&&Ee.get(i)||Ee.get(t);return(null===(e=null==s?void 0:s.rootView)||void 0===e?void 0:e.view)||null;}}]);}());en.styleModule=ds,en.inputHandler=Wi,en.clipboardInputFilter=qi,en.clipboardOutputFilter=Ui,en.scrollHandler=Ki,en.focusChangeEffect=Vi,en.perLineTextDirection=Ji,en.exceptionSink=Hi,en.updateListener=Fi,en.editable=Zi,en.mouseSelectionStyle=zi,en.dragMovesSelection=Pi,en.clickAddsSelectionRange=ji,en.decorations=hs,en.outerDecorations=ls,en.atomicRanges=os,en.bidiIsolatedRanges=us,en.scrollMargins=as,en.darkTheme=Wr,en.cspNonce=z.define({combine:function combine(t){return t.length?t[0]:"";}}),en.contentAttributes=ns,en.editorAttributes=rs,en.lineWrapping=en.contentAttributes.of({"class":"cm-lineWrapping"}),en.announce=mt.define();sn=4096,rn={};nn=/*#__PURE__*/function(){function nn(t,e,i,s,r,n){_classCallCheck(this,nn);this.from=t,this.to=e,this.dir=i,this.isolates=s,this.fresh=r,this.order=n;}return _createClass(nn,null,[{key:"update",value:function update(t,e){if(e.empty&&!t.some(function(t){return t.fresh;}))return t;var i=[],s=t.length?t[t.length-1].dir:bi.LTR;for(var _r95=Math.max(0,t.length-10);_r95<t.length;_r95++){var _n73=t[_r95];_n73.dir!=s||e.touchesRange(_n73.from,_n73.to)||i.push(new nn(e.mapPos(_n73.from,1),e.mapPos(_n73.to,-1),_n73.dir,_n73.isolates,!1,_n73.order));}return i;}}]);}();ln=Ue.mac?"mac":Ue.windows?"win":Ue.linux?"linux":"key";un=Q["default"](en.domEventHandlers({keydown:function keydown(t,e){return gn(cn(e.state),t,e,"editor");}})),_export("v",fn=z.define({enables:un})),an=new WeakMap();dn=null;pn=4e3;mn=null;wn=/*#__PURE__*/function(){function wn(t,e,i,s,r){_classCallCheck(this,wn);this.className=t,this.left=e,this.top=i,this.width=s,this.height=r;}return _createClass(wn,[{key:"draw",value:function draw(){var t=document.createElement("div");return t.className=this.className,this.adjust(t),t;}},{key:"update",value:function update(t,e){return e.className==this.className&&(this.adjust(t),!0);}},{key:"adjust",value:function adjust(t){t.style.left=this.left+"px",t.style.top=this.top+"px",null!=this.width&&(t.style.width=this.width+"px"),t.style.height=this.height+"px";}},{key:"eq",value:function eq(t){return this.left==t.left&&this.top==t.top&&this.width==t.width&&this.height==t.height&&this.className==t.className;}}],[{key:"forRange",value:function forRange(t,e,i){if(i.empty){var _s113=t.coordsAtPos(i.head,i.assoc||1);if(!_s113)return[];var _r98=bn(t);return[new wn(e,_s113.left-_r98.left,_s113.top-_r98.top,null,_s113.bottom-_s113.top)];}return function(t,e,i){if(i.to<=t.viewport.from||i.from>=t.viewport.to)return[];var s=Math.max(i.from,t.viewport.from),r=Math.min(i.to,t.viewport.to),n=t.textDirection==bi.LTR,h=t.contentDOM,l=h.getBoundingClientRect(),o=bn(t),u=h.querySelector(".cm-line"),f=u&&window.getComputedStyle(u),a=l.left+(f?parseInt(f.paddingLeft)+Math.min(0,parseInt(f.textIndent)):0),c=l.right-(f?parseInt(f.paddingRight):0),d=Os(t,s),p=Os(t,r),m=d.type==ni.Text?d:null,g=p.type==ni.Text?p:null;m&&(t.lineWrapping||d.widgetLineBreaks)&&(m=vn(t,s,1,m));g&&(t.lineWrapping||p.widgetLineBreaks)&&(g=vn(t,r,-1,g));if(m&&g&&m.from==g.from&&m.to==g.to)return b(v(i.from,i.to,m));{var _e140=m?v(i.from,null,m):k(d,!1),_s114=g?v(null,i.to,g):k(p,!0),_r99=[];return(m||d).to<(g||p).from-(m&&g?1:0)||d.widgetLineBreaks>1&&_e140.bottom+t.defaultLineHeight/2<_s114.top?_r99.push(w(a,_e140.bottom,c,_s114.top)):_e140.bottom<_s114.top&&t.elementAtHeight((_e140.bottom+_s114.top)/2).type==ni.Text&&(_e140.bottom=_s114.top=(_e140.bottom+_s114.top)/2),b(_e140).concat(_r99).concat(b(_s114));}function w(t,i,s,r){return new wn(e,t-o.left,i-o.top,s-t,r-i);}function b(_ref14){var t=_ref14.top,e=_ref14.bottom,i=_ref14.horizontal;var s=[];for(var _r100=0;_r100<i.length;_r100+=2)s.push(w(i[_r100],t,i[_r100+1],e));return s;}function v(e,i,s){var r=1e9,h=-1e9,l=[];function o(e,i,o,u,f){var d=t.coordsAtPos(e,e==s.to?-2:2),p=t.coordsAtPos(o,o==s.from?2:-2);d&&p&&(r=Math.min(d.top,p.top,r),h=Math.max(d.bottom,p.bottom,h),f==bi.LTR?l.push(n&&i?a:d.left,n&&u?c:p.right):l.push(!n&&u?a:p.left,!n&&i?c:d.right));}var u=null!=e?e:s.from,f=null!=i?i:s.to;var _iterator101=_createForOfIteratorHelper(t.visibleRanges),_step101;try{for(_iterator101.s();!(_step101=_iterator101.n()).done;){var _s115=_step101.value;if(_s115.to>u&&_s115.from<f)for(var _r101=Math.max(_s115.from,u),_n76=Math.min(_s115.to,f);;){var _s116=t.state.doc.lineAt(_r101);var _iterator102=_createForOfIteratorHelper(t.bidiSpans(_s116)),_step102;try{for(_iterator102.s();!(_step102=_iterator102.n()).done;){var _h49=_step102.value;var _t156=_h49.from+_s116.from,_l42=_h49.to+_s116.from;if(_t156>=_n76)break;_l42>_r101&&o(Math.max(_t156,_r101),null==e&&_t156<=u,Math.min(_l42,_n76),null==i&&_l42>=f,_h49.dir);}}catch(err){_iterator102.e(err);}finally{_iterator102.f();}if(_r101=_s116.to+1,_r101>=_n76)break;}}}catch(err){_iterator101.e(err);}finally{_iterator101.f();}return 0==l.length&&o(u,null==e,f,null==i,t.textDirection),{top:r,bottom:h,horizontal:l};}function k(t,e){var i=l.top+(e?t.top:t.bottom);return{top:i,bottom:i,horizontal:[]};}}(t,e,i);}}]);}();kn=/*#__PURE__*/function(){function kn(t,e){_classCallCheck(this,kn);this.view=t,this.layer=e,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=t.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),e.above&&this.dom.classList.add("cm-layer-above"),e["class"]&&this.dom.classList.add(e["class"]),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(t.state),t.requestMeasure(this.measureReq),e.mount&&e.mount(this.dom,t);}return _createClass(kn,[{key:"update",value:function update(t){t.startState.facet(yn)!=t.state.facet(yn)&&this.setOrder(t.state),(this.layer.update(t,this.dom)||t.geometryChanged)&&(this.scale(),t.view.requestMeasure(this.measureReq));}},{key:"docViewUpdate",value:function docViewUpdate(t){!1!==this.layer.updateOnDocViewUpdate&&t.requestMeasure(this.measureReq);}},{key:"setOrder",value:function setOrder(t){var e=0,i=t.facet(yn);for(;e<i.length&&i[e]!=this.layer;)e++;this.dom.style.zIndex=String((this.layer.above?150:-1)-e);}},{key:"measure",value:function measure(){return this.layer.markers(this.view);}},{key:"scale",value:function scale(){var _this$view=this.view,t=_this$view.scaleX,e=_this$view.scaleY;t==this.scaleX&&e==this.scaleY||(this.scaleX=t,this.scaleY=e,this.dom.style.transform="scale(".concat(1/t,", ").concat(1/e,")"));}},{key:"draw",value:function draw(t){var _this53=this;if(t.length!=this.drawn.length||t.some(function(t,e){return i=t,s=_this53.drawn[e],!(i.constructor==s.constructor&&i.eq(s));var i,s;})){var _e141=this.dom.firstChild,_i124=0;var _iterator103=_createForOfIteratorHelper(t),_step103;try{for(_iterator103.s();!(_step103=_iterator103.n()).done;){var _s117=_step103.value;_s117.update&&_e141&&_s117.constructor&&this.drawn[_i124].constructor&&_s117.update(_e141,this.drawn[_i124])?(_e141=_e141.nextSibling,_i124++):this.dom.insertBefore(_s117.draw(),_e141);}}catch(err){_iterator103.e(err);}finally{_iterator103.f();}for(;_e141;){var _t157=_e141.nextSibling;_e141.remove(),_e141=_t157;}this.drawn=t;}}},{key:"destroy",value:function destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove();}}]);}();yn=z.define();xn=!(Ue.ios&&Ue.webkit&&Ue.webkit_version<534),Sn=z.define({combine:function combine(t){return Ot(t,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:function cursorBlinkRate(t,e){return Math.min(t,e);},drawRangeCursor:function drawRangeCursor(t,e){return t||e;}});}});Cn=Mn({above:!0,markers:function markers(t){var e=t.state,i=e.facet(Sn),s=[];var _iterator104=_createForOfIteratorHelper(e.selection.ranges),_step104;try{for(_iterator104.s();!(_step104=_iterator104.n()).done;){var _r102=_step104.value;var _n77=_r102==e.selection.main;if(_r102.empty?!_n77||xn:i.drawRangeCursor){var _e142=_n77?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",_i125=_r102.empty?_r102:$.cursor(_r102.head,_r102.head>_r102.anchor?-1:1);var _iterator105=_createForOfIteratorHelper(wn.forRange(t,_e142,_i125)),_step105;try{for(_iterator105.s();!(_step105=_iterator105.n()).done;){var _r103=_step105.value;s.push(_r103);}}catch(err){_iterator105.e(err);}finally{_iterator105.f();}}}}catch(err){_iterator104.e(err);}finally{_iterator104.f();}return s;},update:function update(t,e){t.transactions.some(function(t){return t.selection;})&&(e.style.animationName="cm-blink"==e.style.animationName?"cm-blink2":"cm-blink");var i=An(t);return i&&Dn(t.state,e),t.docChanged||t.selectionSet||i;},mount:function mount(t,e){Dn(e.state,t);},"class":"cm-cursorLayer"});On=Mn({above:!1,markers:function markers(t){return t.state.selection.ranges.map(function(e){return e.empty?[]:wn.forRange(t,"cm-selectionBackground",e);}).reduce(function(t,e){return t.concat(e);});},update:function update(t,e){return t.docChanged||t.selectionSet||t.viewportChanged||An(t);},"class":"cm-selectionLayer"}),En={".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"}},".cm-content":{"& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}};xn&&(En[".cm-line"].caretColor=En[".cm-content"].caretColor="transparent !important");In=Q.highest(en.theme(En)),Rn=mt.define({map:function map(t,e){return null==t?null:e.mapPos(t);}}),Tn=J.define({create:function create(){return null;},update:function update(t,e){return null!=t&&(t=e.changes.mapPos(t)),e.effects.reduce(function(t,e){return e.is(Rn)?e.value:t;},t);}}),Bn=is.fromClass(/*#__PURE__*/function(){function _class(t){_classCallCheck(this,_class);this.view=t,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)};}return _createClass(_class,[{key:"update",value:function update(t){var e;var i=t.state.field(Tn);null==i?null!=this.cursor&&(null===(e=this.cursor)||void 0===e||e.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(t.startState.field(Tn)!=i||t.docChanged||t.geometryChanged)&&this.view.requestMeasure(this.measureReq));}},{key:"readPos",value:function readPos(){var t=this.view,e=t.state.field(Tn),i=null!=e&&t.coordsAtPos(e);if(!i)return null;var s=t.scrollDOM.getBoundingClientRect();return{left:i.left-s.left+t.scrollDOM.scrollLeft*t.scaleX,top:i.top-s.top+t.scrollDOM.scrollTop*t.scaleY,height:i.bottom-i.top};}},{key:"drawCursor",value:function drawCursor(t){if(this.cursor){var _this$view2=this.view,_e143=_this$view2.scaleX,_i126=_this$view2.scaleY;t?(this.cursor.style.left=t.left/_e143+"px",this.cursor.style.top=t.top/_i126+"px",this.cursor.style.height=t.height/_i126+"px"):this.cursor.style.left="-100000px";}}},{key:"destroy",value:function destroy(){this.cursor&&this.cursor.remove();}},{key:"setDropPos",value:function setDropPos(t){this.view.state.field(Tn)!=t&&this.view.dispatch({effects:Rn.of(t)});}}]);}(),{eventObservers:{dragover:function dragover(t){this.setDropPos(this.view.posAtCoords({x:t.clientX,y:t.clientY}));},dragleave:function dragleave(t){t.target!=this.view.contentDOM&&this.view.contentDOM.contains(t.relatedTarget)||this.setDropPos(null);},dragend:function dragend(){this.setDropPos(null);},drop:function drop(){this.setDropPos(null);}}});Nn=/*#__PURE__*/function(){function Nn(t){_classCallCheck(this,Nn);var e=t.regexp,i=t.decoration,s=t.decorate,r=t.boundary,_t$maxLength=t.maxLength,n=_t$maxLength===void 0?1e3:_t$maxLength;if(!e.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=e,s)this.addMatch=function(t,e,i,r){return s(r,i,i+t[0].length,t,e);};else if("function"==typeof i)this.addMatch=function(t,e,s,r){var n=i(t,e,s);n&&r(s,s+t[0].length,n);};else{if(!i)throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.addMatch=function(t,e,s,r){return r(s,s+t[0].length,i);};}this.boundary=r,this.maxLength=n;}return _createClass(Nn,[{key:"createDeco",value:function createDeco(t){var _this54=this;var e=new Lt(),i=e.add.bind(e);var _iterator106=_createForOfIteratorHelper(function(t,e){var i=t.visibleRanges;if(1==i.length&&i[0].from==t.viewport.from&&i[0].to==t.viewport.to)return i;var s=[];var _iterator107=_createForOfIteratorHelper(i),_step107;try{for(_iterator107.s();!(_step107=_iterator107.n()).done;){var _step107$value=_step107.value,_r104=_step107$value.from,_n79=_step107$value.to;_r104=Math.max(t.state.doc.lineAt(_r104).from,_r104-e),_n79=Math.min(t.state.doc.lineAt(_n79).to,_n79+e),s.length&&s[s.length-1].to>=_r104?s[s.length-1].to=_n79:s.push({from:_r104,to:_n79});}}catch(err){_iterator107.e(err);}finally{_iterator107.f();}return s;}(t,this.maxLength)),_step106;try{for(_iterator106.s();!(_step106=_iterator106.n()).done;){var _step106$value=_step106.value,_e144=_step106$value.from,_s118=_step106$value.to;Ln(t.state.doc,this.regexp,_e144,_s118,function(e,s){return _this54.addMatch(s,t,e,i);});}}catch(err){_iterator106.e(err);}finally{_iterator106.f();}return e.finish();}},{key:"updateDeco",value:function updateDeco(t,e){var i=1e9,s=-1;return t.docChanged&&t.changes.iterChanges(function(e,r,n,h){h>=t.view.viewport.from&&n<=t.view.viewport.to&&(i=Math.min(n,i),s=Math.max(h,s));}),t.viewportMoved||s-i>1e3?this.createDeco(t.view):s>-1?this.updateRange(t.view,e.map(t.changes),i,s):e;}},{key:"updateRange",value:function updateRange(t,e,i,s){var _this55=this;var _iterator108=_createForOfIteratorHelper(t.visibleRanges),_step108;try{var _loop10=function _loop10(){var r=_step108.value;var n=Math.max(r.from,i),h=Math.min(r.to,s);if(h>n){var _i127=t.state.doc.lineAt(n),_s119=_i127.to<h?t.state.doc.lineAt(h):_i127,_l44=Math.max(r.from,_i127.from),_o31=Math.min(r.to,_s119.to);if(_this55.boundary){for(;n>_i127.from;n--)if(_this55.boundary.test(_i127.text[n-1-_i127.from])){_l44=n;break;}for(;h<_s119.to;h++)if(_this55.boundary.test(_s119.text[h-_s119.from])){_o31=h;break;}}var _u25,_f20=[],_a14=function _a14(t,e,i){return _f20.push(i.range(t,e));};if(_i127==_s119)for(_this55.regexp.lastIndex=_l44-_i127.from;(_u25=_this55.regexp.exec(_i127.text))&&_u25.index<_o31-_i127.from;)_this55.addMatch(_u25,t,_u25.index+_i127.from,_a14);else Ln(t.state.doc,_this55.regexp,_l44,_o31,function(e,i){return _this55.addMatch(i,t,e,_a14);});e=e.update({filterFrom:_l44,filterTo:_o31,filter:function filter(t,e){return t<_l44||e>_o31;},add:_f20});}};for(_iterator108.s();!(_step108=_iterator108.n()).done;){_loop10();}}catch(err){_iterator108.e(err);}finally{_iterator108.f();}return e;}}]);}();$n=null!=/x/.unicode?"gu":"g",jn=new RegExp("[\0-\b\n-\x1F\x7F-\x9F\xAD\u061C\u200B\u200E\u200F\u2028\u2029\u202D\u202E\u2066\u2067\u2069\uFEFF\uFFF9-\uFFFC]",$n),Pn={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};zn=null;Hn=z.define({combine:function combine(t){var e=Ot(t,{render:null,specialChars:jn,addSpecialChars:null});return(e.replaceTabs=!function(){var t;if(null==zn&&"undefined"!=typeof document&&document.body){var _e145=document.body.style;zn=null!=(null!==(t=_e145.tabSize)&&void 0!==t?t:_e145.MozTabSize);}return zn||!1;}())&&(e.specialChars=new RegExp("\t|"+e.specialChars.source,$n)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,$n)),e;}});Fn=null;Wn=/*#__PURE__*/function(_ri4){function Wn(t,e){var _this56;_classCallCheck(this,Wn);_this56=_callSuper(this,Wn),_this56.options=t,_this56.code=e;return _this56;}_inherits(Wn,_ri4);return _createClass(Wn,[{key:"eq",value:function eq(t){return t.code==this.code;}},{key:"toDOM",value:function toDOM(t){var e=function(t){return t>=32?"•":10==t?"":String.fromCharCode(9216+t);}(this.code),i=t.state.phrase("Control character")+" "+(Pn[this.code]||"0x"+this.code.toString(16)),s=this.options.render&&this.options.render(this.code,i,e);if(s)return s;var r=document.createElement("span");return r.textContent=e,r.title=i,r.setAttribute("aria-label",i),r.className="cm-specialChar",r;}},{key:"ignoreEvent",value:function ignoreEvent(){return!1;}}]);}(ri);Vn=/*#__PURE__*/function(_ri5){function Vn(t){var _this57;_classCallCheck(this,Vn);_this57=_callSuper(this,Vn),_this57.width=t;return _this57;}_inherits(Vn,_ri5);return _createClass(Vn,[{key:"eq",value:function eq(t){return t.width==this.width;}},{key:"toDOM",value:function toDOM(){var t=document.createElement("span");return t.textContent="\t",t.className="cm-tab",t.style.width=this.width+"px",t;}},{key:"ignoreEvent",value:function ignoreEvent(){return!1;}}]);}(ri);qn=hi.line({"class":"cm-activeLine"}),Un=is.fromClass(/*#__PURE__*/function(){function _class2(t){_classCallCheck(this,_class2);this.decorations=this.getDeco(t);}return _createClass(_class2,[{key:"update",value:function update(t){(t.docChanged||t.selectionSet)&&(this.decorations=this.getDeco(t.view));}},{key:"getDeco",value:function getDeco(t){var e=-1,i=[];var _iterator109=_createForOfIteratorHelper(t.state.selection.ranges),_step109;try{for(_iterator109.s();!(_step109=_iterator109.n()).done;){var _s120=_step109.value;var _r105=t.lineBlockAt(_s120.head);_r105.from>e&&(i.push(qn.range(_r105.from)),e=_r105.from);}}catch(err){_iterator109.e(err);}finally{_iterator109.f();}return hi.set(i);}}]);}(),{decorations:function decorations(t){return t.decorations;}});Jn=/*#__PURE__*/function(_ri6){function Jn(t){var _this58;_classCallCheck(this,Jn);_this58=_callSuper(this,Jn),_this58.content=t;return _this58;}_inherits(Jn,_ri6);return _createClass(Jn,[{key:"toDOM",value:function toDOM(t){var e=document.createElement("span");return e.className="cm-placeholder",e.style.pointerEvents="none",e.appendChild("string"==typeof this.content?document.createTextNode(this.content):"function"==typeof this.content?this.content(t):this.content.cloneNode(!0)),"string"==typeof this.content?e.setAttribute("aria-label","placeholder "+this.content):e.setAttribute("aria-hidden","true"),e;}},{key:"coordsAt",value:function coordsAt(t){var e=t.firstChild?oe(t.firstChild):[];if(!e.length)return null;var i=window.getComputedStyle(t.parentNode),s=pe(e[0],"rtl"!=i.direction),r=parseInt(i.lineHeight);return s.bottom-s.top>1.5*r?{left:s.left,right:s.right,top:s.top,bottom:s.top+r}:s;}},{key:"ignoreEvent",value:function ignoreEvent(){return!1;}}]);}(ri);Kn=2e3;Yn={Alt:[18,function(t){return!!t.altKey;}],Control:[17,function(t){return!!t.ctrlKey;}],Shift:[16,function(t){return!!t.shiftKey;}],Meta:[91,function(t){return!!t.metaKey;}]},Qn={style:"cursor: crosshair"};Zn="-10000px";th=/*#__PURE__*/function(){function th(t,e,i,s){_classCallCheck(this,th);this.facet=e,this.createTooltipView=i,this.removeTooltipView=s,this.input=t.state.facet(e),this.tooltips=this.input.filter(function(t){return t;});var r=null;this.tooltipViews=this.tooltips.map(function(t){return r=i(t,r);});}return _createClass(th,[{key:"update",value:function update(t,e){var i;var s=t.state.facet(this.facet),r=s.filter(function(t){return t;});if(s===this.input){var _iterator110=_createForOfIteratorHelper(this.tooltipViews),_step110;try{for(_iterator110.s();!(_step110=_iterator110.n()).done;){var _e150=_step110.value;_e150.update&&_e150.update(t);}}catch(err){_iterator110.e(err);}finally{_iterator110.f();}return!1;}var n=[],h=e?[]:null;for(var _i130=0;_i130<r.length;_i130++){var _s122=r[_i130],_l47=-1;if(_s122){for(var _t158=0;_t158<this.tooltips.length;_t158++){var _e151=this.tooltips[_t158];_e151&&_e151.create==_s122.create&&(_l47=_t158);}if(_l47<0)n[_i130]=this.createTooltipView(_s122,_i130?n[_i130-1]:null),h&&(h[_i130]=!!_s122.above);else{var _s123=n[_i130]=this.tooltipViews[_l47];h&&(h[_i130]=e[_l47]),_s123.update&&_s123.update(t);}}}var _iterator111=_createForOfIteratorHelper(this.tooltipViews),_step111;try{for(_iterator111.s();!(_step111=_iterator111.n()).done;){var _t159=_step111.value;n.indexOf(_t159)<0&&(this.removeTooltipView(_t159),null===(i=_t159.destroy)||void 0===i||i.call(_t159));}}catch(err){_iterator111.e(err);}finally{_iterator111.f();}return e&&(h.forEach(function(t,i){return e[i]=t;}),e.length=h.length),this.input=s,this.tooltips=r,this.tooltipViews=n,!0;}}]);}();sh=z.define({combine:function combine(t){var e,i,s;return{position:Ue.ios?"absolute":(null===(e=t.find(function(t){return t.position;}))||void 0===e?void 0:e.position)||"fixed",parent:(null===(i=t.find(function(t){return t.parent;}))||void 0===i?void 0:i.parent)||null,tooltipSpace:(null===(s=t.find(function(t){return t.tooltipSpace;}))||void 0===s?void 0:s.tooltipSpace)||ih};}}),rh=new WeakMap(),nh=is.fromClass(/*#__PURE__*/function(){function _class4(t){var _this59=this;_classCallCheck(this,_class4);this.view=t,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;var e=t.state.facet(sh);this.position=e.position,this.parent=e.parent,this.classes=t.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver="function"==typeof ResizeObserver?new ResizeObserver(function(){return _this59.measureSoon();}):null,this.manager=new th(t,uh,function(t,e){return _this59.createTooltip(t,e);},function(t){_this59.resizeObserver&&_this59.resizeObserver.unobserve(t.dom),t.dom.remove();}),this.above=this.manager.tooltips.map(function(t){return!!t.above;}),this.intersectionObserver="function"==typeof IntersectionObserver?new IntersectionObserver(function(t){Date.now()>_this59.lastTransaction-50&&t.length>0&&t[t.length-1].intersectionRatio<1&&_this59.measureSoon();},{threshold:[1]}):null,this.observeIntersection(),t.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure();}return _createClass(_class4,[{key:"createContainer",value:function createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom;}},{key:"observeIntersection",value:function observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();var _iterator112=_createForOfIteratorHelper(this.manager.tooltipViews),_step112;try{for(_iterator112.s();!(_step112=_iterator112.n()).done;){var _t160=_step112.value;this.intersectionObserver.observe(_t160.dom);}}catch(err){_iterator112.e(err);}finally{_iterator112.f();}}}},{key:"measureSoon",value:function measureSoon(){var _this60=this;this.measureTimeout<0&&(this.measureTimeout=setTimeout(function(){_this60.measureTimeout=-1,_this60.maybeMeasure();},50));}},{key:"update",value:function update(t){t.transactions.length&&(this.lastTransaction=Date.now());var e=this.manager.update(t,this.above);e&&this.observeIntersection();var i=e||t.geometryChanged,s=t.state.facet(sh);if(s.position!=this.position&&!this.madeAbsolute){this.position=s.position;var _iterator113=_createForOfIteratorHelper(this.manager.tooltipViews),_step113;try{for(_iterator113.s();!(_step113=_iterator113.n()).done;){var _t161=_step113.value;_t161.dom.style.position=this.position;}}catch(err){_iterator113.e(err);}finally{_iterator113.f();}i=!0;}if(s.parent!=this.parent){this.parent&&this.container.remove(),this.parent=s.parent,this.createContainer();var _iterator114=_createForOfIteratorHelper(this.manager.tooltipViews),_step114;try{for(_iterator114.s();!(_step114=_iterator114.n()).done;){var _t162=_step114.value;this.container.appendChild(_t162.dom);}}catch(err){_iterator114.e(err);}finally{_iterator114.f();}i=!0;}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);i&&this.maybeMeasure();}},{key:"createTooltip",value:function createTooltip(t,e){var i=t.create(this.view),s=e?e.dom:null;if(i.dom.classList.add("cm-tooltip"),t.arrow&&!i.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){var _t163=document.createElement("div");_t163.className="cm-tooltip-arrow",i.dom.appendChild(_t163);}return i.dom.style.position=this.position,i.dom.style.top=Zn,i.dom.style.left="0px",this.container.insertBefore(i.dom,s),i.mount&&i.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(i.dom),i;}},{key:"destroy",value:function destroy(){var t,e,i;this.view.win.removeEventListener("resize",this.measureSoon);var _iterator115=_createForOfIteratorHelper(this.manager.tooltipViews),_step115;try{for(_iterator115.s();!(_step115=_iterator115.n()).done;){var _e152=_step115.value;_e152.dom.remove(),null===(t=_e152.destroy)||void 0===t||t.call(_e152);}}catch(err){_iterator115.e(err);}finally{_iterator115.f();}this.parent&&this.container.remove(),null===(e=this.resizeObserver)||void 0===e||e.disconnect(),null===(i=this.intersectionObserver)||void 0===i||i.disconnect(),clearTimeout(this.measureTimeout);}},{key:"readMeasure",value:function readMeasure(){var _this61=this;var t=1,e=1,i=!1;if("fixed"==this.position&&this.manager.tooltipViews.length){var _t164=this.manager.tooltipViews[0].dom;if(Ue.gecko)i=_t164.offsetParent!=this.container.ownerDocument.body;else if(_t164.style.top==Zn&&"0px"==_t164.style.left){var _e153=_t164.getBoundingClientRect();i=Math.abs(_e153.top+1e4)>1||Math.abs(_e153.left)>1;}}if(i||"absolute"==this.position)if(this.parent){var _i131=this.parent.getBoundingClientRect();_i131.width&&_i131.height&&(t=_i131.width/this.parent.offsetWidth,e=_i131.height/this.parent.offsetHeight);}else{var _this$view$viewState=this.view.viewState;t=_this$view$viewState.scaleX;e=_this$view$viewState.scaleY;}var s=this.view.scrollDOM.getBoundingClientRect(),r=cs(this.view);return{visible:{left:s.left+r.left,top:s.top+r.top,right:s.right-r.right,bottom:s.bottom-r.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map(function(t,e){var i=_this61.manager.tooltipViews[e];return i.getCoords?i.getCoords(t.pos):_this61.view.coordsAtPos(t.pos);}),size:this.manager.tooltipViews.map(function(_ref15){var t=_ref15.dom;return t.getBoundingClientRect();}),space:this.view.state.facet(sh).tooltipSpace(this.view),scaleX:t,scaleY:e,makeAbsolute:i};}},{key:"writeMeasure",value:function writeMeasure(t){var e;if(t.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";var _iterator116=_createForOfIteratorHelper(this.manager.tooltipViews),_step116;try{for(_iterator116.s();!(_step116=_iterator116.n()).done;){var _t165=_step116.value;_t165.dom.style.position="absolute";}}catch(err){_iterator116.e(err);}finally{_iterator116.f();}}var i=t.visible,s=t.space,r=t.scaleX,n=t.scaleY,h=[];for(var _l48=0;_l48<this.manager.tooltips.length;_l48++){var _o32=this.manager.tooltips[_l48],_u26=this.manager.tooltipViews[_l48],_f21=_u26.dom,_a15=t.pos[_l48],_c13=t.size[_l48];if(!_a15||!1!==_o32.clip&&(_a15.bottom<=Math.max(i.top,s.top)||_a15.top>=Math.min(i.bottom,s.bottom)||_a15.right<Math.max(i.left,s.left)-.1||_a15.left>Math.min(i.right,s.right)+.1)){_f21.style.top=Zn;continue;}var _d9=_o32.arrow?_u26.dom.querySelector(".cm-tooltip-arrow"):null,_p6=_d9?7:0,_m4=_c13.right-_c13.left,_g4=null!==(e=rh.get(_u26))&&void 0!==e?e:_c13.bottom-_c13.top,_w=_u26.offset||oh,_b=this.view.textDirection==bi.LTR,_v=_c13.width>s.right-s.left?_b?s.left:s.right-_c13.width:_b?Math.max(s.left,Math.min(_a15.left-(_d9?14:0)+_w.x,s.right-_m4)):Math.min(Math.max(s.left,_a15.left-_m4+(_d9?14:0)-_w.x),s.right-_m4),_k13=this.above[_l48];!_o32.strictSide&&(_k13?_a15.top-_g4-_p6-_w.y<s.top:_a15.bottom+_g4+_p6+_w.y>s.bottom)&&_k13==s.bottom-_a15.bottom>_a15.top-s.top&&(_k13=this.above[_l48]=!_k13);var _y=(_k13?_a15.top-s.top:s.bottom-_a15.bottom)-_p6;if(_y<_g4&&!1!==_u26.resize){if(_y<this.view.defaultLineHeight){_f21.style.top=Zn;continue;}rh.set(_u26,_g4),_f21.style.height=(_g4=_y)/n+"px";}else _f21.style.height&&(_f21.style.height="");var _M=_k13?_a15.top-_g4-_p6-_w.y:_a15.bottom+_p6+_w.y,_x=_v+_m4;if(!0!==_u26.overlap){var _iterator117=_createForOfIteratorHelper(h),_step117;try{for(_iterator117.s();!(_step117=_iterator117.n()).done;){var _t166=_step117.value;_t166.left<_x&&_t166.right>_v&&_t166.top<_M+_g4&&_t166.bottom>_M&&(_M=_k13?_t166.top-_g4-2-_p6:_t166.bottom+_p6+2);}}catch(err){_iterator117.e(err);}finally{_iterator117.f();}}if("absolute"==this.position?(_f21.style.top=(_M-t.parent.top)/n+"px",hh(_f21,(_v-t.parent.left)/r)):(_f21.style.top=_M/n+"px",hh(_f21,_v/r)),_d9){var _t167=_a15.left+(_b?_w.x:-_w.x)-(_v+14-7);_d9.style.left=_t167/r+"px";}!0!==_u26.overlap&&h.push({left:_v,top:_M,right:_x,bottom:_M+_g4}),_f21.classList.toggle("cm-tooltip-above",_k13),_f21.classList.toggle("cm-tooltip-below",!_k13),_u26.positioned&&_u26.positioned(t.space);}}},{key:"maybeMeasure",value:function maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView))){var _iterator118=_createForOfIteratorHelper(this.manager.tooltipViews),_step118;try{for(_iterator118.s();!(_step118=_iterator118.n()).done;){var _t168=_step118.value;_t168.dom.style.top=Zn;}}catch(err){_iterator118.e(err);}finally{_iterator118.f();}}}}]);}(),{eventObservers:{scroll:function scroll(){this.maybeMeasure();}}});lh=en.baseTheme({".cm-tooltip":{zIndex:500,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:"14px",position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),oh={x:0,y:0},uh=z.define({enables:[nh,lh]}),fh=z.define({combine:function combine(t){return t.reduce(function(t,e){return t.concat(e);},[]);}});ah=/*#__PURE__*/function(){function ah(t){var _this62=this;_classCallCheck(this,ah);this.view=t,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new th(t,fh,function(t,e){return _this62.createHostedView(t,e);},function(t){return t.dom.remove();});}return _createClass(ah,[{key:"createHostedView",value:function createHostedView(t,e){var i=t.create(this.view);return i.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(i.dom,e?e.dom.nextSibling:this.dom.firstChild),this.mounted&&i.mount&&i.mount(this.view),i;}},{key:"mount",value:function mount(t){var _iterator119=_createForOfIteratorHelper(this.manager.tooltipViews),_step119;try{for(_iterator119.s();!(_step119=_iterator119.n()).done;){var _e154=_step119.value;_e154.mount&&_e154.mount(t);}}catch(err){_iterator119.e(err);}finally{_iterator119.f();}this.mounted=!0;}},{key:"positioned",value:function positioned(t){var _iterator120=_createForOfIteratorHelper(this.manager.tooltipViews),_step120;try{for(_iterator120.s();!(_step120=_iterator120.n()).done;){var _e155=_step120.value;_e155.positioned&&_e155.positioned(t);}}catch(err){_iterator120.e(err);}finally{_iterator120.f();}}},{key:"update",value:function update(t){this.manager.update(t);}},{key:"destroy",value:function destroy(){var t;var _iterator121=_createForOfIteratorHelper(this.manager.tooltipViews),_step121;try{for(_iterator121.s();!(_step121=_iterator121.n()).done;){var _e156=_step121.value;null===(t=_e156.destroy)||void 0===t||t.call(_e156);}}catch(err){_iterator121.e(err);}finally{_iterator121.f();}}},{key:"passProp",value:function passProp(t){var e;var _iterator122=_createForOfIteratorHelper(this.manager.tooltipViews),_step122;try{for(_iterator122.s();!(_step122=_iterator122.n()).done;){var _i132=_step122.value;var _s124=_i132[t];if(void 0!==_s124)if(void 0===e)e=_s124;else if(e!==_s124)return;}}catch(err){_iterator122.e(err);}finally{_iterator122.f();}return e;}},{key:"offset",get:function get(){return this.passProp("offset");}},{key:"getCoords",get:function get(){return this.passProp("getCoords");}},{key:"overlap",get:function get(){return this.passProp("overlap");}},{key:"resize",get:function get(){return this.passProp("resize");}}],[{key:"create",value:function create(t){return new ah(t);}}]);}();ch=uh.compute([fh],function(t){var e=t.facet(fh);return 0===e.length?null:{pos:Math.min.apply(Math,_toConsumableArray(e.map(function(t){return t.pos;}))),end:Math.max.apply(Math,_toConsumableArray(e.map(function(t){var e;return null!==(e=t.end)&&void 0!==e?e:t.pos;}))),create:ah.create,above:e[0].above,arrow:e.some(function(t){return t.arrow;})};});dh=/*#__PURE__*/function(){function dh(t,e,i,s,r){_classCallCheck(this,dh);this.view=t,this.source=e,this.field=i,this.setHover=s,this.hoverTime=r,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:t.dom,time:0},this.checkHover=this.checkHover.bind(this),t.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),t.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this));}return _createClass(dh,[{key:"update",value:function update(){var _this63=this;this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(function(){return _this63.startHover();},20));}},{key:"active",get:function get(){return this.view.state.field(this.field);}},{key:"checkHover",value:function checkHover(){if(this.hoverTimeout=-1,this.active.length)return;var t=Date.now()-this.lastMove.time;t<this.hoverTime?this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime-t):this.startHover();}},{key:"startHover",value:function startHover(){var _this64=this;clearTimeout(this.restartTimeout);var t=this.view,e=this.lastMove,i=t.docView.nearest(e.target);if(!i)return;var s,r=1;if(i instanceof Ke)s=i.posAtStart;else{if(s=t.posAtCoords(e),null==s)return;var _i133=t.coordsAtPos(s);if(!_i133||e.y<_i133.top||e.y>_i133.bottom||e.x<_i133.left-t.defaultCharacterWidth||e.x>_i133.right+t.defaultCharacterWidth)return;var _n80=t.bidiSpans(t.state.doc.lineAt(s)).find(function(t){return t.from<=s&&t.to>=s;}),_h53=_n80&&_n80.dir==bi.RTL?-1:1;r=e.x<_i133.left?-_h53:_h53;}var n=this.source(t,s,r);if(null==n?void 0:n.then){var _e157=this.pending={pos:s};n.then(function(i){_this64.pending==_e157&&(_this64.pending=null,!i||Array.isArray(i)&&!i.length||t.dispatch({effects:_this64.setHover.of(Array.isArray(i)?i:[i])}));},function(e){return Qi(t.state,e,"hover tooltip");});}else!n||Array.isArray(n)&&!n.length||t.dispatch({effects:this.setHover.of(Array.isArray(n)?n:[n])});}},{key:"tooltip",get:function get(){var t=this.view.plugin(nh),e=t?t.manager.tooltips.findIndex(function(t){return t.create==ah.create;}):-1;return e>-1?t.manager.tooltipViews[e]:null;}},{key:"mousemove",value:function mousemove(t){var e,i;this.lastMove={x:t.clientX,y:t.clientY,target:t.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));var s=this.active,r=this.tooltip;if(s.length&&r&&!function(t,e){var i,_t$getBoundingClientR=t.getBoundingClientRect(),s=_t$getBoundingClientR.left,r=_t$getBoundingClientR.right,n=_t$getBoundingClientR.top,h=_t$getBoundingClientR.bottom;if(i=t.querySelector(".cm-tooltip-arrow")){var _t169=i.getBoundingClientRect();n=Math.min(_t169.top,n),h=Math.max(_t169.bottom,h);}return e.clientX>=s-ph&&e.clientX<=r+ph&&e.clientY>=n-ph&&e.clientY<=h+ph;}(r.dom,t)||this.pending){var _ref16=s[0]||this.pending,_r107=_ref16.pos,_n81=null!==(i=null===(e=s[0])||void 0===e?void 0:e.end)&&void 0!==i?i:_r107;(_r107==_n81?this.view.posAtCoords(this.lastMove)==_r107:function(t,e,i,s,r){var n=t.scrollDOM.getBoundingClientRect(),h=t.documentTop+t.documentPadding.top+t.contentHeight;if(n.left>s||n.right<s||n.top>r||Math.min(n.bottom,h)<r)return!1;var l=t.posAtCoords({x:s,y:r},!1);return l>=e&&l<=i;}(this.view,_r107,_n81,t.clientX,t.clientY))||(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null);}}},{key:"mouseleave",value:function mouseleave(t){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;var e=this.active;if(e.length){var _e158=this.tooltip;_e158&&_e158.dom.contains(t.relatedTarget)?this.watchTooltipLeave(_e158.dom):this.view.dispatch({effects:this.setHover.of([])});}}},{key:"watchTooltipLeave",value:function watchTooltipLeave(t){var _this65=this;var _e159=function e(i){t.removeEventListener("mouseleave",_e159),_this65.active.length&&!_this65.view.dom.contains(i.relatedTarget)&&_this65.view.dispatch({effects:_this65.setHover.of([])});};t.addEventListener("mouseleave",_e159);}},{key:"destroy",value:function destroy(){clearTimeout(this.hoverTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove);}}]);}();ph=4;wh=mt.define(),bh=z.define({combine:function combine(t){var e,i;var _iterator125=_createForOfIteratorHelper(t),_step125;try{for(_iterator125.s();!(_step125=_iterator125.n()).done;){var _s125=_step125.value;e=e||_s125.topContainer,i=i||_s125.bottomContainer;}}catch(err){_iterator125.e(err);}finally{_iterator125.f();}return{topContainer:e,bottomContainer:i};}});kh=is.fromClass(/*#__PURE__*/function(){function _class5(t){_classCallCheck(this,_class5);this.input=t.state.facet(xh),this.specs=this.input.filter(function(t){return t;}),this.panels=this.specs.map(function(e){return e(t);});var e=t.state.facet(bh);this.top=new yh(t,!0,e.topContainer),this.bottom=new yh(t,!1,e.bottomContainer),this.top.sync(this.panels.filter(function(t){return t.top;})),this.bottom.sync(this.panels.filter(function(t){return!t.top;}));var _iterator126=_createForOfIteratorHelper(this.panels),_step126;try{for(_iterator126.s();!(_step126=_iterator126.n()).done;){var _t171=_step126.value;_t171.dom.classList.add("cm-panel"),_t171.mount&&_t171.mount();}}catch(err){_iterator126.e(err);}finally{_iterator126.f();}}return _createClass(_class5,[{key:"update",value:function update(t){var e=t.state.facet(bh);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new yh(t.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new yh(t.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();var i=t.state.facet(xh);if(i!=this.input){var _e162=i.filter(function(t){return t;}),_s126=[],_r109=[],_n82=[],_h54=[];var _iterator127=_createForOfIteratorHelper(_e162),_step127;try{for(_iterator127.s();!(_step127=_iterator127.n()).done;){var _i136=_step127.value;var _e163=void 0,_l49=this.specs.indexOf(_i136);_l49<0?(_e163=_i136(t.view),_h54.push(_e163)):(_e163=this.panels[_l49],_e163.update&&_e163.update(t)),_s126.push(_e163),(_e163.top?_r109:_n82).push(_e163);}}catch(err){_iterator127.e(err);}finally{_iterator127.f();}this.specs=_e162,this.panels=_s126,this.top.sync(_r109),this.bottom.sync(_n82);for(var _i135=0,_h55=_h54;_i135<_h55.length;_i135++){var _t172=_h55[_i135];_t172.dom.classList.add("cm-panel"),_t172.mount&&_t172.mount();}}else{var _iterator128=_createForOfIteratorHelper(this.panels),_step128;try{for(_iterator128.s();!(_step128=_iterator128.n()).done;){var _e164=_step128.value;_e164.update&&_e164.update(t);}}catch(err){_iterator128.e(err);}finally{_iterator128.f();}}}},{key:"destroy",value:function destroy(){this.top.sync([]),this.bottom.sync([]);}}]);}(),{provide:function provide(t){return en.scrollMargins.of(function(e){var i=e.plugin(t);return i&&{top:i.top.scrollMargin(),bottom:i.bottom.scrollMargin()};});}});yh=/*#__PURE__*/function(){function yh(t,e,i){_classCallCheck(this,yh);this.view=t,this.top=e,this.container=i,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses();}return _createClass(yh,[{key:"sync",value:function sync(t){var _iterator129=_createForOfIteratorHelper(this.panels),_step129;try{for(_iterator129.s();!(_step129=_iterator129.n()).done;){var _e165=_step129.value;_e165.destroy&&t.indexOf(_e165)<0&&_e165.destroy();}}catch(err){_iterator129.e(err);}finally{_iterator129.f();}this.panels=t,this.syncDOM();}},{key:"syncDOM",value:function syncDOM(){if(0==this.panels.length)return void(this.dom&&(this.dom.remove(),this.dom=void 0));if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";var _t173=this.container||this.view.dom;_t173.insertBefore(this.dom,this.top?_t173.firstChild:null);}var t=this.dom.firstChild;var _iterator130=_createForOfIteratorHelper(this.panels),_step130;try{for(_iterator130.s();!(_step130=_iterator130.n()).done;){var _e166=_step130.value;if(_e166.dom.parentNode==this.dom){for(;t!=_e166.dom;)t=Mh(t);t=t.nextSibling;}else this.dom.insertBefore(_e166.dom,t);}}catch(err){_iterator130.e(err);}finally{_iterator130.f();}for(;t;)t=Mh(t);}},{key:"scrollMargin",value:function scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top);}},{key:"syncClasses",value:function syncClasses(){if(this.container&&this.classes!=this.view.themeClasses){var _iterator131=_createForOfIteratorHelper(this.classes.split(" ")),_step131;try{for(_iterator131.s();!(_step131=_iterator131.n()).done;){var _t174=_step131.value;_t174&&this.container.classList.remove(_t174);}}catch(err){_iterator131.e(err);}finally{_iterator131.f();}var _iterator132=_createForOfIteratorHelper((this.classes=this.view.themeClasses).split(" ")),_step132;try{for(_iterator132.s();!(_step132=_iterator132.n()).done;){var _t175=_step132.value;_t175&&this.container.classList.add(_t175);}}catch(err){_iterator132.e(err);}finally{_iterator132.f();}}}}]);}();xh=z.define({enables:kh});Sh=/*#__PURE__*/function(_Et2){function Sh(){_classCallCheck(this,Sh);return _callSuper(this,Sh,arguments);}_inherits(Sh,_Et2);return _createClass(Sh,[{key:"compare",value:function compare(t){return this==t||this.constructor==t.constructor&&this.eq(t);}},{key:"eq",value:function eq(t){return!1;}},{key:"destroy",value:function destroy(t){}}]);}(Et);Sh.prototype.elementClass="",Sh.prototype.toDOM=void 0,Sh.prototype.mapMode=C.TrackBefore,Sh.prototype.startSide=Sh.prototype.endSide=-1,Sh.prototype.point=!0;Ah=z.define(),Ch=z.define(),Dh={"class":"",renderEmptyElements:!1,elementStyle:"",markers:function markers(){return Bt.empty;},lineMarker:function lineMarker(){return null;},widgetMarker:function widgetMarker(){return null;},lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{}},Oh=z.define();Ih=z.define({combine:function combine(t){return t.some(function(t){return t;});}});Th=is.fromClass(/*#__PURE__*/function(){function _class6(t){_classCallCheck(this,_class6);this.view=t,this.prevViewport=t.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=t.state.facet(Oh).map(function(e){return new $h(t,e);});var _iterator133=_createForOfIteratorHelper(this.gutters),_step133;try{for(_iterator133.s();!(_step133=_iterator133.n()).done;){var _t176=_step133.value;this.dom.appendChild(_t176.dom);}}catch(err){_iterator133.e(err);}finally{_iterator133.f();}this.fixed=!t.state.facet(Ih),this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),t.scrollDOM.insertBefore(this.dom,t.contentDOM);}return _createClass(_class6,[{key:"update",value:function update(t){if(this.updateGutters(t)){var _e167=this.prevViewport,_i137=t.view.viewport,_s127=Math.min(_e167.to,_i137.to)-Math.max(_e167.from,_i137.from);this.syncGutters(_s127<.8*(_i137.to-_i137.from));}t.geometryChanged&&(this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px"),this.view.state.facet(Ih)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":""),this.prevViewport=t.view.viewport;}},{key:"syncGutters",value:function syncGutters(t){var _this66=this;var e=this.dom.nextSibling;t&&this.dom.remove();var i=Bt.iter(this.view.state.facet(Ah),this.view.viewport.from),s=[],r=this.gutters.map(function(t){return new Nh(t,_this66.view.viewport,-_this66.view.documentPadding.top);});var _iterator134=_createForOfIteratorHelper(this.view.viewportLineBlocks),_step134;try{for(_iterator134.s();!(_step134=_iterator134.n()).done;){var _t177=_step134.value;if(s.length&&(s=[]),Array.isArray(_t177.type)){var _e168=!0;var _iterator136=_createForOfIteratorHelper(_t177.type),_step136;try{for(_iterator136.s();!(_step136=_iterator136.n()).done;){var _n83=_step136.value;if(_n83.type==ni.Text&&_e168){Lh(i,s,_n83.from);var _iterator137=_createForOfIteratorHelper(r),_step137;try{for(_iterator137.s();!(_step137=_iterator137.n()).done;){var _t178=_step137.value;_t178.line(this.view,_n83,s);}}catch(err){_iterator137.e(err);}finally{_iterator137.f();}_e168=!1;}else if(_n83.widget){var _iterator138=_createForOfIteratorHelper(r),_step138;try{for(_iterator138.s();!(_step138=_iterator138.n()).done;){var _t179=_step138.value;_t179.widget(this.view,_n83);}}catch(err){_iterator138.e(err);}finally{_iterator138.f();}}}}catch(err){_iterator136.e(err);}finally{_iterator136.f();}}else if(_t177.type==ni.Text){Lh(i,s,_t177.from);var _iterator139=_createForOfIteratorHelper(r),_step139;try{for(_iterator139.s();!(_step139=_iterator139.n()).done;){var _e169=_step139.value;_e169.line(this.view,_t177,s);}}catch(err){_iterator139.e(err);}finally{_iterator139.f();}}else if(_t177.widget){var _iterator140=_createForOfIteratorHelper(r),_step140;try{for(_iterator140.s();!(_step140=_iterator140.n()).done;){var _e170=_step140.value;_e170.widget(this.view,_t177);}}catch(err){_iterator140.e(err);}finally{_iterator140.f();}}}}catch(err){_iterator134.e(err);}finally{_iterator134.f();}var _iterator135=_createForOfIteratorHelper(r),_step135;try{for(_iterator135.s();!(_step135=_iterator135.n()).done;){var _t180=_step135.value;_t180.finish();}}catch(err){_iterator135.e(err);}finally{_iterator135.f();}t&&this.view.scrollDOM.insertBefore(this.dom,e);}},{key:"updateGutters",value:function updateGutters(t){var e=t.startState.facet(Oh),i=t.state.facet(Oh),s=t.docChanged||t.heightChanged||t.viewportChanged||!Bt.eq(t.startState.facet(Ah),t.state.facet(Ah),t.view.viewport.from,t.view.viewport.to);if(e==i){var _iterator141=_createForOfIteratorHelper(this.gutters),_step141;try{for(_iterator141.s();!(_step141=_iterator141.n()).done;){var _e171=_step141.value;_e171.update(t)&&(s=!0);}}catch(err){_iterator141.e(err);}finally{_iterator141.f();}}else{s=!0;var _r110=[];var _iterator142=_createForOfIteratorHelper(i),_step142;try{for(_iterator142.s();!(_step142=_iterator142.n()).done;){var _s128=_step142.value;var _i139=e.indexOf(_s128);_i139<0?_r110.push(new $h(this.view,_s128)):(this.gutters[_i139].update(t),_r110.push(this.gutters[_i139]));}}catch(err){_iterator142.e(err);}finally{_iterator142.f();}var _iterator143=_createForOfIteratorHelper(this.gutters),_step143;try{for(_iterator143.s();!(_step143=_iterator143.n()).done;){var _t182=_step143.value;_t182.dom.remove(),_r110.indexOf(_t182)<0&&_t182.destroy();}}catch(err){_iterator143.e(err);}finally{_iterator143.f();}for(var _i138=0,_r111=_r110;_i138<_r111.length;_i138++){var _t181=_r111[_i138];this.dom.appendChild(_t181.dom);}this.gutters=_r110;}return s;}},{key:"destroy",value:function destroy(){var _iterator144=_createForOfIteratorHelper(this.gutters),_step144;try{for(_iterator144.s();!(_step144=_iterator144.n()).done;){var _t183=_step144.value;_t183.destroy();}}catch(err){_iterator144.e(err);}finally{_iterator144.f();}this.dom.remove();}}]);}(),{provide:function provide(t){return en.scrollMargins.of(function(e){var i=e.plugin(t);return i&&0!=i.gutters.length&&i.fixed?e.textDirection==bi.LTR?{left:i.dom.offsetWidth*e.scaleX}:{right:i.dom.offsetWidth*e.scaleX}:null;});}});Nh=/*#__PURE__*/function(){function Nh(t,e,i){_classCallCheck(this,Nh);this.gutter=t,this.height=i,this.i=0,this.cursor=Bt.iter(t.markers,e.from);}return _createClass(Nh,[{key:"addElement",value:function addElement(t,e,i){var s=this.gutter,r=(e.top-this.height)/t.scaleY,n=e.height/t.scaleY;if(this.i==s.elements.length){var _e172=new jh(t,n,r,i);s.elements.push(_e172),s.dom.appendChild(_e172.dom);}else s.elements[this.i].update(t,n,r,i);this.height=e.bottom,this.i++;}},{key:"line",value:function line(t,e,i){var s=[];Lh(this.cursor,s,e.from),i.length&&(s=s.concat(i));var r=this.gutter.config.lineMarker(t,e,s);r&&s.unshift(r);var n=this.gutter;(0!=s.length||n.config.renderEmptyElements)&&this.addElement(t,e,s);}},{key:"widget",value:function widget(t,e){var i=this.gutter.config.widgetMarker(t,e.widget,e),s=i?[i]:null;var _iterator145=_createForOfIteratorHelper(t.state.facet(Ch)),_step145;try{for(_iterator145.s();!(_step145=_iterator145.n()).done;){var _i140=_step145.value;var _r112=_i140(t,e.widget,e);_r112&&(s||(s=[])).push(_r112);}}catch(err){_iterator145.e(err);}finally{_iterator145.f();}s&&this.addElement(t,e,s);}},{key:"finish",value:function finish(){var t=this.gutter;for(;t.elements.length>this.i;){var _e173=t.elements.pop();t.dom.removeChild(_e173.dom),_e173.destroy();}}}]);}();$h=/*#__PURE__*/function(){function $h(t,e){var _this67=this;_classCallCheck(this,$h);this.view=t,this.config=e,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config["class"]?" "+this.config["class"]:"");var _loop11=function _loop11(_i141){_this67.dom.addEventListener(_i141,function(s){var r,n=s.target;if(n!=_this67.dom&&_this67.dom.contains(n)){for(;n.parentNode!=_this67.dom;)n=n.parentNode;var _t184=n.getBoundingClientRect();r=(_t184.top+_t184.bottom)/2;}else r=s.clientY;var h=t.lineBlockAtHeight(r-t.documentTop);e.domEventHandlers[_i141](t,h,s)&&s.preventDefault();});};for(var _i141 in e.domEventHandlers){_loop11(_i141);}this.markers=Bh(e.markers(t)),e.initialSpacer&&(this.spacer=new jh(t,0,0,[e.initialSpacer(t)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none");}return _createClass($h,[{key:"update",value:function update(t){var e=this.markers;if(this.markers=Bh(this.config.markers(t.view)),this.spacer&&this.config.updateSpacer){var _e174=this.config.updateSpacer(this.spacer.markers[0],t);_e174!=this.spacer.markers[0]&&this.spacer.update(t.view,0,0,[_e174]);}var i=t.view.viewport;return!Bt.eq(this.markers,e,i.from,i.to)||!!this.config.lineMarkerChange&&this.config.lineMarkerChange(t);}},{key:"destroy",value:function destroy(){var _iterator146=_createForOfIteratorHelper(this.elements),_step146;try{for(_iterator146.s();!(_step146=_iterator146.n()).done;){var _t185=_step146.value;_t185.destroy();}}catch(err){_iterator146.e(err);}finally{_iterator146.f();}}}]);}();jh=/*#__PURE__*/function(){function jh(t,e,i,s){_classCallCheck(this,jh);this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(t,e,i,s);}return _createClass(jh,[{key:"update",value:function update(t,e,i,s){this.height!=e&&(this.height=e,this.dom.style.height=e+"px"),this.above!=i&&(this.dom.style.marginTop=(this.above=i)?i+"px":""),function(t,e){if(t.length!=e.length)return!1;for(var _i142=0;_i142<t.length;_i142++)if(!t[_i142].compare(e[_i142]))return!1;return!0;}(this.markers,s)||this.setMarkers(t,s);}},{key:"setMarkers",value:function setMarkers(t,e){var i="cm-gutterElement",s=this.dom.firstChild;for(var _r113=0,_n84=0;;){var _h56=_n84,_l50=_r113<e.length?e[_r113++]:null,_o33=!1;if(_l50){var _t186=_l50.elementClass;_t186&&(i+=" "+_t186);for(var _t187=_n84;_t187<this.markers.length;_t187++)if(this.markers[_t187].compare(_l50)){_h56=_t187,_o33=!0;break;}}else _h56=this.markers.length;for(;_n84<_h56;){var _t188=this.markers[_n84++];if(_t188.toDOM){_t188.destroy(s);var _e175=s.nextSibling;s.remove(),s=_e175;}}if(!_l50)break;_l50.toDOM&&(_o33?s=s.nextSibling:this.dom.insertBefore(_l50.toDOM(t),s)),_o33&&_n84++;}this.dom.className=i,this.markers=e;}},{key:"destroy",value:function destroy(){this.setMarkers(null,[]);}}]);}();Ph=z.define(),zh=z.define(),Hh=z.define({combine:function combine(t){return Ot(t,{formatNumber:String,domEventHandlers:{}},{domEventHandlers:function domEventHandlers(t,e){var i=Object.assign({},t);var _loop12=function _loop12(){var s=i[_t189],r=e[_t189];i[_t189]=s?function(t,e,i){return s(t,e,i)||r(t,e,i);}:r;};for(var _t189 in e){_loop12();}return i;}});}});Fh=/*#__PURE__*/function(_Sh){function Fh(t){var _this68;_classCallCheck(this,Fh);_this68=_callSuper(this,Fh),_this68.number=t;return _this68;}_inherits(Fh,_Sh);return _createClass(Fh,[{key:"eq",value:function eq(t){return this.number==t.number;}},{key:"toDOM",value:function toDOM(){return document.createTextNode(this.number);}}]);}(Sh);Vh=Oh.compute([Hh],function(t){return{"class":"cm-lineNumbers",renderEmptyElements:!1,markers:function markers(t){return t.state.facet(Ph);},lineMarker:function lineMarker(t,e,i){return i.some(function(t){return t.toDOM;})?null:new Fh(Wh(t,t.state.doc.lineAt(e.from).number));},widgetMarker:function widgetMarker(t,e,i){var _iterator147=_createForOfIteratorHelper(t.state.facet(zh)),_step147;try{for(_iterator147.s();!(_step147=_iterator147.n()).done;){var _s129=_step147.value;var _r114=_s129(t,e,i);if(_r114)return _r114;}}catch(err){_iterator147.e(err);}finally{_iterator147.f();}return null;},lineMarkerChange:function lineMarkerChange(t){return t.startState.facet(Hh)!=t.state.facet(Hh);},initialSpacer:function initialSpacer(t){return new Fh(Wh(t,Uh(t.state.doc.lines)));},updateSpacer:function updateSpacer(t,e){var i=Wh(e.view,Uh(e.view.state.doc.lines));return i==t.number?t:new Fh(i);},domEventHandlers:t.facet(Hh).domEventHandlers};});Jh=new(/*#__PURE__*/function(_Sh2){function _class7(){var _this69;_classCallCheck(this,_class7);_this69=_callSuper(this,_class7,arguments),_this69.elementClass="cm-activeLineGutter";return _this69;}_inherits(_class7,_Sh2);return _createClass(_class7);}(Sh))(),Gh=Ah.compute(["selection"],function(t){var e=[],i=-1;var _iterator148=_createForOfIteratorHelper(t.selection.ranges),_step148;try{for(_iterator148.s();!(_step148=_iterator148.n()).done;){var _s130=_step148.value;var _r115=t.doc.lineAt(_s130.head).from;_r115>i&&(i=_r115,e.push(Jh.range(_r115)));}}catch(err){_iterator148.e(err);}finally{_iterator148.f();}return Bt.of(e);});_export("D",Kh=1024);_h=0;Xh=/*#__PURE__*/_createClass(function Xh(t,e){_classCallCheck(this,Xh);this.from=t,this.to=e;});_export("b",Yh=/*#__PURE__*/function(){function Yh(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,Yh);this.id=_h++,this.perNode=!!t.perNode,this.deserialize=t.deserialize||function(){throw new Error("This node type doesn't define a deserialize function");};}return _createClass(Yh,[{key:"add",value:function add(t){var _this70=this;if(this.perNode)throw new RangeError("Can't add per-node props to node types");return"function"!=typeof t&&(t=tl.match(t)),function(e){var i=t(e);return void 0===i?null:[_this70,i];};}}]);}());Yh.closedBy=new Yh({deserialize:function deserialize(t){return t.split(" ");}}),Yh.openedBy=new Yh({deserialize:function deserialize(t){return t.split(" ");}}),Yh.group=new Yh({deserialize:function deserialize(t){return t.split(" ");}}),Yh.isolate=new Yh({deserialize:function deserialize(t){if(t&&"rtl"!=t&&"ltr"!=t&&"auto"!=t)throw new RangeError("Invalid value for isolate: "+t);return t||"auto";}}),Yh.contextHash=new Yh({perNode:!0}),Yh.lookAhead=new Yh({perNode:!0}),Yh.mounted=new Yh({perNode:!0});Qh=/*#__PURE__*/function(){function Qh(t,e,i){_classCallCheck(this,Qh);this.tree=t,this.overlay=e,this.parser=i;}return _createClass(Qh,null,[{key:"get",value:function get(t){return t&&t.props&&t.props[Yh.mounted.id];}}]);}();Zh=Object.create(null);_export("a",tl=/*#__PURE__*/function(){function tl(t,e,i){var s=arguments.length>3&&arguments[3]!==undefined?arguments[3]:0;_classCallCheck(this,tl);this.name=t,this.props=e,this.id=i,this.flags=s;}return _createClass(tl,[{key:"prop",value:function prop(t){return this.props[t.id];}},{key:"isTop",get:function get(){return(1&this.flags)>0;}},{key:"isSkipped",get:function get(){return(2&this.flags)>0;}},{key:"isError",get:function get(){return(4&this.flags)>0;}},{key:"isAnonymous",get:function get(){return(8&this.flags)>0;}},{key:"is",value:function is(t){if("string"==typeof t){if(this.name==t)return!0;var _e176=this.prop(Yh.group);return!!_e176&&_e176.indexOf(t)>-1;}return this.id==t;}}],[{key:"define",value:function define(t){var e=t.props&&t.props.length?Object.create(null):Zh,i=(t.top?1:0)|(t.skipped?2:0)|(t.error?4:0)|(null==t.name?8:0),s=new tl(t.name||"",e,t.id,i);if(t.props){var _iterator149=_createForOfIteratorHelper(t.props),_step149;try{for(_iterator149.s();!(_step149=_iterator149.n()).done;){var _i143=_step149.value;if(Array.isArray(_i143)||(_i143=_i143(s)),_i143){if(_i143[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");e[_i143[0].id]=_i143[1];}}}catch(err){_iterator149.e(err);}finally{_iterator149.f();}}return s;}},{key:"match",value:function match(t){var e=Object.create(null);for(var _i144 in t){var _iterator150=_createForOfIteratorHelper(_i144.split(" ")),_step150;try{for(_iterator150.s();!(_step150=_iterator150.n()).done;){var _s131=_step150.value;e[_s131]=t[_i144];}}catch(err){_iterator150.e(err);}finally{_iterator150.f();}}return function(t){for(var _i145=t.prop(Yh.group),_s132=-1;_s132<(_i145?_i145.length:0);_s132++){var _r116=e[_s132<0?t.name:_i145[_s132]];if(_r116)return _r116;}};}}]);}());tl.none=new tl("",Object.create(null),0,8);_export("N",el=/*#__PURE__*/function(){function el(t){_classCallCheck(this,el);this.types=t;for(var _e177=0;_e177<t.length;_e177++)if(t[_e177].id!=_e177)throw new RangeError("Node type ids should correspond to array positions when creating a node set");}return _createClass(el,[{key:"extend",value:function extend(){var e=[];for(var _len4=arguments.length,t=new Array(_len4),_key4=0;_key4<_len4;_key4++){t[_key4]=arguments[_key4];}var _iterator151=_createForOfIteratorHelper(this.types),_step151;try{for(_iterator151.s();!(_step151=_iterator151.n()).done;){var _i146=_step151.value;var _s133=null;var _iterator152=_createForOfIteratorHelper(t),_step152;try{for(_iterator152.s();!(_step152=_iterator152.n()).done;){var _e178=_step152.value;var _t190=_e178(_i146);_t190&&(_s133||(_s133=Object.assign({},_i146.props)),_s133[_t190[0].id]=_t190[1]);}}catch(err){_iterator152.e(err);}finally{_iterator152.f();}e.push(_s133?new tl(_i146.name,_s133,_i146.id,_i146.flags):_i146);}}catch(err){_iterator151.e(err);}finally{_iterator151.f();}return new el(e);}}]);}());il=new WeakMap(),sl=new WeakMap();!function(t){t[t.ExcludeBuffers=1]="ExcludeBuffers",t[t.IncludeAnonymous=2]="IncludeAnonymous",t[t.IgnoreMounts=4]="IgnoreMounts",t[t.IgnoreOverlays=8]="IgnoreOverlays";}(rl||_export("I",rl={}));_export("T",nl=/*#__PURE__*/function(){function nl(t,e,i,s,r){_classCallCheck(this,nl);if(this.type=t,this.children=e,this.positions=i,this.length=s,this.props=null,r&&r.length){this.props=Object.create(null);var _iterator153=_createForOfIteratorHelper(r),_step153;try{for(_iterator153.s();!(_step153=_iterator153.n()).done;){var _step153$value=_slicedToArray(_step153.value,2),_t191=_step153$value[0],_e179=_step153$value[1];this.props["number"==typeof _t191?_t191:_t191.id]=_e179;}}catch(err){_iterator153.e(err);}finally{_iterator153.f();}}}return _createClass(nl,[{key:"toString",value:function toString(){var t=Qh.get(this);if(t&&!t.overlay)return t.tree.toString();var e="";var _iterator154=_createForOfIteratorHelper(this.children),_step154;try{for(_iterator154.s();!(_step154=_iterator154.n()).done;){var _t192=_step154.value;var _i147=_t192.toString();_i147&&(e&&(e+=","),e+=_i147);}}catch(err){_iterator154.e(err);}finally{_iterator154.f();}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(e.length?"("+e+")":""):e;}},{key:"cursor",value:function cursor(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return new bl(this.topNode,t);}},{key:"cursorAt",value:function cursorAt(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;var s=il.get(this)||this.topNode,r=new bl(s);return r.moveTo(t,e),il.set(this,r._tree),r;}},{key:"topNode",get:function get(){return new al(this,0,0,null);}},{key:"resolve",value:function resolve(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var i=ul(il.get(this)||this.topNode,t,e,!1);return il.set(this,i),i;}},{key:"resolveInner",value:function resolveInner(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var i=ul(sl.get(this)||this.topNode,t,e,!0);return sl.set(this,i),i;}},{key:"resolveStack",value:function resolveStack(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;return function(t,e,i){var s=t.resolveInner(e,i),r=null;for(var _t193=s instanceof al?s:s.context.parent;_t193;_t193=_t193.parent)if(_t193.index<0){var _n85=_t193.parent;(r||(r=[s])).push(_n85.resolve(e,i)),_t193=_n85;}else{var _n86=Qh.get(_t193.tree);if(_n86&&_n86.overlay&&_n86.overlay[0].from<=e&&_n86.overlay[_n86.overlay.length-1].to>=e){var _h57=new al(_n86.tree,_n86.overlay[0].from+_t193.from,-1,_t193);(r||(r=[s])).push(ul(_h57,e,i,!1));}}return r?gl(r):s;}(this,t,e);}},{key:"iterate",value:function iterate(t){var e=t.enter,i=t.leave,_t$from=t.from,s=_t$from===void 0?0:_t$from,_t$to=t.to,r=_t$to===void 0?this.length:_t$to,n=t.mode||0,h=(n&rl.IncludeAnonymous)>0;for(var _t194=this.cursor(n|rl.IncludeAnonymous);;){var _n87=!1;if(_t194.from<=r&&_t194.to>=s&&(!h&&_t194.type.isAnonymous||!1!==e(_t194))){if(_t194.firstChild())continue;_n87=!0;}for(;_n87&&i&&(h||!_t194.type.isAnonymous)&&i(_t194),!_t194.nextSibling();){if(!_t194.parent())return;_n87=!0;}}}},{key:"prop",value:function prop(t){return t.perNode?this.props?this.props[t.id]:void 0:this.type.prop(t);}},{key:"propValues",get:function get(){var t=[];if(this.props)for(var _e180 in this.props)t.push([+_e180,this.props[_e180]]);return t;}},{key:"balance",value:function balance(){var _this71=this;var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return this.children.length<=8?this:Ml(tl.none,this.children,this.positions,0,this.children.length,0,this.length,function(t,e,i){return new nl(_this71.type,t,e,i,_this71.propValues);},t.makeTree||function(t,e,i){return new nl(tl.none,t,e,i);});}}],[{key:"build",value:function build(t){return function(t){var e;var i=t.buffer,s=t.nodeSet,_t$maxBufferLength=t.maxBufferLength,r=_t$maxBufferLength===void 0?Kh:_t$maxBufferLength,_t$reused=t.reused,n=_t$reused===void 0?[]:_t$reused,_t$minRepeatType=t.minRepeatType,h=_t$minRepeatType===void 0?s.types.length:_t$minRepeatType,l=Array.isArray(i)?new hl(i,i.length):i,o=s.types,u=0,f=0;function a(t,e,i,b,v,k){var y=l.id,M=l.start,x=l.end,S=l.size,A=f,C=u;for(;S<0;){if(l.next(),-1==S){var _e181=n[y];return i.push(_e181),void b.push(M-t);}if(-3==S)return void(u=y);if(-4==S)return void(f=y);throw new RangeError("Unrecognized record size: ".concat(S));}var D,O,E=o[y],I=M-t;if(x-M<=r&&(O=g(l.pos-e,v))){var _e182=new Uint16Array(O.size-O.skip),_i148=l.pos-O.size,_r117=_e182.length;for(;l.pos>_i148;)_r117=w(O.start,_e182,_r117);D=new ll(_e182,x-O.start,s),I=O.start-t;}else{var _t195=l.pos-S;l.next();var _e183=[],_i149=[],_s134=y>=h?y:-1,_n88=0,_o34=x;for(;l.pos>_t195;)_s134>=0&&l.id==_s134&&l.size>=0?(l.end<=_o34-r&&(p(_e183,_i149,M,_n88,l.end,_o34,_s134,A,C),_n88=_e183.length,_o34=l.end),l.next()):k>2500?c(M,_t195,_e183,_i149):a(M,_t195,_e183,_i149,_s134,k+1);if(_s134>=0&&_n88>0&&_n88<_e183.length&&p(_e183,_i149,M,_n88,M,_o34,_s134,A,C),_e183.reverse(),_i149.reverse(),_s134>-1&&_n88>0){var _t196=d(E,C);D=Ml(E,_e183,_i149,0,_e183.length,0,x-M,_t196,_t196);}else D=m(E,_e183,_i149,x-M,A-x,C);}i.push(D),b.push(I);}function c(t,e,i,n){var h=[],o=0,u=-1;for(;l.pos>e;){var _t197=l.id,_e184=l.start,_i150=l.end,_s135=l.size;if(_s135>4)l.next();else{if(u>-1&&_e184<u)break;u<0&&(u=_i150-r),h.push(_t197,_e184,_i150),o++,l.next();}}if(o){var _e185=new Uint16Array(4*o),_r118=h[h.length-2];for(var _t198=h.length-3,_i151=0;_t198>=0;_t198-=3)_e185[_i151++]=h[_t198],_e185[_i151++]=h[_t198+1]-_r118,_e185[_i151++]=h[_t198+2]-_r118,_e185[_i151++]=_i151;i.push(new ll(_e185,h[2]-_r118,s)),n.push(_r118-t);}}function d(t,e){return function(i,s,r){var n,h,l=0,o=i.length-1;if(o>=0&&(n=i[o])instanceof nl){if(!o&&n.type==t&&n.length==r)return n;(h=n.prop(Yh.lookAhead))&&(l=s[o]+n.length+h);}return m(t,i,s,r,l,e);};}function p(t,e,i,r,n,h,l,o,u){var f=[],a=[];for(;t.length>r;)f.push(t.pop()),a.push(e.pop()+i-n);t.push(m(s.types[l],f,a,h-n,o-h,u)),e.push(n-i);}function m(t,e,i,s,r,n,h){if(n){var _t199=[Yh.contextHash,n];h=h?[_t199].concat(h):[_t199];}if(r>25){var _t200=[Yh.lookAhead,r];h=h?[_t200].concat(h):[_t200];}return new nl(t,e,i,s,h);}function g(t,e){var i=l.fork(),s=0,n=0,o=0,u=i.end-r,f={size:0,start:0,skip:0};t:for(var _r119=i.pos-t;i.pos>_r119;){var _t201=i.size;if(i.id==e&&_t201>=0){f.size=s,f.start=n,f.skip=o,o+=4,s+=4,i.next();continue;}var _l51=i.pos-_t201;if(_t201<0||_l51<_r119||i.start<u)break;var _a16=i.id>=h?4:0,_c14=i.start;for(i.next();i.pos>_l51;){if(i.size<0){if(-3!=i.size)break t;_a16+=4;}else i.id>=h&&(_a16+=4);i.next();}n=_c14,s+=_t201,o+=_a16;}return(e<0||s==t)&&(f.size=s,f.start=n,f.skip=o),f.size>4?f:void 0;}function w(t,e,i){var s=l.id,r=l.start,n=l.end,o=l.size;if(l.next(),o>=0&&s<h){var _h58=i;if(o>4){var _s136=l.pos-(o-4);for(;l.pos>_s136;)i=w(t,e,i);}e[--i]=_h58,e[--i]=n-t,e[--i]=r-t,e[--i]=s;}else-3==o?u=s:-4==o&&(f=s);return i;}var b=[],v=[];for(;l.pos>0;)a(t.start||0,t.bufferStart||0,b,v,-1,0);var k=null!==(e=t.length)&&void 0!==e?e:b.length?v[0]+b[0].length:0;return new nl(o[t.topID],b.reverse(),v.reverse(),k);}(t);}}]);}());nl.empty=new nl(tl.none,[],[],0);hl=/*#__PURE__*/function(){function hl(t,e){_classCallCheck(this,hl);this.buffer=t,this.index=e;}return _createClass(hl,[{key:"id",get:function get(){return this.buffer[this.index-4];}},{key:"start",get:function get(){return this.buffer[this.index-3];}},{key:"end",get:function get(){return this.buffer[this.index-2];}},{key:"size",get:function get(){return this.buffer[this.index-1];}},{key:"pos",get:function get(){return this.index;}},{key:"next",value:function next(){this.index-=4;}},{key:"fork",value:function fork(){return new hl(this.buffer,this.index);}}]);}();ll=/*#__PURE__*/function(){function ll(t,e,i){_classCallCheck(this,ll);this.buffer=t,this.length=e,this.set=i;}return _createClass(ll,[{key:"type",get:function get(){return tl.none;}},{key:"toString",value:function toString(){var t=[];for(var _e186=0;_e186<this.buffer.length;)t.push(this.childString(_e186)),_e186=this.buffer[_e186+3];return t.join(",");}},{key:"childString",value:function childString(t){var e=this.buffer[t],i=this.buffer[t+3],s=this.set.types[e],r=s.name;if(/\W/.test(r)&&!s.isError&&(r=JSON.stringify(r)),i==(t+=4))return r;var n=[];for(;t<i;)n.push(this.childString(t)),t=this.buffer[t+3];return r+"("+n.join(",")+")";}},{key:"findChild",value:function findChild(t,e,i,s,r){var n=this.buffer,h=-1;for(var _l52=t;_l52!=e&&!(ol(r,s,n[_l52+1],n[_l52+2])&&(h=_l52,i>0));_l52=n[_l52+3]);return h;}},{key:"slice",value:function slice(t,e,i){var s=this.buffer,r=new Uint16Array(e-t),n=0;for(var _h59=t,_l53=0;_h59<e;){r[_l53++]=s[_h59++],r[_l53++]=s[_h59++]-i;var _e187=r[_l53++]=s[_h59++]-i;r[_l53++]=s[_h59++]-t,n=Math.max(n,_e187);}return new ll(r,n,this.set);}}]);}();fl=/*#__PURE__*/function(){function fl(){_classCallCheck(this,fl);}return _createClass(fl,[{key:"cursor",value:function cursor(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return new bl(this,t);}},{key:"getChild",value:function getChild(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:null;var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:null;var s=cl(this,t,e,i);return s.length?s[0]:null;}},{key:"getChildren",value:function getChildren(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:null;var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:null;return cl(this,t,e,i);}},{key:"resolve",value:function resolve(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;return ul(this,t,e,!1);}},{key:"resolveInner",value:function resolveInner(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;return ul(this,t,e,!0);}},{key:"matchContext",value:function matchContext(t){return dl(this.parent,t);}},{key:"enterUnfinishedNodesBefore",value:function enterUnfinishedNodesBefore(t){var e=this.childBefore(t),i=this;for(;e;){var _t202=e.lastChild;if(!_t202||_t202.to!=e.to)break;_t202.type.isError&&_t202.from==_t202.to?(i=e,e=_t202.prevSibling):e=_t202;}return i;}},{key:"node",get:function get(){return this;}},{key:"next",get:function get(){return this.parent;}}]);}();al=/*#__PURE__*/function(_fl){function al(t,e,i,s){var _this72;_classCallCheck(this,al);_this72=_callSuper(this,al),_this72._tree=t,_this72.from=e,_this72.index=i,_this72._parent=s;return _this72;}_inherits(al,_fl);return _createClass(al,[{key:"type",get:function get(){return this._tree.type;}},{key:"name",get:function get(){return this._tree.type.name;}},{key:"to",get:function get(){return this.from+this._tree.length;}},{key:"nextChild",value:function nextChild(t,e,i,s){var r=arguments.length>4&&arguments[4]!==undefined?arguments[4]:0;for(var _n89=this;;){for(var _n89$_tree=_n89._tree,_h61=_n89$_tree.children,_l54=_n89$_tree.positions,_o35=e>0?_h61.length:-1;t!=_o35;t+=e){var _o36=_h61[t],_u27=_l54[t]+_n89.from;if(ol(s,i,_u27,_u27+_o36.length))if(_o36 instanceof ll){if(r&rl.ExcludeBuffers)continue;var _h62=_o36.findChild(0,_o36.buffer.length,e,i-_u27,s);if(_h62>-1)return new ml(new pl(_n89,_o36,t,_u27),null,_h62);}else if(r&rl.IncludeAnonymous||!_o36.type.isAnonymous||vl(_o36)){var _h63=void 0;if(!(r&rl.IgnoreMounts)&&(_h63=Qh.get(_o36))&&!_h63.overlay)return new al(_h63.tree,_u27,t,_n89);var _l55=new al(_o36,_u27,t,_n89);return r&rl.IncludeAnonymous||!_l55.type.isAnonymous?_l55:_l55.nextChild(e<0?_o36.children.length-1:0,e,i,s);}}if(r&rl.IncludeAnonymous||!_n89.type.isAnonymous)return null;if(t=_n89.index>=0?_n89.index+e:e<0?-1:_n89._parent._tree.children.length,_n89=_n89._parent,!_n89)return null;}}},{key:"firstChild",get:function get(){return this.nextChild(0,1,0,4);}},{key:"lastChild",get:function get(){return this.nextChild(this._tree.children.length-1,-1,0,4);}},{key:"childAfter",value:function childAfter(t){return this.nextChild(0,1,t,2);}},{key:"childBefore",value:function childBefore(t){return this.nextChild(this._tree.children.length-1,-1,t,-2);}},{key:"enter",value:function enter(t,e){var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;var s;if(!(i&rl.IgnoreOverlays)&&(s=Qh.get(this._tree))&&s.overlay){var _i152=t-this.from;var _iterator155=_createForOfIteratorHelper(s.overlay),_step155;try{for(_iterator155.s();!(_step155=_iterator155.n()).done;){var _step155$value=_step155.value,_t203=_step155$value.from,_r120=_step155$value.to;if((e>0?_t203<=_i152:_t203<_i152)&&(e<0?_r120>=_i152:_r120>_i152))return new al(s.tree,s.overlay[0].from+this.from,-1,this);}}catch(err){_iterator155.e(err);}finally{_iterator155.f();}}return this.nextChild(0,1,t,e,i);}},{key:"nextSignificantParent",value:function nextSignificantParent(){var t=this;for(;t.type.isAnonymous&&t._parent;)t=t._parent;return t;}},{key:"parent",get:function get(){return this._parent?this._parent.nextSignificantParent():null;}},{key:"nextSibling",get:function get(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null;}},{key:"prevSibling",get:function get(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null;}},{key:"tree",get:function get(){return this._tree;}},{key:"toTree",value:function toTree(){return this._tree;}},{key:"toString",value:function toString(){return this._tree.toString();}}]);}(fl);pl=/*#__PURE__*/_createClass(function pl(t,e,i,s){_classCallCheck(this,pl);this.parent=t,this.buffer=e,this.index=i,this.start=s;});ml=/*#__PURE__*/function(_fl2){function ml(t,e,i){var _this73;_classCallCheck(this,ml);_this73=_callSuper(this,ml),_this73.context=t,_this73._parent=e,_this73.index=i,_this73.type=t.buffer.set.types[t.buffer.buffer[i]];return _this73;}_inherits(ml,_fl2);return _createClass(ml,[{key:"name",get:function get(){return this.type.name;}},{key:"from",get:function get(){return this.context.start+this.context.buffer.buffer[this.index+1];}},{key:"to",get:function get(){return this.context.start+this.context.buffer.buffer[this.index+2];}},{key:"child",value:function child(t,e,i){var s=this.context.buffer,r=s.findChild(this.index+4,s.buffer[this.index+3],t,e-this.context.start,i);return r<0?null:new ml(this.context,this,r);}},{key:"firstChild",get:function get(){return this.child(1,0,4);}},{key:"lastChild",get:function get(){return this.child(-1,0,4);}},{key:"childAfter",value:function childAfter(t){return this.child(1,t,2);}},{key:"childBefore",value:function childBefore(t){return this.child(-1,t,-2);}},{key:"enter",value:function enter(t,e){var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;if(i&rl.ExcludeBuffers)return null;var s=this.context.buffer,r=s.findChild(this.index+4,s.buffer[this.index+3],e>0?1:-1,t-this.context.start,e);return r<0?null:new ml(this.context,this,r);}},{key:"parent",get:function get(){return this._parent||this.context.parent.nextSignificantParent();}},{key:"externalSibling",value:function externalSibling(t){return this._parent?null:this.context.parent.nextChild(this.context.index+t,t,0,4);}},{key:"nextSibling",get:function get(){var t=this.context.buffer,e=t.buffer[this.index+3];return e<(this._parent?t.buffer[this._parent.index+3]:t.buffer.length)?new ml(this.context,this._parent,e):this.externalSibling(1);}},{key:"prevSibling",get:function get(){var t=this.context.buffer,e=this._parent?this._parent.index+4:0;return this.index==e?this.externalSibling(-1):new ml(this.context,this._parent,t.findChild(e,this.index,-1,0,4));}},{key:"tree",get:function get(){return null;}},{key:"toTree",value:function toTree(){var t=[],e=[],i=this.context.buffer,s=this.index+4,r=i.buffer[this.index+3];if(r>s){var _n90=i.buffer[this.index+1];t.push(i.slice(s,r,_n90)),e.push(0);}return new nl(this.type,t,e,this.to-this.from);}},{key:"toString",value:function toString(){return this.context.buffer.childString(this.index);}}]);}(fl);wl=/*#__PURE__*/function(){function wl(t,e){_classCallCheck(this,wl);this.heads=t,this.node=e;}return _createClass(wl,[{key:"next",get:function get(){return gl(this.heads);}}]);}();bl=/*#__PURE__*/function(){function bl(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;_classCallCheck(this,bl);if(this.mode=e,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,t instanceof al)this.yieldNode(t);else{this._tree=t.context.parent,this.buffer=t.context;for(var _e189=t._parent;_e189;_e189=_e189._parent)this.stack.unshift(_e189.index);this.bufferNode=t,this.yieldBuf(t.index);}}return _createClass(bl,[{key:"name",get:function get(){return this.type.name;}},{key:"yieldNode",value:function yieldNode(t){return!!t&&(this._tree=t,this.type=t.type,this.from=t.from,this.to=t.to,!0);}},{key:"yieldBuf",value:function yieldBuf(t,e){this.index=t;var _this$buffer=this.buffer,i=_this$buffer.start,s=_this$buffer.buffer;return this.type=e||s.set.types[s.buffer[t]],this.from=i+s.buffer[t+1],this.to=i+s.buffer[t+2],!0;}},{key:"yield",value:function _yield(t){return!!t&&(t instanceof al?(this.buffer=null,this.yieldNode(t)):(this.buffer=t.context,this.yieldBuf(t.index,t.type)));}},{key:"toString",value:function toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString();}},{key:"enterChild",value:function enterChild(t,e,i){if(!this.buffer)return this["yield"](this._tree.nextChild(t<0?this._tree._tree.children.length-1:0,t,e,i,this.mode));var s=this.buffer.buffer,r=s.findChild(this.index+4,s.buffer[this.index+3],t,e-this.buffer.start,i);return!(r<0)&&(this.stack.push(this.index),this.yieldBuf(r));}},{key:"firstChild",value:function firstChild(){return this.enterChild(1,0,4);}},{key:"lastChild",value:function lastChild(){return this.enterChild(-1,0,4);}},{key:"childAfter",value:function childAfter(t){return this.enterChild(1,t,2);}},{key:"childBefore",value:function childBefore(t){return this.enterChild(-1,t,-2);}},{key:"enter",value:function enter(t,e){var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:this.mode;return this.buffer?!(i&rl.ExcludeBuffers)&&this.enterChild(1,t,e):this["yield"](this._tree.enter(t,e,i));}},{key:"parent",value:function parent(){if(!this.buffer)return this.yieldNode(this.mode&rl.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());var t=this.mode&rl.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(t);}},{key:"sibling",value:function sibling(t){if(!this.buffer)return!!this._tree._parent&&this["yield"](this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+t,t,0,4,this.mode));var e=this.buffer.buffer,i=this.stack.length-1;if(t<0){var _t205=i<0?0:this.stack[i]+4;if(this.index!=_t205)return this.yieldBuf(e.findChild(_t205,this.index,-1,0,4));}else{var _t206=e.buffer[this.index+3];if(_t206<(i<0?e.buffer.length:e.buffer[this.stack[i]+3]))return this.yieldBuf(_t206);}return i<0&&this["yield"](this.buffer.parent.nextChild(this.buffer.index+t,t,0,4,this.mode));}},{key:"nextSibling",value:function nextSibling(){return this.sibling(1);}},{key:"prevSibling",value:function prevSibling(){return this.sibling(-1);}},{key:"atLastNode",value:function atLastNode(t){var e,i,s=this.buffer;if(s){if(t>0){if(this.index<s.buffer.buffer.length)return!1;}else for(var _t207=0;_t207<this.index;_t207++)if(s.buffer.buffer[_t207+3]<this.index)return!1;e=s.index;i=s.parent;}else{var _this$_tree=this._tree;e=_this$_tree.index;i=_this$_tree._parent;}for(;i;_i153=i,e=_i153.index,i=_i153._parent,_i153){var _i153;if(e>-1)for(var _s141=e+t,_r122=t<0?-1:i._tree.children.length;_s141!=_r122;_s141+=t){var _t208=i._tree.children[_s141];if(this.mode&rl.IncludeAnonymous||_t208 instanceof ll||!_t208.type.isAnonymous||vl(_t208))return!1;}}return!0;}},{key:"move",value:function move(t,e){if(e&&this.enterChild(t,0,4))return!0;for(;;){if(this.sibling(t))return!0;if(this.atLastNode(t)||!this.parent())return!1;}}},{key:"next",value:function next(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:!0;return this.move(1,t);}},{key:"prev",value:function prev(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:!0;return this.move(-1,t);}},{key:"moveTo",value:function moveTo(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;for(;(this.from==this.to||(e<1?this.from>=t:this.from>t)||(e>-1?this.to<=t:this.to<t))&&this.parent(););for(;this.enterChild(1,t,e););return this;}},{key:"node",get:function get(){if(!this.buffer)return this._tree;var t=this.bufferNode,e=null,i=0;if(t&&t.context==this.buffer)t:for(var _s142=this.index,_r123=this.stack.length;_r123>=0;){for(var _n91=t;_n91;_n91=_n91._parent)if(_n91.index==_s142){if(_s142==this.index)return _n91;e=_n91,i=_r123+1;break t;}_s142=this.stack[--_r123];}for(var _t209=i;_t209<this.stack.length;_t209++)e=new ml(this.buffer,e,this.stack[_t209]);return this.bufferNode=new ml(this.buffer,e,this.index);}},{key:"tree",get:function get(){return this.buffer?null:this._tree._tree;}},{key:"iterate",value:function iterate(t,e){for(var _i154=0;;){var _s143=!1;if(this.type.isAnonymous||!1!==t(this)){if(this.firstChild()){_i154++;continue;}this.type.isAnonymous||(_s143=!0);}for(;;){if(_s143&&e&&e(this),_s143=this.type.isAnonymous,!_i154)return;if(this.nextSibling())break;this.parent(),_i154--,_s143=!0;}}}},{key:"matchContext",value:function matchContext(t){if(!this.buffer)return dl(this.node.parent,t);var e=this.buffer.buffer,i=e.set.types;for(var _s144=t.length-1,_r124=this.stack.length-1;_s144>=0;_r124--){if(_r124<0)return dl(this._tree,t,_s144);var _n92=i[e.buffer[this.stack[_r124]]];if(!_n92.isAnonymous){if(t[_s144]&&t[_s144]!=_n92.name)return!1;_s144--;}}return!0;}}]);}();kl=new WeakMap();_export("q",xl=/*#__PURE__*/function(){function xl(){_classCallCheck(this,xl);this.map=new WeakMap();}return _createClass(xl,[{key:"setBuffer",value:function setBuffer(t,e,i){var s=this.map.get(t);s||this.map.set(t,s=new Map()),s.set(e,i);}},{key:"getBuffer",value:function getBuffer(t,e){var i=this.map.get(t);return i&&i.get(e);}},{key:"set",value:function set(t,e){t instanceof ml?this.setBuffer(t.context.buffer,t.index,e):t instanceof al&&this.map.set(t.tree,e);}},{key:"get",value:function get(t){return t instanceof ml?this.getBuffer(t.context.buffer,t.index):t instanceof al?this.map.get(t.tree):void 0;}},{key:"cursorSet",value:function cursorSet(t,e){t.buffer?this.setBuffer(t.buffer.buffer,t.index,e):this.map.set(t.tree,e);}},{key:"cursorGet",value:function cursorGet(t){return t.buffer?this.getBuffer(t.buffer.buffer,t.index):this.map.get(t.tree);}}]);}());Sl=/*#__PURE__*/function(){function Sl(t,e,i,s){var r=arguments.length>4&&arguments[4]!==undefined?arguments[4]:!1;var n=arguments.length>5&&arguments[5]!==undefined?arguments[5]:!1;_classCallCheck(this,Sl);this.from=t,this.to=e,this.tree=i,this.offset=s,this.open=(r?1:0)|(n?2:0);}return _createClass(Sl,[{key:"openStart",get:function get(){return(1&this.open)>0;}},{key:"openEnd",get:function get(){return(2&this.open)>0;}}],[{key:"addTree",value:function addTree(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[];var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!1;var s=[new Sl(0,t.length,t,0,!1,i)];var _iterator157=_createForOfIteratorHelper(e),_step157;try{for(_iterator157.s();!(_step157=_iterator157.n()).done;){var _i156=_step157.value;_i156.to>t.length&&s.push(_i156);}}catch(err){_iterator157.e(err);}finally{_iterator157.f();}return s;}},{key:"applyChanges",value:function applyChanges(t,e){var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:128;if(!e.length)return t;var s=[],r=1,n=t.length?t[0]:null;for(var _h64=0,_l56=0,_o37=0;;_h64++){var _u29=_h64<e.length?e[_h64]:null,_f22=_u29?_u29.fromA:1e9;if(_f22-_l56>=i)for(;n&&n.from<_f22;){var _e192=n;if(_l56>=_e192.from||_f22<=_e192.to||_o37){var _t211=Math.max(_e192.from,_l56)-_o37,_i157=Math.min(_e192.to,_f22)-_o37;_e192=_t211>=_i157?null:new Sl(_t211,_i157,_e192.tree,_e192.offset+_o37,_h64>0,!!_u29);}if(_e192&&s.push(_e192),n.to>_f22)break;n=r<t.length?t[r++]:null;}if(!_u29)break;_l56=_u29.toA,_o37=_u29.toA-_u29.toB;}return s;}}]);}();_export("P",Al=/*#__PURE__*/function(){function Al(){_classCallCheck(this,Al);}return _createClass(Al,[{key:"startParse",value:function startParse(t,e,i){return"string"==typeof t&&(t=new Cl(t)),i=i?i.length?i.map(function(t){return new Xh(t.from,t.to);}):[new Xh(0,0)]:[new Xh(0,t.length)],this.createParse(t,e||[],i);}},{key:"parse",value:function parse(t,e,i){var s=this.startParse(t,e,i);for(;;){var _t212=s.advance();if(_t212)return _t212;}}}]);}());Cl=/*#__PURE__*/function(){function Cl(t){_classCallCheck(this,Cl);this.string=t;}return _createClass(Cl,[{key:"length",get:function get(){return this.string.length;}},{key:"chunk",value:function chunk(t){return this.string.slice(t);}},{key:"lineChunks",get:function get(){return!1;}},{key:"read",value:function read(t,e){return this.string.slice(t,e);}}]);}();Ol=/*#__PURE__*/_createClass(function Ol(t,e,i,s,r){_classCallCheck(this,Ol);this.parser=t,this.parse=e,this.overlay=i,this.target=s,this.from=r;});Il=/*#__PURE__*/_createClass(function Il(t,e,i,s,r,n,h){_classCallCheck(this,Il);this.parser=t,this.predicate=e,this.mounts=i,this.index=s,this.start=r,this.target=n,this.prev=h,this.depth=0,this.ranges=[];});Rl=new Yh({perNode:!0});Tl=/*#__PURE__*/function(){function Tl(t,e,i,s,r){_classCallCheck(this,Tl);this.nest=e,this.input=i,this.fragments=s,this.ranges=r,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=t;}return _createClass(Tl,[{key:"advance",value:function advance(){if(this.baseParse){var _t213=this.baseParse.advance();if(!_t213)return null;if(this.baseParse=null,this.baseTree=_t213,this.startInner(),null!=this.stoppedAt){var _iterator158=_createForOfIteratorHelper(this.inner),_step158;try{for(_iterator158.s();!(_step158=_iterator158.n()).done;){var _t214=_step158.value;_t214.parse.stopAt(this.stoppedAt);}}catch(err){_iterator158.e(err);}finally{_iterator158.f();}}}if(this.innerDone==this.inner.length){var _t215=this.baseTree;return null!=this.stoppedAt&&(_t215=new nl(_t215.type,_t215.children,_t215.positions,_t215.length,_t215.propValues.concat([[Rl,this.stoppedAt]]))),_t215;}var t=this.inner[this.innerDone],e=t.parse.advance();if(e){this.innerDone++;var _i158=Object.assign(Object.create(null),t.target.props);_i158[Yh.mounted.id]=new Qh(e,t.overlay,t.parser),t.target.props=_i158;}return null;}},{key:"parsedPos",get:function get(){if(this.baseParse)return 0;var t=this.input.length;for(var _e193=this.innerDone;_e193<this.inner.length;_e193++)this.inner[_e193].from<t&&(t=Math.min(t,this.inner[_e193].parse.parsedPos));return t;}},{key:"stopAt",value:function stopAt(t){if(this.stoppedAt=t,this.baseParse)this.baseParse.stopAt(t);else for(var _e194=this.innerDone;_e194<this.inner.length;_e194++)this.inner[_e194].parse.stopAt(t);}},{key:"startInner",value:function startInner(){var t=new jl(this.fragments),e=null,i=null,s=new bl(new al(this.baseTree,this.ranges[0].from,0,null),rl.IncludeAnonymous|rl.IgnoreMounts);t:for(var _r126,_n93;;){var _h65=void 0,_l57=!0;if(null!=this.stoppedAt&&s.from>=this.stoppedAt)_l57=!1;else if(t.hasNode(s)){if(e){var _t216=e.mounts.find(function(t){return t.frag.from<=s.from&&t.frag.to>=s.to&&t.mount.overlay;});if(_t216){var _iterator159=_createForOfIteratorHelper(_t216.mount.overlay),_step159;try{var _loop13=function _loop13(){var i=_step159.value;var r=i.from+_t216.pos,n=i.to+_t216.pos;r>=s.from&&n<=s.to&&!e.ranges.some(function(t){return t.from<n&&t.to>r;})&&e.ranges.push({from:r,to:n});};for(_iterator159.s();!(_step159=_iterator159.n()).done;){_loop13();}}catch(err){_iterator159.e(err);}finally{_iterator159.f();}}}_l57=!1;}else if(i&&(_n93=Bl(i.ranges,s.from,s.to)))_l57=2!=_n93;else if(!s.type.isAnonymous&&(_r126=this.nest(s,this.input))&&(s.from<s.to||!_r126.overlay)){s.tree||Nl(s);var _n94=t.findMounts(s.from,_r126.parser);if("function"==typeof _r126.overlay)e=new Il(_r126.parser,_r126.overlay,_n94,this.inner.length,s.from,s.tree,e);else{var _t217=Pl(this.ranges,_r126.overlay||(s.from<s.to?[new Xh(s.from,s.to)]:[]));_t217.length&&El(_t217),!_t217.length&&_r126.overlay||this.inner.push(new Ol(_r126.parser,_t217.length?_r126.parser.startParse(this.input,Hl(_n94,_t217),_t217):_r126.parser.startParse(""),_r126.overlay?_r126.overlay.map(function(t){return new Xh(t.from-s.from,t.to-s.from);}):null,s.tree,_t217.length?_t217[0].from:s.from)),_r126.overlay?_t217.length&&(i={ranges:_t217,depth:0,prev:i}):_l57=!1;}}else if(e&&(_h65=e.predicate(s))&&(!0===_h65&&(_h65=new Xh(s.from,s.to)),_h65.from<_h65.to)){var _t218=e.ranges.length-1;_t218>=0&&e.ranges[_t218].to==_h65.from?e.ranges[_t218]={from:e.ranges[_t218].from,to:_h65.to}:e.ranges.push(_h65);}if(_l57&&s.firstChild())e&&e.depth++,i&&i.depth++;else for(;!s.nextSibling();){if(!s.parent())break t;if(e&&! --e.depth){var _t219=Pl(this.ranges,e.ranges);_t219.length&&(El(_t219),this.inner.splice(e.index,0,new Ol(e.parser,e.parser.startParse(this.input,Hl(e.mounts,_t219),_t219),e.ranges.map(function(t){return new Xh(t.from-e.start,t.to-e.start);}),e.target,_t219[0].from))),e=e.prev;}i&&! --i.depth&&(i=i.prev);}}}}]);}();$l=/*#__PURE__*/function(){function $l(t,e){_classCallCheck(this,$l);this.offset=e,this.done=!1,this.cursor=t.cursor(rl.IncludeAnonymous|rl.IgnoreMounts);}return _createClass($l,[{key:"moveTo",value:function moveTo(t){var e=this.cursor,i=t-this.offset;for(;!this.done&&e.from<i;)e.to>=t&&e.enter(i,1,rl.IgnoreOverlays|rl.ExcludeBuffers)||e.next(!1)||(this.done=!0);}},{key:"hasNode",value:function hasNode(t){if(this.moveTo(t.from),!this.done&&this.cursor.from+this.offset==t.from&&this.cursor.tree)for(var _e196=this.cursor.tree;;){if(_e196==t.tree)return!0;if(!(_e196.children.length&&0==_e196.positions[0]&&_e196.children[0]instanceof nl))break;_e196=_e196.children[0];}return!1;}}]);}();jl=/*#__PURE__*/function(){function jl(t){_classCallCheck(this,jl);var e;if(this.fragments=t,this.curTo=0,this.fragI=0,t.length){var _i161=this.curFrag=t[0];this.curTo=null!==(e=_i161.tree.prop(Rl))&&void 0!==e?e:_i161.to,this.inner=new $l(_i161.tree,-_i161.offset);}else this.curFrag=this.inner=null;}return _createClass(jl,[{key:"hasNode",value:function hasNode(t){for(;this.curFrag&&t.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=t.from&&this.curTo>=t.to&&this.inner.hasNode(t);}},{key:"nextFrag",value:function nextFrag(){var t;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{var _e197=this.curFrag=this.fragments[this.fragI];this.curTo=null!==(t=_e197.tree.prop(Rl))&&void 0!==t?t:_e197.to,this.inner=new $l(_e197.tree,-_e197.offset);}}},{key:"findMounts",value:function findMounts(t,e){var i;var s=[];if(this.inner){this.inner.cursor.moveTo(t,1);for(var _t220=this.inner.cursor.node;_t220;_t220=_t220.parent){var _r127=null===(i=_t220.tree)||void 0===i?void 0:i.prop(Yh.mounted);if(_r127&&_r127.parser==e)for(var _e198=this.fragI;_e198<this.fragments.length;_e198++){var _i162=this.fragments[_e198];if(_i162.from>=_t220.to)break;_i162.tree==this.curFrag.tree&&s.push({frag:_i162,pos:_t220.from-_i162.offset,mount:_r127});}}}return s;}}]);}();Fl=0;Wl=/*#__PURE__*/function(){function Wl(t,e,i,s){_classCallCheck(this,Wl);this.name=t,this.set=e,this.base=i,this.modified=s,this.id=Fl++;}return _createClass(Wl,[{key:"toString",value:function toString(){var t=this.name;var _iterator162=_createForOfIteratorHelper(this.modified),_step162;try{for(_iterator162.s();!(_step162=_iterator162.n()).done;){var _e201=_step162.value;_e201.name&&(t="".concat(_e201.name,"(").concat(t,")"));}}catch(err){_iterator162.e(err);}finally{_iterator162.f();}return t;}}],[{key:"define",value:function define(t,e){var i="string"==typeof t?t:"?";if(t instanceof Wl&&(e=t),null==e?void 0:e.base)throw new Error("Can not derive from a modified tag");var s=new Wl(i,[],null,[]);if(s.set.push(s),e){var _iterator163=_createForOfIteratorHelper(e.set),_step163;try{for(_iterator163.s();!(_step163=_iterator163.n()).done;){var _t223=_step163.value;s.set.push(_t223);}}catch(err){_iterator163.e(err);}finally{_iterator163.f();}}return s;}},{key:"defineModifier",value:function defineModifier(t){var e=new ql(t);return function(t){return t.modified.indexOf(e)>-1?t:ql.get(t.base||t,t.modified.concat(e).sort(function(t,e){return t.id-e.id;}));};}}]);}();Vl=0;ql=/*#__PURE__*/function(){function ql(t){_classCallCheck(this,ql);this.name=t,this.instances=[],this.id=Vl++;}return _createClass(ql,null,[{key:"get",value:function get(t,e){if(!e.length)return t;var i=e[0].instances.find(function(i){return i.base==t&&(s=e,r=i.modified,s.length==r.length&&s.every(function(t,e){return t==r[e];}));var s,r;});if(i)return i;var s=[],r=new Wl(t.name,s,t,e);var _iterator164=_createForOfIteratorHelper(e),_step164;try{for(_iterator164.s();!(_step164=_iterator164.n()).done;){var _t224=_step164.value;_t224.instances.push(r);}}catch(err){_iterator164.e(err);}finally{_iterator164.f();}var n=function(t){var e=[[]];for(var _i163=0;_i163<t.length;_i163++)for(var _s149=0,_r129=e.length;_s149<_r129;_s149++)e.push(e[_s149].concat(t[_i163]));return e.sort(function(t,e){return e.length-t.length;});}(e);var _iterator165=_createForOfIteratorHelper(t.set),_step165;try{for(_iterator165.s();!(_step165=_iterator165.n()).done;){var _e202=_step165.value;if(!_e202.modified.length){var _iterator166=_createForOfIteratorHelper(n),_step166;try{for(_iterator166.s();!(_step166=_iterator166.n()).done;){var _t225=_step166.value;s.push(ql.get(_e202,_t225));}}catch(err){_iterator166.e(err);}finally{_iterator166.f();}}}}catch(err){_iterator165.e(err);}finally{_iterator165.f();}return r;}}]);}();Jl=new Yh();Gl=/*#__PURE__*/function(){function Gl(t,e,i,s){_classCallCheck(this,Gl);this.tags=t,this.mode=e,this.context=i,this.next=s;}return _createClass(Gl,[{key:"opaque",get:function get(){return 0==this.mode;}},{key:"inherit",get:function get(){return 1==this.mode;}},{key:"sort",value:function sort(t){return!t||t.depth<this.depth?(this.next=t,this):(t.next=this.sort(t.next),t);}},{key:"depth",get:function get(){return this.context?this.context.length:0;}}]);}();Gl.empty=new Gl([],2,null);Xl=/*#__PURE__*/function(){function Xl(t,e,i){_classCallCheck(this,Xl);this.at=t,this.highlighters=e,this.span=i,this["class"]="";}return _createClass(Xl,[{key:"startSpan",value:function startSpan(t,e){e!=this["class"]&&(this.flush(t),t>this.at&&(this.at=t),this["class"]=e);}},{key:"flush",value:function flush(t){t>this.at&&this["class"]&&this.span(this.at,t,this["class"]);}},{key:"highlightRange",value:function highlightRange(t,e,i,s,r){var n=t.type,h=t.from,l=t.to;if(h>=i||l<=e)return;n.isTop&&(r=this.highlighters.filter(function(t){return!t.scope||t.scope(n);}));var o=s,u=function(t){var e=t.type.prop(Jl);for(;e&&e.context&&!t.matchContext(e.context);)e=e.next;return e||null;}(t)||Gl.empty,f=function(t,e){var i=null;var _iterator172=_createForOfIteratorHelper(t),_step172;try{for(_iterator172.s();!(_step172=_iterator172.n()).done;){var _s154=_step172.value;var _t229=_s154.style(e);_t229&&(i=i?i+" "+_t229:_t229);}}catch(err){_iterator172.e(err);}finally{_iterator172.f();}return i;}(r,u.tags);if(f&&(o&&(o+=" "),o+=f,1==u.mode&&(s+=(s?" ":"")+f)),this.startSpan(Math.max(e,h),o),u.opaque)return;var a=t.tree&&t.tree.prop(Yh.mounted);if(a&&a.overlay){var _n97=t.node.enter(a.overlay[0].from+h,1),_u31=this.highlighters.filter(function(t){return!t.scope||t.scope(a.tree.type);}),_f24=t.firstChild();for(var _c15=0,_d11=h;;_c15++){var _p8=_c15<a.overlay.length?a.overlay[_c15]:null,_m5=_p8?_p8.from+h:l,_g5=Math.max(e,_d11),_w2=Math.min(i,_m5);if(_g5<_w2&&_f24)for(;t.from<_w2&&(this.highlightRange(t,_g5,_w2,s,r),this.startSpan(Math.min(_w2,t.to),o),!(t.to>=_m5)&&t.nextSibling()););if(!_p8||_m5>i)break;_d11=_p8.to+h,_d11>e&&(this.highlightRange(_n97.cursor(),Math.max(e,_p8.from+h),Math.min(i,_d11),"",_u31),this.startSpan(Math.min(i,_d11),o));}_f24&&t.parent();}else if(t.firstChild()){a&&(s="");do{if(!(t.to<=e)){if(t.from>=i)break;this.highlightRange(t,e,i,s,r),this.startSpan(Math.min(i,t.to),o);}}while(t.nextSibling());t.parent();}}}]);}();Yl=Wl.define,Ql=Yl(),Zl=Yl(),to=Yl(Zl),eo=Yl(Zl),io=Yl(),so=Yl(io),ro=Yl(io),no=Yl(),ho=Yl(no),lo=Yl(),oo=Yl(),uo=Yl(),fo=Yl(uo),ao=Yl(),_export("t",co={comment:Ql,lineComment:Yl(Ql),blockComment:Yl(Ql),docComment:Yl(Ql),name:Zl,variableName:Yl(Zl),typeName:to,tagName:Yl(to),propertyName:eo,attributeName:Yl(eo),className:Yl(Zl),labelName:Yl(Zl),namespace:Yl(Zl),macroName:Yl(Zl),literal:io,string:so,docString:Yl(so),character:Yl(so),attributeValue:Yl(so),number:ro,integer:Yl(ro),"float":Yl(ro),bool:Yl(io),regexp:Yl(io),escape:Yl(io),color:Yl(io),url:Yl(io),keyword:lo,self:Yl(lo),"null":Yl(lo),atom:Yl(lo),unit:Yl(lo),modifier:Yl(lo),operatorKeyword:Yl(lo),controlKeyword:Yl(lo),definitionKeyword:Yl(lo),moduleKeyword:Yl(lo),operator:oo,derefOperator:Yl(oo),arithmeticOperator:Yl(oo),logicOperator:Yl(oo),bitwiseOperator:Yl(oo),compareOperator:Yl(oo),updateOperator:Yl(oo),definitionOperator:Yl(oo),typeOperator:Yl(oo),controlOperator:Yl(oo),punctuation:uo,separator:Yl(uo),bracket:fo,angleBracket:Yl(fo),squareBracket:Yl(fo),paren:Yl(fo),brace:Yl(fo),content:no,heading:ho,heading1:Yl(ho),heading2:Yl(ho),heading3:Yl(ho),heading4:Yl(ho),heading5:Yl(ho),heading6:Yl(ho),contentSeparator:Yl(no),list:Yl(no),quote:Yl(no),emphasis:Yl(no),strong:Yl(no),link:Yl(no),monospace:Yl(no),strikethrough:Yl(no),inserted:Yl(),deleted:Yl(),changed:Yl(),invalid:Yl(),meta:ao,documentMeta:Yl(ao),annotation:Yl(ao),processingInstruction:Yl(ao),definition:Wl.defineModifier("definition"),constant:Wl.defineModifier("constant"),"function":Wl.defineModifier("function"),standard:Wl.defineModifier("standard"),local:Wl.defineModifier("local"),special:Wl.defineModifier("special")});for(_t230 in co){_e205=co[_t230];_e205 instanceof Wl&&(_e205.name=_t230);}Kl([{tag:co.link,"class":"tok-link"},{tag:co.heading,"class":"tok-heading"},{tag:co.emphasis,"class":"tok-emphasis"},{tag:co.strong,"class":"tok-strong"},{tag:co.keyword,"class":"tok-keyword"},{tag:co.atom,"class":"tok-atom"},{tag:co.bool,"class":"tok-bool"},{tag:co.url,"class":"tok-url"},{tag:co.labelName,"class":"tok-labelName"},{tag:co.inserted,"class":"tok-inserted"},{tag:co.deleted,"class":"tok-deleted"},{tag:co.literal,"class":"tok-literal"},{tag:co.string,"class":"tok-string"},{tag:co.number,"class":"tok-number"},{tag:[co.regexp,co.escape,co.special(co.string)],"class":"tok-string2"},{tag:co.variableName,"class":"tok-variableName"},{tag:co.local(co.variableName),"class":"tok-variableName tok-local"},{tag:co.definition(co.variableName),"class":"tok-variableName tok-definition"},{tag:co.special(co.variableName),"class":"tok-variableName2"},{tag:co.definition(co.propertyName),"class":"tok-propertyName tok-definition"},{tag:co.typeName,"class":"tok-typeName"},{tag:co.namespace,"class":"tok-namespace"},{tag:co.className,"class":"tok-className"},{tag:co.macroName,"class":"tok-macroName"},{tag:co.propertyName,"class":"tok-propertyName"},{tag:co.operator,"class":"tok-operator"},{tag:co.comment,"class":"tok-comment"},{tag:co.meta,"class":"tok-meta"},{tag:co.invalid,"class":"tok-invalid"},{tag:co.punctuation,"class":"tok-punctuation"}]);mo=new Yh();_export("o",wo=new Yh());bo=/*#__PURE__*/function(){function bo(t,e){var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[];var s=arguments.length>3&&arguments[3]!==undefined?arguments[3]:"";_classCallCheck(this,bo);this.data=t,this.name=s,Dt.prototype.hasOwnProperty("tree")||Object.defineProperty(Dt.prototype,"tree",{get:function get(){return yo(this);}}),this.parser=e,this.extension=[Io.of(this),Dt.languageData.of(function(t,e,i){var s=vo(t,e,i),r=s.type.prop(mo);if(!r)return[];var n=t.facet(r),h=s.type.prop(wo);if(h){var _r131=s.resolve(e-s.from,i);var _iterator173=_createForOfIteratorHelper(h),_step173;try{for(_iterator173.s();!(_step173=_iterator173.n()).done;){var _e206=_step173.value;if(_e206.test(_r131,t)){var _i166=t.facet(_e206.facet);return"replace"==_e206.type?_i166:_i166.concat(n);}}}catch(err){_iterator173.e(err);}finally{_iterator173.f();}}return n;})].concat(i);}return _createClass(bo,[{key:"isActiveAt",value:function isActiveAt(t,e){var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:-1;return vo(t,e,i).type.prop(mo)==this.data;}},{key:"findRegions",value:function findRegions(t){var _this74=this;var e=t.facet(Io);if((null==e?void 0:e.data)==this.data)return[{from:0,to:t.doc.length}];if(!e||!e.allowsNesting)return[];var i=[],_s155=function s(t,e){if(t.prop(mo)==_this74.data)return void i.push({from:e,to:e+t.length});var r=t.prop(Yh.mounted);if(r){if(r.tree.prop(mo)==_this74.data){if(r.overlay){var _iterator174=_createForOfIteratorHelper(r.overlay),_step174;try{for(_iterator174.s();!(_step174=_iterator174.n()).done;){var _t231=_step174.value;i.push({from:_t231.from+e,to:_t231.to+e});}}catch(err){_iterator174.e(err);}finally{_iterator174.f();}}else i.push({from:e,to:e+t.length});return;}if(r.overlay){var _t232=i.length;if(_s155(r.tree,r.overlay[0].from+e),i.length>_t232)return;}}for(var _i167=0;_i167<t.children.length;_i167++){var _r132=t.children[_i167];_r132 instanceof nl&&_s155(_r132,t.positions[_i167]+e);}};return _s155(yo(t),0),i;}},{key:"allowsNesting",get:function get(){return!0;}}]);}();bo.setState=mt.define();_export("L",ko=/*#__PURE__*/function(_bo){function ko(t,e,i){var _this75;_classCallCheck(this,ko);_this75=_callSuper(this,ko,[t,e,[],i]),_this75.parser=e;return _this75;}_inherits(ko,_bo);return _createClass(ko,[{key:"configure",value:function configure(t,e){return new ko(this.data,this.parser.configure(t),e||this.name);}},{key:"allowsNesting",get:function get(){return this.parser.hasWrappers();}}],[{key:"define",value:function define(t){var e=go(t.languageData);return new ko(e,t.parser.configure({props:[mo.add(function(t){return t.isTop?e:void 0;})]}),t.name);}}]);}(bo));Mo=/*#__PURE__*/function(){function Mo(t){_classCallCheck(this,Mo);this.doc=t,this.cursorPos=0,this.string="",this.cursor=t.iter();}return _createClass(Mo,[{key:"length",get:function get(){return this.doc.length;}},{key:"syncTo",value:function syncTo(t){return this.string=this.cursor.next(t-this.cursorPos).value,this.cursorPos=t+this.string.length,this.cursorPos-this.string.length;}},{key:"chunk",value:function chunk(t){return this.syncTo(t),this.string;}},{key:"lineChunks",get:function get(){return!0;}},{key:"read",value:function read(t,e){var i=this.cursorPos-this.string.length;return t<i||e>=this.cursorPos?this.doc.sliceString(t,e):this.string.slice(t-i,e-i);}}]);}();xo=null;So=/*#__PURE__*/function(){function So(t,e){var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[];var s=arguments.length>3?arguments[3]:undefined;var r=arguments.length>4?arguments[4]:undefined;var n=arguments.length>5?arguments[5]:undefined;var h=arguments.length>6?arguments[6]:undefined;var l=arguments.length>7?arguments[7]:undefined;_classCallCheck(this,So);this.parser=t,this.state=e,this.fragments=i,this.tree=s,this.treeLen=r,this.viewport=n,this.skipped=h,this.scheduleOn=l,this.parse=null,this.tempSkipped=[];}return _createClass(So,[{key:"startParse",value:function startParse(){return this.parser.startParse(new Mo(this.state.doc),this.fragments);}},{key:"work",value:function work(t,e){var _this76=this;return null!=e&&e>=this.state.doc.length&&(e=void 0),this.tree!=nl.empty&&this.isDone(null!=e?e:this.state.doc.length)?(this.takeTree(),!0):this.withContext(function(){var i;if("number"==typeof t){var _e207=Date.now()+t;t=function t(){return Date.now()>_e207;};}for(_this76.parse||(_this76.parse=_this76.startParse()),null!=e&&(null==_this76.parse.stoppedAt||_this76.parse.stoppedAt>e)&&e<_this76.state.doc.length&&_this76.parse.stopAt(e);;){var _s156=_this76.parse.advance();if(_s156){if(_this76.fragments=_this76.withoutTempSkipped(Sl.addTree(_s156,_this76.fragments,null!=_this76.parse.stoppedAt)),_this76.treeLen=null!==(i=_this76.parse.stoppedAt)&&void 0!==i?i:_this76.state.doc.length,_this76.tree=_s156,_this76.parse=null,!(_this76.treeLen<(null!=e?e:_this76.state.doc.length)))return!0;_this76.parse=_this76.startParse();}if(t())return!1;}});}},{key:"takeTree",value:function takeTree(){var _this77=this;var t,e;this.parse&&(t=this.parse.parsedPos)>=this.treeLen&&((null==this.parse.stoppedAt||this.parse.stoppedAt>t)&&this.parse.stopAt(t),this.withContext(function(){for(;!(e=_this77.parse.advance()););}),this.treeLen=t,this.tree=e,this.fragments=this.withoutTempSkipped(Sl.addTree(this.tree,this.fragments,!0)),this.parse=null);}},{key:"withContext",value:function withContext(t){var e=xo;xo=this;try{return t();}finally{xo=e;}}},{key:"withoutTempSkipped",value:function withoutTempSkipped(t){for(var _e208;_e208=this.tempSkipped.pop();)t=Ao(t,_e208.from,_e208.to);return t;}},{key:"changes",value:function changes(t,e){var i=this.fragments,s=this.tree,r=this.treeLen,n=this.viewport,h=this.skipped;if(this.takeTree(),!t.empty){var _e209=[];if(t.iterChangedRanges(function(t,i,s,r){return _e209.push({fromA:t,toA:i,fromB:s,toB:r});}),i=Sl.applyChanges(i,_e209),s=nl.empty,r=0,n={from:t.mapPos(n.from,-1),to:t.mapPos(n.to,1)},this.skipped.length){h=[];var _iterator175=_createForOfIteratorHelper(this.skipped),_step175;try{for(_iterator175.s();!(_step175=_iterator175.n()).done;){var _e210=_step175.value;var _i168=t.mapPos(_e210.from,1),_s157=t.mapPos(_e210.to,-1);_i168<_s157&&h.push({from:_i168,to:_s157});}}catch(err){_iterator175.e(err);}finally{_iterator175.f();}}}return new So(this.parser,e,i,s,r,n,h,this.scheduleOn);}},{key:"updateViewport",value:function updateViewport(t){if(this.viewport.from==t.from&&this.viewport.to==t.to)return!1;this.viewport=t;var e=this.skipped.length;for(var _e211=0;_e211<this.skipped.length;_e211++){var _this$skipped$_e=this.skipped[_e211],_i169=_this$skipped$_e.from,_s158=_this$skipped$_e.to;_i169<t.to&&_s158>t.from&&(this.fragments=Ao(this.fragments,_i169,_s158),this.skipped.splice(_e211--,1));}return!(this.skipped.length>=e)&&(this.reset(),!0);}},{key:"reset",value:function reset(){this.parse&&(this.takeTree(),this.parse=null);}},{key:"skipUntilInView",value:function skipUntilInView(t,e){this.skipped.push({from:t,to:e});}},{key:"isDone",value:function isDone(t){t=Math.min(t,this.state.doc.length);var e=this.fragments;return this.treeLen>=t&&e.length&&0==e[0].from&&e[0].to>=t;}}],[{key:"create",value:function create(t,e,i){return new So(t,e,[],nl.empty,0,i,[],null);}},{key:"getSkippingParser",value:function getSkippingParser(t){return new(/*#__PURE__*/function(_Al){function _class8(){_classCallCheck(this,_class8);return _callSuper(this,_class8,arguments);}_inherits(_class8,_Al);return _createClass(_class8,[{key:"createParse",value:function createParse(e,i,s){var r=s[0].from,n=s[s.length-1].to;return{parsedPos:r,advance:function advance(){var e=xo;if(e){var _iterator176=_createForOfIteratorHelper(s),_step176;try{for(_iterator176.s();!(_step176=_iterator176.n()).done;){var _t234=_step176.value;e.tempSkipped.push(_t234);}}catch(err){_iterator176.e(err);}finally{_iterator176.f();}t&&(e.scheduleOn=e.scheduleOn?Promise.all([e.scheduleOn,t]):t);}return this.parsedPos=n,new nl(tl.none,[],[],n-r);},stoppedAt:null,stopAt:function stopAt(){}};}}]);}(Al))();}},{key:"get",value:function get(){return xo;}}]);}();Co=/*#__PURE__*/function(){function Co(t){_classCallCheck(this,Co);this.context=t,this.tree=t.tree;}return _createClass(Co,[{key:"apply",value:function apply(t){if(!t.docChanged&&this.tree==this.context.tree)return this;var e=this.context.changes(t.changes,t.state),i=this.context.treeLen==t.startState.doc.length?void 0:Math.max(t.changes.mapPos(this.context.treeLen),e.viewport.to);return e.work(20,i)||e.takeTree(),new Co(e);}}],[{key:"init",value:function init(t){var e=Math.min(3e3,t.doc.length),i=So.create(t.facet(Io).parser,t,{from:0,to:e});return i.work(20,e)||i.takeTree(),new Co(i);}}]);}();bo.state=J.define({create:Co.init,update:function update(t,e){var _iterator177=_createForOfIteratorHelper(e.effects),_step177;try{for(_iterator177.s();!(_step177=_iterator177.n()).done;){var _t235=_step177.value;if(_t235.is(bo.setState))return _t235.value;}}catch(err){_iterator177.e(err);}finally{_iterator177.f();}return e.startState.facet(Io)!=e.state.facet(Io)?Co.init(e.state):t.apply(e);}});Do=function Do(t){var e=setTimeout(function(){return t();},500);return function(){return clearTimeout(e);};};"undefined"!=typeof requestIdleCallback&&(Do=function Do(t){var e=-1,i=setTimeout(function(){e=requestIdleCallback(t,{timeout:400});},100);return function(){return e<0?clearTimeout(i):cancelIdleCallback(e);};});Oo="undefined"!=typeof navigator&&(null===(po=navigator.scheduling)||void 0===po?void 0:po.isInputPending)?function(){return navigator.scheduling.isInputPending();}:null,Eo=is.fromClass(/*#__PURE__*/function(){function _class9(t){_classCallCheck(this,_class9);this.view=t,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork();}return _createClass(_class9,[{key:"update",value:function update(t){var e=this.view.state.field(bo.state).context;(e.updateViewport(t.view.viewport)||this.view.viewport.to>e.treeLen)&&this.scheduleWork(),(t.docChanged||t.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(e);}},{key:"scheduleWork",value:function scheduleWork(){if(this.working)return;var t=this.view.state,e=t.field(bo.state);e.tree==e.context.tree&&e.context.isDone(t.doc.length)||(this.working=Do(this.work));}},{key:"work",value:function work(t){this.working=null;var e=Date.now();if(this.chunkEnd<e&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=e+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;var _this$view3=this.view,i=_this$view3.state,s=_this$view3.viewport.to,r=i.field(bo.state);if(r.tree==r.context.tree&&r.context.isDone(s+1e5))return;var n=Date.now()+Math.min(this.chunkBudget,100,t&&!Oo?Math.max(25,t.timeRemaining()-5):1e9),h=r.context.treeLen<s&&i.doc.length>s+1e3,l=r.context.work(function(){return Oo&&Oo()||Date.now()>n;},s+(h?0:1e5));this.chunkBudget-=Date.now()-e,(l||this.chunkBudget<=0)&&(r.context.takeTree(),this.view.dispatch({effects:bo.setState.of(new Co(r.context))})),this.chunkBudget>0&&(!l||h)&&this.scheduleWork(),this.checkAsyncSchedule(r.context);}},{key:"checkAsyncSchedule",value:function checkAsyncSchedule(t){var _this78=this;t.scheduleOn&&(this.workScheduled++,t.scheduleOn.then(function(){return _this78.scheduleWork();})["catch"](function(t){return Qi(_this78.view.state,t);}).then(function(){return _this78.workScheduled--;}),t.scheduleOn=null);}},{key:"destroy",value:function destroy(){this.working&&this.working();}},{key:"isWorking",value:function isWorking(){return!!(this.working||this.workScheduled>0);}}]);}(),{eventHandlers:{focus:function focus(){this.scheduleWork();}}}),Io=z.define({combine:function combine(t){return t.length?t[0]:null;},enables:function enables(t){return[bo.state,Eo,en.contentAttributes.compute([t],function(e){var i=e.facet(t);return i&&i.name?{"data-language":i.name}:{};})];}});_export("h",Ro=/*#__PURE__*/_createClass(function Ro(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[];_classCallCheck(this,Ro);this.language=t,this.support=e,this.extension=[t,e];}));To=z.define(),Bo=z.define({combine:function combine(t){if(!t.length)return" ";var e=t[0];if(!e||/\S/.test(e)||Array.from(e).some(function(t){return t!=e[0];}))throw new Error("Invalid indent unit: "+JSON.stringify(t[0]));return e;}});jo=/*#__PURE__*/function(){function jo(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,jo);this.state=t,this.options=e,this.unit=Lo(t);}return _createClass(jo,[{key:"lineAt",value:function lineAt(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;var i=this.state.doc.lineAt(t),_this$options=this.options,s=_this$options.simulateBreak,r=_this$options.simulateDoubleBreak;return null!=s&&s>=i.from&&s<=i.to?r&&s==t?{text:"",from:t}:(e<0?s<t:s<=t)?{text:i.text.slice(s-i.from),from:s}:{text:i.text.slice(0,s-i.from),from:i.from}:i;}},{key:"textAfterPos",value:function textAfterPos(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;if(this.options.simulateDoubleBreak&&t==this.options.simulateBreak)return"";var _this$lineAt=this.lineAt(t,e),i=_this$lineAt.text,s=_this$lineAt.from;return i.slice(t-s,Math.min(i.length,t+100-s));}},{key:"column",value:function column(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;var _this$lineAt2=this.lineAt(t,e),i=_this$lineAt2.text,s=_this$lineAt2.from,r=this.countColumn(i,t-s),n=this.options.overrideIndentation?this.options.overrideIndentation(s):-1;return n>-1&&(r+=n-this.countColumn(i,i.search(/\S|$/))),r;}},{key:"countColumn",value:function countColumn(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:t.length;return Ut(t,this.state.tabSize,e);}},{key:"lineIndent",value:function lineIndent(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;var _this$lineAt3=this.lineAt(t,e),i=_this$lineAt3.text,s=_this$lineAt3.from,r=this.options.overrideIndentation;if(r){var _t238=r(s);if(_t238>-1)return _t238;}return this.countColumn(i,i.search(/\S|$/));}},{key:"simulatedBreak",get:function get(){return this.options.simulateBreak||null;}}]);}();_export("i",Po=new Yh());Wo=/*#__PURE__*/function(_jo){function Wo(t,e,i){var _this79;_classCallCheck(this,Wo);_this79=_callSuper(this,Wo,[t.state,t.options]),_this79.base=t,_this79.pos=e,_this79.context=i;return _this79;}_inherits(Wo,_jo);return _createClass(Wo,[{key:"node",get:function get(){return this.context.node;}},{key:"textAfter",get:function get(){return this.textAfterPos(this.pos);}},{key:"baseIndent",get:function get(){return this.baseIndentFor(this.node);}},{key:"baseIndentFor",value:function baseIndentFor(t){var e=this.state.doc.lineAt(t.from);for(;;){var _i171=t.resolve(e.from);for(;_i171.parent&&_i171.parent.from==_i171.from;)_i171=_i171.parent;if(Vo(_i171,t))break;e=this.state.doc.lineAt(_i171.from);}return this.lineIndent(e.from);}},{key:"continue",value:function _continue(){return zo(this.context.next,this.base,this.pos);}}],[{key:"create",value:function create(t,e,i){return new Wo(t,e,i);}}]);}(jo);_export("f",Jo=function Jo(t){return t.baseIndent;});Ko=z.define(),_export("e",_o=new Yh());tu=mt.define({map:Zo}),eu=mt.define({map:Zo});su=J.define({create:function create(){return hi.none;},update:function update(t,e){t=t.map(e.changes);var _iterator181=_createForOfIteratorHelper(e.effects),_step181;try{var _loop16=function _loop16(){var i=_step181.value;if(i.is(tu)&&!nu(t,i.value.from,i.value.to)){var _e$state$facet=e.state.facet(fu),_s165=_e$state$facet.preparePlaceholder,_r135=_s165?hi.replace({widget:new pu(_s165(e.state,i.value))}):du;t=t.update({add:[_r135.range(i.value.from,i.value.to)]});}else i.is(eu)&&(t=t.update({filter:function filter(t,e){return i.value.from!=t||i.value.to!=e;},filterFrom:i.value.from,filterTo:i.value.to}));};for(_iterator181.s();!(_step181=_iterator181.n()).done;){_loop16();}}catch(err){_iterator181.e(err);}finally{_iterator181.f();}if(e.selection){var _i173=!1,_s164=e.selection.main.head;t.between(_s164,_s164,function(t,e){t<_s164&&e>_s164&&(_i173=!0);}),_i173&&(t=t.update({filterFrom:_s164,filterTo:_s164,filter:function filter(t,e){return e<=_s164||t>=_s164;}}));}return t;},provide:function provide(t){return en.decorations.from(t);},toJSON:function toJSON(t,e){var i=[];return t.between(0,e.doc.length,function(t,e){i.push(t,e);}),i;},fromJSON:function fromJSON(t){if(!Array.isArray(t)||t.length%2)throw new RangeError("Invalid JSON for fold state");var e=[];for(var _i174=0;_i174<t.length;){var _s166=t[_i174++],_r136=t[_i174++];if("number"!=typeof _s166||"number"!=typeof _r136)throw new RangeError("Invalid JSON for fold state");e.push(du.range(_s166,_r136));}return hi.set(e,!0);}});ou=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:function run(t){var _iterator182=_createForOfIteratorHelper(iu(t)),_step182;try{for(_iterator182.s();!(_step182=_iterator182.n()).done;){var _e215=_step182.value;var _i175=Qo(t.state,_e215.from,_e215.to);if(_i175)return t.dispatch({effects:hu(t.state,[tu.of(_i175),lu(t,_i175)])}),!0;}}catch(err){_iterator182.e(err);}finally{_iterator182.f();}return!1;}},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:function run(t){if(!t.state.field(su,!1))return!1;var e=[];var _iterator183=_createForOfIteratorHelper(iu(t)),_step183;try{for(_iterator183.s();!(_step183=_iterator183.n()).done;){var _i176=_step183.value;var _s167=ru(t.state,_i176.from,_i176.to);_s167&&e.push(eu.of(_s167),lu(t,_s167,!1));}}catch(err){_iterator183.e(err);}finally{_iterator183.f();}return e.length&&t.dispatch({effects:e}),e.length>0;}},{key:"Ctrl-Alt-[",run:function run(t){var e=t.state,i=[];for(var _s168=0;_s168<e.doc.length;){var _r137=t.lineBlockAt(_s168),_n99=Qo(e,_r137.from,_r137.to);_n99&&i.push(tu.of(_n99)),_s168=(_n99?t.lineBlockAt(_n99.to):_r137).to+1;}return i.length&&t.dispatch({effects:hu(t.state,i)}),!!i.length;}},{key:"Ctrl-Alt-]",run:function run(t){var e=t.state.field(su,!1);if(!e||!e.size)return!1;var i=[];return e.between(0,t.state.doc.length,function(t,e){i.push(eu.of({from:t,to:e}));}),t.dispatch({effects:i}),!0;}}],uu={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},fu=z.define({combine:function combine(t){return Ot(t,uu);}});du=hi.replace({widget:new(/*#__PURE__*/function(_ri7){function _class10(){_classCallCheck(this,_class10);return _callSuper(this,_class10,arguments);}_inherits(_class10,_ri7);return _createClass(_class10,[{key:"toDOM",value:function toDOM(t){return cu(t,null);}}]);}(ri))()});pu=/*#__PURE__*/function(_ri8){function pu(t){var _this80;_classCallCheck(this,pu);_this80=_callSuper(this,pu),_this80.value=t;return _this80;}_inherits(pu,_ri8);return _createClass(pu,[{key:"eq",value:function eq(t){return this.value==t.value;}},{key:"toDOM",value:function toDOM(t){return cu(t,this.value);}}]);}(ri);mu={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:function foldingChanged(){return!1;}};gu=/*#__PURE__*/function(_Sh3){function gu(t,e){var _this81;_classCallCheck(this,gu);_this81=_callSuper(this,gu),_this81.config=t,_this81.open=e;return _this81;}_inherits(gu,_Sh3);return _createClass(gu,[{key:"eq",value:function eq(t){return this.config==t.config&&this.open==t.open;}},{key:"toDOM",value:function toDOM(t){if(this.config.markerDOM)return this.config.markerDOM(this.open);var e=document.createElement("span");return e.textContent=this.open?this.config.openText:this.config.closedText,e.title=t.state.phrase(this.open?"Fold line":"Unfold line"),e;}}]);}(Sh);wu=en.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});bu=/*#__PURE__*/function(){function bu(t,e){_classCallCheck(this,bu);var i;function s(t){var e=Xt.newName();return(i||(i=Object.create(null)))["."+e]=t,e;}this.specs=t;var r="string"==typeof e.all?e.all:e.all?s(e.all):void 0,n=e.scope;this.scope=n instanceof bo?function(t){return t.prop(mo)==n.data;}:n?function(t){return t==n;}:void 0,this.style=Kl(t.map(function(t){return{tag:t.tag,"class":t["class"]||s(Object.assign({},t,{tag:null}))};}),{all:r}).style,this.module=i?new Xt(i):null,this.themeType=e.themeType;}return _createClass(bu,null,[{key:"define",value:function define(t,e){return new bu(t,e||{});}}]);}();vu=z.define(),ku=z.define({combine:function combine(t){return t.length?[t[0]]:null;}});xu=/*#__PURE__*/function(){function xu(t){_classCallCheck(this,xu);this.markCache=Object.create(null),this.tree=yo(t.state),this.decorations=this.buildDeco(t,yu(t.state)),this.decoratedTo=t.viewport.to;}return _createClass(xu,[{key:"update",value:function update(t){var e=yo(t.state),i=yu(t.state),s=i!=yu(t.startState),r=t.view.viewport,n=t.changes.mapPos(this.decoratedTo,1);e.length<r.to&&!s&&e.type==this.tree.type&&n>=r.to?(this.decorations=this.decorations.map(t.changes),this.decoratedTo=n):(e!=this.tree||t.viewportChanged||s)&&(this.tree=e,this.decorations=this.buildDeco(t.view,i),this.decoratedTo=r.to);}},{key:"buildDeco",value:function buildDeco(t,e){var _this82=this;if(!e||!this.tree.length)return hi.none;var i=new Lt();var _iterator184=_createForOfIteratorHelper(t.visibleRanges),_step184;try{for(_iterator184.s();!(_step184=_iterator184.n()).done;){var _step184$value=_step184.value,_s169=_step184$value.from,_r138=_step184$value.to;_l(this.tree,e,function(t,e,s){i.add(t,e,_this82.markCache[s]||(_this82.markCache[s]=hi.mark({"class":s})));},_s169,_r138);}}catch(err){_iterator184.e(err);}finally{_iterator184.f();}return i.finish();}}]);}();Su=Q.high(is.fromClass(xu,{decorations:function decorations(t){return t.decorations;}})),_export("K",Au=bu.define([{tag:co.meta,color:"#404740"},{tag:co.link,textDecoration:"underline"},{tag:co.heading,textDecoration:"underline",fontWeight:"bold"},{tag:co.emphasis,fontStyle:"italic"},{tag:co.strong,fontWeight:"bold"},{tag:co.strikethrough,textDecoration:"line-through"},{tag:co.keyword,color:"#708"},{tag:[co.atom,co.bool,co.url,co.contentSeparator,co.labelName],color:"#219"},{tag:[co.literal,co.inserted],color:"#164"},{tag:[co.string,co.deleted],color:"#a11"},{tag:[co.regexp,co.escape,co.special(co.string)],color:"#e40"},{tag:co.definition(co.variableName),color:"#00f"},{tag:co.local(co.variableName),color:"#30a"},{tag:[co.typeName,co.namespace],color:"#085"},{tag:co.className,color:"#167"},{tag:[co.special(co.variableName),co.macroName],color:"#256"},{tag:co.definition(co.propertyName),color:"#00c"},{tag:co.comment,color:"#940"},{tag:co.invalid,color:"#f00"}])),Cu=en.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),Du="()[]{}",Ou=z.define({combine:function combine(t){return Ot(t,{afterCursor:!0,brackets:Du,maxScanDistance:1e4,renderMatch:Ru});}}),Eu=hi.mark({"class":"cm-matchingBracket"}),Iu=hi.mark({"class":"cm-nonmatchingBracket"});Tu=J.define({create:function create(){return hi.none;},update:function update(t,e){if(!e.docChanged&&!e.selection)return t;var i=[],s=e.state.facet(Ou);var _iterator185=_createForOfIteratorHelper(e.state.selection.ranges),_step185;try{for(_iterator185.s();!(_step185=_iterator185.n()).done;){var _t242=_step185.value;if(!_t242.empty)continue;var _r139=ju(e.state,_t242.head,-1,s)||_t242.head>0&&ju(e.state,_t242.head-1,1,s)||s.afterCursor&&(ju(e.state,_t242.head,1,s)||_t242.head<e.state.doc.length&&ju(e.state,_t242.head+1,-1,s));_r139&&(i=i.concat(s.renderMatch(_r139,e.state)));}}catch(err){_iterator185.e(err);}finally{_iterator185.f();}return hi.set(i,!0);},provide:function provide(t){return en.decorations.from(t);}}),Bu=[Tu,Cu];_export("u",Lu=new Yh());zu=Object.create(null),Hu=[tl.none],Fu=[],Wu=Object.create(null),Vu=Object.create(null);for(_i177=0,_arr2=[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]];_i177<_arr2.length;_i177++){_arr2$_i=_slicedToArray(_arr2[_i177],2),_t247=_arr2$_i[0],_e218=_arr2$_i[1];Vu[_t247]=Uu(zu,_e218);}bi.RTL,bi.LTR;Gu=Ju(Zu,0),Ku=Ju(Qu,0),_u=Ju(function(t,e){return Qu(t,e,function(t){var e=[];var _iterator189=_createForOfIteratorHelper(t.selection.ranges),_step189;try{for(_iterator189.s();!(_step189=_iterator189.n()).done;){var _i179=_step189.value;var _s174=t.doc.lineAt(_i179.from),_r141=_i179.to<=_s174.to?_s174:t.doc.lineAt(_i179.to);_r141.from>_s174.from&&_r141.from==_i179.to&&(_r141=_i179.to==_s174.to+1?_s174:t.doc.lineAt(_i179.to-1));var _n101=e.length-1;_n101>=0&&e[_n101].to>_s174.from?e[_n101].to=_r141.to:e.push({from:_s174.from+/^\s*/.exec(_s174.text)[0].length,to:_r141.to});}}catch(err){_iterator189.e(err);}finally{_iterator189.f();}return e;}(e));},0);Yu=50;tf=ct.define(),ef=ct.define(),sf=z.define(),rf=z.define({combine:function combine(t){return Ot(t,{minDepth:100,newGroupDelay:500,joinToEvent:function joinToEvent(t,e){return e;}},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:function joinToEvent(t,e){return function(i,s){return t(i,s)||e(i,s);};}});}}),nf=J.define({create:function create(){return yf.empty;},update:function update(t,e){var i=e.state.facet(rf),s=e.annotation(tf);if(s){var _r145=af.fromTransaction(e,s.selection),_n106=s.side,_h76=0==_n106?t.undone:t.done;return _h76=_r145?cf(_h76,_h76.length,i.minDepth,_r145):gf(_h76,e.startState.selection),new yf(0==_n106?s.rest:_h76,0==_n106?_h76:s.rest);}var r=e.annotation(ef);if("full"!=r&&"before"!=r||(t=t.isolate()),!1===e.annotation(gt.addToHistory))return e.changes.empty?t:t.addMapping(e.changes.desc);var n=af.fromTransaction(e),h=e.annotation(gt.time),l=e.annotation(gt.userEvent);return n?t=t.addChanges(n,h,l,i,e):e.selection&&(t=t.addSelection(e.startState.selection,h,l,i.newGroupDelay)),"full"!=r&&"after"!=r||(t=t.isolate()),t;},toJSON:function toJSON(t){return{done:t.done.map(function(t){return t.toJSON();}),undone:t.undone.map(function(t){return t.toJSON();})};},fromJSON:function fromJSON(t){return new yf(t.done.map(af.fromJSON),t.undone.map(af.fromJSON));}});lf=hf(0,!1),of=hf(1,!1),uf=hf(0,!0),ff=hf(1,!0);af=/*#__PURE__*/function(){function af(t,e,i,s,r){_classCallCheck(this,af);this.changes=t,this.effects=e,this.mapped=i,this.startSelection=s,this.selectionsAfter=r;}return _createClass(af,[{key:"setSelAfter",value:function setSelAfter(t){return new af(this.changes,this.effects,this.mapped,this.startSelection,t);}},{key:"toJSON",value:function toJSON(){var t,e,i;return{changes:null===(t=this.changes)||void 0===t?void 0:t.toJSON(),mapped:null===(e=this.mapped)||void 0===e?void 0:e.toJSON(),startSelection:null===(i=this.startSelection)||void 0===i?void 0:i.toJSON(),selectionsAfter:this.selectionsAfter.map(function(t){return t.toJSON();})};}}],[{key:"fromJSON",value:function fromJSON(t){return new af(t.changes&&O.fromJSON(t.changes),[],t.mapped&&D.fromJSON(t.mapped),t.startSelection&&$.fromJSON(t.startSelection),t.selectionsAfter.map($.fromJSON));}},{key:"fromTransaction",value:function fromTransaction(t,e){var i=pf;var _iterator193=_createForOfIteratorHelper(t.startState.facet(sf)),_step193;try{for(_iterator193.s();!(_step193=_iterator193.n()).done;){var _e225=_step193.value;var _s176=_e225(t);_s176.length&&(i=i.concat(_s176));}}catch(err){_iterator193.e(err);}finally{_iterator193.f();}return!i.length&&t.changes.empty?null:new af(t.changes.invert(t.startState.doc),i,void 0,e||t.startState.selection,pf);}},{key:"selection",value:function selection(t){return new af(void 0,pf,void 0,void 0,t);}}]);}();pf=[],mf=200;kf=/^(input\.type|delete)($|\.)/;yf=/*#__PURE__*/function(){function yf(t,e){var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;var s=arguments.length>3&&arguments[3]!==undefined?arguments[3]:void 0;_classCallCheck(this,yf);this.done=t,this.undone=e,this.prevTime=i,this.prevUserEvent=s;}return _createClass(yf,[{key:"isolate",value:function isolate(){return this.prevTime?new yf(this.done,this.undone):this;}},{key:"addChanges",value:function addChanges(t,e,i,s,r){var n=this.done,h=n[n.length-1];return n=h&&h.changes&&!h.changes.empty&&t.changes&&(!i||kf.test(i))&&(!h.selectionsAfter.length&&e-this.prevTime<s.newGroupDelay&&s.joinToEvent(r,function(t,e){var i=[],s=!1;return t.iterChangedRanges(function(t,e){return i.push(t,e);}),e.iterChangedRanges(function(t,e,r,n){for(var _t255=0;_t255<i.length;){var _e227=i[_t255++],_h77=i[_t255++];n>=_e227&&r<=_h77&&(s=!0);}}),s;}(h.changes,t.changes))||"input.type.compose"==i)?cf(n,n.length-1,s.minDepth,new af(t.changes.compose(h.changes),df(mt.mapEffects(t.effects,h.changes),h.effects),h.mapped,h.startSelection,pf)):cf(n,n.length,s.minDepth,t),new yf(n,pf,e,i);}},{key:"addSelection",value:function addSelection(t,e,i,s){var r=this.done.length?this.done[this.done.length-1].selectionsAfter:pf;return r.length>0&&e-this.prevTime<s&&i==this.prevUserEvent&&i&&/^select($|\.)/.test(i)&&(n=r[r.length-1],h=t,n.ranges.length==h.ranges.length&&0===n.ranges.filter(function(t,e){return t.empty!=h.ranges[e].empty;}).length)?this:new yf(gf(this.done,t),this.undone,e,i);var n,h;}},{key:"addMapping",value:function addMapping(t){return new yf(bf(this.done,t),bf(this.undone,t),this.prevTime,this.prevUserEvent);}},{key:"pop",value:function pop(t,e,i){var s=0==t?this.done:this.undone;if(0==s.length)return null;var r=s[s.length-1],n=r.selectionsAfter[0]||e.selection;if(i&&r.selectionsAfter.length)return e.update({selection:r.selectionsAfter[r.selectionsAfter.length-1],annotations:tf.of({side:t,rest:wf(s),selection:n}),userEvent:0==t?"select.undo":"select.redo",scrollIntoView:!0});if(r.changes){var _i188=1==s.length?pf:s.slice(0,s.length-1);return r.mapped&&(_i188=bf(_i188,r.mapped)),e.update({changes:r.changes,selection:r.startSelection,effects:r.effects,annotations:tf.of({side:t,rest:_i188,selection:n}),filter:!1,userEvent:0==t?"undo":"redo",scrollIntoView:!0});}return null;}}]);}();yf.empty=new yf(pf,pf);Mf=[{key:"Mod-z",run:lf,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:of,preventDefault:!0},{linux:"Ctrl-Shift-z",run:of,preventDefault:!0},{key:"Mod-u",run:uf,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:ff,preventDefault:!0}];Ef=function Ef(t){return Df(t,!Of(t));},If=function If(t){return Df(t,Of(t));};Nf=function Nf(t){return Lf(t,!1);},$f=function $f(t){return Lf(t,!0);};zf=function zf(t){return Pf(t,!1);},Hf=function Hf(t){return Pf(t,!0);};qf=function qf(t){return Vf(t,!Of(t));},Uf=function Uf(t){return Vf(t,Of(t));};Kf=function Kf(t){return Gf(t,!1);},_f=function _f(t){return Gf(t,!0);};Yf=function Yf(t){return Xf(t,!1);},Qf=function Qf(t){return Xf(t,!0);},Zf=function Zf(_ref24){var t=_ref24.state,e=_ref24.dispatch;return e(Sf(t,{anchor:0})),!0;},ta=function ta(_ref25){var t=_ref25.state,e=_ref25.dispatch;return e(Sf(t,{anchor:t.doc.length})),!0;},ea=function ea(_ref26){var t=_ref26.state,e=_ref26.dispatch;return e(Sf(t,{anchor:t.selection.main.anchor,head:0})),!0;},ia=function ia(_ref27){var t=_ref27.state,e=_ref27.dispatch;return e(Sf(t,{anchor:t.selection.main.anchor,head:t.doc.length})),!0;};na=function na(t,e,i){return sa(t,function(s){var r,n,h=s.from,l=t.state,o=l.doc.lineAt(h);if(i&&!e&&h>o.from&&h<o.from+200&&!/[^ \t]/.test(r=o.text.slice(0,h-o.from))){if("\t"==r[r.length-1])return h-1;var _t256=Ut(r,l.tabSize)%Lo(l)||Lo(l);for(var _e231=0;_e231<_t256&&" "==r[r.length-1-_e231];_e231++)h--;n=h;}else n=y(o.text,h-o.from,e,e)+o.from,n==h&&o.number!=(e?l.doc.lines:1)?n+=e?1:-1:!e&&/[\ufe00-\ufe0f]/.test(o.text.slice(n-o.from,h-o.from))&&(n=y(o.text,n-o.from,!1,!1)+o.from);return n;});},ha=function ha(t){return na(t,!1,!0);},la=function la(t){return na(t,!0,!1);},oa=function oa(t,e){return sa(t,function(i){var s=i.head,r=t.state,n=r.doc.lineAt(s),h=r.charCategorizer(s);for(var _t257=null;;){if(s==(e?n.to:n.from)){s==i.head&&n.number!=(e?r.doc.lines:1)&&(s+=e?1:-1);break;}var _l65=y(n.text,s-n.from,e)+n.from,_o42=n.text.slice(Math.min(s,_l65)-n.from,Math.max(s,_l65)-n.from),_u32=h(_o42);if(null!=_t257&&_u32!=_t257)break;" "==_o42&&s==i.head||(_t257=_u32),s=_l65;}return s;});},ua=function ua(t){return oa(t,!1);};da=pa(!1);ga=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:function run(t){return Af(t,function(e){return Bf(t.state,e,!Of(t));});},shift:function shift(t){return Wf(t,function(e){return Bf(t.state,e,!Of(t));});}},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:function run(t){return Af(t,function(e){return Bf(t.state,e,Of(t));});},shift:function shift(t){return Wf(t,function(e){return Bf(t.state,e,Of(t));});}},{key:"Alt-ArrowUp",run:function run(_ref29){var t=_ref29.state,e=_ref29.dispatch;return aa(t,e,!1);}},{key:"Shift-Alt-ArrowUp",run:function run(_ref30){var t=_ref30.state,e=_ref30.dispatch;return ca(t,e,!1);}},{key:"Alt-ArrowDown",run:function run(_ref31){var t=_ref31.state,e=_ref31.dispatch;return aa(t,e,!0);}},{key:"Shift-Alt-ArrowDown",run:function run(_ref32){var t=_ref32.state,e=_ref32.dispatch;return ca(t,e,!0);}},{key:"Escape",run:function run(_ref33){var t=_ref33.state,e=_ref33.dispatch;var i=t.selection,s=null;return i.ranges.length>1?s=$.create([i.main]):i.main.empty||(s=$.create([$.cursor(i.main.head)])),!!s&&(e(Sf(t,s)),!0);}},{key:"Mod-Enter",run:pa(!0)},{key:"Alt-l",mac:"Ctrl-l",run:function run(_ref34){var t=_ref34.state,e=_ref34.dispatch;var i=fa(t).map(function(_ref35){var e=_ref35.from,i=_ref35.to;return $.range(e,Math.min(i+1,t.doc.length));});return e(t.update({selection:$.create(i),userEvent:"select"})),!0;}},{key:"Mod-i",run:function run(_ref36){var t=_ref36.state,e=_ref36.dispatch;var i=xf(t.selection,function(e){var i=yo(t),s=i.resolveStack(e.from,1);if(e.empty){var _t260=i.resolveStack(e.from,-1);_t260.node.from>=s.node.from&&_t260.node.to<=s.node.to&&(s=_t260);}for(var _t261=s;_t261;_t261=_t261.next){var _t262=_t261,_i192=_t262.node;if((_i192.from<e.from&&_i192.to>=e.to||_i192.to>e.to&&_i192.from<=e.from)&&_t261.next)return $.range(_i192.to,_i192.from);}return e;});return!i.eq(t.selection)&&(e(Sf(t,i)),!0);},preventDefault:!0},{key:"Mod-[",run:function run(_ref37){var t=_ref37.state,e=_ref37.dispatch;return!t.readOnly&&(e(t.update(ma(t,function(e,i){var s=/^\s*/.exec(e.text)[0];if(!s)return;var r=Ut(s,t.tabSize),n=0,h=No(t,Math.max(0,r-Lo(t)));for(;n<s.length&&n<h.length&&s.charCodeAt(n)==h.charCodeAt(n);)n++;i.push({from:e.from+n,to:e.from+s.length,insert:h.slice(n)});}),{userEvent:"delete.dedent"})),!0);}},{key:"Mod-]",run:function run(_ref38){var t=_ref38.state,e=_ref38.dispatch;return!t.readOnly&&(e(t.update(ma(t,function(e,i){i.push({from:e.from,insert:t.facet(Bo)});}),{userEvent:"input.indent"})),!0);}},{key:"Mod-Alt-\\",run:function run(_ref39){var t=_ref39.state,e=_ref39.dispatch;if(t.readOnly)return!1;var i=Object.create(null),s=new jo(t,{overrideIndentation:function overrideIndentation(t){var e=i[t];return null==e?-1:e;}}),r=ma(t,function(e,r,n){var h=$o(s,e.from);if(null==h)return;/\S/.test(e.text)||(h=0);var l=/^\s*/.exec(e.text)[0],o=No(t,h);(l!=o||n.from<e.from+l.length)&&(i[e.from]=h,r.push({from:e.from,to:e.from+l.length,insert:o}));});return r.changes.empty||e(t.update(r,{userEvent:"indent"})),!0;}},{key:"Shift-Mod-k",run:function run(t){if(t.state.readOnly)return!1;var e=t.state,i=e.changes(fa(e).map(function(_ref40){var t=_ref40.from,i=_ref40.to;return t>0?t--:i<e.doc.length&&i++,{from:t,to:i};})),s=xf(e.selection,function(e){var i;if(t.lineWrapping){var _s181=t.lineBlockAt(e.head),_r148=t.coordsAtPos(e.head,e.assoc||1);_r148&&(i=_s181.bottom+t.documentTop-_r148.bottom+t.defaultLineHeight/2);}return t.moveVertically(e,!0,i);}).map(i);return t.dispatch({changes:i,selection:s,scrollIntoView:!0,userEvent:"delete.line"}),!0;}},{key:"Shift-Mod-\\",run:function run(_ref41){var t=_ref41.state,e=_ref41.dispatch;return function(t,e,i){var s=!1,r=xf(t.selection,function(e){var r=ju(t,e.head,-1)||ju(t,e.head,1)||e.head>0&&ju(t,e.head-1,1)||e.head<t.doc.length&&ju(t,e.head+1,-1);if(!r||!r.end)return e;s=!0;var n=r.start.from==e.head?r.end.to:r.end.from;return i?$.range(e.anchor,n):$.cursor(n);});return!!s&&(e(Sf(t,r)),!0);}(t,e,!1);}},{key:"Mod-/",run:function run(t){var e=t.state,i=e.doc.lineAt(e.selection.main.from),s=Xu(t.state,i.from);return s.line?Gu(t):!!s.block&&_u(t);}},{key:"Alt-A",run:Ku},{key:"Ctrl-m",mac:"Shift-Alt-m",run:function run(t){return t.setTabFocusMode(),!0;}}].concat([{key:"ArrowLeft",run:Ef,shift:qf,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:function run(t){return Rf(t,!Of(t));},shift:function shift(t){return Jf(t,!Of(t));},preventDefault:!0},{mac:"Cmd-ArrowLeft",run:function run(t){return Af(t,function(e){return Ff(t,e,!Of(t));});},shift:function shift(t){return Wf(t,function(e){return Ff(t,e,!Of(t));});},preventDefault:!0},{key:"ArrowRight",run:If,shift:Uf,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:function run(t){return Rf(t,Of(t));},shift:function shift(t){return Jf(t,Of(t));},preventDefault:!0},{mac:"Cmd-ArrowRight",run:function run(t){return Af(t,function(e){return Ff(t,e,Of(t));});},shift:function shift(t){return Wf(t,function(e){return Ff(t,e,Of(t));});},preventDefault:!0},{key:"ArrowUp",run:Nf,shift:Kf,preventDefault:!0},{mac:"Cmd-ArrowUp",run:Zf,shift:ea},{mac:"Ctrl-ArrowUp",run:zf,shift:Yf},{key:"ArrowDown",run:$f,shift:_f,preventDefault:!0},{mac:"Cmd-ArrowDown",run:ta,shift:ia},{mac:"Ctrl-ArrowDown",run:Hf,shift:Qf},{key:"PageUp",run:zf,shift:Yf},{key:"PageDown",run:Hf,shift:Qf},{key:"Home",run:function run(t){return Af(t,function(e){return Ff(t,e,!1);});},shift:function shift(t){return Wf(t,function(e){return Ff(t,e,!1);});},preventDefault:!0},{key:"Mod-Home",run:Zf,shift:ea},{key:"End",run:function run(t){return Af(t,function(e){return Ff(t,e,!0);});},shift:function shift(t){return Wf(t,function(e){return Ff(t,e,!0);});},preventDefault:!0},{key:"Mod-End",run:ta,shift:ia},{key:"Enter",run:da,shift:da},{key:"Mod-a",run:function run(_ref42){var t=_ref42.state,e=_ref42.dispatch;return e(t.update({selection:{anchor:0,head:t.doc.length},userEvent:"select"})),!0;}},{key:"Backspace",run:ha,shift:ha},{key:"Delete",run:la},{key:"Mod-Backspace",mac:"Alt-Backspace",run:ua},{key:"Mod-Delete",mac:"Alt-Delete",run:function run(t){return oa(t,!0);}},{mac:"Mod-Backspace",run:function run(t){return sa(t,function(e){var i=t.moveToLineBoundary(e,!1).head;return e.head>i?i:Math.max(0,e.head-1);});}},{mac:"Mod-Delete",run:function run(t){return sa(t,function(e){var i=t.moveToLineBoundary(e,!0).head;return e.head<i?i:Math.min(t.state.doc.length,e.head+1);});}}].concat([{key:"Ctrl-b",run:Ef,shift:qf,preventDefault:!0},{key:"Ctrl-f",run:If,shift:Uf},{key:"Ctrl-p",run:Nf,shift:Kf},{key:"Ctrl-n",run:$f,shift:_f},{key:"Ctrl-a",run:function run(t){return Af(t,function(e){return $.cursor(t.lineBlockAt(e.head).from,1);});},shift:function shift(t){return Wf(t,function(e){return $.cursor(t.lineBlockAt(e.head).from);});}},{key:"Ctrl-e",run:function run(t){return Af(t,function(e){return $.cursor(t.lineBlockAt(e.head).to,-1);});},shift:function shift(t){return Wf(t,function(e){return $.cursor(t.lineBlockAt(e.head).to);});}},{key:"Ctrl-d",run:la},{key:"Ctrl-h",run:ha},{key:"Ctrl-k",run:function run(t){return sa(t,function(e){var i=t.lineBlockAt(e.head).to;return e.head<i?i:Math.min(t.state.doc.length,e.head+1);});}},{key:"Ctrl-Alt-h",run:ua},{key:"Ctrl-o",run:function run(_ref43){var t=_ref43.state,e=_ref43.dispatch;if(t.readOnly)return!1;var i=t.changeByRange(function(t){return{changes:{from:t.from,to:t.to,insert:a.of(["",""])},range:$.cursor(t.from)};});return e(t.update(i,{scrollIntoView:!0,userEvent:"input"})),!0;}},{key:"Ctrl-t",run:function run(_ref44){var t=_ref44.state,e=_ref44.dispatch;if(t.readOnly)return!1;var i=t.changeByRange(function(e){if(!e.empty||0==e.from||e.from==t.doc.length)return{range:e};var i=e.from,s=t.doc.lineAt(i),r=i==s.from?i-1:y(s.text,i-s.from,!1)+s.from,n=i==s.to?i+1:y(s.text,i-s.from,!0)+s.from;return{changes:{from:r,to:n,insert:t.doc.slice(i,n).append(t.doc.slice(r,i))},range:$.cursor(n)};});return!i.changes.empty&&(e(t.update(i,{scrollIntoView:!0,userEvent:"move.character"})),!0);}},{key:"Ctrl-v",run:Hf}].map(function(t){return{mac:t.key,run:t.run,shift:t.shift};})));va="function"==typeof String.prototype.normalize?function(t){return t.normalize("NFKD");}:function(t){return t;};ka=/*#__PURE__*/function(){function ka(t,e){var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;var s=arguments.length>3&&arguments[3]!==undefined?arguments[3]:t.length;var r=arguments.length>4?arguments[4]:undefined;var n=arguments.length>5?arguments[5]:undefined;_classCallCheck(this,ka);this.test=n,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=t.iterRange(i,s),this.bufferStart=i,this.normalize=r?function(t){return r(va(t));}:va,this.query=this.normalize(e);}return _createClass(ka,[{key:"peek",value:function peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value;}return M(this.buffer,this.bufferPos);}},{key:"next",value:function next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping();}},{key:"nextOverlapping",value:function nextOverlapping(){for(;;){var _t263=this.peek();if(_t263<0)return this.done=!0,this;var _e234=x(_t263),_i193=this.bufferStart+this.bufferPos;this.bufferPos+=S(_t263);var _s182=this.normalize(_e234);if(_s182.length)for(var _t264=0,_r149=_i193;;_t264++){var _n110=_s182.charCodeAt(_t264),_h83=this.match(_n110,_r149,this.bufferPos+this.bufferStart);if(_t264==_s182.length-1){if(_h83)return this.value=_h83,this;break;}_r149==_i193&&_t264<_e234.length&&_e234.charCodeAt(_t264)==_n110&&_r149++;}}}},{key:"match",value:function match(t,e,i){var s=null;for(var _e235=0;_e235<this.matches.length;_e235+=2){var _r150=this.matches[_e235],_n111=!1;this.query.charCodeAt(_r150)==t&&(_r150==this.query.length-1?s={from:this.matches[_e235+1],to:i}:(this.matches[_e235]++,_n111=!0)),_n111||(this.matches.splice(_e235,2),_e235-=2);}return this.query.charCodeAt(0)==t&&(1==this.query.length?s={from:e,to:i}:this.matches.push(1,e)),s&&this.test&&!this.test(s.from,s.to,this.buffer,this.bufferStart)&&(s=null),s;}}]);}();"undefined"!=typeof Symbol&&(ka.prototype[Symbol.iterator]=function(){return this;});ya={from:-1,to:-1,match:/.*/.exec("")},Ma="gm"+(null==/x/.unicode?"":"u");xa=/*#__PURE__*/function(){function xa(t,e,i){var s=arguments.length>3&&arguments[3]!==undefined?arguments[3]:0;var r=arguments.length>4&&arguments[4]!==undefined?arguments[4]:t.length;_classCallCheck(this,xa);if(this.text=t,this.to=r,this.curLine="",this.done=!1,this.value=ya,/\\[sWDnr]|\n|\r|\[\^/.test(e))return new Ca(t,e,i,s,r);this.re=new RegExp(e,Ma+((null==i?void 0:i.ignoreCase)?"i":"")),this.test=null==i?void 0:i.test,this.iter=t.iter();var n=t.lineAt(s);this.curLineStart=n.from,this.matchPos=Da(t,s),this.getLine(this.curLineStart);}return _createClass(xa,[{key:"getLine",value:function getLine(t){this.iter.next(t),this.iter.lineBreak?this.curLine="":(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next());}},{key:"nextLine",value:function nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0);}},{key:"next",value:function next(){for(var _t265=this.matchPos-this.curLineStart;;){this.re.lastIndex=_t265;var _e236=this.matchPos<=this.to&&this.re.exec(this.curLine);if(_e236){var _i194=this.curLineStart+_e236.index,_s183=_i194+_e236[0].length;if(this.matchPos=Da(this.text,_s183+(_i194==_s183?1:0)),_i194==this.curLineStart+this.curLine.length&&this.nextLine(),(_i194<_s183||_i194>this.value.to)&&(!this.test||this.test(_i194,_s183,_e236)))return this.value={from:_i194,to:_s183,match:_e236},this;_t265=this.matchPos-this.curLineStart;}else{if(!(this.curLineStart+this.curLine.length<this.to))return this.done=!0,this;this.nextLine(),_t265=0;}}}}]);}();Sa=new WeakMap();Aa=/*#__PURE__*/function(){function Aa(t,e){_classCallCheck(this,Aa);this.from=t,this.text=e;}return _createClass(Aa,[{key:"to",get:function get(){return this.from+this.text.length;}}],[{key:"get",value:function get(t,e,i){var s=Sa.get(t);if(!s||s.from>=i||s.to<=e){var _s184=new Aa(e,t.sliceString(e,i));return Sa.set(t,_s184),_s184;}if(s.from==e&&s.to==i)return s;var r=s.text,n=s.from;return n>e&&(r=t.sliceString(e,n)+r,n=e),s.to<i&&(r+=t.sliceString(s.to,i)),Sa.set(t,new Aa(n,r)),new Aa(e,r.slice(e-n,i-n));}}]);}();Ca=/*#__PURE__*/function(){function Ca(t,e,i,s,r){_classCallCheck(this,Ca);this.text=t,this.to=r,this.done=!1,this.value=ya,this.matchPos=Da(t,s),this.re=new RegExp(e,Ma+((null==i?void 0:i.ignoreCase)?"i":"")),this.test=null==i?void 0:i.test,this.flat=Aa.get(t,s,this.chunkEnd(s+5e3));}return _createClass(Ca,[{key:"chunkEnd",value:function chunkEnd(t){return t>=this.to?this.to:this.text.lineAt(t).to;}},{key:"next",value:function next(){for(;;){var _t266=this.re.lastIndex=this.matchPos-this.flat.from,_e237=this.re.exec(this.flat.text);if(_e237&&!_e237[0]&&_e237.index==_t266&&(this.re.lastIndex=_t266+1,_e237=this.re.exec(this.flat.text)),_e237){var _t267=this.flat.from+_e237.index,_i195=_t267+_e237[0].length;if((this.flat.to>=this.to||_e237.index+_e237[0].length<=this.flat.text.length-10)&&(!this.test||this.test(_t267,_i195,_e237)))return this.value={from:_t267,to:_i195,match:_e237},this.matchPos=Da(this.text,_i195+(_t267==_i195?1:0)),this;}if(this.flat.to==this.to)return this.done=!0,this;this.flat=Aa.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+2*this.flat.text.length));}}}]);}();"undefined"!=typeof Symbol&&(xa.prototype[Symbol.iterator]=Ca.prototype[Symbol.iterator]=function(){return this;});Ea=mt.define(),Ia=J.define({create:function create(){return!0;},update:function update(t,e){var _iterator201=_createForOfIteratorHelper(e.effects),_step201;try{for(_iterator201.s();!(_step201=_iterator201.n()).done;){var _i197=_step201.value;_i197.is(Ea)&&(t=_i197.value);}}catch(err){_iterator201.e(err);}finally{_iterator201.f();}return t;},provide:function provide(t){return xh.from(t,function(t){return t?Oa:null;});}}),Ra=en.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px","& label":{fontSize:"80%"}}}),Ta={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},Ba=z.define({combine:function combine(t){return Ot(t,Ta,{highlightWordAroundCursor:function highlightWordAroundCursor(t,e){return t||e;},minSelectionLength:Math.min,maxMatches:Math.min});}});La=hi.mark({"class":"cm-selectionMatch"}),Na=hi.mark({"class":"cm-selectionMatch cm-selectionMatch-main"});ja=is.fromClass(/*#__PURE__*/function(){function _class11(t){_classCallCheck(this,_class11);this.decorations=this.getDeco(t);}return _createClass(_class11,[{key:"update",value:function update(t){(t.selectionSet||t.docChanged||t.viewportChanged)&&(this.decorations=this.getDeco(t.view));}},{key:"getDeco",value:function getDeco(t){var e=t.state.facet(Ba),i=t.state,s=i.selection;if(s.ranges.length>1)return hi.none;var r,n=s.main,h=null;if(n.empty){if(!e.highlightWordAroundCursor)return hi.none;var _t269=i.wordAt(n.head);if(!_t269)return hi.none;h=i.charCategorizer(n.head),r=i.sliceDoc(_t269.from,_t269.to);}else{var _t270=n.to-n.from;if(_t270<e.minSelectionLength||_t270>200)return hi.none;if(e.wholeWords){if(r=i.sliceDoc(n.from,n.to),h=i.charCategorizer(n.head),!$a(h,i,n.from,n.to)||!function(t,e,i,s){return t(e.sliceDoc(i,i+1))==xt.Word&&t(e.sliceDoc(s-1,s))==xt.Word;}(h,i,n.from,n.to))return hi.none;}else if(r=i.sliceDoc(n.from,n.to),!r)return hi.none;}var l=[];var _iterator202=_createForOfIteratorHelper(t.visibleRanges),_step202;try{for(_iterator202.s();!(_step202=_iterator202.n()).done;){var _s185=_step202.value;var _t271=new ka(i.doc,r,_s185.from,_s185.to);for(;!_t271.next().done;){var _t271$value=_t271.value,_s186=_t271$value.from,_r151=_t271$value.to;if((!h||$a(h,i,_s186,_r151))&&(n.empty&&_s186<=n.from&&_r151>=n.to?l.push(Na.range(_s186,_r151)):(_s186>=n.to||_r151<=n.from)&&l.push(La.range(_s186,_r151)),l.length>e.maxMatches))return hi.none;}}}catch(err){_iterator202.e(err);}finally{_iterator202.f();}return hi.set(l);}}]);}(),{decorations:function decorations(t){return t.decorations;}}),Pa=en.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}});za=z.define({combine:function combine(t){return Ot(t,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:function createPanel(t){return new pc(t);},scrollToMatch:function scrollToMatch(t){return en.scrollIntoView(t);}});}});Ha=/*#__PURE__*/function(){function Ha(t){_classCallCheck(this,Ha);this.search=t.search,this.caseSensitive=!!t.caseSensitive,this.literal=!!t.literal,this.regexp=!!t.regexp,this.replace=t.replace||"",this.valid=!!this.search&&(!this.regexp||function(t){try{return new RegExp(t,Ma),!0;}catch(t){return!1;}}(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!t.wholeWord;}return _createClass(Ha,[{key:"unquote",value:function unquote(t){return this.literal?t:t.replace(/\\([nrt\\])/g,function(t,e){return"n"==e?"\n":"r"==e?"\r":"t"==e?"\t":"\\";});}},{key:"eq",value:function eq(t){return this.search==t.search&&this.replace==t.replace&&this.caseSensitive==t.caseSensitive&&this.regexp==t.regexp&&this.wholeWord==t.wholeWord;}},{key:"create",value:function create(){return this.regexp?new Ga(this):new Va(this);}},{key:"getCursor",value:function getCursor(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var i=arguments.length>2?arguments[2]:undefined;var s=t.doc?t:Dt.create({doc:t});return null==i&&(i=s.doc.length),this.regexp?qa(this,s,e,i):Wa(this,s,e,i);}}]);}();Fa=/*#__PURE__*/_createClass(function Fa(t){_classCallCheck(this,Fa);this.spec=t;});Va=/*#__PURE__*/function(_Fa){function Va(t){_classCallCheck(this,Va);return _callSuper(this,Va,[t]);}_inherits(Va,_Fa);return _createClass(Va,[{key:"nextMatch",value:function nextMatch(t,e,i){var s=Wa(this.spec,t,i,t.doc.length).nextOverlapping();if(s.done){var _i198=Math.min(t.doc.length,e+this.spec.unquoted.length);s=Wa(this.spec,t,0,_i198).nextOverlapping();}return s.done||s.value.from==e&&s.value.to==i?null:s.value;}},{key:"prevMatchInRange",value:function prevMatchInRange(t,e,i){for(var _s187=i;;){var _i199=Math.max(e,_s187-1e4-this.spec.unquoted.length),_r152=Wa(this.spec,t,_i199,_s187),_n112=null;for(;!_r152.nextOverlapping().done;)_n112=_r152.value;if(_n112)return _n112;if(_i199==e)return null;_s187-=1e4;}}},{key:"prevMatch",value:function prevMatch(t,e,i){var s=this.prevMatchInRange(t,0,e);return s||(s=this.prevMatchInRange(t,Math.max(0,i-this.spec.unquoted.length),t.doc.length)),!s||s.from==e&&s.to==i?null:s;}},{key:"getReplacement",value:function getReplacement(t){return this.spec.unquote(this.spec.replace);}},{key:"matchAll",value:function matchAll(t,e){var i=Wa(this.spec,t,0,t.doc.length),s=[];for(;!i.next().done;){if(s.length>=e)return null;s.push(i.value);}return s;}},{key:"highlight",value:function highlight(t,e,i,s){var r=Wa(this.spec,t,Math.max(0,e-this.spec.unquoted.length),Math.min(i+this.spec.unquoted.length,t.doc.length));for(;!r.next().done;)s(r.value.from,r.value.to);}}]);}(Fa);Ga=/*#__PURE__*/function(_Fa2){function Ga(){_classCallCheck(this,Ga);return _callSuper(this,Ga,arguments);}_inherits(Ga,_Fa2);return _createClass(Ga,[{key:"nextMatch",value:function nextMatch(t,e,i){var s=qa(this.spec,t,i,t.doc.length).next();return s.done&&(s=qa(this.spec,t,0,e).next()),s.done?null:s.value;}},{key:"prevMatchInRange",value:function prevMatchInRange(t,e,i){for(var _s188=1;;_s188++){var _r153=Math.max(e,i-1e4*_s188),_n113=qa(this.spec,t,_r153,i),_h84=null;for(;!_n113.next().done;)_h84=_n113.value;if(_h84&&(_r153==e||_h84.from>_r153+10))return _h84;if(_r153==e)return null;}}},{key:"prevMatch",value:function prevMatch(t,e,i){return this.prevMatchInRange(t,0,e)||this.prevMatchInRange(t,i,t.doc.length);}},{key:"getReplacement",value:function getReplacement(t){return this.spec.unquote(this.spec.replace).replace(/\$([$&\d+])/g,function(e,i){return"$"==i?"$":"&"==i?t.match[0]:"0"!=i&&+i<t.match.length?t.match[i]:e;});}},{key:"matchAll",value:function matchAll(t,e){var i=qa(this.spec,t,0,t.doc.length),s=[];for(;!i.next().done;){if(s.length>=e)return null;s.push(i.value);}return s;}},{key:"highlight",value:function highlight(t,e,i,s){var r=qa(this.spec,t,Math.max(0,e-250),Math.min(i+250,t.doc.length));for(;!r.next().done;)s(r.value.from,r.value.to);}}]);}(Fa);Ka=mt.define(),_a=mt.define(),Xa=J.define({create:function create(t){return new Ya(oc(t).create(),null);},update:function update(t,e){var _iterator203=_createForOfIteratorHelper(e.effects),_step203;try{for(_iterator203.s();!(_step203=_iterator203.n()).done;){var _i200=_step203.value;_i200.is(Ka)?t=new Ya(_i200.value.create(),t.panel):_i200.is(_a)&&(t=new Ya(t.query,_i200.value?lc:null));}}catch(err){_iterator203.e(err);}finally{_iterator203.f();}return t;},provide:function provide(t){return xh.from(t,function(t){return t.panel;});}});Ya=/*#__PURE__*/_createClass(function Ya(t,e){_classCallCheck(this,Ya);this.query=t,this.panel=e;});Qa=hi.mark({"class":"cm-searchMatch"}),Za=hi.mark({"class":"cm-searchMatch cm-searchMatch-selected"}),tc=is.fromClass(/*#__PURE__*/function(){function _class12(t){_classCallCheck(this,_class12);this.view=t,this.decorations=this.highlight(t.state.field(Xa));}return _createClass(_class12,[{key:"update",value:function update(t){var e=t.state.field(Xa);(e!=t.startState.field(Xa)||t.docChanged||t.selectionSet||t.viewportChanged)&&(this.decorations=this.highlight(e));}},{key:"highlight",value:function highlight(_ref45){var t=_ref45.query,e=_ref45.panel;if(!e||!t.spec.valid)return hi.none;var i=this.view,s=new Lt();for(var _e238=0,_r154=i.visibleRanges,_n114=_r154.length;_e238<_n114;_e238++){var _r154$_e=_r154[_e238],_h85=_r154$_e.from,_l66=_r154$_e.to;for(;_e238<_n114-1&&_l66>_r154[_e238+1].from-500;)_l66=_r154[++_e238].to;t.highlight(i.state,_h85,_l66,function(t,e){var r=i.state.selection.ranges.some(function(i){return i.from==t&&i.to==e;});s.add(t,e,r?Za:Qa);});}return s.finish();}}]);}(),{decorations:function decorations(t){return t.decorations;}});ic=ec(function(t,_ref46){var e=_ref46.query;var i=t.state.selection.main.to,s=e.nextMatch(t.state,i,i);if(!s)return!1;var r=$.single(s.from,s.to),n=t.state.facet(za);return t.dispatch({selection:r,effects:[bc(t,s),n.scrollToMatch(r.main,t)],userEvent:"select.search"}),fc(t),!0;}),sc=ec(function(t,_ref47){var e=_ref47.query;var i=t.state,s=i.selection.main.from,r=e.prevMatch(i,s,s);if(!r)return!1;var n=$.single(r.from,r.to),h=t.state.facet(za);return t.dispatch({selection:n,effects:[bc(t,r),h.scrollToMatch(n.main,t)],userEvent:"select.search"}),fc(t),!0;}),rc=ec(function(t,_ref48){var e=_ref48.query;var i=e.matchAll(t.state,1e3);return!(!i||!i.length)&&(t.dispatch({selection:$.create(i.map(function(t){return $.range(t.from,t.to);})),userEvent:"select.search.matches"}),!0);}),nc=ec(function(t,_ref49){var e=_ref49.query;var i=t.state,_i$selection$main=i.selection.main,s=_i$selection$main.from,r=_i$selection$main.to;if(i.readOnly)return!1;var n=e.nextMatch(i,s,s);if(!n)return!1;var h,l,o=n,u=[],f=[];if(o.from==s&&o.to==r&&(l=i.toText(e.getReplacement(o)),u.push({from:o.from,to:o.to,insert:l}),o=e.nextMatch(i,o.from,o.to),f.push(en.announce.of(i.phrase("replaced match on line $",i.doc.lineAt(s).number)+"."))),o){var _e239=0==u.length||u[0].from>=n.to?0:n.to-n.from-l.length;h=$.single(o.from-_e239,o.to-_e239),f.push(bc(t,o)),f.push(i.facet(za).scrollToMatch(h.main,t));}return t.dispatch({changes:u,selection:h,effects:f,userEvent:"input.replace"}),!0;}),hc=ec(function(t,_ref50){var e=_ref50.query;if(t.state.readOnly)return!1;var i=e.matchAll(t.state,1e9).map(function(t){var i=t.from,s=t.to;return{from:i,to:s,insert:e.getReplacement(t)};});if(!i.length)return!1;var s=t.state.phrase("replaced $ matches",i.length)+".";return t.dispatch({changes:i,effects:en.announce.of(s),userEvent:"input.replace.all"}),!0;});ac=function ac(t){var e=t.state.field(Xa,!1);if(e&&e.panel){var _i201=uc(t);if(_i201&&_i201!=t.root.activeElement){var _s189=oc(t.state,e.query.spec);_s189.valid&&t.dispatch({effects:Ka.of(_s189)}),_i201.focus(),_i201.select();}}else t.dispatch({effects:[_a.of(!0),e?Ka.of(oc(t.state,e.query.spec)):mt.appendConfig.of(kc)]});return!0;},cc=function cc(t){var e=t.state.field(Xa,!1);if(!e||!e.panel)return!1;var i=vh(t,lc);return i&&i.dom.contains(t.root.activeElement)&&t.focus(),t.dispatch({effects:_a.of(!1)}),!0;},dc=[{key:"Mod-f",run:ac,scope:"editor search-panel"},{key:"F3",run:ic,shift:sc,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:ic,shift:sc,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:cc,scope:"editor search-panel"},{key:"Mod-Shift-l",run:function run(_ref51){var t=_ref51.state,e=_ref51.dispatch;var i=t.selection;if(i.ranges.length>1||i.main.empty)return!1;var _i$main=i.main,s=_i$main.from,r=_i$main.to,n=[],h=0;for(var _e240=new ka(t.doc,t.sliceDoc(s,r));!_e240.next().done;){if(n.length>1e3)return!1;_e240.value.from==s&&(h=n.length),n.push($.range(_e240.value.from,_e240.value.to));}return e(t.update({selection:$.create(n,h),userEvent:"select.search.matches"})),!0;}},{key:"Mod-Alt-g",run:function run(t){var e=vh(t,Oa);if(!e){var _i202=[Ea.of(!0)];null==t.state.field(Ia,!1)&&_i202.push(mt.appendConfig.of([Ia,Ra])),t.dispatch({effects:_i202}),e=vh(t,Oa);}return e&&e.dom.querySelector("input").select(),!0;}},{key:"Mod-d",run:function run(_ref52){var t=_ref52.state,e=_ref52.dispatch;var i=t.selection.ranges;if(i.some(function(t){return t.from===t.to;}))return function(_ref53){var t=_ref53.state,e=_ref53.dispatch;var i=t.selection,s=$.create(i.ranges.map(function(e){return t.wordAt(e.head)||$.cursor(e.head);}),i.mainIndex);return!s.eq(i)&&(e(t.update({selection:s})),!0);}({state:t,dispatch:e});var s=t.sliceDoc(i[0].from,i[0].to);if(t.selection.ranges.some(function(e){return t.sliceDoc(e.from,e.to)!=s;}))return!1;var r=function(t,e){var _t$selection=t.selection,i=_t$selection.main,s=_t$selection.ranges,r=t.wordAt(i.head),n=r&&r.from==i.from&&r.to==i.to;var _loop17=function _loop17(_i204,_r156){if(_r156.next(),!_r156.done){if(_i204&&s.some(function(t){return t.from==_r156.value.from;})){_i203=_i204,_r155=_r156;return 0;}// continue
|
|
3
|
-
if(n){var
|
|
4
|
-
}return{v:_r156.value};}if(_i204)return{v:null};_r156=new ka(t.doc,e,0,Math.max(0,s[s.length-1].from-1)),_i204=!0;_i203=_i204,_r155=_r156;},_ret2;for(var _i203=!1,_r155=new ka(t.doc,e,s[s.length-1].to);;){_ret2=_loop17(_i203,_r155);if(_ret2===0)continue;if(_ret2)return _ret2.v;}}(t,s);return!!r&&(e(t.update({selection:t.selection.addRange($.range(r.from,r.to),!1),effects:en.scrollIntoView(r.to)})),!0);},preventDefault:!0}];pc=/*#__PURE__*/function(){function pc(t){var _this83=this;_classCallCheck(this,pc);this.view=t;var e=this.query=t.state.field(Xa).query.spec;function i(t,e,i){return wa("button",{"class":"cm-button",name:t,onclick:e,type:"button"},i);}this.commit=this.commit.bind(this),this.searchField=wa("input",{value:e.search,placeholder:mc(t,"Find"),"aria-label":mc(t,"Find"),"class":"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=wa("input",{value:e.replace,placeholder:mc(t,"Replace"),"aria-label":mc(t,"Replace"),"class":"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=wa("input",{type:"checkbox",name:"case",form:"",checked:e.caseSensitive,onchange:this.commit}),this.reField=wa("input",{type:"checkbox",name:"re",form:"",checked:e.regexp,onchange:this.commit}),this.wordField=wa("input",{type:"checkbox",name:"word",form:"",checked:e.wholeWord,onchange:this.commit}),this.dom=wa("div",{onkeydown:function onkeydown(t){return _this83.keydown(t);},"class":"cm-search"},[this.searchField,i("next",function(){return ic(t);},[mc(t,"next")]),i("prev",function(){return sc(t);},[mc(t,"previous")]),i("select",function(){return rc(t);},[mc(t,"all")]),wa("label",null,[this.caseField,mc(t,"match case")]),wa("label",null,[this.reField,mc(t,"regexp")]),wa("label",null,[this.wordField,mc(t,"by word")])].concat(_toConsumableArray(t.state.readOnly?[]:[wa("br"),this.replaceField,i("replace",function(){return nc(t);},[mc(t,"replace")]),i("replaceAll",function(){return hc(t);},[mc(t,"replace all")])]),[wa("button",{name:"close",onclick:function onclick(){return cc(t);},"aria-label":mc(t,"close"),type:"button"},["×"])]));}return _createClass(pc,[{key:"commit",value:function commit(){var t=new Ha({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});t.eq(this.query)||(this.query=t,this.view.dispatch({effects:Ka.of(t)}));}},{key:"keydown",value:function keydown(t){var e,i,s;e=this.view,i=t,s="search-panel",gn(cn(e.state),i,e,s)?t.preventDefault():13==t.keyCode&&t.target==this.searchField?(t.preventDefault(),(t.shiftKey?sc:ic)(this.view)):13==t.keyCode&&t.target==this.replaceField&&(t.preventDefault(),nc(this.view));}},{key:"update",value:function update(t){var _iterator204=_createForOfIteratorHelper(t.transactions),_step204;try{for(_iterator204.s();!(_step204=_iterator204.n()).done;){var _e242=_step204.value;var _iterator205=_createForOfIteratorHelper(_e242.effects),_step205;try{for(_iterator205.s();!(_step205=_iterator205.n()).done;){var _t272=_step205.value;_t272.is(Ka)&&!_t272.value.eq(this.query)&&this.setQuery(_t272.value);}}catch(err){_iterator205.e(err);}finally{_iterator205.f();}}}catch(err){_iterator204.e(err);}finally{_iterator204.f();}}},{key:"setQuery",value:function setQuery(t){this.query=t,this.searchField.value=t.search,this.replaceField.value=t.replace,this.caseField.checked=t.caseSensitive,this.reField.checked=t.regexp,this.wordField.checked=t.wholeWord;}},{key:"mount",value:function mount(){this.searchField.select();}},{key:"pos",get:function get(){return 80;}},{key:"top",get:function get(){return this.view.state.facet(za).top;}}]);}();gc=30,wc=/[\s\.,:;?!]/;vc=en.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),kc=[Xa,Q.low(tc),vc];yc=/*#__PURE__*/function(){function yc(t,e,i,s){_classCallCheck(this,yc);this.state=t,this.pos=e,this.explicit=i,this.view=s,this.abortListeners=[],this.abortOnDocChange=!1;}return _createClass(yc,[{key:"tokenBefore",value:function tokenBefore(t){var e=yo(this.state).resolveInner(this.pos,-1);for(;e&&t.indexOf(e.name)<0;)e=e.parent;return e?{from:e.from,to:this.pos,text:this.state.sliceDoc(e.from,this.pos),type:e.type}:null;}},{key:"matchBefore",value:function matchBefore(t){var e=this.state.doc.lineAt(this.pos),i=Math.max(e.from,this.pos-250),s=e.text.slice(i-e.from,this.pos-e.from),r=s.search(Dc(t,!1));return r<0?null:{from:i+r,to:this.pos,text:s.slice(r)};}},{key:"aborted",get:function get(){return null==this.abortListeners;}},{key:"addEventListener",value:function addEventListener(t,e,i){"abort"==t&&this.abortListeners&&(this.abortListeners.push(e),i&&i.onDocChange&&(this.abortOnDocChange=!0));}}]);}();Ac=/*#__PURE__*/_createClass(function Ac(t,e,i,s){_classCallCheck(this,Ac);this.completion=t,this.source=e,this.match=i,this.score=s;});Oc=ct.define();Ec=new WeakMap();Rc=mt.define(),Tc=mt.define();Bc=/*#__PURE__*/function(){function Bc(t){_classCallCheck(this,Bc);this.pattern=t,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(var _e244=0;_e244<t.length;){var _i205=M(t,_e244),_s191=S(_i205);this.chars.push(_i205);var _r157=t.slice(_e244,_e244+_s191),_n115=_r157.toUpperCase();this.folded.push(M(_n115==_r157?_r157.toLowerCase():_n115,0)),_e244+=_s191;}this.astral=t.length!=this.chars.length;}return _createClass(Bc,[{key:"ret",value:function ret(t,e){return this.score=t,this.matched=e,this;}},{key:"match",value:function match(t){if(0==this.pattern.length)return this.ret(-100,[]);if(t.length<this.pattern.length)return null;var e=this.chars,i=this.folded,s=this.any,r=this.precise,n=this.byWord;if(1==e.length){var _s192=M(t,0),_r158=S(_s192),_n116=_r158==t.length?0:-100;if(_s192==e[0]);else{if(_s192!=i[0])return null;_n116+=-200;}return this.ret(_n116,[0,_r158]);}var h=t.indexOf(this.pattern);if(0==h)return this.ret(t.length==this.pattern.length?0:-100,[0,this.pattern.length]);var l=e.length,o=0;if(h<0){for(var _r159=0,_n117=Math.min(t.length,200);_r159<_n117&&o<l;){var _n118=M(t,_r159);_n118!=e[o]&&_n118!=i[o]||(s[o++]=_r159),_r159+=S(_n118);}if(o<l)return null;}var u=0,f=0,a=!1,c=0,d=-1,p=-1,m=/[a-z]/.test(t),g=!0;for(var _s193=0,_o43=Math.min(t.length,200),_w3=0;_s193<_o43&&f<l;){var _o44=M(t,_s193);h<0&&(u<l&&_o44==e[u]&&(r[u++]=_s193),c<l&&(_o44==e[c]||_o44==i[c]?(0==c&&(d=_s193),p=_s193+1,c++):c=0));var _b2=void 0,_v2=_o44<255?_o44>=48&&_o44<=57||_o44>=97&&_o44<=122?2:_o44>=65&&_o44<=90?1:0:(_b2=x(_o44))!=_b2.toLowerCase()?1:_b2!=_b2.toUpperCase()?2:0;(!_s193||1==_v2&&m||0==_w3&&0!=_v2)&&(e[f]==_o44||i[f]==_o44&&(a=!0)?n[f++]=_s193:n.length&&(g=!1)),_w3=_v2,_s193+=S(_o44);}return f==l&&0==n[0]&&g?this.result((a?-200:0)-100,n,t):c==l&&0==d?this.ret(-200-t.length+(p==t.length?0:-100),[0,p]):h>-1?this.ret(-700-t.length,[h,h+this.pattern.length]):c==l?this.ret(-900-t.length,[d,p]):f==l?this.result((a?-200:0)-100-700+(g?0:-1100),n,t):2==e.length?null:this.result((s[0]?-700:0)-200-1100,s,t);}},{key:"result",value:function result(t,e,i){var s=[],r=0;var _iterator207=_createForOfIteratorHelper(e),_step207;try{for(_iterator207.s();!(_step207=_iterator207.n()).done;){var _t276=_step207.value;var _e245=_t276+(this.astral?S(M(i,_t276)):1);r&&s[r-1]==_t276?s[r-1]=_e245:(s[r++]=_t276,s[r++]=_e245);}}catch(err){_iterator207.e(err);}finally{_iterator207.f();}return this.ret(t-i.length,s);}}]);}();Lc=/*#__PURE__*/function(){function Lc(t){_classCallCheck(this,Lc);this.pattern=t,this.matched=[],this.score=0,this.folded=t.toLowerCase();}return _createClass(Lc,[{key:"match",value:function match(t){if(t.length<this.pattern.length)return null;var e=t.slice(0,this.pattern.length),i=e==this.pattern?0:e.toLowerCase()==this.folded?-200:null;return null==i?null:(this.matched=[0,e.length],this.score=i+(t.length==this.pattern.length?0:-100),this);}}]);}();Nc=z.define({combine:function combine(t){return Ot(t,{activateOnTyping:!0,activateOnCompletion:function activateOnCompletion(){return!1;},activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:function tooltipClass(){return"";},optionClass:function optionClass(){return"";},aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:jc,filterStrict:!1,compareCompletions:function compareCompletions(t,e){return t.label.localeCompare(e.label);},interactionDelay:75,updateSyncTime:100},{defaultKeymap:function defaultKeymap(t,e){return t&&e;},closeOnBlur:function closeOnBlur(t,e){return t&&e;},icons:function icons(t,e){return t&&e;},tooltipClass:function tooltipClass(t,e){return function(i){return $c(t(i),e(i));};},optionClass:function optionClass(t,e){return function(i){return $c(t(i),e(i));};},addToOptions:function addToOptions(t,e){return t.concat(e);},filterStrict:function filterStrict(t,e){return t||e;}});}});zc=/*#__PURE__*/function(){function zc(t,e,i){var _this84=this;_classCallCheck(this,zc);this.view=t,this.stateField=e,this.applyCompletion=i,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:function read(){return _this84.measureInfo();},write:function write(t){return _this84.placeInfo(t);},key:this},this.space=null,this.currentClass="";var s=t.state.field(e),_s$open=s.open,r=_s$open.options,n=_s$open.selected,h=t.state.facet(Nc);this.optionContent=function(t){var e=t.addToOptions.slice();return t.icons&&e.push({render:function render(t){var _e$classList;var e=document.createElement("div");return e.classList.add("cm-completionIcon"),t.type&&(_e$classList=e.classList).add.apply(_e$classList,_toConsumableArray(t.type.split(/\s+/g).map(function(t){return"cm-completionIcon-"+t;}))),e.setAttribute("aria-hidden","true"),e;},position:20}),e.push({render:function render(t,e,i,s){var r=document.createElement("span");r.className="cm-completionLabel";var n=t.displayLabel||t.label,h=0;for(var _t279=0;_t279<s.length;){var _e246=s[_t279++],_i206=s[_t279++];_e246>h&&r.appendChild(document.createTextNode(n.slice(h,_e246)));var _l67=r.appendChild(document.createElement("span"));_l67.appendChild(document.createTextNode(n.slice(_e246,_i206))),_l67.className="cm-completionMatchedText",h=_i206;}return h<n.length&&r.appendChild(document.createTextNode(n.slice(h))),r;},position:50},{render:function render(t){if(!t.detail)return null;var e=document.createElement("span");return e.className="cm-completionDetail",e.textContent=t.detail,e;},position:80}),e.sort(function(t,e){return t.position-e.position;}).map(function(t){return t.render;});}(h),this.optionClass=h.optionClass,this.tooltipClass=h.tooltipClass,this.range=Pc(r.length,n,h.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(t.state),this.dom.addEventListener("mousedown",function(i){var s=t.state.field(e).open.options;for(var _e247,_r160=i.target;_r160&&_r160!=_this84.dom;_r160=_r160.parentNode)if("LI"==_r160.nodeName&&(_e247=/-(\d+)$/.exec(_r160.id))&&+_e247[1]<s.length)return _this84.applyCompletion(t,s[+_e247[1]]),void i.preventDefault();}),this.dom.addEventListener("focusout",function(e){var i=t.state.field(_this84.stateField,!1);i&&i.tooltip&&t.state.facet(Nc).closeOnBlur&&e.relatedTarget!=t.contentDOM&&t.dispatch({effects:Tc.of(null)});}),this.showOptions(r,s.id);}return _createClass(zc,[{key:"mount",value:function mount(){this.updateSel();}},{key:"showOptions",value:function showOptions(t,e){var _this85=this;this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(t,e,this.range)),this.list.addEventListener("scroll",function(){_this85.info&&_this85.view.requestMeasure(_this85.placeInfoReq);});}},{key:"update",value:function update(t){var e;var i=t.state.field(this.stateField),s=t.startState.field(this.stateField);if(this.updateTooltipClass(t.state),i!=s){var _i$open=i.open,_r161=_i$open.options,_n119=_i$open.selected,_h86=_i$open.disabled;s.open&&s.open.options==_r161||(this.range=Pc(_r161.length,_n119,t.state.facet(Nc).maxRenderedOptions),this.showOptions(_r161,i.id)),this.updateSel(),_h86!=(null===(e=s.open)||void 0===e?void 0:e.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!_h86);}}},{key:"updateTooltipClass",value:function updateTooltipClass(t){var e=this.tooltipClass(t);if(e!=this.currentClass){var _iterator208=_createForOfIteratorHelper(this.currentClass.split(" ")),_step208;try{for(_iterator208.s();!(_step208=_iterator208.n()).done;){var _t280=_step208.value;_t280&&this.dom.classList.remove(_t280);}}catch(err){_iterator208.e(err);}finally{_iterator208.f();}var _iterator209=_createForOfIteratorHelper(e.split(" ")),_step209;try{for(_iterator209.s();!(_step209=_iterator209.n()).done;){var _t281=_step209.value;_t281&&this.dom.classList.add(_t281);}}catch(err){_iterator209.e(err);}finally{_iterator209.f();}this.currentClass=e;}}},{key:"positioned",value:function positioned(t){this.space=t,this.info&&this.view.requestMeasure(this.placeInfoReq);}},{key:"updateSel",value:function updateSel(){var _this86=this;var t=this.view.state.field(this.stateField),e=t.open;if((e.selected>-1&&e.selected<this.range.from||e.selected>=this.range.to)&&(this.range=Pc(e.options.length,e.selected,this.view.state.facet(Nc).maxRenderedOptions),this.showOptions(e.options,t.id)),this.updateSelectedOption(e.selected)){this.destroyInfo();var _i207=e.options[e.selected].completion,_s194=_i207.info;if(!_s194)return;var _r162="string"==typeof _s194?document.createTextNode(_s194):_s194(_i207);if(!_r162)return;"then"in _r162?_r162.then(function(e){e&&_this86.view.state.field(_this86.stateField,!1)==t&&_this86.addInfoPane(e,_i207);})["catch"](function(t){return Qi(_this86.view.state,t,"completion info");}):this.addInfoPane(_r162,_i207);}}},{key:"addInfoPane",value:function addInfoPane(t,e){this.destroyInfo();var i=this.info=document.createElement("div");if(i.className="cm-tooltip cm-completionInfo",null!=t.nodeType)i.appendChild(t),this.infoDestroy=null;else{var _e248=t.dom,_s195=t.destroy;i.appendChild(_e248),this.infoDestroy=_s195||null;}this.dom.appendChild(i),this.view.requestMeasure(this.placeInfoReq);}},{key:"updateSelectedOption",value:function updateSelectedOption(t){var e=null;for(var _i208=this.list.firstChild,_s196=this.range.from;_i208;_i208=_i208.nextSibling,_s196++)"LI"==_i208.nodeName&&_i208.id?_s196==t?_i208.hasAttribute("aria-selected")||(_i208.setAttribute("aria-selected","true"),e=_i208):_i208.hasAttribute("aria-selected")&&_i208.removeAttribute("aria-selected"):_s196--;return e&&function(t,e){var i=t.getBoundingClientRect(),s=e.getBoundingClientRect(),r=i.height/t.offsetHeight;s.top<i.top?t.scrollTop-=(i.top-s.top)/r:s.bottom>i.bottom&&(t.scrollTop+=(s.bottom-i.bottom)/r);}(this.list,e),e;}},{key:"measureInfo",value:function measureInfo(){var t=this.dom.querySelector("[aria-selected]");if(!t||!this.info)return null;var e=this.dom.getBoundingClientRect(),i=this.info.getBoundingClientRect(),s=t.getBoundingClientRect(),r=this.space;if(!r){var _t282=this.dom.ownerDocument.defaultView||window;r={left:0,top:0,right:_t282.innerWidth,bottom:_t282.innerHeight};}return s.top>Math.min(r.bottom,e.bottom)-10||s.bottom<Math.max(r.top,e.top)+10?null:this.view.state.facet(Nc).positionInfo(this.view,e,s,i,r,this.dom);}},{key:"placeInfo",value:function placeInfo(t){this.info&&(t?(t.style&&(this.info.style.cssText=t.style),this.info.className="cm-tooltip cm-completionInfo "+(t["class"]||"")):this.info.style.cssText="top: -1e6px");}},{key:"createListBox",value:function createListBox(t,e,i){var s=document.createElement("ul");s.id=e,s.setAttribute("role","listbox"),s.setAttribute("aria-expanded","true"),s.setAttribute("aria-label",this.view.state.phrase("Completions"));var r=null;for(var _n120=i.from;_n120<i.to;_n120++){var _t$_n=t[_n120],_h87=_t$_n.completion,_l68=_t$_n.match,_o45=_h87.section;if(_o45){var _t283="string"==typeof _o45?_o45:_o45.name;if(_t283!=r&&(_n120>i.from||0==i.from))if(r=_t283,"string"!=typeof _o45&&_o45.header)s.appendChild(_o45.header(_o45));else{s.appendChild(document.createElement("completion-section")).textContent=_t283;}}var _u33=s.appendChild(document.createElement("li"));_u33.id=e+"-"+_n120,_u33.setAttribute("role","option");var _f25=this.optionClass(_h87);_f25&&(_u33.className=_f25);var _iterator210=_createForOfIteratorHelper(this.optionContent),_step210;try{for(_iterator210.s();!(_step210=_iterator210.n()).done;){var _t284=_step210.value;var _e249=_t284(_h87,this.view.state,this.view,_l68);_e249&&_u33.appendChild(_e249);}}catch(err){_iterator210.e(err);}finally{_iterator210.f();}}return i.from&&s.classList.add("cm-completionListIncompleteTop"),i.to<t.length&&s.classList.add("cm-completionListIncompleteBottom"),s;}},{key:"destroyInfo",value:function destroyInfo(){this.info&&(this.infoDestroy&&this.infoDestroy(),this.info.remove(),this.info=null);}},{key:"destroy",value:function destroy(){this.destroyInfo();}}]);}();Wc=/*#__PURE__*/function(){function Wc(t,e,i,s,r,n){_classCallCheck(this,Wc);this.options=t,this.attrs=e,this.tooltip=i,this.timestamp=s,this.selected=r,this.disabled=n;}return _createClass(Wc,[{key:"setSelected",value:function setSelected(t,e){return t==this.selected||t>=this.options.length?this:new Wc(this.options,Jc(e,t),this.tooltip,this.timestamp,t,this.disabled);}},{key:"map",value:function map(t){return new Wc(this.options,this.attrs,Object.assign(Object.assign({},this.tooltip),{pos:t.mapPos(this.tooltip.pos)}),this.timestamp,this.selected,this.disabled);}},{key:"setDisabled",value:function setDisabled(){return new Wc(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0);}}],[{key:"build",value:function build(t,e,i,s,r,n){if(s&&!n&&t.some(function(t){return t.isPending;}))return s.setDisabled();var h=function(t,e){var i=[],s=null,r=function r(t){i.push(t);var e=t.completion.section;if(e){s||(s=[]);var _t285="string"==typeof e?e:e.name;s.some(function(e){return e.name==_t285;})||s.push("string"==typeof e?{name:_t285}:e);}},n=e.facet(Nc);var _iterator211=_createForOfIteratorHelper(t),_step211;try{for(_iterator211.s();!(_step211=_iterator211.n()).done;){var _s197=_step211.value;if(_s197.hasResult()){var _t287=_s197.result.getMatch;if(!1===_s197.result.filter){var _iterator215=_createForOfIteratorHelper(_s197.result.options),_step215;try{for(_iterator215.s();!(_step215=_iterator215.n()).done;){var _e252=_step215.value;r(new Ac(_e252,_s197.source,_t287?_t287(_e252):[],1e9-i.length));}}catch(err){_iterator215.e(err);}finally{_iterator215.f();}}else{var _i211=void 0,_h88=e.sliceDoc(_s197.from,_s197.to),_l69=n.filterStrict?new Lc(_h88):new Bc(_h88);var _iterator216=_createForOfIteratorHelper(_s197.result.options),_step216;try{for(_iterator216.s();!(_step216=_iterator216.n()).done;){var _e253=_step216.value;if(_i211=_l69.match(_e253.label)){var _n121=_e253.displayLabel?_t287?_t287(_e253,_i211.matched):[]:_i211.matched;r(new Ac(_e253,_s197.source,_n121,_i211.score+(_e253.boost||0)));}}}catch(err){_iterator216.e(err);}finally{_iterator216.f();}}}}}catch(err){_iterator211.e(err);}finally{_iterator211.f();}if(s){var _t286=Object.create(null),_e250=0,_r163=function _r163(t,e){var i,s;return(null!==(i=t.rank)&&void 0!==i?i:1e9)-(null!==(s=e.rank)&&void 0!==s?s:1e9)||(t.name<e.name?-1:1);};var _iterator212=_createForOfIteratorHelper(s.sort(_r163)),_step212;try{for(_iterator212.s();!(_step212=_iterator212.n()).done;){var _i209=_step212.value;_e250-=1e5,_t286[_i209.name]=_e250;}}catch(err){_iterator212.e(err);}finally{_iterator212.f();}var _iterator213=_createForOfIteratorHelper(i),_step213;try{for(_iterator213.s();!(_step213=_iterator213.n()).done;){var _e251=_step213.value;var _i210=_e251.completion.section;_i210&&(_e251.score+=_t286["string"==typeof _i210?_i210:_i210.name]);}}catch(err){_iterator213.e(err);}finally{_iterator213.f();}}var h=[],l=null,o=n.compareCompletions;var _iterator214=_createForOfIteratorHelper(i.sort(function(t,e){return e.score-t.score||o(t.completion,e.completion);})),_step214;try{for(_iterator214.s();!(_step214=_iterator214.n()).done;){var _t288=_step214.value;var _e254=_t288.completion;!l||l.label!=_e254.label||l.detail!=_e254.detail||null!=l.type&&null!=_e254.type&&l.type!=_e254.type||l.apply!=_e254.apply||l.boost!=_e254.boost?h.push(_t288):Fc(_t288.completion)>Fc(l)&&(h[h.length-1]=_t288),l=_t288.completion;}}catch(err){_iterator214.e(err);}finally{_iterator214.f();}return h;}(t,e);if(!h.length)return s&&t.some(function(t){return t.isPending;})?s.setDisabled():null;var l=e.facet(Nc).selectOnOpen?0:-1;if(s&&s.selected!=l&&-1!=s.selected){var _t289=s.options[s.selected].completion;for(var _e255=0;_e255<h.length;_e255++)if(h[_e255].completion==_t289){l=_e255;break;}}return new Wc(h,Jc(i,l),{pos:t.reduce(function(t,e){return e.hasResult()?Math.min(t,e.from):t;},1e8),create:ed,above:r.aboveCursor},s?s.timestamp:Date.now(),l,!1);}}]);}();Vc=/*#__PURE__*/function(){function Vc(t,e,i){_classCallCheck(this,Vc);this.active=t,this.id=e,this.open=i;}return _createClass(Vc,[{key:"update",value:function update(t){var _this87=this;var e=t.state,i=e.facet(Nc),s=(i.override||e.languageDataAt("autocomplete",Cc(e)).map(Ic)).map(function(e){return(_this87.active.find(function(t){return t.source==e;})||new _c(e,_this87.active.some(function(t){return 0!=t.state;})?1:0)).update(t,i);});s.length==this.active.length&&s.every(function(t,e){return t==_this87.active[e];})&&(s=this.active);var r=this.open,n=t.effects.some(function(t){return t.is(Yc);});r&&t.docChanged&&(r=r.map(t.changes)),t.selection||s.some(function(e){return e.hasResult()&&t.changes.touchesRange(e.from,e.to);})||!function(t,e){if(t==e)return!0;for(var _i212=0,_s198=0;;){for(;_i212<t.length&&!t[_i212].hasResult();)_i212++;for(;_s198<e.length&&!e[_s198].hasResult();)_s198++;var _r164=_i212==t.length,_n122=_s198==e.length;if(_r164||_n122)return _r164==_n122;if(t[_i212++].result!=e[_s198++].result)return!1;}}(s,this.active)||n?r=Wc.build(s,e,this.id,r,i,n):r&&r.disabled&&!s.some(function(t){return t.isPending;})&&(r=null),!r&&s.every(function(t){return!t.isPending;})&&s.some(function(t){return t.hasResult();})&&(s=s.map(function(t){return t.hasResult()?new _c(t.source,0):t;}));var _iterator217=_createForOfIteratorHelper(t.effects),_step217;try{for(_iterator217.s();!(_step217=_iterator217.n()).done;){var _e256=_step217.value;_e256.is(Qc)&&(r=r&&r.setSelected(_e256.value,this.id));}}catch(err){_iterator217.e(err);}finally{_iterator217.f();}return s==this.active&&r==this.open?this:new Vc(s,this.id,r);}},{key:"tooltip",get:function get(){return this.open?this.open.tooltip:null;}},{key:"attrs",get:function get(){return this.open?this.open.attrs:this.active.length?qc:Uc;}}],[{key:"start",value:function start(){return new Vc(Gc,"cm-ac-"+Math.floor(2e6*Math.random()).toString(36),null);}}]);}();qc={"aria-autocomplete":"list"},Uc={};Gc=[];_c=/*#__PURE__*/function(){function _c(t,e){var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!1;_classCallCheck(this,_c);this.source=t,this.state=e,this.explicit=i;}return _createClass(_c,[{key:"hasResult",value:function hasResult(){return!1;}},{key:"isPending",get:function get(){return 1==this.state;}},{key:"update",value:function update(t,e){var i=Kc(t,e),s=this;(8&i||16&i&&this.touches(t))&&(s=new _c(s.source,0)),4&i&&0==s.state&&(s=new _c(this.source,1)),s=s.updateFor(t,i);var _iterator218=_createForOfIteratorHelper(t.effects),_step218;try{for(_iterator218.s();!(_step218=_iterator218.n()).done;){var _e257=_step218.value;if(_e257.is(Rc))s=new _c(s.source,1,_e257.value);else if(_e257.is(Tc))s=new _c(s.source,0);else if(_e257.is(Yc)){var _iterator219=_createForOfIteratorHelper(_e257.value),_step219;try{for(_iterator219.s();!(_step219=_iterator219.n()).done;){var _t290=_step219.value;_t290.source==s.source&&(s=_t290);}}catch(err){_iterator219.e(err);}finally{_iterator219.f();}}}}catch(err){_iterator218.e(err);}finally{_iterator218.f();}return s;}},{key:"updateFor",value:function updateFor(t,e){return this.map(t.changes);}},{key:"map",value:function map(t){return this;}},{key:"touches",value:function touches(t){return t.changes.touchesRange(Cc(t.state));}}]);}();Xc=/*#__PURE__*/function(_c16){function Xc(t,e,i,s,r,n){var _this88;_classCallCheck(this,Xc);_this88=_callSuper(this,Xc,[t,3,e]),_this88.limit=i,_this88.result=s,_this88.from=r,_this88.to=n;return _this88;}_inherits(Xc,_c16);return _createClass(Xc,[{key:"hasResult",value:function hasResult(){return!0;}},{key:"updateFor",value:function updateFor(t,e){var i;if(!(3&e))return this.map(t.changes);var s=this.result;s.map&&!t.changes.empty&&(s=s.map(s,t.changes));var r=t.changes.mapPos(this.from),n=t.changes.mapPos(this.to,1),h=Cc(t.state);if(h>n||!s||2&e&&(Cc(t.startState)==this.from||h<this.limit))return new _c(this.source,4&e?1:0);var l=t.changes.mapPos(this.limit);return function(t,e,i,s){if(!t)return!1;var r=e.sliceDoc(i,s);return"function"==typeof t?t(r,i,s,e):Dc(t,!0).test(r);}(s.validFor,t.state,r,n)?new Xc(this.source,this.explicit,l,s,r,n):s.update&&(s=s.update(s,r,n,new yc(t.state,h,!1)))?new Xc(this.source,this.explicit,l,s,s.from,null!==(i=s.to)&&void 0!==i?i:Cc(t.state)):new _c(this.source,1,this.explicit);}},{key:"map",value:function map(t){if(t.empty)return this;return(this.result.map?this.result.map(this.result,t):this.result)?new Xc(this.source,this.explicit,t.mapPos(this.limit),this.result,t.mapPos(this.from),t.mapPos(this.to,1)):new _c(this.source,0);}},{key:"touches",value:function touches(t){return t.changes.touchesRange(this.from,this.to);}}]);}(_c);Yc=mt.define({map:function map(t,e){return t.map(function(t){return t.map(e);});}}),Qc=mt.define(),Zc=J.define({create:function create(){return Vc.start();},update:function update(t,e){return t.update(e);},provide:function provide(t){return[uh.from(t,function(t){return t.tooltip;}),en.contentAttributes.from(t,function(t){return t.attrs;})];}});ed=Hc(Zc,td);_export("w",sd=function sd(t){var e=t.state.field(Zc,!1);return!(t.state.readOnly||!e||!e.open||e.open.selected<0||e.open.disabled||Date.now()-e.open.timestamp<t.state.facet(Nc).interactionDelay)&&td(t,e.open.options[e.open.selected]);}),rd=function rd(t){return!!t.state.field(Zc,!1)&&(t.dispatch({effects:Rc.of(!0)}),!0);},_export("y",nd=function nd(t){var e=t.state.field(Zc,!1);return!(!e||!e.active.some(function(t){return 0!=t.state;}))&&(t.dispatch({effects:Tc.of(null)}),!0);});hd=/*#__PURE__*/_createClass(function hd(t,e){_classCallCheck(this,hd);this.active=t,this.context=e,this.time=Date.now(),this.updates=[],this.done=void 0;});ld=is.fromClass(/*#__PURE__*/function(){function _class13(t){_classCallCheck(this,_class13);this.view=t,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;var _iterator220=_createForOfIteratorHelper(t.state.field(Zc).active),_step220;try{for(_iterator220.s();!(_step220=_iterator220.n()).done;){var _e258=_step220.value;_e258.isPending&&this.startQuery(_e258);}}catch(err){_iterator220.e(err);}finally{_iterator220.f();}}return _createClass(_class13,[{key:"update",value:function update(t){var _this89=this;var e=t.state.field(Zc),i=t.state.facet(Nc);if(!t.selectionSet&&!t.docChanged&&t.startState.field(Zc)==e)return;var s=t.transactions.some(function(t){var e=Kc(t,i);return 8&e||(t.selection||t.docChanged)&&!(3&e);});for(var _e259=0;_e259<this.running.length;_e259++){var _i214$updates;var _i214=this.running[_e259];if(s||_i214.context.abortOnDocChange&&t.docChanged||_i214.updates.length+t.transactions.length>50&&Date.now()-_i214.time>1e3){var _iterator221=_createForOfIteratorHelper(_i214.context.abortListeners),_step221;try{for(_iterator221.s();!(_step221=_iterator221.n()).done;){var _t291=_step221.value;try{_t291();}catch(t){Qi(this.view.state,t);}}}catch(err){_iterator221.e(err);}finally{_iterator221.f();}_i214.context.abortListeners=null,this.running.splice(_e259--,1);}else(_i214$updates=_i214.updates).push.apply(_i214$updates,_toConsumableArray(t.transactions));}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),t.transactions.some(function(t){return t.effects.some(function(t){return t.is(Rc);});})&&(this.pendingStart=!0);var r=this.pendingStart?50:i.activateOnTypingDelay;if(this.debounceUpdate=e.active.some(function(t){return t.isPending&&!_this89.running.some(function(e){return e.active.source==t.source;});})?setTimeout(function(){return _this89.startUpdate();},r):-1,0!=this.composing){var _iterator222=_createForOfIteratorHelper(t.transactions),_step222;try{for(_iterator222.s();!(_step222=_iterator222.n()).done;){var _e260=_step222.value;_e260.isUserEvent("input.type")?this.composing=2:2==this.composing&&_e260.selection&&(this.composing=3);}}catch(err){_iterator222.e(err);}finally{_iterator222.f();}}}},{key:"startUpdate",value:function startUpdate(){var _this90=this;this.debounceUpdate=-1,this.pendingStart=!1;var t=this.view.state,e=t.field(Zc);var _iterator223=_createForOfIteratorHelper(e.active),_step223;try{var _loop18=function _loop18(){var t=_step223.value;t.isPending&&!_this90.running.some(function(e){return e.active.source==t.source;})&&_this90.startQuery(t);};for(_iterator223.s();!(_step223=_iterator223.n()).done;){_loop18();}}catch(err){_iterator223.e(err);}finally{_iterator223.f();}this.running.length&&e.open&&e.open.disabled&&(this.debounceAccept=setTimeout(function(){return _this90.accept();},this.view.state.facet(Nc).updateSyncTime));}},{key:"startQuery",value:function startQuery(t){var _this91=this;var e=this.view.state,i=Cc(e),s=new yc(e,i,t.explicit,this.view),r=new hd(t,s);this.running.push(r),Promise.resolve(t.source(s)).then(function(t){r.context.aborted||(r.done=t||null,_this91.scheduleAccept());},function(t){_this91.view.dispatch({effects:Tc.of(null)}),Qi(_this91.view.state,t);});}},{key:"scheduleAccept",value:function scheduleAccept(){var _this92=this;this.running.every(function(t){return void 0!==t.done;})?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(function(){return _this92.accept();},this.view.state.facet(Nc).updateSyncTime));}},{key:"accept",value:function accept(){var _this93=this;var t;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;var e=[],i=this.view.state.facet(Nc),s=this.view.state.field(Zc);var _loop19=function _loop19(_r166){var n=_this93.running[_r166];if(void 0===n.done){_r165=_r166;return 0;}// continue
|
|
5
|
-
if(_this93.running.splice(
|
|
6
|
-
}}var h=s.active.find(function(t){return t.source==n.active.source;});if(h&&h.isPending)if(null==n.done){var _t293=new _c(n.active.source,0);var _iterator225=_createForOfIteratorHelper(n.updates),_step225;try{for(_iterator225.s();!(_step225=_iterator225.n()).done;){var _e261=_step225.value;_t293=_t293.update(_e261,i);}}catch(err){_iterator225.e(err);}finally{_iterator225.f();}_t293.isPending||e.push(_t293);}else _this93.startQuery(h);_r165=_r166;},_ret3;for(var _r165=0;_r165<this.running.length;_r165++){_ret3=_loop19(_r165);if(_ret3===0)continue;}(e.length||s.open&&s.open.disabled)&&this.view.dispatch({effects:Yc.of(e)});}}]);}(),{eventHandlers:{blur:function blur(t){var _this94=this;var e=this.view.state.field(Zc,!1);if(e&&e.tooltip&&this.view.state.facet(Nc).closeOnBlur){var _i215=e.open&&gh(this.view,e.open.tooltip);_i215&&_i215.dom.contains(t.relatedTarget)||setTimeout(function(){return _this94.view.dispatch({effects:Tc.of(null)});},10);}},compositionstart:function compositionstart(){this.composing=1;},compositionend:function compositionend(){var _this95=this;3==this.composing&&setTimeout(function(){return _this95.view.dispatch({effects:Rc.of(!1)});},20),this.composing=0;}}}),od="object"==(typeof navigator==="undefined"?"undefined":_typeof(navigator))&&/Win/.test(navigator.platform),ud=Q.highest(en.domEventHandlers({keydown:function keydown(t,e){var i=e.state.field(Zc,!1);if(!i||!i.open||i.open.disabled||i.open.selected<0||t.key.length>1||t.ctrlKey&&(!od||!t.altKey)||t.metaKey)return!1;var s=i.open.options[i.open.selected],r=i.active.find(function(t){return t.source==s.source;}),n=s.completion.commitCharacters||r.result.commitCharacters;return n&&n.indexOf(t.key)>-1&&td(e,s),!1;}})),fd=en.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});ad=/*#__PURE__*/_createClass(function ad(t,e,i,s){_classCallCheck(this,ad);this.field=t,this.line=e,this.from=i,this.to=s;});cd=/*#__PURE__*/function(){function cd(t,e,i){_classCallCheck(this,cd);this.field=t,this.from=e,this.to=i;}return _createClass(cd,[{key:"map",value:function map(t){var e=t.mapPos(this.from,-1,C.TrackDel),i=t.mapPos(this.to,1,C.TrackDel);return null==e||null==i?null:new cd(this.field,e,i);}}]);}();dd=/*#__PURE__*/function(){function dd(t,e){_classCallCheck(this,dd);this.lines=t,this.fieldPositions=e;}return _createClass(dd,[{key:"instantiate",value:function instantiate(t,e){var i=[],s=[e],r=t.doc.lineAt(e),n=/^\s*/.exec(r.text)[0];var _iterator226=_createForOfIteratorHelper(this.lines),_step226;try{for(_iterator226.s();!(_step226=_iterator226.n()).done;){var _r168=_step226.value;if(i.length){var _i216=n,_h90=/^\t*/.exec(_r168)[0].length;for(var _e262=0;_e262<_h90;_e262++)_i216+=t.facet(Bo);s.push(e+_i216.length-_h90),_r168=_i216+_r168.slice(_h90);}i.push(_r168),e+=_r168.length+1;}}catch(err){_iterator226.e(err);}finally{_iterator226.f();}var h=this.fieldPositions.map(function(t){return new cd(t.field,s[t.line]+t.from,s[t.line]+t.to);});return{text:i,ranges:h};}}],[{key:"parse",value:function parse(t){var e,i=[],s=[],r=[];var _iterator227=_createForOfIteratorHelper(t.split(/\r\n?|\n/)),_step227;try{for(_iterator227.s();!(_step227=_iterator227.n()).done;){var _n123=_step227.value;for(;e=/[#$]\{(?:(\d+)(?::([^}]*))?|((?:\\[{}]|[^}])*))\}/.exec(_n123);){var _t294=e[1]?+e[1]:null,_h91=e[2]||e[3]||"",_l70=-1,_o46=_h91.replace(/\\[{}]/g,function(t){return t[1];});for(var _e263=0;_e263<i.length;_e263++)(null!=_t294?i[_e263].seq==_t294:_o46&&i[_e263].name==_o46)&&(_l70=_e263);if(_l70<0){var _e264=0;for(;_e264<i.length&&(null==_t294||null!=i[_e264].seq&&i[_e264].seq<_t294);)_e264++;i.splice(_e264,0,{seq:_t294,name:_o46}),_l70=_e264;var _iterator228=_createForOfIteratorHelper(r),_step228;try{for(_iterator228.s();!(_step228=_iterator228.n()).done;){var _t295=_step228.value;_t295.field>=_l70&&_t295.field++;}}catch(err){_iterator228.e(err);}finally{_iterator228.f();}}r.push(new ad(_l70,s.length,e.index,e.index+_o46.length)),_n123=_n123.slice(0,e.index)+_h91+_n123.slice(e.index+e[0].length);}_n123=_n123.replace(/\\([{}])/g,function(t,e,i){var _iterator229=_createForOfIteratorHelper(r),_step229;try{for(_iterator229.s();!(_step229=_iterator229.n()).done;){var _t296=_step229.value;_t296.line==s.length&&_t296.from>i&&(_t296.from--,_t296.to--);}}catch(err){_iterator229.e(err);}finally{_iterator229.f();}return e;}),s.push(_n123);}}catch(err){_iterator227.e(err);}finally{_iterator227.f();}return new dd(s,r);}}]);}();pd=hi.widget({widget:new(/*#__PURE__*/function(_ri9){function _class14(){_classCallCheck(this,_class14);return _callSuper(this,_class14,arguments);}_inherits(_class14,_ri9);return _createClass(_class14,[{key:"toDOM",value:function toDOM(){var t=document.createElement("span");return t.className="cm-snippetFieldPosition",t;}},{key:"ignoreEvent",value:function ignoreEvent(){return!1;}}]);}(ri))()}),md=hi.mark({"class":"cm-snippetField"});gd=/*#__PURE__*/function(){function gd(t,e){_classCallCheck(this,gd);this.ranges=t,this.active=e,this.deco=hi.set(t.map(function(t){return(t.from==t.to?pd:md).range(t.from,t.to);}));}return _createClass(gd,[{key:"map",value:function map(t){var e=[];var _iterator230=_createForOfIteratorHelper(this.ranges),_step230;try{for(_iterator230.s();!(_step230=_iterator230.n()).done;){var _i217=_step230.value;var _s200=_i217.map(t);if(!_s200)return null;e.push(_s200);}}catch(err){_iterator230.e(err);}finally{_iterator230.f();}return new gd(e,this.active);}},{key:"selectionInsideField",value:function selectionInsideField(t){var _this96=this;return t.ranges.every(function(t){return _this96.ranges.some(function(e){return e.field==_this96.active&&e.from<=t.from&&e.to>=t.to;});});}}]);}();wd=mt.define({map:function map(t,e){return t&&t.map(e);}}),bd=mt.define(),vd=J.define({create:function create(){return null;},update:function update(t,e){var _iterator231=_createForOfIteratorHelper(e.effects),_step231;try{for(_iterator231.s();!(_step231=_iterator231.n()).done;){var _i218=_step231.value;if(_i218.is(wd))return _i218.value;if(_i218.is(bd)&&t)return new gd(t.ranges,_i218.value);}}catch(err){_iterator231.e(err);}finally{_iterator231.f();}return t&&e.docChanged&&(t=t.map(e.changes)),t&&e.selection&&!t.selectionInsideField(e.selection)&&(t=null),t;},provide:function provide(t){return en.decorations.from(t,function(t){return t?t.deco:hi.none;});}});xd=[{key:"Tab",run:Md(1),shift:Md(-1)},{key:"Escape",run:function run(_ref58){var t=_ref58.state,e=_ref58.dispatch;return!!t.field(vd,!1)&&(e(t.update({effects:wd.of(null)})),!0);}}],Sd=z.define({combine:function combine(t){return t.length?t[0]:xd;}}),Ad=Q.highest(fn.compute([Sd],function(t){return t.facet(Sd);}));Dd=en.domEventHandlers({mousedown:function mousedown(t,e){var i,s=e.state.field(vd,!1);if(!s||null==(i=e.posAtCoords({x:t.clientX,y:t.clientY})))return!1;var r=s.ranges.find(function(t){return t.from<=i&&t.to>=i;});return!(!r||r.field==s.active)&&(e.dispatch({selection:kd(s.ranges,r.field),effects:wd.of(s.ranges.some(function(t){return t.field>r.field;})?new gd(s.ranges,r.field):null),scrollIntoView:!0}),!0);}}),Od={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},Ed=mt.define({map:function map(t,e){var i=e.mapPos(t,-1,C.TrackAfter);return null==i?void 0:i;}}),Id=new(/*#__PURE__*/function(_Et3){function _class15(){_classCallCheck(this,_class15);return _callSuper(this,_class15,arguments);}_inherits(_class15,_Et3);return _createClass(_class15);}(Et))();Id.startSide=1,Id.endSide=-1;Rd=J.define({create:function create(){return Bt.empty;},update:function update(t,e){if(t=t.map(e.changes),e.selection){var _i220=e.state.doc.lineAt(e.selection.main.head);t=t.update({filter:function filter(t){return t>=_i220.from&&t<=_i220.to;}});}var _iterator232=_createForOfIteratorHelper(e.effects),_step232;try{for(_iterator232.s();!(_step232=_iterator232.n()).done;){var _i221=_step232.value;_i221.is(Ed)&&(t=t.update({add:[Id.range(_i221.value,_i221.value+1)]}));}}catch(err){_iterator232.e(err);}finally{_iterator232.f();}return t;}});Td="()[]{}<>";Nd="object"==(typeof navigator==="undefined"?"undefined":_typeof(navigator))&&/Android\b/.test(navigator.userAgent),$d=en.inputHandler.of(function(t,e,i,s){if((Nd?t.composing:t.compositionStarted)||t.state.readOnly)return!1;var r=t.state.selection.main;if(s.length>2||2==s.length&&1==S(M(s,0))||e!=r.from||i!=r.to)return!1;var n=function(t,e){var i=Ld(t,t.selection.main.head),s=i.brackets||Od.brackets;var _iterator233=_createForOfIteratorHelper(s),_step233;try{for(_iterator233.s();!(_step233=_iterator233.n()).done;){var _r169=_step233.value;var _n124=Bd(M(_r169,0));if(e==_r169)return _n124==_r169?Wd(t,_r169,s.indexOf(_r169+_r169+_r169)>-1,i):Hd(t,_r169,_n124,i.before||Od.before);if(e==_n124&&Pd(t,t.selection.main.from))return Fd(t,_r169,_n124);}}catch(err){_iterator233.e(err);}finally{_iterator233.f();}return null;}(t.state,s);return!!n&&(t.dispatch(n),!0);}),jd=[{key:"Backspace",run:function run(_ref59){var t=_ref59.state,e=_ref59.dispatch;if(t.readOnly)return!1;var i=Ld(t,t.selection.main.head).brackets||Od.brackets,s=null,r=t.changeByRange(function(e){if(e.empty){var _s201=function(t,e){var i=t.sliceString(e-2,e);return S(M(i,0))==i.length?i:i.slice(1);}(t.doc,e.head);var _iterator234=_createForOfIteratorHelper(i),_step234;try{for(_iterator234.s();!(_step234=_iterator234.n()).done;){var _r170=_step234.value;if(_r170==_s201&&zd(t.doc,e.head)==Bd(M(_r170,0)))return{changes:{from:e.head-_r170.length,to:e.head+_r170.length},range:$.cursor(e.head-_r170.length)};}}catch(err){_iterator234.e(err);}finally{_iterator234.f();}}return{range:s=e};});return s||e(t.update(r,{scrollIntoView:!0,userEvent:"delete.backward"})),!s;}}];Jd=[{key:"Ctrl-Space",run:rd},{mac:"Alt-`",run:rd},{key:"Escape",run:nd},{key:"ArrowDown",run:id(!0)},{key:"ArrowUp",run:id(!1)},{key:"PageDown",run:id(!0,"page")},{key:"PageUp",run:id(!1,"page")},{key:"Enter",run:sd}],Gd=Q.highest(fn.computeN([Nc],function(t){return t.facet(Nc).defaultKeymap?[Jd]:[];}));_d=/*#__PURE__*/_createClass(function _d(t,e,i){_classCallCheck(this,_d);this.from=t,this.to=e,this.diagnostic=i;});Xd=/*#__PURE__*/function(){function Xd(t,e,i){_classCallCheck(this,Xd);this.diagnostics=t,this.panel=e,this.selected=i;}return _createClass(Xd,null,[{key:"init",value:function init(t,e,i){var s=t,r=i.facet(lp).markerFilter;r&&(s=r(s,i));var n=t.slice().sort(function(t,e){return t.from-e.from||t.to-e.to;}),h=new Lt(),l=[],o=0;var _loop20=function _loop20(_t298){var e,s,r=_t298==n.length?null:n[_t298];if(!r&&!l.length){_t297=_t298;return 1;}// break
|
|
7
|
-
for(l.length?(e=o,s=l.reduce(function(t,e){return Math.min(t,e.to);},r&&r.from>e?r.from:1e8)):(e=r.from,s=r.to,l.push(r),_t298++);_t298<n.length;){var _i223=n[_t298];if(_i223.from!=e||!(_i223.to>_i223.from||_i223.to==e)){s=Math.min(_i223.from,s);break;}l.push(_i223),_t298++,s=Math.min(_i223.to,s);}var u=gp(l);if(l.some(function(t){return t.from==t.to||t.from==t.to-1&&i.doc.lineAt(t.from).to==t.from;}))h.add(e,e,hi.widget({widget:new fp(u),diagnostics:l.slice()}));else{var _t299=l.reduce(function(t,e){return e.markClass?t+" "+e.markClass:t;},"");h.add(e,s,hi.mark({"class":"cm-lintRange cm-lintRange-"+u+_t299,diagnostics:l.slice(),inclusiveEnd:l.some(function(t){return t.to>s;})}));}o=s;for(var _t300=0;_t300<l.length;_t300++)l[_t300].to<=o&&l.splice(_t300--,1);_t297=_t298;};for(var _t297=0;;){if(_loop20(_t297))break;}var u=h.finish();return new Xd(u,e,Yd(u));}}]);}();Qd=mt.define(),Zd=mt.define(),tp=mt.define(),ep=J.define({create:function create(){return new Xd(hi.none,null,null);},update:function update(t,e){if(e.docChanged&&t.diagnostics.size){var _i224=t.diagnostics.map(e.changes),_s203=null,_r172=t.panel;if(t.selected){var _r173=e.changes.mapPos(t.selected.from,1);_s203=Yd(_i224,t.selected.diagnostic,_r173)||Yd(_i224,null,_r173);}!_i224.size&&_r172&&e.state.facet(lp).autoPanel&&(_r172=null),t=new Xd(_i224,_r172,_s203);}var _iterator236=_createForOfIteratorHelper(e.effects),_step236;try{for(_iterator236.s();!(_step236=_iterator236.n()).done;){var _i225=_step236.value;if(_i225.is(Qd)){var _s204=e.state.facet(lp).autoPanel?_i225.value.length?cp.open:null:t.panel;t=Xd.init(_i225.value,_s204,e.state);}else _i225.is(Zd)?t=new Xd(t.diagnostics,_i225.value?cp.open:null,t.selected):_i225.is(tp)&&(t=new Xd(t.diagnostics,t.panel,_i225.value));}}catch(err){_iterator236.e(err);}finally{_iterator236.f();}return t;},provide:function provide(t){return[xh.from(t,function(t){return t.panel;}),en.decorations.from(t,function(t){return t.diagnostics;})];}}),ip=hi.mark({"class":"cm-lintRange cm-lintRange-active"});np=function np(t){var e=t.state.field(ep,!1);return!(!e||!e.panel)&&(t.dispatch({effects:Zd.of(!1)}),!0);},hp=[{key:"Mod-Shift-m",run:function run(t){var e=t.state.field(ep,!1);var i,s;e&&e.panel||t.dispatch({effects:(i=t.state,s=[Zd.of(!0)],i.field(ep,!1)?s:s.concat(mt.appendConfig.of(wp)))});var r=vh(t,cp.open);return r&&r.dom.querySelector(".cm-panel-lint ul").focus(),!0;},preventDefault:!0},{key:"F8",run:function run(t){var e=t.state.field(ep,!1);if(!e)return!1;var i=t.state.selection.main,s=e.diagnostics.iter(i.to+1);return!(!s.value&&(s=e.diagnostics.iter(0),!s.value||s.from==i.from&&s.to==i.to))&&(t.dispatch({selection:{anchor:s.from,head:s.to},scrollIntoView:!0}),!0);}}],lp=z.define({combine:function combine(t){return Object.assign({sources:t.map(function(t){return t.source;}).filter(function(t){return null!=t;})},Ot(t.map(function(t){return t.config;}),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:function hideOn(){return null;}},{needsRefresh:function needsRefresh(t,e){return t?e?function(i){return t(i)||e(i);}:t:e;}}));}});fp=/*#__PURE__*/function(_ri10){function fp(t){var _this97;_classCallCheck(this,fp);_this97=_callSuper(this,fp),_this97.sev=t;return _this97;}_inherits(fp,_ri10);return _createClass(fp,[{key:"eq",value:function eq(t){return t.sev==this.sev;}},{key:"toDOM",value:function toDOM(){return wa("span",{"class":"cm-lintPoint cm-lintPoint-"+this.sev});}}]);}(ri);ap=/*#__PURE__*/_createClass(function ap(t,e){_classCallCheck(this,ap);this.diagnostic=e,this.id="item_"+Math.floor(4294967295*Math.random()).toString(16),this.dom=up(t,e,!0),this.dom.id=this.id,this.dom.setAttribute("role","option");});cp=/*#__PURE__*/function(){function cp(t){var _this98=this;_classCallCheck(this,cp);this.view=t,this.items=[];this.list=wa("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:function onkeydown(e){if(27==e.keyCode)np(_this98.view),_this98.view.focus();else if(38==e.keyCode||33==e.keyCode)_this98.moveSelection((_this98.selectedIndex-1+_this98.items.length)%_this98.items.length);else if(40==e.keyCode||34==e.keyCode)_this98.moveSelection((_this98.selectedIndex+1)%_this98.items.length);else if(36==e.keyCode)_this98.moveSelection(0);else if(35==e.keyCode)_this98.moveSelection(_this98.items.length-1);else if(13==e.keyCode)_this98.view.focus();else{if(!(e.keyCode>=65&&e.keyCode<=90&&_this98.selectedIndex>=0))return;{var _i227=_this98.items[_this98.selectedIndex].diagnostic,_s205=op(_i227.actions);for(var _r174=0;_r174<_s205.length;_r174++)if(_s205[_r174].toUpperCase().charCodeAt(0)==e.keyCode){var _e268=Yd(_this98.view.state.field(ep).diagnostics,_i227);_e268&&_i227.actions[_r174].apply(t,_e268.from,_e268.to);}}}e.preventDefault();},onclick:function onclick(t){for(var _e269=0;_e269<_this98.items.length;_e269++)_this98.items[_e269].dom.contains(t.target)&&_this98.moveSelection(_e269);}}),this.dom=wa("div",{"class":"cm-panel-lint"},this.list,wa("button",{type:"button",name:"close","aria-label":this.view.state.phrase("close"),onclick:function onclick(){return np(_this98.view);}},"×")),this.update();}return _createClass(cp,[{key:"selectedIndex",get:function get(){var t=this.view.state.field(ep).selected;if(!t)return-1;for(var _e270=0;_e270<this.items.length;_e270++)if(this.items[_e270].diagnostic==t.diagnostic)return _e270;return-1;}},{key:"update",value:function update(){var _this99=this;var _this$view$state$fiel=this.view.state.field(ep),t=_this$view$state$fiel.diagnostics,e=_this$view$state$fiel.selected,i=0,s=!1,r=null,n=new Set();for(t.between(0,this.view.state.doc.length,function(t,h,_ref62){var l=_ref62.spec;var _iterator238=_createForOfIteratorHelper(l.diagnostics),_step238;try{for(_iterator238.s();!(_step238=_iterator238.n()).done;){var _t302=_step238.value;if(n.has(_t302))continue;n.add(_t302);var _h94=void 0,_l72=-1;for(var _e271=i;_e271<_this99.items.length;_e271++)if(_this99.items[_e271].diagnostic==_t302){_l72=_e271;break;}_l72<0?(_h94=new ap(_this99.view,_t302),_this99.items.splice(i,0,_h94),s=!0):(_h94=_this99.items[_l72],_l72>i&&(_this99.items.splice(i,_l72-i),s=!0)),e&&_h94.diagnostic==e.diagnostic?_h94.dom.hasAttribute("aria-selected")||(_h94.dom.setAttribute("aria-selected","true"),r=_h94):_h94.dom.hasAttribute("aria-selected")&&_h94.dom.removeAttribute("aria-selected"),i++;}}catch(err){_iterator238.e(err);}finally{_iterator238.f();}});i<this.items.length&&!(1==this.items.length&&this.items[0].diagnostic.from<0);)s=!0,this.items.pop();0==this.items.length&&(this.items.push(new ap(this.view,{from:-1,to:-1,severity:"info",message:this.view.state.phrase("No diagnostics")})),s=!0),r?(this.list.setAttribute("aria-activedescendant",r.id),this.view.requestMeasure({key:this,read:function read(){return{sel:r.dom.getBoundingClientRect(),panel:_this99.list.getBoundingClientRect()};},write:function write(_ref63){var t=_ref63.sel,e=_ref63.panel;var i=e.height/_this99.list.offsetHeight;t.top<e.top?_this99.list.scrollTop-=(e.top-t.top)/i:t.bottom>e.bottom&&(_this99.list.scrollTop+=(t.bottom-e.bottom)/i);}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),s&&this.sync();}},{key:"sync",value:function sync(){var t=this.list.firstChild;function e(){var e=t;t=e.nextSibling,e.remove();}var _iterator239=_createForOfIteratorHelper(this.items),_step239;try{for(_iterator239.s();!(_step239=_iterator239.n()).done;){var _i228=_step239.value;if(_i228.dom.parentNode==this.list){for(;t!=_i228.dom;)e();t=_i228.dom.nextSibling;}else this.list.insertBefore(_i228.dom,t);}}catch(err){_iterator239.e(err);}finally{_iterator239.f();}for(;t;)e();}},{key:"moveSelection",value:function moveSelection(t){if(this.selectedIndex<0)return;var e=Yd(this.view.state.field(ep).diagnostics,this.items[t].diagnostic);e&&this.view.dispatch({selection:{anchor:e.from,head:e.to},scrollIntoView:!0,effects:tp.of(e)});}}],[{key:"open",value:function open(t){return new cp(t);}}]);}();pp=en.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:dp("#d11")},".cm-lintRange-warning":{backgroundImage:dp("orange")},".cm-lintRange-info":{backgroundImage:dp("#999")},".cm-lintRange-hint":{backgroundImage:dp("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}}});wp=[ep,en.decorations.compute([ep],function(t){var _t$field=t.field(ep),e=_t$field.selected,i=_t$field.panel;return e&&i&&e.from!=e.to?hi.set([ip.range(e.from,e.to)]):hi.none;}),mh(sp,{hideOn:function hideOn(t,e){var i=e.pos,s=e.end||i,r=t.state.facet(lp).hideOn(t,i,s);if(null!=r)return r;var n=t.startState.doc.lineAt(e.pos);return!(!t.effects.some(function(t){return t.is(Qd);})&&!t.changes.touchesRange(n.from,Math.max(n.to,s)));}}),pp],bp=function bp(t){return void 0===t||t;},_export("B",vp=function vp(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var e=[];bp(t.defaultKeymap)&&e.push.apply(e,_toConsumableArray(ga)),bp(t.closeBracketsKeymap)&&e.push.apply(e,jd),bp(t.searchKeymap)&&e.push.apply(e,dc),bp(t.historyKeymap)&&e.push.apply(e,Mf),bp(t.foldKeymap)&&e.push.apply(e,ou),bp(t.lintKeymap)&&e.push.apply(e,hp);var i=[];return bp(t.highlightActiveLineGutter)&&i.push(Gh),bp(t.highlightSpecialChars)&&i.push(function(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return[Hn.of(t),Fn||(Fn=is.fromClass(/*#__PURE__*/function(){function _class16(t){_classCallCheck(this,_class16);this.view=t,this.decorations=hi.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(t.state.facet(Hn)),this.decorations=this.decorator.createDeco(t);}return _createClass(_class16,[{key:"makeDecorator",value:function makeDecorator(t){var _this100=this;return new Nn({regexp:t.specialChars,decoration:function decoration(e,i,s){var r=i.state.doc,n=M(e[0],0);if(9==n){var _t304=r.lineAt(s),_e272=i.state.tabSize,_n125=Ut(_t304.text,_e272,s-_t304.from);return hi.replace({widget:new Vn((_e272-_n125%_e272)*_this100.view.defaultCharacterWidth/_this100.view.scaleX)});}return _this100.decorationCache[n]||(_this100.decorationCache[n]=hi.replace({widget:new Wn(t,n)}));},boundary:t.replaceTabs?void 0:/[^]/});}},{key:"update",value:function update(t){var e=t.state.facet(Hn);t.startState.facet(Hn)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(t.view)):this.decorations=this.decorator.updateDeco(t,this.decorations);}}]);}(),{decorations:function decorations(t){return t.decorations;}}))];}()),bp(t.history)&&i.push(function(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return[nf,rf.of(t),en.domEventHandlers({beforeinput:function beforeinput(t,e){var i="historyUndo"==t.inputType?lf:"historyRedo"==t.inputType?of:null;return!!i&&(t.preventDefault(),i(e));}})];}()),bp(t.foldGutter)&&i.push(function(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var e=Object.assign(Object.assign({},mu),t),i=new gu(e,!0),s=new gu(e,!1),r=is.fromClass(/*#__PURE__*/function(){function _class17(t){_classCallCheck(this,_class17);this.from=t.viewport.from,this.markers=this.buildMarkers(t);}return _createClass(_class17,[{key:"update",value:function update(t){(t.docChanged||t.viewportChanged||t.startState.facet(Io)!=t.state.facet(Io)||t.startState.field(su,!1)!=t.state.field(su,!1)||yo(t.startState)!=yo(t.state)||e.foldingChanged(t))&&(this.markers=this.buildMarkers(t.view));}},{key:"buildMarkers",value:function buildMarkers(t){var e=new Lt();var _iterator241=_createForOfIteratorHelper(t.viewportLineBlocks),_step241;try{for(_iterator241.s();!(_step241=_iterator241.n()).done;){var _r175=_step241.value;var _n126=ru(t.state,_r175.from,_r175.to)?s:Qo(t.state,_r175.from,_r175.to)?i:null;_n126&&e.add(_r175.from,_r175.from,_n126);}}catch(err){_iterator241.e(err);}finally{_iterator241.f();}return e.finish();}}]);}()),n=e.domEventHandlers;return[r,Eh({"class":"cm-foldGutter",markers:function markers(t){var e;return(null===(e=t.plugin(r))||void 0===e?void 0:e.markers)||Bt.empty;},initialSpacer:function initialSpacer(){return new gu(e,!1);},domEventHandlers:Object.assign(Object.assign({},n),{click:function click(t,e,i){if(n.click&&n.click(t,e,i))return!0;var s=ru(t.state,e.from,e.to);if(s)return t.dispatch({effects:eu.of(s)}),!0;var r=Qo(t.state,e.from,e.to);return!!r&&(t.dispatch({effects:tu.of(r)}),!0);}})}),au()];}()),bp(t.drawSelection)&&i.push(function(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return[Sn.of(t),Cn,On,In,Gi.of(!0)];}()),bp(t.dropCursor)&&i.push([Tn,Bn]),bp(t.allowMultipleSelections)&&i.push(Dt.allowMultipleSelections.of(!0)),bp(t.indentOnInput)&&i.push(Dt.transactionFilter.of(function(t){if(!t.docChanged||!t.isUserEvent("input.type")&&!t.isUserEvent("input.complete"))return t;var e=t.startState.languageDataAt("indentOnInput",t.startState.selection.main.head);if(!e.length)return t;var i=t.newDoc,s=t.newSelection.main.head,r=i.lineAt(s);if(s>r.from+200)return t;var n=i.sliceString(r.from,s);if(!e.some(function(t){return t.test(n);}))return t;var h=t.state,l=-1,o=[];var _iterator242=_createForOfIteratorHelper(h.selection.ranges),_step242;try{for(_iterator242.s();!(_step242=_iterator242.n()).done;){var _t305=_step242.value.head;var _e273=h.doc.lineAt(_t305);if(_e273.from==l)continue;l=_e273.from;var _i229=$o(h,_e273.from);if(null==_i229)continue;var _s207=/^\s*/.exec(_e273.text)[0],_r176=No(h,_i229);_s207!=_r176&&o.push({from:_e273.from,to:_e273.from+_s207.length,insert:_r176});}}catch(err){_iterator242.e(err);}finally{_iterator242.f();}return o.length?[t,{changes:o,sequential:!0}]:t;})),bp(t.bracketMatching)&&i.push(function(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return[Ou.of(t),Bu];}()),bp(t.closeBrackets)&&i.push([$d,Rd]),bp(t.autocompletion)&&i.push(Ud()),bp(t.rectangularSelection)&&i.push(function(t){var e=(null==t?void 0:t.eventFilter)||function(t){return t.altKey&&0==t.button;};return en.mouseSelectionStyle.of(function(t,i){return e(i)?Xn(t,i):null;});}()),bp(t.crosshairCursor)&&i.push(function(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var _Yn=_slicedToArray(Yn[t.key||"Alt"],2),e=_Yn[0],i=_Yn[1],s=is.fromClass(/*#__PURE__*/function(){function _class18(t){_classCallCheck(this,_class18);this.view=t,this.isDown=!1;}return _createClass(_class18,[{key:"set",value:function set(t){this.isDown!=t&&(this.isDown=t,this.view.update([]));}}]);}(),{eventObservers:{keydown:function keydown(t){this.set(t.keyCode==e||i(t));},keyup:function keyup(t){t.keyCode!=e&&i(t)||this.set(!1);},mousemove:function mousemove(t){this.set(i(t));}}});return[s,en.contentAttributes.of(function(t){var e;return(null===(e=t.plugin(s))||void 0===e?void 0:e.isDown)?Qn:null;})];}()),bp(t.highlightActiveLine)&&i.push(Un),bp(t.highlightSelectionMatches)&&i.push(function(t){var e=[Pa,ja];return t&&e.push(Ba.of(t)),e;}()),t.enableSearch||i.push(fn.of([{key:"Mod-f",run:function run(){return!0;}}])),t.tabSize&&"number"==typeof t.tabSize&&i.push(Bo.of(" ".repeat(t.tabSize))),i.concat([fn.of(e.flat())]).filter(Boolean);});}};});
|
|
1
|
+
System.register(["../index-178e1e57.cjs.js"],function(_export,_context){"use strict";var t,e,i,s,r,p,m,g,v,k,y,M,D,E,I,R,j,z,P,W,F,q,K,_,X,Y,Q,Z,et,it,st,rt,nt,ot,ut,ft,at,ct,dt,pt,mt,gt,wt,bt,vt,St,Ct,Ot,Dt,It,Tt,Bt,Nt,$t,jt,Pt,Ht,Ft,Xt,Yt,Qt,Zt,te,ee,pe,me,ge,Se,Ae,Ce,De,Re,Te,Be,Le,Ne,$e,je,ze,Pe,He,We,Fe,Ve,qe,Je,Ue,Ye,ei,ii,si,ri,ni,hi,ui,fi,ai,ci,pi,mi,gi,wi,vi,ki,yi,Mi,_i64,_arr,_t53,_e58,_i65,Si,Ai,Oi,Ri,Li,Ni,$i,ji,zi,Pi,Hi,Wi,Fi,Vi,qi,Ji,Ui,Gi,Ki,Xi,Yi,Qi,Zi,ts,es,is,ss,rs,ns,hs,os,fs,as,cs,ds,ms,Es,Is,Ts,Bs,$s,Ps,Hs,Ws,Vs,qs,Js,Us,Xs,Zs,tr,er,ir,nr,hr,ur,fr,ar,dr,pr,mr,gr,wr,br,kr,yr,Mr,xr,Ar,Cr,Er,Ir,Rr,Tr,Nr,$r,zr,Pr,Hr,Wr,Fr,Vr,Jr,Ur,Gr,Kr,Yr,Qr,Zr,tn,en,rn,hn,ln,on,fn,an,cn,pn,wn,bn,kn,yn,xn,An,Cn,On,Dn,En,In,Tn,Bn,Ln,Nn,$n,jn,zn,Pn,Hn,Wn,Fn,Vn,Jn,Kn,_n,Xn,Yn,th,eh,ih,rh,nh,hh,lh,oh,uh,fh,ah,ph,mh,wh,bh,kh,yh,Mh,xh,Sh,Ah,Oh,Eh,Th,Bh,Lh,Nh,$h,jh,zh,Hh,Vh,qh,Jh,Uh,Gh,Kh,_h,Xh,Yh,Qh,Zh,tl,el,il,sl,rl,ll,ol,al,cl,pl,ml,wl,kl,yl,Ml,xl,Al,Ol,Dl,El,Bl,Ll,zl,Pl,Hl,Wl,Vl,ql,Gl,Kl,_l,Xl,Yl,Ql,Zl,to,eo,io,so,ro,no,ho,lo,oo,uo,_t230,_e207,fo,ao,po,mo,wo,vo,ko,yo,xo,So,Ao,Co,Oo,Do,Eo,Io,Lo,No,Po,Vo,Jo,Uo,Yo,Qo,tu,nu,hu,lu,fu,au,cu,du,pu,mu,gu,wu,ku,yu,Mu,xu,Su,Au,Cu,Ou,Eu,Iu,Ru,$u,ju,zu,Pu,Hu,_i179,_arr2,_arr2$_i,_t247,_e220,qu,Ju,Uu,Ku,Yu,Qu,Zu,tf,ef,rf,nf,hf,lf,of,af,cf,wf,bf,vf,Cf,Of,Tf,Bf,$f,jf,Wf,Ff,Jf,Uf,Kf,_f,Xf,Yf,Qf,Zf,ia,sa,ra,na,ha,fa,da,ga,wa,ba,va,ka,ya,Ma,xa,Ca,Oa,Da,Ea,Ia,Ra,Ta,La,Na,$a,ja,za,Ha,qa,Ja,Ua,Ga,Ka,_a,Xa,Ya,Za,tc,ec,ic,sc,oc,uc,fc,ac,dc,pc,gc,wc,bc,Mc,Ac,Cc,Dc,Ec,Ic,Rc,Tc,$c,Pc,Hc,Wc,Fc,qc,Uc,Gc,Kc,_c,Xc,Qc,td,ed,id,sd,rd,nd,hd,ld,od,ud,fd,ad,cd,dd,pd,md,gd,kd,yd,Md,Sd,Ad,Cd,Od,Dd,Ed,Td,Bd,Ld,Vd,qd,Ud,Gd,_d,Xd,Yd,Qd,Zd,ip,sp,rp,lp,op,up,ap,pp,mp,gp;function _defineProperty(e,r,t){return(r=_toPropertyKey(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e;}function _toConsumableArray(r){return _arrayWithoutHoles(r)||_iterableToArray(r)||_unsupportedIterableToArray(r)||_nonIterableSpread();}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _iterableToArray(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r);}function _arrayWithoutHoles(r){if(Array.isArray(r))return _arrayLikeToArray(r);}function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _n127=0,F=function F(){};return{s:F,n:function n(){return _n127>=r.length?{done:!0}:{done:!1,value:r[_n127++]};},e:function e(r){throw r;},f:F};}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}var o,a=!0,u=!1;return{s:function s(){t=t.call(r);},n:function n(){var r=t.next();return a=r.done,r;},e:function e(r){u=!0,o=r;},f:function f(){try{a||null==t["return"]||t["return"]();}finally{if(u)throw o;}}};}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e));}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t);}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e;}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t;})();}function _superPropGet(t,o,e,r){var p=_get(_getPrototypeOf(1&r?t.prototype:t),o,e);return 2&r&&"function"==typeof p?function(t){return p.apply(e,t);}:p;}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var p=_superPropBase(e,t);if(p){var n=Object.getOwnPropertyDescriptor(p,t);return n.get?n.get.call(arguments.length<3?e:r):n.value;}},_get.apply(null,arguments);}function _superPropBase(t,o){for(;!{}.hasOwnProperty.call(t,o)&&null!==(t=_getPrototypeOf(t)););return t;}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t);},_getPrototypeOf(t);}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e);}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t;},_setPrototypeOf(t,e);}function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}function _slicedToArray(r,e){return _arrayWithHoles(r)||_iterableToArrayLimit(r,e)||_unsupportedIterableToArray(r,e)||_nonIterableRest();}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0;}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n;}function _iterableToArrayLimit(r,l){var t=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=t){var e,n,i,u,a=[],f=!0,o=!1;try{if(i=(t=t.call(r)).next,0===l){if(Object(t)!==t)return;f=!1;}else for(;!(f=(e=i.call(t)).done)&&(a.push(e.value),a.length!==l);f=!0);}catch(r){o=!0,n=r;}finally{try{if(!f&&null!=t["return"]&&(u=t["return"](),Object(u)!==u))return;}finally{if(o)throw n;}}return a;}}function _arrayWithHoles(r){if(Array.isArray(r))return r;}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function");}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o);}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+"";}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return("string"===r?String:Number)(t);}function n(t){if(t<768)return!1;for(var _e2=0,_i2=s.length;;){var _n2=_e2+_i2>>1;if(t<s[_n2])_i2=_n2;else{if(!(t>=r[_n2]))return!0;_e2=_n2+1;}if(_e2==_i2)return!1;}}function h(t){return t>=127462&&t<=127487;}function l(t,e){var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!0;var s=arguments.length>3&&arguments[3]!==undefined?arguments[3]:!0;return(i?o:u)(t,e,s);}function o(t,e,i){if(e==t.length)return e;e&&a(t.charCodeAt(e))&&c(t.charCodeAt(e-1))&&e--;var s=f(t,e);for(e+=d(s);e<t.length;){var _r2=f(t,e);if(8205==s||8205==_r2||i&&n(_r2))e+=d(_r2),s=_r2;else{if(!h(_r2))break;{var _i4=0,_s2=e-2;for(;_s2>=0&&h(f(t,_s2));)_i4++,_s2-=2;if(_i4%2==0)break;e+=2;}}}return e;}function u(t,e,i){for(;e>0;){var _s3=o(t,e-2,i);if(_s3<e)return _s3;e--;}return 0;}function f(t,e){var i=t.charCodeAt(e);if(!c(i)||e+1==t.length)return i;var s=t.charCodeAt(e+1);return a(s)?s-56320+(i-55296<<10)+65536:i;}function a(t){return t>=56320&&t<57344;}function c(t){return t>=55296&&t<56320;}function d(t){return t<65536?1:2;}function w(t,e){var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;var s=arguments.length>3&&arguments[3]!==undefined?arguments[3]:1e9;for(var _r12=0,_n10=0,_h8=!0;_n10<t.length&&_r12<=s;_n10++){var _l8=t[_n10],_o4=_r12+_l8.length;_o4>=i&&(_o4>s&&(_l8=_l8.slice(0,s-_r12)),_r12<i&&(_l8=_l8.slice(i-_r12)),_h8?(e[e.length-1]+=_l8,_h8=!1):e.push(_l8)),_r12=_o4+1;}return e;}function b(t,e,i){return w(t,[""],e,i);}function x(t,e,i){return[e=Math.max(0,Math.min(t.length,e)),Math.max(e,Math.min(t.length,i))];}function S(t,e){var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!0;var s=arguments.length>3&&arguments[3]!==undefined?arguments[3]:!0;return l(t,e,i,s);}function A(t,e){var i=t.charCodeAt(e);if(!(s=i,s>=55296&&s<56320&&e+1!=t.length))return i;var s;var r=t.charCodeAt(e+1);return function(t){return t>=56320&&t<57344;}(r)?r-56320+(i-55296<<10)+65536:i;}function C(t){return t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode(55296+(t>>10),56320+(1023&t)));}function O(t){return t<65536?1:2;}function T(t,e,i){var s=arguments.length>3&&arguments[3]!==undefined?arguments[3]:!1;if(0==e&&i<=0)return;var r=t.length-2;r>=0&&i<=0&&i==t[r+1]?t[r]+=e:r>=0&&0==e&&0==t[r]?t[r+1]+=i:s?(t[r]+=e,t[r+1]+=i):t.push(e,i);}function B(t,e,i){if(0==i.length)return;var s=e.length-2>>1;if(s<t.length)t[t.length-1]=t[t.length-1].append(i);else{for(;t.length<s;)t.push(p.empty);t.push(i);}}function L(t,e,i){var s=t.inserted;for(var _r20=0,_n17=0,_h14=0;_h14<t.sections.length;){var _l12=t.sections[_h14++],_o7=t.sections[_h14++];if(_o7<0)_r20+=_l12,_n17+=_l12;else{var _u3=_r20,_f3=_n17,_a3=p.empty;for(;_u3+=_l12,_f3+=_o7,_o7&&s&&(_a3=_a3.append(s[_h14-2>>1])),!(i||_h14==t.sections.length||t.sections[_h14+1]<0);)_l12=t.sections[_h14++],_o7=t.sections[_h14++];e(_r20,_u3,_n17,_f3,_a3),_r20=_u3,_n17=_f3;}}}function N(t,e,i){var s=arguments.length>3&&arguments[3]!==undefined?arguments[3]:!1;var r=[],n=s?[]:null,h=new j(t),l=new j(e);for(var _t8=-1;;){if(h.done&&l.len||l.done&&h.len)throw new Error("Mismatched change set lengths");if(-1==h.ins&&-1==l.ins){var _t9=Math.min(h.len,l.len);T(r,_t9,-1),h.forward(_t9),l.forward(_t9);}else if(l.ins>=0&&(h.ins<0||_t8==h.i||0==h.off&&(l.len<h.len||l.len==h.len&&!i))){var _e19=l.len;for(T(r,l.ins,-1);_e19;){var _i14=Math.min(h.len,_e19);h.ins>=0&&_t8<h.i&&h.len<=_i14&&(T(r,0,h.ins),n&&B(n,r,h.text),_t8=h.i),h.forward(_i14),_e19-=_i14;}l.next();}else{if(!(h.ins>=0)){if(h.done&&l.done)return n?R.createSet(r,n):I.create(r);throw new Error("Mismatched change set lengths");}{var _e20=0,_i15=h.len;for(;_i15;)if(-1==l.ins){var _t10=Math.min(_i15,l.len);_e20+=_t10,_i15-=_t10,l.forward(_t10);}else{if(!(0==l.ins&&l.len<_i15))break;_i15-=l.len,l.next();}T(r,_e20,_t8<h.i?h.ins:0),n&&_t8<h.i&&B(n,r,h.text),_t8=h.i,h.forward(h.len-_i15);}}}}function $(t,e){var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!1;var s=[],r=i?[]:null,n=new j(t),h=new j(e);for(var _t11=!1;;){if(n.done&&h.done)return r?R.createSet(s,r):I.create(s);if(0==n.ins)T(s,n.len,0,_t11),n.next();else if(0!=h.len||h.done){if(n.done||h.done)throw new Error("Mismatched change set lengths");{var _e21=Math.min(n.len2,h.len),_i16=s.length;if(-1==n.ins){var _i17=-1==h.ins?-1:h.off?0:h.ins;T(s,_e21,_i17,_t11),r&&_i17&&B(r,s,h.text);}else-1==h.ins?(T(s,n.off?0:n.len,_e21,_t11),r&&B(r,s,n.textBit(_e21))):(T(s,n.off?0:n.len,h.off?0:h.ins,_t11),r&&!h.off&&B(r,s,h.text));_t11=(n.ins>_e21||h.ins>=0&&h.len>_e21)&&(_t11||s.length>_i16),n.forward2(_e21),h.forward(_e21);}}else T(s,0,h.ins,_t11),r&&B(r,s,h.text),h.next();}}function H(t,e){var _iterator11=_createForOfIteratorHelper(t.ranges),_step11;try{for(_iterator11.s();!(_step11=_iterator11.n()).done;){var _i21=_step11.value;if(_i21.to>e)throw new RangeError("Selection points outside of document");}}catch(err){_iterator11.e(err);}finally{_iterator11.f();}}function V(t,e){return t==e||t.length==e.length&&t.every(function(t,i){return t===e[i];});}function J(t,e,i){if(t.length!=e.length)return!1;for(var _s16=0;_s16<t.length;_s16++)if(!i(t[_s16],e[_s16]))return!1;return!0;}function U(t,e){var i=!1;var _iterator13=_createForOfIteratorHelper(e),_step13;try{for(_iterator13.s();!(_step13=_iterator13.n()).done;){var _s17=_step13.value;1&ht(t,_s17)&&(i=!0);}}catch(err){_iterator13.e(err);}finally{_iterator13.f();}return i;}function G(t,e,i){var s=i.map(function(e){return t[e.id];}),r=i.map(function(t){return t.type;}),n=s.filter(function(t){return!(1&t);}),h=t[e.id]>>1;function l(t){var i=[];for(var _e23=0;_e23<s.length;_e23++){var _n19=lt(t,s[_e23]);if(2==r[_e23]){var _iterator14=_createForOfIteratorHelper(_n19),_step14;try{for(_iterator14.s();!(_step14=_iterator14.n()).done;){var _t12=_step14.value;i.push(_t12);}}catch(err){_iterator14.e(err);}finally{_iterator14.f();}}else i.push(_n19);}return e.combine(i);}return{create:function create(t){var _iterator15=_createForOfIteratorHelper(s),_step15;try{for(_iterator15.s();!(_step15=_iterator15.n()).done;){var _e24=_step15.value;ht(t,_e24);}}catch(err){_iterator15.e(err);}finally{_iterator15.f();}return t.values[h]=l(t),1;},update:function update(t,i){if(!U(t,n))return 0;var s=l(t);return e.compare(s,t.values[h])?0:(t.values[h]=s,1);},reconfigure:function reconfigure(t,r){var n=U(t,s),o=r.config.facets[e.id],u=r.facet(e);if(o&&!n&&V(i,o))return t.values[h]=u,0;var f=l(t);return e.compare(f,u)?(t.values[h]=u,0):(t.values[h]=f,1);}};}function tt(t){return function(e){return new it(e,t);};}function ht(t,e){if(1&e)return 2;var i=e>>1,s=t.status[i];if(4==s)throw new Error("Cyclic dependency between fields and/or facets");if(2&s)return s;t.status[i]=4;var r=t.computeSlot(t,t.config.dynamicSlots[i]);return t.status[i]=2|r;}function lt(t,e){return 1&e?t.config.staticValues[e>>1]:t.values[e>>1];}function kt(t,e){var i=[];for(var _s21=0,_r24=0;;){var _n20=void 0,_h16=void 0;if(_s21<t.length&&(_r24==e.length||e[_r24]>=t[_s21]))_n20=t[_s21++],_h16=t[_s21++];else{if(!(_r24<e.length))return i;_n20=e[_r24++],_h16=e[_r24++];}!i.length||i[i.length-1]<_n20?i.push(_n20,_h16):i[i.length-1]<_h16&&(i[i.length-1]=_h16);}}function yt(t,e,i){var s;var r,n,h;return i?(r=e.changes,n=R.empty(e.changes.length),h=t.changes.compose(e.changes)):(r=e.changes.map(t.changes),n=t.changes.mapDesc(e.changes,!0),h=t.changes.compose(r)),{changes:h,selection:e.selection?e.selection.map(n):null===(s=t.selection)||void 0===s?void 0:s.map(r),effects:bt.mapEffects(t.effects,r).concat(bt.mapEffects(e.effects,n)),annotations:t.annotations.length?t.annotations.concat(e.annotations):e.annotations,scrollIntoView:t.scrollIntoView||e.scrollIntoView};}function Mt(t,e,i){var s=e.selection,r=At(e.annotations);return e.userEvent&&(r=r.concat(vt.userEvent.of(e.userEvent))),{changes:e.changes instanceof R?e.changes:R.of(e.changes||[],i,t.facet(ft)),selection:s&&(s instanceof P?s:P.single(s.anchor,s.head)),effects:At(e.effects),annotations:r,scrollIntoView:!!e.scrollIntoView};}function xt(t,e,i){var s=Mt(t,e.length?e[0]:{},t.doc.length);e.length&&!1===e[0].filter&&(i=!1);for(var _r25=1;_r25<e.length;_r25++){!1===e[_r25].filter&&(i=!1);var _n21=!!e[_r25].sequential;s=yt(s,Mt(t,e[_r25],_n21?s.changes.newLength:t.doc.length),_n21);}var r=vt.create(t,s.changes,s.selection,s.effects,s.annotations,s.scrollIntoView);return function(t){var e=t.startState,i=e.facet(dt),s=t;for(var _r26=i.length-1;_r26>=0;_r26--){var _n22=i[_r26](t);_n22&&Object.keys(_n22).length&&(s=yt(s,Mt(e,_n22,t.changes.newLength),!0));}return s==t?t:vt.create(e,t.changes,t.selection,s.effects,s.annotations,s.scrollIntoView);}(i?function(t){var e=t.startState,i=!0;var _iterator21=_createForOfIteratorHelper(e.facet(at)),_step21;try{for(_iterator21.s();!(_step21=_iterator21.n()).done;){var _s23=_step21.value;var _e30=_s23(t);if(!1===_e30){i=!1;break;}Array.isArray(_e30)&&(i=!0===i?_e30:kt(i,_e30));}}catch(err){_iterator21.e(err);}finally{_iterator21.f();}if(!0!==i){var _s22,_r27;if(!1===i)_r27=t.changes.invertedDesc,_s22=R.empty(e.doc.length);else{var _e29=t.changes.filter(i);_s22=_e29.changes,_r27=_e29.filtered.mapDesc(_e29.changes).invertedDesc;}t=vt.create(e,_s22,t.selection&&t.selection.map(_r27),bt.mapEffects(t.effects,_r27),t.annotations,t.scrollIntoView);}var s=e.facet(ct);for(var _i25=s.length-1;_i25>=0;_i25--){var _r28=s[_i25](t);t=_r28 instanceof vt?_r28:Array.isArray(_r28)&&1==_r28.length&&_r28[0]instanceof vt?_r28[0]:xt(e,At(_r28),!1);}return t;}(r):r);}function At(t){return null==t?St:Array.isArray(t)?t:[t];}function Et(t){return function(e){if(!/\S/.test(e))return Ct.Space;if(function(t){if(Dt)return Dt.test(t);for(var _e31=0;_e31<t.length;_e31++){var _i26=t[_e31];if(/\w/.test(_i26)||_i26>""&&(_i26.toUpperCase()!=_i26.toLowerCase()||Ot.test(_i26)))return!0;}return!1;}(e))return Ct.Word;for(var _i27=0;_i27<t.length;_i27++)if(e.indexOf(t[_i27])>-1)return Ct.Word;return Ct.Other;};}function Rt(t,e){var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};var s={};var _iterator26=_createForOfIteratorHelper(t),_step26;try{for(_iterator26.s();!(_step26=_iterator26.n()).done;){var _e35=_step26.value;for(var _i31=0,_Object$keys=Object.keys(_e35);_i31<_Object$keys.length;_i31++){var _t21=_Object$keys[_i31];var _r31=_e35[_t21],_n25=s[_t21];if(void 0===_n25)s[_t21]=_r31;else if(_n25===_r31||void 0===_r31);else{if(!Object.hasOwnProperty.call(i,_t21))throw new Error("Config merge conflict for field "+_t21);s[_t21]=i[_t21](_n25,_r31);}}}}catch(err){_iterator26.e(err);}finally{_iterator26.f();}for(var _t20 in e)void 0===s[_t20]&&(s[_t20]=e[_t20]);return s;}function Lt(t,e){return t.from-e.from||t.value.startSide-e.value.startSide;}function zt(t,e,i){var s=new Map();var _iterator29=_createForOfIteratorHelper(t),_step29;try{for(_iterator29.s();!(_step29=_iterator29.n()).done;){var _e38=_step29.value;for(var _t26=0;_t26<_e38.chunk.length;_t26++)_e38.chunk[_t26].maxPoint<=0&&s.set(_e38.chunk[_t26],_e38.chunkPos[_t26]);}}catch(err){_iterator29.e(err);}finally{_iterator29.f();}var r=new Set();var _iterator30=_createForOfIteratorHelper(e),_step30;try{for(_iterator30.s();!(_step30=_iterator30.n()).done;){var _t27=_step30.value;for(var _e39=0;_e39<_t27.chunk.length;_e39++){var _n30=s.get(_t27.chunk[_e39]);null==_n30||(i?i.mapPos(_n30):_n30)!=_t27.chunkPos[_e39]||(null==i?void 0:i.touchesRange(_n30,_n30+_t27.chunk[_e39].length))||r.add(_t27.chunk[_e39]);}}}catch(err){_iterator30.e(err);}finally{_iterator30.f();}return r;}function Wt(t,e){for(var _i38=t[e];;){var _s31=1+(e<<1);if(_s31>=t.length)break;var _r38=t[_s31];if(_s31+1<t.length&&_r38.compare(t[_s31+1])>=0&&(_r38=t[_s31+1],_s31++),_i38.compare(_r38)<0)break;t[_s31]=_i38,t[e]=_r38,e=_s31;}}function Vt(t,e,i,s,r,n){t["goto"](e),i["goto"](s);var h=s+r,l=s,o=s-e;for(;;){var _e43=t.to+o-i.to,_s33=_e43||t.endSide-i.endSide,_r39=_s33<0?t.to+o:i.to,_u6=Math.min(_r39,h);if(t.point||i.point?t.point&&i.point&&(t.point==i.point||t.point.eq(i.point))&&qt(t.activeForPoint(t.to),i.activeForPoint(i.to))||n.comparePoint(l,_u6,t.point,i.point):_u6>l&&!qt(t.active,i.active)&&n.compareRange(l,_u6,t.active,i.active),_r39>h)break;(_e43||t.openEnd!=i.openEnd)&&n.boundChange&&n.boundChange(_r39),l=_r39,_s33<=0&&t.next(),_s33>=0&&i.next();}}function qt(t,e){if(t.length!=e.length)return!1;for(var _i41=0;_i41<t.length;_i41++)if(t[_i41]!=e[_i41]&&!t[_i41].eq(e[_i41]))return!1;return!0;}function Jt(t,e){for(var _i42=e,_s34=t.length-1;_i42<_s34;_i42++)t[_i42]=t[_i42+1];t.pop();}function Ut(t,e,i){for(var _i43=t.length-1;_i43>=e;_i43--)t[_i43+1]=t[_i43];t[e]=i;}function Gt(t,e){var i=-1,s=1e9;for(var _r40=0;_r40<e.length;_r40++)(e[_r40]-s||t[_r40].endSide-t[i].endSide)<0&&(i=_r40,s=e[_r40]);return i;}function Kt(t,e){var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:t.length;var s=0;for(var _r41=0;_r41<i&&_r41<t.length;)9==t.charCodeAt(_r41)?(s+=e-s%e,_r41++):(s++,_r41=S(t,_r41));return s;}function _t(t,e,i,s){for(var _s35=0,_r42=0;;){if(_r42>=e)return _s35;if(_s35==t.length)break;_r42+=9==t.charCodeAt(_s35)?i-_r42%i:1,_s35=S(t,_s35);}return!0===s?-1:t.length;}function ie(t){var e;return e=11==t.nodeType?t.getSelection?t:t.ownerDocument:t,e.getSelection();}function se(t,e){return!!e&&(t==e||t.contains(1!=e.nodeType?e.parentNode:e));}function re(t,e){if(!e.anchorNode)return!1;try{return se(t,e.anchorNode);}catch(t){return!1;}}function ne(t){return 3==t.nodeType?be(t,0,t.nodeValue.length).getClientRects():1==t.nodeType?t.getClientRects():[];}function he(t,e,i,s){return!!i&&(ue(t,e,i,s,-1)||ue(t,e,i,s,1));}function le(t){for(var e=0;;e++)if(!(t=t.previousSibling))return e;}function oe(t){return 1==t.nodeType&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(t.nodeName);}function ue(t,e,i,s,r){for(;;){if(t==i&&e==s)return!0;if(e==(r<0?0:fe(t))){if("DIV"==t.nodeName)return!1;var _i46=t.parentNode;if(!_i46||1!=_i46.nodeType)return!1;e=le(t)+(r<0?0:1),t=_i46;}else{if(1!=t.nodeType)return!1;if(1==(t=t.childNodes[e+(r<0?-1:0)]).nodeType&&"false"==t.contentEditable)return!1;e=r<0?fe(t):0;}}}function fe(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length;}function ae(t,e){var i=e?t.left:t.right;return{left:i,right:i,top:t.top,bottom:t.bottom};}function ce(t){var e=t.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.innerWidth,top:0,bottom:t.innerHeight};}function de(t,e){var i=e.width/t.offsetWidth,s=e.height/t.offsetHeight;return(i>.995&&i<1.005||!isFinite(i)||Math.abs(e.width-t.offsetWidth)<1)&&(i=1),(s>.995&&s<1.005||!isFinite(s)||Math.abs(e.height-t.offsetHeight)<1)&&(s=1),{scaleX:i,scaleY:s};}function we(t){if(t.setActive)return t.setActive();if(ge)return t.focus(ge);var e=[];for(var _i47=t;_i47&&(e.push(_i47,_i47.scrollTop,_i47.scrollLeft),_i47!=_i47.ownerDocument);_i47=_i47.parentNode);if(t.focus(null==ge?{get preventScroll(){return ge={preventScroll:!0},!0;}}:void 0),!ge){ge=!1;for(var _t35=0;_t35<e.length;){var _i48=e[_t35++],_s36=e[_t35++],_r43=e[_t35++];_i48.scrollTop!=_s36&&(_i48.scrollTop=_s36),_i48.scrollLeft!=_r43&&(_i48.scrollLeft=_r43);}}}function be(t,e){var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:e;var s=me||(me=document.createRange());return s.setEnd(t,i),s.setStart(t,e),s;}function ve(t,e,i,s){var _s37;var r={key:e,code:e,keyCode:i,which:i,cancelable:!0};s&&(_s37=s,r.altKey=_s37.altKey,r.ctrlKey=_s37.ctrlKey,r.shiftKey=_s37.shiftKey,r.metaKey=_s37.metaKey,_s37);var n=new KeyboardEvent("keydown",r);n.synthetic=!0,t.dispatchEvent(n);var h=new KeyboardEvent("keyup",r);return h.synthetic=!0,t.dispatchEvent(h),n.defaultPrevented||h.defaultPrevented;}function ke(t){for(;t.attributes.length;)t.removeAttributeNode(t.attributes[0]);}function ye(t){return t.scrollTop>Math.max(1,t.scrollHeight-t.clientHeight-4);}function Me(t,e){for(var _i49=t,_s38=e;;){if(3==_i49.nodeType&&_s38>0)return{node:_i49,offset:_s38};if(1==_i49.nodeType&&_s38>0){if("false"==_i49.contentEditable)return null;_i49=_i49.childNodes[_s38-1],_s38=fe(_i49);}else{if(!_i49.parentNode||oe(_i49))return null;_s38=le(_i49),_i49=_i49.parentNode;}}}function xe(t,e){for(var _i50=t,_s39=e;;){if(3==_i50.nodeType&&_s39<_i50.nodeValue.length)return{node:_i50,offset:_s39};if(1==_i50.nodeType&&_s39<_i50.childNodes.length){if("false"==_i50.contentEditable)return null;_i50=_i50.childNodes[_s39],_s39=0;}else{if(!_i50.parentNode||oe(_i50))return null;_s39=le(_i50)+1,_i50=_i50.parentNode;}}}function Oe(t){var e=t.nextSibling;return t.parentNode.removeChild(t),e;}function Ee(t,e,i,s,r,n,h,l,o){var u=t.children,f=u.length?u[e]:null,a=n.length?n[n.length-1]:null,c=a?a.breakAfter:h;if(!(e==s&&f&&!h&&!c&&n.length<2&&f.merge(i,r,n.length?a:null,0==i,l,o))){if(s<u.length){var _t42=u[s];_t42&&(r<_t42.length||_t42.breakAfter&&(null==a?void 0:a.breakAfter))?(e==s&&(_t42=_t42.split(r),r=0),!c&&a&&_t42.merge(0,r,a,!0,0,o)?n[n.length-1]=_t42:((r||_t42.children.length&&!_t42.children[0].length)&&_t42.merge(0,r,null,!1,0,o),n.push(_t42))):(null==_t42?void 0:_t42.breakAfter)&&(a?a.breakAfter=1:h=1),s++;}for(f&&(f.breakAfter=h,i>0&&(!h&&n.length&&f.merge(i,f.length,n[0],!1,l,0)?f.breakAfter=n.shift().breakAfter:(i<f.length||f.children.length&&0==f.children[f.children.length-1].length)&&f.merge(i,f.length,null,!1,l,0),e++));e<s&&n.length;)if(u[s-1].become(n[n.length-1]))s--,n.pop(),o=n.length?0:l;else{if(!u[e].become(n[0]))break;e++,n.shift(),l=n.length?0:o;}!n.length&&e&&s<u.length&&!u[e-1].breakAfter&&u[s].merge(0,0,u[e-1],!1,l,o)&&e--,(e<s||n.length)&&t.replaceChildren(e,s,n);}}function Ie(t,e,i,s,r,n){var h=t.childCursor(),_h$findPos=h.findPos(i,1),l=_h$findPos.i,o=_h$findPos.off,_h$findPos2=h.findPos(e,-1),u=_h$findPos2.i,f=_h$findPos2.off,a=e-i;var _iterator37=_createForOfIteratorHelper(s),_step37;try{for(_iterator37.s();!(_step37=_iterator37.n()).done;){var _t43=_step37.value;a+=_t43.length;}}catch(err){_iterator37.e(err);}finally{_iterator37.f();}t.length+=a,Ee(t,u,f,l,o,s,0,r,n);}function Ge(t,e){var i=t.dom,s=t.children,r=0;for(var _t47=0;r<s.length;r++){var _n35=s[r],_h23=_t47+_n35.length;if(!(_h23==_t47&&_n35.getSide()<=0)){if(e>_t47&&e<_h23&&_n35.dom.parentNode==i)return _n35.domAtPos(e-_t47);if(e<=_t47)break;_t47=_h23;}}for(var _t48=r;_t48>0;_t48--){var _e54=s[_t48-1];if(_e54.dom.parentNode==i)return _e54.domAtPos(_e54.length);}for(var _t49=r;_t49<s.length;_t49++){var _e55=s[_t49];if(_e55.dom.parentNode==i)return _e55.domAtPos(0);}return new Se(i,0);}function Ke(t,e,i){var s,r=t.children;i>0&&e instanceof qe&&r.length&&(s=r[r.length-1])instanceof qe&&s.mark.eq(e.mark)?Ke(s,e.children[0],i-1):(r.push(e),e.setParent(t)),t.length+=e.length;}function _e(t,e,i){var s=null,r=-1,n=null,h=-1;!function t(e,l){for(var _o11=0,_u8=0;_o11<e.children.length&&_u8<=l;_o11++){var _f6=e.children[_o11],_a5=_u8+_f6.length;_a5>=l&&(_f6.children.length?t(_f6,l-_u8):(!n||n.isHidden&&i>0)&&(_a5>l||_u8==_a5&&_f6.getSide()>0)?(n=_f6,h=l-_u8):(_u8<l||_u8==_a5&&_f6.getSide()<0&&!_f6.isHidden)&&(s=_f6,r=l-_u8)),_u8=_a5;}}(t,e);var l=(i<0?s:n)||s||n;return l?l.coordsAt(Math.max(0,l==s?r:h),i):function(t){var e=t.dom.lastChild;if(!e)return t.dom.getBoundingClientRect();var i=ne(e);return i[i.length-1]||null;}(t);}function Xe(t,e){for(var _i56 in t)"class"==_i56&&e["class"]?e["class"]+=" "+t["class"]:"style"==_i56&&e.style?e.style+=";"+t.style:e[_i56]=t[_i56];return e;}function Qe(t,e,i){if(t==e)return!0;t||(t=Ye),e||(e=Ye);var s=Object.keys(t),r=Object.keys(e);if(s.length-(i&&s.indexOf(i)>-1?1:0)!=r.length-(i&&r.indexOf(i)>-1?1:0))return!1;for(var _i57=0,_s44=s;_i57<_s44.length;_i57++){var _n36=_s44[_i57];if(_n36!=i&&(-1==r.indexOf(_n36)||t[_n36]!==e[_n36]))return!1;}return!0;}function Ze(t,e,i){var s=!1;if(e)for(var _r45 in e)i&&_r45 in i||(s=!0,"style"==_r45?t.style.cssText="":t.removeAttribute(_r45));if(i)for(var _r46 in i)e&&e[_r46]==i[_r46]||(s=!0,"style"==_r46?t.style.cssText=i[_r46]:t.setAttribute(_r46,i[_r46]));return s;}function ti(t){var e=Object.create(null);for(var _i58=0;_i58<t.attributes.length;_i58++){var _s45=t.attributes[_i58];e[_s45.name]=_s45.value;}return e;}function li(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!1;var i=t.inclusiveStart,s=t.inclusiveEnd;return null==i&&(i=t.inclusive),null==s&&(s=t.inclusive),{start:null!=i?i:e,end:null!=s?s:e};}function oi(t,e,i){var s=arguments.length>3&&arguments[3]!==undefined?arguments[3]:0;var r=i.length-1;r>=0&&i[r]+s>=t?i[r]=Math.max(i[r],e):i.push(t,e);}function di(t,e){var _iterator41=_createForOfIteratorHelper(e),_step41;try{for(_iterator41.s();!(_step41=_iterator41.n()).done;){var _i62=_step41.value;t=new qe(_i62,[t],t.length);}}catch(err){_iterator41.e(err);}finally{_iterator41.f();}return t;}function bi(t){var e=[];for(var _i63=0;_i63<t.length;_i63++)e.push(1<<+t[_i63]);return e;}function xi(t){return t<=247?vi[t]:1424<=t&&t<=1524?2:1536<=t&&t<=1785?ki[t-1536]:1774<=t&&t<=2220?4:8192<=t&&t<=8204?256:64336<=t&&t<=65023?4:1;}function Ci(t,e){if(t.length!=e.length)return!1;for(var _i66=0;_i66<t.length;_i66++){var _s51=t[_i66],_r49=e[_i66];if(_s51.from!=_r49.from||_s51.to!=_r49.to||_s51.direction!=_r49.direction||!Ci(_s51.inner,_r49.inner))return!1;}return!0;}function Di(t,e,i,s,r,n,h){var l=s%2?2:1;if(s%2==r%2)for(var _o13=e,_u10=0;_o13<i;){var _e59=!0,_f7=!1;if(_u10==n.length||_o13<n[_u10].from){var _t54=Oi[_o13];_t54!=l&&(_e59=!1,_f7=16==_t54);}var _a6=_e59||1!=l?null:[],_c3=_e59?s:s+1,_d2=_o13;t:for(;;)if(_u10<n.length&&_d2==n[_u10].from){if(_f7)break t;var _p3=n[_u10];if(!_e59)for(var _t55=_p3.to,_e60=_u10+1;;){if(_t55==i)break t;if(!(_e60<n.length&&n[_e60].from==_t55)){if(Oi[_t55]==l)break t;break;}_t55=n[_e60++].to;}if(_u10++,_a6)_a6.push(_p3);else{_p3.from>_o13&&h.push(new Ai(_o13,_p3.from,_c3)),Ei(t,_p3.direction==gi!=!(_c3%2)?s+1:s,r,_p3.inner,_p3.from,_p3.to,h),_o13=_p3.to;}_d2=_p3.to;}else{if(_d2==i||(_e59?Oi[_d2]!=l:Oi[_d2]==l))break;_d2++;}_a6?Di(t,_o13,_d2,s+1,r,_a6,h):_o13<_d2&&h.push(new Ai(_o13,_d2,_c3)),_o13=_d2;}else for(var _o14=i,_u11=n.length;_o14>e;){var _i67=!0,_f8=!1;if(!_u11||_o14>n[_u11-1].to){var _t56=Oi[_o14-1];_t56!=l&&(_i67=!1,_f8=16==_t56);}var _a7=_i67||1!=l?null:[],_c4=_i67?s:s+1,_d3=_o14;t:for(;;)if(_u11&&_d3==n[_u11-1].to){if(_f8)break t;var _p4=n[--_u11];if(!_i67)for(var _t57=_p4.from,_i68=_u11;;){if(_t57==e)break t;if(!_i68||n[_i68-1].to!=_t57){if(Oi[_t57-1]==l)break t;break;}_t57=n[--_i68].from;}if(_a7)_a7.push(_p4);else{_p4.to<_o14&&h.push(new Ai(_p4.to,_o14,_c4)),Ei(t,_p4.direction==gi!=!(_c4%2)?s+1:s,r,_p4.inner,_p4.from,_p4.to,h),_o14=_p4.from;}_d3=_p4.from;}else{if(_d3==e||(_i67?Oi[_d3-1]!=l:Oi[_d3-1]==l))break;_d3--;}_a7?Di(t,_d3,_o14,s+1,r,_a7,h):_d3<_o14&&h.push(new Ai(_d3,_o14,_c4)),_o14=_d3;}}function Ei(t,e,i,s,r,n,h){var l=e%2?2:1;!function(t,e,i,s,r){for(var _n41=0;_n41<=s.length;_n41++){var _h25=_n41?s[_n41-1].to:e,_l20=_n41<s.length?s[_n41].from:i,_o15=_n41?256:r;for(var _e61=_h25,_i69=_o15,_s52=_o15;_e61<_l20;_e61++){var _r50=xi(t.charCodeAt(_e61));512==_r50?_r50=_i69:8==_r50&&4==_s52&&(_r50=16),Oi[_e61]=4==_r50?2:_r50,7&_r50&&(_s52=_r50),_i69=_r50;}for(var _t58=_h25,_e62=_o15,_s53=_o15;_t58<_l20;_t58++){var _r51=Oi[_t58];if(128==_r51)_t58<_l20-1&&_e62==Oi[_t58+1]&&24&_e62?_r51=Oi[_t58]=_e62:Oi[_t58]=256;else if(64==_r51){var _r52=_t58+1;for(;_r52<_l20&&64==Oi[_r52];)_r52++;var _n42=_t58&&8==_e62||_r52<i&&8==Oi[_r52]?1==_s53?1:8:256;for(var _e63=_t58;_e63<_r52;_e63++)Oi[_e63]=_n42;_t58=_r52-1;}else 8==_r51&&1==_s53&&(Oi[_t58]=1);_e62=_r51,7&_r51&&(_s53=_r51);}}}(t,r,n,s,l),function(t,e,i,s,r){var n=1==r?2:1;for(var _h26=0,_l21=0,_o16=0;_h26<=s.length;_h26++){var _u12=_h26?s[_h26-1].to:e,_f9=_h26<s.length?s[_h26].from:i;for(var _e64,_i70,_s54,_h27=_u12;_h27<_f9;_h27++)if(_i70=yi[_e64=t.charCodeAt(_h27)]){if(_i70<0){for(var _t59=_l21-3;_t59>=0;_t59-=3)if(Mi[_t59+1]==-_i70){var _e65=Mi[_t59+2],_i71=2&_e65?r:4&_e65?1&_e65?n:r:0;_i71&&(Oi[_h27]=Oi[Mi[_t59]]=_i71),_l21=_t59;break;}}else{if(189==Mi.length)break;Mi[_l21++]=_h27,Mi[_l21++]=_e64,Mi[_l21++]=_o16;}}else if(2==(_s54=Oi[_h27])||1==_s54){var _t60=_s54==r;_o16=_t60?0:1;for(var _e66=_l21-3;_e66>=0;_e66-=3){var _i72=Mi[_e66+2];if(2&_i72)break;if(_t60)Mi[_e66+2]|=2;else{if(4&_i72)break;Mi[_e66+2]|=4;}}}}}(t,r,n,s,l),function(t,e,i,s){for(var _r53=0,_n43=s;_r53<=i.length;_r53++){var _h28=_r53?i[_r53-1].to:t,_l22=_r53<i.length?i[_r53].from:e;for(var _o17=_h28;_o17<_l22;){var _h29=Oi[_o17];if(256==_h29){var _h30=_o17+1;for(;;)if(_h30==_l22){if(_r53==i.length)break;_h30=i[_r53++].to,_l22=_r53<i.length?i[_r53].from:e;}else{if(256!=Oi[_h30])break;_h30++;}var _u13=1==_n43,_f10=_u13==(1==(_h30<e?Oi[_h30]:s))?_u13?1:2:s;for(var _e67=_h30,_s55=_r53,_n44=_s55?i[_s55-1].to:t;_e67>_o17;)_e67==_n44&&(_e67=i[--_s55].from,_n44=_s55?i[_s55-1].to:t),Oi[--_e67]=_f10;_o17=_h30;}else _n43=_h29,_o17++;}}}(r,n,s,l),Di(t,r,n,e,i,s,h);}function Ii(t){return[new Ai(0,t,0)];}function Ti(t,e,i,s,r){var n;var h=s.head-t.from,l=Ai.find(e,h,null!==(n=s.bidiLevel)&&void 0!==n?n:-1,s.assoc),o=e[l],u=o.side(r,i);if(h==u){var _t61=l+=r?1:-1;if(_t61<0||_t61>=e.length)return null;o=e[l=_t61],h=o.side(!r,i),u=o.side(r,i);}var f=S(t.text,h,o.forward(r,i));(f<o.from||f>o.to)&&(f=u),Ri=t.text.slice(Math.min(h,f),Math.max(h,f));var a=l==(r?e.length-1:0)?null:e[l+(r?1:-1)];return a&&f==u&&a.level+(r?0:1)<o.level?P.cursor(a.side(!r,i)+t.from,a.forward(r,i)?1:-1,a.level):P.cursor(f+t.from,o.forward(r,i)?-1:1,o.level);}function Bi(t,e,i){for(var _s56=e;_s56<i;_s56++){var _e68=xi(t.charCodeAt(_s56));if(1==_e68)return gi;if(2==_e68||4==_e68)return wi;}return gi;}function _i(t,e,i){var s=t.facet(ji);s.length?s[0](e):window.onerror?window.onerror(String(e),i,void 0,void 0,e):i?console.error(i+":",e):console.error(e);}function ls(t,e){var i=t.state.facet(hs);if(!i.length)return i;var s=i.map(function(e){return e instanceof Function?e(t):e;}),r=[];return $t.spans(s,e.from,e.to,{point:function point(){},span:function span(t,i,s,n){var h=t-e.from,l=i-e.from,o=r;for(var _t63=s.length-1;_t63>=0;_t63--,n--){var _i73=void 0,_r54=s[_t63].spec.bidiIsolate;if(null==_r54&&(_r54=Bi(e.text,h,l)),n>0&&o.length&&(_i73=o[o.length-1]).to==h&&_i73.direction==_r54)_i73.to=l,o=_i73.inner;else{var _t64={from:h,to:l,direction:_r54,inner:[]};o.push(_t64),o=_t64.inner;}}}}),r;}function us(t){var e=0,i=0,s=0,r=0;var _iterator42=_createForOfIteratorHelper(t.state.facet(os)),_step42;try{for(_iterator42.s();!(_step42=_iterator42.n()).done;){var _n45=_step42.value;var _h31=_n45(t);_h31&&(null!=_h31.left&&(e=Math.max(e,_h31.left)),null!=_h31.right&&(i=Math.max(i,_h31.right)),null!=_h31.top&&(s=Math.max(s,_h31.top)),null!=_h31.bottom&&(r=Math.max(r,_h31.bottom)));}}catch(err){_iterator42.e(err);}finally{_iterator42.f();}return{left:e,right:i,top:s,bottom:r};}function ps(t,e){var i=t.observer.selectionRange;if(!i.focusNode)return null;var s=Me(i.focusNode,i.focusOffset),r=xe(i.focusNode,i.focusOffset),n=s||r;if(r&&s&&r.node!=s.node){var _e87=Ce.get(r.node);if(!_e87||_e87 instanceof Ve&&_e87.text!=r.node.nodeValue)n=r;else if(t.docView.lastCompositionAfterCursor){var _t84=Ce.get(s.node);!_t84||_t84 instanceof Ve&&_t84.text!=s.node.nodeValue||(n=r);}}if(t.docView.lastCompositionAfterCursor=n!=s,!n)return null;var h=e-n.offset;return{from:h,to:h+n.node.nodeValue.length,node:n.node};}function gs(t,e){return e.left>t?e.left-t:Math.max(0,t-e.right);}function ws(t,e){return e.top>t?e.top-t:Math.max(0,t-e.bottom);}function bs(t,e){return t.top<e.bottom-1&&t.bottom>e.top+1;}function vs(t,e){return e<t.top?{top:e,left:t.left,right:t.right,bottom:t.bottom}:t;}function ks(t,e){return e>t.bottom?{top:t.top,left:t.left,right:t.right,bottom:e}:t;}function ys(t,e,i){var s,r,n,h,l,o,u,f,a=!1;for(var _c7=t.firstChild;_c7;_c7=_c7.nextSibling){var _t85=ne(_c7);for(var _d6=0;_d6<_t85.length;_d6++){var _p7=_t85[_d6];r&&bs(r,_p7)&&(_p7=vs(ks(_p7,r.bottom),r.top));var _m3=gs(e,_p7),_g3=ws(i,_p7);if(0==_m3&&0==_g3)return 3==_c7.nodeType?Ms(_c7,e,i):ys(_c7,e,i);if(!s||h>_g3||h==_g3&&n>_m3){s=_c7,r=_p7,n=_m3,h=_g3;var _l27=_g3?i<_p7.top?-1:1:_m3?e<_p7.left?-1:1:0;a=!_l27||(_l27>0?_d6<_t85.length-1:_d6>0);}0==_m3?i>_p7.bottom&&(!u||u.bottom<_p7.bottom)?(l=_c7,u=_p7):i<_p7.top&&(!f||f.top>_p7.top)&&(o=_c7,f=_p7):u&&bs(u,_p7)?u=ks(u,_p7.bottom):f&&bs(f,_p7)&&(f=vs(f,_p7.top));}}if(u&&u.bottom>=i?(s=l,r=u):f&&f.top<=i&&(s=o,r=f),!s)return{node:t,offset:0};var c=Math.max(r.left,Math.min(r.right,e));return 3==s.nodeType?Ms(s,c,i):a&&"false"!=s.contentEditable?ys(s,c,i):{node:t,offset:Array.prototype.indexOf.call(t.childNodes,s)+(e>=(r.left+r.right)/2?1:0)};}function Ms(t,e,i){var s=t.nodeValue.length,r=-1,n=1e9,h=0;for(var _l28=0;_l28<s;_l28++){var _s68=be(t,_l28,_l28+1).getClientRects();for(var _o22=0;_o22<_s68.length;_o22++){var _u17=_s68[_o22];if(_u17.top==_u17.bottom)continue;h||(h=e-_u17.left);var _f14=(_u17.top>i?_u17.top-i:i-_u17.bottom)-1;if(_u17.left-1<=e&&_u17.right+1>=e&&_f14<n){var _i80=e>=(_u17.left+_u17.right)/2,_s69=_i80;if(Fe.chrome||Fe.gecko){be(t,_l28).getBoundingClientRect().left==_u17.right&&(_s69=!_i80);}if(_f14<=0)return{node:t,offset:_l28+(_s69?1:0)};r=_l28+(_s69?1:0),n=_f14;}}}return{node:t,offset:r>-1?r:h>0?t.nodeValue.length:0};}function xs(t,e,i){var s=arguments.length>3&&arguments[3]!==undefined?arguments[3]:-1;var r,n;var h,l=t.contentDOM.getBoundingClientRect(),o=l.top+t.viewState.paddingTop,u=t.viewState.docHeight,f=e.x,a=e.y,c=a-o;if(c<0)return 0;if(c>u)return t.state.doc.length;for(var _e88=t.viewState.heightOracle.textHeight/2,_r59=!1;h=t.elementAtHeight(c),h.type!=ii.Text;)for(;c=s>0?h.bottom+_e88:h.top-_e88,!(c>=0&&c<=u);){if(_r59)return i?null:0;_r59=!0,s=-s;}a=o+c;var d=h.from;if(d<t.viewport.from)return 0==t.viewport.from?0:i?null:Ss(t,l,h,f,a);if(d>t.viewport.to)return t.viewport.to==t.state.doc.length?t.state.doc.length:i?null:Ss(t,l,h,f,a);var p=t.dom.ownerDocument,m=t.root.elementFromPoint?t.root:p,g=m.elementFromPoint(f,a);g&&!t.contentDOM.contains(g)&&(g=null),g||(f=Math.max(l.left+1,Math.min(l.right-1,f)),g=m.elementFromPoint(f,a),g&&!t.contentDOM.contains(g)&&(g=null));var w,b=-1;if(g&&0!=(null===(r=t.docView.nearest(g))||void 0===r?void 0:r.isEditable)){if(p.caretPositionFromPoint){var _t87;var _t86=p.caretPositionFromPoint(f,a);_t86&&(_t87=_t86,w=_t87.offsetNode,b=_t87.offset,_t87);}else if(p.caretRangeFromPoint){var _e89=p.caretRangeFromPoint(f,a);_e89&&(w=_e89.startContainer,b=_e89.startOffset,(!t.contentDOM.contains(w)||Fe.safari&&function(t,e,i){var s;if(3!=t.nodeType||e!=(s=t.nodeValue.length))return!1;for(var _e90=t.nextSibling;_e90;_e90=_e90.nextSibling)if(1!=_e90.nodeType||"BR"!=_e90.nodeName)return!1;return be(t,s-1,s).getBoundingClientRect().left>i;}(w,b,f)||Fe.chrome&&function(t,e,i){if(0!=e)return!1;for(var _e91=t;;){var _t88=_e91.parentNode;if(!_t88||1!=_t88.nodeType||_t88.firstChild!=_e91)return!1;if(_t88.classList.contains("cm-line"))break;_e91=_t88;}var s=1==t.nodeType?t.getBoundingClientRect():be(t,0,Math.max(t.nodeValue.length,1)).getBoundingClientRect();return i-s.left>5;}(w,b,f))&&(w=void 0));}w&&(b=Math.min(fe(w),b));}if(!w||!t.docView.dom.contains(w)){var _e92=ui.find(t.docView,d);if(!_e92)return c>h.top+h.height/2?h.to:h.from;var _ys=ys(_e92.dom,f,a);w=_ys.node;b=_ys.offset;}var v=t.docView.nearest(w);if(!v)return null;if(v.isWidget&&1==(null===(n=v.dom)||void 0===n?void 0:n.nodeType)){var _t89=v.dom.getBoundingClientRect();return e.y<_t89.top||e.y<=_t89.bottom&&e.x<=(_t89.left+_t89.right)/2?v.posAtStart:v.posAtEnd;}return v.localPosFromDOM(w,b)+v.posAtStart;}function Ss(t,e,i,s,r){var n=Math.round((s-e.left)*t.defaultCharacterWidth);if(t.lineWrapping&&i.height>1.5*t.defaultLineHeight){var _e93=t.viewState.heightOracle.textHeight;n+=Math.floor((r-i.top-.5*(t.defaultLineHeight-_e93))/_e93)*t.viewState.heightOracle.lineLength;}var h=t.state.sliceDoc(i.from,i.to);return i.from+_t(h,n,t.state.tabSize);}function As(t,e){var i=t.lineBlockAt(e);if(Array.isArray(i.type)){var _iterator50=_createForOfIteratorHelper(i.type),_step50;try{for(_iterator50.s();!(_step50=_iterator50.n()).done;){var _t90=_step50.value;if(_t90.to>e||_t90.to==e&&(_t90.to==i.to||_t90.type==ii.Text))return _t90;}}catch(err){_iterator50.e(err);}finally{_iterator50.f();}}return i;}function Cs(t,e,i,s){var r=t.state.doc.lineAt(e.head),n=t.bidiSpans(r),h=t.textDirectionAt(r.from);for(var _l29=e,_o23=null;;){var _e94=Ti(r,n,h,_l29,i),_u18=Ri;if(!_e94){if(r.number==(i?t.state.doc.lines:1))return _l29;_u18="\n",r=t.state.doc.line(r.number+(i?1:-1)),n=t.bidiSpans(r),_e94=t.visualLineSide(r,!i);}if(_o23){if(!_o23(_u18))return _l29;}else{if(!s)return _e94;_o23=s(_u18);}_l29=_e94;}}function Os(t,e,i){var _loop5=function _loop5(){var s=0;var _iterator51=_createForOfIteratorHelper(t),_step51;try{for(_iterator51.s();!(_step51=_iterator51.n()).done;){var _r60=_step51.value;_r60.between(e-1,e+1,function(t,r,n){if(e>t&&e<r){var _n53=s||i||(e-t<r-e?-1:1);e=_n53<0?t:r,s=_n53;}});}}catch(err){_iterator51.e(err);}finally{_iterator51.f();}if(!s)return{v:e};},_ret;for(;;){_ret=_loop5();if(_ret)return _ret.v;}}function Ds(t,e,i){var s=Os(t.state.facet(ns).map(function(e){return e(t);}),i.from,e.head>i.from?-1:1);return s==i.from?i:P.cursor(s,s<i.from?1:-1);}function Rs(t,e,i){for(;;){if(!e||i<fe(e))return!1;if(e==t)return!0;i=le(e)+1,e=e.parentNode;}}function Ls(t,e){var i,s=e.newSel,r=t.state.selection.main,n=t.inputState.lastKeyTime>Date.now()-100?t.inputState.lastKeyCode:-1;if(e.bounds){var _e$bounds=e.bounds,_s73=_e$bounds.from,_h38=_e$bounds.to,_l31=r.from,_o24=null;(8===n||Fe.android&&e.text.length<_h38-_s73)&&(_l31=r.to,_o24="end");var _u19=function(t,e,i,s){var r=Math.min(t.length,e.length),n=0;for(;n<r&&t.charCodeAt(n)==e.charCodeAt(n);)n++;if(n==r&&t.length==e.length)return null;var h=t.length,l=e.length;for(;h>0&&l>0&&t.charCodeAt(h-1)==e.charCodeAt(l-1);)h--,l--;if("end"==s){i-=h+Math.max(0,n-Math.min(h,l))-n;}if(h<n&&t.length<e.length){n-=i<=n&&i>=h?n-i:0,l=n+(l-h),h=n;}else if(l<n){n-=i<=n&&i>=l?n-i:0,h=n+(h-l),l=n;}return{from:n,toA:h,toB:l};}(t.state.doc.sliceString(_s73,_h38,Es),e.text,_l31-_s73,_o24);_u19&&(Fe.chrome&&13==n&&_u19.toB==_u19.from+2&&e.text.slice(_u19.from,_u19.toB)==Es+Es&&_u19.toB--,i={from:_s73+_u19.from,to:_s73+_u19.toA,insert:p.of(e.text.slice(_u19.from,_u19.toB).split(Es))});}else s&&(!t.hasFocus&&t.state.facet(Xi)||s.main.eq(r))&&(s=null);if(!i&&!s)return!1;if(!i&&e.typeOver&&!r.empty&&s&&s.main.empty?i={from:r.from,to:r.to,insert:t.state.doc.slice(r.from,r.to)}:(Fe.mac||Fe.android)&&i&&i.from==i.to&&i.from==r.head-1&&/^\. ?$/.test(i.insert.toString())&&"off"==t.contentDOM.getAttribute("autocorrect")?(s&&2==i.insert.length&&(s=P.single(s.main.anchor-1,s.main.head-1)),i={from:i.from,to:i.to,insert:p.of([i.insert.toString().replace("."," ")])}):i&&i.from>=r.from&&i.to<=r.to&&(i.from!=r.from||i.to!=r.to)&&r.to-r.from-(i.to-i.from)<=4?i={from:r.from,to:r.to,insert:t.state.doc.slice(r.from,i.from).append(i.insert).append(t.state.doc.slice(i.to,r.to))}:Fe.chrome&&i&&i.from==i.to&&i.from==r.head&&"\n "==i.insert.toString()&&t.lineWrapping&&(s&&(s=P.single(s.main.anchor-1,s.main.head-1)),i={from:r.from,to:r.to,insert:p.of([" "])}),i)return Ns(t,i,s,n);if(s&&!s.main.eq(r)){var _e99=!1,_i87="select";return t.inputState.lastSelectionTime>Date.now()-50&&("select"==t.inputState.lastSelectionOrigin&&(_e99=!0),_i87=t.inputState.lastSelectionOrigin),t.dispatch({selection:s,scrollIntoView:_e99,userEvent:_i87}),!0;}return!1;}function Ns(t,e,i){var s=arguments.length>3&&arguments[3]!==undefined?arguments[3]:-1;if(Fe.ios&&t.inputState.flushIOSKey(e))return!0;var r=t.state.selection.main;if(Fe.android&&(e.to==r.to&&(e.from==r.from||e.from==r.from-1&&" "==t.state.sliceDoc(e.from,r.from))&&1==e.insert.length&&2==e.insert.lines&&ve(t.contentDOM,"Enter",13)||(e.from==r.from-1&&e.to==r.to&&0==e.insert.length||8==s&&e.insert.length<e.to-e.from&&e.to>r.head)&&ve(t.contentDOM,"Backspace",8)||e.from==r.from&&e.to==r.to+1&&0==e.insert.length&&ve(t.contentDOM,"Delete",46)))return!0;var n,h=e.insert.toString();t.inputState.composing>=0&&t.inputState.composing++;var l=function l(){return n||(n=function(t,e,i){var s,r=t.state,n=r.selection.main;if(e.from>=n.from&&e.to<=n.to&&e.to-e.from>=(n.to-n.from)/3&&(!i||i.main.empty&&i.main.from==e.from+e.insert.length)&&t.inputState.composing<0){var _i88=n.from<e.from?r.sliceDoc(n.from,e.from):"",_h39=n.to>e.to?r.sliceDoc(e.to,n.to):"";s=r.replaceSelection(t.state.toText(_i88+e.insert.sliceString(0,void 0,t.state.lineBreak)+_h39));}else{var _h40=r.changes(e),_l32=i&&i.main.to<=_h40.newLength?i.main:void 0;if(r.selection.ranges.length>1&&t.inputState.composing>=0&&e.to<=n.to&&e.to>=n.to-10){var _o25,_u20=t.state.sliceDoc(e.from,e.to),_f15=i&&ps(t,i.main.head);if(_f15){var _t93=e.insert.length-(e.to-e.from);_o25={from:_f15.from,to:_f15.to-_t93};}else _o25=t.state.doc.lineAt(n.head);var _a10=n.to-e.to,_c8=n.to-n.from;s=r.changeByRange(function(i){if(i.from==n.from&&i.to==n.to)return{changes:_h40,range:_l32||i.map(_h40)};var s=i.to-_a10,f=s-_u20.length;if(i.to-i.from!=_c8||t.state.sliceDoc(f,s)!=_u20||i.to>=_o25.from&&i.from<=_o25.to)return{range:i};var d=r.changes({from:f,to:s,insert:e.insert}),p=i.to-n.to;return{changes:d,range:_l32?P.range(Math.max(0,_l32.anchor+p),Math.max(0,_l32.head+p)):i.map(d)};});}else s={changes:_h40,selection:_l32&&r.selection.replaceRange(_l32)};}var h="input.type";(t.composing||t.inputState.compositionPendingChange&&t.inputState.compositionEndedAt>Date.now()-50)&&(t.inputState.compositionPendingChange=!1,h+=".compose",t.inputState.compositionFirstChange&&(h+=".start",t.inputState.compositionFirstChange=!1));return r.update(s,{userEvent:h,scrollIntoView:!0});}(t,e,i));};return t.state.facet(Pi).some(function(i){return i(t,e.from,e.to,h,l);})||t.dispatch(l()),!0;}function js(t,e){return function(i,s){try{return e.call(t,s,i);}catch(t){_i(i.state,t);}};}function zs(t){var e=Object.create(null);function i(t){return e[t]||(e[t]={observers:[],handlers:[]});}var _iterator58=_createForOfIteratorHelper(t),_step58;try{for(_iterator58.s();!(_step58=_iterator58.n()).done;){var _e100=_step58.value;var _t100=_e100.spec;if(_t100&&_t100.domEventHandlers)for(var _s75 in _t100.domEventHandlers){var _r65=_t100.domEventHandlers[_s75];_r65&&i(_s75).handlers.push(js(_e100.value,_r65));}if(_t100&&_t100.domEventObservers)for(var _s76 in _t100.domEventObservers){var _r66=_t100.domEventObservers[_s76];_r66&&i(_s76).observers.push(js(_e100.value,_r66));}}}catch(err){_iterator58.e(err);}finally{_iterator58.f();}for(var _t98 in qs)i(_t98).handlers.push(qs[_t98]);for(var _t99 in Js)i(_t99).observers.push(Js[_t99]);return e;}function Fs(t){return .7*Math.max(0,t)+8;}function Gs(t,e,i){var _iterator59=_createForOfIteratorHelper(t.facet(e)),_step59;try{for(_iterator59.s();!(_step59=_iterator59.n()).done;){var _s78=_step59.value;i=_s78(i,t);}}catch(err){_iterator59.e(err);}finally{_iterator59.f();}return i;}function Ks(t,e){e=Gs(t.state,Wi,e);var i,s=t.state,r=1,n=s.toText(e),h=n.lines==s.selection.ranges.length;if(null!=nr&&s.selection.ranges.every(function(t){return t.empty;})&&nr==n.toString()){var _t104=-1;i=s.changeByRange(function(i){var l=s.doc.lineAt(i.from);if(l.from==_t104)return{range:i};_t104=l.from;var o=s.toText((h?n.line(r++).text:e)+s.lineBreak);return{changes:{from:l.from,insert:o},range:P.cursor(i.from+o.length)};});}else i=h?s.changeByRange(function(t){var e=n.line(r++);return{changes:{from:t.from,to:t.to,insert:e.text},range:P.cursor(t.from+e.length)};}):s.replaceSelection(n);t.dispatch(i,{userEvent:"input.paste",scrollIntoView:!0});}function _s(t,e,i,s){if(1==s)return P.cursor(e,i);if(2==s)return function(t,e){var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:1;var s=t.charCategorizer(e),r=t.doc.lineAt(e),n=e-r.from;if(0==r.length)return P.cursor(e);0==n?i=1:n==r.length&&(i=-1);var h=n,l=n;i<0?h=S(r.text,n,!1):l=S(r.text,n);var o=s(r.text.slice(h,l));for(;h>0;){var _t105=S(r.text,h,!1);if(s(r.text.slice(_t105,h))!=o)break;h=_t105;}for(;l<r.length;){var _t106=S(r.text,l);if(s(r.text.slice(l,_t106))!=o)break;l=_t106;}return P.range(h+r.from,l+r.from);}(t.state,e,i);{var _i92=ui.find(t.docView,e),_s79=t.state.doc.lineAt(_i92?_i92.posAtEnd:e),_r69=_i92?_i92.posAtStart:_s79.from,_n58=_i92?_i92.posAtEnd:_s79.to;return _n58<t.state.doc.length&&_n58==_s79.to&&_n58++,P.range(_r69,_n58);}}function Ys(t,e,i,s){var r=ui.find(t.docView,e);if(!r)return 1;var n=e-r.posAtStart;if(0==n)return 1;if(n==r.length)return-1;var h=r.coordsAt(n,-1);if(h&&Xs(i,s,h))return-1;var l=r.coordsAt(n,1);return l&&Xs(i,s,l)?1:h&&h.bottom>=s?-1:1;}function Qs(t,e){var i=t.posAtCoords({x:e.clientX,y:e.clientY},!1);return{pos:i,bias:Ys(t,i,e.clientX,e.clientY)};}function sr(t){if(!Zs)return t.detail;var e=tr,i=ir;return tr=t,ir=Date.now(),er=!e||i>Date.now()-400&&Math.abs(e.clientX-t.clientX)<2&&Math.abs(e.clientY-t.clientY)<2?(er+1)%3:1;}function rr(t,e,i,s){if(!(i=Gs(t.state,Wi,i)))return;var r=t.posAtCoords({x:e.clientX,y:e.clientY},!1),n=t.inputState.draggedContent,h=s&&n&&function(t,e){var i=t.state.facet(Ni);return i.length?i[0](e):Fe.mac?!e.altKey:!e.ctrlKey;}(t,e)?{from:n.from,to:n.to}:null,l={from:r,insert:i},o=t.state.changes(h?[h,l]:l);t.focus(),t.dispatch({changes:o,selection:{anchor:o.mapPos(r,-1),head:o.mapPos(r,1)},userEvent:h?"move.drop":"input.drop"}),t.inputState.draggedContent=null;}function lr(t,e){var i=[];var _iterator63=_createForOfIteratorHelper(t.facet(Hi)),_step63;try{for(_iterator63.s();!(_step63=_iterator63.n()).done;){var _s87=_step63.value;var _r75=_s87(t,e);_r75&&i.push(_r75);}}catch(err){_iterator63.e(err);}finally{_iterator63.f();}return i?t.update({effects:i,annotations:hr.of(!0)}):null;}function or(t){setTimeout(function(){var e=t.hasFocus;if(e!=t.inputState.notifiedFocused){var _i95=lr(t.state,e);_i95?t.dispatch(_i95):t.update([]);}},10);}function cr(){ar=!1;}function vr(t,e){return t==e?t:(t.constructor!=e.constructor&&(ar=!0),e);}function Sr(t,e){var i,s;null==t[e]&&(i=t[e-1])instanceof Mr&&(s=t[e+1])instanceof Mr&&t.splice(e-1,3,new Mr(i.length+1+s.length));}function Or(t,e){var i=t.getBoundingClientRect(),s=t.ownerDocument,r=s.defaultView||window,n=Math.max(0,i.left),h=Math.min(r.innerWidth,i.right),l=Math.max(0,i.top),o=Math.min(r.innerHeight,i.bottom);for(var _e114=t.parentNode;_e114&&_e114!=s.body;)if(1==_e114.nodeType){var _i102=_e114,_s94=window.getComputedStyle(_i102);if((_i102.scrollHeight>_i102.clientHeight||_i102.scrollWidth>_i102.clientWidth)&&"visible"!=_s94.overflow){var _s95=_i102.getBoundingClientRect();n=Math.max(n,_s95.left),h=Math.min(h,_s95.right),l=Math.max(l,_s95.top),o=Math.min(_e114==t.parentNode?r.innerHeight:o,_s95.bottom);}_e114="absolute"==_s94.position||"fixed"==_s94.position?_i102.offsetParent:_i102.parentNode;}else{if(11!=_e114.nodeType)break;_e114=_e114.host;}return{left:n-i.left,right:Math.max(n,h)-i.left,top:l-(i.top+e),bottom:Math.max(l,o)-(i.top+e)};}function Dr(t,e){var i=t.getBoundingClientRect();return{left:0,right:i.right-i.left,top:e,bottom:i.bottom-(i.top+e)};}function Br(_ref10,i){var t=_ref10.total,e=_ref10.ranges;if(i<=0)return e[0].from;if(i>=1)return e[e.length-1].to;var s=Math.floor(t*i);for(var _t124=0;;_t124++){var _e$_t=e[_t124],_i115=_e$_t.from,_r84=_e$_t.to,_n70=_r84-_i115;if(s<=_n70)return _i115+s;s-=_n70;}}function Lr(t,e){var i=0;var _iterator71=_createForOfIteratorHelper(t.ranges),_step71;try{for(_iterator71.s();!(_step71=_iterator71.n()).done;){var _step71$value=_step71.value,_s99=_step71$value.from,_r85=_step71$value.to;if(e<=_r85){i+=e-_s99;break;}i+=_r85-_s99;}}catch(err){_iterator71.e(err);}finally{_iterator71.f();}return i/t.total;}function jr(t,e){if(1==e.scale)return t;var i=e.toDOM(t.top),s=e.toDOM(t.bottom);return new mr(t.from,t.length,i,s-i,Array.isArray(t._content)?t._content.map(function(t){return jr(t,e);}):t._content);}function qr(t,e,i){return new Zt(e,{finish:function finish(e){return /&/.test(e)?e.replace(/&\w*/,function(e){if("&"==e)return t;if(!i||!i[e])throw new RangeError("Unsupported selector: ".concat(e));return i[e];}):t+" "+e;}});}function _r(t,e,i){for(;e;){var _s103=Ce.get(e);if(_s103&&_s103.parent==t)return _s103;var _r89=e.parentNode;e=_r89!=t.dom?_r89:i>0?e.nextSibling:e.previousSibling;}return null;}function Xr(t,e){var _ref12;var i=e.startContainer,s=e.startOffset,r=e.endContainer,n=e.endOffset,h=t.docView.domAtPos(t.state.selection.main.anchor);return he(h.node,h.offset,r,n)&&(_ref12=[r,n,i,s],i=_ref12[0],s=_ref12[1],r=_ref12[2],n=_ref12[3],_ref12),{anchorNode:i,anchorOffset:s,focusNode:r,focusOffset:n};}function sn(t,e,i){for(var _s110=t.state.facet(e),_r94=_s110.length-1;_r94>=0;_r94--){var _e137=_s110[_r94],_n74="function"==typeof _e137?_e137(t):_e137;_n74&&Xe(_n74,i);}return i;}function nn(t,e,i){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),!1!==i&&e.shiftKey&&(t="Shift-"+t),t;}function un(t){var e=t.facet(ln),i=on.get(e);return i||on.set(e,i=function(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:rn;var i=Object.create(null),s=Object.create(null),r=function r(t,e){var i=s[t];if(null==i)s[t]=e;else if(i!=e)throw new Error("Key binding "+t+" is used both as a regular binding and as a multi-stroke prefix");},n=function n(t,s,_n75,h,l){var o,u;var f=i[t]||(i[t]=Object.create(null)),a=s.split(/ (?!$)/).map(function(t){return function(t,e){var i=t.split(/-(?!$)/);var s,r,n,h,l=i[i.length-1];"Space"==l&&(l=" ");for(var _t154=0;_t154<i.length-1;++_t154){var _l41=i[_t154];if(/^(cmd|meta|m)$/i.test(_l41))h=!0;else if(/^a(lt)?$/i.test(_l41))s=!0;else if(/^(c|ctrl|control)$/i.test(_l41))r=!0;else if(/^s(hift)?$/i.test(_l41))n=!0;else{if(!/^mod$/i.test(_l41))throw new Error("Unrecognized modifier name: "+_l41);"mac"==e?h=!0:r=!0;}}return s&&(l="Alt-"+l),r&&(l="Ctrl-"+l),h&&(l="Meta-"+l),n&&(l="Shift-"+l),l;}(t,e);});var _loop8=function _loop8(){var i=a.slice(0,_e138).join(" ");r(i,!0),f[i]||(f[i]={preventDefault:!0,stopPropagation:!1,run:[function(e){var s=fn={view:e,prefix:i,scope:t};return setTimeout(function(){fn==s&&(fn=null);},an),!0;}]});};for(var _e138=1;_e138<a.length;_e138++){_loop8();}var c=a.join(" ");r(c,!1);var d=f[c]||(f[c]={preventDefault:!1,stopPropagation:!1,run:(null===(u=null===(o=f._any)||void 0===o?void 0:o.run)||void 0===u?void 0:u.slice())||[]});_n75&&d.run.push(_n75),h&&(d.preventDefault=!0),l&&(d.stopPropagation=!0);};var _iterator97=_createForOfIteratorHelper(t),_step97;try{for(_iterator97.s();!(_step97=_iterator97.n()).done;){var _s111=_step97.value;var _t155=_s111.scope?_s111.scope.split(" "):["editor"];if(_s111.any){var _iterator98=_createForOfIteratorHelper(_t155),_step98;try{var _loop9=function _loop9(){var e=_step98.value;var t=i[e]||(i[e]=Object.create(null));t._any||(t._any={preventDefault:!1,stopPropagation:!1,run:[]});var r=_s111.any;for(var _e139 in t)t[_e139].run.push(function(t){return r(t,cn);});};for(_iterator98.s();!(_step98=_iterator98.n()).done;){_loop9();}}catch(err){_iterator98.e(err);}finally{_iterator98.f();}}var _r95=_s111[e]||_s111.key;if(_r95){var _iterator99=_createForOfIteratorHelper(_t155),_step99;try{for(_iterator99.s();!(_step99=_iterator99.n()).done;){var _e140=_step99.value;n(_e140,_r95,_s111.run,_s111.preventDefault,_s111.stopPropagation),_s111.shift&&n(_e140,"Shift-"+_r95,_s111.shift,_s111.preventDefault,_s111.stopPropagation);}}catch(err){_iterator99.e(err);}finally{_iterator99.f();}}}}catch(err){_iterator97.e(err);}finally{_iterator97.f();}return i;}(e.reduce(function(t,e){return t.concat(e);},[]))),i;}function dn(s,r,n,h){cn=r;var l=t(r),o=O(A(l,0))==l.length&&" "!=l,u="",f=!1,a=!1,c=!1;fn&&fn.view==n&&fn.scope==h&&(u=fn.prefix+" ",Ws.indexOf(r.keyCode)<0&&(a=!0,fn=null));var d,p,m=new Set(),g=function g(t){if(t){var _iterator100=_createForOfIteratorHelper(t.run),_step100;try{for(_iterator100.s();!(_step100=_iterator100.n()).done;){var _e141=_step100.value;if(!m.has(_e141)&&(m.add(_e141),_e141(n)))return t.stopPropagation&&(c=!0),!0;}}catch(err){_iterator100.e(err);}finally{_iterator100.f();}t.preventDefault&&(t.stopPropagation&&(c=!0),a=!0);}return!1;},w=s[h];return w&&(g(w[u+nn(l,r,!o)])?f=!0:o&&(r.altKey||r.metaKey||r.ctrlKey)&&!(Fe.windows&&r.ctrlKey&&r.altKey)&&(d=e[r.keyCode])&&d!=l?(g(w[u+nn(d,r,!0)])||r.shiftKey&&(p=i[r.keyCode])!=l&&p!=d&&g(w[u+nn(p,r,!1)]))&&(f=!0):o&&r.shiftKey&&g(w[u+nn(l,r,!0)])&&(f=!0),!f&&g(w._any)&&(f=!0)),a&&(f=!0),f&&c&&r.stopPropagation(),cn=null,f;}function mn(t){var e=t.scrollDOM.getBoundingClientRect();return{left:(t.textDirection==mi.LTR?e.left:e.right-t.scrollDOM.clientWidth*t.scaleX)-t.scrollDOM.scrollLeft*t.scaleX,top:e.top-t.scrollDOM.scrollTop*t.scaleY};}function gn(t,e,i,s){var r=t.coordsAtPos(e,2*i);if(!r)return s;var n=t.dom.getBoundingClientRect(),h=(r.top+r.bottom)/2,l=t.posAtCoords({x:n.left+1,y:h}),o=t.posAtCoords({x:n.right-1,y:h});return null==l||null==o?s:{from:Math.max(s.from,Math.min(l,o)),to:Math.min(s.to,Math.max(l,o))};}function vn(t){return[Zi.define(function(e){return new wn(e,t);}),bn.of(t)];}function Mn(t){return t.startState.facet(yn)!=t.state.facet(yn);}function Sn(t,e){e.style.animationDuration=t.facet(yn).cursorBlinkRate+"ms";}function Rn(t,e,i,s,r){e.lastIndex=0;for(var _n78,_h49=t.iterRange(i,s),_l43=i;!_h49.next().done;_l43+=_h49.value.length)if(!_h49.lineBreak)for(;_n78=e.exec(_h49.value);)r(_l43+_n78.index,_n78);}function qn(t){return Zi.fromClass(/*#__PURE__*/function(){function _class3(e){_classCallCheck(this,_class3);this.view=e,this.placeholder=t?si.set([si.widget({widget:new Vn(t),side:1}).range(0)]):si.none;}return _createClass(_class3,[{key:"decorations",get:function get(){return this.view.state.doc.length?si.none:this.placeholder;}}]);}(),{decorations:function decorations(t){return t.decorations;}});}function Un(t,e){var i=t.posAtCoords({x:e.clientX,y:e.clientY},!1),s=t.state.doc.lineAt(i),r=i-s.from,n=r>Jn?-1:r==s.length?function(t,e){var i=t.coordsAtPos(t.viewport.from);return i?Math.round(Math.abs((i.left-e)/t.defaultCharacterWidth)):-1;}(t,e.clientX):Kt(s.text,t.state.tabSize,i-s.from);return{line:s.number,col:n,off:r};}function Gn(t,e){var i=Un(t,e),s=t.state.selection;return i?{update:function update(t){if(t.docChanged){var _e148=t.changes.mapPos(t.startState.doc.line(i.line).from),_r104=t.state.doc.lineAt(_e148);i={line:_r104.number,col:i.col,off:Math.min(i.off,_r104.length)},s=s.map(t.changes);}},get:function get(e,r,n){var h=Un(t,e);if(!h)return s;var l=function(t,e,i){var s=Math.min(e.line,i.line),r=Math.max(e.line,i.line),n=[];if(e.off>Jn||i.off>Jn||e.col<0||i.col<0){var _h50=Math.min(e.off,i.off),_l45=Math.max(e.off,i.off);for(var _e149=s;_e149<=r;_e149++){var _i130=t.doc.line(_e149);_i130.length<=_l45&&n.push(P.range(_i130.from+_h50,_i130.to+_l45));}}else{var _h51=Math.min(e.col,i.col),_l46=Math.max(e.col,i.col);for(var _e150=s;_e150<=r;_e150++){var _i131=t.doc.line(_e150),_s120=_t(_i131.text,_h51,t.tabSize,!0);if(_s120<0)n.push(P.cursor(_i131.to));else{var _e151=_t(_i131.text,_l46,t.tabSize);n.push(P.range(_i131.from+_s120,_i131.from+_e151));}}}return n;}(t.state,i,h);return l.length?n?P.create(l.concat(s.ranges)):P.create(l):s;}}:null;}function Qn(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return th.of(t);}function Zn(t){var e=t.win;return{top:0,left:0,bottom:e.innerHeight,right:e.innerWidth};}function sh(t,e){var i=parseInt(t.style.left,10);(isNaN(i)||Math.abs(e-i)>1)&&(t.style.left=e+"px");}function ch(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var i=bt.define(),s=_.define({create:function create(){return[];},update:function update(t,s){if(t.length&&(e.hideOnChange&&(s.docChanged||s.selection)?t=[]:e.hideOn&&(t=t.filter(function(t){return!e.hideOn(s,t);})),s.docChanged)){var _e162=[];var _iterator123=_createForOfIteratorHelper(t),_step123;try{for(_iterator123.s();!(_step123=_iterator123.n()).done;){var _i136=_step123.value;var _t170=s.changes.mapPos(_i136.pos,-1,E.TrackDel);if(null!=_t170){var _r106=Object.assign(Object.create(null),_i136);_r106.pos=_t170,null!=_r106.end&&(_r106.end=s.changes.mapPos(_r106.end)),_e162.push(_r106);}}}catch(err){_iterator123.e(err);}finally{_iterator123.f();}t=_e162;}var _iterator124=_createForOfIteratorHelper(s.effects),_step124;try{for(_iterator124.s();!(_step124=_iterator124.n()).done;){var _e163=_step124.value;_e163.is(i)&&(t=_e163.value),_e163.is(ph)&&(t=[]);}}catch(err){_iterator124.e(err);}finally{_iterator124.f();}return t;},provide:function provide(t){return lh.from(t);}});return{active:s,extension:[s,Zi.define(function(r){return new fh(r,t,s,i,e.hoverTime||300);}),uh]};}function dh(t,e){var i=t.plugin(ih);if(!i)return null;var s=i.manager.tooltips.indexOf(e);return s<0?null:i.manager.tooltipViews[s];}function gh(t,e){var i=t.plugin(wh),s=i?i.specs.indexOf(e):-1;return s>-1?i.panels[s]:null;}function vh(t){var e=t.nextSibling;return t.remove(),e;}function Ch(t){return[Dh(),Ah.of(Object.assign(Object.assign({},Sh),t))];}function Dh(t){var e=[Eh];return t&&!1===t.fixed&&e.push(Oh.of(!0)),e;}function Ih(t){return Array.isArray(t)?t:[t];}function Rh(t,e,i){for(;t.value&&t.from<=i;)t.from==i&&e.push(t.value),t.next();}function Ph(t,e){return t.state.facet(jh).formatNumber(e,t.state);}function Wh(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return[jh.of(t),Dh(),Hh];}function Fh(t){var e=9;for(;e<t;)e=10*e+9;return e;}function nl(t,e,i,s){switch(t){case-2:return i<e;case-1:return s>=e&&i<e;case 0:return i<e&&s>e;case 1:return i<=e&&s>e;case 2:return s>e;case 4:return!0;}}function hl(t,e,i,s){for(var r;t.from==t.to||(i<1?t.from>=e:t.from>e)||(i>-1?t.to<=e:t.to<e);){var _e190=!s&&t instanceof ol&&t.index<0?null:t.parent;if(!_e190)return t;t=_e190;}var n=s?0:el.IgnoreOverlays;if(s)for(var _s136=t,_h59=_s136.parent;_h59;_s136=_h59,_h59=_s136.parent)_s136 instanceof ol&&_s136.index<0&&(null===(r=_h59.enter(e,i,n))||void 0===r?void 0:r.from)!=_s136.from&&(t=_h59);for(;;){var _s137=t.enter(e,i,n);if(!_s137)return t;t=_s137;}}function ul(t,e,i,s){var r=t.cursor(),n=[];if(!r.firstChild())return n;if(null!=i)for(var _t204=!1;!_t204;)if(_t204=r.type.is(i),!r.nextSibling())return n;for(;;){if(null!=s&&r.type.is(s))return n;if(r.type.is(e)&&n.push(r.node),!r.nextSibling())return null==s?n:[];}}function fl(t,e){var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:e.length-1;for(var _s138=t;i>=0;_s138=_s138.parent){if(!_s138)return!1;if(!_s138.type.isAnonymous){if(e[i]&&e[i]!=_s138.name)return!1;i--;}}return!0;}function dl(t){if(!t.length)return null;var e=0,i=t[0];for(var _s139=1;_s139<t.length;_s139++){var _r119=t[_s139];(_r119.from>i.from||_r119.to<i.to)&&(i=_r119,e=_s139);}var s=i instanceof ol&&i.index<0?null:i.parent,r=t.slice();return s?r[e]=s:r.splice(e,1),new pl(r,i);}function gl(t){return t.children.some(function(t){return t instanceof rl||!t.type.isAnonymous||gl(t);});}function bl(t,e){if(!t.isAnonymous||e instanceof rl||e.type!=t)return 1;var i=wl.get(e);if(null==i){i=1;var _iterator156=_createForOfIteratorHelper(e.children),_step156;try{for(_iterator156.s();!(_step156=_iterator156.n()).done;){var _s144=_step156.value;if(_s144.type!=t||!(_s144 instanceof il)){i=1;break;}i+=bl(t,_s144);}}catch(err){_iterator156.e(err);}finally{_iterator156.f();}wl.set(e,i);}return i;}function vl(t,e,i,s,r,n,h,l,o){var u=0;for(var _i157=s;_i157<r;_i157++)u+=bl(t,e[_i157]);var f=Math.ceil(1.5*u/8),a=[],c=[];return function e(i,s,r,h,l){for(var _u28=r;_u28<h;){var _r123=_u28,_d10=s[_u28],_p9=bl(t,i[_u28]);for(_u28++;_u28<h;_u28++){var _e192=bl(t,i[_u28]);if(_p9+_e192>=f)break;_p9+=_e192;}if(_u28==_r123+1){if(_p9>f){var _t210=i[_r123];e(_t210.children,_t210.positions,0,_t210.children.length,s[_r123]+l);continue;}a.push(i[_r123]);}else{var _e193=s[_u28-1]+i[_u28-1].length-_d10;a.push(vl(t,i,s,_r123,_u28,_d10,_e193,null,o));}c.push(_d10+l-n);}}(e,i,s,r,0),(l||o)(a,c,h);}function Sl(t){return function(e,i,s,r){return new El(e,t,i,s,r);};}function Cl(t){if(!t.length||t.some(function(t){return t.from>=t.to;}))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(t));}function Il(t,e,i){var _iterator160=_createForOfIteratorHelper(t),_step160;try{for(_iterator160.s();!(_step160=_iterator160.n()).done;){var _s145=_step160.value;if(_s145.from>=i)break;if(_s145.to>e)return _s145.from<=e&&_s145.to>=i?2:1;}}catch(err){_iterator160.e(err);}finally{_iterator160.f();}return 0;}function Rl(t,e,i,s,r,n){if(e<i){var _h65=t.buffer[e+1];s.push(t.slice(e,i,_h65)),r.push(_h65-n);}}function Tl(t){var e=t.node,i=[],s=e.context.buffer;do{i.push(t.index),t.parent();}while(!t.tree);var r=t.tree,n=r.children.indexOf(s),h=r.children[n],l=h.buffer,o=[n];r.children[n]=function t(s,r,n,u,f,a){var c=i[a],d=[],p=[];Rl(h,s,c,d,p,u);var m=l[c+1],g=l[c+2];o.push(d.length);var w=a?t(c+4,l[c+3],h.set.types[l[c]],m,g-m,a-1):e.toTree();return d.push(w),p.push(m-u),Rl(h,l[c+3],r,d,p,u),new il(n,d,p,f);}(0,l.length,Yh.none,0,h.length,i.length-1);for(var _i161=0,_o38=o;_i161<_o38.length;_i161++){var _e197=_o38[_i161];var _i162=t.tree.children[_e197],_s146=t.tree.positions[_e197];t["yield"](new ol(_i162,_s146+t.from,_e197,t._tree));}}function Nl(t,e){var i=null,s=e;for(var _r126=1,_n95=0;_r126<t.length;_r126++){var _h66=t[_r126-1].to,_l58=t[_r126].from;for(;_n95<s.length;_n95++){var _t221=s[_n95];if(_t221.from>=_l58)break;_t221.to<=_h66||(i||(s=i=e.slice()),_t221.from<_h66?(i[_n95]=new Gh(_t221.from,_h66),_t221.to>_l58&&i.splice(_n95+1,0,new Gh(_l58,_t221.to))):_t221.to>_l58?i[_n95--]=new Gh(_l58,_t221.to):i.splice(_n95--,1));}}return s;}function $l(t,e,i,s){var r=0,n=0,h=!1,l=!1,o=-1e9,u=[];for(;;){var _f23=r==t.length?1e9:h?t[r].to:t[r].from,_a17=n==e.length?1e9:l?e[n].to:e[n].from;if(h!=l){var _t222=Math.max(o,i),_e201=Math.min(_f23,_a17,s);_t222<_e201&&u.push(new Gh(_t222,_e201));}if(o=Math.min(_f23,_a17),1e9==o)break;_f23==o&&(h?(h=!1,r++):h=!0),_a17==o&&(l?(l=!1,n++):l=!0);}return u;}function jl(t,e){var i=[];var _iterator161=_createForOfIteratorHelper(t),_step161;try{var _loop14=function _loop14(){var _step161$value=_step161.value,s=_step161$value.pos,r=_step161$value.mount,n=_step161$value.frag;var t=s+(r.overlay?r.overlay[0].from:0),h=t+r.tree.length,l=Math.max(n.from,t),o=Math.min(n.to,h);if(r.overlay){var _h67=$l(e,r.overlay.map(function(t){return new Gh(t.from+s,t.to+s);}),l,o);for(var _e202=0,_s147=l;;_e202++){var _l59=_e202==_h67.length,_u30=_l59?o:_h67[_e202].from;if(_u30>_s147&&i.push(new yl(_s147,_u30,r.tree,-t,n.from>=_s147||n.openStart,n.to<=_u30||n.openEnd)),_l59)break;_s147=_h67[_e202].to;}}else i.push(new yl(l,o,r.tree,-t,n.from>=t||n.openStart,n.to<=h||n.openEnd));};for(_iterator161.s();!(_step161=_iterator161.n()).done;){_loop14();}}catch(err){_iterator161.e(err);}finally{_iterator161.f();}return i;}function Fl(t){var e=Object.create(null);for(var _i166 in t){var _s149=t[_i166];Array.isArray(_s149)||(_s149=[_s149]);var _iterator167=_createForOfIteratorHelper(_i166.split(" ")),_step167;try{for(_iterator167.s();!(_step167=_iterator167.n()).done;){var _t226=_step167.value;if(_t226){var _i167=[],_r128=2,_n96=_t226;for(var _e205=0;;){if("..."==_n96&&_e205>0&&_e205+3==_t226.length){_r128=1;break;}var _s150=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(_n96);if(!_s150)throw new RangeError("Invalid path: "+_t226);if(_i167.push("*"==_s150[0]?"":'"'==_s150[0][0]?JSON.parse(_s150[0]):_s150[0]),_e205+=_s150[0].length,_e205==_t226.length)break;var _h68=_t226[_e205++];if(_e205==_t226.length&&"!"==_h68){_r128=0;break;}if("/"!=_h68)throw new RangeError("Invalid path: "+_t226);_n96=_t226.slice(_e205);}var _h69=_i167.length-1,_l60=_i167[_h69];if(!_l60)throw new RangeError("Invalid path: "+_t226);var _o39=new ql(_s149,_r128,_h69>0?_i167.slice(0,_h69):null);e[_l60]=_o39.sort(e[_l60]);}}}catch(err){_iterator167.e(err);}finally{_iterator167.f();}}return Vl.add(e);}function Jl(t,e){var i=Object.create(null);var _iterator168=_createForOfIteratorHelper(t),_step168;try{for(_iterator168.s();!(_step168=_iterator168.n()).done;){var _e206=_step168.value;if(Array.isArray(_e206.tag)){var _iterator171=_createForOfIteratorHelper(_e206.tag),_step171;try{for(_iterator171.s();!(_step171=_iterator171.n()).done;){var _t228=_step171.value;i[_t228.id]=_e206["class"];}}catch(err){_iterator171.e(err);}finally{_iterator171.f();}}else i[_e206.tag.id]=_e206["class"];}}catch(err){_iterator168.e(err);}finally{_iterator168.f();}var _ref17=e||{},s=_ref17.scope,_ref17$all=_ref17.all,r=_ref17$all===void 0?null:_ref17$all;return{style:function style(t){var e=r;var _iterator169=_createForOfIteratorHelper(t),_step169;try{for(_iterator169.s();!(_step169=_iterator169.n()).done;){var _s151=_step169.value;var _iterator170=_createForOfIteratorHelper(_s151.set),_step170;try{for(_iterator170.s();!(_step170=_iterator170.n()).done;){var _t227=_step170.value;var _s152=i[_t227.id];if(_s152){e=e?e+" "+_s152:_s152;break;}}}catch(err){_iterator170.e(err);}finally{_iterator170.f();}}}catch(err){_iterator169.e(err);}finally{_iterator169.f();}return e;},scope:s};}function Ul(t,e,i){var s=arguments.length>3&&arguments[3]!==undefined?arguments[3]:0;var r=arguments.length>4&&arguments[4]!==undefined?arguments[4]:t.length;var n=new Gl(s,Array.isArray(e)?e:[e],i);n.highlightRange(t.cursor(),s,r,"",n.highlighters),n.flush(r);}function co(t){return F.define({combine:t?function(e){return e.concat(t);}:void 0});}function go(t,e,i){var s=t.facet(Oo),r=bo(t).topNode;if(!s||s.allowsNesting)for(var _t233=r;_t233;_t233=_t233.enter(e,i,el.ExcludeBuffers))_t233.type.isTop&&(r=_t233);return r;}function bo(t){var e=t.field(mo.state,!1);return e?e.tree:il.empty;}function Mo(t,e,i){return yl.applyChanges(t,[{fromA:e,toA:i,fromB:e,toB:i}]);}function Ro(t){var e=t.facet(Io);return 9==e.charCodeAt(0)?t.tabSize*e.length:e.length;}function To(t,e){var i="",s=t.tabSize,r=t.facet(Io)[0];if("\t"==r){for(;e>=s;)i+="\t",e-=s;r=" ";}for(var _t236=0;_t236<e;_t236++)i+=r;return i;}function Bo(t,e){t instanceof It&&(t=new Lo(t));var _iterator178=_createForOfIteratorHelper(t.state.facet(Eo)),_step178;try{for(_iterator178.s();!(_step178=_iterator178.n()).done;){var _i172=_step178.value;var _s158=_i172(t,e);if(void 0!==_s158)return _s158;}}catch(err){_iterator178.e(err);}finally{_iterator178.f();}var i=bo(t.state);return i.length>=e?function(t,e,i){var s=e.resolveStack(i),r=e.resolveInner(i,-1).resolve(i,0).enterUnfinishedNodesBefore(i);if(r!=s.node){var _t237=[];for(var _e214=r;_e214&&(_e214.from!=s.node.from||_e214.type!=s.node.type);_e214=_e214.parent)_t237.push(_e214);for(var _e215=_t237.length-1;_e215>=0;_e215--)s={node:_t237[_e215],next:s};}return $o(s,t,i);}(t,i,e):null;}function $o(t,e,i){for(var _s159=t;_s159;_s159=_s159.next){var _t239=jo(_s159.node);if(_t239)return _t239(Po.create(e,i,_s159));}return 0;}function jo(t){var e=t.type.prop(No);if(e)return e;var i,s=t.firstChild;if(s&&(i=s.type.prop(Kh.closedBy))){var _e216=t.lastChild,_s160=_e216&&i.indexOf(_e216.name)>-1;return function(t){return Fo(t,!0,1,void 0,_s160&&!function(t){return t.pos==t.options.simulateBreak&&t.options.simulateDoubleBreak;}(t)?_e216.from:void 0);};}return null==t.parent?zo:null;}function zo(){return 0;}function Ho(t,e){for(var _i174=e;_i174;_i174=_i174.parent)if(t==_i174)return!0;return!1;}function Wo(_ref18){var t=_ref18.closing,_ref18$align=_ref18.align,e=_ref18$align===void 0?!0:_ref18$align,_ref18$units=_ref18.units,i=_ref18$units===void 0?1:_ref18$units;return function(s){return Fo(s,e,i,t);};}function Fo(t,e,i,s,r){var n=t.textAfter,h=n.match(/^\s*/)[0].length,l=s&&n.slice(h,h+s.length)==s||r==t.pos+h,o=e?function(t){var e=t.node,i=e.childAfter(e.from),s=e.lastChild;if(!i)return null;var r=t.options.simulateBreak,n=t.state.doc.lineAt(i.from),h=null==r||r<=n.from?n.to:Math.min(n.to,r);for(var _t240=i.to;;){var _r131=e.childAfter(_t240);if(!_r131||_r131==s)return null;if(!_r131.type.isSkipped){if(_r131.from>=h)return null;var _t241=/^ */.exec(n.text.slice(i.to-n.from))[0].length;return{from:i.from,to:i.to+_t241};}_t240=_r131.to;}}(t):null;return o?l?t.column(o.from):t.column(o.to):t.baseIndent+(l?0:t.unit*i);}function qo(){var _ref19=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},t=_ref19.except,_ref19$units=_ref19.units,e=_ref19$units===void 0?1:_ref19$units;return function(i){var s=t&&t.test(i.textAfter);return i.baseIndent+(s?0:e*i.unit);};}function Go(t){var e=t.firstChild,i=t.lastChild;return e&&e.to<i.from?{from:e.to,to:i.type.isError?t.to:i.from}:null;}function Ko(t){var e=t.lastChild;return e&&e.to==t.to&&e.type.isError;}function _o(t,e,i){var _iterator179=_createForOfIteratorHelper(t.facet(Jo)),_step179;try{for(_iterator179.s();!(_step179=_iterator179.n()).done;){var _s162=_step179.value;var _r132=_s162(t,e,i);if(_r132)return _r132;}}catch(err){_iterator179.e(err);}finally{_iterator179.f();}return function(t,e,i){var s=bo(t);if(s.length<i)return null;var r=null;for(var _n98=s.resolveStack(i,1);_n98;_n98=_n98.next){var _h70=_n98.node;if(_h70.to<=i||_h70.from>i)continue;if(r&&_h70.from<e)break;var _l61=_h70.type.prop(Uo);if(_l61&&(_h70.to<s.length-50||s.length==t.doc.length||!Ko(_h70))){var _s161=_l61(_h70,t);_s161&&_s161.from<=i&&_s161.from>=e&&_s161.to>i&&(r=_s161);}}return r;}(t,e,i);}function Xo(t,e){var i=e.mapPos(t.from,1),s=e.mapPos(t.to,-1);return i>=s?void 0:{from:i,to:s};}function Zo(t){var e=[];var _iterator180=_createForOfIteratorHelper(t.state.selection.ranges),_step180;try{var _loop15=function _loop15(){var i=_step180.value.head;e.some(function(t){return t.from<=i&&t.to>=i;})||e.push(t.lineBlockAt(i));};for(_iterator180.s();!(_step180=_iterator180.n()).done;){_loop15();}}catch(err){_iterator180.e(err);}finally{_iterator180.f();}return e;}function eu(t,e,i){var s;var r=null;return null===(s=t.field(tu,!1))||void 0===s||s.between(e,i,function(t,e){(!r||r.from>t)&&(r={from:t,to:e});}),r;}function iu(t,e,i){var s=!1;return t.between(e,e,function(t,r){t==e&&r==i&&(s=!0);}),s;}function su(t,e){return t.field(tu,!1)?e:e.concat(bt.appendConfig.of(ou()));}function ru(t,e){var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!0;var s=t.state.doc.lineAt(e.from).number,r=t.state.doc.lineAt(e.to).number;return Qr.announce.of("".concat(t.state.phrase(i?"Folded lines":"Unfolded lines")," ").concat(s," ").concat(t.state.phrase("to")," ").concat(r,"."));}function ou(t){var e=[tu,pu];return t&&e.push(lu.of(t)),e;}function uu(t,e){var i=t.state,s=i.facet(lu),r=function r(e){var i=t.lineBlockAt(t.posAtDOM(e.target)),s=eu(t.state,i.from,i.to);s&&t.dispatch({effects:Qo.of(s)}),e.preventDefault();};if(s.placeholderDOM)return s.placeholderDOM(t,r,e);var n=document.createElement("span");return n.textContent=s.placeholderText,n.setAttribute("aria-label",i.phrase("folded code")),n.title=i.phrase("unfold"),n.className="cm-foldPlaceholder",n.onclick=r,n;}function bu(t){var e=t.facet(gu);return e.length?e:t.facet(wu);}function vu(t,e){var i,s=[yu];return t instanceof mu&&(t.module&&s.push(Qr.styleModule.of(t.module)),i=t.themeType),(null==e?void 0:e.fallback)?s.push(wu.of(t)):i?s.push(gu.computeN([Qr.darkTheme],function(e){return e.facet(Qr.darkTheme)==("dark"==i)?[t]:[];})):s.push(gu.of(t)),s;}function Du(t){var e=[],i=t.matched?Cu:Ou;return e.push(i.range(t.start.from,t.start.to)),t.end&&e.push(i.range(t.end.from,t.end.to)),e;}function Tu(t,e,i){var s=t.prop(e<0?Kh.openedBy:Kh.closedBy);if(s)return s;if(1==t.name.length){var _s169=i.indexOf(t.name);if(_s169>-1&&_s169%2==(e<0?1:0))return[i[_s169+e]];}return null;}function Bu(t){var e=t.type.prop(Ru);return e?e(t.node):t;}function Lu(t,e,i){var s=arguments.length>3&&arguments[3]!==undefined?arguments[3]:{};var r=s.maxScanDistance||1e4,n=s.brackets||Su,h=bo(t),l=h.resolveInner(e,i);for(var _s170=l;_s170;_s170=_s170.parent){var _r138=Tu(_s170.type,i,n);if(_r138&&_s170.from<_s170.to){var _h71=Bu(_s170);if(_h71&&(i>0?e>=_h71.from&&e<_h71.to:e>_h71.from&&e<=_h71.to))return Nu(t,e,i,_s170,_h71,_r138,n);}}return function(t,e,i,s,r,n,h){var l=i<0?t.sliceDoc(e-1,e):t.sliceDoc(e,e+1),o=h.indexOf(l);if(o<0||o%2==0!=i>0)return null;var u={from:i<0?e-1:e,to:i>0?e+1:e},f=t.doc.iterRange(e,i>0?t.doc.length:0),a=0;for(var _t243=0;!f.next().done&&_t243<=n;){var _n100=f.value;i<0&&(_t243+=_n100.length);var _l62=e+_t243*i;for(var _t244=i>0?0:_n100.length-1,_e218=i>0?_n100.length:-1;_t244!=_e218;_t244+=i){var _e219=h.indexOf(_n100[_t244]);if(!(_e219<0||s.resolveInner(_l62+_t244,1).type!=r))if(_e219%2==0==i>0)a++;else{if(1==a)return{start:u,end:{from:_l62+_t244,to:_l62+_t244+1},matched:_e219>>1==o>>1};a--;}}i>0&&(_t243+=_n100.length);}return f.done?{start:u,matched:!1}:null;}(t,e,i,h,l.type,r,n);}function Nu(t,e,i,s,r,n,h){var l=s.parent,o={from:r.from,to:r.to},u=0,f=null==l?void 0:l.cursor();if(f&&(i<0?f.childBefore(s.from):f.childAfter(s.to)))do{if(i<0?f.to<=s.from:f.from>=s.to){if(0==u&&n.indexOf(f.type.name)>-1&&f.from<f.to){var _t245=Bu(f);return{start:o,end:_t245?{from:_t245.from,to:_t245.to}:void 0,matched:!0};}if(Tu(f.type,i,h))u++;else if(Tu(f.type,-i,h)){if(0==u){var _t246=Bu(f);return{start:o,end:_t246&&_t246.from<_t246.to?{from:_t246.from,to:_t246.to}:void 0,matched:!1};}u--;}}}while(i<0?f.prevSibling():f.nextSibling());return{start:o,matched:!1};}function Wu(t,e){zu.indexOf(t)>-1||(zu.push(t),console.warn(e));}function Fu(t,e){var i=[];var _iterator186=_createForOfIteratorHelper(e.split(" ")),_step186;try{for(_iterator186.s();!(_step186=_iterator186.n()).done;){var _s171=_step186.value;var _e221=[];var _iterator187=_createForOfIteratorHelper(_s171.split(".")),_step187;try{for(_iterator187.s();!(_step187=_iterator187.n()).done;){var _i180=_step187.value;var _s172=t[_i180]||uo[_i180];_s172?"function"==typeof _s172?_e221.length?_e221=_e221.map(_s172):Wu(_i180,"Modifier ".concat(_i180," used at start of tag")):_e221.length?Wu(_i180,"Tag ".concat(_i180," used as modifier")):_e221=Array.isArray(_s172)?_s172:[_s172]:Wu(_i180,"Unknown highlighting tag ".concat(_i180));}}catch(err){_iterator187.e(err);}finally{_iterator187.f();}var _iterator188=_createForOfIteratorHelper(_e221),_step188;try{for(_iterator188.s();!(_step188=_iterator188.n()).done;){var _t248=_step188.value;i.push(_t248);}}catch(err){_iterator188.e(err);}finally{_iterator188.f();}}}catch(err){_iterator186.e(err);}finally{_iterator186.f();}if(!i.length)return 0;var s=e.replace(/ /g,"_"),r=s+" "+i.map(function(t){return t.id;}),n=Pu[r];if(n)return n.id;var h=Pu[r]=Yh.define({id:ju.length,name:s,props:[Fl(_defineProperty({},s,i))]});return ju.push(h),h.id;}function Vu(t,e){return function(_ref20){var i=_ref20.state,s=_ref20.dispatch;if(i.readOnly)return!1;var r=t(e,i);return!!r&&(s(i.update(r)),!0);};}function Gu(t,e){var i=t.languageDataAt("commentTokens",e);return i.length?i[0]:{};}function _u(t,e){var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:e.selection.ranges;var s=i.map(function(t){return Gu(e,t.from).block;});if(!s.every(function(t){return t;}))return null;var r=i.map(function(t,i){return function(t,_ref21,s,r){var e=_ref21.open,i=_ref21.close;var n,h,l=t.sliceDoc(s-Ku,s),o=t.sliceDoc(r,r+Ku),u=/\s*$/.exec(l)[0].length,f=/^\s*/.exec(o)[0].length,a=l.length-u;if(l.slice(a-e.length,a)==e&&o.slice(f,f+i.length)==i)return{open:{pos:s-u,margin:u&&1},close:{pos:r+f,margin:f&&1}};r-s<=2*Ku?n=h=t.sliceDoc(s,r):(n=t.sliceDoc(s,s+Ku),h=t.sliceDoc(r-Ku,r));var c=/^\s*/.exec(n)[0].length,d=/\s*$/.exec(h)[0].length,p=h.length-d-i.length;return n.slice(c,c+e.length)==e&&h.slice(p,p+i.length)==i?{open:{pos:s+c+e.length,margin:/\s/.test(n.charAt(c+e.length))?1:0},close:{pos:r-d-i.length,margin:/\s/.test(h.charAt(p-1))?1:0}}:null;}(e,s[i],t.from,t.to);});if(2!=t&&!r.every(function(t){return t;}))return{changes:e.changes(i.map(function(t,e){return r[e]?[]:[{from:t.from,insert:s[e].open+" "},{from:t.to,insert:" "+s[e].close}];}))};if(1!=t&&r.some(function(t){return t;})){var _t249=[];for(var _e222,_i182=0;_i182<r.length;_i182++)if(_e222=r[_i182]){var _r140=s[_i182],_e223=_e222,_n102=_e223.open,_h72=_e223.close;_t249.push({from:_n102.pos-_r140.open.length,to:_n102.pos+_n102.margin},{from:_h72.pos-_h72.margin,to:_h72.pos+_r140.close.length});}return{changes:_t249};}return null;}function Xu(t,e){var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:e.selection.ranges;var s=[],r=-1;var _iterator190=_createForOfIteratorHelper(i),_step190;try{for(_iterator190.s();!(_step190=_iterator190.n()).done;){var _step190$value=_step190.value,_t252=_step190$value.from,_n105=_step190$value.to;var _i186=s.length,_h74=1e9,_l63=Gu(e,_t252).line;if(_l63){for(var _i187=_t252;_i187<=_n105;){var _o40=e.doc.lineAt(_i187);if(_o40.from>r&&(_t252==_n105||_n105>_o40.from)){r=_o40.from;var _t253=/^\s*/.exec(_o40.text)[0].length,_e226=_t253==_o40.length,_i188=_o40.text.slice(_t253,_t253+_l63.length)==_l63?_t253:-1;_t253<_o40.text.length&&_t253<_h74&&(_h74=_t253),s.push({line:_o40,comment:_i188,token:_l63,indent:_t253,empty:_e226,single:!1});}_i187=_o40.to+1;}if(_h74<1e9)for(var _t254=_i186;_t254<s.length;_t254++)s[_t254].indent<s[_t254].line.text.length&&(s[_t254].indent=_h74);s.length==_i186+1&&(s[_i186].single=!0);}}}catch(err){_iterator190.e(err);}finally{_iterator190.f();}if(2!=t&&s.some(function(t){return t.comment<0&&(!t.empty||t.single);})){var _t250=[];var _iterator191=_createForOfIteratorHelper(s),_step191;try{for(_iterator191.s();!(_step191=_iterator191.n()).done;){var _step191$value=_step191.value,_e224=_step191$value.line,_i184=_step191$value.token,_r141=_step191$value.indent,_n103=_step191$value.empty,_h73=_step191$value.single;!_h73&&_n103||_t250.push({from:_e224.from+_r141,insert:_i184+" "});}}catch(err){_iterator191.e(err);}finally{_iterator191.f();}var _i183=e.changes(_t250);return{changes:_i183,selection:e.selection.map(_i183,1)};}if(1!=t&&s.some(function(t){return t.comment>=0;})){var _t251=[];var _iterator192=_createForOfIteratorHelper(s),_step192;try{for(_iterator192.s();!(_step192=_iterator192.n()).done;){var _step192$value=_step192.value,_e225=_step192$value.line,_i185=_step192$value.comment,_r142=_step192$value.token;if(_i185>=0){var _s174=_e225.from+_i185,_n104=_s174+_r142.length;" "==_e225.text[_n104-_e225.from]&&_n104++,_t251.push({from:_s174,to:_n104});}}}catch(err){_iterator192.e(err);}finally{_iterator192.f();}return{changes:_t251};}return null;}function sf(t,e){return function(_ref22){var i=_ref22.state,s=_ref22.dispatch;if(!e&&i.readOnly)return!1;var r=i.field(ef,!1);if(!r)return!1;var n=r.pop(t,i,e);return!!n&&(s(n),!0);};}function uf(t,e,i,s){var r=e+1>i+20?e-i-1:0,n=t.slice(r,e);return n.push(s),n;}function ff(t,e){return t.length?e.length?t.concat(e):t:e;}function df(t,e){if(t.length){var _i189=t[t.length-1],_s176=_i189.selectionsAfter.slice(Math.max(0,_i189.selectionsAfter.length-cf));return _s176.length&&_s176[_s176.length-1].eq(e)?t:(_s176.push(e),uf(t,t.length-1,1e9,_i189.setSelAfter(_s176)));}return[of.selection([e])];}function pf(t){var e=t[t.length-1],i=t.slice();return i[t.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),i;}function mf(t,e){if(!t.length)return t;var i=t.length,s=af;for(;i;){var _r144=gf(t[i-1],e,s);if(_r144.changes&&!_r144.changes.empty||_r144.effects.length){var _e228=t.slice(0,i);return _e228[i-1]=_r144,_e228;}e=_r144.mapped,i--,s=_r144.selectionsAfter;}return s.length?[of.selection(s)]:af;}function gf(t,e,i){var s=ff(t.selectionsAfter.length?t.selectionsAfter.map(function(t){return t.map(e);}):af,i);if(!t.changes)return of.selection(s);var r=t.changes.map(e),n=e.mapDesc(t.changes,!0),h=t.mapped?t.mapped.composeDesc(n):n;return new of(r,bt.mapEffects(t.effects,e),h,t.startSelection.map(n),s);}function kf(t,e){return P.create(t.ranges.map(e),t.mainIndex);}function yf(t,e){return t.update({selection:e,scrollIntoView:!0,userEvent:"select"});}function Mf(_ref23,i){var t=_ref23.state,e=_ref23.dispatch;var s=kf(t.selection,i);return!s.eq(t.selection,!0)&&(e(yf(t,s)),!0);}function xf(t,e){return P.cursor(e?t.to:t.from);}function Sf(t,e){return Mf(t,function(i){return i.empty?t.moveByChar(i,e):xf(i,e);});}function Af(t){return t.textDirectionAt(t.state.selection.main.head)==mi.LTR;}function Df(t,e){return Mf(t,function(i){return i.empty?t.moveByGroup(i,e):xf(i,e);});}function Ef(t,e,i){if(e.type.prop(i))return!0;var s=e.to-e.from;return s&&(s>2||/[^\s,.;:]/.test(t.sliceDoc(e.from,e.to)))||e.firstChild;}function If(t,e,i){var s,r,n=bo(t).resolveInner(e.head),h=i?Kh.closedBy:Kh.openedBy;for(var _s177=e.head;;){var _e230=i?n.childAfter(_s177):n.childBefore(_s177);if(!_e230)break;Ef(t,_e230,h)?n=_e230:_s177=i?_e230.to:_e230.from;}return r=n.type.prop(h)&&(s=i?Lu(t,n.from,1):Lu(t,n.to,-1))&&s.matched?i?s.end.to:s.end.from:i?n.to:n.from,P.cursor(r,i?-1:1);}function Rf(t,e){return Mf(t,function(i){if(!i.empty)return xf(i,e);var s=t.moveVertically(i,e);return s.head!=i.head?s:t.moveToLineBoundary(i,e);});}function Lf(t){var e,i=t.scrollDOM.clientHeight<t.scrollDOM.scrollHeight-2,s=0,r=0;if(i){var _iterator194=_createForOfIteratorHelper(t.state.facet(Qr.scrollMargins)),_step194;try{for(_iterator194.s();!(_step194=_iterator194.n()).done;){var _e231=_step194.value;var _i191=_e231(t);(null==_i191?void 0:_i191.top)&&(s=Math.max(null==_i191?void 0:_i191.top,s)),(null==_i191?void 0:_i191.bottom)&&(r=Math.max(null==_i191?void 0:_i191.bottom,r));}}catch(err){_iterator194.e(err);}finally{_iterator194.f();}e=t.scrollDOM.clientHeight-s-r;}else e=(t.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:s,marginBottom:r,selfScroll:i,height:Math.max(t.defaultLineHeight,e-5)};}function Nf(t,e){var i,s=Lf(t),r=t.state,n=kf(r.selection,function(i){return i.empty?t.moveVertically(i,e,s.height):xf(i,e);});if(n.eq(r.selection))return!1;if(s.selfScroll){var _e232=t.coordsAtPos(r.selection.main.head),_h77=t.scrollDOM.getBoundingClientRect(),_l64=_h77.top+s.marginTop,_o41=_h77.bottom-s.marginBottom;_e232&&_e232.top>_l64&&_e232.bottom<_o41&&(i=Qr.scrollIntoView(n.main.head,{y:"start",yMargin:_e232.top-_l64}));}return t.dispatch(yf(r,n),{effects:i}),!0;}function zf(t,e,i){var s=t.lineBlockAt(e.head),r=t.moveToLineBoundary(e,i);if(r.head==e.head&&r.head!=(i?s.to:s.from)&&(r=t.moveToLineBoundary(e,i,!1)),!i&&r.head==s.from&&s.length){var _i192=/^\s*/.exec(t.state.sliceDoc(s.from,Math.min(s.from+100,s.to)))[0].length;_i192&&e.head!=s.from+_i192&&(r=P.cursor(s.from+_i192));}return r;}function Pf(t,e){var i=kf(t.state.selection,function(t){var i=e(t);return P.range(t.anchor,i.head,i.goalColumn,i.bidiLevel||void 0);});return!i.eq(t.state.selection)&&(t.dispatch(yf(t.state,i)),!0);}function Hf(t,e){return Pf(t,function(i){return t.moveByChar(i,e);});}function Vf(t,e){return Pf(t,function(i){return t.moveByGroup(i,e);});}function qf(t,e){return Pf(t,function(i){return t.moveVertically(i,e);});}function Gf(t,e){return Pf(t,function(i){return t.moveVertically(i,e,Lf(t).height);});}function ta(t,e){if(t.state.readOnly)return!1;var i="delete.selection",s=t.state,r=s.changeByRange(function(s){var r=s.from,n=s.to;if(r==n){var _h78=e(s);_h78<r?(i="delete.backward",_h78=ea(t,_h78,!1)):_h78>r&&(i="delete.forward",_h78=ea(t,_h78,!0)),r=Math.min(r,_h78),n=Math.max(n,_h78);}else r=ea(t,r,!1),n=ea(t,n,!0);return r==n?{range:s}:{changes:{from:r,to:n},range:P.cursor(r,r<s.head?-1:1)};});return!r.changes.empty&&(t.dispatch(s.update(r,{scrollIntoView:!0,userEvent:i,effects:"delete.selection"==i?Qr.announce.of(s.phrase("Selection deleted")):void 0})),!0);}function ea(t,e,i){if(t instanceof Qr){var _iterator195=_createForOfIteratorHelper(t.state.facet(Qr.atomicRanges).map(function(e){return e(t);})),_step195;try{for(_iterator195.s();!(_step195=_iterator195.n()).done;){var _s178=_step195.value;_s178.between(e,e,function(t,s){t<e&&s>e&&(e=i?s:t);});}}catch(err){_iterator195.e(err);}finally{_iterator195.f();}}return e;}function la(t){var e=[],i=-1;var _iterator196=_createForOfIteratorHelper(t.selection.ranges),_step196;try{for(_iterator196.s();!(_step196=_iterator196.n()).done;){var _s179=_step196.value;var _r145=t.doc.lineAt(_s179.from),_n107=t.doc.lineAt(_s179.to);if(_s179.empty||_s179.to!=_n107.from||(_n107=t.doc.lineAt(_s179.to-1)),i>=_r145.number){var _t258=e[e.length-1];_t258.to=_n107.to,_t258.ranges.push(_s179);}else e.push({from:_r145.from,to:_n107.to,ranges:[_s179]});i=_n107.number+1;}}catch(err){_iterator196.e(err);}finally{_iterator196.f();}return e;}function oa(t,e,i){if(t.readOnly)return!1;var s=[],r=[];var _iterator197=_createForOfIteratorHelper(la(t)),_step197;try{for(_iterator197.s();!(_step197=_iterator197.n()).done;){var _e234=_step197.value;if(i?_e234.to==t.doc.length:0==_e234.from)continue;var _n108=t.doc.lineAt(i?_e234.to+1:_e234.from-1),_h79=_n108.length+1;if(i){s.push({from:_e234.to,to:_n108.to},{from:_e234.from,insert:_n108.text+t.lineBreak});var _iterator198=_createForOfIteratorHelper(_e234.ranges),_step198;try{for(_iterator198.s();!(_step198=_iterator198.n()).done;){var _i193=_step198.value;r.push(P.range(Math.min(t.doc.length,_i193.anchor+_h79),Math.min(t.doc.length,_i193.head+_h79)));}}catch(err){_iterator198.e(err);}finally{_iterator198.f();}}else{s.push({from:_n108.from,to:_e234.from},{from:_e234.to,insert:t.lineBreak+_n108.text});var _iterator199=_createForOfIteratorHelper(_e234.ranges),_step199;try{for(_iterator199.s();!(_step199=_iterator199.n()).done;){var _t259=_step199.value;r.push(P.range(_t259.anchor-_h79,_t259.head-_h79));}}catch(err){_iterator199.e(err);}finally{_iterator199.f();}}}}catch(err){_iterator197.e(err);}finally{_iterator197.f();}return!!s.length&&(e(t.update({changes:s,scrollIntoView:!0,selection:P.create(r,t.selection.mainIndex),userEvent:"move.line"})),!0);}function ua(t,e,i){if(t.readOnly)return!1;var s=[];var _iterator200=_createForOfIteratorHelper(la(t)),_step200;try{for(_iterator200.s();!(_step200=_iterator200.n()).done;){var _e235=_step200.value;i?s.push({from:_e235.from,insert:t.doc.slice(_e235.from,_e235.to)+t.lineBreak}):s.push({from:_e235.to,insert:t.lineBreak+t.doc.slice(_e235.from,_e235.to)});}}catch(err){_iterator200.e(err);}finally{_iterator200.f();}return e(t.update({changes:s,scrollIntoView:!0,userEvent:"input.copyline"})),!0;}function aa(t){return function(_ref28){var e=_ref28.state,i=_ref28.dispatch;if(e.readOnly)return!1;var s=e.changeByRange(function(i){var _h80;var s=i.from,r=i.to,n=e.doc.lineAt(s),h=!t&&s==r&&function(t,e){if(/\(\)|\[\]|\{\}/.test(t.sliceDoc(e-1,e+1)))return{from:e,to:e};var i,s=bo(t).resolveInner(e),r=s.childBefore(e),n=s.childAfter(e);return r&&n&&r.to<=e&&n.from>=e&&(i=r.type.prop(Kh.closedBy))&&i.indexOf(n.name)>-1&&t.doc.lineAt(r.to).from==t.doc.lineAt(n.from).from&&!/\S/.test(t.sliceDoc(r.to,n.from))?{from:r.to,to:n.from}:null;}(e,s);t&&(s=r=(r<=n.to?n:e.doc.lineAt(r)).to);var l=new Lo(e,{simulateBreak:s,simulateDoubleBreak:!!h}),o=Bo(l,s);for(null==o&&(o=Kt(/^\s*/.exec(e.doc.lineAt(s).text)[0],e.tabSize));r<n.to&&/\s/.test(n.text[r-n.from]);)r++;h?(_h80=h,s=_h80.from,r=_h80.to,_h80):s>n.from&&s<n.from+100&&!/\S/.test(n.text.slice(0,s))&&(s=n.from);var u=["",To(e,o)];return h&&u.push(To(e,l.lineIndent(n.from,-1))),{changes:{from:s,to:r,insert:p.of(u)},range:P.cursor(s+1+u[1].length)};});return i(e.update(s,{scrollIntoView:!0,userEvent:"input"})),!0;};}function ca(t,e){var i=-1;return t.changeByRange(function(s){var r=[];for(var _n109=s.from;_n109<=s.to;){var _h81=t.doc.lineAt(_n109);_h81.number>i&&(s.empty||s.to>_h81.from)&&(e(_h81,r,s),i=_h81.number),_n109=_h81.to+1;}var n=t.changes(r);return{changes:r,range:P.range(n.mapPos(s.anchor,1),n.mapPos(s.head,1))};});}function pa(){var t=arguments[0];"string"==typeof t&&(t=document.createElement(t));var e=1,i=arguments[1];if(i&&"object"==_typeof(i)&&null==i.nodeType&&!Array.isArray(i)){for(var s in i)if(Object.prototype.hasOwnProperty.call(i,s)){var r=i[s];"string"==typeof r?t.setAttribute(s,r):null!=r&&(t[s]=r);}e++;}for(;e<arguments.length;e++)ma(t,arguments[e]);return t;}function ma(t,e){if("string"==typeof e)t.appendChild(document.createTextNode(e));else if(null==e);else if(null!=e.nodeType)t.appendChild(e);else{if(!Array.isArray(e))throw new RangeError("Unsupported child node: "+e);for(var i=0;i<e.length;i++)ma(t,e[i]);}}function Sa(t,e){if(e>=t.length)return e;var i,s=t.lineAt(e);for(;e<s.to&&(i=s.text.charCodeAt(e-s.from))>=56320&&i<57344;)e++;return e;}function Aa(t){var e=pa("input",{"class":"cm-textfield",name:"line",value:String(t.state.doc.lineAt(t.state.selection.main.head).number)});function i(){var i=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(e.value);if(!i)return;var s=t.state,r=s.doc.lineAt(s.selection.main.head),_i198=_slicedToArray(i,5),n=_i198[1],h=_i198[2],l=_i198[3],o=_i198[4],u=l?+l.slice(1):0,f=h?+h:r.number;if(h&&o){var _t268=f/100;n&&(_t268=_t268*("-"==n?-1:1)+r.number/s.doc.lines),f=Math.round(s.doc.lines*_t268);}else h&&n&&(f=f*("-"==n?-1:1)+r.number);var a=s.doc.line(Math.max(1,Math.min(s.doc.lines,f))),c=P.cursor(a.from+Math.max(0,Math.min(u,a.length)));t.dispatch({effects:[Ca.of(!1),Qr.scrollIntoView(c.from,{y:"center"})],selection:c}),t.focus();}return{dom:pa("form",{"class":"cm-gotoLine",onkeydown:function onkeydown(e){27==e.keyCode?(e.preventDefault(),t.dispatch({effects:Ca.of(!1)}),t.focus()):13==e.keyCode&&(e.preventDefault(),i());},onsubmit:function onsubmit(t){t.preventDefault(),i();}},pa("label",t.state.phrase("Go to line"),": ",e)," ",pa("button",{"class":"cm-button",type:"submit"},t.state.phrase("go")))};}function Ba(t,e,i,s){return!(0!=i&&t(e.sliceDoc(i-1,i))==Ct.Word||s!=e.doc.length&&t(e.sliceDoc(s,s+1))==Ct.Word);}function Pa(t,e,i,s){return new wa(e.doc,t.unquoted,i,s,t.caseSensitive?void 0:function(t){return t.toLowerCase();},t.wholeWord?function(t,e){return function(i,s,r,n){return(n>i||n+r.length<s)&&(n=Math.max(0,i-2),r=t.sliceString(n,Math.min(t.length,s+2))),!(e(Fa(r,i-n))==Ct.Word&&e(Va(r,i-n))==Ct.Word||e(Va(r,s-n))==Ct.Word&&e(Fa(r,s-n))==Ct.Word);};}(e.doc,e.charCategorizer(e.selection.main.head)):void 0);}function Wa(t,e,i,s){return new ka(e.doc,t.search,{ignoreCase:!t.caseSensitive,test:t.wholeWord?(r=e.charCategorizer(e.selection.main.head),function(t,e,i){return!i[0].length||(r(Fa(i.input,i.index))!=Ct.Word||r(Va(i.input,i.index))!=Ct.Word)&&(r(Va(i.input,i.index+i[0].length))!=Ct.Word||r(Fa(i.input,i.index+i[0].length))!=Ct.Word);}):void 0},i,s);var r;}function Fa(t,e){return t.slice(S(t,e,!1),e);}function Va(t,e){return t.slice(e,S(t,e));}function Qa(t){return function(e){var i=e.state.field(Ga,!1);return i&&i.query.spec.valid?t(e,i):oc(e);};}function rc(t){return t.state.facet($a).createPanel(t);}function nc(t,e){var i,s,r,n,h;var l=t.selection.main,o=l.empty||l.to>l.from+100?"":t.sliceDoc(l.from,l.to);if(e&&!o)return e;var u=t.facet($a);return new ja({search:(null!==(i=null==e?void 0:e.literal)&&void 0!==i?i:u.literal)?o:o.replace(/\n/g,"\\n"),caseSensitive:null!==(s=null==e?void 0:e.caseSensitive)&&void 0!==s?s:u.caseSensitive,literal:null!==(r=null==e?void 0:e.literal)&&void 0!==r?r:u.literal,regexp:null!==(n=null==e?void 0:e.regexp)&&void 0!==n?n:u.regexp,wholeWord:null!==(h=null==e?void 0:e.wholeWord)&&void 0!==h?h:u.wholeWord});}function hc(t){var e=gh(t,rc);return e&&e.dom.querySelector("[main-field]");}function lc(t){var e=hc(t);e&&e==t.root.activeElement&&e.select();}function cc(t,e){return t.state.phrase(e);}function mc(t,_ref54){var e=_ref54.from,i=_ref54.to;var s=t.state.doc.lineAt(e),r=t.state.doc.lineAt(i).to,n=Math.max(s.from,e-dc),h=Math.min(r,i+dc),l=t.state.sliceDoc(n,h);if(n!=s.from)for(var _t273=0;_t273<dc;_t273++)if(!pc.test(l[_t273+1])&&pc.test(l[_t273])){l=l.slice(_t273);break;}if(h!=r)for(var _t274=l.length-1;_t274>l.length-dc;_t274--)if(!pc.test(l[_t274-1])&&pc.test(l[_t274])){l=l.slice(0,_t274);break;}return Qr.announce.of("".concat(t.state.phrase("current match"),". ").concat(l," ").concat(t.state.phrase("on line")," ").concat(s.number,"."));}function vc(t){var e=Object.keys(t).join(""),i=/\w/.test(e);return i&&(e=e.replace(/\w/g,"")),"[".concat(i?"\\w":"").concat(e.replace(/[^\w\s]/g,"\\$&"),"]");}function kc(t){var e=t.map(function(t){return"string"==typeof t?{label:t}:t;}),_ref55=e.every(function(t){return /^\w+$/.test(t.label);})?[/\w*$/,/\w+$/]:function(t){var e=Object.create(null),i=Object.create(null);var _iterator206=_createForOfIteratorHelper(t),_step206;try{for(_iterator206.s();!(_step206=_iterator206.n()).done;){var _s189=_step206.value.label;e[_s189[0]]=!0;for(var _t275=1;_t275<_s189.length;_t275++)i[_s189[_t275]]=!0;}}catch(err){_iterator206.e(err);}finally{_iterator206.f();}var s=vc(e)+vc(i)+"*$";return[new RegExp("^"+s),new RegExp(s)];}(e),_ref56=_slicedToArray(_ref55,2),i=_ref56[0],s=_ref56[1];return function(t){var r=t.matchBefore(s);return r||t.explicit?{from:r?r.from:t.pos,options:e,validFor:i}:null;};}function yc(t,e){return function(i){for(var _e245=bo(i.state).resolveInner(i.pos,-1);_e245;_e245=_e245.parent){if(t.indexOf(_e245.name)>-1)return null;if(_e245.type.isTop)break;}return e(i);};}function xc(t){return t.selection.main.from;}function Sc(t,e){var i;var s=t.source,r=e&&"^"!=s[0],n="$"!=s[s.length-1];return r||n?new RegExp("".concat(r?"^":"","(?:").concat(s,")").concat(n?"$":""),null!==(i=t.flags)&&void 0!==i?i:t.ignoreCase?"i":""):t;}function Oc(t){if(!Array.isArray(t))return t;var e=Cc.get(t);return e||Cc.set(t,e=kc(t)),e;}function Bc(t,e){return t?e?t+" "+e:t:e;}function Lc(t,e,i,s,r,n){var h,l,o=t.textDirection==mi.RTL,u=o,f=!1,a="top",c=e.left-r.left,d=r.right-e.right,p=s.right-s.left,m=s.bottom-s.top;if(u&&c<Math.min(p,d)?u=!1:!u&&d<Math.min(p,c)&&(u=!0),p<=(u?c:d))h=Math.max(r.top,Math.min(i.top,r.bottom-m))-e.top,l=Math.min(400,u?c:d);else{f=!0,l=Math.min(400,(o?e.right:r.right-e.left)-30);var _t277=r.bottom-e.bottom;_t277>=m||_t277>e.top?h=i.bottom-e.top:(a="bottom",h=e.bottom-i.top);}return{style:"".concat(a,": ").concat(h/((e.bottom-e.top)/n.offsetHeight),"px; max-width: ").concat(l/((e.right-e.left)/n.offsetWidth),"px"),"class":"cm-completionInfo-"+(f?o?"left-narrow":"right-narrow":u?"left":"right")};}function Nc(t,e,i){if(t<=i)return{from:0,to:t};if(e<0&&(e=0),e<=t>>1){var _t278=Math.floor(e/i);return{from:_t278*i,to:(_t278+1)*i};}var s=Math.floor((t-e)/i);return{from:t-(s+1)*i,to:t-s*i};}function jc(t,e){return function(i){return new $c(i,t,e);};}function zc(t){return 100*(t.boost||0)+(t.apply?10:0)+(t.info?5:0)+(t.type?1:0);}function Vc(t,e){var i={"aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":t};return e>-1&&(i["aria-activedescendant"]=t+"-"+e),i;}function Jc(t,e){if(t.isUserEvent("input.complete")){var _i215=t.annotation(Ac);if(_i215&&e.activateOnCompletion(_i215))return 12;}var i=t.isUserEvent("input.type");return i&&e.activateOnTyping?5:i?1:t.isUserEvent("delete.backward")?2:t.selection?8:t.docChanged?16:0;}function Yc(t,e){var i=e.completion.apply||e.completion.label;var s=t.state.field(Xc).active.find(function(t){return t.source==e.source;});return s instanceof Gc&&("string"==typeof i?t.dispatch(Object.assign(Object.assign({},function(t,e,i,s){var r=t.selection.main,n=i-r.from,h=s-r.from;return Object.assign(Object.assign({},t.changeByRange(function(l){if(l!=r&&i!=s&&t.sliceDoc(l.from+n,l.from+h)!=t.sliceDoc(i,s))return{range:l};var o=t.toText(e);return{changes:{from:l.from+n,to:s==r.from?l.to:l.from+h,insert:o},range:P.cursor(l.from+n+o.length)};})),{scrollIntoView:!0,userEvent:"input.complete"});}(t.state,i,s.from,s.to)),{annotations:Ac.of(e.completion)})):i(t,e.completion,s.from,s.to),!0);}function Zc(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:"option";return function(i){var s=i.state.field(Xc,!1);if(!s||!s.open||s.open.disabled||Date.now()-s.open.timestamp<i.state.facet(Tc).interactionDelay)return!1;var r,n=1;"page"==e&&(r=dh(i,s.open.tooltip))&&(n=Math.max(2,Math.floor(r.dom.offsetHeight/r.dom.querySelector("li").offsetHeight)-1));var h=s.open.options.length,l=s.open.selected>-1?s.open.selected+n*(t?1:-1):t?0:h-1;return l<0?l="page"==e?0:h-1:l>=h&&(l="page"==e?h-1:0),i.dispatch({effects:_c.of(l)}),!0;};}function wd(t,e){return P.create(t.filter(function(t){return t.field==e;}).map(function(t){return P.range(t.from,t.to);}));}function bd(t){var e=fd.parse(t);return function(t,i,s,r){var _e$instantiate=e.instantiate(t.state,s),n=_e$instantiate.text,h=_e$instantiate.ranges,l=t.state.selection.main,o={changes:{from:s,to:r==l.from?l.to:r,insert:p.of(n)},scrollIntoView:!0,annotations:i?[Ac.of(i),vt.userEvent.of("input.complete")]:void 0};if(h.length&&(o.selection=wd(h,0)),h.some(function(t){return t.field>0;})){var _e267=new dd(h,0),_i221=o.effects=[pd.of(_e267)];void 0===t.state.field(gd,!1)&&_i221.push(bt.appendConfig.of([gd,Md,Sd,ld]));}t.dispatch(t.state.update(o));};}function vd(t){return function(_ref57){var e=_ref57.state,i=_ref57.dispatch;var s=e.field(gd,!1);if(!s||t<0&&0==s.active)return!1;var r=s.active+t,n=t>0&&!s.ranges.some(function(e){return e.field==r+t;});return i(e.update({selection:wd(s.ranges,r),effects:pd.of(n?null:new dd(s.ranges,r)),scrollIntoView:!0})),!0;};}function xd(t,e){return Object.assign(Object.assign({},e),{apply:bd(t)});}function Id(t){for(var _e268=0;_e268<8;_e268+=2)if(Ed.charCodeAt(_e268)==t)return Ed.charAt(_e268+1);return C(t<128?t:t+1);}function Rd(t,e){return t.languageDataAt("closeBrackets",e)[0]||Ad;}function Nd(t,e){var i=!1;return t.field(Dd).between(0,t.doc.length,function(t){t==e&&(i=!0);}),i;}function $d(t,e){var i=t.sliceString(e,e+2);return i.slice(0,O(A(i,0)));}function jd(t,e,i,s){var r=null,n=t.changeByRange(function(n){if(!n.empty)return{changes:[{insert:e,from:n.from},{insert:i,from:n.to}],effects:Cd.of(n.to+e.length),range:P.range(n.anchor+e.length,n.head+e.length)};var h=$d(t.doc,n.head);return!h||/\s/.test(h)||s.indexOf(h)>-1?{changes:{insert:e+i,from:n.head},effects:Cd.of(n.head+e.length),range:P.cursor(n.head+e.length)}:{range:r=n};});return r?null:t.update(n,{scrollIntoView:!0,userEvent:"input.type"});}function zd(t,e,i){var s=null,r=t.changeByRange(function(e){return e.empty&&$d(t.doc,e.head)==i?{changes:{from:e.head,to:e.head+i.length,insert:i},range:P.cursor(e.head+i.length)}:s={range:e};});return s?null:t.update(r,{scrollIntoView:!0,userEvent:"input.type"});}function Pd(t,e,i,s){var r=s.stringPrefixes||Ad.stringPrefixes,n=null,h=t.changeByRange(function(s){if(!s.empty)return{changes:[{insert:e,from:s.from},{insert:e,from:s.to}],effects:Cd.of(s.to+e.length),range:P.range(s.anchor+e.length,s.head+e.length)};var h,l=s.head,o=$d(t.doc,l);if(o==e){if(Hd(t,l))return{changes:{insert:e+e,from:l},effects:Cd.of(l+e.length),range:P.cursor(l+e.length)};if(Nd(t,l)){var _s201=i&&t.sliceDoc(l,l+3*e.length)==e+e+e?e+e+e:e;return{changes:{from:l,to:l+_s201.length,insert:_s201},range:P.cursor(l+_s201.length)};}}else{if(i&&t.sliceDoc(l-2*e.length,l)==e+e&&(h=Wd(t,l-2*e.length,r))>-1&&Hd(t,h))return{changes:{insert:e+e+e+e,from:l},effects:Cd.of(l+e.length),range:P.cursor(l+e.length)};if(t.charCategorizer(l)(o)!=Ct.Word&&Wd(t,l,r)>-1&&!function(t,e,i,s){var r=bo(t).resolveInner(e,-1),n=s.reduce(function(t,e){return Math.max(t,e.length);},0);for(var _h91=0;_h91<5;_h91++){var _h92=t.sliceDoc(r.from,Math.min(r.to,r.from+i.length+n)),_l71=_h92.indexOf(i);if(!_l71||_l71>-1&&s.indexOf(_h92.slice(0,_l71))>-1){var _e269=r.firstChild;for(;_e269&&_e269.from==r.from&&_e269.to-_e269.from>i.length+_l71;){if(t.sliceDoc(_e269.to-i.length,_e269.to)==i)return!1;_e269=_e269.firstChild;}return!0;}var _o47=r.to==e&&r.parent;if(!_o47)break;r=_o47;}return!1;}(t,l,e,r))return{changes:{insert:e+e,from:l},effects:Cd.of(l+e.length),range:P.cursor(l+e.length)};}return{range:n=s};});return n?null:t.update(h,{scrollIntoView:!0,userEvent:"input.type"});}function Hd(t,e){var i=bo(t).resolveInner(e+1);return i.parent&&i.from==e;}function Wd(t,e,i){var s=t.charCategorizer(e);if(s(t.sliceDoc(e-1,e))!=Ct.Word)return e;var _iterator235=_createForOfIteratorHelper(i),_step235;try{for(_iterator235.s();!(_step235=_iterator235.n()).done;){var _r169=_step235.value;var _i224=e-_r169.length;if(t.sliceDoc(_i224,e)==_r169&&s(t.sliceDoc(_i224-1,_i224))!=Ct.Word)return _i224;}}catch(err){_iterator235.e(err);}finally{_iterator235.f();}return-1;}function Fd(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return[hd,Xc,Tc.of(t),rd,qd,ld];}function Jd(t){var e=t.field(Xc,!1);return e&&e.active.some(function(t){return t.isPending;})?"pending":e&&e.active.some(function(t){return 0!=t.state;})?"active":null;}function Kd(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:null;var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;var s=null;return t.between(i,1e9,function(t,i,_ref60){var r=_ref60.spec;if(!(e&&r.diagnostics.indexOf(e)<0))if(s){if(r.diagnostics.indexOf(s.diagnostic)<0)return!1;s=new Ud(s.from,i,s.diagnostic);}else s=new Ud(t,i,e||r.diagnostics[0]);}),s;}function tp(t,e,i){var s,_t$state$field=t.state.field(Qd),r=_t$state$field.diagnostics,n=-1,h=-1;r.between(e-(i<0?1:0),e+(i>0?1:0),function(t,r,_ref61){var l=_ref61.spec;if(e>=t&&e<=r&&(t==r||(e>t||i>0)&&(e<r||i<0)))return s=l.diagnostics,n=t,h=r,!1;});var l=t.state.facet(rp).tooltipFilter;return s&&l&&(s=l(s,t.state)),s?{pos:n,end:h,above:t.state.doc.lineAt(n).to<h,create:function create(){return{dom:ep(t,s)};}}:null;}function ep(t,e){return pa("ul",{"class":"cm-tooltip-lint"},e.map(function(e){return hp(t,e,!1);}));}function np(t){var e=[];if(t){var _iterator237=_createForOfIteratorHelper(t),_step237;try{t:for(_iterator237.s();!(_step237=_iterator237.n()).done;){var _i228=_step237.value.name;var _loop21=function _loop21(){var s=_i228[_t301];if(/[a-zA-Z]/.test(s)&&!e.some(function(t){return t.toLowerCase()==s.toLowerCase();})){e.push(s);return 1;// continue t
|
|
2
|
+
}};for(var _t301=0;_t301<_i228.length;_t301++){if(_loop21())continue t;}e.push("");}}catch(err){_iterator237.e(err);}finally{_iterator237.f();}}return e;}function hp(t,e,i){var s;var r=i?np(e.actions):[];return pa("li",{"class":"cm-diagnostic cm-diagnostic-"+e.severity},pa("span",{"class":"cm-diagnosticText"},e.renderMessage?e.renderMessage(t):e.message),null===(s=e.actions)||void 0===s?void 0:s.map(function(i,s){var n=!1,h=function h(s){if(s.preventDefault(),n)return;n=!0;var r=Kd(t.state.field(Qd).diagnostics,e);r&&i.apply(t,r.from,r.to);},l=i.name,o=r[s]?l.indexOf(r[s]):-1,u=o<0?l:[l.slice(0,o),pa("u",l.slice(o,o+1)),l.slice(o+1)];return pa("button",{type:"button","class":"cm-diagnosticAction",onclick:h,onmousedown:h,"aria-label":" Action: ".concat(l).concat(o<0?"":" (access key \"".concat(r[s],")\""),".")},u);}),e.source&&pa("div",{"class":"cm-diagnosticSource"},e.source));}function fp(t){return function(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:'viewBox="0 0 40 40"';return"url('data:image/svg+xml,<svg xmlns=\"http://www.w3.org/2000/svg\" ".concat(e,">").concat(encodeURIComponent(t),"</svg>')");}("<path d=\"m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0\" stroke=\"".concat(t,"\" fill=\"none\" stroke-width=\".7\"/>"),'width="6" height="3"');}function cp(t){return"error"==t?4:"warning"==t?3:"info"==t?2:1;}function dp(t){var e="hint",i=1;var _iterator240=_createForOfIteratorHelper(t),_step240;try{for(_iterator240.s();!(_step240=_iterator240.n()).done;){var _s205=_step240.value;var _t303=cp(_s205.severity);_t303>i&&(i=_t303,e=_s205.severity);}}catch(err){_iterator240.e(err);}finally{_iterator240.f();}return e;}_export({F:Wh,G:qn,H:vu,J:Qn,c:qo,d:Wo,g:Go,j:yc,k:kc,l:bo,n:xd,p:co,r:Sl,s:Fl,x:Fd,z:Jd,I:void 0});return{setters:[function(_index007CjsJs){t=_index007CjsJs.k;e=_index007CjsJs.b;i=_index007CjsJs.s;}],execute:function execute(){s=[],r=[];(function(){var t="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(function(t){return t?parseInt(t,36):1;});for(var _e3=0,_i3=0;_e3<t.length;_e3++)(_e3%2?r:s).push(_i3+=t[_e3]);})();p=/*#__PURE__*/function(){function p(){_classCallCheck(this,p);}return _createClass(p,[{key:"lineAt",value:function lineAt(t){if(t<0||t>this.length)throw new RangeError("Invalid position ".concat(t," in document of length ").concat(this.length));return this.lineInner(t,!1,1,0);}},{key:"line",value:function line(t){if(t<1||t>this.lines)throw new RangeError("Invalid line number ".concat(t," in ").concat(this.lines,"-line document"));return this.lineInner(t,!0,1,0);}},{key:"replace",value:function replace(t,e,i){var _x=x(this,t,e);var _x2=_slicedToArray(_x,2);t=_x2[0];e=_x2[1];var s=[];return this.decompose(0,t,s,2),i.length&&i.decompose(0,i.length,s,3),this.decompose(e,this.length,s,1),g.from(s,this.length-(e-t)+i.length);}},{key:"append",value:function append(t){return this.replace(this.length,this.length,t);}},{key:"slice",value:function slice(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:this.length;var _x3=x(this,t,e);var _x4=_slicedToArray(_x3,2);t=_x4[0];e=_x4[1];var i=[];return this.decompose(t,e,i,0),g.from(i,e-t);}},{key:"eq",value:function eq(t){if(t==this)return!0;if(t.length!=this.length||t.lines!=this.lines)return!1;var e=this.scanIdentical(t,1),i=this.length-this.scanIdentical(t,-1),s=new v(this),r=new v(t);for(var _t2=e,_n3=e;;){if(s.next(_t2),r.next(_t2),_t2=0,s.lineBreak!=r.lineBreak||s.done!=r.done||s.value!=r.value)return!1;if(_n3+=s.value.length,s.done||_n3>=i)return!0;}}},{key:"iter",value:function iter(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;return new v(this,t);}},{key:"iterRange",value:function iterRange(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:this.length;return new k(this,t,e);}},{key:"iterLines",value:function iterLines(t,e){var i;if(null==t)i=this.iter();else{null==e&&(e=this.lines+1);var _s4=this.line(t).from;i=this.iterRange(_s4,Math.max(_s4,e==this.lines+1?this.length:e<=1?0:this.line(e-1).to));}return new y(i);}},{key:"toString",value:function toString(){return this.sliceString(0);}},{key:"toJSON",value:function toJSON(){var t=[];return this.flatten(t),t;}}],[{key:"of",value:function of(t){if(0==t.length)throw new RangeError("A document must have at least one line");return 1!=t.length||t[0]?t.length<=32?new m(t):g.from(m.split(t,[])):p.empty;}}]);}();m=/*#__PURE__*/function(_p){function m(t){var _this;var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:function(t){var e=-1;var _iterator=_createForOfIteratorHelper(t),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var _i5=_step.value;e+=_i5.length+1;}}catch(err){_iterator.e(err);}finally{_iterator.f();}return e;}(t);_classCallCheck(this,m);_this=_callSuper(this,m),_this.text=t,_this.length=e;return _this;}_inherits(m,_p);return _createClass(m,[{key:"lines",get:function get(){return this.text.length;}},{key:"children",get:function get(){return null;}},{key:"lineInner",value:function lineInner(t,e,i,s){for(var _r3=0;;_r3++){var _n4=this.text[_r3],_h2=s+_n4.length;if((e?i:_h2)>=t)return new M(s,_h2,i,_n4);s=_h2+1,i++;}}},{key:"decompose",value:function decompose(t,e,i,s){var r=t<=0&&e>=this.length?this:new m(b(this.text,t,e),Math.min(e,this.length)-Math.max(0,t));if(1&s){var _t3=i.pop(),_e4=w(r.text,_t3.text.slice(),0,r.length);if(_e4.length<=32)i.push(new m(_e4,_t3.length+r.length));else{var _t4=_e4.length>>1;i.push(new m(_e4.slice(0,_t4)),new m(_e4.slice(_t4)));}}else i.push(r);}},{key:"replace",value:function replace(t,e,i){if(!(i instanceof m))return _superPropGet(m,"replace",this,3)([t,e,i]);var _x5=x(this,t,e);var _x6=_slicedToArray(_x5,2);t=_x6[0];e=_x6[1];var s=w(this.text,w(i.text,b(this.text,0,t)),e),r=this.length+i.length-(e-t);return s.length<=32?new m(s,r):g.from(m.split(s,[]),r);}},{key:"sliceString",value:function sliceString(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:this.length;var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:"\n";var _x7=x(this,t,e);var _x8=_slicedToArray(_x7,2);t=_x8[0];e=_x8[1];var s="";for(var _r4=0,_n5=0;_r4<=e&&_n5<this.text.length;_n5++){var _h3=this.text[_n5],_l2=_r4+_h3.length;_r4>t&&_n5&&(s+=i),t<_l2&&e>_r4&&(s+=_h3.slice(Math.max(0,t-_r4),e-_r4)),_r4=_l2+1;}return s;}},{key:"flatten",value:function flatten(t){var _iterator2=_createForOfIteratorHelper(this.text),_step2;try{for(_iterator2.s();!(_step2=_iterator2.n()).done;){var _e5=_step2.value;t.push(_e5);}}catch(err){_iterator2.e(err);}finally{_iterator2.f();}}},{key:"scanIdentical",value:function scanIdentical(){return 0;}}],[{key:"split",value:function split(t,e){var i=[],s=-1;var _iterator3=_createForOfIteratorHelper(t),_step3;try{for(_iterator3.s();!(_step3=_iterator3.n()).done;){var _r5=_step3.value;i.push(_r5),s+=_r5.length+1,32==i.length&&(e.push(new m(i,s)),i=[],s=-1);}}catch(err){_iterator3.e(err);}finally{_iterator3.f();}return s>-1&&e.push(new m(i,s)),e;}}]);}(p);g=/*#__PURE__*/function(_p2){function g(t,e){var _this2;_classCallCheck(this,g);_this2=_callSuper(this,g),_this2.children=t,_this2.length=e,_this2.lines=0;var _iterator4=_createForOfIteratorHelper(t),_step4;try{for(_iterator4.s();!(_step4=_iterator4.n()).done;){var _e6=_step4.value;_this2.lines+=_e6.lines;}}catch(err){_iterator4.e(err);}finally{_iterator4.f();}return _this2;}_inherits(g,_p2);return _createClass(g,[{key:"lineInner",value:function lineInner(t,e,i,s){for(var _r6=0;;_r6++){var _n6=this.children[_r6],_h4=s+_n6.length,_l3=i+_n6.lines-1;if((e?_l3:_h4)>=t)return _n6.lineInner(t,e,i,s);s=_h4+1,i=_l3+1;}}},{key:"decompose",value:function decompose(t,e,i,s){for(var _r7=0,_n7=0;_n7<=e&&_r7<this.children.length;_r7++){var _h5=this.children[_r7],_l4=_n7+_h5.length;if(t<=_l4&&e>=_n7){var _r8=s&((_n7<=t?1:0)|(_l4>=e?2:0));_n7>=t&&_l4<=e&&!_r8?i.push(_h5):_h5.decompose(t-_n7,e-_n7,i,_r8);}_n7=_l4+1;}}},{key:"replace",value:function replace(t,e,i){var _x9,_x10;if(_x9=x(this,t,e),_x10=_slicedToArray(_x9,2),t=_x10[0],e=_x10[1],i.lines<this.lines)for(var _s5=0,_r9=0;_s5<this.children.length;_s5++){var _n8=this.children[_s5],_h6=_r9+_n8.length;if(t>=_r9&&e<=_h6){var _l5=_n8.replace(t-_r9,e-_r9,i),_o2=this.lines-_n8.lines+_l5.lines;if(_l5.lines<_o2>>4&&_l5.lines>_o2>>6){var _r10=this.children.slice();return _r10[_s5]=_l5,new g(_r10,this.length-(e-t)+i.length);}return _superPropGet(g,"replace",this,3)([_r9,_h6,_l5]);}_r9=_h6+1;}return _superPropGet(g,"replace",this,3)([t,e,i]);}},{key:"sliceString",value:function sliceString(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:this.length;var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:"\n";var _x11=x(this,t,e);var _x12=_slicedToArray(_x11,2);t=_x12[0];e=_x12[1];var s="";for(var _r11=0,_n9=0;_r11<this.children.length&&_n9<=e;_r11++){var _h7=this.children[_r11],_l6=_n9+_h7.length;_n9>t&&_r11&&(s+=i),t<_l6&&e>_n9&&(s+=_h7.sliceString(t-_n9,e-_n9,i)),_n9=_l6+1;}return s;}},{key:"flatten",value:function flatten(t){var _iterator5=_createForOfIteratorHelper(this.children),_step5;try{for(_iterator5.s();!(_step5=_iterator5.n()).done;){var _e7=_step5.value;_e7.flatten(t);}}catch(err){_iterator5.e(err);}finally{_iterator5.f();}}},{key:"scanIdentical",value:function scanIdentical(t,e){if(!(t instanceof g))return 0;var i=0,_ref=e>0?[0,0,this.children.length,t.children.length]:[this.children.length-1,t.children.length-1,-1,-1],_ref2=_slicedToArray(_ref,4),s=_ref2[0],r=_ref2[1],n=_ref2[2],h=_ref2[3];for(;;s+=e,r+=e){if(s==n||r==h)return i;var _l7=this.children[s],_o3=t.children[r];if(_l7!=_o3)return i+_l7.scanIdentical(_o3,e);i+=_l7.length+1;}}}],[{key:"from",value:function from(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:t.reduce(function(t,e){return t+e.length+1;},-1);var i=0;var _iterator6=_createForOfIteratorHelper(t),_step6;try{for(_iterator6.s();!(_step6=_iterator6.n()).done;){var _e10=_step6.value;i+=_e10.lines;}}catch(err){_iterator6.e(err);}finally{_iterator6.f();}if(i<32){var _i6=[];var _iterator7=_createForOfIteratorHelper(t),_step7;try{for(_iterator7.s();!(_step7=_iterator7.n()).done;){var _e8=_step7.value;_e8.flatten(_i6);}}catch(err){_iterator7.e(err);}finally{_iterator7.f();}return new m(_i6,e);}var s=Math.max(32,i>>5),r=s<<1,n=s>>1,h=[],l=0,o=-1,u=[];function f(t){var e;if(t.lines>r&&t instanceof g){var _iterator8=_createForOfIteratorHelper(t.children),_step8;try{for(_iterator8.s();!(_step8=_iterator8.n()).done;){var _e9=_step8.value;f(_e9);}}catch(err){_iterator8.e(err);}finally{_iterator8.f();}}else t.lines>n&&(l>n||!l)?(a(),h.push(t)):t instanceof m&&l&&(e=u[u.length-1])instanceof m&&t.lines+e.lines<=32?(l+=t.lines,o+=t.length+1,u[u.length-1]=new m(e.text.concat(t.text),e.length+1+t.length)):(l+t.lines>s&&a(),l+=t.lines,o+=t.length+1,u.push(t));}function a(){0!=l&&(h.push(1==u.length?u[0]:g.from(u,o)),o=-1,l=u.length=0);}var _iterator9=_createForOfIteratorHelper(t),_step9;try{for(_iterator9.s();!(_step9=_iterator9.n()).done;){var _e11=_step9.value;f(_e11);}}catch(err){_iterator9.e(err);}finally{_iterator9.f();}return a(),1==h.length?h[0]:new g(h,e);}}]);}(p);p.empty=new m([""],0);v=/*#__PURE__*/function(){function v(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;_classCallCheck(this,v);this.dir=e,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[t],this.offsets=[e>0?1:(t instanceof m?t.text.length:t.children.length)<<1];}return _createClass(v,[{key:"nextInner",value:function nextInner(t,e){for(this.done=this.lineBreak=!1;;){var _i7=this.nodes.length-1,_s6=this.nodes[_i7],_r13=this.offsets[_i7],_n11=_r13>>1,_h9=_s6 instanceof m?_s6.text.length:_s6.children.length;if(_n11==(e>0?_h9:0)){if(0==_i7)return this.done=!0,this.value="",this;e>0&&this.offsets[_i7-1]++,this.nodes.pop(),this.offsets.pop();}else if((1&_r13)==(e>0?0:1)){if(this.offsets[_i7]+=e,0==t)return this.lineBreak=!0,this.value="\n",this;t--;}else if(_s6 instanceof m){var _r14=_s6.text[_n11+(e<0?-1:0)];if(this.offsets[_i7]+=e,_r14.length>Math.max(0,t))return this.value=0==t?_r14:e>0?_r14.slice(t):_r14.slice(0,_r14.length-t),this;t-=_r14.length;}else{var _r15=_s6.children[_n11+(e<0?-1:0)];t>_r15.length?(t-=_r15.length,this.offsets[_i7]+=e):(e<0&&this.offsets[_i7]--,this.nodes.push(_r15),this.offsets.push(e>0?1:(_r15 instanceof m?_r15.text.length:_r15.children.length)<<1));}}}},{key:"next",value:function next(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return t<0&&(this.nextInner(-t,-this.dir),t=this.value.length),this.nextInner(t,this.dir);}}]);}();k=/*#__PURE__*/function(){function k(t,e,i){_classCallCheck(this,k);this.value="",this.done=!1,this.cursor=new v(t,e>i?-1:1),this.pos=e>i?t.length:0,this.from=Math.min(e,i),this.to=Math.max(e,i);}return _createClass(k,[{key:"nextInner",value:function nextInner(t,e){if(e<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;t+=Math.max(0,e<0?this.pos-this.to:this.from-this.pos);var i=e<0?this.pos-this.from:this.to-this.pos;t>i&&(t=i),i-=t;var _this$cursor$next=this.cursor.next(t),s=_this$cursor$next.value;return this.pos+=(s.length+t)*e,this.value=s.length<=i?s:e<0?s.slice(s.length-i):s.slice(0,i),this.done=!this.value,this;}},{key:"next",value:function next(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return t<0?t=Math.max(t,this.from-this.pos):t>0&&(t=Math.min(t,this.to-this.pos)),this.nextInner(t,this.cursor.dir);}},{key:"lineBreak",get:function get(){return this.cursor.lineBreak&&""!=this.value;}}]);}();y=/*#__PURE__*/function(){function y(t){_classCallCheck(this,y);this.inner=t,this.afterBreak=!0,this.value="",this.done=!1;}return _createClass(y,[{key:"next",value:function next(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var _this$inner$next=this.inner.next(t),e=_this$inner$next.done,i=_this$inner$next.lineBreak,s=_this$inner$next.value;return e&&this.afterBreak?(this.value="",this.afterBreak=!1):e?(this.done=!0,this.value=""):i?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=s,this.afterBreak=!1),this;}},{key:"lineBreak",get:function get(){return!1;}}]);}();"undefined"!=typeof Symbol&&(p.prototype[Symbol.iterator]=function(){return this.iter();},v.prototype[Symbol.iterator]=k.prototype[Symbol.iterator]=y.prototype[Symbol.iterator]=function(){return this;});M=/*#__PURE__*/function(){function M(t,e,i,s){_classCallCheck(this,M);this.from=t,this.to=e,this.number=i,this.text=s;}return _createClass(M,[{key:"length",get:function get(){return this.to-this.from;}}]);}();D=/\r\n?|\n/;E=function(t){return t[t.Simple=0]="Simple",t[t.TrackDel=1]="TrackDel",t[t.TrackBefore=2]="TrackBefore",t[t.TrackAfter=3]="TrackAfter",t;}(E||(E={}));I=/*#__PURE__*/function(){function I(t){_classCallCheck(this,I);this.sections=t;}return _createClass(I,[{key:"length",get:function get(){var t=0;for(var _e12=0;_e12<this.sections.length;_e12+=2)t+=this.sections[_e12];return t;}},{key:"newLength",get:function get(){var t=0;for(var _e13=0;_e13<this.sections.length;_e13+=2){var _i8=this.sections[_e13+1];t+=_i8<0?this.sections[_e13]:_i8;}return t;}},{key:"empty",get:function get(){return 0==this.sections.length||2==this.sections.length&&this.sections[1]<0;}},{key:"iterGaps",value:function iterGaps(t){for(var _e14=0,_i9=0,_s7=0;_e14<this.sections.length;){var _r16=this.sections[_e14++],_n12=this.sections[_e14++];_n12<0?(t(_i9,_s7,_r16),_s7+=_r16):_s7+=_n12,_i9+=_r16;}}},{key:"iterChangedRanges",value:function iterChangedRanges(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!1;L(this,t,e);}},{key:"invertedDesc",get:function get(){var t=[];for(var _e15=0;_e15<this.sections.length;){var _i10=this.sections[_e15++],_s8=this.sections[_e15++];_s8<0?t.push(_i10,_s8):t.push(_s8,_i10);}return new I(t);}},{key:"composeDesc",value:function composeDesc(t){return this.empty?t:t.empty?this:$(this,t);}},{key:"mapDesc",value:function mapDesc(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!1;return t.empty?this:N(this,t,e);}},{key:"mapPos",value:function mapPos(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:-1;var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:E.Simple;var s=0,r=0;for(var _n13=0;_n13<this.sections.length;){var _h10=this.sections[_n13++],_l9=this.sections[_n13++],_o5=s+_h10;if(_l9<0){if(_o5>t)return r+(t-s);r+=_h10;}else{if(i!=E.Simple&&_o5>=t&&(i==E.TrackDel&&s<t&&_o5>t||i==E.TrackBefore&&s<t||i==E.TrackAfter&&_o5>t))return null;if(_o5>t||_o5==t&&e<0&&!_h10)return t==s||e<0?r:r+_l9;r+=_l9;}s=_o5;}if(t>s)throw new RangeError("Position ".concat(t," is out of range for changeset of length ").concat(s));return r;}},{key:"touchesRange",value:function touchesRange(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:t;for(var _i11=0,_s9=0;_i11<this.sections.length&&_s9<=e;){var _r17=_s9+this.sections[_i11++];if(this.sections[_i11++]>=0&&_s9<=e&&_r17>=t)return!(_s9<t&&_r17>e)||"cover";_s9=_r17;}return!1;}},{key:"toString",value:function toString(){var t="";for(var _e16=0;_e16<this.sections.length;){var _i12=this.sections[_e16++],_s10=this.sections[_e16++];t+=(t?" ":"")+_i12+(_s10>=0?":"+_s10:"");}return t;}},{key:"toJSON",value:function toJSON(){return this.sections;}}],[{key:"fromJSON",value:function fromJSON(t){if(!Array.isArray(t)||t.length%2||t.some(function(t){return"number"!=typeof t;}))throw new RangeError("Invalid JSON representation of ChangeDesc");return new I(t);}},{key:"create",value:function create(t){return new I(t);}}]);}();R=/*#__PURE__*/function(_I){function R(t,e){var _this3;_classCallCheck(this,R);_this3=_callSuper(this,R,[t]),_this3.inserted=e;return _this3;}_inherits(R,_I);return _createClass(R,[{key:"apply",value:function apply(t){if(this.length!=t.length)throw new RangeError("Applying change set to a document with the wrong length");return L(this,function(e,i,s,r,n){return t=t.replace(s,s+(i-e),n);},!1),t;}},{key:"mapDesc",value:function mapDesc(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!1;return N(this,t,e,!0);}},{key:"invert",value:function invert(t){var e=this.sections.slice(),i=[];for(var _s11=0,_r18=0;_s11<e.length;_s11+=2){var _n14=e[_s11],_h11=e[_s11+1];if(_h11>=0){e[_s11]=_h11,e[_s11+1]=_n14;var _l10=_s11>>1;for(;i.length<_l10;)i.push(p.empty);i.push(_n14?t.slice(_r18,_r18+_n14):p.empty);}_r18+=_n14;}return new R(e,i);}},{key:"compose",value:function compose(t){return this.empty?t:t.empty?this:$(this,t,!0);}},{key:"map",value:function map(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!1;return t.empty?this:N(this,t,e,!0);}},{key:"iterChanges",value:function iterChanges(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!1;L(this,t,e);}},{key:"desc",get:function get(){return I.create(this.sections);}},{key:"filter",value:function filter(t){var e=[],i=[],s=[],r=new j(this);t:for(var _n15=0,_h12=0;;){var _l11=_n15==t.length?1e9:t[_n15++];for(;_h12<_l11||_h12==_l11&&0==r.len;){if(r.done)break t;var _t5=Math.min(r.len,_l11-_h12);T(s,_t5,-1);var _n16=-1==r.ins?-1:0==r.off?r.ins:0;T(e,_t5,_n16),_n16>0&&B(i,e,r.text),r.forward(_t5),_h12+=_t5;}var _o6=t[_n15++];for(;_h12<_o6;){if(r.done)break t;var _t6=Math.min(r.len,_o6-_h12);T(e,_t6,-1),T(s,_t6,-1==r.ins?-1:0==r.off?r.ins:0),r.forward(_t6),_h12+=_t6;}}return{changes:new R(e,i),filtered:I.create(s)};}},{key:"toJSON",value:function toJSON(){var t=[];for(var _e17=0;_e17<this.sections.length;_e17+=2){var _i13=this.sections[_e17],_s12=this.sections[_e17+1];_s12<0?t.push(_i13):0==_s12?t.push([_i13]):t.push([_i13].concat(this.inserted[_e17>>1].toJSON()));}return t;}}],[{key:"of",value:function of(t,e,i){var s=[],r=[],n=0,h=null;function l(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:!1;if(!t&&!s.length)return;n<e&&T(s,e-n,-1);var i=new R(s,r);h=h?h.compose(i.map(h)):i,s=[],r=[],n=0;}return function t(o){if(Array.isArray(o)){var _iterator10=_createForOfIteratorHelper(o),_step10;try{for(_iterator10.s();!(_step10=_iterator10.n()).done;){var _e18=_step10.value;t(_e18);}}catch(err){_iterator10.e(err);}finally{_iterator10.f();}}else if(o instanceof R){if(o.length!=e)throw new RangeError("Mismatched change set length (got ".concat(o.length,", expected ").concat(e,")"));l(),h=h?h.compose(o.map(h)):o;}else{var _t7=o.from,_o$to=o.to,_h13=_o$to===void 0?_t7:_o$to,_u2=o.insert;if(_t7>_h13||_t7<0||_h13>e)throw new RangeError("Invalid change range ".concat(_t7," to ").concat(_h13," (in doc of length ").concat(e,")"));var _f2=_u2?"string"==typeof _u2?p.of(_u2.split(i||D)):_u2:p.empty,_a2=_f2.length;if(_t7==_h13&&0==_a2)return;_t7<n&&l(),_t7>n&&T(s,_t7-n,-1),T(s,_h13-_t7,_a2),B(r,s,_f2),n=_h13;}}(t),l(!h),h;}},{key:"empty",value:function empty(t){return new R(t?[t,-1]:[],[]);}},{key:"fromJSON",value:function fromJSON(t){if(!Array.isArray(t))throw new RangeError("Invalid JSON representation of ChangeSet");var e=[],i=[];for(var _s13=0;_s13<t.length;_s13++){var _r19=t[_s13];if("number"==typeof _r19)e.push(_r19,-1);else{if(!Array.isArray(_r19)||"number"!=typeof _r19[0]||_r19.some(function(t,e){return e&&"string"!=typeof t;}))throw new RangeError("Invalid JSON representation of ChangeSet");if(1==_r19.length)e.push(_r19[0],0);else{for(;i.length<_s13;)i.push(p.empty);i[_s13]=p.of(_r19.slice(1)),e.push(_r19[0],i[_s13].length);}}}return new R(e,i);}},{key:"createSet",value:function createSet(t,e){return new R(t,e);}}]);}(I);j=/*#__PURE__*/function(){function j(t){_classCallCheck(this,j);this.set=t,this.i=0,this.next();}return _createClass(j,[{key:"next",value:function next(){var t=this.set.sections;this.i<t.length?(this.len=t[this.i++],this.ins=t[this.i++]):(this.len=0,this.ins=-2),this.off=0;}},{key:"done",get:function get(){return-2==this.ins;}},{key:"len2",get:function get(){return this.ins<0?this.len:this.ins;}},{key:"text",get:function get(){var t=this.set.inserted,e=this.i-2>>1;return e>=t.length?p.empty:t[e];}},{key:"textBit",value:function textBit(t){var e=this.set.inserted,i=this.i-2>>1;return i>=e.length&&!t?p.empty:e[i].slice(this.off,null==t?void 0:this.off+t);}},{key:"forward",value:function forward(t){t==this.len?this.next():(this.len-=t,this.off+=t);}},{key:"forward2",value:function forward2(t){-1==this.ins?this.forward(t):t==this.ins?this.next():(this.ins-=t,this.off+=t);}}]);}();z=/*#__PURE__*/function(){function z(t,e,i){_classCallCheck(this,z);this.from=t,this.to=e,this.flags=i;}return _createClass(z,[{key:"anchor",get:function get(){return 32&this.flags?this.to:this.from;}},{key:"head",get:function get(){return 32&this.flags?this.from:this.to;}},{key:"empty",get:function get(){return this.from==this.to;}},{key:"assoc",get:function get(){return 8&this.flags?-1:16&this.flags?1:0;}},{key:"bidiLevel",get:function get(){var t=7&this.flags;return 7==t?null:t;}},{key:"goalColumn",get:function get(){var t=this.flags>>6;return 16777215==t?void 0:t;}},{key:"map",value:function map(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:-1;var i,s;return this.empty?i=s=t.mapPos(this.from,e):(i=t.mapPos(this.from,1),s=t.mapPos(this.to,-1)),i==this.from&&s==this.to?this:new z(i,s,this.flags);}},{key:"extend",value:function extend(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:t;if(t<=this.anchor&&e>=this.anchor)return P.range(t,e);var i=Math.abs(t-this.anchor)>Math.abs(e-this.anchor)?t:e;return P.range(this.anchor,i);}},{key:"eq",value:function eq(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!1;return!(this.anchor!=t.anchor||this.head!=t.head||e&&this.empty&&this.assoc!=t.assoc);}},{key:"toJSON",value:function toJSON(){return{anchor:this.anchor,head:this.head};}}],[{key:"fromJSON",value:function fromJSON(t){if(!t||"number"!=typeof t.anchor||"number"!=typeof t.head)throw new RangeError("Invalid JSON representation for SelectionRange");return P.range(t.anchor,t.head);}},{key:"create",value:function create(t,e,i){return new z(t,e,i);}}]);}();_export("m",P=/*#__PURE__*/function(){function P(t,e){_classCallCheck(this,P);this.ranges=t,this.mainIndex=e;}return _createClass(P,[{key:"map",value:function map(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:-1;return t.empty?this:P.create(this.ranges.map(function(i){return i.map(t,e);}),this.mainIndex);}},{key:"eq",value:function eq(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!1;if(this.ranges.length!=t.ranges.length||this.mainIndex!=t.mainIndex)return!1;for(var _i18=0;_i18<this.ranges.length;_i18++)if(!this.ranges[_i18].eq(t.ranges[_i18],e))return!1;return!0;}},{key:"main",get:function get(){return this.ranges[this.mainIndex];}},{key:"asSingle",value:function asSingle(){return 1==this.ranges.length?this:new P([this.main],0);}},{key:"addRange",value:function addRange(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!0;return P.create([t].concat(this.ranges),e?0:this.mainIndex+1);}},{key:"replaceRange",value:function replaceRange(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:this.mainIndex;var i=this.ranges.slice();return i[e]=t,P.create(i,this.mainIndex);}},{key:"toJSON",value:function toJSON(){return{ranges:this.ranges.map(function(t){return t.toJSON();}),main:this.mainIndex};}}],[{key:"fromJSON",value:function fromJSON(t){if(!t||!Array.isArray(t.ranges)||"number"!=typeof t.main||t.main>=t.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new P(t.ranges.map(function(t){return z.fromJSON(t);}),t.main);}},{key:"single",value:function single(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:t;return new P([P.range(t,e)],0);}},{key:"create",value:function create(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;if(0==t.length)throw new RangeError("A selection needs at least one range");for(var _i19=0,_s14=0;_s14<t.length;_s14++){var _r21=t[_s14];if(_r21.empty?_r21.from<=_i19:_r21.from<_i19)return P.normalized(t.slice(),e);_i19=_r21.to;}return new P(t,e);}},{key:"cursor",value:function cursor(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var i=arguments.length>2?arguments[2]:undefined;var s=arguments.length>3?arguments[3]:undefined;return z.create(t,t,(0==e?0:e<0?8:16)|(null==i?7:Math.min(6,i))|(null!=s?s:16777215)<<6);}},{key:"range",value:function range(t,e,i,s){var r=(null!=i?i:16777215)<<6|(null==s?7:Math.min(6,s));return e<t?z.create(e,t,48|r):z.create(t,e,(e>t?8:0)|r);}},{key:"normalized",value:function normalized(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var i=t[e];t.sort(function(t,e){return t.from-e.from;}),e=t.indexOf(i);for(var _i20=1;_i20<t.length;_i20++){var _s15=t[_i20],_r22=t[_i20-1];if(_s15.empty?_s15.from<=_r22.to:_s15.from<_r22.to){var _n18=_r22.from,_h15=Math.max(_s15.to,_r22.to);_i20<=e&&e--,t.splice(--_i20,2,_s15.anchor>_s15.head?P.range(_h15,_n18):P.range(_n18,_h15));}}return new P(t,e);}}]);}());W=0;F=/*#__PURE__*/function(){function F(t,e,i,s,r){_classCallCheck(this,F);this.combine=t,this.compareInput=e,this.compare=i,this.isStatic=s,this.id=W++,this["default"]=t([]),this.extensions="function"==typeof r?r(this):r;}return _createClass(F,[{key:"reader",get:function get(){return this;}},{key:"of",value:function of(t){return new q([],this,0,t);}},{key:"compute",value:function compute(t,e){if(this.isStatic)throw new Error("Can't compute a static facet");return new q(t,this,1,e);}},{key:"computeN",value:function computeN(t,e){if(this.isStatic)throw new Error("Can't compute a static facet");return new q(t,this,2,e);}},{key:"from",value:function from(t,e){return e||(e=function e(t){return t;}),this.compute([t],function(i){return e(i.field(t));});}}],[{key:"define",value:function define(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return new F(t.combine||function(t){return t;},t.compareInput||function(t,e){return t===e;},t.compare||(t.combine?function(t,e){return t===e;}:V),!!t["static"],t.enables);}}]);}();q=/*#__PURE__*/function(){function q(t,e,i,s){_classCallCheck(this,q);this.dependencies=t,this.facet=e,this.type=i,this.value=s,this.id=W++;}return _createClass(q,[{key:"dynamicSlot",value:function dynamicSlot(t){var _this4=this;var e;var i=this.value,s=this.facet.compareInput,r=this.id,n=t[r]>>1,h=2==this.type,l=!1,o=!1,u=[];var _iterator12=_createForOfIteratorHelper(this.dependencies),_step12;try{for(_iterator12.s();!(_step12=_iterator12.n()).done;){var _i22=_step12.value;"doc"==_i22?l=!0:"selection"==_i22?o=!0:1&(null!==(e=t[_i22.id])&&void 0!==e?e:1)||u.push(t[_i22.id]);}}catch(err){_iterator12.e(err);}finally{_iterator12.f();}return{create:function create(t){return t.values[n]=i(t),1;},update:function update(t,e){if(l&&e.docChanged||o&&(e.docChanged||e.selection)||U(t,u)){var _e22=i(t);if(h?!J(_e22,t.values[n],s):!s(_e22,t.values[n]))return t.values[n]=_e22,1;}return 0;},reconfigure:function reconfigure(t,e){var l,o=e.config.address[r];if(null!=o){var _r23=lt(e,o);if(_this4.dependencies.every(function(i){return i instanceof F?e.facet(i)===t.facet(i):!(i instanceof _)||e.field(i,!1)==t.field(i,!1);})||(h?J(l=i(t),_r23,s):s(l=i(t),_r23)))return t.values[n]=_r23,0;}else l=i(t);return t.values[n]=l,1;}};}}]);}();K=F.define({"static":!0});_=/*#__PURE__*/function(){function _(t,e,i,s,r){_classCallCheck(this,_);this.id=t,this.createF=e,this.updateF=i,this.compareF=s,this.spec=r,this.provides=void 0;}return _createClass(_,[{key:"create",value:function create(t){var _this5=this;var e=t.facet(K).find(function(t){return t.field==_this5;});return((null==e?void 0:e.create)||this.createF)(t);}},{key:"slot",value:function slot(t){var _this6=this;var e=t[this.id]>>1;return{create:function create(t){return t.values[e]=_this6.create(t),1;},update:function update(t,i){var s=t.values[e],r=_this6.updateF(s,i);return _this6.compareF(s,r)?0:(t.values[e]=r,1);},reconfigure:function reconfigure(t,i){var s,r=t.facet(K),n=i.facet(K);return(s=r.find(function(t){return t.field==_this6;}))&&s!=n.find(function(t){return t.field==_this6;})?(t.values[e]=s.create(t),1):null!=i.config.address[_this6.id]?(t.values[e]=i.field(_this6),0):(t.values[e]=_this6.create(t),1);}};}},{key:"init",value:function init(t){return[this,K.of({field:this,create:t})];}},{key:"extension",get:function get(){return this;}}],[{key:"define",value:function define(t){var e=new _(W++,t.create,t.update,t.compare||function(t,e){return t===e;},t);return t.provide&&(e.provides=t.provide(e)),e;}}]);}();X=4,Y=3,Q=2,Z=1;et={highest:tt(0),high:tt(Z),"default":tt(Q),low:tt(Y),lowest:tt(X)};it=/*#__PURE__*/_createClass(function it(t,e){_classCallCheck(this,it);this.inner=t,this.prec=e;});_export("C",st=/*#__PURE__*/function(){function st(){_classCallCheck(this,st);}return _createClass(st,[{key:"of",value:function of(t){return new rt(this,t);}},{key:"reconfigure",value:function reconfigure(t){return st.reconfigure.of({compartment:this,extension:t});}},{key:"get",value:function get(t){return t.config.compartments.get(this);}}]);}());rt=/*#__PURE__*/_createClass(function rt(t,e){_classCallCheck(this,rt);this.compartment=t,this.inner=e;});nt=/*#__PURE__*/function(){function nt(t,e,i,s,r,n){_classCallCheck(this,nt);for(this.base=t,this.compartments=e,this.dynamicSlots=i,this.address=s,this.staticValues=r,this.facets=n,this.statusTemplate=[];this.statusTemplate.length<i.length;)this.statusTemplate.push(0);}return _createClass(nt,[{key:"staticFacet",value:function staticFacet(t){var e=this.address[t.id];return null==e?t["default"]:this.staticValues[e>>1];}}],[{key:"resolve",value:function resolve(t,e,i){var s=[],r=Object.create(null),n=new Map();var _iterator16=_createForOfIteratorHelper(function(t,e,i){var s=[[],[],[],[],[]],r=new Map();function n(t,h){var l=r.get(t);if(null!=l){if(l<=h)return;var _e25=s[l].indexOf(t);_e25>-1&&s[l].splice(_e25,1),t instanceof rt&&i["delete"](t.compartment);}if(r.set(t,h),Array.isArray(t)){var _iterator17=_createForOfIteratorHelper(t),_step17;try{for(_iterator17.s();!(_step17=_iterator17.n()).done;){var _e26=_step17.value;n(_e26,h);}}catch(err){_iterator17.e(err);}finally{_iterator17.f();}}else if(t instanceof rt){if(i.has(t.compartment))throw new RangeError("Duplicate use of compartment in extensions");var _s19=e.get(t.compartment)||t.inner;i.set(t.compartment,_s19),n(_s19,h);}else if(t instanceof it)n(t.inner,t.prec);else if(t instanceof _)s[h].push(t),t.provides&&n(t.provides,h);else if(t instanceof q)s[h].push(t),t.facet.extensions&&n(t.facet.extensions,Q);else{var _e27=t.extension;if(!_e27)throw new Error("Unrecognized extension value in extension set (".concat(t,"). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks."));n(_e27,h);}}return n(t,Q),s.reduce(function(t,e){return t.concat(e);});}(t,e,n)),_step16;try{for(_iterator16.s();!(_step16=_iterator16.n()).done;){var _i24=_step16.value;_i24 instanceof _?s.push(_i24):(r[_i24.facet.id]||(r[_i24.facet.id]=[])).push(_i24);}}catch(err){_iterator16.e(err);}finally{_iterator16.f();}var h=Object.create(null),l=[],o=[];var _loop=function _loop(){var t=_s18[_i23];h[t.id]=o.length<<1,o.push(function(e){return t.slot(e);});};for(var _i23=0,_s18=s;_i23<_s18.length;_i23++){_loop();}var u=null==i?void 0:i.config.facets;var _loop2=function _loop2(){var e=r[_t13],s=e[0].facet,n=u&&u[_t13]||[];if(e.every(function(t){return 0==t.type;})){if(h[s.id]=l.length<<1|1,V(n,e))l.push(i.facet(s));else{var _t14=s.combine(e.map(function(t){return t.value;}));l.push(i&&s.compare(_t14,i.facet(s))?i.facet(s):_t14);}}else{var _iterator18=_createForOfIteratorHelper(e),_step18;try{var _loop3=function _loop3(){var t=_step18.value;0==t.type?(h[t.id]=l.length<<1|1,l.push(t.value)):(h[t.id]=o.length<<1,o.push(function(e){return t.dynamicSlot(e);}));};for(_iterator18.s();!(_step18=_iterator18.n()).done;){_loop3();}}catch(err){_iterator18.e(err);}finally{_iterator18.f();}h[s.id]=o.length<<1,o.push(function(t){return G(t,s,e);});}};for(var _t13 in r){_loop2();}var f=o.map(function(t){return t(h);});return new nt(t,n,f,h,l,r);}}]);}();ot=F.define(),ut=F.define({combine:function combine(t){return t.some(function(t){return t;});},"static":!0}),ft=F.define({combine:function combine(t){return t.length?t[0]:void 0;},"static":!0}),at=F.define(),ct=F.define(),dt=F.define(),pt=F.define({combine:function combine(t){return!!t.length&&t[0];}});mt=/*#__PURE__*/function(){function mt(t,e){_classCallCheck(this,mt);this.type=t,this.value=e;}return _createClass(mt,null,[{key:"define",value:function define(){return new gt();}}]);}();gt=/*#__PURE__*/function(){function gt(){_classCallCheck(this,gt);}return _createClass(gt,[{key:"of",value:function of(t){return new mt(this,t);}}]);}();wt=/*#__PURE__*/function(){function wt(t){_classCallCheck(this,wt);this.map=t;}return _createClass(wt,[{key:"of",value:function of(t){return new bt(this,t);}}]);}();bt=/*#__PURE__*/function(){function bt(t,e){_classCallCheck(this,bt);this.type=t,this.value=e;}return _createClass(bt,[{key:"map",value:function map(t){var e=this.type.map(this.value,t);return void 0===e?void 0:e==this.value?this:new bt(this.type,e);}},{key:"is",value:function is(t){return this.type==t;}}],[{key:"define",value:function define(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return new wt(t.map||function(t){return t;});}},{key:"mapEffects",value:function mapEffects(t,e){if(!t.length)return t;var i=[];var _iterator19=_createForOfIteratorHelper(t),_step19;try{for(_iterator19.s();!(_step19=_iterator19.n()).done;){var _s20=_step19.value;var _t15=_s20.map(e);_t15&&i.push(_t15);}}catch(err){_iterator19.e(err);}finally{_iterator19.f();}return i;}}]);}();bt.reconfigure=bt.define(),bt.appendConfig=bt.define();vt=/*#__PURE__*/function(){function vt(t,e,i,s,r,n){_classCallCheck(this,vt);this.startState=t,this.changes=e,this.selection=i,this.effects=s,this.annotations=r,this.scrollIntoView=n,this._doc=null,this._state=null,i&&H(i,e.newLength),r.some(function(t){return t.type==vt.time;})||(this.annotations=r.concat(vt.time.of(Date.now())));}return _createClass(vt,[{key:"newDoc",get:function get(){return this._doc||(this._doc=this.changes.apply(this.startState.doc));}},{key:"newSelection",get:function get(){return this.selection||this.startState.selection.map(this.changes);}},{key:"state",get:function get(){return this._state||this.startState.applyTransaction(this),this._state;}},{key:"annotation",value:function annotation(t){var _iterator20=_createForOfIteratorHelper(this.annotations),_step20;try{for(_iterator20.s();!(_step20=_iterator20.n()).done;){var _e28=_step20.value;if(_e28.type==t)return _e28.value;}}catch(err){_iterator20.e(err);}finally{_iterator20.f();}}},{key:"docChanged",get:function get(){return!this.changes.empty;}},{key:"reconfigured",get:function get(){return this.startState.config!=this.state.config;}},{key:"isUserEvent",value:function isUserEvent(t){var e=this.annotation(vt.userEvent);return!(!e||!(e==t||e.length>t.length&&e.slice(0,t.length)==t&&"."==e[t.length]));}}],[{key:"create",value:function create(t,e,i,s,r,n){return new vt(t,e,i,s,r,n);}}]);}();vt.time=mt.define(),vt.userEvent=mt.define(),vt.addToHistory=mt.define(),vt.remote=mt.define();St=[];Ct=function(t){return t[t.Word=0]="Word",t[t.Space=1]="Space",t[t.Other=2]="Other",t;}(Ct||(Ct={}));Ot=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;try{Dt=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u");}catch(t){}_export("A",It=/*#__PURE__*/function(){function It(t,e,i,s,r,n){_classCallCheck(this,It);this.config=t,this.doc=e,this.selection=i,this.values=s,this.status=t.statusTemplate.slice(),this.computeSlot=r,n&&(n._state=this);for(var _t16=0;_t16<this.config.dynamicSlots.length;_t16++)ht(this,_t16<<1);this.computeSlot=null;}return _createClass(It,[{key:"field",value:function field(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!0;var i=this.config.address[t.id];if(null!=i)return ht(this,i),lt(this,i);if(e)throw new RangeError("Field is not present in this state");}},{key:"update",value:function update(){for(var _len=arguments.length,t=new Array(_len),_key=0;_key<_len;_key++){t[_key]=arguments[_key];}return xt(this,t,!0);}},{key:"applyTransaction",value:function applyTransaction(t){var _this7=this;var e,i=this.config,_i28=i,s=_i28.base,r=_i28.compartments;var _iterator22=_createForOfIteratorHelper(t.effects),_step22;try{for(_iterator22.s();!(_step22=_iterator22.n()).done;){var _e32=_step22.value;_e32.is(st.reconfigure)?(i&&(r=new Map(),i.compartments.forEach(function(t,e){return r.set(e,t);}),i=null),r.set(_e32.value.compartment,_e32.value.extension)):_e32.is(bt.reconfigure)?(i=null,s=_e32.value):_e32.is(bt.appendConfig)&&(i=null,s=At(s).concat(_e32.value));}}catch(err){_iterator22.e(err);}finally{_iterator22.f();}if(i)e=t.startState.values.slice();else{i=nt.resolve(s,r,this),e=new It(i,this.doc,this.selection,i.dynamicSlots.map(function(){return null;}),function(t,e){return e.reconfigure(t,_this7);},null).values;}var n=t.startState.facet(ut)?t.newSelection:t.newSelection.asSingle();new It(i,t.newDoc,n,e,function(e,i){return i.update(e,t);},t);}},{key:"replaceSelection",value:function replaceSelection(t){return"string"==typeof t&&(t=this.toText(t)),this.changeByRange(function(e){return{changes:{from:e.from,to:e.to,insert:t},range:P.cursor(e.from+t.length)};});}},{key:"changeByRange",value:function changeByRange(t){var e=this.selection,i=t(e.ranges[0]),s=this.changes(i.changes),r=[i.range],n=At(i.effects);for(var _i29=1;_i29<e.ranges.length;_i29++){var _h17=t(e.ranges[_i29]),_l13=this.changes(_h17.changes),_o8=_l13.map(s);for(var _t17=0;_t17<_i29;_t17++)r[_t17]=r[_t17].map(_o8);var _u4=s.mapDesc(_l13,!0);r.push(_h17.range.map(_u4)),s=s.compose(_o8),n=bt.mapEffects(n,_o8).concat(bt.mapEffects(At(_h17.effects),_u4));}return{changes:s,selection:P.create(r,e.mainIndex),effects:n};}},{key:"changes",value:function changes(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];return t instanceof R?t:R.of(t,this.doc.length,this.facet(It.lineSeparator));}},{key:"toText",value:function toText(t){return p.of(t.split(this.facet(It.lineSeparator)||D));}},{key:"sliceDoc",value:function sliceDoc(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:this.doc.length;return this.doc.sliceString(t,e,this.lineBreak);}},{key:"facet",value:function facet(t){var e=this.config.address[t.id];return null==e?t["default"]:(ht(this,e),lt(this,e));}},{key:"toJSON",value:function toJSON(t){var e={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(t)for(var _i30 in t){var _s24=t[_i30];_s24 instanceof _&&null!=this.config.address[_s24.id]&&(e[_i30]=_s24.spec.toJSON(this.field(t[_i30]),this));}return e;}},{key:"tabSize",get:function get(){return this.facet(It.tabSize);}},{key:"lineBreak",get:function get(){return this.facet(It.lineSeparator)||"\n";}},{key:"readOnly",get:function get(){return this.facet(pt);}},{key:"phrase",value:function phrase(t){for(var _len2=arguments.length,e=new Array(_len2>1?_len2-1:0),_key2=1;_key2<_len2;_key2++){e[_key2-1]=arguments[_key2];}var _iterator23=_createForOfIteratorHelper(this.facet(It.phrases)),_step23;try{for(_iterator23.s();!(_step23=_iterator23.n()).done;){var _e33=_step23.value;if(Object.prototype.hasOwnProperty.call(_e33,t)){t=_e33[t];break;}}}catch(err){_iterator23.e(err);}finally{_iterator23.f();}return e.length&&(t=t.replace(/\$(\$|\d*)/g,function(t,i){if("$"==i)return"$";var s=+(i||1);return!s||s>e.length?t:e[s-1];})),t;}},{key:"languageDataAt",value:function languageDataAt(t,e){var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:-1;var s=[];var _iterator24=_createForOfIteratorHelper(this.facet(ot)),_step24;try{for(_iterator24.s();!(_step24=_iterator24.n()).done;){var _r29=_step24.value;var _iterator25=_createForOfIteratorHelper(_r29(this,e,i)),_step25;try{for(_iterator25.s();!(_step25=_iterator25.n()).done;){var _n23=_step25.value;Object.prototype.hasOwnProperty.call(_n23,t)&&s.push(_n23[t]);}}catch(err){_iterator25.e(err);}finally{_iterator25.f();}}}catch(err){_iterator24.e(err);}finally{_iterator24.f();}return s;}},{key:"charCategorizer",value:function charCategorizer(t){return Et(this.languageDataAt("wordChars",t).join(""));}},{key:"wordAt",value:function wordAt(t){var _this$doc$lineAt=this.doc.lineAt(t),e=_this$doc$lineAt.text,i=_this$doc$lineAt.from,s=_this$doc$lineAt.length,r=this.charCategorizer(t),n=t-i,h=t-i;for(;n>0;){var _t18=S(e,n,!1);if(r(e.slice(_t18,n))!=Ct.Word)break;n=_t18;}for(;h<s;){var _t19=S(e,h);if(r(e.slice(h,_t19))!=Ct.Word)break;h=_t19;}return n==h?null:P.range(n+i,h+i);}}],[{key:"fromJSON",value:function fromJSON(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var i=arguments.length>2?arguments[2]:undefined;if(!t||"string"!=typeof t.doc)throw new RangeError("Invalid JSON representation for EditorState");var s=[];if(i){var _loop4=function _loop4(){if(Object.prototype.hasOwnProperty.call(t,_e34)){var _r30=i[_e34],_n24=t[_e34];s.push(_r30.init(function(t){return _r30.spec.fromJSON(_n24,t);}));}};for(var _e34 in i){_loop4();}}return It.create({doc:t.doc,selection:P.fromJSON(t.selection),extensions:e.extensions?s.concat([e.extensions]):s});}},{key:"create",value:function create(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var e=nt.resolve(t.extensions||[],new Map()),i=t.doc instanceof p?t.doc:p.of((t.doc||"").split(e.staticFacet(It.lineSeparator)||D)),s=t.selection?t.selection instanceof P?t.selection:P.single(t.selection.anchor,t.selection.head):P.single(0);return H(s,i.length),e.staticFacet(ut)||(s=s.asSingle()),new It(e,i,s,e.dynamicSlots.map(function(){return null;}),function(t,e){return e.create(t);},null);}}]);}());It.allowMultipleSelections=ut,It.tabSize=F.define({combine:function combine(t){return t.length?t[0]:4;}}),It.lineSeparator=ft,It.readOnly=pt,It.phrases=F.define({compare:function compare(t,e){var i=Object.keys(t),s=Object.keys(e);return i.length==s.length&&i.every(function(i){return t[i]==e[i];});}}),It.languageData=ot,It.changeFilter=at,It.transactionFilter=ct,It.transactionExtender=dt,st.reconfigure=bt.define();Tt=/*#__PURE__*/function(){function Tt(){_classCallCheck(this,Tt);}return _createClass(Tt,[{key:"eq",value:function eq(t){return this==t;}},{key:"range",value:function range(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:t;return Bt.create(t,e,this);}}]);}();Tt.prototype.startSide=Tt.prototype.endSide=0,Tt.prototype.point=!1,Tt.prototype.mapMode=E.TrackDel;Bt=/*#__PURE__*/function(){function t(_t22,e,i){_classCallCheck(this,t);this.from=_t22,this.to=e,this.value=i;}return _createClass(t,null,[{key:"create",value:function create(e,i,s){return new t(e,i,s);}}]);}();Nt=/*#__PURE__*/function(){function Nt(t,e,i,s){_classCallCheck(this,Nt);this.from=t,this.to=e,this.value=i,this.maxPoint=s;}return _createClass(Nt,[{key:"length",get:function get(){return this.to[this.to.length-1];}},{key:"findIndex",value:function findIndex(t,e,i){var s=arguments.length>3&&arguments[3]!==undefined?arguments[3]:0;var r=i?this.to:this.from;for(var _n26=s,_h18=r.length;;){if(_n26==_h18)return _n26;var _s25=_n26+_h18>>1,_l14=r[_s25]-t||(i?this.value[_s25].endSide:this.value[_s25].startSide)-e;if(_s25==_n26)return _l14>=0?_n26:_h18;_l14>=0?_h18=_s25:_n26=_s25+1;}}},{key:"between",value:function between(t,e,i,s){for(var _r32=this.findIndex(e,-1e9,!0),_n27=this.findIndex(i,1e9,!1,_r32);_r32<_n27;_r32++)if(!1===s(this.from[_r32]+t,this.to[_r32]+t,this.value[_r32]))return!1;}},{key:"map",value:function map(t,e){var i=[],s=[],r=[],n=-1,h=-1;for(var _l15=0;_l15<this.value.length;_l15++){var _o9=void 0,_u5=void 0,_f4=this.value[_l15],_a4=this.from[_l15]+t,_c2=this.to[_l15]+t;if(_a4==_c2){var _t23=e.mapPos(_a4,_f4.startSide,_f4.mapMode);if(null==_t23)continue;if(_o9=_u5=_t23,_f4.startSide!=_f4.endSide&&(_u5=e.mapPos(_a4,_f4.endSide),_u5<_o9))continue;}else if(_o9=e.mapPos(_a4,_f4.startSide),_u5=e.mapPos(_c2,_f4.endSide),_o9>_u5||_o9==_u5&&_f4.startSide>0&&_f4.endSide<=0)continue;(_u5-_o9||_f4.endSide-_f4.startSide)<0||(n<0&&(n=_o9),_f4.point&&(h=Math.max(h,_u5-_o9)),i.push(_f4),s.push(_o9-n),r.push(_u5-n));}return{mapped:i.length?new Nt(s,r,i,h):null,pos:n};}}]);}();$t=/*#__PURE__*/function(){function $t(t,e,i,s){_classCallCheck(this,$t);this.chunkPos=t,this.chunk=e,this.nextLayer=i,this.maxPoint=s;}return _createClass($t,[{key:"length",get:function get(){var t=this.chunk.length-1;return t<0?0:Math.max(this.chunkEnd(t),this.nextLayer.length);}},{key:"size",get:function get(){if(this.isEmpty)return 0;var t=this.nextLayer.size;var _iterator27=_createForOfIteratorHelper(this.chunk),_step27;try{for(_iterator27.s();!(_step27=_iterator27.n()).done;){var _e36=_step27.value;t+=_e36.value.length;}}catch(err){_iterator27.e(err);}finally{_iterator27.f();}return t;}},{key:"chunkEnd",value:function chunkEnd(t){return this.chunkPos[t]+this.chunk[t].length;}},{key:"update",value:function update(t){var _t$add=t.add,e=_t$add===void 0?[]:_t$add,_t$sort=t.sort,i=_t$sort===void 0?!1:_t$sort,_t$filterFrom=t.filterFrom,s=_t$filterFrom===void 0?0:_t$filterFrom,_t$filterTo=t.filterTo,r=_t$filterTo===void 0?this.length:_t$filterTo,n=t.filter;if(0==e.length&&!n)return this;if(i&&(e=e.slice().sort(Lt)),this.isEmpty)return e.length?$t.of(e):this;var h=new Pt(this,null,-1)["goto"](0),l=0,o=[],u=new jt();for(;h.value||l<e.length;)if(l<e.length&&(h.from-e[l].from||h.startSide-e[l].value.startSide)>=0){var _t24=e[l++];u.addInner(_t24.from,_t24.to,_t24.value)||o.push(_t24);}else 1==h.rangeIndex&&h.chunkIndex<this.chunk.length&&(l==e.length||this.chunkEnd(h.chunkIndex)<e[l].from)&&(!n||s>this.chunkEnd(h.chunkIndex)||r<this.chunkPos[h.chunkIndex])&&u.addChunk(this.chunkPos[h.chunkIndex],this.chunk[h.chunkIndex])?h.nextChunk():((!n||s>h.to||r<h.from||n(h.from,h.to,h.value))&&(u.addInner(h.from,h.to,h.value)||o.push(Bt.create(h.from,h.to,h.value))),h.next());return u.finishInner(this.nextLayer.isEmpty&&!o.length?$t.empty:this.nextLayer.update({add:o,filter:n,filterFrom:s,filterTo:r}));}},{key:"map",value:function map(t){if(t.empty||this.isEmpty)return this;var e=[],i=[],s=-1;for(var _r33=0;_r33<this.chunk.length;_r33++){var _n28=this.chunkPos[_r33],_h19=this.chunk[_r33],_l16=t.touchesRange(_n28,_n28+_h19.length);if(!1===_l16)s=Math.max(s,_h19.maxPoint),e.push(_h19),i.push(t.mapPos(_n28));else if(!0===_l16){var _h19$map=_h19.map(_n28,t),_r34=_h19$map.mapped,_l17=_h19$map.pos;_r34&&(s=Math.max(s,_r34.maxPoint),e.push(_r34),i.push(_l17));}}var r=this.nextLayer.map(t);return 0==e.length?r:new $t(i,e,r||$t.empty,s);}},{key:"between",value:function between(t,e,i){if(!this.isEmpty){for(var _s26=0;_s26<this.chunk.length;_s26++){var _r35=this.chunkPos[_s26],_n29=this.chunk[_s26];if(e>=_r35&&t<=_r35+_n29.length&&!1===_n29.between(_r35,t-_r35,e-_r35,i))return;}this.nextLayer.between(t,e,i);}}},{key:"iter",value:function iter(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return Ht.from([this])["goto"](t);}},{key:"isEmpty",get:function get(){return this.nextLayer==this;}}],[{key:"create",value:function create(t,e,i,s){return new $t(t,e,i,s);}},{key:"iter",value:function iter(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;return Ht.from(t)["goto"](e);}},{key:"compare",value:function compare(t,e,i,s){var r=arguments.length>4&&arguments[4]!==undefined?arguments[4]:-1;var n=t.filter(function(t){return t.maxPoint>0||!t.isEmpty&&t.maxPoint>=r;}),h=e.filter(function(t){return t.maxPoint>0||!t.isEmpty&&t.maxPoint>=r;}),l=zt(n,h,i),o=new Ft(n,l,r),u=new Ft(h,l,r);i.iterGaps(function(t,e,i){return Vt(o,t,u,e,i,s);}),i.empty&&0==i.length&&Vt(o,0,u,0,0,s);}},{key:"eq",value:function eq(t,e){var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;var s=arguments.length>3?arguments[3]:undefined;null==s&&(s=999999999);var r=t.filter(function(t){return!t.isEmpty&&e.indexOf(t)<0;}),n=e.filter(function(e){return!e.isEmpty&&t.indexOf(e)<0;});if(r.length!=n.length)return!1;if(!r.length)return!0;var h=zt(r,n),l=new Ft(r,h,0)["goto"](i),o=new Ft(n,h,0)["goto"](i);for(;;){if(l.to!=o.to||!qt(l.active,o.active)||l.point&&(!o.point||!l.point.eq(o.point)))return!1;if(l.to>s)return!0;l.next(),o.next();}}},{key:"spans",value:function spans(t,e,i,s){var r=arguments.length>4&&arguments[4]!==undefined?arguments[4]:-1;var n=new Ft(t,null,r)["goto"](e),h=e,l=n.openStart;for(;;){var _t25=Math.min(n.to,i);if(n.point){var _i32=n.activeForPoint(n.to),_r36=n.pointFrom<e?_i32.length+1:n.point.startSide<0?_i32.length:Math.min(_i32.length,l);s.point(h,_t25,n.point,_i32,_r36,n.pointRank),l=Math.min(n.openEnd(_t25),_i32.length);}else _t25>h&&(s.span(h,_t25,n.active,l),l=n.openEnd(_t25));if(n.to>i)return l+(n.point&&n.to>i?1:0);h=n.to,n.next();}}},{key:"of",value:function of(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!1;var i=new jt();var _iterator28=_createForOfIteratorHelper(t instanceof Bt?[t]:e?function(t){if(t.length>1)for(var _e37=t[0],_i33=1;_i33<t.length;_i33++){var _s27=t[_i33];if(Lt(_e37,_s27)>0)return t.slice().sort(Lt);_e37=_s27;}return t;}(t):t),_step28;try{for(_iterator28.s();!(_step28=_iterator28.n()).done;){var _s28=_step28.value;i.add(_s28.from,_s28.to,_s28.value);}}catch(err){_iterator28.e(err);}finally{_iterator28.f();}return i.finish();}},{key:"join",value:function join(t){if(!t.length)return $t.empty;var e=t[t.length-1];for(var _i34=t.length-2;_i34>=0;_i34--)for(var _s29=t[_i34];_s29!=$t.empty;_s29=_s29.nextLayer)e=new $t(_s29.chunkPos,_s29.chunk,e,Math.max(_s29.maxPoint,e.maxPoint));return e;}}]);}();$t.empty=new $t([],[],null,-1),$t.empty.nextLayer=$t.empty;jt=/*#__PURE__*/function(){function jt(){_classCallCheck(this,jt);this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null;}return _createClass(jt,[{key:"finishChunk",value:function finishChunk(t){this.chunks.push(new Nt(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,t&&(this.from=[],this.to=[],this.value=[]);}},{key:"add",value:function add(t,e,i){this.addInner(t,e,i)||(this.nextLayer||(this.nextLayer=new jt())).add(t,e,i);}},{key:"addInner",value:function addInner(t,e,i){var s=t-this.lastTo||i.startSide-this.last.endSide;if(s<=0&&(t-this.lastFrom||i.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return!(s<0)&&(250==this.from.length&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=t),this.from.push(t-this.chunkStart),this.to.push(e-this.chunkStart),this.last=i,this.lastFrom=t,this.lastTo=e,this.value.push(i),i.point&&(this.maxPoint=Math.max(this.maxPoint,e-t)),!0);}},{key:"addChunk",value:function addChunk(t,e){if((t-this.lastTo||e.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,e.maxPoint),this.chunks.push(e),this.chunkPos.push(t);var i=e.value.length-1;return this.last=e.value[i],this.lastFrom=e.from[i]+t,this.lastTo=e.to[i]+t,!0;}},{key:"finish",value:function finish(){return this.finishInner($t.empty);}},{key:"finishInner",value:function finishInner(t){if(this.from.length&&this.finishChunk(!1),0==this.chunks.length)return t;var e=$t.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(t):t,this.setMaxPoint);return this.from=null,e;}}]);}();Pt=/*#__PURE__*/function(){function Pt(t,e,i){var s=arguments.length>3&&arguments[3]!==undefined?arguments[3]:0;_classCallCheck(this,Pt);this.layer=t,this.skip=e,this.minPoint=i,this.rank=s;}return _createClass(Pt,[{key:"startSide",get:function get(){return this.value?this.value.startSide:0;}},{key:"endSide",get:function get(){return this.value?this.value.endSide:0;}},{key:"goto",value:function _goto(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:-1e9;return this.chunkIndex=this.rangeIndex=0,this.gotoInner(t,e,!1),this;}},{key:"gotoInner",value:function gotoInner(t,e,i){for(;this.chunkIndex<this.layer.chunk.length;){var _e40=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(_e40)||this.layer.chunkEnd(this.chunkIndex)<t||_e40.maxPoint<this.minPoint))break;this.chunkIndex++,i=!1;}if(this.chunkIndex<this.layer.chunk.length){var _s30=this.layer.chunk[this.chunkIndex].findIndex(t-this.layer.chunkPos[this.chunkIndex],e,!0);(!i||this.rangeIndex<_s30)&&this.setRangeIndex(_s30);}this.next();}},{key:"forward",value:function forward(t,e){(this.to-t||this.endSide-e)<0&&this.gotoInner(t,e,!0);}},{key:"next",value:function next(){for(;;){if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break;}{var _t28=this.layer.chunkPos[this.chunkIndex],_e41=this.layer.chunk[this.chunkIndex],_i35=_t28+_e41.from[this.rangeIndex];if(this.from=_i35,this.to=_t28+_e41.to[this.rangeIndex],this.value=_e41.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break;}}}},{key:"setRangeIndex",value:function setRangeIndex(t){if(t==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex<this.layer.chunk.length&&this.skip.has(this.layer.chunk[this.chunkIndex]);)this.chunkIndex++;this.rangeIndex=0;}else this.rangeIndex=t;}},{key:"nextChunk",value:function nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next();}},{key:"compare",value:function compare(t){return this.from-t.from||this.startSide-t.startSide||this.rank-t.rank||this.to-t.to||this.endSide-t.endSide;}}]);}();Ht=/*#__PURE__*/function(){function Ht(t){_classCallCheck(this,Ht);this.heap=t;}return _createClass(Ht,[{key:"startSide",get:function get(){return this.value?this.value.startSide:0;}},{key:"goto",value:function _goto2(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:-1e9;var _iterator31=_createForOfIteratorHelper(this.heap),_step31;try{for(_iterator31.s();!(_step31=_iterator31.n()).done;){var _i36=_step31.value;_i36["goto"](t,e);}}catch(err){_iterator31.e(err);}finally{_iterator31.f();}for(var _t29=this.heap.length>>1;_t29>=0;_t29--)Wt(this.heap,_t29);return this.next(),this;}},{key:"forward",value:function forward(t,e){var _iterator32=_createForOfIteratorHelper(this.heap),_step32;try{for(_iterator32.s();!(_step32=_iterator32.n()).done;){var _i37=_step32.value;_i37.forward(t,e);}}catch(err){_iterator32.e(err);}finally{_iterator32.f();}for(var _t30=this.heap.length>>1;_t30>=0;_t30--)Wt(this.heap,_t30);(this.to-t||this.value.endSide-e)<0&&this.next();}},{key:"next",value:function next(){if(0==this.heap.length)this.from=this.to=1e9,this.value=null,this.rank=-1;else{var _t31=this.heap[0];this.from=_t31.from,this.to=_t31.to,this.value=_t31.value,this.rank=_t31.rank,_t31.value&&_t31.next(),Wt(this.heap,0);}}}],[{key:"from",value:function from(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:null;var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:-1;var s=[];for(var _r37=0;_r37<t.length;_r37++)for(var _n31=t[_r37];!_n31.isEmpty;_n31=_n31.nextLayer)_n31.maxPoint>=i&&s.push(new Pt(_n31,e,i,_r37));return 1==s.length?s[0]:new Ht(s);}}]);}();Ft=/*#__PURE__*/function(){function Ft(t,e,i){_classCallCheck(this,Ft);this.minPoint=i,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=Ht.from(t,e,i);}return _createClass(Ft,[{key:"goto",value:function _goto3(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:-1e9;return this.cursor["goto"](t,e),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=t,this.endSide=e,this.openStart=-1,this.next(),this;}},{key:"forward",value:function forward(t,e){for(;this.minActive>-1&&(this.activeTo[this.minActive]-t||this.active[this.minActive].endSide-e)<0;)this.removeActive(this.minActive);this.cursor.forward(t,e);}},{key:"removeActive",value:function removeActive(t){Jt(this.active,t),Jt(this.activeTo,t),Jt(this.activeRank,t),this.minActive=Gt(this.active,this.activeTo);}},{key:"addActive",value:function addActive(t){var e=0,_this$cursor=this.cursor,i=_this$cursor.value,s=_this$cursor.to,r=_this$cursor.rank;for(;e<this.activeRank.length&&(r-this.activeRank[e]||s-this.activeTo[e])>0;)e++;Ut(this.active,e,i),Ut(this.activeTo,e,s),Ut(this.activeRank,e,r),t&&Ut(t,e,this.cursor.from),this.minActive=Gt(this.active,this.activeTo);}},{key:"next",value:function next(){var t=this.to,e=this.point;this.point=null;var i=this.openStart<0?[]:null;for(;;){var _s32=this.minActive;if(_s32>-1&&(this.activeTo[_s32]-this.cursor.from||this.active[_s32].endSide-this.cursor.startSide)<0){if(this.activeTo[_s32]>t){this.to=this.activeTo[_s32],this.endSide=this.active[_s32].endSide;break;}this.removeActive(_s32),i&&Jt(i,_s32);}else{if(!this.cursor.value){this.to=this.endSide=1e9;break;}if(this.cursor.from>t){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break;}{var _t32=this.cursor.value;if(_t32.point){if(!(e&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)){this.point=_t32,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=_t32.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break;}this.cursor.next();}else this.addActive(i),this.cursor.next();}}}if(i){this.openStart=0;for(var _e42=i.length-1;_e42>=0&&i[_e42]<t;_e42--)this.openStart++;}}},{key:"activeForPoint",value:function activeForPoint(t){if(!this.active.length)return this.active;var e=[];for(var _i39=this.active.length-1;_i39>=0&&!(this.activeRank[_i39]<this.pointRank);_i39--)(this.activeTo[_i39]>t||this.activeTo[_i39]==t&&this.active[_i39].endSide>=this.point.endSide)&&e.push(this.active[_i39]);return e.reverse();}},{key:"openEnd",value:function openEnd(t){var e=0;for(var _i40=this.activeTo.length-1;_i40>=0&&this.activeTo[_i40]>t;_i40--)e++;return e;}}]);}();Xt="undefined"==typeof Symbol?"__ͼ":Symbol["for"]("ͼ"),Yt="undefined"==typeof Symbol?"__styleSet"+Math.floor(1e8*Math.random()):Symbol("styleSet"),Qt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:{};Zt=/*#__PURE__*/function(){function Zt(t,e){_classCallCheck(this,Zt);this.rules=[];var _ref3=e||{},i=_ref3.finish;function s(t){return /^@/.test(t)?[t]:t.split(/,\s*/);}function r(t,e,n,h){var l=[],o=/^@(\w+)\b/.exec(t[0]),u=o&&"keyframes"==o[1];if(o&&null==e)return n.push(t[0]+";");for(var _i44 in e){var _h20=e[_i44];if(/&/.test(_i44))r(_i44.split(/,\s*/).map(function(e){return t.map(function(t){return e.replace(/&/,t);});}).reduce(function(t,e){return t.concat(e);}),_h20,n);else if(_h20&&"object"==_typeof(_h20)){if(!o)throw new RangeError("The value of a property ("+_i44+") should be a primitive value.");r(s(_i44),_h20,l,u);}else null!=_h20&&l.push(_i44.replace(/_.*/,"").replace(/[A-Z]/g,function(t){return"-"+t.toLowerCase();})+": "+_h20+";");}(l.length||u)&&n.push((!i||o||h?t:t.map(i)).join(", ")+" {"+l.join(" ")+"}");}for(var _e44 in t)r(s(_e44),t[_e44],this.rules);}return _createClass(Zt,[{key:"getRules",value:function getRules(){return this.rules.join("\n");}}],[{key:"newName",value:function newName(){var t=Qt[Xt]||1;return Qt[Xt]=t+1,"ͼ"+t.toString(36);}},{key:"mount",value:function mount(t,e,i){var s=t[Yt],r=i&&i.nonce;s?r&&s.setNonce(r):s=new ee(t,r),s.mount(Array.isArray(e)?e:[e],t);}}]);}();te=new Map();ee=/*#__PURE__*/function(){function ee(t,e){_classCallCheck(this,ee);var i=t.ownerDocument||t,s=i.defaultView;if(!t.head&&t.adoptedStyleSheets&&s.CSSStyleSheet){var _e45=te.get(i);if(_e45)return t[Yt]=_e45;this.sheet=new s.CSSStyleSheet(),te.set(i,this);}else this.styleTag=i.createElement("style"),e&&this.styleTag.setAttribute("nonce",e);this.modules=[],t[Yt]=this;}return _createClass(ee,[{key:"mount",value:function mount(t,e){var i=this.sheet,s=0,r=0;for(var _e46=0;_e46<t.length;_e46++){var _n32=t[_e46],_h21=this.modules.indexOf(_n32);if(_h21<r&&_h21>-1&&(this.modules.splice(_h21,1),r--,_h21=-1),-1==_h21){if(this.modules.splice(r++,0,_n32),i)for(var _t33=0;_t33<_n32.rules.length;_t33++)i.insertRule(_n32.rules[_t33],s++);}else{for(;r<_h21;)s+=this.modules[r++].rules.length;s+=_n32.rules.length,r++;}}if(i)e.adoptedStyleSheets.indexOf(this.sheet)<0&&(e.adoptedStyleSheets=[this.sheet].concat(_toConsumableArray(e.adoptedStyleSheets)));else{var _t34="";for(var _e47=0;_e47<this.modules.length;_e47++)_t34+=this.modules[_e47].getRules()+"\n";this.styleTag.textContent=_t34;var _i45=e.head||e;this.styleTag.parentNode!=_i45&&_i45.insertBefore(this.styleTag,_i45.firstChild);}}},{key:"setNonce",value:function setNonce(t){this.styleTag&&this.styleTag.getAttribute("nonce")!=t&&this.styleTag.setAttribute("nonce",t);}}]);}();pe=/*#__PURE__*/function(){function pe(){_classCallCheck(this,pe);this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0;}return _createClass(pe,[{key:"eq",value:function eq(t){return this.anchorNode==t.anchorNode&&this.anchorOffset==t.anchorOffset&&this.focusNode==t.focusNode&&this.focusOffset==t.focusOffset;}},{key:"setRange",value:function setRange(t){var e=t.anchorNode,i=t.focusNode;this.set(e,Math.min(t.anchorOffset,e?fe(e):0),i,Math.min(t.focusOffset,i?fe(i):0));}},{key:"set",value:function set(t,e,i,s){this.anchorNode=t,this.anchorOffset=e,this.focusNode=i,this.focusOffset=s;}}]);}();ge=null;Se=/*#__PURE__*/function(){function Se(t,e){var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!0;_classCallCheck(this,Se);this.node=t,this.offset=e,this.precise=i;}return _createClass(Se,null,[{key:"before",value:function before(t,e){return new Se(t.parentNode,le(t),e);}},{key:"after",value:function after(t,e){return new Se(t.parentNode,le(t)+1,e);}}]);}();Ae=[];Ce=/*#__PURE__*/function(){function Ce(){_classCallCheck(this,Ce);this.parent=null,this.dom=null,this.flags=2;}return _createClass(Ce,[{key:"overrideDOMText",get:function get(){return null;}},{key:"posAtStart",get:function get(){return this.parent?this.parent.posBefore(this):0;}},{key:"posAtEnd",get:function get(){return this.posAtStart+this.length;}},{key:"posBefore",value:function posBefore(t){var e=this.posAtStart;var _iterator33=_createForOfIteratorHelper(this.children),_step33;try{for(_iterator33.s();!(_step33=_iterator33.n()).done;){var _i51=_step33.value;if(_i51==t)return e;e+=_i51.length+_i51.breakAfter;}}catch(err){_iterator33.e(err);}finally{_iterator33.f();}throw new RangeError("Invalid child in posBefore");}},{key:"posAfter",value:function posAfter(t){return this.posBefore(t)+t.length;}},{key:"sync",value:function sync(t,e){if(2&this.flags){var _i52,_s40=this.dom,_r44=null;var _iterator34=_createForOfIteratorHelper(this.children),_step34;try{for(_iterator34.s();!(_step34=_iterator34.n()).done;){var _n33=_step34.value;if(7&_n33.flags){if(!_n33.dom&&(_i52=_r44?_r44.nextSibling:_s40.firstChild)){var _t36=Ce.get(_i52);(!_t36||!_t36.parent&&_t36.canReuseDOM(_n33))&&_n33.reuseDOM(_i52);}_n33.sync(t,e),_n33.flags&=-8;}if(_i52=_r44?_r44.nextSibling:_s40.firstChild,e&&!e.written&&e.node==_s40&&_i52!=_n33.dom&&(e.written=!0),_n33.dom.parentNode==_s40)for(;_i52&&_i52!=_n33.dom;)_i52=Oe(_i52);else _s40.insertBefore(_n33.dom,_i52);_r44=_n33.dom;}}catch(err){_iterator34.e(err);}finally{_iterator34.f();}for(_i52=_r44?_r44.nextSibling:_s40.firstChild,_i52&&e&&e.node==_s40&&(e.written=!0);_i52;)_i52=Oe(_i52);}else if(1&this.flags){var _iterator35=_createForOfIteratorHelper(this.children),_step35;try{for(_iterator35.s();!(_step35=_iterator35.n()).done;){var _i53=_step35.value;7&_i53.flags&&(_i53.sync(t,e),_i53.flags&=-8);}}catch(err){_iterator35.e(err);}finally{_iterator35.f();}}}},{key:"reuseDOM",value:function reuseDOM(t){}},{key:"localPosFromDOM",value:function localPosFromDOM(t,e){var i;if(t==this.dom)i=this.dom.childNodes[e];else{var _s41=0==fe(t)?0:0==e?-1:1;for(;;){var _e48=t.parentNode;if(_e48==this.dom)break;0==_s41&&_e48.firstChild!=_e48.lastChild&&(_s41=t==_e48.firstChild?-1:1),t=_e48;}i=_s41<0?t:t.nextSibling;}if(i==this.dom.firstChild)return 0;for(;i&&!Ce.get(i);)i=i.nextSibling;if(!i)return this.length;for(var _t37=0,_e49=0;;_t37++){var _s42=this.children[_t37];if(_s42.dom==i)return _e49;_e49+=_s42.length+_s42.breakAfter;}}},{key:"domBoundsAround",value:function domBoundsAround(t,e){var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;var s=-1,r=-1,n=-1,h=-1;for(var _l18=0,_o10=i,_u7=i;_l18<this.children.length;_l18++){var _i54=this.children[_l18],_f5=_o10+_i54.length;if(_o10<t&&_f5>e)return _i54.domBoundsAround(t,e,_o10);if(_f5>=t&&-1==s&&(s=_l18,r=_o10),_o10>e&&_i54.dom.parentNode==this.dom){n=_l18,h=_u7;break;}_u7=_f5,_o10=_f5+_i54.breakAfter;}return{from:r,to:h<0?i+this.length:h,startDOM:(s?this.children[s-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:n<this.children.length&&n>=0?this.children[n].dom:null};}},{key:"markDirty",value:function markDirty(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:!1;this.flags|=2,this.markParentsDirty(t);}},{key:"markParentsDirty",value:function markParentsDirty(t){for(var _e50=this.parent;_e50;_e50=_e50.parent){if(t&&(_e50.flags|=2),1&_e50.flags)return;_e50.flags|=1,t=!1;}}},{key:"setParent",value:function setParent(t){this.parent!=t&&(this.parent=t,7&this.flags&&this.markParentsDirty(!0));}},{key:"setDOM",value:function setDOM(t){this.dom!=t&&(this.dom&&(this.dom.cmView=null),this.dom=t,t.cmView=this);}},{key:"rootView",get:function get(){for(var _t38=this;;){var _e51=_t38.parent;if(!_e51)return _t38;_t38=_e51;}}},{key:"replaceChildren",value:function replaceChildren(t,e){var _this$children;var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:Ae;this.markDirty();for(var _s43=t;_s43<e;_s43++){var _t39=this.children[_s43];_t39.parent==this&&i.indexOf(_t39)<0&&_t39.destroy();}i.length<250?(_this$children=this.children).splice.apply(_this$children,[t,e-t].concat(_toConsumableArray(i))):this.children=[].concat(this.children.slice(0,t),i,this.children.slice(e));for(var _t40=0;_t40<i.length;_t40++)i[_t40].setParent(this);}},{key:"ignoreMutation",value:function ignoreMutation(t){return!1;}},{key:"ignoreEvent",value:function ignoreEvent(t){return!1;}},{key:"childCursor",value:function childCursor(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:this.length;return new De(this.children,t,this.children.length);}},{key:"childPos",value:function childPos(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;return this.childCursor().findPos(t,e);}},{key:"toString",value:function toString(){var t=this.constructor.name.replace("View","");return t+(this.children.length?"("+this.children.join()+")":this.length?"["+("Text"==t?this.text:this.length)+"]":"")+(this.breakAfter?"#":"");}},{key:"isEditable",get:function get(){return!0;}},{key:"isWidget",get:function get(){return!1;}},{key:"isHidden",get:function get(){return!1;}},{key:"merge",value:function merge(t,e,i,s,r,n){return!1;}},{key:"become",value:function become(t){return!1;}},{key:"canReuseDOM",value:function canReuseDOM(t){return t.constructor==this.constructor&&!(8&(this.flags|t.flags));}},{key:"getSide",value:function getSide(){return 0;}},{key:"destroy",value:function destroy(){var _iterator36=_createForOfIteratorHelper(this.children),_step36;try{for(_iterator36.s();!(_step36=_iterator36.n()).done;){var _t41=_step36.value;_t41.parent==this&&_t41.destroy();}}catch(err){_iterator36.e(err);}finally{_iterator36.f();}this.parent=null;}}],[{key:"get",value:function get(t){return t.cmView;}}]);}();Ce.prototype.breakAfter=0;De=/*#__PURE__*/function(){function De(t,e,i){_classCallCheck(this,De);this.children=t,this.pos=e,this.i=i,this.off=0;}return _createClass(De,[{key:"findPos",value:function findPos(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;for(;;){if(t>this.pos||t==this.pos&&(e>0||0==this.i||this.children[this.i-1].breakAfter))return this.off=t-this.pos,this;var _i55=this.children[--this.i];this.pos-=_i55.length+_i55.breakAfter;}}}]);}();Re="undefined"!=typeof navigator?navigator:{userAgent:"",vendor:"",platform:""},Te="undefined"!=typeof document?document:{documentElement:{style:{}}};Be=/Edge\/(\d+)/.exec(Re.userAgent),Le=/MSIE \d/.test(Re.userAgent),Ne=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Re.userAgent),$e=!!(Le||Ne||Be),je=!$e&&/gecko\/(\d+)/i.test(Re.userAgent),ze=!$e&&/Chrome\/(\d+)/.exec(Re.userAgent),Pe="webkitFontSmoothing"in Te.documentElement.style,He=!$e&&/Apple Computer/.test(Re.vendor),We=He&&(/Mobile\/\w+/.test(Re.userAgent)||Re.maxTouchPoints>2);Fe={mac:We||/Mac/.test(Re.platform),windows:/Win/.test(Re.platform),linux:/Linux|X11/.test(Re.platform),ie:$e,ie_version:Le?Te.documentMode||6:Ne?+Ne[1]:Be?+Be[1]:0,gecko:je,gecko_version:je?+(/Firefox\/(\d+)/.exec(Re.userAgent)||[0,0])[1]:0,chrome:!!ze,chrome_version:ze?+ze[1]:0,ios:We,android:/Android\b/.test(Re.userAgent),webkit:Pe,safari:He,webkit_version:Pe?+(/\bAppleWebKit\/(\d+)/.exec(Re.userAgent)||[0,0])[1]:0,tabSize:null!=Te.documentElement.style.tabSize?"tab-size":"-moz-tab-size"};Ve=/*#__PURE__*/function(_Ce){function Ve(t){var _this8;_classCallCheck(this,Ve);_this8=_callSuper(this,Ve),_this8.text=t;return _this8;}_inherits(Ve,_Ce);return _createClass(Ve,[{key:"length",get:function get(){return this.text.length;}},{key:"createDOM",value:function createDOM(t){this.setDOM(t||document.createTextNode(this.text));}},{key:"sync",value:function sync(t,e){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(e&&e.node==this.dom&&(e.written=!0),this.dom.nodeValue=this.text);}},{key:"reuseDOM",value:function reuseDOM(t){3==t.nodeType&&this.createDOM(t);}},{key:"merge",value:function merge(t,e,i){return!(8&this.flags||i&&(!(i instanceof Ve)||this.length-(e-t)+i.length>256||8&i.flags))&&(this.text=this.text.slice(0,t)+(i?i.text:"")+this.text.slice(e),this.markDirty(),!0);}},{key:"split",value:function split(t){var e=new Ve(this.text.slice(t));return this.text=this.text.slice(0,t),this.markDirty(),e.flags|=8&this.flags,e;}},{key:"localPosFromDOM",value:function localPosFromDOM(t,e){return t==this.dom?e:e?this.text.length:0;}},{key:"domAtPos",value:function domAtPos(t){return new Se(this.dom,t);}},{key:"domBoundsAround",value:function domBoundsAround(t,e,i){return{from:i,to:i+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling};}},{key:"coordsAt",value:function coordsAt(t,e){return function(t,e,i){var s=t.nodeValue.length;e>s&&(e=s);var r=e,n=e,h=0;0==e&&i<0||e==s&&i>=0?Fe.chrome||Fe.gecko||(e?(r--,h=1):n<s&&(n++,h=-1)):i<0?r--:n<s&&n++;var l=be(t,r,n).getClientRects();if(!l.length)return null;var o=l[(h?h<0:i>=0)?0:l.length-1];Fe.safari&&!h&&0==o.width&&(o=Array.prototype.find.call(l,function(t){return t.width;})||o);return h?ae(o,h<0):o||null;}(this.dom,t,e);}}]);}(Ce);qe=/*#__PURE__*/function(_Ce2){function qe(t){var _this9;var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[];var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;_classCallCheck(this,qe);_this9=_callSuper(this,qe),_this9.mark=t,_this9.children=e,_this9.length=i;var _iterator38=_createForOfIteratorHelper(e),_step38;try{for(_iterator38.s();!(_step38=_iterator38.n()).done;){var _t44=_step38.value;_t44.setParent(_this9);}}catch(err){_iterator38.e(err);}finally{_iterator38.f();}return _this9;}_inherits(qe,_Ce2);return _createClass(qe,[{key:"setAttrs",value:function setAttrs(t){if(ke(t),this.mark["class"]&&(t.className=this.mark["class"]),this.mark.attrs)for(var _e52 in this.mark.attrs)t.setAttribute(_e52,this.mark.attrs[_e52]);return t;}},{key:"canReuseDOM",value:function canReuseDOM(t){return _superPropGet(qe,"canReuseDOM",this,3)([t])&&!(8&(this.flags|t.flags));}},{key:"reuseDOM",value:function reuseDOM(t){t.nodeName==this.mark.tagName.toUpperCase()&&(this.setDOM(t),this.flags|=6);}},{key:"sync",value:function sync(t,e){this.dom?4&this.flags&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),_superPropGet(qe,"sync",this,3)([t,e]);}},{key:"merge",value:function merge(t,e,i,s,r,n){return(!i||!(!(i instanceof qe&&i.mark.eq(this.mark))||t&&r<=0||e<this.length&&n<=0))&&(Ie(this,t,e,i?i.children.slice():[],r-1,n-1),this.markDirty(),!0);}},{key:"split",value:function split(t){var e=[],i=0,s=-1,r=0;var _iterator39=_createForOfIteratorHelper(this.children),_step39;try{for(_iterator39.s();!(_step39=_iterator39.n()).done;){var _n34=_step39.value;var _h22=i+_n34.length;_h22>t&&e.push(i<t?_n34.split(t-i):_n34),s<0&&i>=t&&(s=r),i=_h22,r++;}}catch(err){_iterator39.e(err);}finally{_iterator39.f();}var n=this.length-t;return this.length=t,s>-1&&(this.children.length=s,this.markDirty()),new qe(this.mark,e,n);}},{key:"domAtPos",value:function domAtPos(t){return Ge(this,t);}},{key:"coordsAt",value:function coordsAt(t,e){return _e(this,t,e);}}]);}(Ce);Je=/*#__PURE__*/function(_Ce3){function Je(t,e,i){var _this10;_classCallCheck(this,Je);_this10=_callSuper(this,Je),_this10.widget=t,_this10.length=e,_this10.side=i,_this10.prevWidget=null;return _this10;}_inherits(Je,_Ce3);return _createClass(Je,[{key:"split",value:function split(t){var e=Je.create(this.widget,this.length-t,this.side);return this.length-=t,e;}},{key:"sync",value:function sync(t){this.dom&&this.widget.updateDOM(this.dom,t)||(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(t)),this.widget.editable||(this.dom.contentEditable="false"));}},{key:"getSide",value:function getSide(){return this.side;}},{key:"merge",value:function merge(t,e,i,s,r,n){return!(i&&(!(i instanceof Je&&this.widget.compare(i.widget))||t>0&&r<=0||e<this.length&&n<=0))&&(this.length=t+(i?i.length:0)+(this.length-e),!0);}},{key:"become",value:function become(t){return t instanceof Je&&t.side==this.side&&this.widget.constructor==t.widget.constructor&&(this.widget.compare(t.widget)||this.markDirty(!0),this.dom&&!this.prevWidget&&(this.prevWidget=this.widget),this.widget=t.widget,this.length=t.length,!0);}},{key:"ignoreMutation",value:function ignoreMutation(){return!0;}},{key:"ignoreEvent",value:function ignoreEvent(t){return this.widget.ignoreEvent(t);}},{key:"overrideDOMText",get:function get(){if(0==this.length)return p.empty;var t=this;for(;t.parent;)t=t.parent;var _t45=t,e=_t45.view,i=e&&e.state.doc,s=this.posAtStart;return i?i.slice(s,s+this.length):p.empty;}},{key:"domAtPos",value:function domAtPos(t){return(this.length?0==t:this.side>0)?Se.before(this.dom):Se.after(this.dom,t==this.length);}},{key:"domBoundsAround",value:function domBoundsAround(){return null;}},{key:"coordsAt",value:function coordsAt(t,e){var i=this.widget.coordsAt(this.dom,t,e);if(i)return i;var s=this.dom.getClientRects(),r=null;if(!s.length)return null;var n=this.side?this.side<0:t>0;for(var _e53=n?s.length-1:0;r=s[_e53],!(t>0?0==_e53:_e53==s.length-1||r.top<r.bottom);_e53+=n?-1:1);return ae(r,!n);}},{key:"isEditable",get:function get(){return!1;}},{key:"isWidget",get:function get(){return!0;}},{key:"isHidden",get:function get(){return this.widget.isHidden;}},{key:"destroy",value:function destroy(){_superPropGet(Je,"destroy",this,3)([]),this.dom&&this.widget.destroy(this.dom);}}],[{key:"create",value:function create(t,e,i){return new Je(t,e,i);}}]);}(Ce);Ue=/*#__PURE__*/function(_Ce4){function Ue(t){var _this11;_classCallCheck(this,Ue);_this11=_callSuper(this,Ue),_this11.side=t;return _this11;}_inherits(Ue,_Ce4);return _createClass(Ue,[{key:"length",get:function get(){return 0;}},{key:"merge",value:function merge(){return!1;}},{key:"become",value:function become(t){return t instanceof Ue&&t.side==this.side;}},{key:"split",value:function split(){return new Ue(this.side);}},{key:"sync",value:function sync(){if(!this.dom){var _t46=document.createElement("img");_t46.className="cm-widgetBuffer",_t46.setAttribute("aria-hidden","true"),this.setDOM(_t46);}}},{key:"getSide",value:function getSide(){return this.side;}},{key:"domAtPos",value:function domAtPos(t){return this.side>0?Se.before(this.dom):Se.after(this.dom);}},{key:"localPosFromDOM",value:function localPosFromDOM(){return 0;}},{key:"domBoundsAround",value:function domBoundsAround(){return null;}},{key:"coordsAt",value:function coordsAt(t){return this.dom.getBoundingClientRect();}},{key:"overrideDOMText",get:function get(){return p.empty;}},{key:"isHidden",get:function get(){return!0;}}]);}(Ce);Ve.prototype.children=Je.prototype.children=Ue.prototype.children=Ae;Ye=Object.create(null);ei=/*#__PURE__*/function(){function ei(){_classCallCheck(this,ei);}return _createClass(ei,[{key:"eq",value:function eq(t){return!1;}},{key:"updateDOM",value:function updateDOM(t,e){return!1;}},{key:"compare",value:function compare(t){return this==t||this.constructor==t.constructor&&this.eq(t);}},{key:"estimatedHeight",get:function get(){return-1;}},{key:"lineBreaks",get:function get(){return 0;}},{key:"ignoreEvent",value:function ignoreEvent(t){return!0;}},{key:"coordsAt",value:function coordsAt(t,e,i){return null;}},{key:"isHidden",get:function get(){return!1;}},{key:"editable",get:function get(){return!1;}},{key:"destroy",value:function destroy(t){}}]);}();ii=function(t){return t[t.Text=0]="Text",t[t.WidgetBefore=1]="WidgetBefore",t[t.WidgetAfter=2]="WidgetAfter",t[t.WidgetRange=3]="WidgetRange",t;}(ii||(ii={}));si=/*#__PURE__*/function(_Tt){function si(t,e,i,s){var _this12;_classCallCheck(this,si);_this12=_callSuper(this,si),_this12.startSide=t,_this12.endSide=e,_this12.widget=i,_this12.spec=s;return _this12;}_inherits(si,_Tt);return _createClass(si,[{key:"heightRelevant",get:function get(){return!1;}},{key:"hasHeight",value:function hasHeight(){return!!this.widget&&this.widget.estimatedHeight>-1;}}],[{key:"mark",value:function mark(t){return new ri(t);}},{key:"widget",value:function widget(t){var e=Math.max(-1e4,Math.min(1e4,t.side||0)),i=!!t.block;return e+=i&&!t.inlineOrder?e>0?3e8:-4e8:e>0?1e8:-1e8,new hi(t,e,e,i,t.widget||null,!1);}},{key:"replace",value:function replace(t){var e,i,s=!!t.block;if(t.isBlockGap)e=-5e8,i=4e8;else{var _li=li(t,s),_r47=_li.start,_n37=_li.end;e=(_r47?s?-3e8:-1:5e8)-1,i=1+(_n37?s?2e8:1:-6e8);}return new hi(t,e,i,s,t.widget||null,!0);}},{key:"line",value:function line(t){return new ni(t);}},{key:"set",value:function set(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!1;return $t.of(t,e);}}]);}(Tt);si.none=$t.empty;ri=/*#__PURE__*/function(_si){function ri(t){var _this13;_classCallCheck(this,ri);var _li2=li(t),e=_li2.start,i=_li2.end;_this13=_callSuper(this,ri,[e?-1:5e8,i?1:-6e8,null,t]),_this13.tagName=t.tagName||"span",_this13["class"]=t["class"]||"",_this13.attrs=t.attributes||null;return _this13;}_inherits(ri,_si);return _createClass(ri,[{key:"eq",value:function eq(t){var e,i;return this==t||t instanceof ri&&this.tagName==t.tagName&&(this["class"]||(null===(e=this.attrs)||void 0===e?void 0:e["class"]))==(t["class"]||(null===(i=t.attrs)||void 0===i?void 0:i["class"]))&&Qe(this.attrs,t.attrs,"class");}},{key:"range",value:function range(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:t;if(t>=e)throw new RangeError("Mark decorations may not be empty");return _superPropGet(ri,"range",this,3)([t,e]);}}]);}(si);ri.prototype.point=!1;ni=/*#__PURE__*/function(_si2){function ni(t){_classCallCheck(this,ni);return _callSuper(this,ni,[-2e8,-2e8,null,t]);}_inherits(ni,_si2);return _createClass(ni,[{key:"eq",value:function eq(t){return t instanceof ni&&this.spec["class"]==t.spec["class"]&&Qe(this.spec.attributes,t.spec.attributes);}},{key:"range",value:function range(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:t;if(e!=t)throw new RangeError("Line decoration ranges must be zero-length");return _superPropGet(ni,"range",this,3)([t,e]);}}]);}(si);ni.prototype.mapMode=E.TrackBefore,ni.prototype.point=!0;hi=/*#__PURE__*/function(_si3){function hi(t,e,i,s,r,n){var _this14;_classCallCheck(this,hi);_this14=_callSuper(this,hi,[e,i,r,t]),_this14.block=s,_this14.isReplace=n,_this14.mapMode=s?e<=0?E.TrackBefore:E.TrackAfter:E.TrackDel;return _this14;}_inherits(hi,_si3);return _createClass(hi,[{key:"type",get:function get(){return this.startSide!=this.endSide?ii.WidgetRange:this.startSide<=0?ii.WidgetBefore:ii.WidgetAfter;}},{key:"heightRelevant",get:function get(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0);}},{key:"eq",value:function eq(t){return t instanceof hi&&(e=this.widget,i=t.widget,e==i||!!(e&&i&&e.compare(i)))&&this.block==t.block&&this.startSide==t.startSide&&this.endSide==t.endSide;var e,i;}},{key:"range",value:function range(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:t;if(this.isReplace&&(t>e||t==e&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&e!=t)throw new RangeError("Widget decorations can only have zero-length ranges");return _superPropGet(hi,"range",this,3)([t,e]);}}]);}(si);hi.prototype.point=!0;ui=/*#__PURE__*/function(_Ce5){function ui(){var _this15;_classCallCheck(this,ui);_this15=_callSuper(this,ui,arguments),_this15.children=[],_this15.length=0,_this15.prevAttrs=void 0,_this15.attrs=null,_this15.breakAfter=0;return _this15;}_inherits(ui,_Ce5);return _createClass(ui,[{key:"merge",value:function merge(t,e,i,s,r,n){if(i){if(!(i instanceof ui))return!1;this.dom||i.transferDOM(this);}return s&&this.setDeco(i?i.attrs:null),Ie(this,t,e,i?i.children.slice():[],r,n),!0;}},{key:"split",value:function split(t){var e=new ui();if(e.breakAfter=this.breakAfter,0==this.length)return e;var _this$childPos=this.childPos(t),i=_this$childPos.i,s=_this$childPos.off;s&&(e.append(this.children[i].split(s),0),this.children[i].merge(s,this.children[i].length,null,!1,0,0),i++);for(var _t50=i;_t50<this.children.length;_t50++)e.append(this.children[_t50],0);for(;i>0&&0==this.children[i-1].length;)this.children[--i].destroy();return this.children.length=i,this.markDirty(),this.length=t,e;}},{key:"transferDOM",value:function transferDOM(t){this.dom&&(this.markDirty(),t.setDOM(this.dom),t.prevAttrs=void 0===this.prevAttrs?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null);}},{key:"setDeco",value:function setDeco(t){Qe(this.attrs,t)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=t);}},{key:"append",value:function append(t,e){Ke(this,t,e);}},{key:"addLineDeco",value:function addLineDeco(t){var e=t.spec.attributes,i=t.spec["class"];e&&(this.attrs=Xe(e,this.attrs||{})),i&&(this.attrs=Xe({"class":i},this.attrs||{}));}},{key:"domAtPos",value:function domAtPos(t){return Ge(this,t);}},{key:"reuseDOM",value:function reuseDOM(t){"DIV"==t.nodeName&&(this.setDOM(t),this.flags|=6);}},{key:"sync",value:function sync(t,e){var i;this.dom?4&this.flags&&(ke(this.dom),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0):(this.setDOM(document.createElement("div")),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0),void 0!==this.prevAttrs&&(Ze(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),_superPropGet(ui,"sync",this,3)([t,e]);var s=this.dom.lastChild;for(;s&&Ce.get(s)instanceof qe;)s=s.lastChild;if(!(s&&this.length&&("BR"==s.nodeName||0!=(null===(i=Ce.get(s))||void 0===i?void 0:i.isEditable)||Fe.ios&&this.children.some(function(t){return t instanceof Ve;})))){var _t51=document.createElement("BR");_t51.cmIgnore=!0,this.dom.appendChild(_t51);}}},{key:"measureTextSize",value:function measureTextSize(){if(0==this.children.length||this.length>20)return null;var t,e=0;var _iterator40=_createForOfIteratorHelper(this.children),_step40;try{for(_iterator40.s();!(_step40=_iterator40.n()).done;){var _i59=_step40.value;if(!(_i59 instanceof Ve)||/[^ -~]/.test(_i59.text))return null;var _s46=ne(_i59.dom);if(1!=_s46.length)return null;e+=_s46[0].width,t=_s46[0].height;}}catch(err){_iterator40.e(err);}finally{_iterator40.f();}return e?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:e/this.length,textHeight:t}:null;}},{key:"coordsAt",value:function coordsAt(t,e){var i=_e(this,t,e);if(!this.children.length&&i&&this.parent){var _t52=this.parent.view.viewState.heightOracle,_e56=i.bottom-i.top;if(Math.abs(_e56-_t52.lineHeight)<2&&_t52.textHeight<_e56){var _s47=(_e56-_t52.textHeight)/2;return{top:i.top+_s47,bottom:i.bottom-_s47,left:i.left,right:i.left};}}return i;}},{key:"become",value:function become(t){return t instanceof ui&&0==this.children.length&&0==t.children.length&&Qe(this.attrs,t.attrs)&&this.breakAfter==t.breakAfter;}},{key:"covers",value:function covers(){return!0;}}],[{key:"find",value:function find(t,e){for(var _i60=0,_s48=0;_i60<t.children.length;_i60++){var _r48=t.children[_i60],_n38=_s48+_r48.length;if(_n38>=e){if(_r48 instanceof ui)return _r48;if(_n38>e)break;}_s48=_n38+_r48.breakAfter;}return null;}}]);}(Ce);fi=/*#__PURE__*/function(_Ce6){function fi(t,e,i){var _this16;_classCallCheck(this,fi);_this16=_callSuper(this,fi),_this16.widget=t,_this16.length=e,_this16.deco=i,_this16.breakAfter=0,_this16.prevWidget=null;return _this16;}_inherits(fi,_Ce6);return _createClass(fi,[{key:"merge",value:function merge(t,e,i,s,r,n){return!(i&&(!(i instanceof fi&&this.widget.compare(i.widget))||t>0&&r<=0||e<this.length&&n<=0))&&(this.length=t+(i?i.length:0)+(this.length-e),!0);}},{key:"domAtPos",value:function domAtPos(t){return 0==t?Se.before(this.dom):Se.after(this.dom,t==this.length);}},{key:"split",value:function split(t){var e=this.length-t;this.length=t;var i=new fi(this.widget,e,this.deco);return i.breakAfter=this.breakAfter,i;}},{key:"children",get:function get(){return Ae;}},{key:"sync",value:function sync(t){this.dom&&this.widget.updateDOM(this.dom,t)||(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(t)),this.widget.editable||(this.dom.contentEditable="false"));}},{key:"overrideDOMText",get:function get(){return this.parent?this.parent.view.state.doc.slice(this.posAtStart,this.posAtEnd):p.empty;}},{key:"domBoundsAround",value:function domBoundsAround(){return null;}},{key:"become",value:function become(t){return t instanceof fi&&t.widget.constructor==this.widget.constructor&&(t.widget.compare(this.widget)||this.markDirty(!0),this.dom&&!this.prevWidget&&(this.prevWidget=this.widget),this.widget=t.widget,this.length=t.length,this.deco=t.deco,this.breakAfter=t.breakAfter,!0);}},{key:"ignoreMutation",value:function ignoreMutation(){return!0;}},{key:"ignoreEvent",value:function ignoreEvent(t){return this.widget.ignoreEvent(t);}},{key:"isEditable",get:function get(){return!1;}},{key:"isWidget",get:function get(){return!0;}},{key:"coordsAt",value:function coordsAt(t,e){var i=this.widget.coordsAt(this.dom,t,e);return i||(this.widget instanceof ai?null:ae(this.dom.getBoundingClientRect(),this.length?0==t:e<=0));}},{key:"destroy",value:function destroy(){_superPropGet(fi,"destroy",this,3)([]),this.dom&&this.widget.destroy(this.dom);}},{key:"covers",value:function covers(t){var _this$deco=this.deco,e=_this$deco.startSide,i=_this$deco.endSide;return e!=i&&(t<0?e<0:i>0);}}]);}(Ce);ai=/*#__PURE__*/function(_ei){function ai(t){var _this17;_classCallCheck(this,ai);_this17=_callSuper(this,ai),_this17.height=t;return _this17;}_inherits(ai,_ei);return _createClass(ai,[{key:"toDOM",value:function toDOM(){var t=document.createElement("div");return t.className="cm-gap",this.updateDOM(t),t;}},{key:"eq",value:function eq(t){return t.height==this.height;}},{key:"updateDOM",value:function updateDOM(t){return t.style.height=this.height+"px",!0;}},{key:"editable",get:function get(){return!0;}},{key:"estimatedHeight",get:function get(){return this.height;}},{key:"ignoreEvent",value:function ignoreEvent(){return!1;}}]);}(ei);ci=/*#__PURE__*/function(){function ci(t,e,i,s){_classCallCheck(this,ci);this.doc=t,this.pos=e,this.end=i,this.disallowBlockEffectsFor=s,this.content=[],this.curLine=null,this.breakAtStart=0,this.pendingBuffer=0,this.bufferMarks=[],this.atCursorPos=!0,this.openStart=-1,this.openEnd=-1,this.text="",this.textOff=0,this.cursor=t.iter(),this.skip=e;}return _createClass(ci,[{key:"posCovered",value:function posCovered(){if(0==this.content.length)return!this.breakAtStart&&this.doc.lineAt(this.pos).from!=this.pos;var t=this.content[this.content.length-1];return!(t.breakAfter||t instanceof fi&&t.deco.endSide<0);}},{key:"getLine",value:function getLine(){return this.curLine||(this.content.push(this.curLine=new ui()),this.atCursorPos=!0),this.curLine;}},{key:"flushBuffer",value:function flushBuffer(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:this.bufferMarks;this.pendingBuffer&&(this.curLine.append(di(new Ue(-1),t),t.length),this.pendingBuffer=0);}},{key:"addBlockWidget",value:function addBlockWidget(t){this.flushBuffer(),this.curLine=null,this.content.push(t);}},{key:"finish",value:function finish(t){this.pendingBuffer&&t<=this.bufferMarks.length?this.flushBuffer():this.pendingBuffer=0,this.posCovered()||t&&this.content.length&&this.content[this.content.length-1]instanceof fi||this.getLine();}},{key:"buildText",value:function buildText(t,e,i){for(;t>0;){if(this.textOff==this.text.length){var _this$cursor$next2=this.cursor.next(this.skip),_e57=_this$cursor$next2.value,_i61=_this$cursor$next2.lineBreak,_s49=_this$cursor$next2.done;if(this.skip=0,_s49)throw new Error("Ran out of text content when drawing inline views");if(_i61){this.posCovered()||this.getLine(),this.content.length?this.content[this.content.length-1].breakAfter=1:this.breakAtStart=1,this.flushBuffer(),this.curLine=null,this.atCursorPos=!0,t--;continue;}this.text=_e57,this.textOff=0;}var _s50=Math.min(this.text.length-this.textOff,t,512);this.flushBuffer(e.slice(e.length-i)),this.getLine().append(di(new Ve(this.text.slice(this.textOff,this.textOff+_s50)),e),i),this.atCursorPos=!0,this.textOff+=_s50,t-=_s50,i=0;}}},{key:"span",value:function span(t,e,i,s){this.buildText(e-t,i,s),this.pos=e,this.openStart<0&&(this.openStart=s);}},{key:"point",value:function point(t,e,i,s,r,n){if(this.disallowBlockEffectsFor[n]&&i instanceof hi){if(i.block)throw new RangeError("Block decorations may not be specified via plugins");if(e>this.doc.lineAt(this.pos).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins");}var h=e-t;if(i instanceof hi){if(i.block)i.startSide>0&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new fi(i.widget||pi.block,h,i));else{var _n39=Je.create(i.widget||pi.inline,h,h?0:i.startSide),_l19=this.atCursorPos&&!_n39.isEditable&&r<=s.length&&(t<e||i.startSide>0),_o12=!_n39.isEditable&&(t<e||r>s.length||i.startSide<=0),_u9=this.getLine();2!=this.pendingBuffer||_l19||_n39.isEditable||(this.pendingBuffer=0),this.flushBuffer(s),_l19&&(_u9.append(di(new Ue(1),s),r),r=s.length+Math.max(0,r-s.length)),_u9.append(di(_n39,s),r),this.atCursorPos=_o12,this.pendingBuffer=_o12?t<e||r>s.length?1:2:0,this.pendingBuffer&&(this.bufferMarks=s.slice());}}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(i);h&&(this.textOff+h<=this.text.length?this.textOff+=h:(this.skip+=h-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=e),this.openStart<0&&(this.openStart=r);}}],[{key:"build",value:function build(t,e,i,s,r){var n=new ci(t,e,i,r);return n.openEnd=$t.spans(s,e,i,n),n.openStart<0&&(n.openStart=n.openEnd),n.finish(n.openEnd),n;}}]);}();pi=/*#__PURE__*/function(_ei2){function pi(t){var _this18;_classCallCheck(this,pi);_this18=_callSuper(this,pi),_this18.tag=t;return _this18;}_inherits(pi,_ei2);return _createClass(pi,[{key:"eq",value:function eq(t){return t.tag==this.tag;}},{key:"toDOM",value:function toDOM(){return document.createElement(this.tag);}},{key:"updateDOM",value:function updateDOM(t){return t.nodeName.toLowerCase()==this.tag;}},{key:"isHidden",get:function get(){return!0;}}]);}(ei);pi.inline=new pi("span"),pi.block=new pi("div");mi=function(t){return t[t.LTR=0]="LTR",t[t.RTL=1]="RTL",t;}(mi||(mi={}));gi=mi.LTR,wi=mi.RTL;vi=bi("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),ki=bi("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),yi=Object.create(null),Mi=[];for(_i64=0,_arr=["()","[]","{}"];_i64<_arr.length;_i64++){_t53=_arr[_i64];_e58=_t53.charCodeAt(0),_i65=_t53.charCodeAt(1);yi[_e58]=_i65,yi[_i65]=-_e58;}Si=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;Ai=/*#__PURE__*/function(){function Ai(t,e,i){_classCallCheck(this,Ai);this.from=t,this.to=e,this.level=i;}return _createClass(Ai,[{key:"dir",get:function get(){return this.level%2?wi:gi;}},{key:"side",value:function side(t,e){return this.dir==e==t?this.to:this.from;}},{key:"forward",value:function forward(t,e){return t==(this.dir==e);}}],[{key:"find",value:function find(t,e,i,s){var r=-1;for(var _n40=0;_n40<t.length;_n40++){var _h24=t[_n40];if(_h24.from<=e&&_h24.to>=e){if(_h24.level==i)return _n40;(r<0||(0!=s?s<0?_h24.from<e:_h24.to>e:t[r].level>_h24.level))&&(r=_n40);}}if(r<0)throw new RangeError("Index out of range");return r;}}]);}();Oi=[];Ri="";Li=F.define(),Ni=F.define(),$i=F.define(),ji=F.define(),zi=F.define(),Pi=F.define(),Hi=F.define(),Wi=F.define(),Fi=F.define(),Vi=F.define({combine:function combine(t){return t.some(function(t){return t;});}}),qi=F.define({combine:function combine(t){return t.some(function(t){return t;});}}),Ji=F.define();Ui=/*#__PURE__*/function(){function Ui(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:"nearest";var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:"nearest";var s=arguments.length>3&&arguments[3]!==undefined?arguments[3]:5;var r=arguments.length>4&&arguments[4]!==undefined?arguments[4]:5;var n=arguments.length>5&&arguments[5]!==undefined?arguments[5]:!1;_classCallCheck(this,Ui);this.range=t,this.y=e,this.x=i,this.yMargin=s,this.xMargin=r,this.isSnapshot=n;}return _createClass(Ui,[{key:"map",value:function map(t){return t.empty?this:new Ui(this.range.map(t),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot);}},{key:"clip",value:function clip(t){return this.range.to<=t.doc.length?this:new Ui(P.cursor(t.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot);}}]);}();Gi=bt.define({map:function map(t,e){return t.map(e);}}),Ki=bt.define();Xi=F.define({combine:function combine(t){return!t.length||t[0];}});Yi=0;Qi=F.define();Zi=/*#__PURE__*/function(){function Zi(t,e,i,s,r){_classCallCheck(this,Zi);this.id=t,this.create=e,this.domEventHandlers=i,this.domEventObservers=s,this.extension=r(this);}return _createClass(Zi,null,[{key:"define",value:function define(t,e){var _ref4=e||{},i=_ref4.eventHandlers,s=_ref4.eventObservers,r=_ref4.provide,n=_ref4.decorations;return new Zi(Yi++,t,i,s,function(t){var e=[Qi.of(t)];return n&&e.push(ss.of(function(e){var i=e.plugin(t);return i?n(i):si.none;})),r&&e.push(r(t)),e;});}},{key:"fromClass",value:function fromClass(t,e){return Zi.define(function(e){return new t(e);},e);}}]);}();ts=/*#__PURE__*/function(){function ts(t){_classCallCheck(this,ts);this.spec=t,this.mustUpdate=null,this.value=null;}return _createClass(ts,[{key:"update",value:function update(t){if(this.value){if(this.mustUpdate){var _t62=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(_t62);}catch(e){if(_i(_t62.state,e,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy();}catch(t){}this.deactivate();}}}else if(this.spec)try{this.value=this.spec.create(t);}catch(e){_i(t.state,e,"CodeMirror plugin crashed"),this.deactivate();}return this;}},{key:"destroy",value:function destroy(t){var e;if(null===(e=this.value)||void 0===e?void 0:e.destroy)try{this.value.destroy();}catch(e){_i(t.state,e,"CodeMirror plugin crashed");}}},{key:"deactivate",value:function deactivate(){this.spec=this.value=null;}}]);}();es=F.define(),is=F.define(),ss=F.define(),rs=F.define(),ns=F.define(),hs=F.define();os=F.define();fs=F.define();as=/*#__PURE__*/function(){function as(t,e,i,s){_classCallCheck(this,as);this.fromA=t,this.toA=e,this.fromB=i,this.toB=s;}return _createClass(as,[{key:"join",value:function join(t){return new as(Math.min(this.fromA,t.fromA),Math.max(this.toA,t.toA),Math.min(this.fromB,t.fromB),Math.max(this.toB,t.toB));}},{key:"addToSet",value:function addToSet(t){var e=t.length,i=this;for(;e>0;e--){var _s57=t[e-1];if(!(_s57.fromA>i.toA)){if(_s57.toA<i.fromA)break;i=i.join(_s57),t.splice(e-1,1);}}return t.splice(e,0,i),t;}}],[{key:"extendWithRanges",value:function extendWithRanges(t,e){if(0==e.length)return t;var i=[];for(var _s58=0,_r55=0,_n46=0,_h32=0;;_s58++){var _l23=_s58==t.length?null:t[_s58],_o18=_n46-_h32,_u14=_l23?_l23.fromB:1e9;for(;_r55<e.length&&e[_r55]<_u14;){var _t65=e[_r55],_s59=e[_r55+1],_n47=Math.max(_h32,_t65),_l24=Math.min(_u14,_s59);if(_n47<=_l24&&new as(_n47+_o18,_l24+_o18,_n47,_l24).addToSet(i),_s59>_u14)break;_r55+=2;}if(!_l23)return i;new as(_l23.fromA,_l23.toA,_l23.fromB,_l23.toB).addToSet(i),_n46=_l23.toA,_h32=_l23.toB;}}}]);}();cs=/*#__PURE__*/function(){function cs(t,e,i){_classCallCheck(this,cs);this.view=t,this.state=e,this.transactions=i,this.flags=0,this.startState=t.state,this.changes=R.empty(this.startState.doc.length);var _iterator43=_createForOfIteratorHelper(i),_step43;try{for(_iterator43.s();!(_step43=_iterator43.n()).done;){var _t66=_step43.value;this.changes=this.changes.compose(_t66.changes);}}catch(err){_iterator43.e(err);}finally{_iterator43.f();}var s=[];this.changes.iterChangedRanges(function(t,e,i,r){return s.push(new as(t,e,i,r));}),this.changedRanges=s;}return _createClass(cs,[{key:"viewportChanged",get:function get(){return(4&this.flags)>0;}},{key:"viewportMoved",get:function get(){return(8&this.flags)>0;}},{key:"heightChanged",get:function get(){return(2&this.flags)>0;}},{key:"geometryChanged",get:function get(){return this.docChanged||(18&this.flags)>0;}},{key:"focusChanged",get:function get(){return(1&this.flags)>0;}},{key:"docChanged",get:function get(){return!this.changes.empty;}},{key:"selectionSet",get:function get(){return this.transactions.some(function(t){return t.selection;});}},{key:"empty",get:function get(){return 0==this.flags&&0==this.transactions.length;}}],[{key:"create",value:function create(t,e,i){return new cs(t,e,i);}}]);}();ds=/*#__PURE__*/function(_Ce7){function ds(t){var _this19;_classCallCheck(this,ds);_this19=_callSuper(this,ds),_this19.view=t,_this19.decorations=[],_this19.dynamicDecorationMap=[!1],_this19.domChanged=null,_this19.hasComposition=null,_this19.markedForComposition=new Set(),_this19.editContextFormatting=si.none,_this19.lastCompositionAfterCursor=!1,_this19.minWidth=0,_this19.minWidthFrom=0,_this19.minWidthTo=0,_this19.impreciseAnchor=null,_this19.impreciseHead=null,_this19.forceSelection=!1,_this19.lastUpdate=Date.now(),_this19.setDOM(t.contentDOM),_this19.children=[new ui()],_this19.children[0].setParent(_assertThisInitialized(_this19)),_this19.updateDeco(),_this19.updateInner([new as(0,0,0,t.state.doc.length)],0,null);return _this19;}_inherits(ds,_Ce7);return _createClass(ds,[{key:"length",get:function get(){return this.view.state.doc.length;}},{key:"update",value:function update(t){var _this20=this;var e;var i=t.changedRanges;this.minWidth>0&&i.length&&(i.every(function(_ref5){var t=_ref5.fromA,e=_ref5.toA;return e<_this20.minWidthFrom||t>_this20.minWidthTo;})?(this.minWidthFrom=t.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=t.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(t);var s=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&((null===(e=this.domChanged)||void 0===e?void 0:e.newSel)?s=this.domChanged.newSel.head:function(t,e){var i=!1;e&&t.iterChangedRanges(function(t,s){t<e.to&&s>e.from&&(i=!0);});return i;}(t.changes,this.hasComposition)||t.selectionSet||(s=t.state.selection.main.head));var r=s>-1?function(t,e,i){var s=ps(t,i);if(!s)return null;var r=s.node,n=s.from,h=s.to,l=r.nodeValue;if(/[\n\r]/.test(l))return null;if(t.state.doc.sliceString(s.from,s.to)!=l)return null;var o=e.invertedDesc,u=new as(o.mapPos(n),o.mapPos(h),n,h),f=[];for(var _e69=r.parentNode;;_e69=_e69.parentNode){var _i74=Ce.get(_e69);if(_i74 instanceof qe)f.push({node:_e69,deco:_i74.mark});else{if(_i74 instanceof ui||"DIV"==_e69.nodeName&&_e69.parentNode==t.contentDOM)return{range:u,text:r,marks:f,line:_e69};if(_e69==t.contentDOM)return null;f.push({node:_e69,deco:new ri({inclusive:!0,attributes:ti(_e69),tagName:_e69.tagName.toLowerCase()})});}}}(this.view,t.changes,s):null;if(this.domChanged=null,this.hasComposition){this.markedForComposition.clear();var _this$hasComposition=this.hasComposition,_e70=_this$hasComposition.from,_s60=_this$hasComposition.to;i=new as(_e70,_s60,t.changes.mapPos(_e70,-1),t.changes.mapPos(_s60,1)).addToSet(i.slice());}this.hasComposition=r?{from:r.range.fromB,to:r.range.toB}:null,(Fe.ie||Fe.chrome)&&!r&&t&&t.state.doc.lines!=t.startState.doc.lines&&(this.forceSelection=!0);var n=function(t,e,i){var s=new ms();return $t.compare(t,e,i,s),s.changes;}(this.decorations,this.updateDeco(),t.changes);return i=as.extendWithRanges(i,n),!!(7&this.flags||0!=i.length)&&(this.updateInner(i,t.startState.doc.length,r),t.transactions.length&&(this.lastUpdate=Date.now()),!0);}},{key:"updateInner",value:function updateInner(t,e,i){var _this21=this;this.view.viewState.mustMeasureContent=!0,this.updateChildren(t,e,i);var s=this.view.observer;s.ignore(function(){_this21.dom.style.height=_this21.view.viewState.contentHeight/_this21.view.scaleY+"px",_this21.dom.style.flexBasis=_this21.minWidth?_this21.minWidth+"px":"";var t=Fe.chrome||Fe.ios?{node:s.selectionRange.focusNode,written:!1}:void 0;_this21.sync(_this21.view,t),_this21.flags&=-8,t&&(t.written||s.selectionRange.focusNode!=t.node)&&(_this21.forceSelection=!0),_this21.dom.style.height="";}),this.markedForComposition.forEach(function(t){return t.flags&=-9;});var r=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length){var _iterator44=_createForOfIteratorHelper(this.children),_step44;try{for(_iterator44.s();!(_step44=_iterator44.n()).done;){var _t67=_step44.value;_t67 instanceof fi&&_t67.widget instanceof ai&&r.push(_t67.dom);}}catch(err){_iterator44.e(err);}finally{_iterator44.f();}}s.updateGaps(r);}},{key:"updateChildren",value:function updateChildren(t,e,i){var s=i?i.range.addToSet(t.slice()):t,r=this.childCursor(e);for(var _t68=s.length-1;;_t68--){var _e71=_t68>=0?s[_t68]:null;if(!_e71)break;var _n48=void 0,_h33=void 0,_l25=void 0,_o19=void 0,_u15=_e71.fromA,_f11=_e71.toA,_a8=_e71.fromB,_c5=_e71.toB;if(i&&i.range.fromB<_c5&&i.range.toB>_a8){var _t69=ci.build(this.view.state.doc,_a8,i.range.fromB,this.decorations,this.dynamicDecorationMap),_e72=ci.build(this.view.state.doc,i.range.toB,_c5,this.decorations,this.dynamicDecorationMap);_h33=_t69.breakAtStart,_l25=_t69.openStart,_o19=_e72.openEnd;var _s61=this.compositionView(i);_e72.breakAtStart?_s61.breakAfter=1:_e72.content.length&&_s61.merge(_s61.length,_s61.length,_e72.content[0],!1,_e72.openStart,0)&&(_s61.breakAfter=_e72.content[0].breakAfter,_e72.content.shift()),_t69.content.length&&_s61.merge(0,0,_t69.content[_t69.content.length-1],!0,0,_t69.openEnd)&&_t69.content.pop(),_n48=_t69.content.concat(_s61).concat(_e72.content);}else{var _ci$build=ci.build(this.view.state.doc,_a8,_c5,this.decorations,this.dynamicDecorationMap);_n48=_ci$build.content;_h33=_ci$build.breakAtStart;_l25=_ci$build.openStart;_o19=_ci$build.openEnd;}var _r$findPos=r.findPos(_f11,1),_d4=_r$findPos.i,_p5=_r$findPos.off,_r$findPos2=r.findPos(_u15,-1),_m=_r$findPos2.i,_g=_r$findPos2.off;Ee(this,_m,_g,_d4,_p5,_n48,_h33,_l25,_o19);}i&&this.fixCompositionDOM(i);}},{key:"updateEditContextFormatting",value:function updateEditContextFormatting(t){this.editContextFormatting=this.editContextFormatting.map(t.changes);var _iterator45=_createForOfIteratorHelper(t.transactions),_step45;try{for(_iterator45.s();!(_step45=_iterator45.n()).done;){var _e73=_step45.value;var _iterator46=_createForOfIteratorHelper(_e73.effects),_step46;try{for(_iterator46.s();!(_step46=_iterator46.n()).done;){var _t70=_step46.value;_t70.is(Ki)&&(this.editContextFormatting=_t70.value);}}catch(err){_iterator46.e(err);}finally{_iterator46.f();}}}catch(err){_iterator45.e(err);}finally{_iterator45.f();}}},{key:"compositionView",value:function compositionView(t){var e=new Ve(t.text.nodeValue);e.flags|=8;var _iterator47=_createForOfIteratorHelper(t.marks),_step47;try{for(_iterator47.s();!(_step47=_iterator47.n()).done;){var _i75=_step47.value.deco;e=new qe(_i75,[e],e.length);}}catch(err){_iterator47.e(err);}finally{_iterator47.f();}var i=new ui();return i.append(e,0),i;}},{key:"fixCompositionDOM",value:function fixCompositionDOM(t){var _this22=this;var e=function e(t,_e74){_e74.flags|=8|(_e74.children.some(function(t){return 7&t.flags;})?1:0),_this22.markedForComposition.add(_e74);var i=Ce.get(t);i&&i!=_e74&&(i.dom=null),_e74.setDOM(t);},i=this.childPos(t.range.fromB,1),s=this.children[i.i];e(t.line,s);for(var _r56=t.marks.length-1;_r56>=-1;_r56--)i=s.childPos(i.off,1),s=s.children[i.i],e(_r56>=0?t.marks[_r56].node:t.text,s);}},{key:"updateSelection",value:function updateSelection(){var _this23=this;var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:!1;var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!1;!t&&this.view.observer.selectionRange.focusNode||this.view.observer.readSelectionRange();var i=this.view.root.activeElement,s=i==this.dom,r=!s&&!(this.view.state.facet(Xi)||this.dom.tabIndex>-1)&&re(this.dom,this.view.observer.selectionRange)&&!(i&&this.dom.contains(i));if(!(s||e||r))return;var n=this.forceSelection;this.forceSelection=!1;var h=this.view.state.selection.main,l=this.moveToLine(this.domAtPos(h.anchor)),o=h.empty?l:this.moveToLine(this.domAtPos(h.head));if(Fe.gecko&&h.empty&&!this.hasComposition&&1==(u=l).node.nodeType&&u.node.firstChild&&(0==u.offset||"false"==u.node.childNodes[u.offset-1].contentEditable)&&(u.offset==u.node.childNodes.length||"false"==u.node.childNodes[u.offset].contentEditable)){var _t71=document.createTextNode("");this.view.observer.ignore(function(){return l.node.insertBefore(_t71,l.node.childNodes[l.offset]||null);}),l=o=new Se(_t71,0),n=!0;}var u;var f=this.view.observer.selectionRange;!n&&f.focusNode&&(he(l.node,l.offset,f.anchorNode,f.anchorOffset)&&he(o.node,o.offset,f.focusNode,f.focusOffset)||this.suppressWidgetCursorChange(f,h))||(this.view.observer.ignore(function(){Fe.android&&Fe.chrome&&_this23.dom.contains(f.focusNode)&&function(t,e){for(var _i76=t;_i76&&_i76!=e;_i76=_i76.assignedSlot||_i76.parentNode)if(1==_i76.nodeType&&"false"==_i76.contentEditable)return!0;return!1;}(f.focusNode,_this23.dom)&&(_this23.dom.blur(),_this23.dom.focus({preventScroll:!0}));var t=ie(_this23.view.root);if(t){if(h.empty){if(Fe.gecko){var _t72=(e=l.node,s=l.offset,1!=e.nodeType?0:(s&&"false"==e.childNodes[s-1].contentEditable?1:0)|(s<e.childNodes.length&&"false"==e.childNodes[s].contentEditable?2:0));if(_t72&&3!=_t72){var _e75=(1==_t72?Me:xe)(l.node,l.offset);_e75&&(l=new Se(_e75.node,_e75.offset));}}t.collapse(l.node,l.offset),null!=h.bidiLevel&&void 0!==t.caretBidiLevel&&(t.caretBidiLevel=h.bidiLevel);}else if(t.extend){t.collapse(l.node,l.offset);try{t.extend(o.node,o.offset);}catch(t){}}else{var _ref6;var _e76=document.createRange();h.anchor>h.head&&(_ref6=[o,l],l=_ref6[0],o=_ref6[1],_ref6),_e76.setEnd(o.node,o.offset),_e76.setStart(l.node,l.offset),t.removeAllRanges(),t.addRange(_e76);}}else;var e,s;r&&_this23.view.root.activeElement==_this23.dom&&(_this23.dom.blur(),i&&i.focus());}),this.view.observer.setSelectionRange(l,o)),this.impreciseAnchor=l.precise?null:new Se(f.anchorNode,f.anchorOffset),this.impreciseHead=o.precise?null:new Se(f.focusNode,f.focusOffset);}},{key:"suppressWidgetCursorChange",value:function suppressWidgetCursorChange(t,e){return this.hasComposition&&e.empty&&he(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)&&this.posFromDOM(t.focusNode,t.focusOffset)==e.head;}},{key:"enforceCursorAssoc",value:function enforceCursorAssoc(){if(this.hasComposition)return;var t=this.view,e=t.state.selection.main,i=ie(t.root),_t$observer$selection=t.observer.selectionRange,s=_t$observer$selection.anchorNode,r=_t$observer$selection.anchorOffset;if(!(i&&e.empty&&e.assoc&&i.modify))return;var n=ui.find(this,e.head);if(!n)return;var h=n.posAtStart;if(e.head==h||e.head==h+n.length)return;var l=this.coordsAt(e.head,-1),o=this.coordsAt(e.head,1);if(!l||!o||l.bottom>o.top)return;var u=this.domAtPos(e.head+e.assoc);i.collapse(u.node,u.offset),i.modify("move",e.assoc<0?"forward":"backward","lineboundary"),t.observer.readSelectionRange();var f=t.observer.selectionRange;t.docView.posFromDOM(f.anchorNode,f.anchorOffset)!=e.from&&i.collapse(s,r);}},{key:"moveToLine",value:function moveToLine(t){var e,i=this.dom;if(t.node!=i)return t;for(var _s62=t.offset;!e&&_s62<i.childNodes.length;_s62++){var _t73=Ce.get(i.childNodes[_s62]);_t73 instanceof ui&&(e=_t73.domAtPos(0));}for(var _s63=t.offset-1;!e&&_s63>=0;_s63--){var _t74=Ce.get(i.childNodes[_s63]);_t74 instanceof ui&&(e=_t74.domAtPos(_t74.length));}return e?new Se(e.node,e.offset,!0):t;}},{key:"nearest",value:function nearest(t){for(var _e77=t;_e77;){var _t75=Ce.get(_e77);if(_t75&&_t75.rootView==this)return _t75;_e77=_e77.parentNode;}return null;}},{key:"posFromDOM",value:function posFromDOM(t,e){var i=this.nearest(t);if(!i)throw new RangeError("Trying to find position for a DOM position outside of the document");return i.localPosFromDOM(t,e)+i.posAtStart;}},{key:"domAtPos",value:function domAtPos(t){var _this$childCursor$fin=this.childCursor().findPos(t,-1),e=_this$childCursor$fin.i,i=_this$childCursor$fin.off;for(;e<this.children.length-1;){var _t76=this.children[e];if(i<_t76.length||_t76 instanceof ui)break;e++,i=0;}return this.children[e].domAtPos(i);}},{key:"coordsAt",value:function coordsAt(t,e){var i=null,s=0;for(var _r57=this.length,_n49=this.children.length-1;_n49>=0;_n49--){var _h34=this.children[_n49],_l26=_r57-_h34.breakAfter,_o20=_l26-_h34.length;if(_l26<t)break;if(_o20<=t&&(_o20<t||_h34.covers(-1))&&(_l26>t||_h34.covers(1))&&(!i||_h34 instanceof ui&&!(i instanceof ui&&e>=0)))i=_h34,s=_o20;else if(i&&_o20==t&&_l26==t&&_h34 instanceof fi&&Math.abs(e)<2){if(_h34.deco.startSide<0)break;_n49&&(i=null);}_r57=_o20;}return i?i.coordsAt(t-s,e):null;}},{key:"coordsForChar",value:function coordsForChar(t){var _this$childPos2=this.childPos(t,1),e=_this$childPos2.i,i=_this$childPos2.off,s=this.children[e];if(!(s instanceof ui))return null;for(;s.children.length;){var _s$childPos=s.childPos(i,1),_t77=_s$childPos.i,_e78=_s$childPos.off;for(;;_t77++){if(_t77==s.children.length)return null;if((s=s.children[_t77]).length)break;}i=_e78;}if(!(s instanceof Ve))return null;var r=S(s.text,i);if(r==i)return null;var n=be(s.dom,i,r).getClientRects();for(var _t78=0;_t78<n.length;_t78++){var _e79=n[_t78];if(_t78==n.length-1||_e79.top<_e79.bottom&&_e79.left<_e79.right)return _e79;}return null;}},{key:"measureVisibleLineHeights",value:function measureVisibleLineHeights(t){var e=[],i=t.from,s=t.to,r=this.view.contentDOM.clientWidth,n=r>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,h=-1,l=this.view.textDirection==mi.LTR;for(var _t79=0,_o21=0;_o21<this.children.length;_o21++){var _u16=this.children[_o21],_f12=_t79+_u16.length;if(_f12>s)break;if(_t79>=i){var _i77=_u16.dom.getBoundingClientRect();if(e.push(_i77.height),n){var _e80=_u16.dom.lastChild,_s64=_e80?ne(_e80):[];if(_s64.length){var _e81=_s64[_s64.length-1],_n50=l?_e81.right-_i77.left:_i77.right-_e81.left;_n50>h&&(h=_n50,this.minWidth=r,this.minWidthFrom=_t79,this.minWidthTo=_f12);}}}_t79=_f12+_u16.breakAfter;}return e;}},{key:"textDirectionAt",value:function textDirectionAt(t){var _this$childPos3=this.childPos(t,1),e=_this$childPos3.i;return"rtl"==getComputedStyle(this.children[e].dom).direction?mi.RTL:mi.LTR;}},{key:"measureTextSize",value:function measureTextSize(){var _this24=this;var _iterator48=_createForOfIteratorHelper(this.children),_step48;try{for(_iterator48.s();!(_step48=_iterator48.n()).done;){var _t80=_step48.value;if(_t80 instanceof ui){var _e82=_t80.measureTextSize();if(_e82)return _e82;}}}catch(err){_iterator48.e(err);}finally{_iterator48.f();}var t,e,i,s=document.createElement("div");return s.className="cm-line",s.style.width="99999px",s.style.position="absolute",s.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(function(){_this24.dom.appendChild(s);var r=ne(s.firstChild)[0];t=s.getBoundingClientRect().height,e=r?r.width/27:7,i=r?r.height:t,s.remove();}),{lineHeight:t,charWidth:e,textHeight:i};}},{key:"childCursor",value:function childCursor(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:this.length;var e=this.children.length;return e&&(t-=this.children[--e].length),new De(this.children,t,e);}},{key:"computeBlockGapDeco",value:function computeBlockGapDeco(){var t=[],e=this.view.viewState;for(var _i78=0,_s65=0;;_s65++){var _r58=_s65==e.viewports.length?null:e.viewports[_s65],_n51=_r58?_r58.from-1:this.length;if(_n51>_i78){var _s66=(e.lineBlockAt(_n51).bottom-e.lineBlockAt(_i78).top)/this.view.scaleY;t.push(si.replace({widget:new ai(_s66),block:!0,inclusive:!0,isBlockGap:!0}).range(_i78,_n51));}if(!_r58)break;_i78=_r58.to+1;}return si.set(t);}},{key:"updateDeco",value:function updateDeco(){var _this25=this;var t=1,e=this.view.state.facet(ss).map(function(e){return(_this25.dynamicDecorationMap[t++]="function"==typeof e)?e(_this25.view):e;}),i=!1,s=this.view.state.facet(rs).map(function(t,e){var s="function"==typeof t;return s&&(i=!0),s?t(_this25.view):t;});for(s.length&&(this.dynamicDecorationMap[t++]=i,e.push($t.join(s))),this.decorations=[this.editContextFormatting].concat(_toConsumableArray(e),[this.computeBlockGapDeco(),this.view.viewState.lineGapDeco]);t<this.decorations.length;)this.dynamicDecorationMap[t++]=!1;return this.decorations;}},{key:"scrollIntoView",value:function scrollIntoView(t){if(t.isSnapshot){var _e83=this.view.viewState.lineBlockAt(t.range.head);return this.view.scrollDOM.scrollTop=_e83.top-t.yMargin,void(this.view.scrollDOM.scrollLeft=t.xMargin);}var _iterator49=_createForOfIteratorHelper(this.view.state.facet(Ji)),_step49;try{for(_iterator49.s();!(_step49=_iterator49.n()).done;){var _e86=_step49.value;try{if(_e86(this.view,t.range,t))return!0;}catch(t){_i(this.view.state,t,"scroll handler");}}}catch(err){_iterator49.e(err);}finally{_iterator49.f();}var e,i=t.range,s=this.coordsAt(i.head,i.empty?i.assoc:i.head>i.anchor?-1:1);if(!s)return;!i.empty&&(e=this.coordsAt(i.anchor,i.anchor>i.head?-1:1))&&(s={left:Math.min(s.left,e.left),top:Math.min(s.top,e.top),right:Math.max(s.right,e.right),bottom:Math.max(s.bottom,e.bottom)});var r=us(this.view),n={left:s.left-r.left,top:s.top-r.top,right:s.right+r.right,bottom:s.bottom+r.bottom},_this$view$scrollDOM=this.view.scrollDOM,h=_this$view$scrollDOM.offsetWidth,l=_this$view$scrollDOM.offsetHeight;!function(t,e,i,s,r,n,h,l){var o=t.ownerDocument,u=o.defaultView||window;for(var _f13=t,_a9=!1;_f13&&!_a9;)if(1==_f13.nodeType){var _t81=void 0,_c6=_f13==o.body,_d5=1,_p6=1;if(_c6)_t81=ce(u);else{var _de;if(/^(fixed|sticky)$/.test(getComputedStyle(_f13).position)&&(_a9=!0),_f13.scrollHeight<=_f13.clientHeight&&_f13.scrollWidth<=_f13.clientWidth){_f13=_f13.assignedSlot||_f13.parentNode;continue;}var _e84=_f13.getBoundingClientRect();_de=de(_f13,_e84),_d5=_de.scaleX,_p6=_de.scaleY,_t81={left:_e84.left,right:_e84.left+_f13.clientWidth*_d5,top:_e84.top,bottom:_e84.top+_f13.clientHeight*_p6};}var _m2=0,_g2=0;if("nearest"==r)e.top<_t81.top?(_g2=-(_t81.top-e.top+h),i>0&&e.bottom>_t81.bottom+_g2&&(_g2=e.bottom-_t81.bottom+_g2+h)):e.bottom>_t81.bottom&&(_g2=e.bottom-_t81.bottom+h,i<0&&e.top-_g2<_t81.top&&(_g2=-(_t81.top+_g2-e.top+h)));else{var _s67=e.bottom-e.top,_n52=_t81.bottom-_t81.top;_g2=("center"==r&&_s67<=_n52?e.top+_s67/2-_n52/2:"start"==r||"center"==r&&i<0?e.top-h:e.bottom-_n52+h)-_t81.top;}if("nearest"==s?e.left<_t81.left?(_m2=-(_t81.left-e.left+n),i>0&&e.right>_t81.right+_m2&&(_m2=e.right-_t81.right+_m2+n)):e.right>_t81.right&&(_m2=e.right-_t81.right+n,i<0&&e.left<_t81.left+_m2&&(_m2=-(_t81.left+_m2-e.left+n))):_m2=("center"==s?e.left+(e.right-e.left)/2-(_t81.right-_t81.left)/2:"start"==s==l?e.left-n:e.right-(_t81.right-_t81.left)+n)-_t81.left,_m2||_g2)if(_c6)u.scrollBy(_m2,_g2);else{var _t82=0,_i79=0;if(_g2){var _t83=_f13.scrollTop;_f13.scrollTop+=_g2/_p6,_i79=(_f13.scrollTop-_t83)*_p6;}if(_m2){var _e85=_f13.scrollLeft;_f13.scrollLeft+=_m2/_d5,_t82=(_f13.scrollLeft-_e85)*_d5;}e={left:e.left-_t82,top:e.top-_i79,right:e.right-_t82,bottom:e.bottom-_i79},_t82&&Math.abs(_t82-_m2)<1&&(s="nearest"),_i79&&Math.abs(_i79-_g2)<1&&(r="nearest");}if(_c6)break;_f13=_f13.assignedSlot||_f13.parentNode;}else{if(11!=_f13.nodeType)break;_f13=_f13.host;}}(this.view.scrollDOM,n,i.head<i.anchor?-1:1,t.x,t.y,Math.max(Math.min(t.xMargin,h),-h),Math.max(Math.min(t.yMargin,l),-l),this.view.textDirection==mi.LTR);}}]);}(Ce);ms=/*#__PURE__*/function(){function ms(){_classCallCheck(this,ms);this.changes=[];}return _createClass(ms,[{key:"compareRange",value:function compareRange(t,e){oi(t,e,this.changes);}},{key:"comparePoint",value:function comparePoint(t,e){oi(t,e,this.changes);}},{key:"boundChange",value:function boundChange(t){oi(t,t,this.changes);}}]);}();Es="";Is=/*#__PURE__*/function(){function Is(t,e){_classCallCheck(this,Is);this.points=t,this.text="",this.lineSeparator=e.facet(It.lineSeparator);}return _createClass(Is,[{key:"append",value:function append(t){this.text+=t;}},{key:"lineBreak",value:function lineBreak(){this.text+=Es;}},{key:"readRange",value:function readRange(t,e){if(!t)return this;var i=t.parentNode;for(var _s70=t;;){this.findPointBefore(i,_s70);var _t91=this.text.length;this.readNode(_s70);var _r61=_s70.nextSibling;if(_r61==e)break;var _n54=Ce.get(_s70),_h35=Ce.get(_r61);(_n54&&_h35?_n54.breakAfter:(_n54?_n54.breakAfter:oe(_s70))||oe(_r61)&&("BR"!=_s70.nodeName||_s70.cmIgnore)&&this.text.length>_t91)&&this.lineBreak(),_s70=_r61;}return this.findPointBefore(i,e),this;}},{key:"readTextNode",value:function readTextNode(t){var e=t.nodeValue;var _iterator52=_createForOfIteratorHelper(this.points),_step52;try{for(_iterator52.s();!(_step52=_iterator52.n()).done;){var _i82=_step52.value;_i82.node==t&&(_i82.pos=this.text.length+Math.min(_i82.offset,e.length));}}catch(err){_iterator52.e(err);}finally{_iterator52.f();}for(var _i81=0,_s71=this.lineSeparator?null:/\r\n?|\n/g;;){var _r62=void 0,_n55=-1,_h36=1;if(this.lineSeparator?(_n55=e.indexOf(this.lineSeparator,_i81),_h36=this.lineSeparator.length):(_r62=_s71.exec(e))&&(_n55=_r62.index,_h36=_r62[0].length),this.append(e.slice(_i81,_n55<0?e.length:_n55)),_n55<0)break;if(this.lineBreak(),_h36>1){var _iterator53=_createForOfIteratorHelper(this.points),_step53;try{for(_iterator53.s();!(_step53=_iterator53.n()).done;){var _e95=_step53.value;_e95.node==t&&_e95.pos>this.text.length&&(_e95.pos-=_h36-1);}}catch(err){_iterator53.e(err);}finally{_iterator53.f();}}_i81=_n55+_h36;}}},{key:"readNode",value:function readNode(t){if(t.cmIgnore)return;var e=Ce.get(t),i=e&&e.overrideDOMText;if(null!=i){this.findPointInside(t,i.length);for(var _t92=i.iter();!_t92.next().done;)_t92.lineBreak?this.lineBreak():this.append(_t92.value);}else 3==t.nodeType?this.readTextNode(t):"BR"==t.nodeName?t.nextSibling&&this.lineBreak():1==t.nodeType&&this.readRange(t.firstChild,null);}},{key:"findPointBefore",value:function findPointBefore(t,e){var _iterator54=_createForOfIteratorHelper(this.points),_step54;try{for(_iterator54.s();!(_step54=_iterator54.n()).done;){var _i83=_step54.value;_i83.node==t&&t.childNodes[_i83.offset]==e&&(_i83.pos=this.text.length);}}catch(err){_iterator54.e(err);}finally{_iterator54.f();}}},{key:"findPointInside",value:function findPointInside(t,e){var _iterator55=_createForOfIteratorHelper(this.points),_step55;try{for(_iterator55.s();!(_step55=_iterator55.n()).done;){var _i84=_step55.value;(3==t.nodeType?_i84.node==t:t.contains(_i84.node))&&(_i84.pos=this.text.length+(Rs(t,_i84.node,_i84.offset)?e:0));}}catch(err){_iterator55.e(err);}finally{_iterator55.f();}}}]);}();Ts=/*#__PURE__*/_createClass(function Ts(t,e){_classCallCheck(this,Ts);this.node=t,this.offset=e,this.pos=-1;});Bs=/*#__PURE__*/_createClass(function Bs(t,e,i,s){_classCallCheck(this,Bs);this.typeOver=s,this.bounds=null,this.text="",this.domChanged=e>-1;var _t$docView=t.docView,r=_t$docView.impreciseHead,n=_t$docView.impreciseAnchor;if(t.state.readOnly&&e>-1)this.newSel=null;else if(e>-1&&(this.bounds=t.docView.domBoundsAround(e,i,0))){var _e96=r||n?[]:function(t){var e=[];if(t.root.activeElement!=t.contentDOM)return e;var _t$observer$selection2=t.observer.selectionRange,i=_t$observer$selection2.anchorNode,s=_t$observer$selection2.anchorOffset,r=_t$observer$selection2.focusNode,n=_t$observer$selection2.focusOffset;i&&(e.push(new Ts(i,s)),r==i&&n==s||e.push(new Ts(r,n)));return e;}(t),_i85=new Is(_e96,t.state);_i85.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=_i85.text,this.newSel=function(t,e){if(0==t.length)return null;var i=t[0].pos,s=2==t.length?t[1].pos:i;return i>-1&&s>-1?P.single(i+e,s+e):null;}(_e96,this.bounds.from);}else{var _e97=t.observer.selectionRange,_i86=r&&r.node==_e97.focusNode&&r.offset==_e97.focusOffset||!se(t.contentDOM,_e97.focusNode)?t.state.selection.main.head:t.docView.posFromDOM(_e97.focusNode,_e97.focusOffset),_s72=n&&n.node==_e97.anchorNode&&n.offset==_e97.anchorOffset||!se(t.contentDOM,_e97.anchorNode)?t.state.selection.main.anchor:t.docView.posFromDOM(_e97.anchorNode,_e97.anchorOffset),_h37=t.viewport;if((Fe.ios||Fe.chrome)&&t.state.selection.main.empty&&_i86!=_s72&&(_h37.from>0||_h37.to<t.state.doc.length)){var _e98=Math.min(_i86,_s72),_r63=Math.max(_i86,_s72),_n56=_h37.from-_e98,_l30=_h37.to-_r63;0!=_n56&&1!=_n56&&0!=_e98||0!=_l30&&-1!=_l30&&_r63!=t.state.doc.length||(_i86=0,_s72=t.state.doc.length);}this.newSel=P.single(_s72,_i86);}});$s=/*#__PURE__*/function(){function $s(t){_classCallCheck(this,$s);this.view=t,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=t.hasFocus,Fe.safari&&t.contentDOM.addEventListener("input",function(){return null;}),Fe.gecko&&function(t){ur.has(t)||(ur.add(t),t.addEventListener("copy",function(){}),t.addEventListener("cut",function(){}));}(t.contentDOM.ownerDocument);}return _createClass($s,[{key:"setSelectionOrigin",value:function setSelectionOrigin(t){this.lastSelectionOrigin=t,this.lastSelectionTime=Date.now();}},{key:"handleEvent",value:function handleEvent(t){(function(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(var _i89,_s74=e.target;_s74!=t.contentDOM;_s74=_s74.parentNode)if(!_s74||11==_s74.nodeType||(_i89=Ce.get(_s74))&&_i89.ignoreEvent(e))return!1;return!0;})(this.view,t)&&!this.ignoreDuringComposition(t)&&("keydown"==t.type&&this.keydown(t)||this.runHandlers(t.type,t));}},{key:"runHandlers",value:function runHandlers(t,e){var i=this.handlers[t];if(i){var _iterator56=_createForOfIteratorHelper(i.observers),_step56;try{for(_iterator56.s();!(_step56=_iterator56.n()).done;){var _t94=_step56.value;_t94(this.view,e);}}catch(err){_iterator56.e(err);}finally{_iterator56.f();}var _iterator57=_createForOfIteratorHelper(i.handlers),_step57;try{for(_iterator57.s();!(_step57=_iterator57.n()).done;){var _t95=_step57.value;if(e.defaultPrevented)break;if(_t95(this.view,e)){e.preventDefault();break;}}}catch(err){_iterator57.e(err);}finally{_iterator57.f();}}}},{key:"ensureHandlers",value:function ensureHandlers(t){var e=zs(t),i=this.handlers,s=this.view.contentDOM;for(var _t96 in e)if("scroll"!=_t96){var _r64=!e[_t96].handlers.length,_n57=i[_t96];_n57&&_r64!=!_n57.handlers.length&&(s.removeEventListener(_t96,this.handleEvent),_n57=null),_n57||s.addEventListener(_t96,this.handleEvent,{passive:_r64});}for(var _t97 in i)"scroll"==_t97||e[_t97]||s.removeEventListener(_t97,this.handleEvent);this.handlers=e;}},{key:"keydown",value:function keydown(t){var _this26=this;if(this.lastKeyCode=t.keyCode,this.lastKeyTime=Date.now(),9==t.keyCode&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&27!=t.keyCode&&Ws.indexOf(t.keyCode)<0&&(this.tabFocusMode=-1),Fe.android&&Fe.chrome&&!t.synthetic&&(13==t.keyCode||8==t.keyCode))return this.view.observer.delayAndroidKey(t.key,t.keyCode),!0;var e;return!Fe.ios||t.synthetic||t.altKey||t.metaKey||!((e=Ps.find(function(e){return e.keyCode==t.keyCode;}))&&!t.ctrlKey||Hs.indexOf(t.key)>-1&&t.ctrlKey&&!t.shiftKey)?(229!=t.keyCode&&this.view.observer.forceFlush(),!1):(this.pendingIOSKey=e||t,setTimeout(function(){return _this26.flushIOSKey();},250),!0);}},{key:"flushIOSKey",value:function flushIOSKey(t){var e=this.pendingIOSKey;return!!e&&!("Enter"==e.key&&t&&t.from<t.to&&/^\S+$/.test(t.insert.toString()))&&(this.pendingIOSKey=void 0,ve(this.view.contentDOM,e.key,e.keyCode,e instanceof KeyboardEvent?e:void 0));}},{key:"ignoreDuringComposition",value:function ignoreDuringComposition(t){return!!/^key/.test(t.type)&&(this.composing>0||!!(Fe.safari&&!Fe.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100)&&(this.compositionPendingKey=!1,!0));}},{key:"startMouseSelection",value:function startMouseSelection(t){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=t;}},{key:"update",value:function update(t){this.view.observer.update(t),this.mouseSelection&&this.mouseSelection.update(t),this.draggedContent&&t.docChanged&&(this.draggedContent=this.draggedContent.map(t.changes)),t.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0);}},{key:"destroy",value:function destroy(){this.mouseSelection&&this.mouseSelection.destroy();}}]);}();Ps=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],Hs="dthko",Ws=[16,17,18,20,91,92,224,225];Vs=/*#__PURE__*/function(){function Vs(t,e,i,s){_classCallCheck(this,Vs);this.view=t,this.startEvent=e,this.style=i,this.mustSelect=s,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=e,this.scrollParents=function(t){var e,i,s=t.ownerDocument;for(var _r67=t.parentNode;_r67&&!(_r67==s.body||e&&i);)if(1==_r67.nodeType)!i&&_r67.scrollHeight>_r67.clientHeight&&(i=_r67),!e&&_r67.scrollWidth>_r67.clientWidth&&(e=_r67),_r67=_r67.assignedSlot||_r67.parentNode;else{if(11!=_r67.nodeType)break;_r67=_r67.host;}return{x:e,y:i};}(t.contentDOM),this.atoms=t.state.facet(ns).map(function(e){return e(t);});var r=t.contentDOM.ownerDocument;r.addEventListener("mousemove",this.move=this.move.bind(this)),r.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=e.shiftKey,this.multiple=t.state.facet(It.allowMultipleSelections)&&function(t,e){var i=t.state.facet(Li);return i.length?i[0](e):Fe.mac?e.metaKey:e.ctrlKey;}(t,e),this.dragging=!(!function(t,e){var i=t.state.selection.main;if(i.empty)return!1;var s=ie(t.root);if(!s||0==s.rangeCount)return!0;var r=s.getRangeAt(0).getClientRects();for(var _t101=0;_t101<r.length;_t101++){var _i90=r[_t101];if(_i90.left<=e.clientX&&_i90.right>=e.clientX&&_i90.top<=e.clientY&&_i90.bottom>=e.clientY)return!0;}return!1;}(t,e)||1!=sr(e))&&null;}return _createClass(Vs,[{key:"start",value:function start(t){!1===this.dragging&&this.select(t);}},{key:"move",value:function move(t){var _this$scrollParents$x,_this$scrollParents$y;if(0==t.buttons)return this.destroy();if(this.dragging||null==this.dragging&&(e=this.startEvent,i=t,Math.max(Math.abs(e.clientX-i.clientX),Math.abs(e.clientY-i.clientY))<10))return;var e,i;this.select(this.lastEvent=t);var s=0,r=0,n=0,h=0,l=this.view.win.innerWidth,o=this.view.win.innerHeight;this.scrollParents.x&&(_this$scrollParents$x=this.scrollParents.x.getBoundingClientRect(),n=_this$scrollParents$x.left,l=_this$scrollParents$x.right,_this$scrollParents$x),this.scrollParents.y&&(_this$scrollParents$y=this.scrollParents.y.getBoundingClientRect(),h=_this$scrollParents$y.top,o=_this$scrollParents$y.bottom,_this$scrollParents$y);var u=us(this.view);t.clientX-u.left<=n+6?s=-Fs(n-t.clientX):t.clientX+u.right>=l-6&&(s=Fs(t.clientX-l)),t.clientY-u.top<=h+6?r=-Fs(h-t.clientY):t.clientY+u.bottom>=o-6&&(r=Fs(t.clientY-o)),this.setScrollSpeed(s,r);}},{key:"up",value:function up(t){null==this.dragging&&this.select(this.lastEvent),this.dragging||t.preventDefault(),this.destroy();}},{key:"destroy",value:function destroy(){this.setScrollSpeed(0,0);var t=this.view.contentDOM.ownerDocument;t.removeEventListener("mousemove",this.move),t.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null;}},{key:"setScrollSpeed",value:function setScrollSpeed(t,e){var _this27=this;this.scrollSpeed={x:t,y:e},t||e?this.scrolling<0&&(this.scrolling=setInterval(function(){return _this27.scroll();},50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1);}},{key:"scroll",value:function scroll(){var _this$scrollSpeed=this.scrollSpeed,t=_this$scrollSpeed.x,e=_this$scrollSpeed.y;t&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=t,t=0),e&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=e,e=0),(t||e)&&this.view.win.scrollBy(t,e),!1===this.dragging&&this.select(this.lastEvent);}},{key:"skipAtoms",value:function skipAtoms(t){var e=null;for(var _i91=0;_i91<t.ranges.length;_i91++){var _s77=t.ranges[_i91],_r68=null;if(_s77.empty){var _t102=Os(this.atoms,_s77.from,0);_t102!=_s77.from&&(_r68=P.cursor(_t102,-1));}else{var _t103=Os(this.atoms,_s77.from,-1),_e101=Os(this.atoms,_s77.to,1);_t103==_s77.from&&_e101==_s77.to||(_r68=P.range(_s77.from==_s77.anchor?_t103:_e101,_s77.from==_s77.head?_t103:_e101));}_r68&&(e||(e=t.ranges.slice()),e[_i91]=_r68);}return e?P.create(e,t.mainIndex):t;}},{key:"select",value:function select(t){var e=this.view,i=this.skipAtoms(this.style.get(t,this.extend,this.multiple));!this.mustSelect&&i.eq(e.state.selection,!1===this.dragging)||this.view.dispatch({selection:i,userEvent:"select.pointer"}),this.mustSelect=!1;}},{key:"update",value:function update(t){var _this28=this;t.transactions.some(function(t){return t.isUserEvent("input.type");})?this.destroy():this.style.update(t)&&setTimeout(function(){return _this28.select(_this28.lastEvent);},20);}}]);}();qs=Object.create(null),Js=Object.create(null),Us=Fe.ie&&Fe.ie_version<15||Fe.ios&&Fe.webkit_version<604;Js.scroll=function(t){t.inputState.lastScrollTop=t.scrollDOM.scrollTop,t.inputState.lastScrollLeft=t.scrollDOM.scrollLeft;},qs.keydown=function(t,e){return t.inputState.setSelectionOrigin("select"),27==e.keyCode&&0!=t.inputState.tabFocusMode&&(t.inputState.tabFocusMode=Date.now()+2e3),!1;},Js.touchstart=function(t,e){t.inputState.lastTouchTime=Date.now(),t.inputState.setSelectionOrigin("select.pointer");},Js.touchmove=function(t){t.inputState.setSelectionOrigin("select.pointer");},qs.mousedown=function(t,e){if(t.observer.flush(),t.inputState.lastTouchTime>Date.now()-2e3)return!1;var i=null;var _iterator60=_createForOfIteratorHelper(t.state.facet($i)),_step60;try{for(_iterator60.s();!(_step60=_iterator60.n()).done;){var _s82=_step60.value;if(i=_s82(t,e),i)break;}}catch(err){_iterator60.e(err);}finally{_iterator60.f();}if(i||0!=e.button||(i=function(t,e){var i=Qs(t,e),s=sr(e),r=t.state.selection;return{update:function update(t){t.docChanged&&(i.pos=t.changes.mapPos(i.pos),r=r.map(t.changes));},get:function get(e,n,h){var l,o=Qs(t,e),u=_s(t,o.pos,o.bias,s);if(i.pos!=o.pos&&!n){var _e102=_s(t,i.pos,i.bias,s),_r70=Math.min(_e102.from,u.from),_n59=Math.max(_e102.to,u.to);u=_r70<u.from?P.range(_r70,_n59):P.range(_n59,_r70);}return n?r.replaceRange(r.main.extend(u.from,u.to)):h&&1==s&&r.ranges.length>1&&(l=function(t,e){for(var _i93=0;_i93<t.ranges.length;_i93++){var _t$ranges$_i=t.ranges[_i93],_s80=_t$ranges$_i.from,_r71=_t$ranges$_i.to;if(_s80<=e&&_r71>=e)return P.create(t.ranges.slice(0,_i93).concat(t.ranges.slice(_i93+1)),t.mainIndex==_i93?0:t.mainIndex-(t.mainIndex>_i93?1:0));}return null;}(r,o.pos))?l:h?r.addRange(u):P.create([u]);}};}(t,e)),i){var _s81=!t.hasFocus;t.inputState.startMouseSelection(new Vs(t,e,i,_s81)),_s81&&t.observer.ignore(function(){we(t.contentDOM);var e=t.root.activeElement;e&&!e.contains(t.contentDOM)&&e.blur();});var _r72=t.inputState.mouseSelection;if(_r72)return _r72.start(e),!1===_r72.dragging;}return!1;};Xs=function Xs(t,e,i){return e>=i.top&&e<=i.bottom&&t>=i.left&&t<=i.right;};Zs=Fe.ie&&Fe.ie_version<=11;tr=null,er=0,ir=0;qs.dragstart=function(t,e){var i=t.state.selection.main;if(e.target.draggable){var _s83=t.docView.nearest(e.target);if(_s83&&_s83.isWidget){var _t107=_s83.posAtStart,_e103=_t107+_s83.length;(_t107>=i.to||_e103<=i.from)&&(i=P.range(_t107,_e103));}}var s=t.inputState;return s.mouseSelection&&(s.mouseSelection.dragging=!0),s.draggedContent=i,e.dataTransfer&&(e.dataTransfer.setData("Text",Gs(t.state,Fi,t.state.sliceDoc(i.from,i.to))),e.dataTransfer.effectAllowed="copyMove"),!1;},qs.dragend=function(t){return t.inputState.draggedContent=null,!1;},qs.drop=function(t,e){if(!e.dataTransfer)return!1;if(t.state.readOnly)return!0;var i=e.dataTransfer.files;if(i&&i.length){var _s84=Array(i.length),_r73=0,_n60=function _n60(){++_r73==i.length&&rr(t,e,_s84.filter(function(t){return null!=t;}).join(t.state.lineBreak),!1);};var _loop6=function _loop6(_t108){var e=new FileReader();e.onerror=_n60,e.onload=function(){/[\x00-\x08\x0e-\x1f]{2}/.test(e.result)||(_s84[_t108]=e.result),_n60();},e.readAsText(i[_t108]);};for(var _t108=0;_t108<i.length;_t108++){_loop6(_t108);}return!0;}{var _i94=e.dataTransfer.getData("Text");if(_i94)return rr(t,e,_i94,!0),!0;}return!1;},qs.paste=function(t,e){if(t.state.readOnly)return!0;t.observer.flush();var i=Us?null:e.clipboardData;return i?(Ks(t,i.getData("text/plain")||i.getData("text/uri-list")),!0):(function(t){var e=t.dom.parentNode;if(!e)return;var i=e.appendChild(document.createElement("textarea"));i.style.cssText="position: fixed; left: -10000px; top: 10px",i.focus(),setTimeout(function(){t.focus(),i.remove(),Ks(t,i.value);},50);}(t),!1);};nr=null;qs.copy=qs.cut=function(t,e){var _ref7=function(t){var e=[],i=[],s=!1;var _iterator61=_createForOfIteratorHelper(t.selection.ranges),_step61;try{for(_iterator61.s();!(_step61=_iterator61.n()).done;){var _s86=_step61.value;_s86.empty||(e.push(t.sliceDoc(_s86.from,_s86.to)),i.push(_s86));}}catch(err){_iterator61.e(err);}finally{_iterator61.f();}if(!e.length){var _r74=-1;var _iterator62=_createForOfIteratorHelper(t.selection.ranges),_step62;try{for(_iterator62.s();!(_step62=_iterator62.n()).done;){var _s85=_step62.value.from;var _n61=t.doc.lineAt(_s85);_n61.number>_r74&&(e.push(_n61.text),i.push({from:_n61.from,to:Math.min(t.doc.length,_n61.to+1)})),_r74=_n61.number;}}catch(err){_iterator62.e(err);}finally{_iterator62.f();}s=!0;}return{text:Gs(t,Fi,e.join(t.lineBreak)),ranges:i,linewise:s};}(t.state),i=_ref7.text,s=_ref7.ranges,r=_ref7.linewise;if(!i&&!r)return!1;nr=r?i:null,"cut"!=e.type||t.state.readOnly||t.dispatch({changes:s,scrollIntoView:!0,userEvent:"delete.cut"});var n=Us?null:e.clipboardData;return n?(n.clearData(),n.setData("text/plain",i),!0):(function(t,e){var i=t.dom.parentNode;if(!i)return;var s=i.appendChild(document.createElement("textarea"));s.style.cssText="position: fixed; left: -10000px; top: 10px",s.value=e,s.focus(),s.selectionEnd=e.length,s.selectionStart=0,setTimeout(function(){s.remove(),t.focus();},50);}(t,i),!1);};hr=mt.define();Js.focus=function(t){t.inputState.lastFocusTime=Date.now(),t.scrollDOM.scrollTop||!t.inputState.lastScrollTop&&!t.inputState.lastScrollLeft||(t.scrollDOM.scrollTop=t.inputState.lastScrollTop,t.scrollDOM.scrollLeft=t.inputState.lastScrollLeft),or(t);},Js.blur=function(t){t.observer.clearSelectionRange(),or(t);},Js.compositionstart=Js.compositionupdate=function(t){t.observer.editContext||(null==t.inputState.compositionFirstChange&&(t.inputState.compositionFirstChange=!0),t.inputState.composing<0&&(t.inputState.composing=0));},Js.compositionend=function(t){t.observer.editContext||(t.inputState.composing=-1,t.inputState.compositionEndedAt=Date.now(),t.inputState.compositionPendingKey=!0,t.inputState.compositionPendingChange=t.observer.pendingRecords().length>0,t.inputState.compositionFirstChange=null,Fe.chrome&&Fe.android?t.observer.flushSoon():t.inputState.compositionPendingChange?Promise.resolve().then(function(){return t.observer.flush();}):setTimeout(function(){t.inputState.composing<0&&t.docView.hasComposition&&t.update([]);},50));},Js.contextmenu=function(t){t.inputState.lastContextMenu=Date.now();},qs.beforeinput=function(t,e){var i,s;if("insertReplacementText"==e.inputType&&t.observer.editContext){var _s88=null===(i=e.dataTransfer)||void 0===i?void 0:i.getData("text/plain"),_r76=e.getTargetRanges();if(_s88&&_r76.length){var _e104=_r76[0],_i96=t.posAtDOM(_e104.startContainer,_e104.startOffset),_n62=t.posAtDOM(_e104.endContainer,_e104.endOffset);return Ns(t,{from:_i96,to:_n62,insert:t.state.toText(_s88)},null),!0;}}var r;if(Fe.chrome&&Fe.android&&(r=Ps.find(function(t){return t.inputType==e.inputType;}))&&(t.observer.delayAndroidKey(r.key,r.keyCode),"Backspace"==r.key||"Delete"==r.key)){var _e105=(null===(s=window.visualViewport)||void 0===s?void 0:s.height)||0;setTimeout(function(){var i;((null===(i=window.visualViewport)||void 0===i?void 0:i.height)||0)>_e105+10&&t.hasFocus&&(t.contentDOM.blur(),t.focus());},100);}return Fe.ios&&"deleteContentForward"==e.inputType&&t.observer.flushSoon(),Fe.safari&&"insertText"==e.inputType&&t.inputState.composing>=0&&setTimeout(function(){return Js.compositionend(t,e);},20),!1;};ur=new Set();fr=["pre-wrap","normal","pre-line","break-spaces"];ar=!1;dr=/*#__PURE__*/function(){function dr(t){_classCallCheck(this,dr);this.lineWrapping=t,this.doc=p.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30;}return _createClass(dr,[{key:"heightForGap",value:function heightForGap(t,e){var i=this.doc.lineAt(e).number-this.doc.lineAt(t).number+1;return this.lineWrapping&&(i+=Math.max(0,Math.ceil((e-t-i*this.lineLength*.5)/this.lineLength))),this.lineHeight*i;}},{key:"heightForLine",value:function heightForLine(t){if(!this.lineWrapping)return this.lineHeight;return(1+Math.max(0,Math.ceil((t-this.lineLength)/(this.lineLength-5))))*this.lineHeight;}},{key:"setDoc",value:function setDoc(t){return this.doc=t,this;}},{key:"mustRefreshForWrapping",value:function mustRefreshForWrapping(t){return fr.indexOf(t)>-1!=this.lineWrapping;}},{key:"mustRefreshForHeights",value:function mustRefreshForHeights(t){var e=!1;for(var _i97=0;_i97<t.length;_i97++){var _s89=t[_i97];_s89<0?_i97++:this.heightSamples[Math.floor(10*_s89)]||(e=!0,this.heightSamples[Math.floor(10*_s89)]=!0);}return e;}},{key:"refresh",value:function refresh(t,e,i,s,r,n){var h=fr.indexOf(t)>-1,l=Math.round(e)!=Math.round(this.lineHeight)||this.lineWrapping!=h;if(this.lineWrapping=h,this.lineHeight=e,this.charWidth=i,this.textHeight=s,this.lineLength=r,l){this.heightSamples={};for(var _t109=0;_t109<n.length;_t109++){var _e106=n[_t109];_e106<0?_t109++:this.heightSamples[Math.floor(10*_e106)]=!0;}}return l;}}]);}();pr=/*#__PURE__*/function(){function pr(t,e){_classCallCheck(this,pr);this.from=t,this.heights=e,this.index=0;}return _createClass(pr,[{key:"more",get:function get(){return this.index<this.heights.length;}}]);}();mr=/*#__PURE__*/function(){function mr(t,e,i,s,r){_classCallCheck(this,mr);this.from=t,this.length=e,this.top=i,this.height=s,this._content=r;}return _createClass(mr,[{key:"type",get:function get(){return"number"==typeof this._content?ii.Text:Array.isArray(this._content)?this._content:this._content.type;}},{key:"to",get:function get(){return this.from+this.length;}},{key:"bottom",get:function get(){return this.top+this.height;}},{key:"widget",get:function get(){return this._content instanceof hi?this._content.widget:null;}},{key:"widgetLineBreaks",get:function get(){return"number"==typeof this._content?this._content:0;}},{key:"join",value:function join(t){var e=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(t._content)?t._content:[t]);return new mr(this.from,this.length+t.length,this.top,this.height+t.height,e);}}]);}();gr=function(t){return t[t.ByPos=0]="ByPos",t[t.ByHeight=1]="ByHeight",t[t.ByPosNoHeight=2]="ByPosNoHeight",t;}(gr||(gr={}));wr=.001;br=/*#__PURE__*/function(){function br(t,e){var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:2;_classCallCheck(this,br);this.length=t,this.height=e,this.flags=i;}return _createClass(br,[{key:"outdated",get:function get(){return(2&this.flags)>0;},set:function set(t){this.flags=(t?2:0)|-3&this.flags;}},{key:"setHeight",value:function setHeight(t){this.height!=t&&(Math.abs(this.height-t)>wr&&(ar=!0),this.height=t);}},{key:"replace",value:function replace(t,e,i){return br.of(i);}},{key:"decomposeLeft",value:function decomposeLeft(t,e){e.push(this);}},{key:"decomposeRight",value:function decomposeRight(t,e){e.push(this);}},{key:"applyChanges",value:function applyChanges(t,e,i,s){var r=this,n=i.doc;for(var _h41=s.length-1;_h41>=0;_h41--){var _s$_h=s[_h41],_l33=_s$_h.fromA,_o26=_s$_h.toA,_u21=_s$_h.fromB,_f16=_s$_h.toB,_a11=r.lineAt(_l33,gr.ByPosNoHeight,i.setDoc(e),0,0),_c9=_a11.to>=_o26?_a11:r.lineAt(_o26,gr.ByPosNoHeight,i,0,0);for(_f16+=_c9.to-_o26,_o26=_c9.to;_h41>0&&_a11.from<=s[_h41-1].toA;)_l33=s[_h41-1].fromA,_u21=s[_h41-1].fromB,_h41--,_l33<_a11.from&&(_a11=r.lineAt(_l33,gr.ByPosNoHeight,i,0,0));_u21+=_a11.from-_l33,_l33=_a11.from;var _d7=Ar.build(i.setDoc(n),t,_u21,_f16);r=vr(r,r.replace(_l33,_o26,_d7));}return r.updateHeight(i,0);}}],[{key:"empty",value:function empty(){return new yr(0,0);}},{key:"of",value:function of(t){if(1==t.length)return t[0];var e=0,i=t.length,s=0,r=0;for(;;)if(e==i){if(s>2*r){var _r77=t[e-1];_r77["break"]?t.splice(--e,1,_r77.left,null,_r77.right):t.splice(--e,1,_r77.left,_r77.right),i+=1+_r77["break"],s-=_r77.size;}else{if(!(r>2*s))break;{var _e107=t[i];_e107["break"]?t.splice(i,1,_e107.left,null,_e107.right):t.splice(i,1,_e107.left,_e107.right),i+=2+_e107["break"],r-=_e107.size;}}}else if(s<r){var _i98=t[e++];_i98&&(s+=_i98.size);}else{var _e108=t[--i];_e108&&(r+=_e108.size);}var n=0;return null==t[e-1]?(n=1,e--):null==t[e]&&(n=1,i++),new xr(br.of(t.slice(0,e)),n,br.of(t.slice(i)));}}]);}();br.prototype.size=1;kr=/*#__PURE__*/function(_br){function kr(t,e,i){var _this29;_classCallCheck(this,kr);_this29=_callSuper(this,kr,[t,e]),_this29.deco=i;return _this29;}_inherits(kr,_br);return _createClass(kr,[{key:"blockAt",value:function blockAt(t,e,i,s){return new mr(s,this.length,i,this.height,this.deco||0);}},{key:"lineAt",value:function lineAt(t,e,i,s,r){return this.blockAt(0,i,s,r);}},{key:"forEachLine",value:function forEachLine(t,e,i,s,r,n){t<=r+this.length&&e>=r&&n(this.blockAt(0,i,s,r));}},{key:"updateHeight",value:function updateHeight(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!1;var s=arguments.length>3?arguments[3]:undefined;return s&&s.from<=e&&s.more&&this.setHeight(s.heights[s.index++]),this.outdated=!1,this;}},{key:"toString",value:function toString(){return"block(".concat(this.length,")");}}]);}(br);yr=/*#__PURE__*/function(_kr){function yr(t,e){var _this30;_classCallCheck(this,yr);_this30=_callSuper(this,yr,[t,e,null]),_this30.collapsed=0,_this30.widgetHeight=0,_this30.breaks=0;return _this30;}_inherits(yr,_kr);return _createClass(yr,[{key:"blockAt",value:function blockAt(t,e,i,s){return new mr(s,this.length,i,this.height,this.breaks);}},{key:"replace",value:function replace(t,e,i){var s=i[0];return 1==i.length&&(s instanceof yr||s instanceof Mr&&4&s.flags)&&Math.abs(this.length-s.length)<10?(s instanceof Mr?s=new yr(s.length,this.height):s.height=this.height,this.outdated||(s.outdated=!1),s):br.of(i);}},{key:"updateHeight",value:function updateHeight(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!1;var s=arguments.length>3?arguments[3]:undefined;return s&&s.from<=e&&s.more?this.setHeight(s.heights[s.index++]):(i||this.outdated)&&this.setHeight(Math.max(this.widgetHeight,t.heightForLine(this.length-this.collapsed))+this.breaks*t.lineHeight),this.outdated=!1,this;}},{key:"toString",value:function toString(){return"line(".concat(this.length).concat(this.collapsed?-this.collapsed:"").concat(this.widgetHeight?":"+this.widgetHeight:"",")");}}]);}(kr);Mr=/*#__PURE__*/function(_br2){function Mr(t){_classCallCheck(this,Mr);return _callSuper(this,Mr,[t,0]);}_inherits(Mr,_br2);return _createClass(Mr,[{key:"heightMetrics",value:function heightMetrics(t,e){var i,s=t.doc.lineAt(e).number,r=t.doc.lineAt(e+this.length).number,n=r-s+1,h=0;if(t.lineWrapping){var _e109=Math.min(this.height,t.lineHeight*n);i=_e109/n,this.length>n+1&&(h=(this.height-_e109)/(this.length-n-1));}else i=this.height/n;return{firstLine:s,lastLine:r,perLine:i,perChar:h};}},{key:"blockAt",value:function blockAt(t,e,i,s){var _this$heightMetrics=this.heightMetrics(e,s),r=_this$heightMetrics.firstLine,n=_this$heightMetrics.lastLine,h=_this$heightMetrics.perLine,l=_this$heightMetrics.perChar;if(e.lineWrapping){var _r78=s+(t<e.lineHeight?0:Math.round(Math.max(0,Math.min(1,(t-i)/this.height))*this.length)),_n63=e.doc.lineAt(_r78),_o27=h+_n63.length*l,_u22=Math.max(i,t-_o27/2);return new mr(_n63.from,_n63.length,_u22,_o27,0);}{var _s90=Math.max(0,Math.min(n-r,Math.floor((t-i)/h))),_e$doc$line=e.doc.line(r+_s90),_l34=_e$doc$line.from,_o28=_e$doc$line.length;return new mr(_l34,_o28,i+h*_s90,h,0);}}},{key:"lineAt",value:function lineAt(t,e,i,s,r){if(e==gr.ByHeight)return this.blockAt(t,i,s,r);if(e==gr.ByPosNoHeight){var _i$doc$lineAt=i.doc.lineAt(t),_e110=_i$doc$lineAt.from,_s91=_i$doc$lineAt.to;return new mr(_e110,_s91-_e110,0,0,0);}var _this$heightMetrics2=this.heightMetrics(i,r),n=_this$heightMetrics2.firstLine,h=_this$heightMetrics2.perLine,l=_this$heightMetrics2.perChar,o=i.doc.lineAt(t),u=h+o.length*l,f=o.number-n,a=s+h*f+l*(o.from-r-f);return new mr(o.from,o.length,Math.max(s,Math.min(a,s+this.height-u)),u,0);}},{key:"forEachLine",value:function forEachLine(t,e,i,s,r,n){t=Math.max(t,r),e=Math.min(e,r+this.length);var _this$heightMetrics3=this.heightMetrics(i,r),h=_this$heightMetrics3.firstLine,l=_this$heightMetrics3.perLine,o=_this$heightMetrics3.perChar;for(var _u23=t,_f17=s;_u23<=e;){var _e111=i.doc.lineAt(_u23);if(_u23==t){var _i99=_e111.number-h;_f17+=l*_i99+o*(t-r-_i99);}var _s92=l+o*_e111.length;n(new mr(_e111.from,_e111.length,_f17,_s92,0)),_f17+=_s92,_u23=_e111.to+1;}}},{key:"replace",value:function replace(t,e,i){var s=this.length-e;if(s>0){var _t110=i[i.length-1];_t110 instanceof Mr?i[i.length-1]=new Mr(_t110.length+s):i.push(null,new Mr(s-1));}if(t>0){var _e112=i[0];_e112 instanceof Mr?i[0]=new Mr(t+_e112.length):i.unshift(new Mr(t-1),null);}return br.of(i);}},{key:"decomposeLeft",value:function decomposeLeft(t,e){e.push(new Mr(t-1),null);}},{key:"decomposeRight",value:function decomposeRight(t,e){e.push(null,new Mr(this.length-t-1));}},{key:"updateHeight",value:function updateHeight(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!1;var s=arguments.length>3?arguments[3]:undefined;var r=e+this.length;if(s&&s.from<=e+this.length&&s.more){var _i100=[],_n64=Math.max(e,s.from),_h42=-1;for(s.from>e&&_i100.push(new Mr(s.from-e-1).updateHeight(t,e));_n64<=r&&s.more;){var _e113=t.doc.lineAt(_n64).length;_i100.length&&_i100.push(null);var _r79=s.heights[s.index++];-1==_h42?_h42=_r79:Math.abs(_r79-_h42)>=wr&&(_h42=-2);var _l35=new yr(_e113,_r79);_l35.outdated=!1,_i100.push(_l35),_n64+=_e113+1;}_n64<=r&&_i100.push(null,new Mr(r-_n64).updateHeight(t,_n64));var _l36=br.of(_i100);return(_h42<0||Math.abs(_l36.height-this.height)>=wr||Math.abs(_h42-this.heightMetrics(t,e).perLine)>=wr)&&(ar=!0),vr(this,_l36);}return(i||this.outdated)&&(this.setHeight(t.heightForGap(e,e+this.length)),this.outdated=!1),this;}},{key:"toString",value:function toString(){return"gap(".concat(this.length,")");}}]);}(br);xr=/*#__PURE__*/function(_br3){function xr(t,e,i){var _this31;_classCallCheck(this,xr);_this31=_callSuper(this,xr,[t.length+e+i.length,t.height+i.height,e|(t.outdated||i.outdated?2:0)]),_this31.left=t,_this31.right=i,_this31.size=t.size+i.size;return _this31;}_inherits(xr,_br3);return _createClass(xr,[{key:"break",get:function get(){return 1&this.flags;}},{key:"blockAt",value:function blockAt(t,e,i,s){var r=i+this.left.height;return t<r?this.left.blockAt(t,e,i,s):this.right.blockAt(t,e,r,s+this.left.length+this["break"]);}},{key:"lineAt",value:function lineAt(t,e,i,s,r){var n=s+this.left.height,h=r+this.left.length+this["break"],l=e==gr.ByHeight?t<n:t<h,o=l?this.left.lineAt(t,e,i,s,r):this.right.lineAt(t,e,i,n,h);if(this["break"]||(l?o.to<h:o.from>h))return o;var u=e==gr.ByPosNoHeight?gr.ByPosNoHeight:gr.ByPos;return l?o.join(this.right.lineAt(h,u,i,n,h)):this.left.lineAt(h,u,i,s,r).join(o);}},{key:"forEachLine",value:function forEachLine(t,e,i,s,r,n){var h=s+this.left.height,l=r+this.left.length+this["break"];if(this["break"])t<l&&this.left.forEachLine(t,e,i,s,r,n),e>=l&&this.right.forEachLine(t,e,i,h,l,n);else{var _o29=this.lineAt(l,gr.ByPos,i,s,r);t<_o29.from&&this.left.forEachLine(t,_o29.from-1,i,s,r,n),_o29.to>=t&&_o29.from<=e&&n(_o29),e>_o29.to&&this.right.forEachLine(_o29.to+1,e,i,h,l,n);}}},{key:"replace",value:function replace(t,e,i){var s=this.left.length+this["break"];if(e<s)return this.balanced(this.left.replace(t,e,i),this.right);if(t>this.left.length)return this.balanced(this.left,this.right.replace(t-s,e-s,i));var r=[];t>0&&this.decomposeLeft(t,r);var n=r.length;var _iterator64=_createForOfIteratorHelper(i),_step64;try{for(_iterator64.s();!(_step64=_iterator64.n()).done;){var _t112=_step64.value;r.push(_t112);}}catch(err){_iterator64.e(err);}finally{_iterator64.f();}if(t>0&&Sr(r,n-1),e<this.length){var _t111=r.length;this.decomposeRight(e,r),Sr(r,_t111);}return br.of(r);}},{key:"decomposeLeft",value:function decomposeLeft(t,e){var i=this.left.length;if(t<=i)return this.left.decomposeLeft(t,e);e.push(this.left),this["break"]&&(i++,t>=i&&e.push(null)),t>i&&this.right.decomposeLeft(t-i,e);}},{key:"decomposeRight",value:function decomposeRight(t,e){var i=this.left.length,s=i+this["break"];if(t>=s)return this.right.decomposeRight(t-s,e);t<i&&this.left.decomposeRight(t,e),this["break"]&&t<s&&e.push(null),e.push(this.right);}},{key:"balanced",value:function balanced(t,e){return t.size>2*e.size||e.size>2*t.size?br.of(this["break"]?[t,null,e]:[t,e]):(this.left=vr(this.left,t),this.right=vr(this.right,e),this.setHeight(t.height+e.height),this.outdated=t.outdated||e.outdated,this.size=t.size+e.size,this.length=t.length+this["break"]+e.length,this);}},{key:"updateHeight",value:function updateHeight(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!1;var s=arguments.length>3?arguments[3]:undefined;var r=this.left,n=this.right,h=e+r.length+this["break"],l=null;return s&&s.from<=e+r.length&&s.more?l=r=r.updateHeight(t,e,i,s):r.updateHeight(t,e,i),s&&s.from<=h+n.length&&s.more?l=n=n.updateHeight(t,h,i,s):n.updateHeight(t,h,i),l?this.balanced(r,n):(this.height=this.left.height+this.right.height,this.outdated=!1,this);}},{key:"toString",value:function toString(){return this.left+(this["break"]?" ":"-")+this.right;}}]);}(br);Ar=/*#__PURE__*/function(){function Ar(t,e){_classCallCheck(this,Ar);this.pos=t,this.oracle=e,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=t;}return _createClass(Ar,[{key:"isCovered",get:function get(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering;}},{key:"span",value:function span(t,e){if(this.lineStart>-1){var _t113=Math.min(e,this.lineEnd),_i101=this.nodes[this.nodes.length-1];_i101 instanceof yr?_i101.length+=_t113-this.pos:(_t113>this.pos||!this.isCovered)&&this.nodes.push(new yr(_t113-this.pos,-1)),this.writtenTo=_t113,e>_t113&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1);}this.pos=e;}},{key:"point",value:function point(t,e,i){if(t<e||i.heightRelevant){var _s93=i.widget?i.widget.estimatedHeight:0,_r80=i.widget?i.widget.lineBreaks:0;_s93<0&&(_s93=this.oracle.lineHeight);var _n65=e-t;i.block?this.addBlock(new kr(_n65,_s93,i)):(_n65||_r80||_s93>=5)&&this.addLineDeco(_s93,_r80,_n65);}else e>t&&this.span(t,e);this.lineEnd>-1&&this.lineEnd<this.pos&&(this.lineEnd=this.oracle.doc.lineAt(this.pos).to);}},{key:"enterLine",value:function enterLine(){if(this.lineStart>-1)return;var _this$oracle$doc$line=this.oracle.doc.lineAt(this.pos),t=_this$oracle$doc$line.from,e=_this$oracle$doc$line.to;this.lineStart=t,this.lineEnd=e,this.writtenTo<t&&((this.writtenTo<t-1||null==this.nodes[this.nodes.length-1])&&this.nodes.push(this.blankContent(this.writtenTo,t-1)),this.nodes.push(null)),this.pos>t&&this.nodes.push(new yr(this.pos-t,-1)),this.writtenTo=this.pos;}},{key:"blankContent",value:function blankContent(t,e){var i=new Mr(e-t);return this.oracle.doc.lineAt(t).to==e&&(i.flags|=4),i;}},{key:"ensureLine",value:function ensureLine(){this.enterLine();var t=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(t instanceof yr)return t;var e=new yr(0,-1);return this.nodes.push(e),e;}},{key:"addBlock",value:function addBlock(t){this.enterLine();var e=t.deco;e&&e.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(t),this.writtenTo=this.pos=this.pos+t.length,e&&e.endSide>0&&(this.covering=t);}},{key:"addLineDeco",value:function addLineDeco(t,e,i){var s=this.ensureLine();s.length+=i,s.collapsed+=i,s.widgetHeight=Math.max(s.widgetHeight,t),s.breaks+=e,this.writtenTo=this.pos=this.pos+i;}},{key:"finish",value:function finish(t){var e=0==this.nodes.length?null:this.nodes[this.nodes.length-1];!(this.lineStart>-1)||e instanceof yr||this.isCovered?(this.writtenTo<this.pos||null==e)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos)):this.nodes.push(new yr(0,-1));var i=t;var _iterator65=_createForOfIteratorHelper(this.nodes),_step65;try{for(_iterator65.s();!(_step65=_iterator65.n()).done;){var _t114=_step65.value;_t114 instanceof yr&&_t114.updateHeight(this.oracle,i),i+=_t114?_t114.length:1;}}catch(err){_iterator65.e(err);}finally{_iterator65.f();}return this.nodes;}}],[{key:"build",value:function build(t,e,i,s){var r=new Ar(i,t);return $t.spans(e,i,s,r,0),r.finish(i);}}]);}();Cr=/*#__PURE__*/function(){function Cr(){_classCallCheck(this,Cr);this.changes=[];}return _createClass(Cr,[{key:"compareRange",value:function compareRange(){}},{key:"comparePoint",value:function comparePoint(t,e,i,s){(t<e||i&&i.heightRelevant||s&&s.heightRelevant)&&oi(t,e,this.changes,5);}}]);}();Er=/*#__PURE__*/function(){function Er(t,e,i,s){_classCallCheck(this,Er);this.from=t,this.to=e,this.size=i,this.displaySize=s;}return _createClass(Er,[{key:"draw",value:function draw(t,e){return si.replace({widget:new Ir(this.displaySize*(e?t.scaleY:t.scaleX),e)}).range(this.from,this.to);}}],[{key:"same",value:function same(t,e){if(t.length!=e.length)return!1;for(var _i103=0;_i103<t.length;_i103++){var _s96=t[_i103],_r81=e[_i103];if(_s96.from!=_r81.from||_s96.to!=_r81.to||_s96.size!=_r81.size)return!1;}return!0;}}]);}();Ir=/*#__PURE__*/function(_ei3){function Ir(t,e){var _this32;_classCallCheck(this,Ir);_this32=_callSuper(this,Ir),_this32.size=t,_this32.vertical=e;return _this32;}_inherits(Ir,_ei3);return _createClass(Ir,[{key:"eq",value:function eq(t){return t.size==this.size&&t.vertical==this.vertical;}},{key:"toDOM",value:function toDOM(){var t=document.createElement("div");return this.vertical?t.style.height=this.size+"px":(t.style.width=this.size+"px",t.style.height="2px",t.style.display="inline-block"),t;}},{key:"estimatedHeight",get:function get(){return this.vertical?this.size:-1;}}]);}(ei);Rr=/*#__PURE__*/function(){function Rr(t){var _this33=this;_classCallCheck(this,Rr);this.state=t,this.pixelViewport={left:0,right:window.innerWidth,top:0,bottom:0},this.inView=!0,this.paddingTop=0,this.paddingBottom=0,this.contentDOMWidth=0,this.contentDOMHeight=0,this.editorHeight=0,this.editorWidth=0,this.scrollTop=0,this.scrolledToBottom=!1,this.scaleX=1,this.scaleY=1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=Nr,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=mi.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;var e=t.facet(is).some(function(t){return"function"!=typeof t&&"cm-lineWrapping"==t["class"];});this.heightOracle=new dr(e),this.stateDeco=t.facet(ss).filter(function(t){return"function"!=typeof t;}),this.heightMap=br.empty().applyChanges(this.stateDeco,p.empty,this.heightOracle.setDoc(t.doc),[new as(0,0,0,t.doc.length)]);for(var _t115=0;_t115<2&&(this.viewport=this.getViewport(0,null),this.updateForViewport());_t115++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=si.set(this.lineGaps.map(function(t){return t.draw(_this33,!1);})),this.computeVisibleRanges();}return _createClass(Rr,[{key:"updateForViewport",value:function updateForViewport(){var _this34=this;var t=[this.viewport],e=this.state.selection.main;var _loop7=function _loop7(){var s=_i104?e.head:e.anchor;if(!t.some(function(_ref8){var t=_ref8.from,e=_ref8.to;return s>=t&&s<=e;})){var _this34$lineBlockAt=_this34.lineBlockAt(s),_e115=_this34$lineBlockAt.from,_i105=_this34$lineBlockAt.to;t.push(new Tr(_e115,_i105));}};for(var _i104=0;_i104<=1;_i104++){_loop7();}return this.viewports=t.sort(function(t,e){return t.from-e.from;}),this.updateScaler();}},{key:"updateScaler",value:function updateScaler(){var t=this.scaler;return this.scaler=this.heightMap.height<=7e6?Nr:new $r(this.heightOracle,this.heightMap,this.viewports),t.eq(this.scaler)?0:2;}},{key:"updateViewportLines",value:function updateViewportLines(){var _this35=this;this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,function(t){_this35.viewportLines.push(jr(t,_this35.scaler));});}},{key:"update",value:function update(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:null;this.state=t.state;var i=this.stateDeco;this.stateDeco=this.state.facet(ss).filter(function(t){return"function"!=typeof t;});var s=t.changedRanges,r=as.extendWithRanges(s,function(t,e,i){var s=new Cr();return $t.compare(t,e,i,s,0),s.changes;}(i,this.stateDeco,t?t.changes:R.empty(this.state.doc.length))),n=this.heightMap.height,h=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);cr(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,t.startState.doc,this.heightOracle.setDoc(this.state.doc),r),(this.heightMap.height!=n||ar)&&(t.flags|=2),h?(this.scrollAnchorPos=t.changes.mapPos(h.from,-1),this.scrollAnchorHeight=h.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=this.heightMap.height);var l=r.length?this.mapViewport(this.viewport,t.changes):this.viewport;(e&&(e.range.head<l.from||e.range.head>l.to)||!this.viewportIsAppropriate(l))&&(l=this.getViewport(0,e));var o=l.from!=this.viewport.from||l.to!=this.viewport.to;this.viewport=l,t.flags|=this.updateForViewport(),(o||!t.changes.empty||2&t.flags)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,t.changes))),t.flags|=this.computeVisibleRanges(t.changes),e&&(this.scrollTarget=e),!this.mustEnforceCursorAssoc&&t.selectionSet&&t.view.lineWrapping&&t.state.selection.main.empty&&t.state.selection.main.assoc&&!t.state.facet(qi)&&(this.mustEnforceCursorAssoc=!0);}},{key:"measure",value:function measure(t){var e=t.contentDOM,i=window.getComputedStyle(e),s=this.heightOracle,r=i.whiteSpace;this.defaultTextDirection="rtl"==i.direction?mi.RTL:mi.LTR;var n=this.heightOracle.mustRefreshForWrapping(r),h=e.getBoundingClientRect(),l=n||this.mustMeasureContent||this.contentDOMHeight!=h.height;this.contentDOMHeight=h.height,this.mustMeasureContent=!1;var o=0,u=0;if(h.width&&h.height){var _de2=de(e,h),_t116=_de2.scaleX,_i106=_de2.scaleY;(_t116>.005&&Math.abs(this.scaleX-_t116)>.005||_i106>.005&&Math.abs(this.scaleY-_i106)>.005)&&(this.scaleX=_t116,this.scaleY=_i106,o|=16,n=l=!0);}var f=(parseInt(i.paddingTop)||0)*this.scaleY,a=(parseInt(i.paddingBottom)||0)*this.scaleY;this.paddingTop==f&&this.paddingBottom==a||(this.paddingTop=f,this.paddingBottom=a,o|=18),this.editorWidth!=t.scrollDOM.clientWidth&&(s.lineWrapping&&(l=!0),this.editorWidth=t.scrollDOM.clientWidth,o|=16);var c=t.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=c&&(this.scrollAnchorHeight=-1,this.scrollTop=c),this.scrolledToBottom=ye(t.scrollDOM);var d=(this.printing?Dr:Or)(e,this.paddingTop),m=d.top-this.pixelViewport.top,g=d.bottom-this.pixelViewport.bottom;this.pixelViewport=d;var w=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(w!=this.inView&&(this.inView=w,w&&(l=!0)),!this.inView&&!this.scrollTarget&&!function(t){var e=t.getBoundingClientRect(),i=t.ownerDocument.defaultView||window;return e.left<i.innerWidth&&e.right>0&&e.top<i.innerHeight&&e.bottom>0;}(t.dom))return 0;var b=h.width;if(this.contentDOMWidth==b&&this.editorHeight==t.scrollDOM.clientHeight||(this.contentDOMWidth=h.width,this.editorHeight=t.scrollDOM.clientHeight,o|=16),l){var _e116=t.docView.measureVisibleLineHeights(this.viewport);if(s.mustRefreshForHeights(_e116)&&(n=!0),n||s.lineWrapping&&Math.abs(b-this.contentDOMWidth)>s.charWidth){var _t$docView$measureTex=t.docView.measureTextSize(),_i107=_t$docView$measureTex.lineHeight,_h43=_t$docView$measureTex.charWidth,_l37=_t$docView$measureTex.textHeight;n=_i107>0&&s.refresh(r,_i107,_h43,_l37,b/_h43,_e116),n&&(t.docView.minWidth=0,o|=16);}m>0&&g>0?u=Math.max(m,g):m<0&&g<0&&(u=Math.min(m,g)),cr();var _iterator66=_createForOfIteratorHelper(this.viewports),_step66;try{for(_iterator66.s();!(_step66=_iterator66.n()).done;){var _i108=_step66.value;var _r82=_i108.from==this.viewport.from?_e116:t.docView.measureVisibleLineHeights(_i108);this.heightMap=(n?br.empty().applyChanges(this.stateDeco,p.empty,this.heightOracle,[new as(0,0,0,t.state.doc.length)]):this.heightMap).updateHeight(s,0,n,new pr(_i108.from,_r82));}}catch(err){_iterator66.e(err);}finally{_iterator66.f();}ar&&(o|=2);}var v=!this.viewportIsAppropriate(this.viewport,u)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return v&&(2&o&&(o|=this.updateScaler()),this.viewport=this.getViewport(u,this.scrollTarget),o|=this.updateForViewport()),(2&o||v)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(n?[]:this.lineGaps,t)),o|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,t.docView.enforceCursorAssoc()),o;}},{key:"visibleTop",get:function get(){return this.scaler.fromDOM(this.pixelViewport.top);}},{key:"visibleBottom",get:function get(){return this.scaler.fromDOM(this.pixelViewport.bottom);}},{key:"getViewport",value:function getViewport(t,e){var i=.5-Math.max(-.5,Math.min(.5,t/1e3/2)),s=this.heightMap,r=this.heightOracle,n=this.visibleTop,h=this.visibleBottom,l=new Tr(s.lineAt(n-1e3*i,gr.ByHeight,r,0,0).from,s.lineAt(h+1e3*(1-i),gr.ByHeight,r,0,0).to);if(e){var _t117=e.range.head;if(_t117<l.from||_t117>l.to){var _i109,_n66=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),_h44=s.lineAt(_t117,gr.ByPos,r,0,0);_i109="center"==e.y?(_h44.top+_h44.bottom)/2-_n66/2:"start"==e.y||"nearest"==e.y&&_t117<l.from?_h44.top:_h44.bottom-_n66,l=new Tr(s.lineAt(_i109-500,gr.ByHeight,r,0,0).from,s.lineAt(_i109+_n66+500,gr.ByHeight,r,0,0).to);}}return l;}},{key:"mapViewport",value:function mapViewport(t,e){var i=e.mapPos(t.from,-1),s=e.mapPos(t.to,1);return new Tr(this.heightMap.lineAt(i,gr.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(s,gr.ByPos,this.heightOracle,0,0).to);}},{key:"viewportIsAppropriate",value:function viewportIsAppropriate(_ref9){var t=_ref9.from,e=_ref9.to;var i=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;if(!this.inView)return!0;var _this$heightMap$lineA=this.heightMap.lineAt(t,gr.ByPos,this.heightOracle,0,0),s=_this$heightMap$lineA.top,_this$heightMap$lineA2=this.heightMap.lineAt(e,gr.ByPos,this.heightOracle,0,0),r=_this$heightMap$lineA2.bottom,n=this.visibleTop,h=this.visibleBottom;return(0==t||s<=n-Math.max(10,Math.min(-i,250)))&&(e==this.state.doc.length||r>=h+Math.max(10,Math.min(i,250)))&&s>n-2e3&&r<h+2e3;}},{key:"mapLineGaps",value:function mapLineGaps(t,e){if(!t.length||e.empty)return t;var i=[];var _iterator67=_createForOfIteratorHelper(t),_step67;try{for(_iterator67.s();!(_step67=_iterator67.n()).done;){var _s97=_step67.value;e.touchesRange(_s97.from,_s97.to)||i.push(new Er(e.mapPos(_s97.from),e.mapPos(_s97.to),_s97.size,_s97.displaySize));}}catch(err){_iterator67.e(err);}finally{_iterator67.f();}return i;}},{key:"ensureLineGaps",value:function ensureLineGaps(t,e){var _this36=this;var i=this.heightOracle.lineWrapping,s=i?1e4:2e3,r=s>>1,n=s<<1;if(this.defaultTextDirection!=mi.LTR&&!i)return[];var h=[],_l38=function l(s,n,o,u){if(n-s<r)return;var f=_this36.state.selection.main,a=[f.from];f.empty||a.push(f.to);for(var _i110=0,_a12=a;_i110<_a12.length;_i110++){var _t118=_a12[_i110];if(_t118>s&&_t118<n)return _l38(s,_t118-10,o,u),void _l38(_t118+10,n,o,u);}var c=function(t,e){var _iterator68=_createForOfIteratorHelper(t),_step68;try{for(_iterator68.s();!(_step68=_iterator68.n()).done;){var _i111=_step68.value;if(e(_i111))return _i111;}}catch(err){_iterator68.e(err);}finally{_iterator68.f();}return;}(t,function(t){return t.from>=o.from&&t.to<=o.to&&Math.abs(t.from-s)<r&&Math.abs(t.to-n)<r&&!a.some(function(e){return t.from<e&&t.to>e;});});if(!c){if(n<o.to&&e&&i&&e.visibleRanges.some(function(t){return t.from<=n&&t.to>=n;})){var _t119=e.moveToLineBoundary(P.cursor(n),!1,!0).head;_t119>s&&(n=_t119);}var _t120=_this36.gapSize(o,s,n,u);c=new Er(s,n,_t120,i||_t120<2e6?_t120:2e6);}h.push(c);},o=function o(e){if(e.length<n||e.type!=ii.Text)return;var r=function(t,e,i){var s=[],r=t,n=0;$t.spans(i,t,e,{span:function span(){},point:function point(t,e){t>r&&(s.push({from:r,to:t}),n+=t-r),r=e;}},20),r<e&&(s.push({from:r,to:e}),n+=e-r);return{total:n,ranges:s};}(e.from,e.to,_this36.stateDeco);if(r.total<n)return;var h,o,u=_this36.scrollTarget?_this36.scrollTarget.range.head:null;if(i){var _t121,_i112,_n67=s/_this36.heightOracle.lineLength*_this36.heightOracle.lineHeight;if(null!=u){var _s98=Lr(r,u),_h45=((_this36.visibleBottom-_this36.visibleTop)/2+_n67)/e.height;_t121=_s98-_h45,_i112=_s98+_h45;}else _t121=(_this36.visibleTop-e.top-_n67)/e.height,_i112=(_this36.visibleBottom-e.top+_n67)/e.height;h=Br(r,_t121),o=Br(r,_i112);}else{var _i113=r.total*_this36.heightOracle.charWidth,_n68=s*_this36.heightOracle.charWidth,_l39=0;if(_i113>2e6){var _iterator69=_createForOfIteratorHelper(t),_step69;try{for(_iterator69.s();!(_step69=_iterator69.n()).done;){var _i114=_step69.value;_i114.from>=e.from&&_i114.from<e.to&&_i114.size!=_i114.displaySize&&_i114.from*_this36.heightOracle.charWidth+_l39<_this36.pixelViewport.left&&(_l39=_i114.size-_i114.displaySize);}}catch(err){_iterator69.e(err);}finally{_iterator69.f();}}var _f18,_a13,_c10=_this36.pixelViewport.left+_l39,_d8=_this36.pixelViewport.right+_l39;if(null!=u){var _t122=Lr(r,u),_e117=((_d8-_c10)/2+_n68)/_i113;_f18=_t122-_e117,_a13=_t122+_e117;}else _f18=(_c10-_n68)/_i113,_a13=(_d8+_n68)/_i113;h=Br(r,_f18),o=Br(r,_a13);}h>e.from&&_l38(e.from,h,e,r),o<e.to&&_l38(o,e.to,e,r);};var _iterator70=_createForOfIteratorHelper(this.viewportLines),_step70;try{for(_iterator70.s();!(_step70=_iterator70.n()).done;){var _t123=_step70.value;Array.isArray(_t123.type)?_t123.type.forEach(o):o(_t123);}}catch(err){_iterator70.e(err);}finally{_iterator70.f();}return h;}},{key:"gapSize",value:function gapSize(t,e,i,s){var r=Lr(s,i)-Lr(s,e);return this.heightOracle.lineWrapping?t.height*r:s.total*this.heightOracle.charWidth*r;}},{key:"updateLineGaps",value:function updateLineGaps(t){var _this37=this;Er.same(t,this.lineGaps)||(this.lineGaps=t,this.lineGapDeco=si.set(t.map(function(t){return t.draw(_this37,_this37.heightOracle.lineWrapping);})));}},{key:"computeVisibleRanges",value:function computeVisibleRanges(t){var e=this.stateDeco;this.lineGaps.length&&(e=e.concat(this.lineGapDeco));var i=[];$t.spans(e,this.viewport.from,this.viewport.to,{span:function span(t,e){i.push({from:t,to:e});},point:function point(){}},20);var s=0;if(i.length!=this.visibleRanges.length)s=12;else for(var _e118=0;_e118<i.length&&!(8&s);_e118++){var _r83=this.visibleRanges[_e118],_n69=i[_e118];_r83.from==_n69.from&&_r83.to==_n69.to||(s|=4,t&&t.mapPos(_r83.from,-1)==_n69.from&&t.mapPos(_r83.to,1)==_n69.to||(s|=8));}return this.visibleRanges=i,s;}},{key:"lineBlockAt",value:function lineBlockAt(t){return t>=this.viewport.from&&t<=this.viewport.to&&this.viewportLines.find(function(e){return e.from<=t&&e.to>=t;})||jr(this.heightMap.lineAt(t,gr.ByPos,this.heightOracle,0,0),this.scaler);}},{key:"lineBlockAtHeight",value:function lineBlockAtHeight(t){return t>=this.viewportLines[0].top&&t<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(function(e){return e.top<=t&&e.bottom>=t;})||jr(this.heightMap.lineAt(this.scaler.fromDOM(t),gr.ByHeight,this.heightOracle,0,0),this.scaler);}},{key:"scrollAnchorAt",value:function scrollAnchorAt(t){var e=this.lineBlockAtHeight(t+8);return e.from>=this.viewport.from||this.viewportLines[0].top-t>200?e:this.viewportLines[0];}},{key:"elementAtHeight",value:function elementAtHeight(t){return jr(this.heightMap.blockAt(this.scaler.fromDOM(t),this.heightOracle,0,0),this.scaler);}},{key:"docHeight",get:function get(){return this.scaler.toDOM(this.heightMap.height);}},{key:"contentHeight",get:function get(){return this.docHeight+this.paddingTop+this.paddingBottom;}}]);}();Tr=/*#__PURE__*/_createClass(function Tr(t,e){_classCallCheck(this,Tr);this.from=t,this.to=e;});Nr={toDOM:function toDOM(t){return t;},fromDOM:function fromDOM(t){return t;},scale:1,eq:function eq(t){return t==this;}};$r=/*#__PURE__*/function(){function $r(t,e,i){_classCallCheck(this,$r);var s=0,r=0,n=0;this.viewports=i.map(function(_ref11){var i=_ref11.from,r=_ref11.to;var n=e.lineAt(i,gr.ByPos,t,0,0).top,h=e.lineAt(r,gr.ByPos,t,0,0).bottom;return s+=h-n,{from:i,to:r,top:n,bottom:h,domTop:0,domBottom:0};}),this.scale=(7e6-s)/(e.height-s);var _iterator72=_createForOfIteratorHelper(this.viewports),_step72;try{for(_iterator72.s();!(_step72=_iterator72.n()).done;){var _t125=_step72.value;_t125.domTop=n+(_t125.top-r)*this.scale,n=_t125.domBottom=_t125.domTop+(_t125.bottom-_t125.top),r=_t125.bottom;}}catch(err){_iterator72.e(err);}finally{_iterator72.f();}}return _createClass($r,[{key:"toDOM",value:function toDOM(t){for(var _e119=0,_i116=0,_s100=0;;_e119++){var _r86=_e119<this.viewports.length?this.viewports[_e119]:null;if(!_r86||t<_r86.top)return _s100+(t-_i116)*this.scale;if(t<=_r86.bottom)return _r86.domTop+(t-_r86.top);_i116=_r86.bottom,_s100=_r86.domBottom;}}},{key:"fromDOM",value:function fromDOM(t){for(var _e120=0,_i117=0,_s101=0;;_e120++){var _r87=_e120<this.viewports.length?this.viewports[_e120]:null;if(!_r87||t<_r87.domTop)return _i117+(t-_s101)/this.scale;if(t<=_r87.domBottom)return _r87.top+(t-_r87.domTop);_i117=_r87.bottom,_s101=_r87.domBottom;}}},{key:"eq",value:function eq(t){return t instanceof $r&&this.scale==t.scale&&this.viewports.length==t.viewports.length&&this.viewports.every(function(e,i){return e.from==t.viewports[i].from&&e.to==t.viewports[i].to;});}}]);}();zr=F.define({combine:function combine(t){return t.join(" ");}}),Pr=F.define({combine:function combine(t){return t.indexOf(!0)>-1;}}),Hr=Zt.newName(),Wr=Zt.newName(),Fr=Zt.newName(),Vr={"&light":"."+Wr,"&dark":"."+Fr};Jr=qr("."+Hr,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",insetInlineStart:0,zIndex:200},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",borderRight:"1px solid #ddd"},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:'url(\'data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="20"><path stroke="%23888" stroke-width="1" fill="none" d="M1 10H196L190 5M190 15L196 10M197 4L197 16"/></svg>\')',backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},Vr),Ur={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},Gr=Fe.ie&&Fe.ie_version<=11;Kr=/*#__PURE__*/function(){function Kr(t){var _this38=this;_classCallCheck(this,Kr);this.view=t,this.active=!1,this.editContext=null,this.selectionRange=new pe(),this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=t.contentDOM,this.observer=new MutationObserver(function(e){var _iterator73=_createForOfIteratorHelper(e),_step73;try{for(_iterator73.s();!(_step73=_iterator73.n()).done;){var _t126=_step73.value;_this38.queue.push(_t126);}}catch(err){_iterator73.e(err);}finally{_iterator73.f();}(Fe.ie&&Fe.ie_version<=11||Fe.ios&&t.composing)&&e.some(function(t){return"childList"==t.type&&t.removedNodes.length||"characterData"==t.type&&t.oldValue.length>t.target.nodeValue.length;})?_this38.flushSoon():_this38.flush();}),!window.EditContext||!1===t.constructor.EDIT_CONTEXT||Fe.chrome&&Fe.chrome_version<126||(this.editContext=new Yr(t),t.state.facet(Xi)&&(t.contentDOM.editContext=this.editContext.editContext)),Gr&&(this.onCharData=function(t){_this38.queue.push({target:t.target,type:"characterData",oldValue:t.prevValue}),_this38.flushSoon();}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),"function"==typeof ResizeObserver&&(this.resizeScroll=new ResizeObserver(function(){var t;(null===(t=_this38.view.docView)||void 0===t?void 0:t.lastUpdate)<Date.now()-75&&_this38.onResize();}),this.resizeScroll.observe(t.scrollDOM)),this.addWindowListeners(this.win=t.win),this.start(),"function"==typeof IntersectionObserver&&(this.intersection=new IntersectionObserver(function(t){_this38.parentCheck<0&&(_this38.parentCheck=setTimeout(_this38.listenForScroll.bind(_this38),1e3)),t.length>0&&t[t.length-1].intersectionRatio>0!=_this38.intersecting&&(_this38.intersecting=!_this38.intersecting,_this38.intersecting!=_this38.view.inView&&_this38.onScrollChanged(document.createEvent("Event")));},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(function(t){t.length>0&&t[t.length-1].intersectionRatio>0&&_this38.onScrollChanged(document.createEvent("Event"));},{})),this.listenForScroll(),this.readSelectionRange();}return _createClass(Kr,[{key:"onScrollChanged",value:function onScrollChanged(t){this.view.inputState.runHandlers("scroll",t),this.intersecting&&this.view.measure();}},{key:"onScroll",value:function onScroll(t){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(t);}},{key:"onResize",value:function onResize(){var _this39=this;this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(function(){_this39.resizeTimeout=-1,_this39.view.requestMeasure();},50));}},{key:"onPrint",value:function onPrint(t){var _this40=this;("change"!=t.type&&t.type||t.matches)&&(this.view.viewState.printing=!0,this.view.measure(),setTimeout(function(){_this40.view.viewState.printing=!1,_this40.view.requestMeasure();},500));}},{key:"updateGaps",value:function updateGaps(t){if(this.gapIntersection&&(t.length!=this.gaps.length||this.gaps.some(function(e,i){return e!=t[i];}))){this.gapIntersection.disconnect();var _iterator74=_createForOfIteratorHelper(t),_step74;try{for(_iterator74.s();!(_step74=_iterator74.n()).done;){var _e121=_step74.value;this.gapIntersection.observe(_e121);}}catch(err){_iterator74.e(err);}finally{_iterator74.f();}this.gaps=t;}}},{key:"onSelectionChange",value:function onSelectionChange(t){var e=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;var i=this.view,s=this.selectionRange;if(i.state.facet(Xi)?i.root.activeElement!=this.dom:!re(this.dom,s))return;var r=s.anchorNode&&i.docView.nearest(s.anchorNode);r&&r.ignoreEvent(t)?e||(this.selectionChanged=!1):(Fe.ie&&Fe.ie_version<=11||Fe.android&&Fe.chrome)&&!i.state.selection.main.empty&&s.focusNode&&he(s.focusNode,s.focusOffset,s.anchorNode,s.anchorOffset)?this.flushSoon():this.flush(!1);}},{key:"readSelectionRange",value:function readSelectionRange(){var t=this.view,e=ie(t.root);if(!e)return!1;var i=Fe.safari&&11==t.root.nodeType&&t.root.activeElement==this.dom&&function(t,e){if(e.getComposedRanges){var _i118=e.getComposedRanges(t.root)[0];if(_i118)return Xr(t,_i118);}var i=null;function s(t){t.preventDefault(),t.stopImmediatePropagation(),i=t.getTargetRanges()[0];}return t.contentDOM.addEventListener("beforeinput",s,!0),t.dom.ownerDocument.execCommand("indent"),t.contentDOM.removeEventListener("beforeinput",s,!0),i?Xr(t,i):null;}(this.view,e)||e;if(!i||this.selectionRange.eq(i))return!1;var s=re(this.dom,i);return s&&!this.selectionChanged&&t.inputState.lastFocusTime>Date.now()-200&&t.inputState.lastTouchTime<Date.now()-300&&function(t,e){var i=e.focusNode,s=e.focusOffset;if(!i||e.anchorNode!=i||e.anchorOffset!=s)return!1;for(s=Math.min(s,fe(i));;)if(s){if(1!=i.nodeType)return!1;var _t127=i.childNodes[s-1];"false"==_t127.contentEditable?s--:(i=_t127,s=fe(i));}else{if(i==t)return!0;s=le(i),i=i.parentNode;}}(this.dom,i)?(this.view.inputState.lastFocusTime=0,t.docView.updateSelection(),!1):(this.selectionRange.setRange(i),s&&(this.selectionChanged=!0),!0);}},{key:"setSelectionRange",value:function setSelectionRange(t,e){this.selectionRange.set(t.node,t.offset,e.node,e.offset),this.selectionChanged=!1;}},{key:"clearSelectionRange",value:function clearSelectionRange(){this.selectionRange.set(null,0,null,0);}},{key:"listenForScroll",value:function listenForScroll(){this.parentCheck=-1;var t=0,e=null;for(var _i119=this.dom;_i119;)if(1==_i119.nodeType)!e&&t<this.scrollTargets.length&&this.scrollTargets[t]==_i119?t++:e||(e=this.scrollTargets.slice(0,t)),e&&e.push(_i119),_i119=_i119.assignedSlot||_i119.parentNode;else{if(11!=_i119.nodeType)break;_i119=_i119.host;}if(t<this.scrollTargets.length&&!e&&(e=this.scrollTargets.slice(0,t)),e){var _iterator75=_createForOfIteratorHelper(this.scrollTargets),_step75;try{for(_iterator75.s();!(_step75=_iterator75.n()).done;){var _t128=_step75.value;_t128.removeEventListener("scroll",this.onScroll);}}catch(err){_iterator75.e(err);}finally{_iterator75.f();}var _iterator76=_createForOfIteratorHelper(this.scrollTargets=e),_step76;try{for(_iterator76.s();!(_step76=_iterator76.n()).done;){var _t129=_step76.value;_t129.addEventListener("scroll",this.onScroll);}}catch(err){_iterator76.e(err);}finally{_iterator76.f();}}}},{key:"ignore",value:function ignore(t){if(!this.active)return t();try{return this.stop(),t();}finally{this.start(),this.clear();}}},{key:"start",value:function start(){this.active||(this.observer.observe(this.dom,Ur),Gr&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0);}},{key:"stop",value:function stop(){this.active&&(this.active=!1,this.observer.disconnect(),Gr&&this.dom.removeEventListener("DOMCharacterDataModified",this.onCharData));}},{key:"clear",value:function clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1;}},{key:"delayAndroidKey",value:function delayAndroidKey(t,e){var _this41=this;var i;if(!this.delayedAndroidKey){var _t130=function _t130(){var t=_this41.delayedAndroidKey;if(t){_this41.clearDelayedAndroidKey(),_this41.view.inputState.lastKeyCode=t.keyCode,_this41.view.inputState.lastKeyTime=Date.now(),!_this41.flush()&&t.force&&ve(_this41.dom,t.key,t.keyCode);}};this.flushingAndroidKey=this.view.win.requestAnimationFrame(_t130);}this.delayedAndroidKey&&"Enter"!=t||(this.delayedAndroidKey={key:t,keyCode:e,force:this.lastChange<Date.now()-50||!!(null===(i=this.delayedAndroidKey)||void 0===i?void 0:i.force)});}},{key:"clearDelayedAndroidKey",value:function clearDelayedAndroidKey(){this.win.cancelAnimationFrame(this.flushingAndroidKey),this.delayedAndroidKey=null,this.flushingAndroidKey=-1;}},{key:"flushSoon",value:function flushSoon(){var _this42=this;this.delayedFlush<0&&(this.delayedFlush=this.view.win.requestAnimationFrame(function(){_this42.delayedFlush=-1,_this42.flush();}));}},{key:"forceFlush",value:function forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush();}},{key:"pendingRecords",value:function pendingRecords(){var _iterator77=_createForOfIteratorHelper(this.observer.takeRecords()),_step77;try{for(_iterator77.s();!(_step77=_iterator77.n()).done;){var _t131=_step77.value;this.queue.push(_t131);}}catch(err){_iterator77.e(err);}finally{_iterator77.f();}return this.queue;}},{key:"processRecords",value:function processRecords(){var t=this.pendingRecords();t.length&&(this.queue=[]);var e=-1,i=-1,s=!1;var _iterator78=_createForOfIteratorHelper(t),_step78;try{for(_iterator78.s();!(_step78=_iterator78.n()).done;){var _t133;var _r88=_step78.value;var _t132=this.readMutation(_r88);_t132&&(_t132.typeOver&&(s=!0),-1==e?(_t133=_t132,e=_t133.from,i=_t133.to,_t133):(e=Math.min(_t132.from,e),i=Math.max(_t132.to,i)));}}catch(err){_iterator78.e(err);}finally{_iterator78.f();}return{from:e,to:i,typeOver:s};}},{key:"readChange",value:function readChange(){var _this$processRecords=this.processRecords(),t=_this$processRecords.from,e=_this$processRecords.to,i=_this$processRecords.typeOver,s=this.selectionChanged&&re(this.dom,this.selectionRange);if(t<0&&!s)return null;t>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;var r=new Bs(this.view,t,e,i);return this.view.docView.domChanged={newSel:r.newSel?r.newSel.main:null},r;}},{key:"flush",value:function flush(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:!0;if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;t&&this.readSelectionRange();var e=this.readChange();if(!e)return this.view.requestMeasure(),!1;var i=this.view.state,s=Ls(this.view,e);return this.view.state==i&&(e.domChanged||e.newSel&&!e.newSel.main.eq(this.view.state.selection.main))&&this.view.update([]),s;}},{key:"readMutation",value:function readMutation(t){var e=this.view.docView.nearest(t.target);if(!e||e.ignoreMutation(t))return null;if(e.markDirty("attributes"==t.type),"attributes"==t.type&&(e.flags|=4),"childList"==t.type){var _i120=_r(e,t.previousSibling||t.target.previousSibling,-1),_s102=_r(e,t.nextSibling||t.target.nextSibling,1);return{from:_i120?e.posAfter(_i120):e.posAtStart,to:_s102?e.posBefore(_s102):e.posAtEnd,typeOver:!1};}return"characterData"==t.type?{from:e.posAtStart,to:e.posAtEnd,typeOver:t.target.nodeValue==t.oldValue}:null;}},{key:"setWindow",value:function setWindow(t){t!=this.win&&(this.removeWindowListeners(this.win),this.win=t,this.addWindowListeners(this.win));}},{key:"addWindowListeners",value:function addWindowListeners(t){t.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):t.addEventListener("beforeprint",this.onPrint),t.addEventListener("scroll",this.onScroll),t.document.addEventListener("selectionchange",this.onSelectionChange);}},{key:"removeWindowListeners",value:function removeWindowListeners(t){t.removeEventListener("scroll",this.onScroll),t.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):t.removeEventListener("beforeprint",this.onPrint),t.document.removeEventListener("selectionchange",this.onSelectionChange);}},{key:"update",value:function update(t){this.editContext&&(this.editContext.update(t),t.startState.facet(Xi)!=t.state.facet(Xi)&&(t.view.contentDOM.editContext=t.state.facet(Xi)?this.editContext.editContext:null));}},{key:"destroy",value:function destroy(){var t,e,i;this.stop(),null===(t=this.intersection)||void 0===t||t.disconnect(),null===(e=this.gapIntersection)||void 0===e||e.disconnect(),null===(i=this.resizeScroll)||void 0===i||i.disconnect();var _iterator79=_createForOfIteratorHelper(this.scrollTargets),_step79;try{for(_iterator79.s();!(_step79=_iterator79.n()).done;){var _t134=_step79.value;_t134.removeEventListener("scroll",this.onScroll);}}catch(err){_iterator79.e(err);}finally{_iterator79.f();}this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy());}}]);}();Yr=/*#__PURE__*/function(){function Yr(t){var _this43=this;_classCallCheck(this,Yr);this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(t.state);var e=this.editContext=new window.EditContext({text:t.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,t.state.selection.main.anchor))),selectionEnd:this.toContextPos(t.state.selection.main.head)});this.handlers.textupdate=function(e){var i=t.state.selection.main,s=i.anchor,r=i.head,n=_this43.toEditorPos(e.updateRangeStart),h=_this43.toEditorPos(e.updateRangeEnd);t.inputState.composing>=0&&!_this43.composing&&(_this43.composing={contextBase:e.updateRangeStart,editorBase:n,drifted:!1});var l={from:n,to:h,insert:p.of(e.text.split("\n"))};if(l.from==_this43.from&&s<_this43.from?l.from=s:l.to==_this43.to&&s>_this43.to&&(l.to=s),l.from!=l.to||l.insert.length){if((Fe.mac||Fe.android)&&l.from==r-1&&/^\. ?$/.test(e.text)&&"off"==t.contentDOM.getAttribute("autocorrect")&&(l={from:n,to:h,insert:p.of([e.text.replace("."," ")])}),_this43.pendingContextChange=l,!t.state.readOnly){var _i121=_this43.to-_this43.from+(l.to-l.from+l.insert.length);Ns(t,l,P.single(_this43.toEditorPos(e.selectionStart,_i121),_this43.toEditorPos(e.selectionEnd,_i121)));}_this43.pendingContextChange&&(_this43.revertPending(t.state),_this43.setSelection(t.state));}else{var _s104=P.single(_this43.toEditorPos(e.selectionStart),_this43.toEditorPos(e.selectionEnd));_s104.main.eq(i)||t.dispatch({selection:_s104,userEvent:"select"});}},this.handlers.characterboundsupdate=function(i){var s=[],r=null;for(var _e122=_this43.toEditorPos(i.rangeStart),_n71=_this43.toEditorPos(i.rangeEnd);_e122<_n71;_e122++){var _i122=t.coordsForChar(_e122);r=_i122&&new DOMRect(_i122.left,_i122.top,_i122.right-_i122.left,_i122.bottom-_i122.top)||r||new DOMRect(),s.push(r);}e.updateCharacterBounds(i.rangeStart,s);},this.handlers.textformatupdate=function(e){var i=[];var _iterator80=_createForOfIteratorHelper(e.getTextFormats()),_step80;try{for(_iterator80.s();!(_step80=_iterator80.n()).done;){var _t135=_step80.value;var _e123=_t135.underlineStyle,_s105=_t135.underlineThickness;if("None"!=_e123&&"None"!=_s105){var _r90=_this43.toEditorPos(_t135.rangeStart),_n72=_this43.toEditorPos(_t135.rangeEnd);if(_r90<_n72){var _t136="text-decoration: underline ".concat("Dashed"==_e123?"dashed ":"Squiggle"==_e123?"wavy ":"").concat("Thin"==_s105?1:2,"px");i.push(si.mark({attributes:{style:_t136}}).range(_r90,_n72));}}}}catch(err){_iterator80.e(err);}finally{_iterator80.f();}t.dispatch({effects:Ki.of(si.set(i))});},this.handlers.compositionstart=function(){t.inputState.composing<0&&(t.inputState.composing=0,t.inputState.compositionFirstChange=!0);},this.handlers.compositionend=function(){if(t.inputState.composing=-1,t.inputState.compositionFirstChange=null,_this43.composing){var _e124=_this43.composing.drifted;_this43.composing=null,_e124&&_this43.reset(t.state);}};for(var _t137 in this.handlers)e.addEventListener(_t137,this.handlers[_t137]);this.measureReq={read:function read(t){_this43.editContext.updateControlBounds(t.contentDOM.getBoundingClientRect());var e=ie(t.root);e&&e.rangeCount&&_this43.editContext.updateSelectionBounds(e.getRangeAt(0).getBoundingClientRect());}};}return _createClass(Yr,[{key:"applyEdits",value:function applyEdits(t){var _this44=this;var e=0,i=!1,s=this.pendingContextChange;return t.changes.iterChanges(function(r,n,h,l,o){if(i)return;var u=o.length-(n-r);if(s&&n>=s.to){if(s.from==r&&s.to==n&&s.insert.eq(o))return s=_this44.pendingContextChange=null,e+=u,void(_this44.to+=u);s=null,_this44.revertPending(t.state);}if(r+=e,(n+=e)<=_this44.from)_this44.from+=u,_this44.to+=u;else if(r<_this44.to){if(r<_this44.from||n>_this44.to||_this44.to-_this44.from+o.length>3e4)return void(i=!0);_this44.editContext.updateText(_this44.toContextPos(r),_this44.toContextPos(n),o.toString()),_this44.to+=u;}e+=u;}),s&&!i&&this.revertPending(t.state),!i;}},{key:"update",value:function update(t){var _this45=this;var e=this.pendingContextChange;this.composing&&(this.composing.drifted||t.transactions.some(function(t){return!t.isUserEvent("input.type")&&t.changes.touchesRange(_this45.from,_this45.to);}))?(this.composing.drifted=!0,this.composing.editorBase=t.changes.mapPos(this.composing.editorBase)):this.applyEdits(t)&&this.rangeIsValid(t.state)?(t.docChanged||t.selectionSet||e)&&this.setSelection(t.state):(this.pendingContextChange=null,this.reset(t.state)),(t.geometryChanged||t.docChanged||t.selectionSet)&&t.view.requestMeasure(this.measureReq);}},{key:"resetRange",value:function resetRange(t){var e=t.selection.main.head;this.from=Math.max(0,e-1e4),this.to=Math.min(t.doc.length,e+1e4);}},{key:"reset",value:function reset(t){this.resetRange(t),this.editContext.updateText(0,this.editContext.text.length,t.doc.sliceString(this.from,this.to)),this.setSelection(t);}},{key:"revertPending",value:function revertPending(t){var e=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(e.from),this.toContextPos(e.from+e.insert.length),t.doc.sliceString(e.from,e.to));}},{key:"setSelection",value:function setSelection(t){var e=t.selection.main,i=this.toContextPos(Math.max(this.from,Math.min(this.to,e.anchor))),s=this.toContextPos(e.head);this.editContext.selectionStart==i&&this.editContext.selectionEnd==s||this.editContext.updateSelection(i,s);}},{key:"rangeIsValid",value:function rangeIsValid(t){var e=t.selection.main.head;return!(this.from>0&&e-this.from<500||this.to<t.doc.length&&this.to-e<500||this.to-this.from>3e4);}},{key:"toEditorPos",value:function toEditorPos(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:this.to-this.from;t=Math.min(t,e);var i=this.composing;return i&&i.drifted?i.editorBase+(t-i.contextBase):t+this.from;}},{key:"toContextPos",value:function toContextPos(t){var e=this.composing;return e&&e.drifted?e.contextBase+(t-e.editorBase):t-this.from;}},{key:"destroy",value:function destroy(){for(var _t138 in this.handlers)this.editContext.removeEventListener(_t138,this.handlers[_t138]);}}]);}();_export("E",Qr=/*#__PURE__*/function(){function Qr(){var _this46=this;var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,Qr);var e;this.plugins=[],this.pluginMap=new Map(),this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),t.parent&&t.parent.appendChild(this.dom);var i=t.dispatch;this.dispatchTransactions=t.dispatchTransactions||i&&function(t){return t.forEach(function(t){return i(t,_this46);});}||function(t){return _this46.update(t);},this.dispatch=this.dispatch.bind(this),this._root=t.root||function(t){for(;t;){if(t&&(9==t.nodeType||11==t.nodeType&&t.host))return t;t=t.assignedSlot||t.parentNode;}return null;}(t.parent)||document,this.viewState=new Rr(t.state||It.create(t)),t.scrollTo&&t.scrollTo.is(Gi)&&(this.viewState.scrollTarget=t.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(Qi).map(function(t){return new ts(t);});var _iterator81=_createForOfIteratorHelper(this.plugins),_step81;try{for(_iterator81.s();!(_step81=_iterator81.n()).done;){var _t139=_step81.value;_t139.update(this);}}catch(err){_iterator81.e(err);}finally{_iterator81.f();}this.observer=new Kr(this),this.inputState=new $s(this),this.inputState.ensureHandlers(this.plugins),this.docView=new ds(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),(null===(e=document.fonts)||void 0===e?void 0:e.ready)&&document.fonts.ready.then(function(){return _this46.requestMeasure();});}return _createClass(Qr,[{key:"state",get:function get(){return this.viewState.state;}},{key:"viewport",get:function get(){return this.viewState.viewport;}},{key:"visibleRanges",get:function get(){return this.viewState.visibleRanges;}},{key:"inView",get:function get(){return this.viewState.inView;}},{key:"composing",get:function get(){return this.inputState.composing>0;}},{key:"compositionStarted",get:function get(){return this.inputState.composing>=0;}},{key:"root",get:function get(){return this._root;}},{key:"win",get:function get(){return this.dom.ownerDocument.defaultView||window;}},{key:"dispatch",value:function dispatch(){var _this$state;for(var _len3=arguments.length,t=new Array(_len3),_key3=0;_key3<_len3;_key3++){t[_key3]=arguments[_key3];}var e=1==t.length&&t[0]instanceof vt?t:1==t.length&&Array.isArray(t[0])?t[0]:[(_this$state=this.state).update.apply(_this$state,t)];this.dispatchTransactions(e,this);}},{key:"update",value:function update(t){var _this47=this;if(0!=this.updateState)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");var e,i=!1,s=!1,r=this.state;var _iterator82=_createForOfIteratorHelper(t),_step82;try{for(_iterator82.s();!(_step82=_iterator82.n()).done;){var _e126=_step82.value;if(_e126.startState!=r)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");r=_e126.state;}}catch(err){_iterator82.e(err);}finally{_iterator82.f();}if(this.destroyed)return void(this.viewState.state=r);var n=this.hasFocus,h=0,l=null;t.some(function(t){return t.annotation(hr);})?(this.inputState.notifiedFocused=n,h=1):n!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=n,l=lr(r,n),l||(h=1));var o=this.observer.delayedAndroidKey,u=null;if(o?(this.observer.clearDelayedAndroidKey(),u=this.observer.readChange(),(u&&!this.state.doc.eq(r.doc)||!this.state.selection.eq(r.selection))&&(u=null)):this.observer.clear(),r.facet(It.phrases)!=this.state.facet(It.phrases))return this.setState(r);e=cs.create(this,r,t),e.flags|=h;var f=this.viewState.scrollTarget;try{this.updateState=2;var _iterator83=_createForOfIteratorHelper(t),_step83;try{for(_iterator83.s();!(_step83=_iterator83.n()).done;){var _e125=_step83.value;if(f&&(f=f.map(_e125.changes)),_e125.scrollIntoView){var _t140=_e125.state.selection.main;f=new Ui(_t140.empty?_t140:P.cursor(_t140.head,_t140.head>_t140.anchor?-1:1));}var _iterator84=_createForOfIteratorHelper(_e125.effects),_step84;try{for(_iterator84.s();!(_step84=_iterator84.n()).done;){var _t141=_step84.value;_t141.is(Gi)&&(f=_t141.value.clip(this.state));}}catch(err){_iterator84.e(err);}finally{_iterator84.f();}}}catch(err){_iterator83.e(err);}finally{_iterator83.f();}this.viewState.update(e,f),this.bidiCache=en.update(this.bidiCache,e.changes),e.empty||(this.updatePlugins(e),this.inputState.update(e)),i=this.docView.update(e),this.state.facet(fs)!=this.styleModules&&this.mountStyles(),s=this.updateAttrs(),this.showAnnouncements(t),this.docView.updateSelection(i,t.some(function(t){return t.isUserEvent("select.pointer");}));}finally{this.updateState=0;}if(e.startState.facet(zr)!=e.state.facet(zr)&&(this.viewState.mustMeasureContent=!0),(i||s||f||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),i&&this.docViewUpdate(),!e.empty){var _iterator85=_createForOfIteratorHelper(this.state.facet(zi)),_step85;try{for(_iterator85.s();!(_step85=_iterator85.n()).done;){var _t142=_step85.value;try{_t142(e);}catch(t){_i(this.state,t,"update listener");}}}catch(err){_iterator85.e(err);}finally{_iterator85.f();}}(l||u)&&Promise.resolve().then(function(){l&&_this47.state==l.startState&&_this47.dispatch(l),u&&!Ls(_this47,u)&&o.force&&ve(_this47.contentDOM,o.key,o.keyCode);});}},{key:"setState",value:function setState(t){if(0!=this.updateState)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed)return void(this.viewState.state=t);this.updateState=2;var e=this.hasFocus;try{var _iterator86=_createForOfIteratorHelper(this.plugins),_step86;try{for(_iterator86.s();!(_step86=_iterator86.n()).done;){var _t143=_step86.value;_t143.destroy(this);}}catch(err){_iterator86.e(err);}finally{_iterator86.f();}this.viewState=new Rr(t),this.plugins=t.facet(Qi).map(function(t){return new ts(t);}),this.pluginMap.clear();var _iterator87=_createForOfIteratorHelper(this.plugins),_step87;try{for(_iterator87.s();!(_step87=_iterator87.n()).done;){var _t144=_step87.value;_t144.update(this);}}catch(err){_iterator87.e(err);}finally{_iterator87.f();}this.docView.destroy(),this.docView=new ds(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[];}finally{this.updateState=0;}e&&this.focus(),this.requestMeasure();}},{key:"updatePlugins",value:function updatePlugins(t){var e=t.startState.facet(Qi),i=t.state.facet(Qi);if(e!=i){var _s106=[];var _iterator88=_createForOfIteratorHelper(i),_step88;try{for(_iterator88.s();!(_step88=_iterator88.n()).done;){var _r91=_step88.value;var _i123=e.indexOf(_r91);if(_i123<0)_s106.push(new ts(_r91));else{var _e127=this.plugins[_i123];_e127.mustUpdate=t,_s106.push(_e127);}}}catch(err){_iterator88.e(err);}finally{_iterator88.f();}var _iterator89=_createForOfIteratorHelper(this.plugins),_step89;try{for(_iterator89.s();!(_step89=_iterator89.n()).done;){var _e128=_step89.value;_e128.mustUpdate!=t&&_e128.destroy(this);}}catch(err){_iterator89.e(err);}finally{_iterator89.f();}this.plugins=_s106,this.pluginMap.clear();}else{var _iterator90=_createForOfIteratorHelper(this.plugins),_step90;try{for(_iterator90.s();!(_step90=_iterator90.n()).done;){var _e129=_step90.value;_e129.mustUpdate=t;}}catch(err){_iterator90.e(err);}finally{_iterator90.f();}}for(var _t145=0;_t145<this.plugins.length;_t145++)this.plugins[_t145].update(this);e!=i&&this.inputState.ensureHandlers(this.plugins);}},{key:"docViewUpdate",value:function docViewUpdate(){var _iterator91=_createForOfIteratorHelper(this.plugins),_step91;try{for(_iterator91.s();!(_step91=_iterator91.n()).done;){var _t146=_step91.value;var _e130=_t146.value;if(_e130&&_e130.docViewUpdate)try{_e130.docViewUpdate(this);}catch(t){_i(this.state,t,"doc view update listener");}}}catch(err){_iterator91.e(err);}finally{_iterator91.f();}}},{key:"measure",value:function measure(){var _this48=this;var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:!0;if(this.destroyed)return;if(this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey)return this.measureScheduled=-1,void this.requestMeasure();this.measureScheduled=0,t&&this.observer.forceFlush();var e=null,i=this.scrollDOM,s=i.scrollTop*this.scaleY,_this$viewState=this.viewState,r=_this$viewState.scrollAnchorPos,n=_this$viewState.scrollAnchorHeight;Math.abs(s-this.viewState.scrollTop)>1&&(n=-1),this.viewState.scrollAnchorHeight=-1;try{for(var _t147=0;;_t147++){var _ref13;if(n<0)if(ye(i))r=-1,n=this.viewState.heightMap.height;else{var _t148=this.viewState.scrollAnchorAt(s);r=_t148.from,n=_t148.top;}this.updateState=1;var _h46=this.viewState.measure(this);if(!_h46&&!this.measureRequests.length&&null==this.viewState.scrollTarget)break;if(_t147>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break;}var _l40=[];4&_h46||(_ref13=[_l40,this.measureRequests],this.measureRequests=_ref13[0],_l40=_ref13[1],_ref13);var _o30=_l40.map(function(t){try{return t.read(_this48);}catch(t){return _i(_this48.state,t),tn;}}),_u24=cs.create(this,this.state,[]),_f19=!1;_u24.flags|=_h46,e?e.flags|=_h46:e=_u24,this.updateState=2,_u24.empty||(this.updatePlugins(_u24),this.inputState.update(_u24),this.updateAttrs(),_f19=this.docView.update(_u24),_f19&&this.docViewUpdate());for(var _t149=0;_t149<_l40.length;_t149++)if(_o30[_t149]!=tn)try{var _e131=_l40[_t149];_e131.write&&_e131.write(_o30[_t149],this);}catch(t){_i(this.state,t);}if(_f19&&this.docView.updateSelection(!0),!_u24.viewportChanged&&0==this.measureRequests.length){if(this.viewState.editorHeight){if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,n=-1;continue;}{var _t150=(r<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(r).top)-n;if(_t150>1||_t150<-1){s+=_t150,i.scrollTop=s/this.scaleY,n=-1;continue;}}}break;}}}finally{this.updateState=0,this.measureScheduled=-1;}if(e&&!e.empty){var _iterator92=_createForOfIteratorHelper(this.state.facet(zi)),_step92;try{for(_iterator92.s();!(_step92=_iterator92.n()).done;){var _t151=_step92.value;_t151(e);}}catch(err){_iterator92.e(err);}finally{_iterator92.f();}}}},{key:"themeClasses",get:function get(){return Hr+" "+(this.state.facet(Pr)?Fr:Wr)+" "+this.state.facet(zr);}},{key:"updateAttrs",value:function updateAttrs(){var _this49=this;var t=sn(this,es,{"class":"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),e={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(Xi)?"true":"false","class":"cm-content",style:"".concat(Fe.tabSize,": ").concat(this.state.tabSize),role:"textbox","aria-multiline":"true"};this.state.readOnly&&(e["aria-readonly"]="true"),sn(this,is,e);var i=this.observer.ignore(function(){var i=Ze(_this49.contentDOM,_this49.contentAttrs,e),s=Ze(_this49.dom,_this49.editorAttrs,t);return i||s;});return this.editorAttrs=t,this.contentAttrs=e,i;}},{key:"showAnnouncements",value:function showAnnouncements(t){var e=!0;var _iterator93=_createForOfIteratorHelper(t),_step93;try{for(_iterator93.s();!(_step93=_iterator93.n()).done;){var _i124=_step93.value;var _iterator94=_createForOfIteratorHelper(_i124.effects),_step94;try{for(_iterator94.s();!(_step94=_iterator94.n()).done;){var _t152=_step94.value;if(_t152.is(Qr.announce)){e&&(this.announceDOM.textContent=""),e=!1,this.announceDOM.appendChild(document.createElement("div")).textContent=_t152.value;}}}catch(err){_iterator94.e(err);}finally{_iterator94.f();}}}catch(err){_iterator93.e(err);}finally{_iterator93.f();}}},{key:"mountStyles",value:function mountStyles(){this.styleModules=this.state.facet(fs);var t=this.state.facet(Qr.cspNonce);Zt.mount(this.root,this.styleModules.concat(Jr).reverse(),t?{nonce:t}:void 0);}},{key:"readMeasured",value:function readMeasured(){if(2==this.updateState)throw new Error("Reading the editor layout isn't allowed during an update");0==this.updateState&&this.measureScheduled>-1&&this.measure(!1);}},{key:"requestMeasure",value:function requestMeasure(t){var _this50=this;if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(function(){return _this50.measure();})),t){if(this.measureRequests.indexOf(t)>-1)return;if(null!=t.key)for(var _e132=0;_e132<this.measureRequests.length;_e132++)if(this.measureRequests[_e132].key===t.key)return void(this.measureRequests[_e132]=t);this.measureRequests.push(t);}}},{key:"plugin",value:function plugin(t){var e=this.pluginMap.get(t);return(void 0===e||e&&e.spec!=t)&&this.pluginMap.set(t,e=this.plugins.find(function(e){return e.spec==t;})||null),e&&e.update(this).value;}},{key:"documentTop",get:function get(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop;}},{key:"documentPadding",get:function get(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom};}},{key:"scaleX",get:function get(){return this.viewState.scaleX;}},{key:"scaleY",get:function get(){return this.viewState.scaleY;}},{key:"elementAtHeight",value:function elementAtHeight(t){return this.readMeasured(),this.viewState.elementAtHeight(t);}},{key:"lineBlockAtHeight",value:function lineBlockAtHeight(t){return this.readMeasured(),this.viewState.lineBlockAtHeight(t);}},{key:"viewportLineBlocks",get:function get(){return this.viewState.viewportLines;}},{key:"lineBlockAt",value:function lineBlockAt(t){return this.viewState.lineBlockAt(t);}},{key:"contentHeight",get:function get(){return this.viewState.contentHeight;}},{key:"moveByChar",value:function moveByChar(t,e,i){return Ds(this,t,Cs(this,t,e,i));}},{key:"moveByGroup",value:function moveByGroup(t,e){var _this51=this;return Ds(this,t,Cs(this,t,e,function(e){return function(t,e,i){var s=t.state.charCategorizer(e),r=s(i);return function(t){var e=s(t);return r==Ct.Space&&(r=e),r==e;};}(_this51,t.head,e);}));}},{key:"visualLineSide",value:function visualLineSide(t,e){var i=this.bidiSpans(t),s=this.textDirectionAt(t.from),r=i[e?i.length-1:0];return P.cursor(r.side(e,s)+t.from,r.forward(!e,s)?1:-1);}},{key:"moveToLineBoundary",value:function moveToLineBoundary(t,e){var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!0;return function(t,e,i,s){var r=As(t,e.head),n=s&&r.type==ii.Text&&(t.lineWrapping||r.widgetLineBreaks)?t.coordsAtPos(e.assoc<0&&e.head>r.from?e.head-1:e.head):null;if(n){var _e133=t.dom.getBoundingClientRect(),_s107=t.textDirectionAt(r.from),_h47=t.posAtCoords({x:i==(_s107==mi.LTR)?_e133.right-1:_e133.left+1,y:(n.top+n.bottom)/2});if(null!=_h47)return P.cursor(_h47,i?-1:1);}return P.cursor(i?r.to:r.from,i?-1:1);}(this,t,e,i);}},{key:"moveVertically",value:function moveVertically(t,e,i){return Ds(this,t,function(t,e,i,s){var r=e.head,n=i?1:-1;if(r==(i?t.state.doc.length:0))return P.cursor(r,e.assoc);var h,l=e.goalColumn,o=t.contentDOM.getBoundingClientRect(),u=t.coordsAtPos(r,e.assoc||-1),f=t.documentTop;if(u)null==l&&(l=u.left-o.left),h=n<0?u.top:u.bottom;else{var _e134=t.viewState.lineBlockAt(r);null==l&&(l=Math.min(o.right-o.left,t.defaultCharacterWidth*(r-_e134.from))),h=(n<0?_e134.top:_e134.bottom)+f;}var a=o.left+l,c=null!=s?s:t.viewState.heightOracle.textHeight>>1;for(var _e135=0;;_e135+=10){var _i125=h+(c+_e135)*n,_s108=xs(t,{x:a,y:_i125},!1,n);if(_i125<o.top||_i125>o.bottom||(n<0?_s108<r:_s108>r)){var _e136=t.docView.coordsForChar(_s108),_r92=!_e136||_i125<_e136.top?-1:1;return P.cursor(_s108,_r92,void 0,l);}}}(this,t,e,i));}},{key:"domAtPos",value:function domAtPos(t){return this.docView.domAtPos(t);}},{key:"posAtDOM",value:function posAtDOM(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;return this.docView.posFromDOM(t,e);}},{key:"posAtCoords",value:function posAtCoords(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!0;return this.readMeasured(),xs(this,t,e);}},{key:"coordsAtPos",value:function coordsAtPos(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;this.readMeasured();var i=this.docView.coordsAt(t,e);if(!i||i.left==i.right)return i;var s=this.state.doc.lineAt(t),r=this.bidiSpans(s);return ae(i,r[Ai.find(r,t-s.from,-1,e)].dir==mi.LTR==e>0);}},{key:"coordsForChar",value:function coordsForChar(t){return this.readMeasured(),this.docView.coordsForChar(t);}},{key:"defaultCharacterWidth",get:function get(){return this.viewState.heightOracle.charWidth;}},{key:"defaultLineHeight",get:function get(){return this.viewState.heightOracle.lineHeight;}},{key:"textDirection",get:function get(){return this.viewState.defaultTextDirection;}},{key:"textDirectionAt",value:function textDirectionAt(t){return!this.state.facet(Vi)||t<this.viewport.from||t>this.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(t));}},{key:"lineWrapping",get:function get(){return this.viewState.heightOracle.lineWrapping;}},{key:"bidiSpans",value:function bidiSpans(t){if(t.length>Zr)return Ii(t.length);var e,i=this.textDirectionAt(t.from);var _iterator95=_createForOfIteratorHelper(this.bidiCache),_step95;try{for(_iterator95.s();!(_step95=_iterator95.n()).done;){var _s109=_step95.value;if(_s109.from==t.from&&_s109.dir==i&&(_s109.fresh||Ci(_s109.isolates,e=ls(this,t))))return _s109.order;}}catch(err){_iterator95.e(err);}finally{_iterator95.f();}e||(e=ls(this,t));var s=function(t,e,i){if(!t)return[new Ai(0,0,e==wi?1:0)];if(e==gi&&!i.length&&!Si.test(t))return Ii(t.length);if(i.length)for(;t.length>Oi.length;)Oi[Oi.length]=256;var s=[],r=e==gi?0:1;return Ei(t,r,r,i,0,t.length,s),s;}(t.text,i,e);return this.bidiCache.push(new en(t.from,t.to,i,e,!0,s)),s;}},{key:"hasFocus",get:function get(){var t;return(this.dom.ownerDocument.hasFocus()||Fe.safari&&(null===(t=this.inputState)||void 0===t?void 0:t.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM;}},{key:"focus",value:function focus(){var _this52=this;this.observer.ignore(function(){we(_this52.contentDOM),_this52.docView.updateSelection();});}},{key:"setRoot",value:function setRoot(t){this._root!=t&&(this._root=t,this.observer.setWindow((9==t.nodeType?t:t.ownerDocument).defaultView||window),this.mountStyles());}},{key:"destroy",value:function destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();var _iterator96=_createForOfIteratorHelper(this.plugins),_step96;try{for(_iterator96.s();!(_step96=_iterator96.n()).done;){var _t153=_step96.value;_t153.destroy(this);}}catch(err){_iterator96.e(err);}finally{_iterator96.f();}this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0;}},{key:"scrollSnapshot",value:function scrollSnapshot(){var _this$scrollDOM=this.scrollDOM,t=_this$scrollDOM.scrollTop,e=_this$scrollDOM.scrollLeft,i=this.viewState.scrollAnchorAt(t);return Gi.of(new Ui(P.cursor(i.from),"start","start",i.top-t,e,!0));}},{key:"setTabFocusMode",value:function setTabFocusMode(t){null==t?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:"boolean"==typeof t?this.inputState.tabFocusMode=t?0:-1:0!=this.inputState.tabFocusMode&&(this.inputState.tabFocusMode=Date.now()+t);}}],[{key:"scrollIntoView",value:function scrollIntoView(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};return Gi.of(new Ui("number"==typeof t?P.cursor(t):t,e.y,e.x,e.yMargin,e.xMargin));}},{key:"domEventHandlers",value:function domEventHandlers(t){return Zi.define(function(){return{};},{eventHandlers:t});}},{key:"domEventObservers",value:function domEventObservers(t){return Zi.define(function(){return{};},{eventObservers:t});}},{key:"theme",value:function theme(t,e){var i=Zt.newName(),s=[zr.of(i),fs.of(qr(".".concat(i),t))];return e&&e.dark&&s.push(Pr.of(!0)),s;}},{key:"baseTheme",value:function baseTheme(t){return et.lowest(fs.of(qr("."+Hr,t,Vr)));}},{key:"findFromDOM",value:function findFromDOM(t){var e;var i=t.querySelector(".cm-content"),s=i&&Ce.get(i)||Ce.get(t);return(null===(e=null==s?void 0:s.rootView)||void 0===e?void 0:e.view)||null;}}]);}());Qr.styleModule=fs,Qr.inputHandler=Pi,Qr.clipboardInputFilter=Wi,Qr.clipboardOutputFilter=Fi,Qr.scrollHandler=Ji,Qr.focusChangeEffect=Hi,Qr.perLineTextDirection=Vi,Qr.exceptionSink=ji,Qr.updateListener=zi,Qr.editable=Xi,Qr.mouseSelectionStyle=$i,Qr.dragMovesSelection=Ni,Qr.clickAddsSelectionRange=Li,Qr.decorations=ss,Qr.outerDecorations=rs,Qr.atomicRanges=ns,Qr.bidiIsolatedRanges=hs,Qr.scrollMargins=os,Qr.darkTheme=Pr,Qr.cspNonce=F.define({combine:function combine(t){return t.length?t[0]:"";}}),Qr.contentAttributes=is,Qr.editorAttributes=es,Qr.lineWrapping=Qr.contentAttributes.of({"class":"cm-lineWrapping"}),Qr.announce=bt.define();Zr=4096,tn={};en=/*#__PURE__*/function(){function en(t,e,i,s,r,n){_classCallCheck(this,en);this.from=t,this.to=e,this.dir=i,this.isolates=s,this.fresh=r,this.order=n;}return _createClass(en,null,[{key:"update",value:function update(t,e){if(e.empty&&!t.some(function(t){return t.fresh;}))return t;var i=[],s=t.length?t[t.length-1].dir:mi.LTR;for(var _r93=Math.max(0,t.length-10);_r93<t.length;_r93++){var _n73=t[_r93];_n73.dir!=s||e.touchesRange(_n73.from,_n73.to)||i.push(new en(e.mapPos(_n73.from,1),e.mapPos(_n73.to,-1),_n73.dir,_n73.isolates,!1,_n73.order));}return i;}}]);}();rn=Fe.mac?"mac":Fe.windows?"win":Fe.linux?"linux":"key";hn=et["default"](Qr.domEventHandlers({keydown:function keydown(t,e){return dn(un(e.state),t,e,"editor");}})),_export("v",ln=F.define({enables:hn})),on=new WeakMap();fn=null;an=4e3;cn=null;pn=/*#__PURE__*/function(){function pn(t,e,i,s,r){_classCallCheck(this,pn);this.className=t,this.left=e,this.top=i,this.width=s,this.height=r;}return _createClass(pn,[{key:"draw",value:function draw(){var t=document.createElement("div");return t.className=this.className,this.adjust(t),t;}},{key:"update",value:function update(t,e){return e.className==this.className&&(this.adjust(t),!0);}},{key:"adjust",value:function adjust(t){t.style.left=this.left+"px",t.style.top=this.top+"px",null!=this.width&&(t.style.width=this.width+"px"),t.style.height=this.height+"px";}},{key:"eq",value:function eq(t){return this.left==t.left&&this.top==t.top&&this.width==t.width&&this.height==t.height&&this.className==t.className;}}],[{key:"forRange",value:function forRange(t,e,i){if(i.empty){var _s112=t.coordsAtPos(i.head,i.assoc||1);if(!_s112)return[];var _r96=mn(t);return[new pn(e,_s112.left-_r96.left,_s112.top-_r96.top,null,_s112.bottom-_s112.top)];}return function(t,e,i){if(i.to<=t.viewport.from||i.from>=t.viewport.to)return[];var s=Math.max(i.from,t.viewport.from),r=Math.min(i.to,t.viewport.to),n=t.textDirection==mi.LTR,h=t.contentDOM,l=h.getBoundingClientRect(),o=mn(t),u=h.querySelector(".cm-line"),f=u&&window.getComputedStyle(u),a=l.left+(f?parseInt(f.paddingLeft)+Math.min(0,parseInt(f.textIndent)):0),c=l.right-(f?parseInt(f.paddingRight):0),d=As(t,s),p=As(t,r),m=d.type==ii.Text?d:null,g=p.type==ii.Text?p:null;m&&(t.lineWrapping||d.widgetLineBreaks)&&(m=gn(t,s,1,m));g&&(t.lineWrapping||p.widgetLineBreaks)&&(g=gn(t,r,-1,g));if(m&&g&&m.from==g.from&&m.to==g.to)return b(v(i.from,i.to,m));{var _e142=m?v(i.from,null,m):k(d,!1),_s113=g?v(null,i.to,g):k(p,!0),_r97=[];return(m||d).to<(g||p).from-(m&&g?1:0)||d.widgetLineBreaks>1&&_e142.bottom+t.defaultLineHeight/2<_s113.top?_r97.push(w(a,_e142.bottom,c,_s113.top)):_e142.bottom<_s113.top&&t.elementAtHeight((_e142.bottom+_s113.top)/2).type==ii.Text&&(_e142.bottom=_s113.top=(_e142.bottom+_s113.top)/2),b(_e142).concat(_r97).concat(b(_s113));}function w(t,i,s,r){return new pn(e,t-o.left,i-o.top,s-t,r-i);}function b(_ref14){var t=_ref14.top,e=_ref14.bottom,i=_ref14.horizontal;var s=[];for(var _r98=0;_r98<i.length;_r98+=2)s.push(w(i[_r98],t,i[_r98+1],e));return s;}function v(e,i,s){var r=1e9,h=-1e9,l=[];function o(e,i,o,u,f){var d=t.coordsAtPos(e,e==s.to?-2:2),p=t.coordsAtPos(o,o==s.from?2:-2);d&&p&&(r=Math.min(d.top,p.top,r),h=Math.max(d.bottom,p.bottom,h),f==mi.LTR?l.push(n&&i?a:d.left,n&&u?c:p.right):l.push(!n&&u?a:p.left,!n&&i?c:d.right));}var u=null!=e?e:s.from,f=null!=i?i:s.to;var _iterator101=_createForOfIteratorHelper(t.visibleRanges),_step101;try{for(_iterator101.s();!(_step101=_iterator101.n()).done;){var _s114=_step101.value;if(_s114.to>u&&_s114.from<f)for(var _r99=Math.max(_s114.from,u),_n76=Math.min(_s114.to,f);;){var _s115=t.state.doc.lineAt(_r99);var _iterator102=_createForOfIteratorHelper(t.bidiSpans(_s115)),_step102;try{for(_iterator102.s();!(_step102=_iterator102.n()).done;){var _h48=_step102.value;var _t156=_h48.from+_s115.from,_l42=_h48.to+_s115.from;if(_t156>=_n76)break;_l42>_r99&&o(Math.max(_t156,_r99),null==e&&_t156<=u,Math.min(_l42,_n76),null==i&&_l42>=f,_h48.dir);}}catch(err){_iterator102.e(err);}finally{_iterator102.f();}if(_r99=_s115.to+1,_r99>=_n76)break;}}}catch(err){_iterator101.e(err);}finally{_iterator101.f();}return 0==l.length&&o(u,null==e,f,null==i,t.textDirection),{top:r,bottom:h,horizontal:l};}function k(t,e){var i=l.top+(e?t.top:t.bottom);return{top:i,bottom:i,horizontal:[]};}}(t,e,i);}}]);}();wn=/*#__PURE__*/function(){function wn(t,e){_classCallCheck(this,wn);this.view=t,this.layer=e,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=t.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),e.above&&this.dom.classList.add("cm-layer-above"),e["class"]&&this.dom.classList.add(e["class"]),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(t.state),t.requestMeasure(this.measureReq),e.mount&&e.mount(this.dom,t);}return _createClass(wn,[{key:"update",value:function update(t){t.startState.facet(bn)!=t.state.facet(bn)&&this.setOrder(t.state),(this.layer.update(t,this.dom)||t.geometryChanged)&&(this.scale(),t.view.requestMeasure(this.measureReq));}},{key:"docViewUpdate",value:function docViewUpdate(t){!1!==this.layer.updateOnDocViewUpdate&&t.requestMeasure(this.measureReq);}},{key:"setOrder",value:function setOrder(t){var e=0,i=t.facet(bn);for(;e<i.length&&i[e]!=this.layer;)e++;this.dom.style.zIndex=String((this.layer.above?150:-1)-e);}},{key:"measure",value:function measure(){return this.layer.markers(this.view);}},{key:"scale",value:function scale(){var _this$view=this.view,t=_this$view.scaleX,e=_this$view.scaleY;t==this.scaleX&&e==this.scaleY||(this.scaleX=t,this.scaleY=e,this.dom.style.transform="scale(".concat(1/t,", ").concat(1/e,")"));}},{key:"draw",value:function draw(t){var _this53=this;if(t.length!=this.drawn.length||t.some(function(t,e){return i=t,s=_this53.drawn[e],!(i.constructor==s.constructor&&i.eq(s));var i,s;})){var _e143=this.dom.firstChild,_i126=0;var _iterator103=_createForOfIteratorHelper(t),_step103;try{for(_iterator103.s();!(_step103=_iterator103.n()).done;){var _s116=_step103.value;_s116.update&&_e143&&_s116.constructor&&this.drawn[_i126].constructor&&_s116.update(_e143,this.drawn[_i126])?(_e143=_e143.nextSibling,_i126++):this.dom.insertBefore(_s116.draw(),_e143);}}catch(err){_iterator103.e(err);}finally{_iterator103.f();}for(;_e143;){var _t157=_e143.nextSibling;_e143.remove(),_e143=_t157;}this.drawn=t;}}},{key:"destroy",value:function destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove();}}]);}();bn=F.define();kn=!(Fe.ios&&Fe.webkit&&Fe.webkit_version<534),yn=F.define({combine:function combine(t){return Rt(t,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:function cursorBlinkRate(t,e){return Math.min(t,e);},drawRangeCursor:function drawRangeCursor(t,e){return t||e;}});}});xn=vn({above:!0,markers:function markers(t){var e=t.state,i=e.facet(yn),s=[];var _iterator104=_createForOfIteratorHelper(e.selection.ranges),_step104;try{for(_iterator104.s();!(_step104=_iterator104.n()).done;){var _r100=_step104.value;var _n77=_r100==e.selection.main;if(_r100.empty?!_n77||kn:i.drawRangeCursor){var _e144=_n77?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",_i127=_r100.empty?_r100:P.cursor(_r100.head,_r100.head>_r100.anchor?-1:1);var _iterator105=_createForOfIteratorHelper(pn.forRange(t,_e144,_i127)),_step105;try{for(_iterator105.s();!(_step105=_iterator105.n()).done;){var _r101=_step105.value;s.push(_r101);}}catch(err){_iterator105.e(err);}finally{_iterator105.f();}}}}catch(err){_iterator104.e(err);}finally{_iterator104.f();}return s;},update:function update(t,e){t.transactions.some(function(t){return t.selection;})&&(e.style.animationName="cm-blink"==e.style.animationName?"cm-blink2":"cm-blink");var i=Mn(t);return i&&Sn(t.state,e),t.docChanged||t.selectionSet||i;},mount:function mount(t,e){Sn(e.state,t);},"class":"cm-cursorLayer"});An=vn({above:!1,markers:function markers(t){return t.state.selection.ranges.map(function(e){return e.empty?[]:pn.forRange(t,"cm-selectionBackground",e);}).reduce(function(t,e){return t.concat(e);});},update:function update(t,e){return t.docChanged||t.selectionSet||t.viewportChanged||Mn(t);},"class":"cm-selectionLayer"}),Cn={".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"}},".cm-content":{"& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}};kn&&(Cn[".cm-line"].caretColor=Cn[".cm-content"].caretColor="transparent !important");On=et.highest(Qr.theme(Cn)),Dn=bt.define({map:function map(t,e){return null==t?null:e.mapPos(t);}}),En=_.define({create:function create(){return null;},update:function update(t,e){return null!=t&&(t=e.changes.mapPos(t)),e.effects.reduce(function(t,e){return e.is(Dn)?e.value:t;},t);}}),In=Zi.fromClass(/*#__PURE__*/function(){function _class(t){_classCallCheck(this,_class);this.view=t,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)};}return _createClass(_class,[{key:"update",value:function update(t){var e;var i=t.state.field(En);null==i?null!=this.cursor&&(null===(e=this.cursor)||void 0===e||e.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(t.startState.field(En)!=i||t.docChanged||t.geometryChanged)&&this.view.requestMeasure(this.measureReq));}},{key:"readPos",value:function readPos(){var t=this.view,e=t.state.field(En),i=null!=e&&t.coordsAtPos(e);if(!i)return null;var s=t.scrollDOM.getBoundingClientRect();return{left:i.left-s.left+t.scrollDOM.scrollLeft*t.scaleX,top:i.top-s.top+t.scrollDOM.scrollTop*t.scaleY,height:i.bottom-i.top};}},{key:"drawCursor",value:function drawCursor(t){if(this.cursor){var _this$view2=this.view,_e145=_this$view2.scaleX,_i128=_this$view2.scaleY;t?(this.cursor.style.left=t.left/_e145+"px",this.cursor.style.top=t.top/_i128+"px",this.cursor.style.height=t.height/_i128+"px"):this.cursor.style.left="-100000px";}}},{key:"destroy",value:function destroy(){this.cursor&&this.cursor.remove();}},{key:"setDropPos",value:function setDropPos(t){this.view.state.field(En)!=t&&this.view.dispatch({effects:Dn.of(t)});}}]);}(),{eventObservers:{dragover:function dragover(t){this.setDropPos(this.view.posAtCoords({x:t.clientX,y:t.clientY}));},dragleave:function dragleave(t){t.target!=this.view.contentDOM&&this.view.contentDOM.contains(t.relatedTarget)||this.setDropPos(null);},dragend:function dragend(){this.setDropPos(null);},drop:function drop(){this.setDropPos(null);}}});Tn=/*#__PURE__*/function(){function Tn(t){_classCallCheck(this,Tn);var e=t.regexp,i=t.decoration,s=t.decorate,r=t.boundary,_t$maxLength=t.maxLength,n=_t$maxLength===void 0?1e3:_t$maxLength;if(!e.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=e,s)this.addMatch=function(t,e,i,r){return s(r,i,i+t[0].length,t,e);};else if("function"==typeof i)this.addMatch=function(t,e,s,r){var n=i(t,e,s);n&&r(s,s+t[0].length,n);};else{if(!i)throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.addMatch=function(t,e,s,r){return r(s,s+t[0].length,i);};}this.boundary=r,this.maxLength=n;}return _createClass(Tn,[{key:"createDeco",value:function createDeco(t){var _this54=this;var e=new jt(),i=e.add.bind(e);var _iterator106=_createForOfIteratorHelper(function(t,e){var i=t.visibleRanges;if(1==i.length&&i[0].from==t.viewport.from&&i[0].to==t.viewport.to)return i;var s=[];var _iterator107=_createForOfIteratorHelper(i),_step107;try{for(_iterator107.s();!(_step107=_iterator107.n()).done;){var _step107$value=_step107.value,_r102=_step107$value.from,_n79=_step107$value.to;_r102=Math.max(t.state.doc.lineAt(_r102).from,_r102-e),_n79=Math.min(t.state.doc.lineAt(_n79).to,_n79+e),s.length&&s[s.length-1].to>=_r102?s[s.length-1].to=_n79:s.push({from:_r102,to:_n79});}}catch(err){_iterator107.e(err);}finally{_iterator107.f();}return s;}(t,this.maxLength)),_step106;try{for(_iterator106.s();!(_step106=_iterator106.n()).done;){var _step106$value=_step106.value,_e146=_step106$value.from,_s117=_step106$value.to;Rn(t.state.doc,this.regexp,_e146,_s117,function(e,s){return _this54.addMatch(s,t,e,i);});}}catch(err){_iterator106.e(err);}finally{_iterator106.f();}return e.finish();}},{key:"updateDeco",value:function updateDeco(t,e){var i=1e9,s=-1;return t.docChanged&&t.changes.iterChanges(function(e,r,n,h){h>=t.view.viewport.from&&n<=t.view.viewport.to&&(i=Math.min(n,i),s=Math.max(h,s));}),t.viewportMoved||s-i>1e3?this.createDeco(t.view):s>-1?this.updateRange(t.view,e.map(t.changes),i,s):e;}},{key:"updateRange",value:function updateRange(t,e,i,s){var _this55=this;var _iterator108=_createForOfIteratorHelper(t.visibleRanges),_step108;try{var _loop10=function _loop10(){var r=_step108.value;var n=Math.max(r.from,i),h=Math.min(r.to,s);if(h>n){var _i129=t.state.doc.lineAt(n),_s118=_i129.to<h?t.state.doc.lineAt(h):_i129,_l44=Math.max(r.from,_i129.from),_o31=Math.min(r.to,_s118.to);if(_this55.boundary){for(;n>_i129.from;n--)if(_this55.boundary.test(_i129.text[n-1-_i129.from])){_l44=n;break;}for(;h<_s118.to;h++)if(_this55.boundary.test(_s118.text[h-_s118.from])){_o31=h;break;}}var _u25,_f20=[],_a14=function _a14(t,e,i){return _f20.push(i.range(t,e));};if(_i129==_s118)for(_this55.regexp.lastIndex=_l44-_i129.from;(_u25=_this55.regexp.exec(_i129.text))&&_u25.index<_o31-_i129.from;)_this55.addMatch(_u25,t,_u25.index+_i129.from,_a14);else Rn(t.state.doc,_this55.regexp,_l44,_o31,function(e,i){return _this55.addMatch(i,t,e,_a14);});e=e.update({filterFrom:_l44,filterTo:_o31,filter:function filter(t,e){return t<_l44||e>_o31;},add:_f20});}};for(_iterator108.s();!(_step108=_iterator108.n()).done;){_loop10();}}catch(err){_iterator108.e(err);}finally{_iterator108.f();}return e;}}]);}();Bn=null!=/x/.unicode?"gu":"g",Ln=new RegExp("[\0-\b\n-\x1F\x7F-\x9F\xAD\u061C\u200B\u200E\u200F\u2028\u2029\u202D\u202E\u2066\u2067\u2069\uFEFF\uFFF9-\uFFFC]",Bn),Nn={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};$n=null;jn=F.define({combine:function combine(t){var e=Rt(t,{render:null,specialChars:Ln,addSpecialChars:null});return(e.replaceTabs=!function(){var t;if(null==$n&&"undefined"!=typeof document&&document.body){var _e147=document.body.style;$n=null!=(null!==(t=_e147.tabSize)&&void 0!==t?t:_e147.MozTabSize);}return $n||!1;}())&&(e.specialChars=new RegExp("\t|"+e.specialChars.source,Bn)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,Bn)),e;}});zn=null;Pn=/*#__PURE__*/function(_ei4){function Pn(t,e){var _this56;_classCallCheck(this,Pn);_this56=_callSuper(this,Pn),_this56.options=t,_this56.code=e;return _this56;}_inherits(Pn,_ei4);return _createClass(Pn,[{key:"eq",value:function eq(t){return t.code==this.code;}},{key:"toDOM",value:function toDOM(t){var e=(i=this.code)>=32?"•":10==i?"":String.fromCharCode(9216+i);var i;var s=t.state.phrase("Control character")+" "+(Nn[this.code]||"0x"+this.code.toString(16)),r=this.options.render&&this.options.render(this.code,s,e);if(r)return r;var n=document.createElement("span");return n.textContent=e,n.title=s,n.setAttribute("aria-label",s),n.className="cm-specialChar",n;}},{key:"ignoreEvent",value:function ignoreEvent(){return!1;}}]);}(ei);Hn=/*#__PURE__*/function(_ei5){function Hn(t){var _this57;_classCallCheck(this,Hn);_this57=_callSuper(this,Hn),_this57.width=t;return _this57;}_inherits(Hn,_ei5);return _createClass(Hn,[{key:"eq",value:function eq(t){return t.width==this.width;}},{key:"toDOM",value:function toDOM(){var t=document.createElement("span");return t.textContent="\t",t.className="cm-tab",t.style.width=this.width+"px",t;}},{key:"ignoreEvent",value:function ignoreEvent(){return!1;}}]);}(ei);Wn=si.line({"class":"cm-activeLine"}),Fn=Zi.fromClass(/*#__PURE__*/function(){function _class2(t){_classCallCheck(this,_class2);this.decorations=this.getDeco(t);}return _createClass(_class2,[{key:"update",value:function update(t){(t.docChanged||t.selectionSet)&&(this.decorations=this.getDeco(t.view));}},{key:"getDeco",value:function getDeco(t){var e=-1,i=[];var _iterator109=_createForOfIteratorHelper(t.state.selection.ranges),_step109;try{for(_iterator109.s();!(_step109=_iterator109.n()).done;){var _s119=_step109.value;var _r103=t.lineBlockAt(_s119.head);_r103.from>e&&(i.push(Wn.range(_r103.from)),e=_r103.from);}}catch(err){_iterator109.e(err);}finally{_iterator109.f();}return si.set(i);}}]);}(),{decorations:function decorations(t){return t.decorations;}});Vn=/*#__PURE__*/function(_ei6){function Vn(t){var _this58;_classCallCheck(this,Vn);_this58=_callSuper(this,Vn),_this58.content=t;return _this58;}_inherits(Vn,_ei6);return _createClass(Vn,[{key:"toDOM",value:function toDOM(t){var e=document.createElement("span");return e.className="cm-placeholder",e.style.pointerEvents="none",e.appendChild("string"==typeof this.content?document.createTextNode(this.content):"function"==typeof this.content?this.content(t):this.content.cloneNode(!0)),"string"==typeof this.content?e.setAttribute("aria-label","placeholder "+this.content):e.setAttribute("aria-hidden","true"),e;}},{key:"coordsAt",value:function coordsAt(t){var e=t.firstChild?ne(t.firstChild):[];if(!e.length)return null;var i=window.getComputedStyle(t.parentNode),s=ae(e[0],"rtl"!=i.direction),r=parseInt(i.lineHeight);return s.bottom-s.top>1.5*r?{left:s.left,right:s.right,top:s.top,bottom:s.top+r}:s;}},{key:"ignoreEvent",value:function ignoreEvent(){return!1;}}]);}(ei);Jn=2e3;Kn={Alt:[18,function(t){return!!t.altKey;}],Control:[17,function(t){return!!t.ctrlKey;}],Shift:[16,function(t){return!!t.shiftKey;}],Meta:[91,function(t){return!!t.metaKey;}]},_n={style:"cursor: crosshair"};Xn="-10000px";Yn=/*#__PURE__*/function(){function Yn(t,e,i,s){_classCallCheck(this,Yn);this.facet=e,this.createTooltipView=i,this.removeTooltipView=s,this.input=t.state.facet(e),this.tooltips=this.input.filter(function(t){return t;});var r=null;this.tooltipViews=this.tooltips.map(function(t){return r=i(t,r);});}return _createClass(Yn,[{key:"update",value:function update(t,e){var i;var s=t.state.facet(this.facet),r=s.filter(function(t){return t;});if(s===this.input){var _iterator110=_createForOfIteratorHelper(this.tooltipViews),_step110;try{for(_iterator110.s();!(_step110=_iterator110.n()).done;){var _e152=_step110.value;_e152.update&&_e152.update(t);}}catch(err){_iterator110.e(err);}finally{_iterator110.f();}return!1;}var n=[],h=e?[]:null;for(var _i132=0;_i132<r.length;_i132++){var _s121=r[_i132],_l47=-1;if(_s121){for(var _t158=0;_t158<this.tooltips.length;_t158++){var _e153=this.tooltips[_t158];_e153&&_e153.create==_s121.create&&(_l47=_t158);}if(_l47<0)n[_i132]=this.createTooltipView(_s121,_i132?n[_i132-1]:null),h&&(h[_i132]=!!_s121.above);else{var _s122=n[_i132]=this.tooltipViews[_l47];h&&(h[_i132]=e[_l47]),_s122.update&&_s122.update(t);}}}var _iterator111=_createForOfIteratorHelper(this.tooltipViews),_step111;try{for(_iterator111.s();!(_step111=_iterator111.n()).done;){var _t159=_step111.value;n.indexOf(_t159)<0&&(this.removeTooltipView(_t159),null===(i=_t159.destroy)||void 0===i||i.call(_t159));}}catch(err){_iterator111.e(err);}finally{_iterator111.f();}return e&&(h.forEach(function(t,i){return e[i]=t;}),e.length=h.length),this.input=s,this.tooltips=r,this.tooltipViews=n,!0;}}]);}();th=F.define({combine:function combine(t){var e,i,s;return{position:Fe.ios?"absolute":(null===(e=t.find(function(t){return t.position;}))||void 0===e?void 0:e.position)||"fixed",parent:(null===(i=t.find(function(t){return t.parent;}))||void 0===i?void 0:i.parent)||null,tooltipSpace:(null===(s=t.find(function(t){return t.tooltipSpace;}))||void 0===s?void 0:s.tooltipSpace)||Zn};}}),eh=new WeakMap(),ih=Zi.fromClass(/*#__PURE__*/function(){function _class4(t){var _this59=this;_classCallCheck(this,_class4);this.view=t,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;var e=t.state.facet(th);this.position=e.position,this.parent=e.parent,this.classes=t.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver="function"==typeof ResizeObserver?new ResizeObserver(function(){return _this59.measureSoon();}):null,this.manager=new Yn(t,hh,function(t,e){return _this59.createTooltip(t,e);},function(t){_this59.resizeObserver&&_this59.resizeObserver.unobserve(t.dom),t.dom.remove();}),this.above=this.manager.tooltips.map(function(t){return!!t.above;}),this.intersectionObserver="function"==typeof IntersectionObserver?new IntersectionObserver(function(t){Date.now()>_this59.lastTransaction-50&&t.length>0&&t[t.length-1].intersectionRatio<1&&_this59.measureSoon();},{threshold:[1]}):null,this.observeIntersection(),t.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure();}return _createClass(_class4,[{key:"createContainer",value:function createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom;}},{key:"observeIntersection",value:function observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();var _iterator112=_createForOfIteratorHelper(this.manager.tooltipViews),_step112;try{for(_iterator112.s();!(_step112=_iterator112.n()).done;){var _t160=_step112.value;this.intersectionObserver.observe(_t160.dom);}}catch(err){_iterator112.e(err);}finally{_iterator112.f();}}}},{key:"measureSoon",value:function measureSoon(){var _this60=this;this.measureTimeout<0&&(this.measureTimeout=setTimeout(function(){_this60.measureTimeout=-1,_this60.maybeMeasure();},50));}},{key:"update",value:function update(t){t.transactions.length&&(this.lastTransaction=Date.now());var e=this.manager.update(t,this.above);e&&this.observeIntersection();var i=e||t.geometryChanged,s=t.state.facet(th);if(s.position!=this.position&&!this.madeAbsolute){this.position=s.position;var _iterator113=_createForOfIteratorHelper(this.manager.tooltipViews),_step113;try{for(_iterator113.s();!(_step113=_iterator113.n()).done;){var _t161=_step113.value;_t161.dom.style.position=this.position;}}catch(err){_iterator113.e(err);}finally{_iterator113.f();}i=!0;}if(s.parent!=this.parent){this.parent&&this.container.remove(),this.parent=s.parent,this.createContainer();var _iterator114=_createForOfIteratorHelper(this.manager.tooltipViews),_step114;try{for(_iterator114.s();!(_step114=_iterator114.n()).done;){var _t162=_step114.value;this.container.appendChild(_t162.dom);}}catch(err){_iterator114.e(err);}finally{_iterator114.f();}i=!0;}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);i&&this.maybeMeasure();}},{key:"createTooltip",value:function createTooltip(t,e){var i=t.create(this.view),s=e?e.dom:null;if(i.dom.classList.add("cm-tooltip"),t.arrow&&!i.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){var _t163=document.createElement("div");_t163.className="cm-tooltip-arrow",i.dom.appendChild(_t163);}return i.dom.style.position=this.position,i.dom.style.top=Xn,i.dom.style.left="0px",this.container.insertBefore(i.dom,s),i.mount&&i.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(i.dom),i;}},{key:"destroy",value:function destroy(){var t,e,i;this.view.win.removeEventListener("resize",this.measureSoon);var _iterator115=_createForOfIteratorHelper(this.manager.tooltipViews),_step115;try{for(_iterator115.s();!(_step115=_iterator115.n()).done;){var _e154=_step115.value;_e154.dom.remove(),null===(t=_e154.destroy)||void 0===t||t.call(_e154);}}catch(err){_iterator115.e(err);}finally{_iterator115.f();}this.parent&&this.container.remove(),null===(e=this.resizeObserver)||void 0===e||e.disconnect(),null===(i=this.intersectionObserver)||void 0===i||i.disconnect(),clearTimeout(this.measureTimeout);}},{key:"readMeasure",value:function readMeasure(){var _this61=this;var t=1,e=1,i=!1;if("fixed"==this.position&&this.manager.tooltipViews.length){var _t164=this.manager.tooltipViews[0].dom;if(Fe.gecko)i=_t164.offsetParent!=this.container.ownerDocument.body;else if(_t164.style.top==Xn&&"0px"==_t164.style.left){var _e155=_t164.getBoundingClientRect();i=Math.abs(_e155.top+1e4)>1||Math.abs(_e155.left)>1;}}if(i||"absolute"==this.position)if(this.parent){var _i133=this.parent.getBoundingClientRect();_i133.width&&_i133.height&&(t=_i133.width/this.parent.offsetWidth,e=_i133.height/this.parent.offsetHeight);}else{var _this$view$viewState=this.view.viewState;t=_this$view$viewState.scaleX;e=_this$view$viewState.scaleY;}var s=this.view.scrollDOM.getBoundingClientRect(),r=us(this.view);return{visible:{left:s.left+r.left,top:s.top+r.top,right:s.right-r.right,bottom:s.bottom-r.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map(function(t,e){var i=_this61.manager.tooltipViews[e];return i.getCoords?i.getCoords(t.pos):_this61.view.coordsAtPos(t.pos);}),size:this.manager.tooltipViews.map(function(_ref15){var t=_ref15.dom;return t.getBoundingClientRect();}),space:this.view.state.facet(th).tooltipSpace(this.view),scaleX:t,scaleY:e,makeAbsolute:i};}},{key:"writeMeasure",value:function writeMeasure(t){var e;if(t.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";var _iterator116=_createForOfIteratorHelper(this.manager.tooltipViews),_step116;try{for(_iterator116.s();!(_step116=_iterator116.n()).done;){var _t165=_step116.value;_t165.dom.style.position="absolute";}}catch(err){_iterator116.e(err);}finally{_iterator116.f();}}var i=t.visible,s=t.space,r=t.scaleX,n=t.scaleY,h=[];for(var _l48=0;_l48<this.manager.tooltips.length;_l48++){var _o32=this.manager.tooltips[_l48],_u26=this.manager.tooltipViews[_l48],_f21=_u26.dom,_a15=t.pos[_l48],_c11=t.size[_l48];if(!_a15||!1!==_o32.clip&&(_a15.bottom<=Math.max(i.top,s.top)||_a15.top>=Math.min(i.bottom,s.bottom)||_a15.right<Math.max(i.left,s.left)-.1||_a15.left>Math.min(i.right,s.right)+.1)){_f21.style.top=Xn;continue;}var _d9=_o32.arrow?_u26.dom.querySelector(".cm-tooltip-arrow"):null,_p8=_d9?7:0,_m4=_c11.right-_c11.left,_g4=null!==(e=eh.get(_u26))&&void 0!==e?e:_c11.bottom-_c11.top,_w=_u26.offset||nh,_b=this.view.textDirection==mi.LTR,_v=_c11.width>s.right-s.left?_b?s.left:s.right-_c11.width:_b?Math.max(s.left,Math.min(_a15.left-(_d9?14:0)+_w.x,s.right-_m4)):Math.min(Math.max(s.left,_a15.left-_m4+(_d9?14:0)-_w.x),s.right-_m4),_k=this.above[_l48];!_o32.strictSide&&(_k?_a15.top-_g4-_p8-_w.y<s.top:_a15.bottom+_g4+_p8+_w.y>s.bottom)&&_k==s.bottom-_a15.bottom>_a15.top-s.top&&(_k=this.above[_l48]=!_k);var _y=(_k?_a15.top-s.top:s.bottom-_a15.bottom)-_p8;if(_y<_g4&&!1!==_u26.resize){if(_y<this.view.defaultLineHeight){_f21.style.top=Xn;continue;}eh.set(_u26,_g4),_f21.style.height=(_g4=_y)/n+"px";}else _f21.style.height&&(_f21.style.height="");var _M=_k?_a15.top-_g4-_p8-_w.y:_a15.bottom+_p8+_w.y,_x13=_v+_m4;if(!0!==_u26.overlap){var _iterator117=_createForOfIteratorHelper(h),_step117;try{for(_iterator117.s();!(_step117=_iterator117.n()).done;){var _t166=_step117.value;_t166.left<_x13&&_t166.right>_v&&_t166.top<_M+_g4&&_t166.bottom>_M&&(_M=_k?_t166.top-_g4-2-_p8:_t166.bottom+_p8+2);}}catch(err){_iterator117.e(err);}finally{_iterator117.f();}}if("absolute"==this.position?(_f21.style.top=(_M-t.parent.top)/n+"px",sh(_f21,(_v-t.parent.left)/r)):(_f21.style.top=_M/n+"px",sh(_f21,_v/r)),_d9){var _t167=_a15.left+(_b?_w.x:-_w.x)-(_v+14-7);_d9.style.left=_t167/r+"px";}!0!==_u26.overlap&&h.push({left:_v,top:_M,right:_x13,bottom:_M+_g4}),_f21.classList.toggle("cm-tooltip-above",_k),_f21.classList.toggle("cm-tooltip-below",!_k),_u26.positioned&&_u26.positioned(t.space);}}},{key:"maybeMeasure",value:function maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView))){var _iterator118=_createForOfIteratorHelper(this.manager.tooltipViews),_step118;try{for(_iterator118.s();!(_step118=_iterator118.n()).done;){var _t168=_step118.value;_t168.dom.style.top=Xn;}}catch(err){_iterator118.e(err);}finally{_iterator118.f();}}}}]);}(),{eventObservers:{scroll:function scroll(){this.maybeMeasure();}}});rh=Qr.baseTheme({".cm-tooltip":{zIndex:500,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:"14px",position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),nh={x:0,y:0},hh=F.define({enables:[ih,rh]}),lh=F.define({combine:function combine(t){return t.reduce(function(t,e){return t.concat(e);},[]);}});oh=/*#__PURE__*/function(){function oh(t){var _this62=this;_classCallCheck(this,oh);this.view=t,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new Yn(t,lh,function(t,e){return _this62.createHostedView(t,e);},function(t){return t.dom.remove();});}return _createClass(oh,[{key:"createHostedView",value:function createHostedView(t,e){var i=t.create(this.view);return i.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(i.dom,e?e.dom.nextSibling:this.dom.firstChild),this.mounted&&i.mount&&i.mount(this.view),i;}},{key:"mount",value:function mount(t){var _iterator119=_createForOfIteratorHelper(this.manager.tooltipViews),_step119;try{for(_iterator119.s();!(_step119=_iterator119.n()).done;){var _e156=_step119.value;_e156.mount&&_e156.mount(t);}}catch(err){_iterator119.e(err);}finally{_iterator119.f();}this.mounted=!0;}},{key:"positioned",value:function positioned(t){var _iterator120=_createForOfIteratorHelper(this.manager.tooltipViews),_step120;try{for(_iterator120.s();!(_step120=_iterator120.n()).done;){var _e157=_step120.value;_e157.positioned&&_e157.positioned(t);}}catch(err){_iterator120.e(err);}finally{_iterator120.f();}}},{key:"update",value:function update(t){this.manager.update(t);}},{key:"destroy",value:function destroy(){var t;var _iterator121=_createForOfIteratorHelper(this.manager.tooltipViews),_step121;try{for(_iterator121.s();!(_step121=_iterator121.n()).done;){var _e158=_step121.value;null===(t=_e158.destroy)||void 0===t||t.call(_e158);}}catch(err){_iterator121.e(err);}finally{_iterator121.f();}}},{key:"passProp",value:function passProp(t){var e;var _iterator122=_createForOfIteratorHelper(this.manager.tooltipViews),_step122;try{for(_iterator122.s();!(_step122=_iterator122.n()).done;){var _i134=_step122.value;var _s123=_i134[t];if(void 0!==_s123)if(void 0===e)e=_s123;else if(e!==_s123)return;}}catch(err){_iterator122.e(err);}finally{_iterator122.f();}return e;}},{key:"offset",get:function get(){return this.passProp("offset");}},{key:"getCoords",get:function get(){return this.passProp("getCoords");}},{key:"overlap",get:function get(){return this.passProp("overlap");}},{key:"resize",get:function get(){return this.passProp("resize");}}],[{key:"create",value:function create(t){return new oh(t);}}]);}();uh=hh.compute([lh],function(t){var e=t.facet(lh);return 0===e.length?null:{pos:Math.min.apply(Math,_toConsumableArray(e.map(function(t){return t.pos;}))),end:Math.max.apply(Math,_toConsumableArray(e.map(function(t){var e;return null!==(e=t.end)&&void 0!==e?e:t.pos;}))),create:oh.create,above:e[0].above,arrow:e.some(function(t){return t.arrow;})};});fh=/*#__PURE__*/function(){function fh(t,e,i,s,r){_classCallCheck(this,fh);this.view=t,this.source=e,this.field=i,this.setHover=s,this.hoverTime=r,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:t.dom,time:0},this.checkHover=this.checkHover.bind(this),t.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),t.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this));}return _createClass(fh,[{key:"update",value:function update(){var _this63=this;this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(function(){return _this63.startHover();},20));}},{key:"active",get:function get(){return this.view.state.field(this.field);}},{key:"checkHover",value:function checkHover(){if(this.hoverTimeout=-1,this.active.length)return;var t=Date.now()-this.lastMove.time;t<this.hoverTime?this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime-t):this.startHover();}},{key:"startHover",value:function startHover(){var _this64=this;clearTimeout(this.restartTimeout);var t=this.view,e=this.lastMove,i=t.docView.nearest(e.target);if(!i)return;var s,r=1;if(i instanceof Je)s=i.posAtStart;else{if(s=t.posAtCoords(e),null==s)return;var _i135=t.coordsAtPos(s);if(!_i135||e.y<_i135.top||e.y>_i135.bottom||e.x<_i135.left-t.defaultCharacterWidth||e.x>_i135.right+t.defaultCharacterWidth)return;var _n80=t.bidiSpans(t.state.doc.lineAt(s)).find(function(t){return t.from<=s&&t.to>=s;}),_h52=_n80&&_n80.dir==mi.RTL?-1:1;r=e.x<_i135.left?-_h52:_h52;}var n=this.source(t,s,r);if(null==n?void 0:n.then){var _e159=this.pending={pos:s};n.then(function(i){_this64.pending==_e159&&(_this64.pending=null,!i||Array.isArray(i)&&!i.length||t.dispatch({effects:_this64.setHover.of(Array.isArray(i)?i:[i])}));},function(e){return _i(t.state,e,"hover tooltip");});}else!n||Array.isArray(n)&&!n.length||t.dispatch({effects:this.setHover.of(Array.isArray(n)?n:[n])});}},{key:"tooltip",get:function get(){var t=this.view.plugin(ih),e=t?t.manager.tooltips.findIndex(function(t){return t.create==oh.create;}):-1;return e>-1?t.manager.tooltipViews[e]:null;}},{key:"mousemove",value:function mousemove(t){var e,i;this.lastMove={x:t.clientX,y:t.clientY,target:t.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));var s=this.active,r=this.tooltip;if(s.length&&r&&!function(t,e){var i,_t$getBoundingClientR=t.getBoundingClientRect(),s=_t$getBoundingClientR.left,r=_t$getBoundingClientR.right,n=_t$getBoundingClientR.top,h=_t$getBoundingClientR.bottom;if(i=t.querySelector(".cm-tooltip-arrow")){var _t169=i.getBoundingClientRect();n=Math.min(_t169.top,n),h=Math.max(_t169.bottom,h);}return e.clientX>=s-ah&&e.clientX<=r+ah&&e.clientY>=n-ah&&e.clientY<=h+ah;}(r.dom,t)||this.pending){var _ref16=s[0]||this.pending,_r105=_ref16.pos,_n81=null!==(i=null===(e=s[0])||void 0===e?void 0:e.end)&&void 0!==i?i:_r105;(_r105==_n81?this.view.posAtCoords(this.lastMove)==_r105:function(t,e,i,s,r){var n=t.scrollDOM.getBoundingClientRect(),h=t.documentTop+t.documentPadding.top+t.contentHeight;if(n.left>s||n.right<s||n.top>r||Math.min(n.bottom,h)<r)return!1;var l=t.posAtCoords({x:s,y:r},!1);return l>=e&&l<=i;}(this.view,_r105,_n81,t.clientX,t.clientY))||(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null);}}},{key:"mouseleave",value:function mouseleave(t){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;var e=this.active;if(e.length){var _e160=this.tooltip;_e160&&_e160.dom.contains(t.relatedTarget)?this.watchTooltipLeave(_e160.dom):this.view.dispatch({effects:this.setHover.of([])});}}},{key:"watchTooltipLeave",value:function watchTooltipLeave(t){var _this65=this;var _e161=function e(i){t.removeEventListener("mouseleave",_e161),_this65.active.length&&!_this65.view.dom.contains(i.relatedTarget)&&_this65.view.dispatch({effects:_this65.setHover.of([])});};t.addEventListener("mouseleave",_e161);}},{key:"destroy",value:function destroy(){clearTimeout(this.hoverTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove);}}]);}();ah=4;ph=bt.define(),mh=F.define({combine:function combine(t){var e,i;var _iterator125=_createForOfIteratorHelper(t),_step125;try{for(_iterator125.s();!(_step125=_iterator125.n()).done;){var _s124=_step125.value;e=e||_s124.topContainer,i=i||_s124.bottomContainer;}}catch(err){_iterator125.e(err);}finally{_iterator125.f();}return{topContainer:e,bottomContainer:i};}});wh=Zi.fromClass(/*#__PURE__*/function(){function _class5(t){_classCallCheck(this,_class5);this.input=t.state.facet(kh),this.specs=this.input.filter(function(t){return t;}),this.panels=this.specs.map(function(e){return e(t);});var e=t.state.facet(mh);this.top=new bh(t,!0,e.topContainer),this.bottom=new bh(t,!1,e.bottomContainer),this.top.sync(this.panels.filter(function(t){return t.top;})),this.bottom.sync(this.panels.filter(function(t){return!t.top;}));var _iterator126=_createForOfIteratorHelper(this.panels),_step126;try{for(_iterator126.s();!(_step126=_iterator126.n()).done;){var _t171=_step126.value;_t171.dom.classList.add("cm-panel"),_t171.mount&&_t171.mount();}}catch(err){_iterator126.e(err);}finally{_iterator126.f();}}return _createClass(_class5,[{key:"update",value:function update(t){var e=t.state.facet(mh);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new bh(t.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new bh(t.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();var i=t.state.facet(kh);if(i!=this.input){var _e164=i.filter(function(t){return t;}),_s125=[],_r107=[],_n82=[],_h53=[];var _iterator127=_createForOfIteratorHelper(_e164),_step127;try{for(_iterator127.s();!(_step127=_iterator127.n()).done;){var _i138=_step127.value;var _e165=void 0,_l49=this.specs.indexOf(_i138);_l49<0?(_e165=_i138(t.view),_h53.push(_e165)):(_e165=this.panels[_l49],_e165.update&&_e165.update(t)),_s125.push(_e165),(_e165.top?_r107:_n82).push(_e165);}}catch(err){_iterator127.e(err);}finally{_iterator127.f();}this.specs=_e164,this.panels=_s125,this.top.sync(_r107),this.bottom.sync(_n82);for(var _i137=0,_h54=_h53;_i137<_h54.length;_i137++){var _t172=_h54[_i137];_t172.dom.classList.add("cm-panel"),_t172.mount&&_t172.mount();}}else{var _iterator128=_createForOfIteratorHelper(this.panels),_step128;try{for(_iterator128.s();!(_step128=_iterator128.n()).done;){var _e166=_step128.value;_e166.update&&_e166.update(t);}}catch(err){_iterator128.e(err);}finally{_iterator128.f();}}}},{key:"destroy",value:function destroy(){this.top.sync([]),this.bottom.sync([]);}}]);}(),{provide:function provide(t){return Qr.scrollMargins.of(function(e){var i=e.plugin(t);return i&&{top:i.top.scrollMargin(),bottom:i.bottom.scrollMargin()};});}});bh=/*#__PURE__*/function(){function bh(t,e,i){_classCallCheck(this,bh);this.view=t,this.top=e,this.container=i,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses();}return _createClass(bh,[{key:"sync",value:function sync(t){var _iterator129=_createForOfIteratorHelper(this.panels),_step129;try{for(_iterator129.s();!(_step129=_iterator129.n()).done;){var _e167=_step129.value;_e167.destroy&&t.indexOf(_e167)<0&&_e167.destroy();}}catch(err){_iterator129.e(err);}finally{_iterator129.f();}this.panels=t,this.syncDOM();}},{key:"syncDOM",value:function syncDOM(){if(0==this.panels.length)return void(this.dom&&(this.dom.remove(),this.dom=void 0));if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";var _t173=this.container||this.view.dom;_t173.insertBefore(this.dom,this.top?_t173.firstChild:null);}var t=this.dom.firstChild;var _iterator130=_createForOfIteratorHelper(this.panels),_step130;try{for(_iterator130.s();!(_step130=_iterator130.n()).done;){var _e168=_step130.value;if(_e168.dom.parentNode==this.dom){for(;t!=_e168.dom;)t=vh(t);t=t.nextSibling;}else this.dom.insertBefore(_e168.dom,t);}}catch(err){_iterator130.e(err);}finally{_iterator130.f();}for(;t;)t=vh(t);}},{key:"scrollMargin",value:function scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top);}},{key:"syncClasses",value:function syncClasses(){if(this.container&&this.classes!=this.view.themeClasses){var _iterator131=_createForOfIteratorHelper(this.classes.split(" ")),_step131;try{for(_iterator131.s();!(_step131=_iterator131.n()).done;){var _t174=_step131.value;_t174&&this.container.classList.remove(_t174);}}catch(err){_iterator131.e(err);}finally{_iterator131.f();}var _iterator132=_createForOfIteratorHelper((this.classes=this.view.themeClasses).split(" ")),_step132;try{for(_iterator132.s();!(_step132=_iterator132.n()).done;){var _t175=_step132.value;_t175&&this.container.classList.add(_t175);}}catch(err){_iterator132.e(err);}finally{_iterator132.f();}}}}]);}();kh=F.define({enables:wh});yh=/*#__PURE__*/function(_Tt2){function yh(){_classCallCheck(this,yh);return _callSuper(this,yh,arguments);}_inherits(yh,_Tt2);return _createClass(yh,[{key:"compare",value:function compare(t){return this==t||this.constructor==t.constructor&&this.eq(t);}},{key:"eq",value:function eq(t){return!1;}},{key:"destroy",value:function destroy(t){}}]);}(Tt);yh.prototype.elementClass="",yh.prototype.toDOM=void 0,yh.prototype.mapMode=E.TrackBefore,yh.prototype.startSide=yh.prototype.endSide=-1,yh.prototype.point=!0;Mh=F.define(),xh=F.define(),Sh={"class":"",renderEmptyElements:!1,elementStyle:"",markers:function markers(){return $t.empty;},lineMarker:function lineMarker(){return null;},widgetMarker:function widgetMarker(){return null;},lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{}},Ah=F.define();Oh=F.define({combine:function combine(t){return t.some(function(t){return t;});}});Eh=Zi.fromClass(/*#__PURE__*/function(){function _class6(t){_classCallCheck(this,_class6);this.view=t,this.prevViewport=t.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=t.state.facet(Ah).map(function(e){return new Bh(t,e);});var _iterator133=_createForOfIteratorHelper(this.gutters),_step133;try{for(_iterator133.s();!(_step133=_iterator133.n()).done;){var _t176=_step133.value;this.dom.appendChild(_t176.dom);}}catch(err){_iterator133.e(err);}finally{_iterator133.f();}this.fixed=!t.state.facet(Oh),this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),t.scrollDOM.insertBefore(this.dom,t.contentDOM);}return _createClass(_class6,[{key:"update",value:function update(t){if(this.updateGutters(t)){var _e169=this.prevViewport,_i139=t.view.viewport,_s126=Math.min(_e169.to,_i139.to)-Math.max(_e169.from,_i139.from);this.syncGutters(_s126<.8*(_i139.to-_i139.from));}t.geometryChanged&&(this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px"),this.view.state.facet(Oh)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":""),this.prevViewport=t.view.viewport;}},{key:"syncGutters",value:function syncGutters(t){var _this66=this;var e=this.dom.nextSibling;t&&this.dom.remove();var i=$t.iter(this.view.state.facet(Mh),this.view.viewport.from),s=[],r=this.gutters.map(function(t){return new Th(t,_this66.view.viewport,-_this66.view.documentPadding.top);});var _iterator134=_createForOfIteratorHelper(this.view.viewportLineBlocks),_step134;try{for(_iterator134.s();!(_step134=_iterator134.n()).done;){var _t177=_step134.value;if(s.length&&(s=[]),Array.isArray(_t177.type)){var _e170=!0;var _iterator136=_createForOfIteratorHelper(_t177.type),_step136;try{for(_iterator136.s();!(_step136=_iterator136.n()).done;){var _n83=_step136.value;if(_n83.type==ii.Text&&_e170){Rh(i,s,_n83.from);var _iterator137=_createForOfIteratorHelper(r),_step137;try{for(_iterator137.s();!(_step137=_iterator137.n()).done;){var _t178=_step137.value;_t178.line(this.view,_n83,s);}}catch(err){_iterator137.e(err);}finally{_iterator137.f();}_e170=!1;}else if(_n83.widget){var _iterator138=_createForOfIteratorHelper(r),_step138;try{for(_iterator138.s();!(_step138=_iterator138.n()).done;){var _t179=_step138.value;_t179.widget(this.view,_n83);}}catch(err){_iterator138.e(err);}finally{_iterator138.f();}}}}catch(err){_iterator136.e(err);}finally{_iterator136.f();}}else if(_t177.type==ii.Text){Rh(i,s,_t177.from);var _iterator139=_createForOfIteratorHelper(r),_step139;try{for(_iterator139.s();!(_step139=_iterator139.n()).done;){var _e171=_step139.value;_e171.line(this.view,_t177,s);}}catch(err){_iterator139.e(err);}finally{_iterator139.f();}}else if(_t177.widget){var _iterator140=_createForOfIteratorHelper(r),_step140;try{for(_iterator140.s();!(_step140=_iterator140.n()).done;){var _e172=_step140.value;_e172.widget(this.view,_t177);}}catch(err){_iterator140.e(err);}finally{_iterator140.f();}}}}catch(err){_iterator134.e(err);}finally{_iterator134.f();}var _iterator135=_createForOfIteratorHelper(r),_step135;try{for(_iterator135.s();!(_step135=_iterator135.n()).done;){var _t180=_step135.value;_t180.finish();}}catch(err){_iterator135.e(err);}finally{_iterator135.f();}t&&this.view.scrollDOM.insertBefore(this.dom,e);}},{key:"updateGutters",value:function updateGutters(t){var e=t.startState.facet(Ah),i=t.state.facet(Ah),s=t.docChanged||t.heightChanged||t.viewportChanged||!$t.eq(t.startState.facet(Mh),t.state.facet(Mh),t.view.viewport.from,t.view.viewport.to);if(e==i){var _iterator141=_createForOfIteratorHelper(this.gutters),_step141;try{for(_iterator141.s();!(_step141=_iterator141.n()).done;){var _e173=_step141.value;_e173.update(t)&&(s=!0);}}catch(err){_iterator141.e(err);}finally{_iterator141.f();}}else{s=!0;var _r108=[];var _iterator142=_createForOfIteratorHelper(i),_step142;try{for(_iterator142.s();!(_step142=_iterator142.n()).done;){var _s127=_step142.value;var _i141=e.indexOf(_s127);_i141<0?_r108.push(new Bh(this.view,_s127)):(this.gutters[_i141].update(t),_r108.push(this.gutters[_i141]));}}catch(err){_iterator142.e(err);}finally{_iterator142.f();}var _iterator143=_createForOfIteratorHelper(this.gutters),_step143;try{for(_iterator143.s();!(_step143=_iterator143.n()).done;){var _t182=_step143.value;_t182.dom.remove(),_r108.indexOf(_t182)<0&&_t182.destroy();}}catch(err){_iterator143.e(err);}finally{_iterator143.f();}for(var _i140=0,_r109=_r108;_i140<_r109.length;_i140++){var _t181=_r109[_i140];this.dom.appendChild(_t181.dom);}this.gutters=_r108;}return s;}},{key:"destroy",value:function destroy(){var _iterator144=_createForOfIteratorHelper(this.gutters),_step144;try{for(_iterator144.s();!(_step144=_iterator144.n()).done;){var _t183=_step144.value;_t183.destroy();}}catch(err){_iterator144.e(err);}finally{_iterator144.f();}this.dom.remove();}}]);}(),{provide:function provide(t){return Qr.scrollMargins.of(function(e){var i=e.plugin(t);return i&&0!=i.gutters.length&&i.fixed?e.textDirection==mi.LTR?{left:i.dom.offsetWidth*e.scaleX}:{right:i.dom.offsetWidth*e.scaleX}:null;});}});Th=/*#__PURE__*/function(){function Th(t,e,i){_classCallCheck(this,Th);this.gutter=t,this.height=i,this.i=0,this.cursor=$t.iter(t.markers,e.from);}return _createClass(Th,[{key:"addElement",value:function addElement(t,e,i){var s=this.gutter,r=(e.top-this.height)/t.scaleY,n=e.height/t.scaleY;if(this.i==s.elements.length){var _e174=new Lh(t,n,r,i);s.elements.push(_e174),s.dom.appendChild(_e174.dom);}else s.elements[this.i].update(t,n,r,i);this.height=e.bottom,this.i++;}},{key:"line",value:function line(t,e,i){var s=[];Rh(this.cursor,s,e.from),i.length&&(s=s.concat(i));var r=this.gutter.config.lineMarker(t,e,s);r&&s.unshift(r);var n=this.gutter;(0!=s.length||n.config.renderEmptyElements)&&this.addElement(t,e,s);}},{key:"widget",value:function widget(t,e){var i=this.gutter.config.widgetMarker(t,e.widget,e),s=i?[i]:null;var _iterator145=_createForOfIteratorHelper(t.state.facet(xh)),_step145;try{for(_iterator145.s();!(_step145=_iterator145.n()).done;){var _i142=_step145.value;var _r110=_i142(t,e.widget,e);_r110&&(s||(s=[])).push(_r110);}}catch(err){_iterator145.e(err);}finally{_iterator145.f();}s&&this.addElement(t,e,s);}},{key:"finish",value:function finish(){var t=this.gutter;for(;t.elements.length>this.i;){var _e175=t.elements.pop();t.dom.removeChild(_e175.dom),_e175.destroy();}}}]);}();Bh=/*#__PURE__*/function(){function Bh(t,e){var _this67=this;_classCallCheck(this,Bh);this.view=t,this.config=e,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config["class"]?" "+this.config["class"]:"");var _loop11=function _loop11(_i143){_this67.dom.addEventListener(_i143,function(s){var r,n=s.target;if(n!=_this67.dom&&_this67.dom.contains(n)){for(;n.parentNode!=_this67.dom;)n=n.parentNode;var _t184=n.getBoundingClientRect();r=(_t184.top+_t184.bottom)/2;}else r=s.clientY;var h=t.lineBlockAtHeight(r-t.documentTop);e.domEventHandlers[_i143](t,h,s)&&s.preventDefault();});};for(var _i143 in e.domEventHandlers){_loop11(_i143);}this.markers=Ih(e.markers(t)),e.initialSpacer&&(this.spacer=new Lh(t,0,0,[e.initialSpacer(t)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none");}return _createClass(Bh,[{key:"update",value:function update(t){var e=this.markers;if(this.markers=Ih(this.config.markers(t.view)),this.spacer&&this.config.updateSpacer){var _e176=this.config.updateSpacer(this.spacer.markers[0],t);_e176!=this.spacer.markers[0]&&this.spacer.update(t.view,0,0,[_e176]);}var i=t.view.viewport;return!$t.eq(this.markers,e,i.from,i.to)||!!this.config.lineMarkerChange&&this.config.lineMarkerChange(t);}},{key:"destroy",value:function destroy(){var _iterator146=_createForOfIteratorHelper(this.elements),_step146;try{for(_iterator146.s();!(_step146=_iterator146.n()).done;){var _t185=_step146.value;_t185.destroy();}}catch(err){_iterator146.e(err);}finally{_iterator146.f();}}}]);}();Lh=/*#__PURE__*/function(){function Lh(t,e,i,s){_classCallCheck(this,Lh);this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(t,e,i,s);}return _createClass(Lh,[{key:"update",value:function update(t,e,i,s){this.height!=e&&(this.height=e,this.dom.style.height=e+"px"),this.above!=i&&(this.dom.style.marginTop=(this.above=i)?i+"px":""),function(t,e){if(t.length!=e.length)return!1;for(var _i144=0;_i144<t.length;_i144++)if(!t[_i144].compare(e[_i144]))return!1;return!0;}(this.markers,s)||this.setMarkers(t,s);}},{key:"setMarkers",value:function setMarkers(t,e){var i="cm-gutterElement",s=this.dom.firstChild;for(var _r111=0,_n84=0;;){var _h55=_n84,_l50=_r111<e.length?e[_r111++]:null,_o33=!1;if(_l50){var _t186=_l50.elementClass;_t186&&(i+=" "+_t186);for(var _t187=_n84;_t187<this.markers.length;_t187++)if(this.markers[_t187].compare(_l50)){_h55=_t187,_o33=!0;break;}}else _h55=this.markers.length;for(;_n84<_h55;){var _t188=this.markers[_n84++];if(_t188.toDOM){_t188.destroy(s);var _e177=s.nextSibling;s.remove(),s=_e177;}}if(!_l50)break;_l50.toDOM&&(_o33?s=s.nextSibling:this.dom.insertBefore(_l50.toDOM(t),s)),_o33&&_n84++;}this.dom.className=i,this.markers=e;}},{key:"destroy",value:function destroy(){this.setMarkers(null,[]);}}]);}();Nh=F.define(),$h=F.define(),jh=F.define({combine:function combine(t){return Rt(t,{formatNumber:String,domEventHandlers:{}},{domEventHandlers:function domEventHandlers(t,e){var i=Object.assign({},t);var _loop12=function _loop12(){var s=i[_t189],r=e[_t189];i[_t189]=s?function(t,e,i){return s(t,e,i)||r(t,e,i);}:r;};for(var _t189 in e){_loop12();}return i;}});}});zh=/*#__PURE__*/function(_yh){function zh(t){var _this68;_classCallCheck(this,zh);_this68=_callSuper(this,zh),_this68.number=t;return _this68;}_inherits(zh,_yh);return _createClass(zh,[{key:"eq",value:function eq(t){return this.number==t.number;}},{key:"toDOM",value:function toDOM(){return document.createTextNode(this.number);}}]);}(yh);Hh=Ah.compute([jh],function(t){return{"class":"cm-lineNumbers",renderEmptyElements:!1,markers:function markers(t){return t.state.facet(Nh);},lineMarker:function lineMarker(t,e,i){return i.some(function(t){return t.toDOM;})?null:new zh(Ph(t,t.state.doc.lineAt(e.from).number));},widgetMarker:function widgetMarker(t,e,i){var _iterator147=_createForOfIteratorHelper(t.state.facet($h)),_step147;try{for(_iterator147.s();!(_step147=_iterator147.n()).done;){var _s128=_step147.value;var _r112=_s128(t,e,i);if(_r112)return _r112;}}catch(err){_iterator147.e(err);}finally{_iterator147.f();}return null;},lineMarkerChange:function lineMarkerChange(t){return t.startState.facet(jh)!=t.state.facet(jh);},initialSpacer:function initialSpacer(t){return new zh(Ph(t,Fh(t.state.doc.lines)));},updateSpacer:function updateSpacer(t,e){var i=Ph(e.view,Fh(e.view.state.doc.lines));return i==t.number?t:new zh(i);},domEventHandlers:t.facet(jh).domEventHandlers};});Vh=new(/*#__PURE__*/function(_yh2){function _class7(){var _this69;_classCallCheck(this,_class7);_this69=_callSuper(this,_class7,arguments),_this69.elementClass="cm-activeLineGutter";return _this69;}_inherits(_class7,_yh2);return _createClass(_class7);}(yh))(),qh=Mh.compute(["selection"],function(t){var e=[],i=-1;var _iterator148=_createForOfIteratorHelper(t.selection.ranges),_step148;try{for(_iterator148.s();!(_step148=_iterator148.n()).done;){var _s129=_step148.value;var _r113=t.doc.lineAt(_s129.head).from;_r113>i&&(i=_r113,e.push(Vh.range(_r113)));}}catch(err){_iterator148.e(err);}finally{_iterator148.f();}return $t.of(e);});_export("D",Jh=1024);Uh=0;Gh=/*#__PURE__*/_createClass(function Gh(t,e){_classCallCheck(this,Gh);this.from=t,this.to=e;});_export("b",Kh=/*#__PURE__*/function(){function Kh(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,Kh);this.id=Uh++,this.perNode=!!t.perNode,this.deserialize=t.deserialize||function(){throw new Error("This node type doesn't define a deserialize function");};}return _createClass(Kh,[{key:"add",value:function add(t){var _this70=this;if(this.perNode)throw new RangeError("Can't add per-node props to node types");return"function"!=typeof t&&(t=Yh.match(t)),function(e){var i=t(e);return void 0===i?null:[_this70,i];};}}]);}());Kh.closedBy=new Kh({deserialize:function deserialize(t){return t.split(" ");}}),Kh.openedBy=new Kh({deserialize:function deserialize(t){return t.split(" ");}}),Kh.group=new Kh({deserialize:function deserialize(t){return t.split(" ");}}),Kh.isolate=new Kh({deserialize:function deserialize(t){if(t&&"rtl"!=t&&"ltr"!=t&&"auto"!=t)throw new RangeError("Invalid value for isolate: "+t);return t||"auto";}}),Kh.contextHash=new Kh({perNode:!0}),Kh.lookAhead=new Kh({perNode:!0}),Kh.mounted=new Kh({perNode:!0});_h=/*#__PURE__*/function(){function _h(t,e,i){_classCallCheck(this,_h);this.tree=t,this.overlay=e,this.parser=i;}return _createClass(_h,null,[{key:"get",value:function get(t){return t&&t.props&&t.props[Kh.mounted.id];}}]);}();Xh=Object.create(null);_export("a",Yh=/*#__PURE__*/function(){function Yh(t,e,i){var s=arguments.length>3&&arguments[3]!==undefined?arguments[3]:0;_classCallCheck(this,Yh);this.name=t,this.props=e,this.id=i,this.flags=s;}return _createClass(Yh,[{key:"prop",value:function prop(t){return this.props[t.id];}},{key:"isTop",get:function get(){return(1&this.flags)>0;}},{key:"isSkipped",get:function get(){return(2&this.flags)>0;}},{key:"isError",get:function get(){return(4&this.flags)>0;}},{key:"isAnonymous",get:function get(){return(8&this.flags)>0;}},{key:"is",value:function is(t){if("string"==typeof t){if(this.name==t)return!0;var _e178=this.prop(Kh.group);return!!_e178&&_e178.indexOf(t)>-1;}return this.id==t;}}],[{key:"define",value:function define(t){var e=t.props&&t.props.length?Object.create(null):Xh,i=(t.top?1:0)|(t.skipped?2:0)|(t.error?4:0)|(null==t.name?8:0),s=new Yh(t.name||"",e,t.id,i);if(t.props){var _iterator149=_createForOfIteratorHelper(t.props),_step149;try{for(_iterator149.s();!(_step149=_iterator149.n()).done;){var _i145=_step149.value;if(Array.isArray(_i145)||(_i145=_i145(s)),_i145){if(_i145[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");e[_i145[0].id]=_i145[1];}}}catch(err){_iterator149.e(err);}finally{_iterator149.f();}}return s;}},{key:"match",value:function match(t){var e=Object.create(null);for(var _i146 in t){var _iterator150=_createForOfIteratorHelper(_i146.split(" ")),_step150;try{for(_iterator150.s();!(_step150=_iterator150.n()).done;){var _s130=_step150.value;e[_s130]=t[_i146];}}catch(err){_iterator150.e(err);}finally{_iterator150.f();}}return function(t){for(var _i147=t.prop(Kh.group),_s131=-1;_s131<(_i147?_i147.length:0);_s131++){var _r114=e[_s131<0?t.name:_i147[_s131]];if(_r114)return _r114;}};}}]);}());Yh.none=new Yh("",Object.create(null),0,8);_export("N",Qh=/*#__PURE__*/function(){function Qh(t){_classCallCheck(this,Qh);this.types=t;for(var _e179=0;_e179<t.length;_e179++)if(t[_e179].id!=_e179)throw new RangeError("Node type ids should correspond to array positions when creating a node set");}return _createClass(Qh,[{key:"extend",value:function extend(){var e=[];for(var _len4=arguments.length,t=new Array(_len4),_key4=0;_key4<_len4;_key4++){t[_key4]=arguments[_key4];}var _iterator151=_createForOfIteratorHelper(this.types),_step151;try{for(_iterator151.s();!(_step151=_iterator151.n()).done;){var _i148=_step151.value;var _s132=null;var _iterator152=_createForOfIteratorHelper(t),_step152;try{for(_iterator152.s();!(_step152=_iterator152.n()).done;){var _e180=_step152.value;var _t190=_e180(_i148);_t190&&(_s132||(_s132=Object.assign({},_i148.props)),_s132[_t190[0].id]=_t190[1]);}}catch(err){_iterator152.e(err);}finally{_iterator152.f();}e.push(_s132?new Yh(_i148.name,_s132,_i148.id,_i148.flags):_i148);}}catch(err){_iterator151.e(err);}finally{_iterator151.f();}return new Qh(e);}}]);}());Zh=new WeakMap(),tl=new WeakMap();!function(t){t[t.ExcludeBuffers=1]="ExcludeBuffers",t[t.IncludeAnonymous=2]="IncludeAnonymous",t[t.IgnoreMounts=4]="IgnoreMounts",t[t.IgnoreOverlays=8]="IgnoreOverlays";}(el||_export("I",el={}));_export("T",il=/*#__PURE__*/function(){function il(t,e,i,s,r){_classCallCheck(this,il);if(this.type=t,this.children=e,this.positions=i,this.length=s,this.props=null,r&&r.length){this.props=Object.create(null);var _iterator153=_createForOfIteratorHelper(r),_step153;try{for(_iterator153.s();!(_step153=_iterator153.n()).done;){var _step153$value=_slicedToArray(_step153.value,2),_t191=_step153$value[0],_e181=_step153$value[1];this.props["number"==typeof _t191?_t191:_t191.id]=_e181;}}catch(err){_iterator153.e(err);}finally{_iterator153.f();}}}return _createClass(il,[{key:"toString",value:function toString(){var t=_h.get(this);if(t&&!t.overlay)return t.tree.toString();var e="";var _iterator154=_createForOfIteratorHelper(this.children),_step154;try{for(_iterator154.s();!(_step154=_iterator154.n()).done;){var _t192=_step154.value;var _i149=_t192.toString();_i149&&(e&&(e+=","),e+=_i149);}}catch(err){_iterator154.e(err);}finally{_iterator154.f();}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(e.length?"("+e+")":""):e;}},{key:"cursor",value:function cursor(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return new ml(this.topNode,t);}},{key:"cursorAt",value:function cursorAt(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;var s=Zh.get(this)||this.topNode,r=new ml(s);return r.moveTo(t,e),Zh.set(this,r._tree),r;}},{key:"topNode",get:function get(){return new ol(this,0,0,null);}},{key:"resolve",value:function resolve(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var i=hl(Zh.get(this)||this.topNode,t,e,!1);return Zh.set(this,i),i;}},{key:"resolveInner",value:function resolveInner(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var i=hl(tl.get(this)||this.topNode,t,e,!0);return tl.set(this,i),i;}},{key:"resolveStack",value:function resolveStack(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;return function(t,e,i){var s=t.resolveInner(e,i),r=null;for(var _t193=s instanceof ol?s:s.context.parent;_t193;_t193=_t193.parent)if(_t193.index<0){var _n85=_t193.parent;(r||(r=[s])).push(_n85.resolve(e,i)),_t193=_n85;}else{var _n86=_h.get(_t193.tree);if(_n86&&_n86.overlay&&_n86.overlay[0].from<=e&&_n86.overlay[_n86.overlay.length-1].to>=e){var _h56=new ol(_n86.tree,_n86.overlay[0].from+_t193.from,-1,_t193);(r||(r=[s])).push(hl(_h56,e,i,!1));}}return r?dl(r):s;}(this,t,e);}},{key:"iterate",value:function iterate(t){var e=t.enter,i=t.leave,_t$from=t.from,s=_t$from===void 0?0:_t$from,_t$to=t.to,r=_t$to===void 0?this.length:_t$to,n=t.mode||0,h=(n&el.IncludeAnonymous)>0;for(var _t194=this.cursor(n|el.IncludeAnonymous);;){var _n87=!1;if(_t194.from<=r&&_t194.to>=s&&(!h&&_t194.type.isAnonymous||!1!==e(_t194))){if(_t194.firstChild())continue;_n87=!0;}for(;_n87&&i&&(h||!_t194.type.isAnonymous)&&i(_t194),!_t194.nextSibling();){if(!_t194.parent())return;_n87=!0;}}}},{key:"prop",value:function prop(t){return t.perNode?this.props?this.props[t.id]:void 0:this.type.prop(t);}},{key:"propValues",get:function get(){var t=[];if(this.props)for(var _e182 in this.props)t.push([+_e182,this.props[_e182]]);return t;}},{key:"balance",value:function balance(){var _this71=this;var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return this.children.length<=8?this:vl(Yh.none,this.children,this.positions,0,this.children.length,0,this.length,function(t,e,i){return new il(_this71.type,t,e,i,_this71.propValues);},t.makeTree||function(t,e,i){return new il(Yh.none,t,e,i);});}}],[{key:"build",value:function build(t){return function(t){var e;var i=t.buffer,s=t.nodeSet,_t$maxBufferLength=t.maxBufferLength,r=_t$maxBufferLength===void 0?Jh:_t$maxBufferLength,_t$reused=t.reused,n=_t$reused===void 0?[]:_t$reused,_t$minRepeatType=t.minRepeatType,h=_t$minRepeatType===void 0?s.types.length:_t$minRepeatType,l=Array.isArray(i)?new sl(i,i.length):i,o=s.types,u=0,f=0;function a(t,e,i,b,v,k){var y=l.id,M=l.start,x=l.end,S=l.size,A=f,C=u;for(;S<0;){if(l.next(),-1==S){var _e183=n[y];return i.push(_e183),void b.push(M-t);}if(-3==S)return void(u=y);if(-4==S)return void(f=y);throw new RangeError("Unrecognized record size: ".concat(S));}var O,D,E=o[y],I=M-t;if(x-M<=r&&(D=g(l.pos-e,v))){var _e184=new Uint16Array(D.size-D.skip),_i150=l.pos-D.size,_r115=_e184.length;for(;l.pos>_i150;)_r115=w(D.start,_e184,_r115);O=new rl(_e184,x-D.start,s),I=D.start-t;}else{var _t195=l.pos-S;l.next();var _e185=[],_i151=[],_s133=y>=h?y:-1,_n88=0,_o34=x;for(;l.pos>_t195;)_s133>=0&&l.id==_s133&&l.size>=0?(l.end<=_o34-r&&(p(_e185,_i151,M,_n88,l.end,_o34,_s133,A,C),_n88=_e185.length,_o34=l.end),l.next()):k>2500?c(M,_t195,_e185,_i151):a(M,_t195,_e185,_i151,_s133,k+1);if(_s133>=0&&_n88>0&&_n88<_e185.length&&p(_e185,_i151,M,_n88,M,_o34,_s133,A,C),_e185.reverse(),_i151.reverse(),_s133>-1&&_n88>0){var _t196=d(E,C);O=vl(E,_e185,_i151,0,_e185.length,0,x-M,_t196,_t196);}else O=m(E,_e185,_i151,x-M,A-x,C);}i.push(O),b.push(I);}function c(t,e,i,n){var h=[],o=0,u=-1;for(;l.pos>e;){var _t197=l.id,_e186=l.start,_i152=l.end,_s134=l.size;if(_s134>4)l.next();else{if(u>-1&&_e186<u)break;u<0&&(u=_i152-r),h.push(_t197,_e186,_i152),o++,l.next();}}if(o){var _e187=new Uint16Array(4*o),_r116=h[h.length-2];for(var _t198=h.length-3,_i153=0;_t198>=0;_t198-=3)_e187[_i153++]=h[_t198],_e187[_i153++]=h[_t198+1]-_r116,_e187[_i153++]=h[_t198+2]-_r116,_e187[_i153++]=_i153;i.push(new rl(_e187,h[2]-_r116,s)),n.push(_r116-t);}}function d(t,e){return function(i,s,r){var n,h,l=0,o=i.length-1;if(o>=0&&(n=i[o])instanceof il){if(!o&&n.type==t&&n.length==r)return n;(h=n.prop(Kh.lookAhead))&&(l=s[o]+n.length+h);}return m(t,i,s,r,l,e);};}function p(t,e,i,r,n,h,l,o,u){var f=[],a=[];for(;t.length>r;)f.push(t.pop()),a.push(e.pop()+i-n);t.push(m(s.types[l],f,a,h-n,o-h,u)),e.push(n-i);}function m(t,e,i,s,r,n,h){if(n){var _t199=[Kh.contextHash,n];h=h?[_t199].concat(h):[_t199];}if(r>25){var _t200=[Kh.lookAhead,r];h=h?[_t200].concat(h):[_t200];}return new il(t,e,i,s,h);}function g(t,e){var i=l.fork(),s=0,n=0,o=0,u=i.end-r,f={size:0,start:0,skip:0};t:for(var _r117=i.pos-t;i.pos>_r117;){var _t201=i.size;if(i.id==e&&_t201>=0){f.size=s,f.start=n,f.skip=o,o+=4,s+=4,i.next();continue;}var _l51=i.pos-_t201;if(_t201<0||_l51<_r117||i.start<u)break;var _a16=i.id>=h?4:0,_c12=i.start;for(i.next();i.pos>_l51;){if(i.size<0){if(-3!=i.size)break t;_a16+=4;}else i.id>=h&&(_a16+=4);i.next();}n=_c12,s+=_t201,o+=_a16;}return(e<0||s==t)&&(f.size=s,f.start=n,f.skip=o),f.size>4?f:void 0;}function w(t,e,i){var s=l.id,r=l.start,n=l.end,o=l.size;if(l.next(),o>=0&&s<h){var _h57=i;if(o>4){var _s135=l.pos-(o-4);for(;l.pos>_s135;)i=w(t,e,i);}e[--i]=_h57,e[--i]=n-t,e[--i]=r-t,e[--i]=s;}else-3==o?u=s:-4==o&&(f=s);return i;}var b=[],v=[];for(;l.pos>0;)a(t.start||0,t.bufferStart||0,b,v,-1,0);var k=null!==(e=t.length)&&void 0!==e?e:b.length?v[0]+b[0].length:0;return new il(o[t.topID],b.reverse(),v.reverse(),k);}(t);}}]);}());il.empty=new il(Yh.none,[],[],0);sl=/*#__PURE__*/function(){function sl(t,e){_classCallCheck(this,sl);this.buffer=t,this.index=e;}return _createClass(sl,[{key:"id",get:function get(){return this.buffer[this.index-4];}},{key:"start",get:function get(){return this.buffer[this.index-3];}},{key:"end",get:function get(){return this.buffer[this.index-2];}},{key:"size",get:function get(){return this.buffer[this.index-1];}},{key:"pos",get:function get(){return this.index;}},{key:"next",value:function next(){this.index-=4;}},{key:"fork",value:function fork(){return new sl(this.buffer,this.index);}}]);}();rl=/*#__PURE__*/function(){function rl(t,e,i){_classCallCheck(this,rl);this.buffer=t,this.length=e,this.set=i;}return _createClass(rl,[{key:"type",get:function get(){return Yh.none;}},{key:"toString",value:function toString(){var t=[];for(var _e188=0;_e188<this.buffer.length;)t.push(this.childString(_e188)),_e188=this.buffer[_e188+3];return t.join(",");}},{key:"childString",value:function childString(t){var e=this.buffer[t],i=this.buffer[t+3],s=this.set.types[e],r=s.name;if(/\W/.test(r)&&!s.isError&&(r=JSON.stringify(r)),i==(t+=4))return r;var n=[];for(;t<i;)n.push(this.childString(t)),t=this.buffer[t+3];return r+"("+n.join(",")+")";}},{key:"findChild",value:function findChild(t,e,i,s,r){var n=this.buffer,h=-1;for(var _l52=t;_l52!=e&&!(nl(r,s,n[_l52+1],n[_l52+2])&&(h=_l52,i>0));_l52=n[_l52+3]);return h;}},{key:"slice",value:function slice(t,e,i){var s=this.buffer,r=new Uint16Array(e-t),n=0;for(var _h58=t,_l53=0;_h58<e;){r[_l53++]=s[_h58++],r[_l53++]=s[_h58++]-i;var _e189=r[_l53++]=s[_h58++]-i;r[_l53++]=s[_h58++]-t,n=Math.max(n,_e189);}return new rl(r,n,this.set);}}]);}();ll=/*#__PURE__*/function(){function ll(){_classCallCheck(this,ll);}return _createClass(ll,[{key:"cursor",value:function cursor(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return new ml(this,t);}},{key:"getChild",value:function getChild(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:null;var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:null;var s=ul(this,t,e,i);return s.length?s[0]:null;}},{key:"getChildren",value:function getChildren(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:null;var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:null;return ul(this,t,e,i);}},{key:"resolve",value:function resolve(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;return hl(this,t,e,!1);}},{key:"resolveInner",value:function resolveInner(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;return hl(this,t,e,!0);}},{key:"matchContext",value:function matchContext(t){return fl(this.parent,t);}},{key:"enterUnfinishedNodesBefore",value:function enterUnfinishedNodesBefore(t){var e=this.childBefore(t),i=this;for(;e;){var _t202=e.lastChild;if(!_t202||_t202.to!=e.to)break;_t202.type.isError&&_t202.from==_t202.to?(i=e,e=_t202.prevSibling):e=_t202;}return i;}},{key:"node",get:function get(){return this;}},{key:"next",get:function get(){return this.parent;}}]);}();ol=/*#__PURE__*/function(_ll){function ol(t,e,i,s){var _this72;_classCallCheck(this,ol);_this72=_callSuper(this,ol),_this72._tree=t,_this72.from=e,_this72.index=i,_this72._parent=s;return _this72;}_inherits(ol,_ll);return _createClass(ol,[{key:"type",get:function get(){return this._tree.type;}},{key:"name",get:function get(){return this._tree.type.name;}},{key:"to",get:function get(){return this.from+this._tree.length;}},{key:"nextChild",value:function nextChild(t,e,i,s){var r=arguments.length>4&&arguments[4]!==undefined?arguments[4]:0;for(var _n89=this;;){for(var _n89$_tree=_n89._tree,_h60=_n89$_tree.children,_l54=_n89$_tree.positions,_o35=e>0?_h60.length:-1;t!=_o35;t+=e){var _o36=_h60[t],_u27=_l54[t]+_n89.from;if(nl(s,i,_u27,_u27+_o36.length))if(_o36 instanceof rl){if(r&el.ExcludeBuffers)continue;var _h61=_o36.findChild(0,_o36.buffer.length,e,i-_u27,s);if(_h61>-1)return new cl(new al(_n89,_o36,t,_u27),null,_h61);}else if(r&el.IncludeAnonymous||!_o36.type.isAnonymous||gl(_o36)){var _h62=void 0;if(!(r&el.IgnoreMounts)&&(_h62=_h.get(_o36))&&!_h62.overlay)return new ol(_h62.tree,_u27,t,_n89);var _l55=new ol(_o36,_u27,t,_n89);return r&el.IncludeAnonymous||!_l55.type.isAnonymous?_l55:_l55.nextChild(e<0?_o36.children.length-1:0,e,i,s);}}if(r&el.IncludeAnonymous||!_n89.type.isAnonymous)return null;if(t=_n89.index>=0?_n89.index+e:e<0?-1:_n89._parent._tree.children.length,_n89=_n89._parent,!_n89)return null;}}},{key:"firstChild",get:function get(){return this.nextChild(0,1,0,4);}},{key:"lastChild",get:function get(){return this.nextChild(this._tree.children.length-1,-1,0,4);}},{key:"childAfter",value:function childAfter(t){return this.nextChild(0,1,t,2);}},{key:"childBefore",value:function childBefore(t){return this.nextChild(this._tree.children.length-1,-1,t,-2);}},{key:"enter",value:function enter(t,e){var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;var s;if(!(i&el.IgnoreOverlays)&&(s=_h.get(this._tree))&&s.overlay){var _i154=t-this.from;var _iterator155=_createForOfIteratorHelper(s.overlay),_step155;try{for(_iterator155.s();!(_step155=_iterator155.n()).done;){var _step155$value=_step155.value,_t203=_step155$value.from,_r118=_step155$value.to;if((e>0?_t203<=_i154:_t203<_i154)&&(e<0?_r118>=_i154:_r118>_i154))return new ol(s.tree,s.overlay[0].from+this.from,-1,this);}}catch(err){_iterator155.e(err);}finally{_iterator155.f();}}return this.nextChild(0,1,t,e,i);}},{key:"nextSignificantParent",value:function nextSignificantParent(){var t=this;for(;t.type.isAnonymous&&t._parent;)t=t._parent;return t;}},{key:"parent",get:function get(){return this._parent?this._parent.nextSignificantParent():null;}},{key:"nextSibling",get:function get(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null;}},{key:"prevSibling",get:function get(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null;}},{key:"tree",get:function get(){return this._tree;}},{key:"toTree",value:function toTree(){return this._tree;}},{key:"toString",value:function toString(){return this._tree.toString();}}]);}(ll);al=/*#__PURE__*/_createClass(function al(t,e,i,s){_classCallCheck(this,al);this.parent=t,this.buffer=e,this.index=i,this.start=s;});cl=/*#__PURE__*/function(_ll2){function cl(t,e,i){var _this73;_classCallCheck(this,cl);_this73=_callSuper(this,cl),_this73.context=t,_this73._parent=e,_this73.index=i,_this73.type=t.buffer.set.types[t.buffer.buffer[i]];return _this73;}_inherits(cl,_ll2);return _createClass(cl,[{key:"name",get:function get(){return this.type.name;}},{key:"from",get:function get(){return this.context.start+this.context.buffer.buffer[this.index+1];}},{key:"to",get:function get(){return this.context.start+this.context.buffer.buffer[this.index+2];}},{key:"child",value:function child(t,e,i){var s=this.context.buffer,r=s.findChild(this.index+4,s.buffer[this.index+3],t,e-this.context.start,i);return r<0?null:new cl(this.context,this,r);}},{key:"firstChild",get:function get(){return this.child(1,0,4);}},{key:"lastChild",get:function get(){return this.child(-1,0,4);}},{key:"childAfter",value:function childAfter(t){return this.child(1,t,2);}},{key:"childBefore",value:function childBefore(t){return this.child(-1,t,-2);}},{key:"enter",value:function enter(t,e){var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;if(i&el.ExcludeBuffers)return null;var s=this.context.buffer,r=s.findChild(this.index+4,s.buffer[this.index+3],e>0?1:-1,t-this.context.start,e);return r<0?null:new cl(this.context,this,r);}},{key:"parent",get:function get(){return this._parent||this.context.parent.nextSignificantParent();}},{key:"externalSibling",value:function externalSibling(t){return this._parent?null:this.context.parent.nextChild(this.context.index+t,t,0,4);}},{key:"nextSibling",get:function get(){var t=this.context.buffer,e=t.buffer[this.index+3];return e<(this._parent?t.buffer[this._parent.index+3]:t.buffer.length)?new cl(this.context,this._parent,e):this.externalSibling(1);}},{key:"prevSibling",get:function get(){var t=this.context.buffer,e=this._parent?this._parent.index+4:0;return this.index==e?this.externalSibling(-1):new cl(this.context,this._parent,t.findChild(e,this.index,-1,0,4));}},{key:"tree",get:function get(){return null;}},{key:"toTree",value:function toTree(){var t=[],e=[],i=this.context.buffer,s=this.index+4,r=i.buffer[this.index+3];if(r>s){var _n90=i.buffer[this.index+1];t.push(i.slice(s,r,_n90)),e.push(0);}return new il(this.type,t,e,this.to-this.from);}},{key:"toString",value:function toString(){return this.context.buffer.childString(this.index);}}]);}(ll);pl=/*#__PURE__*/function(){function pl(t,e){_classCallCheck(this,pl);this.heads=t,this.node=e;}return _createClass(pl,[{key:"next",get:function get(){return dl(this.heads);}}]);}();ml=/*#__PURE__*/function(){function ml(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;_classCallCheck(this,ml);if(this.mode=e,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,t instanceof ol)this.yieldNode(t);else{this._tree=t.context.parent,this.buffer=t.context;for(var _e191=t._parent;_e191;_e191=_e191._parent)this.stack.unshift(_e191.index);this.bufferNode=t,this.yieldBuf(t.index);}}return _createClass(ml,[{key:"name",get:function get(){return this.type.name;}},{key:"yieldNode",value:function yieldNode(t){return!!t&&(this._tree=t,this.type=t.type,this.from=t.from,this.to=t.to,!0);}},{key:"yieldBuf",value:function yieldBuf(t,e){this.index=t;var _this$buffer=this.buffer,i=_this$buffer.start,s=_this$buffer.buffer;return this.type=e||s.set.types[s.buffer[t]],this.from=i+s.buffer[t+1],this.to=i+s.buffer[t+2],!0;}},{key:"yield",value:function _yield(t){return!!t&&(t instanceof ol?(this.buffer=null,this.yieldNode(t)):(this.buffer=t.context,this.yieldBuf(t.index,t.type)));}},{key:"toString",value:function toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString();}},{key:"enterChild",value:function enterChild(t,e,i){if(!this.buffer)return this["yield"](this._tree.nextChild(t<0?this._tree._tree.children.length-1:0,t,e,i,this.mode));var s=this.buffer.buffer,r=s.findChild(this.index+4,s.buffer[this.index+3],t,e-this.buffer.start,i);return!(r<0)&&(this.stack.push(this.index),this.yieldBuf(r));}},{key:"firstChild",value:function firstChild(){return this.enterChild(1,0,4);}},{key:"lastChild",value:function lastChild(){return this.enterChild(-1,0,4);}},{key:"childAfter",value:function childAfter(t){return this.enterChild(1,t,2);}},{key:"childBefore",value:function childBefore(t){return this.enterChild(-1,t,-2);}},{key:"enter",value:function enter(t,e){var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:this.mode;return this.buffer?!(i&el.ExcludeBuffers)&&this.enterChild(1,t,e):this["yield"](this._tree.enter(t,e,i));}},{key:"parent",value:function parent(){if(!this.buffer)return this.yieldNode(this.mode&el.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());var t=this.mode&el.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(t);}},{key:"sibling",value:function sibling(t){if(!this.buffer)return!!this._tree._parent&&this["yield"](this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+t,t,0,4,this.mode));var e=this.buffer.buffer,i=this.stack.length-1;if(t<0){var _t205=i<0?0:this.stack[i]+4;if(this.index!=_t205)return this.yieldBuf(e.findChild(_t205,this.index,-1,0,4));}else{var _t206=e.buffer[this.index+3];if(_t206<(i<0?e.buffer.length:e.buffer[this.stack[i]+3]))return this.yieldBuf(_t206);}return i<0&&this["yield"](this.buffer.parent.nextChild(this.buffer.index+t,t,0,4,this.mode));}},{key:"nextSibling",value:function nextSibling(){return this.sibling(1);}},{key:"prevSibling",value:function prevSibling(){return this.sibling(-1);}},{key:"atLastNode",value:function atLastNode(t){var e,i,s=this.buffer;if(s){if(t>0){if(this.index<s.buffer.buffer.length)return!1;}else for(var _t207=0;_t207<this.index;_t207++)if(s.buffer.buffer[_t207+3]<this.index)return!1;e=s.index;i=s.parent;}else{var _this$_tree=this._tree;e=_this$_tree.index;i=_this$_tree._parent;}for(;i;_i155=i,e=_i155.index,i=_i155._parent,_i155){var _i155;if(e>-1)for(var _s140=e+t,_r120=t<0?-1:i._tree.children.length;_s140!=_r120;_s140+=t){var _t208=i._tree.children[_s140];if(this.mode&el.IncludeAnonymous||_t208 instanceof rl||!_t208.type.isAnonymous||gl(_t208))return!1;}}return!0;}},{key:"move",value:function move(t,e){if(e&&this.enterChild(t,0,4))return!0;for(;;){if(this.sibling(t))return!0;if(this.atLastNode(t)||!this.parent())return!1;}}},{key:"next",value:function next(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:!0;return this.move(1,t);}},{key:"prev",value:function prev(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:!0;return this.move(-1,t);}},{key:"moveTo",value:function moveTo(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;for(;(this.from==this.to||(e<1?this.from>=t:this.from>t)||(e>-1?this.to<=t:this.to<t))&&this.parent(););for(;this.enterChild(1,t,e););return this;}},{key:"node",get:function get(){if(!this.buffer)return this._tree;var t=this.bufferNode,e=null,i=0;if(t&&t.context==this.buffer)t:for(var _s141=this.index,_r121=this.stack.length;_r121>=0;){for(var _n91=t;_n91;_n91=_n91._parent)if(_n91.index==_s141){if(_s141==this.index)return _n91;e=_n91,i=_r121+1;break t;}_s141=this.stack[--_r121];}for(var _t209=i;_t209<this.stack.length;_t209++)e=new cl(this.buffer,e,this.stack[_t209]);return this.bufferNode=new cl(this.buffer,e,this.index);}},{key:"tree",get:function get(){return this.buffer?null:this._tree._tree;}},{key:"iterate",value:function iterate(t,e){for(var _i156=0;;){var _s142=!1;if(this.type.isAnonymous||!1!==t(this)){if(this.firstChild()){_i156++;continue;}this.type.isAnonymous||(_s142=!0);}for(;;){if(_s142&&e&&e(this),_s142=this.type.isAnonymous,!_i156)return;if(this.nextSibling())break;this.parent(),_i156--,_s142=!0;}}}},{key:"matchContext",value:function matchContext(t){if(!this.buffer)return fl(this.node.parent,t);var e=this.buffer.buffer,i=e.set.types;for(var _s143=t.length-1,_r122=this.stack.length-1;_s143>=0;_r122--){if(_r122<0)return fl(this._tree,t,_s143);var _n92=i[e.buffer[this.stack[_r122]]];if(!_n92.isAnonymous){if(t[_s143]&&t[_s143]!=_n92.name)return!1;_s143--;}}return!0;}}]);}();wl=new WeakMap();_export("q",kl=/*#__PURE__*/function(){function kl(){_classCallCheck(this,kl);this.map=new WeakMap();}return _createClass(kl,[{key:"setBuffer",value:function setBuffer(t,e,i){var s=this.map.get(t);s||this.map.set(t,s=new Map()),s.set(e,i);}},{key:"getBuffer",value:function getBuffer(t,e){var i=this.map.get(t);return i&&i.get(e);}},{key:"set",value:function set(t,e){t instanceof cl?this.setBuffer(t.context.buffer,t.index,e):t instanceof ol&&this.map.set(t.tree,e);}},{key:"get",value:function get(t){return t instanceof cl?this.getBuffer(t.context.buffer,t.index):t instanceof ol?this.map.get(t.tree):void 0;}},{key:"cursorSet",value:function cursorSet(t,e){t.buffer?this.setBuffer(t.buffer.buffer,t.index,e):this.map.set(t.tree,e);}},{key:"cursorGet",value:function cursorGet(t){return t.buffer?this.getBuffer(t.buffer.buffer,t.index):this.map.get(t.tree);}}]);}());yl=/*#__PURE__*/function(){function yl(t,e,i,s){var r=arguments.length>4&&arguments[4]!==undefined?arguments[4]:!1;var n=arguments.length>5&&arguments[5]!==undefined?arguments[5]:!1;_classCallCheck(this,yl);this.from=t,this.to=e,this.tree=i,this.offset=s,this.open=(r?1:0)|(n?2:0);}return _createClass(yl,[{key:"openStart",get:function get(){return(1&this.open)>0;}},{key:"openEnd",get:function get(){return(2&this.open)>0;}}],[{key:"addTree",value:function addTree(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[];var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!1;var s=[new yl(0,t.length,t,0,!1,i)];var _iterator157=_createForOfIteratorHelper(e),_step157;try{for(_iterator157.s();!(_step157=_iterator157.n()).done;){var _i158=_step157.value;_i158.to>t.length&&s.push(_i158);}}catch(err){_iterator157.e(err);}finally{_iterator157.f();}return s;}},{key:"applyChanges",value:function applyChanges(t,e){var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:128;if(!e.length)return t;var s=[],r=1,n=t.length?t[0]:null;for(var _h63=0,_l56=0,_o37=0;;_h63++){var _u29=_h63<e.length?e[_h63]:null,_f22=_u29?_u29.fromA:1e9;if(_f22-_l56>=i)for(;n&&n.from<_f22;){var _e194=n;if(_l56>=_e194.from||_f22<=_e194.to||_o37){var _t211=Math.max(_e194.from,_l56)-_o37,_i159=Math.min(_e194.to,_f22)-_o37;_e194=_t211>=_i159?null:new yl(_t211,_i159,_e194.tree,_e194.offset+_o37,_h63>0,!!_u29);}if(_e194&&s.push(_e194),n.to>_f22)break;n=r<t.length?t[r++]:null;}if(!_u29)break;_l56=_u29.toA,_o37=_u29.toA-_u29.toB;}return s;}}]);}();_export("P",Ml=/*#__PURE__*/function(){function Ml(){_classCallCheck(this,Ml);}return _createClass(Ml,[{key:"startParse",value:function startParse(t,e,i){return"string"==typeof t&&(t=new xl(t)),i=i?i.length?i.map(function(t){return new Gh(t.from,t.to);}):[new Gh(0,0)]:[new Gh(0,t.length)],this.createParse(t,e||[],i);}},{key:"parse",value:function parse(t,e,i){var s=this.startParse(t,e,i);for(;;){var _t212=s.advance();if(_t212)return _t212;}}}]);}());xl=/*#__PURE__*/function(){function xl(t){_classCallCheck(this,xl);this.string=t;}return _createClass(xl,[{key:"length",get:function get(){return this.string.length;}},{key:"chunk",value:function chunk(t){return this.string.slice(t);}},{key:"lineChunks",get:function get(){return!1;}},{key:"read",value:function read(t,e){return this.string.slice(t,e);}}]);}();Al=/*#__PURE__*/_createClass(function Al(t,e,i,s,r){_classCallCheck(this,Al);this.parser=t,this.parse=e,this.overlay=i,this.target=s,this.from=r;});Ol=/*#__PURE__*/_createClass(function Ol(t,e,i,s,r,n,h){_classCallCheck(this,Ol);this.parser=t,this.predicate=e,this.mounts=i,this.index=s,this.start=r,this.target=n,this.prev=h,this.depth=0,this.ranges=[];});Dl=new Kh({perNode:!0});El=/*#__PURE__*/function(){function El(t,e,i,s,r){_classCallCheck(this,El);this.nest=e,this.input=i,this.fragments=s,this.ranges=r,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=t;}return _createClass(El,[{key:"advance",value:function advance(){if(this.baseParse){var _t213=this.baseParse.advance();if(!_t213)return null;if(this.baseParse=null,this.baseTree=_t213,this.startInner(),null!=this.stoppedAt){var _iterator158=_createForOfIteratorHelper(this.inner),_step158;try{for(_iterator158.s();!(_step158=_iterator158.n()).done;){var _t214=_step158.value;_t214.parse.stopAt(this.stoppedAt);}}catch(err){_iterator158.e(err);}finally{_iterator158.f();}}}if(this.innerDone==this.inner.length){var _t215=this.baseTree;return null!=this.stoppedAt&&(_t215=new il(_t215.type,_t215.children,_t215.positions,_t215.length,_t215.propValues.concat([[Dl,this.stoppedAt]]))),_t215;}var t=this.inner[this.innerDone],e=t.parse.advance();if(e){this.innerDone++;var _i160=Object.assign(Object.create(null),t.target.props);_i160[Kh.mounted.id]=new _h(e,t.overlay,t.parser),t.target.props=_i160;}return null;}},{key:"parsedPos",get:function get(){if(this.baseParse)return 0;var t=this.input.length;for(var _e195=this.innerDone;_e195<this.inner.length;_e195++)this.inner[_e195].from<t&&(t=Math.min(t,this.inner[_e195].parse.parsedPos));return t;}},{key:"stopAt",value:function stopAt(t){if(this.stoppedAt=t,this.baseParse)this.baseParse.stopAt(t);else for(var _e196=this.innerDone;_e196<this.inner.length;_e196++)this.inner[_e196].parse.stopAt(t);}},{key:"startInner",value:function startInner(){var t=new Ll(this.fragments),e=null,i=null,s=new ml(new ol(this.baseTree,this.ranges[0].from,0,null),el.IncludeAnonymous|el.IgnoreMounts);t:for(var _r124,_n93;;){var _h64=void 0,_l57=!0;if(null!=this.stoppedAt&&s.from>=this.stoppedAt)_l57=!1;else if(t.hasNode(s)){if(e){var _t216=e.mounts.find(function(t){return t.frag.from<=s.from&&t.frag.to>=s.to&&t.mount.overlay;});if(_t216){var _iterator159=_createForOfIteratorHelper(_t216.mount.overlay),_step159;try{var _loop13=function _loop13(){var i=_step159.value;var r=i.from+_t216.pos,n=i.to+_t216.pos;r>=s.from&&n<=s.to&&!e.ranges.some(function(t){return t.from<n&&t.to>r;})&&e.ranges.push({from:r,to:n});};for(_iterator159.s();!(_step159=_iterator159.n()).done;){_loop13();}}catch(err){_iterator159.e(err);}finally{_iterator159.f();}}}_l57=!1;}else if(i&&(_n93=Il(i.ranges,s.from,s.to)))_l57=2!=_n93;else if(!s.type.isAnonymous&&(_r124=this.nest(s,this.input))&&(s.from<s.to||!_r124.overlay)){s.tree||Tl(s);var _n94=t.findMounts(s.from,_r124.parser);if("function"==typeof _r124.overlay)e=new Ol(_r124.parser,_r124.overlay,_n94,this.inner.length,s.from,s.tree,e);else{var _t217=Nl(this.ranges,_r124.overlay||(s.from<s.to?[new Gh(s.from,s.to)]:[]));_t217.length&&Cl(_t217),!_t217.length&&_r124.overlay||this.inner.push(new Al(_r124.parser,_t217.length?_r124.parser.startParse(this.input,jl(_n94,_t217),_t217):_r124.parser.startParse(""),_r124.overlay?_r124.overlay.map(function(t){return new Gh(t.from-s.from,t.to-s.from);}):null,s.tree,_t217.length?_t217[0].from:s.from)),_r124.overlay?_t217.length&&(i={ranges:_t217,depth:0,prev:i}):_l57=!1;}}else if(e&&(_h64=e.predicate(s))&&(!0===_h64&&(_h64=new Gh(s.from,s.to)),_h64.from<_h64.to)){var _t218=e.ranges.length-1;_t218>=0&&e.ranges[_t218].to==_h64.from?e.ranges[_t218]={from:e.ranges[_t218].from,to:_h64.to}:e.ranges.push(_h64);}if(_l57&&s.firstChild())e&&e.depth++,i&&i.depth++;else for(;!s.nextSibling();){if(!s.parent())break t;if(e&&! --e.depth){var _t219=Nl(this.ranges,e.ranges);_t219.length&&(Cl(_t219),this.inner.splice(e.index,0,new Al(e.parser,e.parser.startParse(this.input,jl(e.mounts,_t219),_t219),e.ranges.map(function(t){return new Gh(t.from-e.start,t.to-e.start);}),e.target,_t219[0].from))),e=e.prev;}i&&! --i.depth&&(i=i.prev);}}}}]);}();Bl=/*#__PURE__*/function(){function Bl(t,e){_classCallCheck(this,Bl);this.offset=e,this.done=!1,this.cursor=t.cursor(el.IncludeAnonymous|el.IgnoreMounts);}return _createClass(Bl,[{key:"moveTo",value:function moveTo(t){var e=this.cursor,i=t-this.offset;for(;!this.done&&e.from<i;)e.to>=t&&e.enter(i,1,el.IgnoreOverlays|el.ExcludeBuffers)||e.next(!1)||(this.done=!0);}},{key:"hasNode",value:function hasNode(t){if(this.moveTo(t.from),!this.done&&this.cursor.from+this.offset==t.from&&this.cursor.tree)for(var _e198=this.cursor.tree;;){if(_e198==t.tree)return!0;if(!(_e198.children.length&&0==_e198.positions[0]&&_e198.children[0]instanceof il))break;_e198=_e198.children[0];}return!1;}}]);}();Ll=/*#__PURE__*/function(){function Ll(t){_classCallCheck(this,Ll);var e;if(this.fragments=t,this.curTo=0,this.fragI=0,t.length){var _i163=this.curFrag=t[0];this.curTo=null!==(e=_i163.tree.prop(Dl))&&void 0!==e?e:_i163.to,this.inner=new Bl(_i163.tree,-_i163.offset);}else this.curFrag=this.inner=null;}return _createClass(Ll,[{key:"hasNode",value:function hasNode(t){for(;this.curFrag&&t.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=t.from&&this.curTo>=t.to&&this.inner.hasNode(t);}},{key:"nextFrag",value:function nextFrag(){var t;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{var _e199=this.curFrag=this.fragments[this.fragI];this.curTo=null!==(t=_e199.tree.prop(Dl))&&void 0!==t?t:_e199.to,this.inner=new Bl(_e199.tree,-_e199.offset);}}},{key:"findMounts",value:function findMounts(t,e){var i;var s=[];if(this.inner){this.inner.cursor.moveTo(t,1);for(var _t220=this.inner.cursor.node;_t220;_t220=_t220.parent){var _r125=null===(i=_t220.tree)||void 0===i?void 0:i.prop(Kh.mounted);if(_r125&&_r125.parser==e)for(var _e200=this.fragI;_e200<this.fragments.length;_e200++){var _i164=this.fragments[_e200];if(_i164.from>=_t220.to)break;_i164.tree==this.curFrag.tree&&s.push({frag:_i164,pos:_t220.from-_i164.offset,mount:_r125});}}}return s;}}]);}();zl=0;Pl=/*#__PURE__*/function(){function Pl(t,e,i,s){_classCallCheck(this,Pl);this.name=t,this.set=e,this.base=i,this.modified=s,this.id=zl++;}return _createClass(Pl,[{key:"toString",value:function toString(){var t=this.name;var _iterator162=_createForOfIteratorHelper(this.modified),_step162;try{for(_iterator162.s();!(_step162=_iterator162.n()).done;){var _e203=_step162.value;_e203.name&&(t="".concat(_e203.name,"(").concat(t,")"));}}catch(err){_iterator162.e(err);}finally{_iterator162.f();}return t;}}],[{key:"define",value:function define(t,e){var i="string"==typeof t?t:"?";if(t instanceof Pl&&(e=t),null==e?void 0:e.base)throw new Error("Can not derive from a modified tag");var s=new Pl(i,[],null,[]);if(s.set.push(s),e){var _iterator163=_createForOfIteratorHelper(e.set),_step163;try{for(_iterator163.s();!(_step163=_iterator163.n()).done;){var _t223=_step163.value;s.set.push(_t223);}}catch(err){_iterator163.e(err);}finally{_iterator163.f();}}return s;}},{key:"defineModifier",value:function defineModifier(t){var e=new Wl(t);return function(t){return t.modified.indexOf(e)>-1?t:Wl.get(t.base||t,t.modified.concat(e).sort(function(t,e){return t.id-e.id;}));};}}]);}();Hl=0;Wl=/*#__PURE__*/function(){function Wl(t){_classCallCheck(this,Wl);this.name=t,this.instances=[],this.id=Hl++;}return _createClass(Wl,null,[{key:"get",value:function get(t,e){if(!e.length)return t;var i=e[0].instances.find(function(i){return i.base==t&&(s=e,r=i.modified,s.length==r.length&&s.every(function(t,e){return t==r[e];}));var s,r;});if(i)return i;var s=[],r=new Pl(t.name,s,t,e);var _iterator164=_createForOfIteratorHelper(e),_step164;try{for(_iterator164.s();!(_step164=_iterator164.n()).done;){var _t224=_step164.value;_t224.instances.push(r);}}catch(err){_iterator164.e(err);}finally{_iterator164.f();}var n=function(t){var e=[[]];for(var _i165=0;_i165<t.length;_i165++)for(var _s148=0,_r127=e.length;_s148<_r127;_s148++)e.push(e[_s148].concat(t[_i165]));return e.sort(function(t,e){return e.length-t.length;});}(e);var _iterator165=_createForOfIteratorHelper(t.set),_step165;try{for(_iterator165.s();!(_step165=_iterator165.n()).done;){var _e204=_step165.value;if(!_e204.modified.length){var _iterator166=_createForOfIteratorHelper(n),_step166;try{for(_iterator166.s();!(_step166=_iterator166.n()).done;){var _t225=_step166.value;s.push(Wl.get(_e204,_t225));}}catch(err){_iterator166.e(err);}finally{_iterator166.f();}}}}catch(err){_iterator165.e(err);}finally{_iterator165.f();}return r;}}]);}();Vl=new Kh();ql=/*#__PURE__*/function(){function ql(t,e,i,s){_classCallCheck(this,ql);this.tags=t,this.mode=e,this.context=i,this.next=s;}return _createClass(ql,[{key:"opaque",get:function get(){return 0==this.mode;}},{key:"inherit",get:function get(){return 1==this.mode;}},{key:"sort",value:function sort(t){return!t||t.depth<this.depth?(this.next=t,this):(t.next=this.sort(t.next),t);}},{key:"depth",get:function get(){return this.context?this.context.length:0;}}]);}();ql.empty=new ql([],2,null);Gl=/*#__PURE__*/function(){function Gl(t,e,i){_classCallCheck(this,Gl);this.at=t,this.highlighters=e,this.span=i,this["class"]="";}return _createClass(Gl,[{key:"startSpan",value:function startSpan(t,e){e!=this["class"]&&(this.flush(t),t>this.at&&(this.at=t),this["class"]=e);}},{key:"flush",value:function flush(t){t>this.at&&this["class"]&&this.span(this.at,t,this["class"]);}},{key:"highlightRange",value:function highlightRange(t,e,i,s,r){var n=t.type,h=t.from,l=t.to;if(h>=i||l<=e)return;n.isTop&&(r=this.highlighters.filter(function(t){return!t.scope||t.scope(n);}));var o=s,u=function(t){var e=t.type.prop(Vl);for(;e&&e.context&&!t.matchContext(e.context);)e=e.next;return e||null;}(t)||ql.empty,f=function(t,e){var i=null;var _iterator172=_createForOfIteratorHelper(t),_step172;try{for(_iterator172.s();!(_step172=_iterator172.n()).done;){var _s153=_step172.value;var _t229=_s153.style(e);_t229&&(i=i?i+" "+_t229:_t229);}}catch(err){_iterator172.e(err);}finally{_iterator172.f();}return i;}(r,u.tags);if(f&&(o&&(o+=" "),o+=f,1==u.mode&&(s+=(s?" ":"")+f)),this.startSpan(Math.max(e,h),o),u.opaque)return;var a=t.tree&&t.tree.prop(Kh.mounted);if(a&&a.overlay){var _n97=t.node.enter(a.overlay[0].from+h,1),_u31=this.highlighters.filter(function(t){return!t.scope||t.scope(a.tree.type);}),_f24=t.firstChild();for(var _c13=0,_d11=h;;_c13++){var _p10=_c13<a.overlay.length?a.overlay[_c13]:null,_m5=_p10?_p10.from+h:l,_g5=Math.max(e,_d11),_w2=Math.min(i,_m5);if(_g5<_w2&&_f24)for(;t.from<_w2&&(this.highlightRange(t,_g5,_w2,s,r),this.startSpan(Math.min(_w2,t.to),o),!(t.to>=_m5)&&t.nextSibling()););if(!_p10||_m5>i)break;_d11=_p10.to+h,_d11>e&&(this.highlightRange(_n97.cursor(),Math.max(e,_p10.from+h),Math.min(i,_d11),"",_u31),this.startSpan(Math.min(i,_d11),o));}_f24&&t.parent();}else if(t.firstChild()){a&&(s="");do{if(!(t.to<=e)){if(t.from>=i)break;this.highlightRange(t,e,i,s,r),this.startSpan(Math.min(i,t.to),o);}}while(t.nextSibling());t.parent();}}}]);}();Kl=Pl.define,_l=Kl(),Xl=Kl(),Yl=Kl(Xl),Ql=Kl(Xl),Zl=Kl(),to=Kl(Zl),eo=Kl(Zl),io=Kl(),so=Kl(io),ro=Kl(),no=Kl(),ho=Kl(),lo=Kl(ho),oo=Kl(),_export("t",uo={comment:_l,lineComment:Kl(_l),blockComment:Kl(_l),docComment:Kl(_l),name:Xl,variableName:Kl(Xl),typeName:Yl,tagName:Kl(Yl),propertyName:Ql,attributeName:Kl(Ql),className:Kl(Xl),labelName:Kl(Xl),namespace:Kl(Xl),macroName:Kl(Xl),literal:Zl,string:to,docString:Kl(to),character:Kl(to),attributeValue:Kl(to),number:eo,integer:Kl(eo),"float":Kl(eo),bool:Kl(Zl),regexp:Kl(Zl),escape:Kl(Zl),color:Kl(Zl),url:Kl(Zl),keyword:ro,self:Kl(ro),"null":Kl(ro),atom:Kl(ro),unit:Kl(ro),modifier:Kl(ro),operatorKeyword:Kl(ro),controlKeyword:Kl(ro),definitionKeyword:Kl(ro),moduleKeyword:Kl(ro),operator:no,derefOperator:Kl(no),arithmeticOperator:Kl(no),logicOperator:Kl(no),bitwiseOperator:Kl(no),compareOperator:Kl(no),updateOperator:Kl(no),definitionOperator:Kl(no),typeOperator:Kl(no),controlOperator:Kl(no),punctuation:ho,separator:Kl(ho),bracket:lo,angleBracket:Kl(lo),squareBracket:Kl(lo),paren:Kl(lo),brace:Kl(lo),content:io,heading:so,heading1:Kl(so),heading2:Kl(so),heading3:Kl(so),heading4:Kl(so),heading5:Kl(so),heading6:Kl(so),contentSeparator:Kl(io),list:Kl(io),quote:Kl(io),emphasis:Kl(io),strong:Kl(io),link:Kl(io),monospace:Kl(io),strikethrough:Kl(io),inserted:Kl(),deleted:Kl(),changed:Kl(),invalid:Kl(),meta:oo,documentMeta:Kl(oo),annotation:Kl(oo),processingInstruction:Kl(oo),definition:Pl.defineModifier("definition"),constant:Pl.defineModifier("constant"),"function":Pl.defineModifier("function"),standard:Pl.defineModifier("standard"),local:Pl.defineModifier("local"),special:Pl.defineModifier("special")});for(_t230 in uo){_e207=uo[_t230];_e207 instanceof Pl&&(_e207.name=_t230);}Jl([{tag:uo.link,"class":"tok-link"},{tag:uo.heading,"class":"tok-heading"},{tag:uo.emphasis,"class":"tok-emphasis"},{tag:uo.strong,"class":"tok-strong"},{tag:uo.keyword,"class":"tok-keyword"},{tag:uo.atom,"class":"tok-atom"},{tag:uo.bool,"class":"tok-bool"},{tag:uo.url,"class":"tok-url"},{tag:uo.labelName,"class":"tok-labelName"},{tag:uo.inserted,"class":"tok-inserted"},{tag:uo.deleted,"class":"tok-deleted"},{tag:uo.literal,"class":"tok-literal"},{tag:uo.string,"class":"tok-string"},{tag:uo.number,"class":"tok-number"},{tag:[uo.regexp,uo.escape,uo.special(uo.string)],"class":"tok-string2"},{tag:uo.variableName,"class":"tok-variableName"},{tag:uo.local(uo.variableName),"class":"tok-variableName tok-local"},{tag:uo.definition(uo.variableName),"class":"tok-variableName tok-definition"},{tag:uo.special(uo.variableName),"class":"tok-variableName2"},{tag:uo.definition(uo.propertyName),"class":"tok-propertyName tok-definition"},{tag:uo.typeName,"class":"tok-typeName"},{tag:uo.namespace,"class":"tok-namespace"},{tag:uo.className,"class":"tok-className"},{tag:uo.macroName,"class":"tok-macroName"},{tag:uo.propertyName,"class":"tok-propertyName"},{tag:uo.operator,"class":"tok-operator"},{tag:uo.comment,"class":"tok-comment"},{tag:uo.meta,"class":"tok-meta"},{tag:uo.invalid,"class":"tok-invalid"},{tag:uo.punctuation,"class":"tok-punctuation"}]);ao=new Kh();_export("o",po=new Kh());mo=/*#__PURE__*/function(){function mo(t,e){var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[];var s=arguments.length>3&&arguments[3]!==undefined?arguments[3]:"";_classCallCheck(this,mo);this.data=t,this.name=s,It.prototype.hasOwnProperty("tree")||Object.defineProperty(It.prototype,"tree",{get:function get(){return bo(this);}}),this.parser=e,this.extension=[Oo.of(this),It.languageData.of(function(t,e,i){var s=go(t,e,i),r=s.type.prop(ao);if(!r)return[];var n=t.facet(r),h=s.type.prop(po);if(h){var _r129=s.resolve(e-s.from,i);var _iterator173=_createForOfIteratorHelper(h),_step173;try{for(_iterator173.s();!(_step173=_iterator173.n()).done;){var _e208=_step173.value;if(_e208.test(_r129,t)){var _i168=t.facet(_e208.facet);return"replace"==_e208.type?_i168:_i168.concat(n);}}}catch(err){_iterator173.e(err);}finally{_iterator173.f();}}return n;})].concat(i);}return _createClass(mo,[{key:"isActiveAt",value:function isActiveAt(t,e){var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:-1;return go(t,e,i).type.prop(ao)==this.data;}},{key:"findRegions",value:function findRegions(t){var _this74=this;var e=t.facet(Oo);if((null==e?void 0:e.data)==this.data)return[{from:0,to:t.doc.length}];if(!e||!e.allowsNesting)return[];var i=[],_s154=function s(t,e){if(t.prop(ao)==_this74.data)return void i.push({from:e,to:e+t.length});var r=t.prop(Kh.mounted);if(r){if(r.tree.prop(ao)==_this74.data){if(r.overlay){var _iterator174=_createForOfIteratorHelper(r.overlay),_step174;try{for(_iterator174.s();!(_step174=_iterator174.n()).done;){var _t231=_step174.value;i.push({from:_t231.from+e,to:_t231.to+e});}}catch(err){_iterator174.e(err);}finally{_iterator174.f();}}else i.push({from:e,to:e+t.length});return;}if(r.overlay){var _t232=i.length;if(_s154(r.tree,r.overlay[0].from+e),i.length>_t232)return;}}for(var _i169=0;_i169<t.children.length;_i169++){var _r130=t.children[_i169];_r130 instanceof il&&_s154(_r130,t.positions[_i169]+e);}};return _s154(bo(t),0),i;}},{key:"allowsNesting",get:function get(){return!0;}}]);}();mo.setState=bt.define();_export("L",wo=/*#__PURE__*/function(_mo){function wo(t,e,i){var _this75;_classCallCheck(this,wo);_this75=_callSuper(this,wo,[t,e,[],i]),_this75.parser=e;return _this75;}_inherits(wo,_mo);return _createClass(wo,[{key:"configure",value:function configure(t,e){return new wo(this.data,this.parser.configure(t),e||this.name);}},{key:"allowsNesting",get:function get(){return this.parser.hasWrappers();}}],[{key:"define",value:function define(t){var e=co(t.languageData);return new wo(e,t.parser.configure({props:[ao.add(function(t){return t.isTop?e:void 0;})]}),t.name);}}]);}(mo));vo=/*#__PURE__*/function(){function vo(t){_classCallCheck(this,vo);this.doc=t,this.cursorPos=0,this.string="",this.cursor=t.iter();}return _createClass(vo,[{key:"length",get:function get(){return this.doc.length;}},{key:"syncTo",value:function syncTo(t){return this.string=this.cursor.next(t-this.cursorPos).value,this.cursorPos=t+this.string.length,this.cursorPos-this.string.length;}},{key:"chunk",value:function chunk(t){return this.syncTo(t),this.string;}},{key:"lineChunks",get:function get(){return!0;}},{key:"read",value:function read(t,e){var i=this.cursorPos-this.string.length;return t<i||e>=this.cursorPos?this.doc.sliceString(t,e):this.string.slice(t-i,e-i);}}]);}();ko=null;yo=/*#__PURE__*/function(){function yo(t,e){var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[];var s=arguments.length>3?arguments[3]:undefined;var r=arguments.length>4?arguments[4]:undefined;var n=arguments.length>5?arguments[5]:undefined;var h=arguments.length>6?arguments[6]:undefined;var l=arguments.length>7?arguments[7]:undefined;_classCallCheck(this,yo);this.parser=t,this.state=e,this.fragments=i,this.tree=s,this.treeLen=r,this.viewport=n,this.skipped=h,this.scheduleOn=l,this.parse=null,this.tempSkipped=[];}return _createClass(yo,[{key:"startParse",value:function startParse(){return this.parser.startParse(new vo(this.state.doc),this.fragments);}},{key:"work",value:function work(t,e){var _this76=this;return null!=e&&e>=this.state.doc.length&&(e=void 0),this.tree!=il.empty&&this.isDone(null!=e?e:this.state.doc.length)?(this.takeTree(),!0):this.withContext(function(){var i;if("number"==typeof t){var _e209=Date.now()+t;t=function t(){return Date.now()>_e209;};}for(_this76.parse||(_this76.parse=_this76.startParse()),null!=e&&(null==_this76.parse.stoppedAt||_this76.parse.stoppedAt>e)&&e<_this76.state.doc.length&&_this76.parse.stopAt(e);;){var _s155=_this76.parse.advance();if(_s155){if(_this76.fragments=_this76.withoutTempSkipped(yl.addTree(_s155,_this76.fragments,null!=_this76.parse.stoppedAt)),_this76.treeLen=null!==(i=_this76.parse.stoppedAt)&&void 0!==i?i:_this76.state.doc.length,_this76.tree=_s155,_this76.parse=null,!(_this76.treeLen<(null!=e?e:_this76.state.doc.length)))return!0;_this76.parse=_this76.startParse();}if(t())return!1;}});}},{key:"takeTree",value:function takeTree(){var _this77=this;var t,e;this.parse&&(t=this.parse.parsedPos)>=this.treeLen&&((null==this.parse.stoppedAt||this.parse.stoppedAt>t)&&this.parse.stopAt(t),this.withContext(function(){for(;!(e=_this77.parse.advance()););}),this.treeLen=t,this.tree=e,this.fragments=this.withoutTempSkipped(yl.addTree(this.tree,this.fragments,!0)),this.parse=null);}},{key:"withContext",value:function withContext(t){var e=ko;ko=this;try{return t();}finally{ko=e;}}},{key:"withoutTempSkipped",value:function withoutTempSkipped(t){for(var _e210;_e210=this.tempSkipped.pop();)t=Mo(t,_e210.from,_e210.to);return t;}},{key:"changes",value:function changes(t,e){var i=this.fragments,s=this.tree,r=this.treeLen,n=this.viewport,h=this.skipped;if(this.takeTree(),!t.empty){var _e211=[];if(t.iterChangedRanges(function(t,i,s,r){return _e211.push({fromA:t,toA:i,fromB:s,toB:r});}),i=yl.applyChanges(i,_e211),s=il.empty,r=0,n={from:t.mapPos(n.from,-1),to:t.mapPos(n.to,1)},this.skipped.length){h=[];var _iterator175=_createForOfIteratorHelper(this.skipped),_step175;try{for(_iterator175.s();!(_step175=_iterator175.n()).done;){var _e212=_step175.value;var _i170=t.mapPos(_e212.from,1),_s156=t.mapPos(_e212.to,-1);_i170<_s156&&h.push({from:_i170,to:_s156});}}catch(err){_iterator175.e(err);}finally{_iterator175.f();}}}return new yo(this.parser,e,i,s,r,n,h,this.scheduleOn);}},{key:"updateViewport",value:function updateViewport(t){if(this.viewport.from==t.from&&this.viewport.to==t.to)return!1;this.viewport=t;var e=this.skipped.length;for(var _e213=0;_e213<this.skipped.length;_e213++){var _this$skipped$_e=this.skipped[_e213],_i171=_this$skipped$_e.from,_s157=_this$skipped$_e.to;_i171<t.to&&_s157>t.from&&(this.fragments=Mo(this.fragments,_i171,_s157),this.skipped.splice(_e213--,1));}return!(this.skipped.length>=e)&&(this.reset(),!0);}},{key:"reset",value:function reset(){this.parse&&(this.takeTree(),this.parse=null);}},{key:"skipUntilInView",value:function skipUntilInView(t,e){this.skipped.push({from:t,to:e});}},{key:"isDone",value:function isDone(t){t=Math.min(t,this.state.doc.length);var e=this.fragments;return this.treeLen>=t&&e.length&&0==e[0].from&&e[0].to>=t;}}],[{key:"create",value:function create(t,e,i){return new yo(t,e,[],il.empty,0,i,[],null);}},{key:"getSkippingParser",value:function getSkippingParser(t){return new(/*#__PURE__*/function(_Ml){function _class8(){_classCallCheck(this,_class8);return _callSuper(this,_class8,arguments);}_inherits(_class8,_Ml);return _createClass(_class8,[{key:"createParse",value:function createParse(e,i,s){var r=s[0].from,n=s[s.length-1].to;return{parsedPos:r,advance:function advance(){var e=ko;if(e){var _iterator176=_createForOfIteratorHelper(s),_step176;try{for(_iterator176.s();!(_step176=_iterator176.n()).done;){var _t234=_step176.value;e.tempSkipped.push(_t234);}}catch(err){_iterator176.e(err);}finally{_iterator176.f();}t&&(e.scheduleOn=e.scheduleOn?Promise.all([e.scheduleOn,t]):t);}return this.parsedPos=n,new il(Yh.none,[],[],n-r);},stoppedAt:null,stopAt:function stopAt(){}};}}]);}(Ml))();}},{key:"get",value:function get(){return ko;}}]);}();xo=/*#__PURE__*/function(){function xo(t){_classCallCheck(this,xo);this.context=t,this.tree=t.tree;}return _createClass(xo,[{key:"apply",value:function apply(t){if(!t.docChanged&&this.tree==this.context.tree)return this;var e=this.context.changes(t.changes,t.state),i=this.context.treeLen==t.startState.doc.length?void 0:Math.max(t.changes.mapPos(this.context.treeLen),e.viewport.to);return e.work(20,i)||e.takeTree(),new xo(e);}}],[{key:"init",value:function init(t){var e=Math.min(3e3,t.doc.length),i=yo.create(t.facet(Oo).parser,t,{from:0,to:e});return i.work(20,e)||i.takeTree(),new xo(i);}}]);}();mo.state=_.define({create:xo.init,update:function update(t,e){var _iterator177=_createForOfIteratorHelper(e.effects),_step177;try{for(_iterator177.s();!(_step177=_iterator177.n()).done;){var _t235=_step177.value;if(_t235.is(mo.setState))return _t235.value;}}catch(err){_iterator177.e(err);}finally{_iterator177.f();}return e.startState.facet(Oo)!=e.state.facet(Oo)?xo.init(e.state):t.apply(e);}});So=function So(t){var e=setTimeout(function(){return t();},500);return function(){return clearTimeout(e);};};"undefined"!=typeof requestIdleCallback&&(So=function So(t){var e=-1,i=setTimeout(function(){e=requestIdleCallback(t,{timeout:400});},100);return function(){return e<0?clearTimeout(i):cancelIdleCallback(e);};});Ao="undefined"!=typeof navigator&&(null===(fo=navigator.scheduling)||void 0===fo?void 0:fo.isInputPending)?function(){return navigator.scheduling.isInputPending();}:null,Co=Zi.fromClass(/*#__PURE__*/function(){function _class9(t){_classCallCheck(this,_class9);this.view=t,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork();}return _createClass(_class9,[{key:"update",value:function update(t){var e=this.view.state.field(mo.state).context;(e.updateViewport(t.view.viewport)||this.view.viewport.to>e.treeLen)&&this.scheduleWork(),(t.docChanged||t.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(e);}},{key:"scheduleWork",value:function scheduleWork(){if(this.working)return;var t=this.view.state,e=t.field(mo.state);e.tree==e.context.tree&&e.context.isDone(t.doc.length)||(this.working=So(this.work));}},{key:"work",value:function work(t){this.working=null;var e=Date.now();if(this.chunkEnd<e&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=e+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;var _this$view3=this.view,i=_this$view3.state,s=_this$view3.viewport.to,r=i.field(mo.state);if(r.tree==r.context.tree&&r.context.isDone(s+1e5))return;var n=Date.now()+Math.min(this.chunkBudget,100,t&&!Ao?Math.max(25,t.timeRemaining()-5):1e9),h=r.context.treeLen<s&&i.doc.length>s+1e3,l=r.context.work(function(){return Ao&&Ao()||Date.now()>n;},s+(h?0:1e5));this.chunkBudget-=Date.now()-e,(l||this.chunkBudget<=0)&&(r.context.takeTree(),this.view.dispatch({effects:mo.setState.of(new xo(r.context))})),this.chunkBudget>0&&(!l||h)&&this.scheduleWork(),this.checkAsyncSchedule(r.context);}},{key:"checkAsyncSchedule",value:function checkAsyncSchedule(t){var _this78=this;t.scheduleOn&&(this.workScheduled++,t.scheduleOn.then(function(){return _this78.scheduleWork();})["catch"](function(t){return _i(_this78.view.state,t);}).then(function(){return _this78.workScheduled--;}),t.scheduleOn=null);}},{key:"destroy",value:function destroy(){this.working&&this.working();}},{key:"isWorking",value:function isWorking(){return!!(this.working||this.workScheduled>0);}}]);}(),{eventHandlers:{focus:function focus(){this.scheduleWork();}}}),Oo=F.define({combine:function combine(t){return t.length?t[0]:null;},enables:function enables(t){return[mo.state,Co,Qr.contentAttributes.compute([t],function(e){var i=e.facet(t);return i&&i.name?{"data-language":i.name}:{};})];}});_export("h",Do=/*#__PURE__*/_createClass(function Do(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[];_classCallCheck(this,Do);this.language=t,this.support=e,this.extension=[t,e];}));Eo=F.define(),Io=F.define({combine:function combine(t){if(!t.length)return" ";var e=t[0];if(!e||/\S/.test(e)||Array.from(e).some(function(t){return t!=e[0];}))throw new Error("Invalid indent unit: "+JSON.stringify(t[0]));return e;}});Lo=/*#__PURE__*/function(){function Lo(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,Lo);this.state=t,this.options=e,this.unit=Ro(t);}return _createClass(Lo,[{key:"lineAt",value:function lineAt(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;var i=this.state.doc.lineAt(t),_this$options=this.options,s=_this$options.simulateBreak,r=_this$options.simulateDoubleBreak;return null!=s&&s>=i.from&&s<=i.to?r&&s==t?{text:"",from:t}:(e<0?s<t:s<=t)?{text:i.text.slice(s-i.from),from:s}:{text:i.text.slice(0,s-i.from),from:i.from}:i;}},{key:"textAfterPos",value:function textAfterPos(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;if(this.options.simulateDoubleBreak&&t==this.options.simulateBreak)return"";var _this$lineAt=this.lineAt(t,e),i=_this$lineAt.text,s=_this$lineAt.from;return i.slice(t-s,Math.min(i.length,t+100-s));}},{key:"column",value:function column(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;var _this$lineAt2=this.lineAt(t,e),i=_this$lineAt2.text,s=_this$lineAt2.from,r=this.countColumn(i,t-s),n=this.options.overrideIndentation?this.options.overrideIndentation(s):-1;return n>-1&&(r+=n-this.countColumn(i,i.search(/\S|$/))),r;}},{key:"countColumn",value:function countColumn(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:t.length;return Kt(t,this.state.tabSize,e);}},{key:"lineIndent",value:function lineIndent(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;var _this$lineAt3=this.lineAt(t,e),i=_this$lineAt3.text,s=_this$lineAt3.from,r=this.options.overrideIndentation;if(r){var _t238=r(s);if(_t238>-1)return _t238;}return this.countColumn(i,i.search(/\S|$/));}},{key:"simulatedBreak",get:function get(){return this.options.simulateBreak||null;}}]);}();_export("i",No=new Kh());Po=/*#__PURE__*/function(_Lo){function Po(t,e,i){var _this79;_classCallCheck(this,Po);_this79=_callSuper(this,Po,[t.state,t.options]),_this79.base=t,_this79.pos=e,_this79.context=i;return _this79;}_inherits(Po,_Lo);return _createClass(Po,[{key:"node",get:function get(){return this.context.node;}},{key:"textAfter",get:function get(){return this.textAfterPos(this.pos);}},{key:"baseIndent",get:function get(){return this.baseIndentFor(this.node);}},{key:"baseIndentFor",value:function baseIndentFor(t){var e=this.state.doc.lineAt(t.from);for(;;){var _i173=t.resolve(e.from);for(;_i173.parent&&_i173.parent.from==_i173.from;)_i173=_i173.parent;if(Ho(_i173,t))break;e=this.state.doc.lineAt(_i173.from);}return this.lineIndent(e.from);}},{key:"continue",value:function _continue(){return $o(this.context.next,this.base,this.pos);}}],[{key:"create",value:function create(t,e,i){return new Po(t,e,i);}}]);}(Lo);_export("f",Vo=function Vo(t){return t.baseIndent;});Jo=F.define(),_export("e",Uo=new Kh());Yo=bt.define({map:Xo}),Qo=bt.define({map:Xo});tu=_.define({create:function create(){return si.none;},update:function update(t,e){t=t.map(e.changes);var _iterator181=_createForOfIteratorHelper(e.effects),_step181;try{var _loop16=function _loop16(){var i=_step181.value;if(i.is(Yo)&&!iu(t,i.value.from,i.value.to)){var _e$state$facet=e.state.facet(lu),_s164=_e$state$facet.preparePlaceholder,_r133=_s164?si.replace({widget:new au(_s164(e.state,i.value))}):fu;t=t.update({add:[_r133.range(i.value.from,i.value.to)]});}else i.is(Qo)&&(t=t.update({filter:function filter(t,e){return i.value.from!=t||i.value.to!=e;},filterFrom:i.value.from,filterTo:i.value.to}));};for(_iterator181.s();!(_step181=_iterator181.n()).done;){_loop16();}}catch(err){_iterator181.e(err);}finally{_iterator181.f();}if(e.selection){var _i175=!1,_s163=e.selection.main.head;t.between(_s163,_s163,function(t,e){t<_s163&&e>_s163&&(_i175=!0);}),_i175&&(t=t.update({filterFrom:_s163,filterTo:_s163,filter:function filter(t,e){return e<=_s163||t>=_s163;}}));}return t;},provide:function provide(t){return Qr.decorations.from(t);},toJSON:function toJSON(t,e){var i=[];return t.between(0,e.doc.length,function(t,e){i.push(t,e);}),i;},fromJSON:function fromJSON(t){if(!Array.isArray(t)||t.length%2)throw new RangeError("Invalid JSON for fold state");var e=[];for(var _i176=0;_i176<t.length;){var _s165=t[_i176++],_r134=t[_i176++];if("number"!=typeof _s165||"number"!=typeof _r134)throw new RangeError("Invalid JSON for fold state");e.push(fu.range(_s165,_r134));}return si.set(e,!0);}});nu=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:function run(t){var _iterator182=_createForOfIteratorHelper(Zo(t)),_step182;try{for(_iterator182.s();!(_step182=_iterator182.n()).done;){var _e217=_step182.value;var _i177=_o(t.state,_e217.from,_e217.to);if(_i177)return t.dispatch({effects:su(t.state,[Yo.of(_i177),ru(t,_i177)])}),!0;}}catch(err){_iterator182.e(err);}finally{_iterator182.f();}return!1;}},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:function run(t){if(!t.state.field(tu,!1))return!1;var e=[];var _iterator183=_createForOfIteratorHelper(Zo(t)),_step183;try{for(_iterator183.s();!(_step183=_iterator183.n()).done;){var _i178=_step183.value;var _s166=eu(t.state,_i178.from,_i178.to);_s166&&e.push(Qo.of(_s166),ru(t,_s166,!1));}}catch(err){_iterator183.e(err);}finally{_iterator183.f();}return e.length&&t.dispatch({effects:e}),e.length>0;}},{key:"Ctrl-Alt-[",run:function run(t){var e=t.state,i=[];for(var _s167=0;_s167<e.doc.length;){var _r135=t.lineBlockAt(_s167),_n99=_o(e,_r135.from,_r135.to);_n99&&i.push(Yo.of(_n99)),_s167=(_n99?t.lineBlockAt(_n99.to):_r135).to+1;}return i.length&&t.dispatch({effects:su(t.state,i)}),!!i.length;}},{key:"Ctrl-Alt-]",run:function run(t){var e=t.state.field(tu,!1);if(!e||!e.size)return!1;var i=[];return e.between(0,t.state.doc.length,function(t,e){i.push(Qo.of({from:t,to:e}));}),t.dispatch({effects:i}),!0;}}],hu={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},lu=F.define({combine:function combine(t){return Rt(t,hu);}});fu=si.replace({widget:new(/*#__PURE__*/function(_ei7){function _class10(){_classCallCheck(this,_class10);return _callSuper(this,_class10,arguments);}_inherits(_class10,_ei7);return _createClass(_class10,[{key:"toDOM",value:function toDOM(t){return uu(t,null);}}]);}(ei))()});au=/*#__PURE__*/function(_ei8){function au(t){var _this80;_classCallCheck(this,au);_this80=_callSuper(this,au),_this80.value=t;return _this80;}_inherits(au,_ei8);return _createClass(au,[{key:"eq",value:function eq(t){return this.value==t.value;}},{key:"toDOM",value:function toDOM(t){return uu(t,this.value);}}]);}(ei);cu={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:function foldingChanged(){return!1;}};du=/*#__PURE__*/function(_yh3){function du(t,e){var _this81;_classCallCheck(this,du);_this81=_callSuper(this,du),_this81.config=t,_this81.open=e;return _this81;}_inherits(du,_yh3);return _createClass(du,[{key:"eq",value:function eq(t){return this.config==t.config&&this.open==t.open;}},{key:"toDOM",value:function toDOM(t){if(this.config.markerDOM)return this.config.markerDOM(this.open);var e=document.createElement("span");return e.textContent=this.open?this.config.openText:this.config.closedText,e.title=t.state.phrase(this.open?"Fold line":"Unfold line"),e;}}]);}(yh);pu=Qr.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});mu=/*#__PURE__*/function(){function mu(t,e){_classCallCheck(this,mu);var i;function s(t){var e=Zt.newName();return(i||(i=Object.create(null)))["."+e]=t,e;}this.specs=t;var r="string"==typeof e.all?e.all:e.all?s(e.all):void 0,n=e.scope;this.scope=n instanceof mo?function(t){return t.prop(ao)==n.data;}:n?function(t){return t==n;}:void 0,this.style=Jl(t.map(function(t){return{tag:t.tag,"class":t["class"]||s(Object.assign({},t,{tag:null}))};}),{all:r}).style,this.module=i?new Zt(i):null,this.themeType=e.themeType;}return _createClass(mu,null,[{key:"define",value:function define(t,e){return new mu(t,e||{});}}]);}();gu=F.define(),wu=F.define({combine:function combine(t){return t.length?[t[0]]:null;}});ku=/*#__PURE__*/function(){function ku(t){_classCallCheck(this,ku);this.markCache=Object.create(null),this.tree=bo(t.state),this.decorations=this.buildDeco(t,bu(t.state)),this.decoratedTo=t.viewport.to;}return _createClass(ku,[{key:"update",value:function update(t){var e=bo(t.state),i=bu(t.state),s=i!=bu(t.startState),r=t.view.viewport,n=t.changes.mapPos(this.decoratedTo,1);e.length<r.to&&!s&&e.type==this.tree.type&&n>=r.to?(this.decorations=this.decorations.map(t.changes),this.decoratedTo=n):(e!=this.tree||t.viewportChanged||s)&&(this.tree=e,this.decorations=this.buildDeco(t.view,i),this.decoratedTo=r.to);}},{key:"buildDeco",value:function buildDeco(t,e){var _this82=this;if(!e||!this.tree.length)return si.none;var i=new jt();var _iterator184=_createForOfIteratorHelper(t.visibleRanges),_step184;try{for(_iterator184.s();!(_step184=_iterator184.n()).done;){var _step184$value=_step184.value,_s168=_step184$value.from,_r136=_step184$value.to;Ul(this.tree,e,function(t,e,s){i.add(t,e,_this82.markCache[s]||(_this82.markCache[s]=si.mark({"class":s})));},_s168,_r136);}}catch(err){_iterator184.e(err);}finally{_iterator184.f();}return i.finish();}}]);}();yu=et.high(Zi.fromClass(ku,{decorations:function decorations(t){return t.decorations;}})),_export("K",Mu=mu.define([{tag:uo.meta,color:"#404740"},{tag:uo.link,textDecoration:"underline"},{tag:uo.heading,textDecoration:"underline",fontWeight:"bold"},{tag:uo.emphasis,fontStyle:"italic"},{tag:uo.strong,fontWeight:"bold"},{tag:uo.strikethrough,textDecoration:"line-through"},{tag:uo.keyword,color:"#708"},{tag:[uo.atom,uo.bool,uo.url,uo.contentSeparator,uo.labelName],color:"#219"},{tag:[uo.literal,uo.inserted],color:"#164"},{tag:[uo.string,uo.deleted],color:"#a11"},{tag:[uo.regexp,uo.escape,uo.special(uo.string)],color:"#e40"},{tag:uo.definition(uo.variableName),color:"#00f"},{tag:uo.local(uo.variableName),color:"#30a"},{tag:[uo.typeName,uo.namespace],color:"#085"},{tag:uo.className,color:"#167"},{tag:[uo.special(uo.variableName),uo.macroName],color:"#256"},{tag:uo.definition(uo.propertyName),color:"#00c"},{tag:uo.comment,color:"#940"},{tag:uo.invalid,color:"#f00"}])),xu=Qr.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),Su="()[]{}",Au=F.define({combine:function combine(t){return Rt(t,{afterCursor:!0,brackets:Su,maxScanDistance:1e4,renderMatch:Du});}}),Cu=si.mark({"class":"cm-matchingBracket"}),Ou=si.mark({"class":"cm-nonmatchingBracket"});Eu=_.define({create:function create(){return si.none;},update:function update(t,e){if(!e.docChanged&&!e.selection)return t;var i=[],s=e.state.facet(Au);var _iterator185=_createForOfIteratorHelper(e.state.selection.ranges),_step185;try{for(_iterator185.s();!(_step185=_iterator185.n()).done;){var _t242=_step185.value;if(!_t242.empty)continue;var _r137=Lu(e.state,_t242.head,-1,s)||_t242.head>0&&Lu(e.state,_t242.head-1,1,s)||s.afterCursor&&(Lu(e.state,_t242.head,1,s)||_t242.head<e.state.doc.length&&Lu(e.state,_t242.head+1,-1,s));_r137&&(i=i.concat(s.renderMatch(_r137,e.state)));}}catch(err){_iterator185.e(err);}finally{_iterator185.f();}return si.set(i,!0);},provide:function provide(t){return Qr.decorations.from(t);}}),Iu=[Eu,xu];_export("u",Ru=new Kh());$u=Object.create(null),ju=[Yh.none],zu=[],Pu=Object.create(null),Hu=Object.create(null);for(_i179=0,_arr2=[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]];_i179<_arr2.length;_i179++){_arr2$_i=_slicedToArray(_arr2[_i179],2),_t247=_arr2$_i[0],_e220=_arr2$_i[1];Hu[_t247]=Fu($u,_e220);}mi.RTL,mi.LTR;qu=Vu(Xu,0),Ju=Vu(_u,0),Uu=Vu(function(t,e){return _u(t,e,function(t){var e=[];var _iterator189=_createForOfIteratorHelper(t.selection.ranges),_step189;try{for(_iterator189.s();!(_step189=_iterator189.n()).done;){var _i181=_step189.value;var _s173=t.doc.lineAt(_i181.from),_r139=_i181.to<=_s173.to?_s173:t.doc.lineAt(_i181.to);_r139.from>_s173.from&&_r139.from==_i181.to&&(_r139=_i181.to==_s173.to+1?_s173:t.doc.lineAt(_i181.to-1));var _n101=e.length-1;_n101>=0&&e[_n101].to>_s173.from?e[_n101].to=_r139.to:e.push({from:_s173.from+/^\s*/.exec(_s173.text)[0].length,to:_r139.to});}}catch(err){_iterator189.e(err);}finally{_iterator189.f();}return e;}(e));},0);Ku=50;Yu=mt.define(),Qu=mt.define(),Zu=F.define(),tf=F.define({combine:function combine(t){return Rt(t,{minDepth:100,newGroupDelay:500,joinToEvent:function joinToEvent(t,e){return e;}},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:function joinToEvent(t,e){return function(i,s){return t(i,s)||e(i,s);};}});}}),ef=_.define({create:function create(){return bf.empty;},update:function update(t,e){var i=e.state.facet(tf),s=e.annotation(Yu);if(s){var _r143=of.fromTransaction(e,s.selection),_n106=s.side,_h75=0==_n106?t.undone:t.done;return _h75=_r143?uf(_h75,_h75.length,i.minDepth,_r143):df(_h75,e.startState.selection),new bf(0==_n106?s.rest:_h75,0==_n106?_h75:s.rest);}var r=e.annotation(Qu);if("full"!=r&&"before"!=r||(t=t.isolate()),!1===e.annotation(vt.addToHistory))return e.changes.empty?t:t.addMapping(e.changes.desc);var n=of.fromTransaction(e),h=e.annotation(vt.time),l=e.annotation(vt.userEvent);return n?t=t.addChanges(n,h,l,i,e):e.selection&&(t=t.addSelection(e.startState.selection,h,l,i.newGroupDelay)),"full"!=r&&"after"!=r||(t=t.isolate()),t;},toJSON:function toJSON(t){return{done:t.done.map(function(t){return t.toJSON();}),undone:t.undone.map(function(t){return t.toJSON();})};},fromJSON:function fromJSON(t){return new bf(t.done.map(of.fromJSON),t.undone.map(of.fromJSON));}});rf=sf(0,!1),nf=sf(1,!1),hf=sf(0,!0),lf=sf(1,!0);of=/*#__PURE__*/function(){function of(t,e,i,s,r){_classCallCheck(this,of);this.changes=t,this.effects=e,this.mapped=i,this.startSelection=s,this.selectionsAfter=r;}return _createClass(of,[{key:"setSelAfter",value:function setSelAfter(t){return new of(this.changes,this.effects,this.mapped,this.startSelection,t);}},{key:"toJSON",value:function toJSON(){var t,e,i;return{changes:null===(t=this.changes)||void 0===t?void 0:t.toJSON(),mapped:null===(e=this.mapped)||void 0===e?void 0:e.toJSON(),startSelection:null===(i=this.startSelection)||void 0===i?void 0:i.toJSON(),selectionsAfter:this.selectionsAfter.map(function(t){return t.toJSON();})};}}],[{key:"fromJSON",value:function fromJSON(t){return new of(t.changes&&R.fromJSON(t.changes),[],t.mapped&&I.fromJSON(t.mapped),t.startSelection&&P.fromJSON(t.startSelection),t.selectionsAfter.map(P.fromJSON));}},{key:"fromTransaction",value:function fromTransaction(t,e){var i=af;var _iterator193=_createForOfIteratorHelper(t.startState.facet(Zu)),_step193;try{for(_iterator193.s();!(_step193=_iterator193.n()).done;){var _e227=_step193.value;var _s175=_e227(t);_s175.length&&(i=i.concat(_s175));}}catch(err){_iterator193.e(err);}finally{_iterator193.f();}return!i.length&&t.changes.empty?null:new of(t.changes.invert(t.startState.doc),i,void 0,e||t.startState.selection,af);}},{key:"selection",value:function selection(t){return new of(void 0,af,void 0,void 0,t);}}]);}();af=[],cf=200;wf=/^(input\.type|delete)($|\.)/;bf=/*#__PURE__*/function(){function bf(t,e){var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;var s=arguments.length>3&&arguments[3]!==undefined?arguments[3]:void 0;_classCallCheck(this,bf);this.done=t,this.undone=e,this.prevTime=i,this.prevUserEvent=s;}return _createClass(bf,[{key:"isolate",value:function isolate(){return this.prevTime?new bf(this.done,this.undone):this;}},{key:"addChanges",value:function addChanges(t,e,i,s,r){var n=this.done,h=n[n.length-1];return n=h&&h.changes&&!h.changes.empty&&t.changes&&(!i||wf.test(i))&&(!h.selectionsAfter.length&&e-this.prevTime<s.newGroupDelay&&s.joinToEvent(r,function(t,e){var i=[],s=!1;return t.iterChangedRanges(function(t,e){return i.push(t,e);}),e.iterChangedRanges(function(t,e,r,n){for(var _t255=0;_t255<i.length;){var _e229=i[_t255++],_h76=i[_t255++];n>=_e229&&r<=_h76&&(s=!0);}}),s;}(h.changes,t.changes))||"input.type.compose"==i)?uf(n,n.length-1,s.minDepth,new of(t.changes.compose(h.changes),ff(bt.mapEffects(t.effects,h.changes),h.effects),h.mapped,h.startSelection,af)):uf(n,n.length,s.minDepth,t),new bf(n,af,e,i);}},{key:"addSelection",value:function addSelection(t,e,i,s){var r=this.done.length?this.done[this.done.length-1].selectionsAfter:af;return r.length>0&&e-this.prevTime<s&&i==this.prevUserEvent&&i&&/^select($|\.)/.test(i)&&(n=r[r.length-1],h=t,n.ranges.length==h.ranges.length&&0===n.ranges.filter(function(t,e){return t.empty!=h.ranges[e].empty;}).length)?this:new bf(df(this.done,t),this.undone,e,i);var n,h;}},{key:"addMapping",value:function addMapping(t){return new bf(mf(this.done,t),mf(this.undone,t),this.prevTime,this.prevUserEvent);}},{key:"pop",value:function pop(t,e,i){var s=0==t?this.done:this.undone;if(0==s.length)return null;var r=s[s.length-1],n=r.selectionsAfter[0]||e.selection;if(i&&r.selectionsAfter.length)return e.update({selection:r.selectionsAfter[r.selectionsAfter.length-1],annotations:Yu.of({side:t,rest:pf(s),selection:n}),userEvent:0==t?"select.undo":"select.redo",scrollIntoView:!0});if(r.changes){var _i190=1==s.length?af:s.slice(0,s.length-1);return r.mapped&&(_i190=mf(_i190,r.mapped)),e.update({changes:r.changes,selection:r.startSelection,effects:r.effects,annotations:Yu.of({side:t,rest:_i190,selection:n}),filter:!1,userEvent:0==t?"undo":"redo",scrollIntoView:!0});}return null;}}]);}();bf.empty=new bf(af,af);vf=[{key:"Mod-z",run:rf,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:nf,preventDefault:!0},{linux:"Ctrl-Shift-z",run:nf,preventDefault:!0},{key:"Mod-u",run:hf,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:lf,preventDefault:!0}];Cf=function Cf(t){return Sf(t,!Af(t));},Of=function Of(t){return Sf(t,Af(t));};Tf=function Tf(t){return Rf(t,!1);},Bf=function Bf(t){return Rf(t,!0);};$f=function $f(t){return Nf(t,!1);},jf=function jf(t){return Nf(t,!0);};Wf=function Wf(t){return Hf(t,!Af(t));},Ff=function Ff(t){return Hf(t,Af(t));};Jf=function Jf(t){return qf(t,!1);},Uf=function Uf(t){return qf(t,!0);};Kf=function Kf(t){return Gf(t,!1);},_f=function _f(t){return Gf(t,!0);},Xf=function Xf(_ref24){var t=_ref24.state,e=_ref24.dispatch;return e(yf(t,{anchor:0})),!0;},Yf=function Yf(_ref25){var t=_ref25.state,e=_ref25.dispatch;return e(yf(t,{anchor:t.doc.length})),!0;},Qf=function Qf(_ref26){var t=_ref26.state,e=_ref26.dispatch;return e(yf(t,{anchor:t.selection.main.anchor,head:0})),!0;},Zf=function Zf(_ref27){var t=_ref27.state,e=_ref27.dispatch;return e(yf(t,{anchor:t.selection.main.anchor,head:t.doc.length})),!0;};ia=function ia(t,e,i){return ta(t,function(s){var r,n,h=s.from,l=t.state,o=l.doc.lineAt(h);if(i&&!e&&h>o.from&&h<o.from+200&&!/[^ \t]/.test(r=o.text.slice(0,h-o.from))){if("\t"==r[r.length-1])return h-1;var _t256=Kt(r,l.tabSize)%Ro(l)||Ro(l);for(var _e233=0;_e233<_t256&&" "==r[r.length-1-_e233];_e233++)h--;n=h;}else n=S(o.text,h-o.from,e,e)+o.from,n==h&&o.number!=(e?l.doc.lines:1)?n+=e?1:-1:!e&&/[\ufe00-\ufe0f]/.test(o.text.slice(n-o.from,h-o.from))&&(n=S(o.text,n-o.from,!1,!1)+o.from);return n;});},sa=function sa(t){return ia(t,!1,!0);},ra=function ra(t){return ia(t,!0,!1);},na=function na(t,e){return ta(t,function(i){var s=i.head,r=t.state,n=r.doc.lineAt(s),h=r.charCategorizer(s);for(var _t257=null;;){if(s==(e?n.to:n.from)){s==i.head&&n.number!=(e?r.doc.lines:1)&&(s+=e?1:-1);break;}var _l65=S(n.text,s-n.from,e)+n.from,_o42=n.text.slice(Math.min(s,_l65)-n.from,Math.max(s,_l65)-n.from),_u32=h(_o42);if(null!=_t257&&_u32!=_t257)break;" "==_o42&&s==i.head||(_t257=_u32),s=_l65;}return s;});},ha=function ha(t){return na(t,!1);};fa=aa(!1);da=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:function run(t){return Mf(t,function(e){return If(t.state,e,!Af(t));});},shift:function shift(t){return Pf(t,function(e){return If(t.state,e,!Af(t));});}},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:function run(t){return Mf(t,function(e){return If(t.state,e,Af(t));});},shift:function shift(t){return Pf(t,function(e){return If(t.state,e,Af(t));});}},{key:"Alt-ArrowUp",run:function run(_ref29){var t=_ref29.state,e=_ref29.dispatch;return oa(t,e,!1);}},{key:"Shift-Alt-ArrowUp",run:function run(_ref30){var t=_ref30.state,e=_ref30.dispatch;return ua(t,e,!1);}},{key:"Alt-ArrowDown",run:function run(_ref31){var t=_ref31.state,e=_ref31.dispatch;return oa(t,e,!0);}},{key:"Shift-Alt-ArrowDown",run:function run(_ref32){var t=_ref32.state,e=_ref32.dispatch;return ua(t,e,!0);}},{key:"Escape",run:function run(_ref33){var t=_ref33.state,e=_ref33.dispatch;var i=t.selection,s=null;return i.ranges.length>1?s=P.create([i.main]):i.main.empty||(s=P.create([P.cursor(i.main.head)])),!!s&&(e(yf(t,s)),!0);}},{key:"Mod-Enter",run:aa(!0)},{key:"Alt-l",mac:"Ctrl-l",run:function run(_ref34){var t=_ref34.state,e=_ref34.dispatch;var i=la(t).map(function(_ref35){var e=_ref35.from,i=_ref35.to;return P.range(e,Math.min(i+1,t.doc.length));});return e(t.update({selection:P.create(i),userEvent:"select"})),!0;}},{key:"Mod-i",run:function run(_ref36){var t=_ref36.state,e=_ref36.dispatch;var i=kf(t.selection,function(e){var i=bo(t),s=i.resolveStack(e.from,1);if(e.empty){var _t260=i.resolveStack(e.from,-1);_t260.node.from>=s.node.from&&_t260.node.to<=s.node.to&&(s=_t260);}for(var _t261=s;_t261;_t261=_t261.next){var _t262=_t261,_i194=_t262.node;if((_i194.from<e.from&&_i194.to>=e.to||_i194.to>e.to&&_i194.from<=e.from)&&_t261.next)return P.range(_i194.to,_i194.from);}return e;});return!i.eq(t.selection)&&(e(yf(t,i)),!0);},preventDefault:!0},{key:"Mod-[",run:function run(_ref37){var t=_ref37.state,e=_ref37.dispatch;return!t.readOnly&&(e(t.update(ca(t,function(e,i){var s=/^\s*/.exec(e.text)[0];if(!s)return;var r=Kt(s,t.tabSize),n=0,h=To(t,Math.max(0,r-Ro(t)));for(;n<s.length&&n<h.length&&s.charCodeAt(n)==h.charCodeAt(n);)n++;i.push({from:e.from+n,to:e.from+s.length,insert:h.slice(n)});}),{userEvent:"delete.dedent"})),!0);}},{key:"Mod-]",run:function run(_ref38){var t=_ref38.state,e=_ref38.dispatch;return!t.readOnly&&(e(t.update(ca(t,function(e,i){i.push({from:e.from,insert:t.facet(Io)});}),{userEvent:"input.indent"})),!0);}},{key:"Mod-Alt-\\",run:function run(_ref39){var t=_ref39.state,e=_ref39.dispatch;if(t.readOnly)return!1;var i=Object.create(null),s=new Lo(t,{overrideIndentation:function overrideIndentation(t){var e=i[t];return null==e?-1:e;}}),r=ca(t,function(e,r,n){var h=Bo(s,e.from);if(null==h)return;/\S/.test(e.text)||(h=0);var l=/^\s*/.exec(e.text)[0],o=To(t,h);(l!=o||n.from<e.from+l.length)&&(i[e.from]=h,r.push({from:e.from,to:e.from+l.length,insert:o}));});return r.changes.empty||e(t.update(r,{userEvent:"indent"})),!0;}},{key:"Shift-Mod-k",run:function run(t){if(t.state.readOnly)return!1;var e=t.state,i=e.changes(la(e).map(function(_ref40){var t=_ref40.from,i=_ref40.to;return t>0?t--:i<e.doc.length&&i++,{from:t,to:i};})),s=kf(e.selection,function(e){var i;if(t.lineWrapping){var _s180=t.lineBlockAt(e.head),_r146=t.coordsAtPos(e.head,e.assoc||1);_r146&&(i=_s180.bottom+t.documentTop-_r146.bottom+t.defaultLineHeight/2);}return t.moveVertically(e,!0,i);}).map(i);return t.dispatch({changes:i,selection:s,scrollIntoView:!0,userEvent:"delete.line"}),!0;}},{key:"Shift-Mod-\\",run:function run(_ref41){var t=_ref41.state,e=_ref41.dispatch;return function(t,e,i){var s=!1,r=kf(t.selection,function(e){var r=Lu(t,e.head,-1)||Lu(t,e.head,1)||e.head>0&&Lu(t,e.head-1,1)||e.head<t.doc.length&&Lu(t,e.head+1,-1);if(!r||!r.end)return e;s=!0;var n=r.start.from==e.head?r.end.to:r.end.from;return i?P.range(e.anchor,n):P.cursor(n);});return!!s&&(e(yf(t,r)),!0);}(t,e,!1);}},{key:"Mod-/",run:function run(t){var e=t.state,i=e.doc.lineAt(e.selection.main.from),s=Gu(t.state,i.from);return s.line?qu(t):!!s.block&&Uu(t);}},{key:"Alt-A",run:Ju},{key:"Ctrl-m",mac:"Shift-Alt-m",run:function run(t){return t.setTabFocusMode(),!0;}}].concat([{key:"ArrowLeft",run:Cf,shift:Wf,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:function run(t){return Df(t,!Af(t));},shift:function shift(t){return Vf(t,!Af(t));},preventDefault:!0},{mac:"Cmd-ArrowLeft",run:function run(t){return Mf(t,function(e){return zf(t,e,!Af(t));});},shift:function shift(t){return Pf(t,function(e){return zf(t,e,!Af(t));});},preventDefault:!0},{key:"ArrowRight",run:Of,shift:Ff,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:function run(t){return Df(t,Af(t));},shift:function shift(t){return Vf(t,Af(t));},preventDefault:!0},{mac:"Cmd-ArrowRight",run:function run(t){return Mf(t,function(e){return zf(t,e,Af(t));});},shift:function shift(t){return Pf(t,function(e){return zf(t,e,Af(t));});},preventDefault:!0},{key:"ArrowUp",run:Tf,shift:Jf,preventDefault:!0},{mac:"Cmd-ArrowUp",run:Xf,shift:Qf},{mac:"Ctrl-ArrowUp",run:$f,shift:Kf},{key:"ArrowDown",run:Bf,shift:Uf,preventDefault:!0},{mac:"Cmd-ArrowDown",run:Yf,shift:Zf},{mac:"Ctrl-ArrowDown",run:jf,shift:_f},{key:"PageUp",run:$f,shift:Kf},{key:"PageDown",run:jf,shift:_f},{key:"Home",run:function run(t){return Mf(t,function(e){return zf(t,e,!1);});},shift:function shift(t){return Pf(t,function(e){return zf(t,e,!1);});},preventDefault:!0},{key:"Mod-Home",run:Xf,shift:Qf},{key:"End",run:function run(t){return Mf(t,function(e){return zf(t,e,!0);});},shift:function shift(t){return Pf(t,function(e){return zf(t,e,!0);});},preventDefault:!0},{key:"Mod-End",run:Yf,shift:Zf},{key:"Enter",run:fa,shift:fa},{key:"Mod-a",run:function run(_ref42){var t=_ref42.state,e=_ref42.dispatch;return e(t.update({selection:{anchor:0,head:t.doc.length},userEvent:"select"})),!0;}},{key:"Backspace",run:sa,shift:sa},{key:"Delete",run:ra},{key:"Mod-Backspace",mac:"Alt-Backspace",run:ha},{key:"Mod-Delete",mac:"Alt-Delete",run:function run(t){return na(t,!0);}},{mac:"Mod-Backspace",run:function run(t){return ta(t,function(e){var i=t.moveToLineBoundary(e,!1).head;return e.head>i?i:Math.max(0,e.head-1);});}},{mac:"Mod-Delete",run:function run(t){return ta(t,function(e){var i=t.moveToLineBoundary(e,!0).head;return e.head<i?i:Math.min(t.state.doc.length,e.head+1);});}}].concat([{key:"Ctrl-b",run:Cf,shift:Wf,preventDefault:!0},{key:"Ctrl-f",run:Of,shift:Ff},{key:"Ctrl-p",run:Tf,shift:Jf},{key:"Ctrl-n",run:Bf,shift:Uf},{key:"Ctrl-a",run:function run(t){return Mf(t,function(e){return P.cursor(t.lineBlockAt(e.head).from,1);});},shift:function shift(t){return Pf(t,function(e){return P.cursor(t.lineBlockAt(e.head).from);});}},{key:"Ctrl-e",run:function run(t){return Mf(t,function(e){return P.cursor(t.lineBlockAt(e.head).to,-1);});},shift:function shift(t){return Pf(t,function(e){return P.cursor(t.lineBlockAt(e.head).to);});}},{key:"Ctrl-d",run:ra},{key:"Ctrl-h",run:sa},{key:"Ctrl-k",run:function run(t){return ta(t,function(e){var i=t.lineBlockAt(e.head).to;return e.head<i?i:Math.min(t.state.doc.length,e.head+1);});}},{key:"Ctrl-Alt-h",run:ha},{key:"Ctrl-o",run:function run(_ref43){var t=_ref43.state,e=_ref43.dispatch;if(t.readOnly)return!1;var i=t.changeByRange(function(t){return{changes:{from:t.from,to:t.to,insert:p.of(["",""])},range:P.cursor(t.from)};});return e(t.update(i,{scrollIntoView:!0,userEvent:"input"})),!0;}},{key:"Ctrl-t",run:function run(_ref44){var t=_ref44.state,e=_ref44.dispatch;if(t.readOnly)return!1;var i=t.changeByRange(function(e){if(!e.empty||0==e.from||e.from==t.doc.length)return{range:e};var i=e.from,s=t.doc.lineAt(i),r=i==s.from?i-1:S(s.text,i-s.from,!1)+s.from,n=i==s.to?i+1:S(s.text,i-s.from,!0)+s.from;return{changes:{from:r,to:n,insert:t.doc.slice(i,n).append(t.doc.slice(r,i))},range:P.cursor(n)};});return!i.changes.empty&&(e(t.update(i,{scrollIntoView:!0,userEvent:"move.character"})),!0);}},{key:"Ctrl-v",run:jf}].map(function(t){return{mac:t.key,run:t.run,shift:t.shift};})));ga="function"==typeof String.prototype.normalize?function(t){return t.normalize("NFKD");}:function(t){return t;};wa=/*#__PURE__*/function(){function wa(t,e){var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;var s=arguments.length>3&&arguments[3]!==undefined?arguments[3]:t.length;var r=arguments.length>4?arguments[4]:undefined;var n=arguments.length>5?arguments[5]:undefined;_classCallCheck(this,wa);this.test=n,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=t.iterRange(i,s),this.bufferStart=i,this.normalize=r?function(t){return r(ga(t));}:ga,this.query=this.normalize(e);}return _createClass(wa,[{key:"peek",value:function peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value;}return A(this.buffer,this.bufferPos);}},{key:"next",value:function next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping();}},{key:"nextOverlapping",value:function nextOverlapping(){for(;;){var _t263=this.peek();if(_t263<0)return this.done=!0,this;var _e236=C(_t263),_i195=this.bufferStart+this.bufferPos;this.bufferPos+=O(_t263);var _s181=this.normalize(_e236);if(_s181.length)for(var _t264=0,_r147=_i195;;_t264++){var _n110=_s181.charCodeAt(_t264),_h82=this.match(_n110,_r147,this.bufferPos+this.bufferStart);if(_t264==_s181.length-1){if(_h82)return this.value=_h82,this;break;}_r147==_i195&&_t264<_e236.length&&_e236.charCodeAt(_t264)==_n110&&_r147++;}}}},{key:"match",value:function match(t,e,i){var s=null;for(var _e237=0;_e237<this.matches.length;_e237+=2){var _r148=this.matches[_e237],_n111=!1;this.query.charCodeAt(_r148)==t&&(_r148==this.query.length-1?s={from:this.matches[_e237+1],to:i}:(this.matches[_e237]++,_n111=!0)),_n111||(this.matches.splice(_e237,2),_e237-=2);}return this.query.charCodeAt(0)==t&&(1==this.query.length?s={from:e,to:i}:this.matches.push(1,e)),s&&this.test&&!this.test(s.from,s.to,this.buffer,this.bufferStart)&&(s=null),s;}}]);}();"undefined"!=typeof Symbol&&(wa.prototype[Symbol.iterator]=function(){return this;});ba={from:-1,to:-1,match:/.*/.exec("")},va="gm"+(null==/x/.unicode?"":"u");ka=/*#__PURE__*/function(){function ka(t,e,i){var s=arguments.length>3&&arguments[3]!==undefined?arguments[3]:0;var r=arguments.length>4&&arguments[4]!==undefined?arguments[4]:t.length;_classCallCheck(this,ka);if(this.text=t,this.to=r,this.curLine="",this.done=!1,this.value=ba,/\\[sWDnr]|\n|\r|\[\^/.test(e))return new xa(t,e,i,s,r);this.re=new RegExp(e,va+((null==i?void 0:i.ignoreCase)?"i":"")),this.test=null==i?void 0:i.test,this.iter=t.iter();var n=t.lineAt(s);this.curLineStart=n.from,this.matchPos=Sa(t,s),this.getLine(this.curLineStart);}return _createClass(ka,[{key:"getLine",value:function getLine(t){this.iter.next(t),this.iter.lineBreak?this.curLine="":(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next());}},{key:"nextLine",value:function nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0);}},{key:"next",value:function next(){for(var _t265=this.matchPos-this.curLineStart;;){this.re.lastIndex=_t265;var _e238=this.matchPos<=this.to&&this.re.exec(this.curLine);if(_e238){var _i196=this.curLineStart+_e238.index,_s182=_i196+_e238[0].length;if(this.matchPos=Sa(this.text,_s182+(_i196==_s182?1:0)),_i196==this.curLineStart+this.curLine.length&&this.nextLine(),(_i196<_s182||_i196>this.value.to)&&(!this.test||this.test(_i196,_s182,_e238)))return this.value={from:_i196,to:_s182,match:_e238},this;_t265=this.matchPos-this.curLineStart;}else{if(!(this.curLineStart+this.curLine.length<this.to))return this.done=!0,this;this.nextLine(),_t265=0;}}}}]);}();ya=new WeakMap();Ma=/*#__PURE__*/function(){function Ma(t,e){_classCallCheck(this,Ma);this.from=t,this.text=e;}return _createClass(Ma,[{key:"to",get:function get(){return this.from+this.text.length;}}],[{key:"get",value:function get(t,e,i){var s=ya.get(t);if(!s||s.from>=i||s.to<=e){var _s183=new Ma(e,t.sliceString(e,i));return ya.set(t,_s183),_s183;}if(s.from==e&&s.to==i)return s;var r=s.text,n=s.from;return n>e&&(r=t.sliceString(e,n)+r,n=e),s.to<i&&(r+=t.sliceString(s.to,i)),ya.set(t,new Ma(n,r)),new Ma(e,r.slice(e-n,i-n));}}]);}();xa=/*#__PURE__*/function(){function xa(t,e,i,s,r){_classCallCheck(this,xa);this.text=t,this.to=r,this.done=!1,this.value=ba,this.matchPos=Sa(t,s),this.re=new RegExp(e,va+((null==i?void 0:i.ignoreCase)?"i":"")),this.test=null==i?void 0:i.test,this.flat=Ma.get(t,s,this.chunkEnd(s+5e3));}return _createClass(xa,[{key:"chunkEnd",value:function chunkEnd(t){return t>=this.to?this.to:this.text.lineAt(t).to;}},{key:"next",value:function next(){for(;;){var _t266=this.re.lastIndex=this.matchPos-this.flat.from,_e239=this.re.exec(this.flat.text);if(_e239&&!_e239[0]&&_e239.index==_t266&&(this.re.lastIndex=_t266+1,_e239=this.re.exec(this.flat.text)),_e239){var _t267=this.flat.from+_e239.index,_i197=_t267+_e239[0].length;if((this.flat.to>=this.to||_e239.index+_e239[0].length<=this.flat.text.length-10)&&(!this.test||this.test(_t267,_i197,_e239)))return this.value={from:_t267,to:_i197,match:_e239},this.matchPos=Sa(this.text,_i197+(_t267==_i197?1:0)),this;}if(this.flat.to==this.to)return this.done=!0,this;this.flat=Ma.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+2*this.flat.text.length));}}}]);}();"undefined"!=typeof Symbol&&(ka.prototype[Symbol.iterator]=xa.prototype[Symbol.iterator]=function(){return this;});Ca=bt.define(),Oa=_.define({create:function create(){return!0;},update:function update(t,e){var _iterator201=_createForOfIteratorHelper(e.effects),_step201;try{for(_iterator201.s();!(_step201=_iterator201.n()).done;){var _i199=_step201.value;_i199.is(Ca)&&(t=_i199.value);}}catch(err){_iterator201.e(err);}finally{_iterator201.f();}return t;},provide:function provide(t){return kh.from(t,function(t){return t?Aa:null;});}}),Da=Qr.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px","& label":{fontSize:"80%"}}}),Ea={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},Ia=F.define({combine:function combine(t){return Rt(t,Ea,{highlightWordAroundCursor:function highlightWordAroundCursor(t,e){return t||e;},minSelectionLength:Math.min,maxMatches:Math.min});}});Ra=si.mark({"class":"cm-selectionMatch"}),Ta=si.mark({"class":"cm-selectionMatch cm-selectionMatch-main"});La=Zi.fromClass(/*#__PURE__*/function(){function _class11(t){_classCallCheck(this,_class11);this.decorations=this.getDeco(t);}return _createClass(_class11,[{key:"update",value:function update(t){(t.selectionSet||t.docChanged||t.viewportChanged)&&(this.decorations=this.getDeco(t.view));}},{key:"getDeco",value:function getDeco(t){var e=t.state.facet(Ia),i=t.state,s=i.selection;if(s.ranges.length>1)return si.none;var r,n=s.main,h=null;if(n.empty){if(!e.highlightWordAroundCursor)return si.none;var _t269=i.wordAt(n.head);if(!_t269)return si.none;h=i.charCategorizer(n.head),r=i.sliceDoc(_t269.from,_t269.to);}else{var _t270=n.to-n.from;if(_t270<e.minSelectionLength||_t270>200)return si.none;if(e.wholeWords){if(r=i.sliceDoc(n.from,n.to),h=i.charCategorizer(n.head),!Ba(h,i,n.from,n.to)||!function(t,e,i,s){return t(e.sliceDoc(i,i+1))==Ct.Word&&t(e.sliceDoc(s-1,s))==Ct.Word;}(h,i,n.from,n.to))return si.none;}else if(r=i.sliceDoc(n.from,n.to),!r)return si.none;}var l=[];var _iterator202=_createForOfIteratorHelper(t.visibleRanges),_step202;try{for(_iterator202.s();!(_step202=_iterator202.n()).done;){var _s184=_step202.value;var _t271=new wa(i.doc,r,_s184.from,_s184.to);for(;!_t271.next().done;){var _t271$value=_t271.value,_s185=_t271$value.from,_r149=_t271$value.to;if((!h||Ba(h,i,_s185,_r149))&&(n.empty&&_s185<=n.from&&_r149>=n.to?l.push(Ta.range(_s185,_r149)):(_s185>=n.to||_r149<=n.from)&&l.push(Ra.range(_s185,_r149)),l.length>e.maxMatches))return si.none;}}}catch(err){_iterator202.e(err);}finally{_iterator202.f();}return si.set(l);}}]);}(),{decorations:function decorations(t){return t.decorations;}}),Na=Qr.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}});$a=F.define({combine:function combine(t){return Rt(t,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:function createPanel(t){return new ac(t);},scrollToMatch:function scrollToMatch(t){return Qr.scrollIntoView(t);}});}});ja=/*#__PURE__*/function(){function ja(t){_classCallCheck(this,ja);this.search=t.search,this.caseSensitive=!!t.caseSensitive,this.literal=!!t.literal,this.regexp=!!t.regexp,this.replace=t.replace||"",this.valid=!!this.search&&(!this.regexp||function(t){try{return new RegExp(t,va),!0;}catch(t){return!1;}}(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!t.wholeWord;}return _createClass(ja,[{key:"unquote",value:function unquote(t){return this.literal?t:t.replace(/\\([nrt\\])/g,function(t,e){return"n"==e?"\n":"r"==e?"\r":"t"==e?"\t":"\\";});}},{key:"eq",value:function eq(t){return this.search==t.search&&this.replace==t.replace&&this.caseSensitive==t.caseSensitive&&this.regexp==t.regexp&&this.wholeWord==t.wholeWord;}},{key:"create",value:function create(){return this.regexp?new qa(this):new Ha(this);}},{key:"getCursor",value:function getCursor(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var i=arguments.length>2?arguments[2]:undefined;var s=t.doc?t:It.create({doc:t});return null==i&&(i=s.doc.length),this.regexp?Wa(this,s,e,i):Pa(this,s,e,i);}}]);}();za=/*#__PURE__*/_createClass(function za(t){_classCallCheck(this,za);this.spec=t;});Ha=/*#__PURE__*/function(_za){function Ha(t){_classCallCheck(this,Ha);return _callSuper(this,Ha,[t]);}_inherits(Ha,_za);return _createClass(Ha,[{key:"nextMatch",value:function nextMatch(t,e,i){var s=Pa(this.spec,t,i,t.doc.length).nextOverlapping();if(s.done){var _i200=Math.min(t.doc.length,e+this.spec.unquoted.length);s=Pa(this.spec,t,0,_i200).nextOverlapping();}return s.done||s.value.from==e&&s.value.to==i?null:s.value;}},{key:"prevMatchInRange",value:function prevMatchInRange(t,e,i){for(var _s186=i;;){var _i201=Math.max(e,_s186-1e4-this.spec.unquoted.length),_r150=Pa(this.spec,t,_i201,_s186),_n112=null;for(;!_r150.nextOverlapping().done;)_n112=_r150.value;if(_n112)return _n112;if(_i201==e)return null;_s186-=1e4;}}},{key:"prevMatch",value:function prevMatch(t,e,i){var s=this.prevMatchInRange(t,0,e);return s||(s=this.prevMatchInRange(t,Math.max(0,i-this.spec.unquoted.length),t.doc.length)),!s||s.from==e&&s.to==i?null:s;}},{key:"getReplacement",value:function getReplacement(t){return this.spec.unquote(this.spec.replace);}},{key:"matchAll",value:function matchAll(t,e){var i=Pa(this.spec,t,0,t.doc.length),s=[];for(;!i.next().done;){if(s.length>=e)return null;s.push(i.value);}return s;}},{key:"highlight",value:function highlight(t,e,i,s){var r=Pa(this.spec,t,Math.max(0,e-this.spec.unquoted.length),Math.min(i+this.spec.unquoted.length,t.doc.length));for(;!r.next().done;)s(r.value.from,r.value.to);}}]);}(za);qa=/*#__PURE__*/function(_za2){function qa(){_classCallCheck(this,qa);return _callSuper(this,qa,arguments);}_inherits(qa,_za2);return _createClass(qa,[{key:"nextMatch",value:function nextMatch(t,e,i){var s=Wa(this.spec,t,i,t.doc.length).next();return s.done&&(s=Wa(this.spec,t,0,e).next()),s.done?null:s.value;}},{key:"prevMatchInRange",value:function prevMatchInRange(t,e,i){for(var _s187=1;;_s187++){var _r151=Math.max(e,i-1e4*_s187),_n113=Wa(this.spec,t,_r151,i),_h83=null;for(;!_n113.next().done;)_h83=_n113.value;if(_h83&&(_r151==e||_h83.from>_r151+10))return _h83;if(_r151==e)return null;}}},{key:"prevMatch",value:function prevMatch(t,e,i){return this.prevMatchInRange(t,0,e)||this.prevMatchInRange(t,i,t.doc.length);}},{key:"getReplacement",value:function getReplacement(t){return this.spec.unquote(this.spec.replace).replace(/\$([$&\d+])/g,function(e,i){return"$"==i?"$":"&"==i?t.match[0]:"0"!=i&&+i<t.match.length?t.match[i]:e;});}},{key:"matchAll",value:function matchAll(t,e){var i=Wa(this.spec,t,0,t.doc.length),s=[];for(;!i.next().done;){if(s.length>=e)return null;s.push(i.value);}return s;}},{key:"highlight",value:function highlight(t,e,i,s){var r=Wa(this.spec,t,Math.max(0,e-250),Math.min(i+250,t.doc.length));for(;!r.next().done;)s(r.value.from,r.value.to);}}]);}(za);Ja=bt.define(),Ua=bt.define(),Ga=_.define({create:function create(t){return new Ka(nc(t).create(),null);},update:function update(t,e){var _iterator203=_createForOfIteratorHelper(e.effects),_step203;try{for(_iterator203.s();!(_step203=_iterator203.n()).done;){var _i202=_step203.value;_i202.is(Ja)?t=new Ka(_i202.value.create(),t.panel):_i202.is(Ua)&&(t=new Ka(t.query,_i202.value?rc:null));}}catch(err){_iterator203.e(err);}finally{_iterator203.f();}return t;},provide:function provide(t){return kh.from(t,function(t){return t.panel;});}});Ka=/*#__PURE__*/_createClass(function Ka(t,e){_classCallCheck(this,Ka);this.query=t,this.panel=e;});_a=si.mark({"class":"cm-searchMatch"}),Xa=si.mark({"class":"cm-searchMatch cm-searchMatch-selected"}),Ya=Zi.fromClass(/*#__PURE__*/function(){function _class12(t){_classCallCheck(this,_class12);this.view=t,this.decorations=this.highlight(t.state.field(Ga));}return _createClass(_class12,[{key:"update",value:function update(t){var e=t.state.field(Ga);(e!=t.startState.field(Ga)||t.docChanged||t.selectionSet||t.viewportChanged)&&(this.decorations=this.highlight(e));}},{key:"highlight",value:function highlight(_ref45){var t=_ref45.query,e=_ref45.panel;if(!e||!t.spec.valid)return si.none;var i=this.view,s=new jt();for(var _e240=0,_r152=i.visibleRanges,_n114=_r152.length;_e240<_n114;_e240++){var _r152$_e=_r152[_e240],_h84=_r152$_e.from,_l66=_r152$_e.to;for(;_e240<_n114-1&&_l66>_r152[_e240+1].from-500;)_l66=_r152[++_e240].to;t.highlight(i.state,_h84,_l66,function(t,e){var r=i.state.selection.ranges.some(function(i){return i.from==t&&i.to==e;});s.add(t,e,r?Xa:_a);});}return s.finish();}}]);}(),{decorations:function decorations(t){return t.decorations;}});Za=Qa(function(t,_ref46){var e=_ref46.query;var i=t.state.selection.main.to,s=e.nextMatch(t.state,i,i);if(!s)return!1;var r=P.single(s.from,s.to),n=t.state.facet($a);return t.dispatch({selection:r,effects:[mc(t,s),n.scrollToMatch(r.main,t)],userEvent:"select.search"}),lc(t),!0;}),tc=Qa(function(t,_ref47){var e=_ref47.query;var i=t.state,s=i.selection.main.from,r=e.prevMatch(i,s,s);if(!r)return!1;var n=P.single(r.from,r.to),h=t.state.facet($a);return t.dispatch({selection:n,effects:[mc(t,r),h.scrollToMatch(n.main,t)],userEvent:"select.search"}),lc(t),!0;}),ec=Qa(function(t,_ref48){var e=_ref48.query;var i=e.matchAll(t.state,1e3);return!(!i||!i.length)&&(t.dispatch({selection:P.create(i.map(function(t){return P.range(t.from,t.to);})),userEvent:"select.search.matches"}),!0);}),ic=Qa(function(t,_ref49){var e=_ref49.query;var i=t.state,_i$selection$main=i.selection.main,s=_i$selection$main.from,r=_i$selection$main.to;if(i.readOnly)return!1;var n=e.nextMatch(i,s,s);if(!n)return!1;var h,l,o=n,u=[],f=[];if(o.from==s&&o.to==r&&(l=i.toText(e.getReplacement(o)),u.push({from:o.from,to:o.to,insert:l}),o=e.nextMatch(i,o.from,o.to),f.push(Qr.announce.of(i.phrase("replaced match on line $",i.doc.lineAt(s).number)+"."))),o){var _e241=0==u.length||u[0].from>=n.to?0:n.to-n.from-l.length;h=P.single(o.from-_e241,o.to-_e241),f.push(mc(t,o)),f.push(i.facet($a).scrollToMatch(h.main,t));}return t.dispatch({changes:u,selection:h,effects:f,userEvent:"input.replace"}),!0;}),sc=Qa(function(t,_ref50){var e=_ref50.query;if(t.state.readOnly)return!1;var i=e.matchAll(t.state,1e9).map(function(t){var i=t.from,s=t.to;return{from:i,to:s,insert:e.getReplacement(t)};});if(!i.length)return!1;var s=t.state.phrase("replaced $ matches",i.length)+".";return t.dispatch({changes:i,effects:Qr.announce.of(s),userEvent:"input.replace.all"}),!0;});oc=function oc(t){var e=t.state.field(Ga,!1);if(e&&e.panel){var _i203=hc(t);if(_i203&&_i203!=t.root.activeElement){var _s188=nc(t.state,e.query.spec);_s188.valid&&t.dispatch({effects:Ja.of(_s188)}),_i203.focus(),_i203.select();}}else t.dispatch({effects:[Ua.of(!0),e?Ja.of(nc(t.state,e.query.spec)):bt.appendConfig.of(wc)]});return!0;},uc=function uc(t){var e=t.state.field(Ga,!1);if(!e||!e.panel)return!1;var i=gh(t,rc);return i&&i.dom.contains(t.root.activeElement)&&t.focus(),t.dispatch({effects:Ua.of(!1)}),!0;},fc=[{key:"Mod-f",run:oc,scope:"editor search-panel"},{key:"F3",run:Za,shift:tc,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:Za,shift:tc,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:uc,scope:"editor search-panel"},{key:"Mod-Shift-l",run:function run(_ref51){var t=_ref51.state,e=_ref51.dispatch;var i=t.selection;if(i.ranges.length>1||i.main.empty)return!1;var _i$main=i.main,s=_i$main.from,r=_i$main.to,n=[],h=0;for(var _e242=new wa(t.doc,t.sliceDoc(s,r));!_e242.next().done;){if(n.length>1e3)return!1;_e242.value.from==s&&(h=n.length),n.push(P.range(_e242.value.from,_e242.value.to));}return e(t.update({selection:P.create(n,h),userEvent:"select.search.matches"})),!0;}},{key:"Mod-Alt-g",run:function run(t){var e=gh(t,Aa);if(!e){var _i204=[Ca.of(!0)];null==t.state.field(Oa,!1)&&_i204.push(bt.appendConfig.of([Oa,Da])),t.dispatch({effects:_i204}),e=gh(t,Aa);}return e&&e.dom.querySelector("input").select(),!0;}},{key:"Mod-d",run:function run(_ref52){var t=_ref52.state,e=_ref52.dispatch;var i=t.selection.ranges;if(i.some(function(t){return t.from===t.to;}))return function(_ref53){var t=_ref53.state,e=_ref53.dispatch;var i=t.selection,s=P.create(i.ranges.map(function(e){return t.wordAt(e.head)||P.cursor(e.head);}),i.mainIndex);return!s.eq(i)&&(e(t.update({selection:s})),!0);}({state:t,dispatch:e});var s=t.sliceDoc(i[0].from,i[0].to);if(t.selection.ranges.some(function(e){return t.sliceDoc(e.from,e.to)!=s;}))return!1;var r=function(t,e){var _t$selection=t.selection,i=_t$selection.main,s=_t$selection.ranges,r=t.wordAt(i.head),n=r&&r.from==i.from&&r.to==i.to;var _loop17=function _loop17(_i206,_r154){if(_r154.next(),!_r154.done){if(_i206&&s.some(function(t){return t.from==_r154.value.from;})){_i205=_i206,_r153=_r154;return 0;}// continue
|
|
3
|
+
if(n){var _e243=t.wordAt(_r154.value.from);if(!_e243||_e243.from!=_r154.value.from||_e243.to!=_r154.value.to){_i205=_i206,_r153=_r154;return 0;}// continue
|
|
4
|
+
}return{v:_r154.value};}if(_i206)return{v:null};_r154=new wa(t.doc,e,0,Math.max(0,s[s.length-1].from-1)),_i206=!0;_i205=_i206,_r153=_r154;},_ret2;for(var _i205=!1,_r153=new wa(t.doc,e,s[s.length-1].to);;){_ret2=_loop17(_i205,_r153);if(_ret2===0)continue;if(_ret2)return _ret2.v;}}(t,s);return!!r&&(e(t.update({selection:t.selection.addRange(P.range(r.from,r.to),!1),effects:Qr.scrollIntoView(r.to)})),!0);},preventDefault:!0}];ac=/*#__PURE__*/function(){function ac(t){var _this83=this;_classCallCheck(this,ac);this.view=t;var e=this.query=t.state.field(Ga).query.spec;function i(t,e,i){return pa("button",{"class":"cm-button",name:t,onclick:e,type:"button"},i);}this.commit=this.commit.bind(this),this.searchField=pa("input",{value:e.search,placeholder:cc(t,"Find"),"aria-label":cc(t,"Find"),"class":"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=pa("input",{value:e.replace,placeholder:cc(t,"Replace"),"aria-label":cc(t,"Replace"),"class":"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=pa("input",{type:"checkbox",name:"case",form:"",checked:e.caseSensitive,onchange:this.commit}),this.reField=pa("input",{type:"checkbox",name:"re",form:"",checked:e.regexp,onchange:this.commit}),this.wordField=pa("input",{type:"checkbox",name:"word",form:"",checked:e.wholeWord,onchange:this.commit}),this.dom=pa("div",{onkeydown:function onkeydown(t){return _this83.keydown(t);},"class":"cm-search"},[this.searchField,i("next",function(){return Za(t);},[cc(t,"next")]),i("prev",function(){return tc(t);},[cc(t,"previous")]),i("select",function(){return ec(t);},[cc(t,"all")]),pa("label",null,[this.caseField,cc(t,"match case")]),pa("label",null,[this.reField,cc(t,"regexp")]),pa("label",null,[this.wordField,cc(t,"by word")])].concat(_toConsumableArray(t.state.readOnly?[]:[pa("br"),this.replaceField,i("replace",function(){return ic(t);},[cc(t,"replace")]),i("replaceAll",function(){return sc(t);},[cc(t,"replace all")])]),[pa("button",{name:"close",onclick:function onclick(){return uc(t);},"aria-label":cc(t,"close"),type:"button"},["×"])]));}return _createClass(ac,[{key:"commit",value:function commit(){var t=new ja({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});t.eq(this.query)||(this.query=t,this.view.dispatch({effects:Ja.of(t)}));}},{key:"keydown",value:function keydown(t){var e,i,s;e=this.view,i=t,s="search-panel",dn(un(e.state),i,e,s)?t.preventDefault():13==t.keyCode&&t.target==this.searchField?(t.preventDefault(),(t.shiftKey?tc:Za)(this.view)):13==t.keyCode&&t.target==this.replaceField&&(t.preventDefault(),ic(this.view));}},{key:"update",value:function update(t){var _iterator204=_createForOfIteratorHelper(t.transactions),_step204;try{for(_iterator204.s();!(_step204=_iterator204.n()).done;){var _e244=_step204.value;var _iterator205=_createForOfIteratorHelper(_e244.effects),_step205;try{for(_iterator205.s();!(_step205=_iterator205.n()).done;){var _t272=_step205.value;_t272.is(Ja)&&!_t272.value.eq(this.query)&&this.setQuery(_t272.value);}}catch(err){_iterator205.e(err);}finally{_iterator205.f();}}}catch(err){_iterator204.e(err);}finally{_iterator204.f();}}},{key:"setQuery",value:function setQuery(t){this.query=t,this.searchField.value=t.search,this.replaceField.value=t.replace,this.caseField.checked=t.caseSensitive,this.reField.checked=t.regexp,this.wordField.checked=t.wholeWord;}},{key:"mount",value:function mount(){this.searchField.select();}},{key:"pos",get:function get(){return 80;}},{key:"top",get:function get(){return this.view.state.facet($a).top;}}]);}();dc=30,pc=/[\s\.,:;?!]/;gc=Qr.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),wc=[Ga,et.low(Ya),gc];bc=/*#__PURE__*/function(){function bc(t,e,i,s){_classCallCheck(this,bc);this.state=t,this.pos=e,this.explicit=i,this.view=s,this.abortListeners=[],this.abortOnDocChange=!1;}return _createClass(bc,[{key:"tokenBefore",value:function tokenBefore(t){var e=bo(this.state).resolveInner(this.pos,-1);for(;e&&t.indexOf(e.name)<0;)e=e.parent;return e?{from:e.from,to:this.pos,text:this.state.sliceDoc(e.from,this.pos),type:e.type}:null;}},{key:"matchBefore",value:function matchBefore(t){var e=this.state.doc.lineAt(this.pos),i=Math.max(e.from,this.pos-250),s=e.text.slice(i-e.from,this.pos-e.from),r=s.search(Sc(t,!1));return r<0?null:{from:i+r,to:this.pos,text:s.slice(r)};}},{key:"aborted",get:function get(){return null==this.abortListeners;}},{key:"addEventListener",value:function addEventListener(t,e,i){"abort"==t&&this.abortListeners&&(this.abortListeners.push(e),i&&i.onDocChange&&(this.abortOnDocChange=!0));}}]);}();Mc=/*#__PURE__*/_createClass(function Mc(t,e,i,s){_classCallCheck(this,Mc);this.completion=t,this.source=e,this.match=i,this.score=s;});Ac=mt.define();Cc=new WeakMap();Dc=bt.define(),Ec=bt.define();Ic=/*#__PURE__*/function(){function Ic(t){_classCallCheck(this,Ic);this.pattern=t,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(var _e246=0;_e246<t.length;){var _i207=A(t,_e246),_s190=O(_i207);this.chars.push(_i207);var _r155=t.slice(_e246,_e246+_s190),_n115=_r155.toUpperCase();this.folded.push(A(_n115==_r155?_r155.toLowerCase():_n115,0)),_e246+=_s190;}this.astral=t.length!=this.chars.length;}return _createClass(Ic,[{key:"ret",value:function ret(t,e){return this.score=t,this.matched=e,this;}},{key:"match",value:function match(t){if(0==this.pattern.length)return this.ret(-100,[]);if(t.length<this.pattern.length)return null;var e=this.chars,i=this.folded,s=this.any,r=this.precise,n=this.byWord;if(1==e.length){var _s191=A(t,0),_r156=O(_s191),_n116=_r156==t.length?0:-100;if(_s191==e[0]);else{if(_s191!=i[0])return null;_n116+=-200;}return this.ret(_n116,[0,_r156]);}var h=t.indexOf(this.pattern);if(0==h)return this.ret(t.length==this.pattern.length?0:-100,[0,this.pattern.length]);var l=e.length,o=0;if(h<0){for(var _r157=0,_n117=Math.min(t.length,200);_r157<_n117&&o<l;){var _n118=A(t,_r157);_n118!=e[o]&&_n118!=i[o]||(s[o++]=_r157),_r157+=O(_n118);}if(o<l)return null;}var u=0,f=0,a=!1,c=0,d=-1,p=-1,m=/[a-z]/.test(t),g=!0;for(var _s192=0,_o43=Math.min(t.length,200),_w3=0;_s192<_o43&&f<l;){var _o44=A(t,_s192);h<0&&(u<l&&_o44==e[u]&&(r[u++]=_s192),c<l&&(_o44==e[c]||_o44==i[c]?(0==c&&(d=_s192),p=_s192+1,c++):c=0));var _b2=void 0,_v2=_o44<255?_o44>=48&&_o44<=57||_o44>=97&&_o44<=122?2:_o44>=65&&_o44<=90?1:0:(_b2=C(_o44))!=_b2.toLowerCase()?1:_b2!=_b2.toUpperCase()?2:0;(!_s192||1==_v2&&m||0==_w3&&0!=_v2)&&(e[f]==_o44||i[f]==_o44&&(a=!0)?n[f++]=_s192:n.length&&(g=!1)),_w3=_v2,_s192+=O(_o44);}return f==l&&0==n[0]&&g?this.result((a?-200:0)-100,n,t):c==l&&0==d?this.ret(-200-t.length+(p==t.length?0:-100),[0,p]):h>-1?this.ret(-700-t.length,[h,h+this.pattern.length]):c==l?this.ret(-900-t.length,[d,p]):f==l?this.result((a?-200:0)-100-700+(g?0:-1100),n,t):2==e.length?null:this.result((s[0]?-700:0)-200-1100,s,t);}},{key:"result",value:function result(t,e,i){var s=[],r=0;var _iterator207=_createForOfIteratorHelper(e),_step207;try{for(_iterator207.s();!(_step207=_iterator207.n()).done;){var _t276=_step207.value;var _e247=_t276+(this.astral?O(A(i,_t276)):1);r&&s[r-1]==_t276?s[r-1]=_e247:(s[r++]=_t276,s[r++]=_e247);}}catch(err){_iterator207.e(err);}finally{_iterator207.f();}return this.ret(t-i.length,s);}}]);}();Rc=/*#__PURE__*/function(){function Rc(t){_classCallCheck(this,Rc);this.pattern=t,this.matched=[],this.score=0,this.folded=t.toLowerCase();}return _createClass(Rc,[{key:"match",value:function match(t){if(t.length<this.pattern.length)return null;var e=t.slice(0,this.pattern.length),i=e==this.pattern?0:e.toLowerCase()==this.folded?-200:null;return null==i?null:(this.matched=[0,e.length],this.score=i+(t.length==this.pattern.length?0:-100),this);}}]);}();Tc=F.define({combine:function combine(t){return Rt(t,{activateOnTyping:!0,activateOnCompletion:function activateOnCompletion(){return!1;},activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:function tooltipClass(){return"";},optionClass:function optionClass(){return"";},aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:Lc,filterStrict:!1,compareCompletions:function compareCompletions(t,e){return t.label.localeCompare(e.label);},interactionDelay:75,updateSyncTime:100},{defaultKeymap:function defaultKeymap(t,e){return t&&e;},closeOnBlur:function closeOnBlur(t,e){return t&&e;},icons:function icons(t,e){return t&&e;},tooltipClass:function tooltipClass(t,e){return function(i){return Bc(t(i),e(i));};},optionClass:function optionClass(t,e){return function(i){return Bc(t(i),e(i));};},addToOptions:function addToOptions(t,e){return t.concat(e);},filterStrict:function filterStrict(t,e){return t||e;}});}});$c=/*#__PURE__*/function(){function $c(t,e,i){var _this84=this;_classCallCheck(this,$c);this.view=t,this.stateField=e,this.applyCompletion=i,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:function read(){return _this84.measureInfo();},write:function write(t){return _this84.placeInfo(t);},key:this},this.space=null,this.currentClass="";var s=t.state.field(e),_s$open=s.open,r=_s$open.options,n=_s$open.selected,h=t.state.facet(Tc);this.optionContent=function(t){var e=t.addToOptions.slice();return t.icons&&e.push({render:function render(t){var _e$classList;var e=document.createElement("div");return e.classList.add("cm-completionIcon"),t.type&&(_e$classList=e.classList).add.apply(_e$classList,_toConsumableArray(t.type.split(/\s+/g).map(function(t){return"cm-completionIcon-"+t;}))),e.setAttribute("aria-hidden","true"),e;},position:20}),e.push({render:function render(t,e,i,s){var r=document.createElement("span");r.className="cm-completionLabel";var n=t.displayLabel||t.label,h=0;for(var _t279=0;_t279<s.length;){var _e248=s[_t279++],_i208=s[_t279++];_e248>h&&r.appendChild(document.createTextNode(n.slice(h,_e248)));var _l67=r.appendChild(document.createElement("span"));_l67.appendChild(document.createTextNode(n.slice(_e248,_i208))),_l67.className="cm-completionMatchedText",h=_i208;}return h<n.length&&r.appendChild(document.createTextNode(n.slice(h))),r;},position:50},{render:function render(t){if(!t.detail)return null;var e=document.createElement("span");return e.className="cm-completionDetail",e.textContent=t.detail,e;},position:80}),e.sort(function(t,e){return t.position-e.position;}).map(function(t){return t.render;});}(h),this.optionClass=h.optionClass,this.tooltipClass=h.tooltipClass,this.range=Nc(r.length,n,h.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(t.state),this.dom.addEventListener("mousedown",function(i){var s=t.state.field(e).open.options;for(var _e249,_r158=i.target;_r158&&_r158!=_this84.dom;_r158=_r158.parentNode)if("LI"==_r158.nodeName&&(_e249=/-(\d+)$/.exec(_r158.id))&&+_e249[1]<s.length)return _this84.applyCompletion(t,s[+_e249[1]]),void i.preventDefault();}),this.dom.addEventListener("focusout",function(e){var i=t.state.field(_this84.stateField,!1);i&&i.tooltip&&t.state.facet(Tc).closeOnBlur&&e.relatedTarget!=t.contentDOM&&t.dispatch({effects:Ec.of(null)});}),this.showOptions(r,s.id);}return _createClass($c,[{key:"mount",value:function mount(){this.updateSel();}},{key:"showOptions",value:function showOptions(t,e){var _this85=this;this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(t,e,this.range)),this.list.addEventListener("scroll",function(){_this85.info&&_this85.view.requestMeasure(_this85.placeInfoReq);});}},{key:"update",value:function update(t){var e;var i=t.state.field(this.stateField),s=t.startState.field(this.stateField);if(this.updateTooltipClass(t.state),i!=s){var _i$open=i.open,_r159=_i$open.options,_n119=_i$open.selected,_h85=_i$open.disabled;s.open&&s.open.options==_r159||(this.range=Nc(_r159.length,_n119,t.state.facet(Tc).maxRenderedOptions),this.showOptions(_r159,i.id)),this.updateSel(),_h85!=(null===(e=s.open)||void 0===e?void 0:e.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!_h85);}}},{key:"updateTooltipClass",value:function updateTooltipClass(t){var e=this.tooltipClass(t);if(e!=this.currentClass){var _iterator208=_createForOfIteratorHelper(this.currentClass.split(" ")),_step208;try{for(_iterator208.s();!(_step208=_iterator208.n()).done;){var _t280=_step208.value;_t280&&this.dom.classList.remove(_t280);}}catch(err){_iterator208.e(err);}finally{_iterator208.f();}var _iterator209=_createForOfIteratorHelper(e.split(" ")),_step209;try{for(_iterator209.s();!(_step209=_iterator209.n()).done;){var _t281=_step209.value;_t281&&this.dom.classList.add(_t281);}}catch(err){_iterator209.e(err);}finally{_iterator209.f();}this.currentClass=e;}}},{key:"positioned",value:function positioned(t){this.space=t,this.info&&this.view.requestMeasure(this.placeInfoReq);}},{key:"updateSel",value:function updateSel(){var _this86=this;var t=this.view.state.field(this.stateField),e=t.open;if((e.selected>-1&&e.selected<this.range.from||e.selected>=this.range.to)&&(this.range=Nc(e.options.length,e.selected,this.view.state.facet(Tc).maxRenderedOptions),this.showOptions(e.options,t.id)),this.updateSelectedOption(e.selected)){this.destroyInfo();var _i209=e.options[e.selected].completion,_s193=_i209.info;if(!_s193)return;var _r160="string"==typeof _s193?document.createTextNode(_s193):_s193(_i209);if(!_r160)return;"then"in _r160?_r160.then(function(e){e&&_this86.view.state.field(_this86.stateField,!1)==t&&_this86.addInfoPane(e,_i209);})["catch"](function(t){return _i(_this86.view.state,t,"completion info");}):this.addInfoPane(_r160,_i209);}}},{key:"addInfoPane",value:function addInfoPane(t,e){this.destroyInfo();var i=this.info=document.createElement("div");if(i.className="cm-tooltip cm-completionInfo",null!=t.nodeType)i.appendChild(t),this.infoDestroy=null;else{var _e250=t.dom,_s194=t.destroy;i.appendChild(_e250),this.infoDestroy=_s194||null;}this.dom.appendChild(i),this.view.requestMeasure(this.placeInfoReq);}},{key:"updateSelectedOption",value:function updateSelectedOption(t){var e=null;for(var _i210=this.list.firstChild,_s195=this.range.from;_i210;_i210=_i210.nextSibling,_s195++)"LI"==_i210.nodeName&&_i210.id?_s195==t?_i210.hasAttribute("aria-selected")||(_i210.setAttribute("aria-selected","true"),e=_i210):_i210.hasAttribute("aria-selected")&&_i210.removeAttribute("aria-selected"):_s195--;return e&&function(t,e){var i=t.getBoundingClientRect(),s=e.getBoundingClientRect(),r=i.height/t.offsetHeight;s.top<i.top?t.scrollTop-=(i.top-s.top)/r:s.bottom>i.bottom&&(t.scrollTop+=(s.bottom-i.bottom)/r);}(this.list,e),e;}},{key:"measureInfo",value:function measureInfo(){var t=this.dom.querySelector("[aria-selected]");if(!t||!this.info)return null;var e=this.dom.getBoundingClientRect(),i=this.info.getBoundingClientRect(),s=t.getBoundingClientRect(),r=this.space;if(!r){var _t282=this.dom.ownerDocument.defaultView||window;r={left:0,top:0,right:_t282.innerWidth,bottom:_t282.innerHeight};}return s.top>Math.min(r.bottom,e.bottom)-10||s.bottom<Math.max(r.top,e.top)+10?null:this.view.state.facet(Tc).positionInfo(this.view,e,s,i,r,this.dom);}},{key:"placeInfo",value:function placeInfo(t){this.info&&(t?(t.style&&(this.info.style.cssText=t.style),this.info.className="cm-tooltip cm-completionInfo "+(t["class"]||"")):this.info.style.cssText="top: -1e6px");}},{key:"createListBox",value:function createListBox(t,e,i){var s=document.createElement("ul");s.id=e,s.setAttribute("role","listbox"),s.setAttribute("aria-expanded","true"),s.setAttribute("aria-label",this.view.state.phrase("Completions"));var r=null;for(var _n120=i.from;_n120<i.to;_n120++){var _t$_n=t[_n120],_h86=_t$_n.completion,_l68=_t$_n.match,_o45=_h86.section;if(_o45){var _t283="string"==typeof _o45?_o45:_o45.name;if(_t283!=r&&(_n120>i.from||0==i.from))if(r=_t283,"string"!=typeof _o45&&_o45.header)s.appendChild(_o45.header(_o45));else{s.appendChild(document.createElement("completion-section")).textContent=_t283;}}var _u33=s.appendChild(document.createElement("li"));_u33.id=e+"-"+_n120,_u33.setAttribute("role","option");var _f25=this.optionClass(_h86);_f25&&(_u33.className=_f25);var _iterator210=_createForOfIteratorHelper(this.optionContent),_step210;try{for(_iterator210.s();!(_step210=_iterator210.n()).done;){var _t284=_step210.value;var _e251=_t284(_h86,this.view.state,this.view,_l68);_e251&&_u33.appendChild(_e251);}}catch(err){_iterator210.e(err);}finally{_iterator210.f();}}return i.from&&s.classList.add("cm-completionListIncompleteTop"),i.to<t.length&&s.classList.add("cm-completionListIncompleteBottom"),s;}},{key:"destroyInfo",value:function destroyInfo(){this.info&&(this.infoDestroy&&this.infoDestroy(),this.info.remove(),this.info=null);}},{key:"destroy",value:function destroy(){this.destroyInfo();}}]);}();Pc=/*#__PURE__*/function(){function Pc(t,e,i,s,r,n){_classCallCheck(this,Pc);this.options=t,this.attrs=e,this.tooltip=i,this.timestamp=s,this.selected=r,this.disabled=n;}return _createClass(Pc,[{key:"setSelected",value:function setSelected(t,e){return t==this.selected||t>=this.options.length?this:new Pc(this.options,Vc(e,t),this.tooltip,this.timestamp,t,this.disabled);}},{key:"map",value:function map(t){return new Pc(this.options,this.attrs,Object.assign(Object.assign({},this.tooltip),{pos:t.mapPos(this.tooltip.pos)}),this.timestamp,this.selected,this.disabled);}},{key:"setDisabled",value:function setDisabled(){return new Pc(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0);}}],[{key:"build",value:function build(t,e,i,s,r,n){if(s&&!n&&t.some(function(t){return t.isPending;}))return s.setDisabled();var h=function(t,e){var i=[],s=null,r=function r(t){i.push(t);var e=t.completion.section;if(e){s||(s=[]);var _t285="string"==typeof e?e:e.name;s.some(function(e){return e.name==_t285;})||s.push("string"==typeof e?{name:_t285}:e);}},n=e.facet(Tc);var _iterator211=_createForOfIteratorHelper(t),_step211;try{for(_iterator211.s();!(_step211=_iterator211.n()).done;){var _s196=_step211.value;if(_s196.hasResult()){var _t287=_s196.result.getMatch;if(!1===_s196.result.filter){var _iterator215=_createForOfIteratorHelper(_s196.result.options),_step215;try{for(_iterator215.s();!(_step215=_iterator215.n()).done;){var _e254=_step215.value;r(new Mc(_e254,_s196.source,_t287?_t287(_e254):[],1e9-i.length));}}catch(err){_iterator215.e(err);}finally{_iterator215.f();}}else{var _i213=void 0,_h87=e.sliceDoc(_s196.from,_s196.to),_l69=n.filterStrict?new Rc(_h87):new Ic(_h87);var _iterator216=_createForOfIteratorHelper(_s196.result.options),_step216;try{for(_iterator216.s();!(_step216=_iterator216.n()).done;){var _e255=_step216.value;if(_i213=_l69.match(_e255.label)){var _n121=_e255.displayLabel?_t287?_t287(_e255,_i213.matched):[]:_i213.matched;r(new Mc(_e255,_s196.source,_n121,_i213.score+(_e255.boost||0)));}}}catch(err){_iterator216.e(err);}finally{_iterator216.f();}}}}}catch(err){_iterator211.e(err);}finally{_iterator211.f();}if(s){var _t286=Object.create(null),_e252=0,_r161=function _r161(t,e){var i,s;return(null!==(i=t.rank)&&void 0!==i?i:1e9)-(null!==(s=e.rank)&&void 0!==s?s:1e9)||(t.name<e.name?-1:1);};var _iterator212=_createForOfIteratorHelper(s.sort(_r161)),_step212;try{for(_iterator212.s();!(_step212=_iterator212.n()).done;){var _i211=_step212.value;_e252-=1e5,_t286[_i211.name]=_e252;}}catch(err){_iterator212.e(err);}finally{_iterator212.f();}var _iterator213=_createForOfIteratorHelper(i),_step213;try{for(_iterator213.s();!(_step213=_iterator213.n()).done;){var _e253=_step213.value;var _i212=_e253.completion.section;_i212&&(_e253.score+=_t286["string"==typeof _i212?_i212:_i212.name]);}}catch(err){_iterator213.e(err);}finally{_iterator213.f();}}var h=[],l=null,o=n.compareCompletions;var _iterator214=_createForOfIteratorHelper(i.sort(function(t,e){return e.score-t.score||o(t.completion,e.completion);})),_step214;try{for(_iterator214.s();!(_step214=_iterator214.n()).done;){var _t288=_step214.value;var _e256=_t288.completion;!l||l.label!=_e256.label||l.detail!=_e256.detail||null!=l.type&&null!=_e256.type&&l.type!=_e256.type||l.apply!=_e256.apply||l.boost!=_e256.boost?h.push(_t288):zc(_t288.completion)>zc(l)&&(h[h.length-1]=_t288),l=_t288.completion;}}catch(err){_iterator214.e(err);}finally{_iterator214.f();}return h;}(t,e);if(!h.length)return s&&t.some(function(t){return t.isPending;})?s.setDisabled():null;var l=e.facet(Tc).selectOnOpen?0:-1;if(s&&s.selected!=l&&-1!=s.selected){var _t289=s.options[s.selected].completion;for(var _e257=0;_e257<h.length;_e257++)if(h[_e257].completion==_t289){l=_e257;break;}}return new Pc(h,Vc(i,l),{pos:t.reduce(function(t,e){return e.hasResult()?Math.min(t,e.from):t;},1e8),create:Qc,above:r.aboveCursor},s?s.timestamp:Date.now(),l,!1);}}]);}();Hc=/*#__PURE__*/function(){function Hc(t,e,i){_classCallCheck(this,Hc);this.active=t,this.id=e,this.open=i;}return _createClass(Hc,[{key:"update",value:function update(t){var _this87=this;var e=t.state,i=e.facet(Tc),s=(i.override||e.languageDataAt("autocomplete",xc(e)).map(Oc)).map(function(e){return(_this87.active.find(function(t){return t.source==e;})||new Uc(e,_this87.active.some(function(t){return 0!=t.state;})?1:0)).update(t,i);});s.length==this.active.length&&s.every(function(t,e){return t==_this87.active[e];})&&(s=this.active);var r=this.open,n=t.effects.some(function(t){return t.is(Kc);});r&&t.docChanged&&(r=r.map(t.changes)),t.selection||s.some(function(e){return e.hasResult()&&t.changes.touchesRange(e.from,e.to);})||!function(t,e){if(t==e)return!0;for(var _i214=0,_s197=0;;){for(;_i214<t.length&&!t[_i214].hasResult();)_i214++;for(;_s197<e.length&&!e[_s197].hasResult();)_s197++;var _r162=_i214==t.length,_n122=_s197==e.length;if(_r162||_n122)return _r162==_n122;if(t[_i214++].result!=e[_s197++].result)return!1;}}(s,this.active)||n?r=Pc.build(s,e,this.id,r,i,n):r&&r.disabled&&!s.some(function(t){return t.isPending;})&&(r=null),!r&&s.every(function(t){return!t.isPending;})&&s.some(function(t){return t.hasResult();})&&(s=s.map(function(t){return t.hasResult()?new Uc(t.source,0):t;}));var _iterator217=_createForOfIteratorHelper(t.effects),_step217;try{for(_iterator217.s();!(_step217=_iterator217.n()).done;){var _e258=_step217.value;_e258.is(_c)&&(r=r&&r.setSelected(_e258.value,this.id));}}catch(err){_iterator217.e(err);}finally{_iterator217.f();}return s==this.active&&r==this.open?this:new Hc(s,this.id,r);}},{key:"tooltip",get:function get(){return this.open?this.open.tooltip:null;}},{key:"attrs",get:function get(){return this.open?this.open.attrs:this.active.length?Wc:Fc;}}],[{key:"start",value:function start(){return new Hc(qc,"cm-ac-"+Math.floor(2e6*Math.random()).toString(36),null);}}]);}();Wc={"aria-autocomplete":"list"},Fc={};qc=[];Uc=/*#__PURE__*/function(){function Uc(t,e){var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!1;_classCallCheck(this,Uc);this.source=t,this.state=e,this.explicit=i;}return _createClass(Uc,[{key:"hasResult",value:function hasResult(){return!1;}},{key:"isPending",get:function get(){return 1==this.state;}},{key:"update",value:function update(t,e){var i=Jc(t,e),s=this;(8&i||16&i&&this.touches(t))&&(s=new Uc(s.source,0)),4&i&&0==s.state&&(s=new Uc(this.source,1)),s=s.updateFor(t,i);var _iterator218=_createForOfIteratorHelper(t.effects),_step218;try{for(_iterator218.s();!(_step218=_iterator218.n()).done;){var _e259=_step218.value;if(_e259.is(Dc))s=new Uc(s.source,1,_e259.value);else if(_e259.is(Ec))s=new Uc(s.source,0);else if(_e259.is(Kc)){var _iterator219=_createForOfIteratorHelper(_e259.value),_step219;try{for(_iterator219.s();!(_step219=_iterator219.n()).done;){var _t290=_step219.value;_t290.source==s.source&&(s=_t290);}}catch(err){_iterator219.e(err);}finally{_iterator219.f();}}}}catch(err){_iterator218.e(err);}finally{_iterator218.f();}return s;}},{key:"updateFor",value:function updateFor(t,e){return this.map(t.changes);}},{key:"map",value:function map(t){return this;}},{key:"touches",value:function touches(t){return t.changes.touchesRange(xc(t.state));}}]);}();Gc=/*#__PURE__*/function(_Uc){function Gc(t,e,i,s,r,n){var _this88;_classCallCheck(this,Gc);_this88=_callSuper(this,Gc,[t,3,e]),_this88.limit=i,_this88.result=s,_this88.from=r,_this88.to=n;return _this88;}_inherits(Gc,_Uc);return _createClass(Gc,[{key:"hasResult",value:function hasResult(){return!0;}},{key:"updateFor",value:function updateFor(t,e){var i;if(!(3&e))return this.map(t.changes);var s=this.result;s.map&&!t.changes.empty&&(s=s.map(s,t.changes));var r=t.changes.mapPos(this.from),n=t.changes.mapPos(this.to,1),h=xc(t.state);if(h>n||!s||2&e&&(xc(t.startState)==this.from||h<this.limit))return new Uc(this.source,4&e?1:0);var l=t.changes.mapPos(this.limit);return function(t,e,i,s){if(!t)return!1;var r=e.sliceDoc(i,s);return"function"==typeof t?t(r,i,s,e):Sc(t,!0).test(r);}(s.validFor,t.state,r,n)?new Gc(this.source,this.explicit,l,s,r,n):s.update&&(s=s.update(s,r,n,new bc(t.state,h,!1)))?new Gc(this.source,this.explicit,l,s,s.from,null!==(i=s.to)&&void 0!==i?i:xc(t.state)):new Uc(this.source,1,this.explicit);}},{key:"map",value:function map(t){if(t.empty)return this;return(this.result.map?this.result.map(this.result,t):this.result)?new Gc(this.source,this.explicit,t.mapPos(this.limit),this.result,t.mapPos(this.from),t.mapPos(this.to,1)):new Uc(this.source,0);}},{key:"touches",value:function touches(t){return t.changes.touchesRange(this.from,this.to);}}]);}(Uc);Kc=bt.define({map:function map(t,e){return t.map(function(t){return t.map(e);});}}),_c=bt.define(),Xc=_.define({create:function create(){return Hc.start();},update:function update(t,e){return t.update(e);},provide:function provide(t){return[hh.from(t,function(t){return t.tooltip;}),Qr.contentAttributes.from(t,function(t){return t.attrs;})];}});Qc=jc(Xc,Yc);_export("w",td=function td(t){var e=t.state.field(Xc,!1);return!(t.state.readOnly||!e||!e.open||e.open.selected<0||e.open.disabled||Date.now()-e.open.timestamp<t.state.facet(Tc).interactionDelay)&&Yc(t,e.open.options[e.open.selected]);}),ed=function ed(t){return!!t.state.field(Xc,!1)&&(t.dispatch({effects:Dc.of(!0)}),!0);},_export("y",id=function id(t){var e=t.state.field(Xc,!1);return!(!e||!e.active.some(function(t){return 0!=t.state;}))&&(t.dispatch({effects:Ec.of(null)}),!0);});sd=/*#__PURE__*/_createClass(function sd(t,e){_classCallCheck(this,sd);this.active=t,this.context=e,this.time=Date.now(),this.updates=[],this.done=void 0;});rd=Zi.fromClass(/*#__PURE__*/function(){function _class13(t){_classCallCheck(this,_class13);this.view=t,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;var _iterator220=_createForOfIteratorHelper(t.state.field(Xc).active),_step220;try{for(_iterator220.s();!(_step220=_iterator220.n()).done;){var _e260=_step220.value;_e260.isPending&&this.startQuery(_e260);}}catch(err){_iterator220.e(err);}finally{_iterator220.f();}}return _createClass(_class13,[{key:"update",value:function update(t){var _this89=this;var e=t.state.field(Xc),i=t.state.facet(Tc);if(!t.selectionSet&&!t.docChanged&&t.startState.field(Xc)==e)return;var s=t.transactions.some(function(t){var e=Jc(t,i);return 8&e||(t.selection||t.docChanged)&&!(3&e);});for(var _e261=0;_e261<this.running.length;_e261++){var _i216$updates;var _i216=this.running[_e261];if(s||_i216.context.abortOnDocChange&&t.docChanged||_i216.updates.length+t.transactions.length>50&&Date.now()-_i216.time>1e3){var _iterator221=_createForOfIteratorHelper(_i216.context.abortListeners),_step221;try{for(_iterator221.s();!(_step221=_iterator221.n()).done;){var _t291=_step221.value;try{_t291();}catch(t){_i(this.view.state,t);}}}catch(err){_iterator221.e(err);}finally{_iterator221.f();}_i216.context.abortListeners=null,this.running.splice(_e261--,1);}else(_i216$updates=_i216.updates).push.apply(_i216$updates,_toConsumableArray(t.transactions));}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),t.transactions.some(function(t){return t.effects.some(function(t){return t.is(Dc);});})&&(this.pendingStart=!0);var r=this.pendingStart?50:i.activateOnTypingDelay;if(this.debounceUpdate=e.active.some(function(t){return t.isPending&&!_this89.running.some(function(e){return e.active.source==t.source;});})?setTimeout(function(){return _this89.startUpdate();},r):-1,0!=this.composing){var _iterator222=_createForOfIteratorHelper(t.transactions),_step222;try{for(_iterator222.s();!(_step222=_iterator222.n()).done;){var _e262=_step222.value;_e262.isUserEvent("input.type")?this.composing=2:2==this.composing&&_e262.selection&&(this.composing=3);}}catch(err){_iterator222.e(err);}finally{_iterator222.f();}}}},{key:"startUpdate",value:function startUpdate(){var _this90=this;this.debounceUpdate=-1,this.pendingStart=!1;var t=this.view.state,e=t.field(Xc);var _iterator223=_createForOfIteratorHelper(e.active),_step223;try{var _loop18=function _loop18(){var t=_step223.value;t.isPending&&!_this90.running.some(function(e){return e.active.source==t.source;})&&_this90.startQuery(t);};for(_iterator223.s();!(_step223=_iterator223.n()).done;){_loop18();}}catch(err){_iterator223.e(err);}finally{_iterator223.f();}this.running.length&&e.open&&e.open.disabled&&(this.debounceAccept=setTimeout(function(){return _this90.accept();},this.view.state.facet(Tc).updateSyncTime));}},{key:"startQuery",value:function startQuery(t){var _this91=this;var e=this.view.state,i=xc(e),s=new bc(e,i,t.explicit,this.view),r=new sd(t,s);this.running.push(r),Promise.resolve(t.source(s)).then(function(t){r.context.aborted||(r.done=t||null,_this91.scheduleAccept());},function(t){_this91.view.dispatch({effects:Ec.of(null)}),_i(_this91.view.state,t);});}},{key:"scheduleAccept",value:function scheduleAccept(){var _this92=this;this.running.every(function(t){return void 0!==t.done;})?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(function(){return _this92.accept();},this.view.state.facet(Tc).updateSyncTime));}},{key:"accept",value:function accept(){var _this93=this;var t;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;var e=[],i=this.view.state.facet(Tc),s=this.view.state.field(Xc);var _loop19=function _loop19(_r164){var n=_this93.running[_r164];if(void 0===n.done){_r163=_r164;return 0;}// continue
|
|
5
|
+
if(_this93.running.splice(_r164--,1),n.done){var _s198=xc(n.updates.length?n.updates[0].startState:_this93.view.state),_r165=Math.min(_s198,n.done.from+(n.active.explicit?0:1)),_h88=new Gc(n.active.source,n.active.explicit,_r165,n.done,n.done.from,null!==(t=n.done.to)&&void 0!==t?t:_s198);var _iterator224=_createForOfIteratorHelper(n.updates),_step224;try{for(_iterator224.s();!(_step224=_iterator224.n()).done;){var _t292=_step224.value;_h88=_h88.update(_t292,i);}}catch(err){_iterator224.e(err);}finally{_iterator224.f();}if(_h88.hasResult()){e.push(_h88);_r163=_r164;return 0;// continue
|
|
6
|
+
}}var h=s.active.find(function(t){return t.source==n.active.source;});if(h&&h.isPending)if(null==n.done){var _t293=new Uc(n.active.source,0);var _iterator225=_createForOfIteratorHelper(n.updates),_step225;try{for(_iterator225.s();!(_step225=_iterator225.n()).done;){var _e263=_step225.value;_t293=_t293.update(_e263,i);}}catch(err){_iterator225.e(err);}finally{_iterator225.f();}_t293.isPending||e.push(_t293);}else _this93.startQuery(h);_r163=_r164;},_ret3;for(var _r163=0;_r163<this.running.length;_r163++){_ret3=_loop19(_r163);if(_ret3===0)continue;}(e.length||s.open&&s.open.disabled)&&this.view.dispatch({effects:Kc.of(e)});}}]);}(),{eventHandlers:{blur:function blur(t){var _this94=this;var e=this.view.state.field(Xc,!1);if(e&&e.tooltip&&this.view.state.facet(Tc).closeOnBlur){var _i217=e.open&&dh(this.view,e.open.tooltip);_i217&&_i217.dom.contains(t.relatedTarget)||setTimeout(function(){return _this94.view.dispatch({effects:Ec.of(null)});},10);}},compositionstart:function compositionstart(){this.composing=1;},compositionend:function compositionend(){var _this95=this;3==this.composing&&setTimeout(function(){return _this95.view.dispatch({effects:Dc.of(!1)});},20),this.composing=0;}}}),nd="object"==(typeof navigator==="undefined"?"undefined":_typeof(navigator))&&/Win/.test(navigator.platform),hd=et.highest(Qr.domEventHandlers({keydown:function keydown(t,e){var i=e.state.field(Xc,!1);if(!i||!i.open||i.open.disabled||i.open.selected<0||t.key.length>1||t.ctrlKey&&(!nd||!t.altKey)||t.metaKey)return!1;var s=i.open.options[i.open.selected],r=i.active.find(function(t){return t.source==s.source;}),n=s.completion.commitCharacters||r.result.commitCharacters;return n&&n.indexOf(t.key)>-1&&Yc(e,s),!1;}})),ld=Qr.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});od=/*#__PURE__*/_createClass(function od(t,e,i,s){_classCallCheck(this,od);this.field=t,this.line=e,this.from=i,this.to=s;});ud=/*#__PURE__*/function(){function ud(t,e,i){_classCallCheck(this,ud);this.field=t,this.from=e,this.to=i;}return _createClass(ud,[{key:"map",value:function map(t){var e=t.mapPos(this.from,-1,E.TrackDel),i=t.mapPos(this.to,1,E.TrackDel);return null==e||null==i?null:new ud(this.field,e,i);}}]);}();fd=/*#__PURE__*/function(){function fd(t,e){_classCallCheck(this,fd);this.lines=t,this.fieldPositions=e;}return _createClass(fd,[{key:"instantiate",value:function instantiate(t,e){var i=[],s=[e],r=t.doc.lineAt(e),n=/^\s*/.exec(r.text)[0];var _iterator226=_createForOfIteratorHelper(this.lines),_step226;try{for(_iterator226.s();!(_step226=_iterator226.n()).done;){var _r166=_step226.value;if(i.length){var _i218=n,_h89=/^\t*/.exec(_r166)[0].length;for(var _e264=0;_e264<_h89;_e264++)_i218+=t.facet(Io);s.push(e+_i218.length-_h89),_r166=_i218+_r166.slice(_h89);}i.push(_r166),e+=_r166.length+1;}}catch(err){_iterator226.e(err);}finally{_iterator226.f();}var h=this.fieldPositions.map(function(t){return new ud(t.field,s[t.line]+t.from,s[t.line]+t.to);});return{text:i,ranges:h};}}],[{key:"parse",value:function parse(t){var e,i=[],s=[],r=[];var _iterator227=_createForOfIteratorHelper(t.split(/\r\n?|\n/)),_step227;try{for(_iterator227.s();!(_step227=_iterator227.n()).done;){var _n123=_step227.value;for(;e=/[#$]\{(?:(\d+)(?::([^}]*))?|((?:\\[{}]|[^}])*))\}/.exec(_n123);){var _t294=e[1]?+e[1]:null,_h90=e[2]||e[3]||"",_l70=-1,_o46=_h90.replace(/\\[{}]/g,function(t){return t[1];});for(var _e265=0;_e265<i.length;_e265++)(null!=_t294?i[_e265].seq==_t294:_o46&&i[_e265].name==_o46)&&(_l70=_e265);if(_l70<0){var _e266=0;for(;_e266<i.length&&(null==_t294||null!=i[_e266].seq&&i[_e266].seq<_t294);)_e266++;i.splice(_e266,0,{seq:_t294,name:_o46}),_l70=_e266;var _iterator228=_createForOfIteratorHelper(r),_step228;try{for(_iterator228.s();!(_step228=_iterator228.n()).done;){var _t295=_step228.value;_t295.field>=_l70&&_t295.field++;}}catch(err){_iterator228.e(err);}finally{_iterator228.f();}}r.push(new od(_l70,s.length,e.index,e.index+_o46.length)),_n123=_n123.slice(0,e.index)+_h90+_n123.slice(e.index+e[0].length);}_n123=_n123.replace(/\\([{}])/g,function(t,e,i){var _iterator229=_createForOfIteratorHelper(r),_step229;try{for(_iterator229.s();!(_step229=_iterator229.n()).done;){var _t296=_step229.value;_t296.line==s.length&&_t296.from>i&&(_t296.from--,_t296.to--);}}catch(err){_iterator229.e(err);}finally{_iterator229.f();}return e;}),s.push(_n123);}}catch(err){_iterator227.e(err);}finally{_iterator227.f();}return new fd(s,r);}}]);}();ad=si.widget({widget:new(/*#__PURE__*/function(_ei9){function _class14(){_classCallCheck(this,_class14);return _callSuper(this,_class14,arguments);}_inherits(_class14,_ei9);return _createClass(_class14,[{key:"toDOM",value:function toDOM(){var t=document.createElement("span");return t.className="cm-snippetFieldPosition",t;}},{key:"ignoreEvent",value:function ignoreEvent(){return!1;}}]);}(ei))()}),cd=si.mark({"class":"cm-snippetField"});dd=/*#__PURE__*/function(){function dd(t,e){_classCallCheck(this,dd);this.ranges=t,this.active=e,this.deco=si.set(t.map(function(t){return(t.from==t.to?ad:cd).range(t.from,t.to);}));}return _createClass(dd,[{key:"map",value:function map(t){var e=[];var _iterator230=_createForOfIteratorHelper(this.ranges),_step230;try{for(_iterator230.s();!(_step230=_iterator230.n()).done;){var _i219=_step230.value;var _s199=_i219.map(t);if(!_s199)return null;e.push(_s199);}}catch(err){_iterator230.e(err);}finally{_iterator230.f();}return new dd(e,this.active);}},{key:"selectionInsideField",value:function selectionInsideField(t){var _this96=this;return t.ranges.every(function(t){return _this96.ranges.some(function(e){return e.field==_this96.active&&e.from<=t.from&&e.to>=t.to;});});}}]);}();pd=bt.define({map:function map(t,e){return t&&t.map(e);}}),md=bt.define(),gd=_.define({create:function create(){return null;},update:function update(t,e){var _iterator231=_createForOfIteratorHelper(e.effects),_step231;try{for(_iterator231.s();!(_step231=_iterator231.n()).done;){var _i220=_step231.value;if(_i220.is(pd))return _i220.value;if(_i220.is(md)&&t)return new dd(t.ranges,_i220.value);}}catch(err){_iterator231.e(err);}finally{_iterator231.f();}return t&&e.docChanged&&(t=t.map(e.changes)),t&&e.selection&&!t.selectionInsideField(e.selection)&&(t=null),t;},provide:function provide(t){return Qr.decorations.from(t,function(t){return t?t.deco:si.none;});}});kd=[{key:"Tab",run:vd(1),shift:vd(-1)},{key:"Escape",run:function run(_ref58){var t=_ref58.state,e=_ref58.dispatch;return!!t.field(gd,!1)&&(e(t.update({effects:pd.of(null)})),!0);}}],yd=F.define({combine:function combine(t){return t.length?t[0]:kd;}}),Md=et.highest(ln.compute([yd],function(t){return t.facet(yd);}));Sd=Qr.domEventHandlers({mousedown:function mousedown(t,e){var i,s=e.state.field(gd,!1);if(!s||null==(i=e.posAtCoords({x:t.clientX,y:t.clientY})))return!1;var r=s.ranges.find(function(t){return t.from<=i&&t.to>=i;});return!(!r||r.field==s.active)&&(e.dispatch({selection:wd(s.ranges,r.field),effects:pd.of(s.ranges.some(function(t){return t.field>r.field;})?new dd(s.ranges,r.field):null),scrollIntoView:!0}),!0);}}),Ad={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},Cd=bt.define({map:function map(t,e){var i=e.mapPos(t,-1,E.TrackAfter);return null==i?void 0:i;}}),Od=new(/*#__PURE__*/function(_Tt3){function _class15(){_classCallCheck(this,_class15);return _callSuper(this,_class15,arguments);}_inherits(_class15,_Tt3);return _createClass(_class15);}(Tt))();Od.startSide=1,Od.endSide=-1;Dd=_.define({create:function create(){return $t.empty;},update:function update(t,e){if(t=t.map(e.changes),e.selection){var _i222=e.state.doc.lineAt(e.selection.main.head);t=t.update({filter:function filter(t){return t>=_i222.from&&t<=_i222.to;}});}var _iterator232=_createForOfIteratorHelper(e.effects),_step232;try{for(_iterator232.s();!(_step232=_iterator232.n()).done;){var _i223=_step232.value;_i223.is(Cd)&&(t=t.update({add:[Od.range(_i223.value,_i223.value+1)]}));}}catch(err){_iterator232.e(err);}finally{_iterator232.f();}return t;}});Ed="()[]{}<>";Td="object"==(typeof navigator==="undefined"?"undefined":_typeof(navigator))&&/Android\b/.test(navigator.userAgent),Bd=Qr.inputHandler.of(function(t,e,i,s){if((Td?t.composing:t.compositionStarted)||t.state.readOnly)return!1;var r=t.state.selection.main;if(s.length>2||2==s.length&&1==O(A(s,0))||e!=r.from||i!=r.to)return!1;var n=function(t,e){var i=Rd(t,t.selection.main.head),s=i.brackets||Ad.brackets;var _iterator233=_createForOfIteratorHelper(s),_step233;try{for(_iterator233.s();!(_step233=_iterator233.n()).done;){var _r167=_step233.value;var _n124=Id(A(_r167,0));if(e==_r167)return _n124==_r167?Pd(t,_r167,s.indexOf(_r167+_r167+_r167)>-1,i):jd(t,_r167,_n124,i.before||Ad.before);if(e==_n124&&Nd(t,t.selection.main.from))return zd(t,_r167,_n124);}}catch(err){_iterator233.e(err);}finally{_iterator233.f();}return null;}(t.state,s);return!!n&&(t.dispatch(n),!0);}),Ld=[{key:"Backspace",run:function run(_ref59){var t=_ref59.state,e=_ref59.dispatch;if(t.readOnly)return!1;var i=Rd(t,t.selection.main.head).brackets||Ad.brackets,s=null,r=t.changeByRange(function(e){if(e.empty){var _s200=function(t,e){var i=t.sliceString(e-2,e);return O(A(i,0))==i.length?i:i.slice(1);}(t.doc,e.head);var _iterator234=_createForOfIteratorHelper(i),_step234;try{for(_iterator234.s();!(_step234=_iterator234.n()).done;){var _r168=_step234.value;if(_r168==_s200&&$d(t.doc,e.head)==Id(A(_r168,0)))return{changes:{from:e.head-_r168.length,to:e.head+_r168.length},range:P.cursor(e.head-_r168.length)};}}catch(err){_iterator234.e(err);}finally{_iterator234.f();}}return{range:s=e};});return s||e(t.update(r,{scrollIntoView:!0,userEvent:"delete.backward"})),!s;}}];Vd=[{key:"Ctrl-Space",run:ed},{mac:"Alt-`",run:ed},{key:"Escape",run:id},{key:"ArrowDown",run:Zc(!0)},{key:"ArrowUp",run:Zc(!1)},{key:"PageDown",run:Zc(!0,"page")},{key:"PageUp",run:Zc(!1,"page")},{key:"Enter",run:td}],qd=et.highest(ln.computeN([Tc],function(t){return t.facet(Tc).defaultKeymap?[Vd]:[];}));Ud=/*#__PURE__*/_createClass(function Ud(t,e,i){_classCallCheck(this,Ud);this.from=t,this.to=e,this.diagnostic=i;});Gd=/*#__PURE__*/function(){function Gd(t,e,i){_classCallCheck(this,Gd);this.diagnostics=t,this.panel=e,this.selected=i;}return _createClass(Gd,null,[{key:"init",value:function init(t,e,i){var s=t,r=i.facet(rp).markerFilter;r&&(s=r(s,i));var n=t.slice().sort(function(t,e){return t.from-e.from||t.to-e.to;}),h=new jt(),l=[],o=0;var _loop20=function _loop20(_t298){var e,s,r=_t298==n.length?null:n[_t298];if(!r&&!l.length){_t297=_t298;return 1;}// break
|
|
7
|
+
for(l.length?(e=o,s=l.reduce(function(t,e){return Math.min(t,e.to);},r&&r.from>e?r.from:1e8)):(e=r.from,s=r.to,l.push(r),_t298++);_t298<n.length;){var _i225=n[_t298];if(_i225.from!=e||!(_i225.to>_i225.from||_i225.to==e)){s=Math.min(_i225.from,s);break;}l.push(_i225),_t298++,s=Math.min(_i225.to,s);}var u=dp(l);if(l.some(function(t){return t.from==t.to||t.from==t.to-1&&i.doc.lineAt(t.from).to==t.from;}))h.add(e,e,si.widget({widget:new lp(u),diagnostics:l.slice()}));else{var _t299=l.reduce(function(t,e){return e.markClass?t+" "+e.markClass:t;},"");h.add(e,s,si.mark({"class":"cm-lintRange cm-lintRange-"+u+_t299,diagnostics:l.slice(),inclusiveEnd:l.some(function(t){return t.to>s;})}));}o=s;for(var _t300=0;_t300<l.length;_t300++)l[_t300].to<=o&&l.splice(_t300--,1);_t297=_t298;};for(var _t297=0;;){if(_loop20(_t297))break;}var u=h.finish();return new Gd(u,e,Kd(u));}}]);}();_d=bt.define(),Xd=bt.define(),Yd=bt.define(),Qd=_.define({create:function create(){return new Gd(si.none,null,null);},update:function update(t,e){if(e.docChanged&&t.diagnostics.size){var _i226=t.diagnostics.map(e.changes),_s202=null,_r170=t.panel;if(t.selected){var _r171=e.changes.mapPos(t.selected.from,1);_s202=Kd(_i226,t.selected.diagnostic,_r171)||Kd(_i226,null,_r171);}!_i226.size&&_r170&&e.state.facet(rp).autoPanel&&(_r170=null),t=new Gd(_i226,_r170,_s202);}var _iterator236=_createForOfIteratorHelper(e.effects),_step236;try{for(_iterator236.s();!(_step236=_iterator236.n()).done;){var _i227=_step236.value;if(_i227.is(_d)){var _s203=e.state.facet(rp).autoPanel?_i227.value.length?up.open:null:t.panel;t=Gd.init(_i227.value,_s203,e.state);}else _i227.is(Xd)?t=new Gd(t.diagnostics,_i227.value?up.open:null,t.selected):_i227.is(Yd)&&(t=new Gd(t.diagnostics,t.panel,_i227.value));}}catch(err){_iterator236.e(err);}finally{_iterator236.f();}return t;},provide:function provide(t){return[kh.from(t,function(t){return t.panel;}),Qr.decorations.from(t,function(t){return t.diagnostics;})];}}),Zd=si.mark({"class":"cm-lintRange cm-lintRange-active"});ip=function ip(t){var e=t.state.field(Qd,!1);return!(!e||!e.panel)&&(t.dispatch({effects:Xd.of(!1)}),!0);},sp=[{key:"Mod-Shift-m",run:function run(t){var e=t.state.field(Qd,!1);var i,s;e&&e.panel||t.dispatch({effects:(i=t.state,s=[Xd.of(!0)],i.field(Qd,!1)?s:s.concat(bt.appendConfig.of(pp)))});var r=gh(t,up.open);return r&&r.dom.querySelector(".cm-panel-lint ul").focus(),!0;},preventDefault:!0},{key:"F8",run:function run(t){var e=t.state.field(Qd,!1);if(!e)return!1;var i=t.state.selection.main,s=e.diagnostics.iter(i.to+1);return!(!s.value&&(s=e.diagnostics.iter(0),!s.value||s.from==i.from&&s.to==i.to))&&(t.dispatch({selection:{anchor:s.from,head:s.to},scrollIntoView:!0}),!0);}}],rp=F.define({combine:function combine(t){return Object.assign({sources:t.map(function(t){return t.source;}).filter(function(t){return null!=t;})},Rt(t.map(function(t){return t.config;}),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:function hideOn(){return null;}},{needsRefresh:function needsRefresh(t,e){return t?e?function(i){return t(i)||e(i);}:t:e;}}));}});lp=/*#__PURE__*/function(_ei10){function lp(t){var _this97;_classCallCheck(this,lp);_this97=_callSuper(this,lp),_this97.sev=t;return _this97;}_inherits(lp,_ei10);return _createClass(lp,[{key:"eq",value:function eq(t){return t.sev==this.sev;}},{key:"toDOM",value:function toDOM(){return pa("span",{"class":"cm-lintPoint cm-lintPoint-"+this.sev});}}]);}(ei);op=/*#__PURE__*/_createClass(function op(t,e){_classCallCheck(this,op);this.diagnostic=e,this.id="item_"+Math.floor(4294967295*Math.random()).toString(16),this.dom=hp(t,e,!0),this.dom.id=this.id,this.dom.setAttribute("role","option");});up=/*#__PURE__*/function(){function up(t){var _this98=this;_classCallCheck(this,up);this.view=t,this.items=[];this.list=pa("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:function onkeydown(e){if(27==e.keyCode)ip(_this98.view),_this98.view.focus();else if(38==e.keyCode||33==e.keyCode)_this98.moveSelection((_this98.selectedIndex-1+_this98.items.length)%_this98.items.length);else if(40==e.keyCode||34==e.keyCode)_this98.moveSelection((_this98.selectedIndex+1)%_this98.items.length);else if(36==e.keyCode)_this98.moveSelection(0);else if(35==e.keyCode)_this98.moveSelection(_this98.items.length-1);else if(13==e.keyCode)_this98.view.focus();else{if(!(e.keyCode>=65&&e.keyCode<=90&&_this98.selectedIndex>=0))return;{var _i229=_this98.items[_this98.selectedIndex].diagnostic,_s204=np(_i229.actions);for(var _r172=0;_r172<_s204.length;_r172++)if(_s204[_r172].toUpperCase().charCodeAt(0)==e.keyCode){var _e270=Kd(_this98.view.state.field(Qd).diagnostics,_i229);_e270&&_i229.actions[_r172].apply(t,_e270.from,_e270.to);}}}e.preventDefault();},onclick:function onclick(t){for(var _e271=0;_e271<_this98.items.length;_e271++)_this98.items[_e271].dom.contains(t.target)&&_this98.moveSelection(_e271);}}),this.dom=pa("div",{"class":"cm-panel-lint"},this.list,pa("button",{type:"button",name:"close","aria-label":this.view.state.phrase("close"),onclick:function onclick(){return ip(_this98.view);}},"×")),this.update();}return _createClass(up,[{key:"selectedIndex",get:function get(){var t=this.view.state.field(Qd).selected;if(!t)return-1;for(var _e272=0;_e272<this.items.length;_e272++)if(this.items[_e272].diagnostic==t.diagnostic)return _e272;return-1;}},{key:"update",value:function update(){var _this99=this;var _this$view$state$fiel=this.view.state.field(Qd),t=_this$view$state$fiel.diagnostics,e=_this$view$state$fiel.selected,i=0,s=!1,r=null,n=new Set();for(t.between(0,this.view.state.doc.length,function(t,h,_ref62){var l=_ref62.spec;var _iterator238=_createForOfIteratorHelper(l.diagnostics),_step238;try{for(_iterator238.s();!(_step238=_iterator238.n()).done;){var _t302=_step238.value;if(n.has(_t302))continue;n.add(_t302);var _h93=void 0,_l72=-1;for(var _e273=i;_e273<_this99.items.length;_e273++)if(_this99.items[_e273].diagnostic==_t302){_l72=_e273;break;}_l72<0?(_h93=new op(_this99.view,_t302),_this99.items.splice(i,0,_h93),s=!0):(_h93=_this99.items[_l72],_l72>i&&(_this99.items.splice(i,_l72-i),s=!0)),e&&_h93.diagnostic==e.diagnostic?_h93.dom.hasAttribute("aria-selected")||(_h93.dom.setAttribute("aria-selected","true"),r=_h93):_h93.dom.hasAttribute("aria-selected")&&_h93.dom.removeAttribute("aria-selected"),i++;}}catch(err){_iterator238.e(err);}finally{_iterator238.f();}});i<this.items.length&&!(1==this.items.length&&this.items[0].diagnostic.from<0);)s=!0,this.items.pop();0==this.items.length&&(this.items.push(new op(this.view,{from:-1,to:-1,severity:"info",message:this.view.state.phrase("No diagnostics")})),s=!0),r?(this.list.setAttribute("aria-activedescendant",r.id),this.view.requestMeasure({key:this,read:function read(){return{sel:r.dom.getBoundingClientRect(),panel:_this99.list.getBoundingClientRect()};},write:function write(_ref63){var t=_ref63.sel,e=_ref63.panel;var i=e.height/_this99.list.offsetHeight;t.top<e.top?_this99.list.scrollTop-=(e.top-t.top)/i:t.bottom>e.bottom&&(_this99.list.scrollTop+=(t.bottom-e.bottom)/i);}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),s&&this.sync();}},{key:"sync",value:function sync(){var t=this.list.firstChild;function e(){var e=t;t=e.nextSibling,e.remove();}var _iterator239=_createForOfIteratorHelper(this.items),_step239;try{for(_iterator239.s();!(_step239=_iterator239.n()).done;){var _i230=_step239.value;if(_i230.dom.parentNode==this.list){for(;t!=_i230.dom;)e();t=_i230.dom.nextSibling;}else this.list.insertBefore(_i230.dom,t);}}catch(err){_iterator239.e(err);}finally{_iterator239.f();}for(;t;)e();}},{key:"moveSelection",value:function moveSelection(t){if(this.selectedIndex<0)return;var e=Kd(this.view.state.field(Qd).diagnostics,this.items[t].diagnostic);e&&this.view.dispatch({selection:{anchor:e.from,head:e.to},scrollIntoView:!0,effects:Yd.of(e)});}}],[{key:"open",value:function open(t){return new up(t);}}]);}();ap=Qr.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:fp("#d11")},".cm-lintRange-warning":{backgroundImage:fp("orange")},".cm-lintRange-info":{backgroundImage:fp("#999")},".cm-lintRange-hint":{backgroundImage:fp("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}}});pp=[Qd,Qr.decorations.compute([Qd],function(t){var _t$field=t.field(Qd),e=_t$field.selected,i=_t$field.panel;return e&&i&&e.from!=e.to?si.set([Zd.range(e.from,e.to)]):si.none;}),ch(tp,{hideOn:function hideOn(t,e){var i=e.pos,s=e.end||i,r=t.state.facet(rp).hideOn(t,i,s);if(null!=r)return r;var n=t.startState.doc.lineAt(e.pos);return!(!t.effects.some(function(t){return t.is(_d);})&&!t.changes.touchesRange(n.from,Math.max(n.to,s)));}}),ap],mp=function mp(t){return void 0===t||t;},_export("B",gp=function gp(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var e=[];mp(t.defaultKeymap)&&e.push.apply(e,_toConsumableArray(da)),mp(t.closeBracketsKeymap)&&e.push.apply(e,Ld),mp(t.searchKeymap)&&e.push.apply(e,fc),mp(t.historyKeymap)&&e.push.apply(e,vf),mp(t.foldKeymap)&&e.push.apply(e,nu),mp(t.lintKeymap)&&e.push.apply(e,sp);var i=[];return mp(t.highlightActiveLineGutter)&&i.push(qh),mp(t.highlightSpecialChars)&&i.push(function(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return[jn.of(t),zn||(zn=Zi.fromClass(/*#__PURE__*/function(){function _class16(t){_classCallCheck(this,_class16);this.view=t,this.decorations=si.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(t.state.facet(jn)),this.decorations=this.decorator.createDeco(t);}return _createClass(_class16,[{key:"makeDecorator",value:function makeDecorator(t){var _this100=this;return new Tn({regexp:t.specialChars,decoration:function decoration(e,i,s){var r=i.state.doc,n=A(e[0],0);if(9==n){var _t304=r.lineAt(s),_e274=i.state.tabSize,_n125=Kt(_t304.text,_e274,s-_t304.from);return si.replace({widget:new Hn((_e274-_n125%_e274)*_this100.view.defaultCharacterWidth/_this100.view.scaleX)});}return _this100.decorationCache[n]||(_this100.decorationCache[n]=si.replace({widget:new Pn(t,n)}));},boundary:t.replaceTabs?void 0:/[^]/});}},{key:"update",value:function update(t){var e=t.state.facet(jn);t.startState.facet(jn)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(t.view)):this.decorations=this.decorator.updateDeco(t,this.decorations);}}]);}(),{decorations:function decorations(t){return t.decorations;}}))];}()),mp(t.history)&&i.push(function(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return[ef,tf.of(t),Qr.domEventHandlers({beforeinput:function beforeinput(t,e){var i="historyUndo"==t.inputType?rf:"historyRedo"==t.inputType?nf:null;return!!i&&(t.preventDefault(),i(e));}})];}()),mp(t.foldGutter)&&i.push(function(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var e=Object.assign(Object.assign({},cu),t),i=new du(e,!0),s=new du(e,!1),r=Zi.fromClass(/*#__PURE__*/function(){function _class17(t){_classCallCheck(this,_class17);this.from=t.viewport.from,this.markers=this.buildMarkers(t);}return _createClass(_class17,[{key:"update",value:function update(t){(t.docChanged||t.viewportChanged||t.startState.facet(Oo)!=t.state.facet(Oo)||t.startState.field(tu,!1)!=t.state.field(tu,!1)||bo(t.startState)!=bo(t.state)||e.foldingChanged(t))&&(this.markers=this.buildMarkers(t.view));}},{key:"buildMarkers",value:function buildMarkers(t){var e=new jt();var _iterator241=_createForOfIteratorHelper(t.viewportLineBlocks),_step241;try{for(_iterator241.s();!(_step241=_iterator241.n()).done;){var _r173=_step241.value;var _n126=eu(t.state,_r173.from,_r173.to)?s:_o(t.state,_r173.from,_r173.to)?i:null;_n126&&e.add(_r173.from,_r173.from,_n126);}}catch(err){_iterator241.e(err);}finally{_iterator241.f();}return e.finish();}}]);}()),n=e.domEventHandlers;return[r,Ch({"class":"cm-foldGutter",markers:function markers(t){var e;return(null===(e=t.plugin(r))||void 0===e?void 0:e.markers)||$t.empty;},initialSpacer:function initialSpacer(){return new du(e,!1);},domEventHandlers:Object.assign(Object.assign({},n),{click:function click(t,e,i){if(n.click&&n.click(t,e,i))return!0;var s=eu(t.state,e.from,e.to);if(s)return t.dispatch({effects:Qo.of(s)}),!0;var r=_o(t.state,e.from,e.to);return!!r&&(t.dispatch({effects:Yo.of(r)}),!0);}})}),ou()];}()),mp(t.drawSelection)&&i.push(function(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return[yn.of(t),xn,An,On,qi.of(!0)];}()),mp(t.dropCursor)&&i.push([En,In]),mp(t.allowMultipleSelections)&&i.push(It.allowMultipleSelections.of(!0)),mp(t.indentOnInput)&&i.push(It.transactionFilter.of(function(t){if(!t.docChanged||!t.isUserEvent("input.type")&&!t.isUserEvent("input.complete"))return t;var e=t.startState.languageDataAt("indentOnInput",t.startState.selection.main.head);if(!e.length)return t;var i=t.newDoc,s=t.newSelection.main.head,r=i.lineAt(s);if(s>r.from+200)return t;var n=i.sliceString(r.from,s);if(!e.some(function(t){return t.test(n);}))return t;var h=t.state,l=-1,o=[];var _iterator242=_createForOfIteratorHelper(h.selection.ranges),_step242;try{for(_iterator242.s();!(_step242=_iterator242.n()).done;){var _t305=_step242.value.head;var _e275=h.doc.lineAt(_t305);if(_e275.from==l)continue;l=_e275.from;var _i231=Bo(h,_e275.from);if(null==_i231)continue;var _s206=/^\s*/.exec(_e275.text)[0],_r174=To(h,_i231);_s206!=_r174&&o.push({from:_e275.from,to:_e275.from+_s206.length,insert:_r174});}}catch(err){_iterator242.e(err);}finally{_iterator242.f();}return o.length?[t,{changes:o,sequential:!0}]:t;})),mp(t.bracketMatching)&&i.push(function(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return[Au.of(t),Iu];}()),mp(t.closeBrackets)&&i.push([Bd,Dd]),mp(t.autocompletion)&&i.push(Fd()),mp(t.rectangularSelection)&&i.push(function(t){var e=(null==t?void 0:t.eventFilter)||function(t){return t.altKey&&0==t.button;};return Qr.mouseSelectionStyle.of(function(t,i){return e(i)?Gn(t,i):null;});}()),mp(t.crosshairCursor)&&i.push(function(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var _Kn=_slicedToArray(Kn[t.key||"Alt"],2),e=_Kn[0],i=_Kn[1],s=Zi.fromClass(/*#__PURE__*/function(){function _class18(t){_classCallCheck(this,_class18);this.view=t,this.isDown=!1;}return _createClass(_class18,[{key:"set",value:function set(t){this.isDown!=t&&(this.isDown=t,this.view.update([]));}}]);}(),{eventObservers:{keydown:function keydown(t){this.set(t.keyCode==e||i(t));},keyup:function keyup(t){t.keyCode!=e&&i(t)||this.set(!1);},mousemove:function mousemove(t){this.set(i(t));}}});return[s,Qr.contentAttributes.of(function(t){var e;return(null===(e=t.plugin(s))||void 0===e?void 0:e.isDown)?_n:null;})];}()),mp(t.highlightActiveLine)&&i.push(Fn),mp(t.highlightSelectionMatches)&&i.push(function(t){var e=[Na,La];return t&&e.push(Ia.of(t)),e;}()),t.enableSearch||i.push(ln.of([{key:"Mod-f",run:function run(){return!0;}}])),t.tabSize&&"number"==typeof t.tabSize&&i.push(Io.of(" ".repeat(t.tabSize))),i.concat([ln.of(e.flat())]).filter(Boolean);});}};});
|
|
8
8
|
//# sourceMappingURL=extensionSetup.cjs.js.map
|