@limetech/lime-elements 38.7.0 → 38.7.2
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/CHANGELOG.md +16 -0
- package/dist/cjs/{checkbox.template-f86d05d4.js → checkbox.template-60f3ffb2.js} +2 -2
- package/dist/cjs/{checkbox.template-f86d05d4.js.map → checkbox.template-60f3ffb2.js.map} +1 -1
- package/dist/cjs/{index-d1052409.js → index-174a078a.js} +387 -9
- package/dist/cjs/index-174a078a.js.map +1 -0
- package/dist/cjs/lime-elements.cjs.js +2 -2
- package/dist/cjs/limel-3d-hover-effect-glow.cjs.entry.js +1 -1
- package/dist/cjs/limel-action-bar-item_2.cjs.entry.js +2 -2
- package/dist/cjs/limel-action-bar_2.cjs.entry.js +2 -2
- package/dist/cjs/limel-action-bar_2.cjs.entry.js.map +1 -1
- package/dist/cjs/limel-badge_3.cjs.entry.js +1 -1
- package/dist/cjs/limel-banner.cjs.entry.js +1 -1
- package/dist/cjs/{limel-breadcrumbs_7.cjs.entry.js → limel-breadcrumbs_8.cjs.entry.js} +40 -22
- package/dist/cjs/limel-breadcrumbs_8.cjs.entry.js.map +1 -0
- package/dist/cjs/limel-button-group.cjs.entry.js +1 -1
- package/dist/cjs/limel-button.cjs.entry.js +2 -2
- package/dist/cjs/limel-callout.cjs.entry.js +1 -1
- package/dist/cjs/limel-card.cjs.entry.js +1 -1
- package/dist/cjs/limel-chart.cjs.entry.js +1 -1
- package/dist/cjs/limel-checkbox.cjs.entry.js +2 -2
- package/dist/cjs/limel-chip_2.cjs.entry.js +53 -56
- package/dist/cjs/limel-chip_2.cjs.entry.js.map +1 -1
- package/dist/cjs/limel-circular-progress.cjs.entry.js +1 -1
- package/dist/cjs/limel-code-editor.cjs.entry.js +1 -1
- package/dist/cjs/limel-collapsible-section.cjs.entry.js +2 -2
- package/dist/cjs/limel-color-picker-palette.cjs.entry.js +1 -1
- package/dist/cjs/limel-color-picker.cjs.entry.js +1 -1
- package/dist/cjs/limel-config.cjs.entry.js +1 -1
- package/dist/cjs/limel-date-picker.cjs.entry.js +1 -1
- package/dist/cjs/limel-dialog.cjs.entry.js +1 -1
- package/dist/cjs/limel-dock-button.cjs.entry.js +1 -1
- package/dist/cjs/limel-dock.cjs.entry.js +1 -1
- package/dist/cjs/limel-dynamic-label_2.cjs.entry.js +1 -1
- package/dist/cjs/limel-file-dropzone_2.cjs.entry.js +1 -1
- package/dist/cjs/limel-file-viewer.cjs.entry.js +1 -1
- package/dist/cjs/limel-file.cjs.entry.js +1 -1
- package/dist/cjs/limel-flatpickr-adapter.cjs.entry.js +1 -1
- package/dist/cjs/limel-flex-container.cjs.entry.js +1 -1
- package/dist/cjs/limel-form.cjs.entry.js +1 -1
- package/dist/cjs/limel-grid.cjs.entry.js +1 -1
- package/dist/cjs/limel-header.cjs.entry.js +1 -1
- package/dist/cjs/limel-help-content.cjs.entry.js +1 -1
- package/dist/cjs/limel-help.cjs.entry.js +1 -1
- package/dist/cjs/limel-icon-button.cjs.entry.js +2 -2
- package/dist/cjs/limel-icon.cjs.entry.js +1 -1
- package/dist/cjs/limel-info-tile.cjs.entry.js +1 -1
- package/dist/cjs/limel-linear-progress.cjs.entry.js +1 -1
- package/dist/cjs/limel-markdown.cjs.entry.js +1 -1
- package/dist/cjs/limel-picker.cjs.entry.js +1 -1
- package/dist/cjs/limel-popover_2.cjs.entry.js +1 -1
- package/dist/cjs/limel-portal.cjs.entry.js +1 -1
- package/dist/cjs/limel-progress-flow-item.cjs.entry.js +1 -1
- package/dist/cjs/limel-progress-flow.cjs.entry.js +1 -1
- package/dist/cjs/limel-prosemirror-adapter.cjs.entry.js +1 -1
- package/dist/cjs/limel-select.cjs.entry.js +11 -25
- package/dist/cjs/limel-select.cjs.entry.js.map +1 -1
- package/dist/cjs/limel-shortcut.cjs.entry.js +1 -1
- package/dist/cjs/limel-slider.cjs.entry.js +1 -1
- package/dist/cjs/limel-snackbar.cjs.entry.js +1 -1
- package/dist/cjs/limel-split-button.cjs.entry.js +1 -1
- package/dist/cjs/limel-switch.cjs.entry.js +2 -2
- package/dist/cjs/limel-tab-bar.cjs.entry.js +1 -1
- package/dist/cjs/limel-tab-panel.cjs.entry.js +1 -1
- package/dist/cjs/limel-table.cjs.entry.js +1 -1
- package/dist/cjs/limel-text-editor.cjs.entry.js +8 -27
- package/dist/cjs/limel-text-editor.cjs.entry.js.map +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{make-enter-clickable-c116ac4f.js → make-enter-clickable-71e4750b.js} +2 -2
- package/dist/cjs/{make-enter-clickable-c116ac4f.js.map → make-enter-clickable-71e4750b.js.map} +1 -1
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/action-bar/action-bar.js +1 -1
- package/dist/collection/components/action-bar/action-bar.js.map +1 -1
- package/dist/collection/components/chip-set/chip-set.css +28 -412
- package/dist/collection/components/chip-set/chip-set.js +51 -54
- package/dist/collection/components/chip-set/chip-set.js.map +1 -1
- package/dist/collection/components/input-field/input-field.css +9 -300
- package/dist/collection/components/input-field/input-field.js +1 -17
- package/dist/collection/components/input-field/input-field.js.map +1 -1
- package/dist/collection/components/notched-outline/notched-outline.css +297 -0
- package/dist/collection/components/notched-outline/notched-outline.js +221 -0
- package/dist/collection/components/notched-outline/notched-outline.js.map +1 -0
- package/dist/collection/components/select/select.css +5 -33
- package/dist/collection/components/select/select.template.js +8 -19
- package/dist/collection/components/select/select.template.js.map +1 -1
- package/dist/collection/components/text-editor/text-editor.css +5 -102
- package/dist/collection/components/text-editor/text-editor.js +7 -26
- package/dist/collection/components/text-editor/text-editor.js.map +1 -1
- package/dist/collection/style/internal/shared_input-select-picker.scss +8 -2
- package/dist/esm/{checkbox.template-c42b7020.js → checkbox.template-1fd53d7b.js} +2 -2
- package/dist/esm/{checkbox.template-c42b7020.js.map → checkbox.template-1fd53d7b.js.map} +1 -1
- package/dist/esm/{index-6156b4fd.js → index-2714248e.js} +387 -9
- package/dist/esm/index-2714248e.js.map +1 -0
- package/dist/esm/lime-elements.js +3 -3
- package/dist/esm/limel-3d-hover-effect-glow.entry.js +1 -1
- package/dist/esm/limel-action-bar-item_2.entry.js +2 -2
- package/dist/esm/limel-action-bar_2.entry.js +2 -2
- package/dist/esm/limel-action-bar_2.entry.js.map +1 -1
- package/dist/esm/limel-badge_3.entry.js +1 -1
- package/dist/esm/limel-banner.entry.js +1 -1
- package/dist/esm/{limel-breadcrumbs_7.entry.js → limel-breadcrumbs_8.entry.js} +40 -23
- package/dist/esm/limel-breadcrumbs_8.entry.js.map +1 -0
- package/dist/esm/limel-button-group.entry.js +1 -1
- package/dist/esm/limel-button.entry.js +2 -2
- package/dist/esm/limel-callout.entry.js +1 -1
- package/dist/esm/limel-card.entry.js +1 -1
- package/dist/esm/limel-chart.entry.js +1 -1
- package/dist/esm/limel-checkbox.entry.js +2 -2
- package/dist/esm/limel-chip_2.entry.js +53 -56
- package/dist/esm/limel-chip_2.entry.js.map +1 -1
- package/dist/esm/limel-circular-progress.entry.js +1 -1
- package/dist/esm/limel-code-editor.entry.js +1 -1
- package/dist/esm/limel-collapsible-section.entry.js +2 -2
- package/dist/esm/limel-color-picker-palette.entry.js +1 -1
- package/dist/esm/limel-color-picker.entry.js +1 -1
- package/dist/esm/limel-config.entry.js +1 -1
- package/dist/esm/limel-date-picker.entry.js +1 -1
- package/dist/esm/limel-dialog.entry.js +1 -1
- package/dist/esm/limel-dock-button.entry.js +1 -1
- package/dist/esm/limel-dock.entry.js +1 -1
- package/dist/esm/limel-dynamic-label_2.entry.js +1 -1
- package/dist/esm/limel-file-dropzone_2.entry.js +1 -1
- package/dist/esm/limel-file-viewer.entry.js +1 -1
- package/dist/esm/limel-file.entry.js +1 -1
- package/dist/esm/limel-flatpickr-adapter.entry.js +1 -1
- package/dist/esm/limel-flex-container.entry.js +1 -1
- package/dist/esm/limel-form.entry.js +1 -1
- package/dist/esm/limel-grid.entry.js +1 -1
- package/dist/esm/limel-header.entry.js +1 -1
- package/dist/esm/limel-help-content.entry.js +1 -1
- package/dist/esm/limel-help.entry.js +1 -1
- package/dist/esm/limel-icon-button.entry.js +2 -2
- package/dist/esm/limel-icon.entry.js +1 -1
- package/dist/esm/limel-info-tile.entry.js +1 -1
- package/dist/esm/limel-linear-progress.entry.js +1 -1
- package/dist/esm/limel-markdown.entry.js +1 -1
- package/dist/esm/limel-picker.entry.js +1 -1
- package/dist/esm/limel-popover_2.entry.js +1 -1
- package/dist/esm/limel-portal.entry.js +1 -1
- package/dist/esm/limel-progress-flow-item.entry.js +1 -1
- package/dist/esm/limel-progress-flow.entry.js +1 -1
- package/dist/esm/limel-prosemirror-adapter.entry.js +1 -1
- package/dist/esm/limel-select.entry.js +11 -25
- package/dist/esm/limel-select.entry.js.map +1 -1
- package/dist/esm/limel-shortcut.entry.js +1 -1
- package/dist/esm/limel-slider.entry.js +1 -1
- package/dist/esm/limel-snackbar.entry.js +1 -1
- package/dist/esm/limel-split-button.entry.js +1 -1
- package/dist/esm/limel-switch.entry.js +2 -2
- package/dist/esm/limel-tab-bar.entry.js +1 -1
- package/dist/esm/limel-tab-panel.entry.js +1 -1
- package/dist/esm/limel-table.entry.js +1 -1
- package/dist/esm/limel-text-editor.entry.js +8 -27
- package/dist/esm/limel-text-editor.entry.js.map +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{make-enter-clickable-a30589fb.js → make-enter-clickable-5334fc26.js} +2 -2
- package/dist/esm/{make-enter-clickable-a30589fb.js.map → make-enter-clickable-5334fc26.js.map} +1 -1
- package/dist/lime-elements/lime-elements.esm.js +1 -1
- package/dist/lime-elements/lime-elements.esm.js.map +1 -1
- package/dist/lime-elements/{p-fda881a3.entry.js → p-02197b98.entry.js} +2 -2
- package/dist/lime-elements/{p-f95a5cb5.entry.js → p-0960ca61.entry.js} +2 -2
- package/dist/lime-elements/{p-fd0ea2e9.entry.js → p-0aa2f9c0.entry.js} +2 -2
- package/dist/lime-elements/{p-85ffcf55.entry.js → p-10d1256b.entry.js} +2 -2
- package/dist/lime-elements/{p-2b294a69.entry.js → p-1942e25c.entry.js} +2 -2
- package/dist/lime-elements/{p-d93f1964.entry.js → p-19688e05.entry.js} +2 -2
- package/dist/lime-elements/{p-c923b97d.entry.js → p-1f142e39.entry.js} +2 -2
- package/dist/lime-elements/{p-4f70c0aa.entry.js → p-254c9b18.entry.js} +2 -2
- package/dist/lime-elements/{p-3a605df3.entry.js → p-26e06ef4.entry.js} +2 -2
- package/dist/lime-elements/p-288f0842.js +3 -0
- package/dist/lime-elements/p-288f0842.js.map +1 -0
- package/dist/lime-elements/{p-8f1b76df.entry.js → p-28a6fec9.entry.js} +2 -2
- package/dist/lime-elements/{p-e329fd1e.entry.js → p-28e5fef5.entry.js} +2 -2
- package/dist/lime-elements/{p-211456f2.entry.js → p-2c7e5deb.entry.js} +2 -2
- package/dist/lime-elements/{p-28c76ae8.entry.js → p-30cef284.entry.js} +2 -2
- package/dist/lime-elements/{p-7db872fd.entry.js → p-3cd846eb.entry.js} +2 -2
- package/dist/lime-elements/p-3cd846eb.entry.js.map +1 -0
- package/dist/lime-elements/p-447e573c.entry.js +2 -0
- package/dist/lime-elements/p-447e573c.entry.js.map +1 -0
- package/dist/lime-elements/{p-e86af8b6.js → p-46cbc6d9.js} +2 -2
- package/dist/lime-elements/{p-f340d860.entry.js → p-48e9f4ea.entry.js} +2 -2
- package/dist/lime-elements/{p-36cf3031.entry.js → p-49432af9.entry.js} +2 -2
- package/dist/lime-elements/{p-89eaca66.entry.js → p-4eae90f7.entry.js} +2 -2
- package/dist/lime-elements/{p-ea98795d.entry.js → p-4ed15eb7.entry.js} +2 -2
- package/dist/lime-elements/{p-0aeff0b6.entry.js → p-54ff8dcb.entry.js} +2 -2
- package/dist/lime-elements/{p-3d6dc7de.entry.js → p-56de9524.entry.js} +2 -2
- package/dist/lime-elements/{p-02564969.entry.js → p-58acbdcc.entry.js} +2 -2
- package/dist/lime-elements/{p-dc6846e1.entry.js → p-5e325fee.entry.js} +2 -2
- package/dist/lime-elements/{p-16e4ca3e.entry.js → p-5e68e5f7.entry.js} +2 -2
- package/dist/lime-elements/{p-c632261b.entry.js → p-5f39d366.entry.js} +2 -2
- package/dist/lime-elements/{p-a2eee29e.entry.js → p-5fd7abb8.entry.js} +2 -2
- package/dist/lime-elements/{p-06b5aa10.entry.js → p-61766ba1.entry.js} +2 -2
- package/dist/lime-elements/{p-b5f723e2.entry.js → p-69b6119b.entry.js} +2 -2
- package/dist/lime-elements/{p-1bcdc70b.entry.js → p-6c2fdad7.entry.js} +2 -2
- package/dist/lime-elements/{p-5d08ef7d.entry.js → p-74a15b9e.entry.js} +2 -2
- package/dist/lime-elements/{p-f3cbbaf5.entry.js → p-76b845b0.entry.js} +2 -2
- package/dist/lime-elements/p-7993102f.entry.js +68 -0
- package/dist/lime-elements/p-7993102f.entry.js.map +1 -0
- package/dist/lime-elements/{p-40016256.entry.js → p-818f71b8.entry.js} +2 -2
- package/dist/lime-elements/{p-8baf79cf.entry.js → p-82290560.entry.js} +2 -2
- package/dist/lime-elements/{p-3c5a0769.entry.js → p-874e3af6.entry.js} +2 -2
- package/dist/lime-elements/{p-8579a166.entry.js → p-8b61a573.entry.js} +2 -2
- package/dist/lime-elements/{p-d6660d2a.entry.js → p-93d5ebeb.entry.js} +2 -2
- package/dist/lime-elements/{p-54ac08f5.entry.js → p-9cec73a7.entry.js} +2 -2
- package/dist/lime-elements/{p-8f6f643d.entry.js → p-a809b9a8.entry.js} +2 -2
- package/dist/lime-elements/{p-66501d69.entry.js → p-aabeba98.entry.js} +2 -2
- package/dist/lime-elements/p-ad568d69.entry.js +2 -0
- package/dist/lime-elements/p-ad568d69.entry.js.map +1 -0
- package/dist/lime-elements/{p-0863261f.entry.js → p-bab6b677.entry.js} +2 -2
- package/dist/lime-elements/{p-fa8ea2db.entry.js → p-bd278c51.entry.js} +2 -2
- package/dist/lime-elements/{p-8e7788a1.entry.js → p-c30e11ce.entry.js} +2 -2
- package/dist/lime-elements/{p-6500050d.entry.js → p-d05ebeb1.entry.js} +2 -2
- package/dist/lime-elements/{p-1c5f50f0.entry.js → p-d532cab0.entry.js} +2 -2
- package/dist/lime-elements/{p-ad3f6808.entry.js → p-d814fd97.entry.js} +2 -2
- package/dist/lime-elements/{p-9c5f2c45.entry.js → p-da37b2af.entry.js} +2 -2
- package/dist/lime-elements/{p-dbcde7db.entry.js → p-dcacda04.entry.js} +2 -2
- package/dist/lime-elements/{p-2078a6e2.entry.js → p-e655e6a1.entry.js} +2 -2
- package/dist/lime-elements/{p-26623b2d.entry.js → p-e9015886.entry.js} +2 -2
- package/dist/lime-elements/{p-1c16aa9b.entry.js → p-e9d11321.entry.js} +2 -2
- package/dist/lime-elements/{p-869d6d77.js → p-f221011c.js} +2 -2
- package/dist/lime-elements/{p-53404aa6.entry.js → p-f6aad3ee.entry.js} +9 -9
- package/dist/lime-elements/p-f6aad3ee.entry.js.map +1 -0
- package/dist/lime-elements/{p-ece3a0f5.entry.js → p-fc078f90.entry.js} +2 -2
- package/dist/lime-elements/{p-2793f6d0.entry.js → p-fe5fd06b.entry.js} +2 -2
- package/dist/lime-elements/style/internal/shared_input-select-picker.scss +8 -2
- package/dist/types/components/chip-set/chip-set.d.ts +4 -4
- package/dist/types/components/input-field/input-field.d.ts +0 -2
- package/dist/types/components/notched-outline/notched-outline.d.ts +75 -0
- package/dist/types/components/text-editor/text-editor.d.ts +1 -2
- package/dist/types/components.d.ts +145 -0
- package/package.json +1 -1
- package/dist/cjs/index-d1052409.js.map +0 -1
- package/dist/cjs/limel-breadcrumbs_7.cjs.entry.js.map +0 -1
- package/dist/esm/index-6156b4fd.js.map +0 -1
- package/dist/esm/limel-breadcrumbs_7.entry.js.map +0 -1
- package/dist/lime-elements/p-443111b3.js +0 -3
- package/dist/lime-elements/p-443111b3.js.map +0 -1
- package/dist/lime-elements/p-53404aa6.entry.js.map +0 -1
- package/dist/lime-elements/p-62a21e92.entry.js +0 -2
- package/dist/lime-elements/p-62a21e92.entry.js.map +0 -1
- package/dist/lime-elements/p-7db872fd.entry.js.map +0 -1
- package/dist/lime-elements/p-8900110f.entry.js +0 -2
- package/dist/lime-elements/p-8900110f.entry.js.map +0 -1
- package/dist/lime-elements/p-d05a7803.entry.js +0 -68
- package/dist/lime-elements/p-d05a7803.entry.js.map +0 -1
- /package/dist/lime-elements/{p-fda881a3.entry.js.map → p-02197b98.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-f95a5cb5.entry.js.map → p-0960ca61.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-fd0ea2e9.entry.js.map → p-0aa2f9c0.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-85ffcf55.entry.js.map → p-10d1256b.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-2b294a69.entry.js.map → p-1942e25c.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-d93f1964.entry.js.map → p-19688e05.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-c923b97d.entry.js.map → p-1f142e39.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-4f70c0aa.entry.js.map → p-254c9b18.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-3a605df3.entry.js.map → p-26e06ef4.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-8f1b76df.entry.js.map → p-28a6fec9.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-e329fd1e.entry.js.map → p-28e5fef5.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-211456f2.entry.js.map → p-2c7e5deb.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-28c76ae8.entry.js.map → p-30cef284.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-e86af8b6.js.map → p-46cbc6d9.js.map} +0 -0
- /package/dist/lime-elements/{p-f340d860.entry.js.map → p-48e9f4ea.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-36cf3031.entry.js.map → p-49432af9.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-89eaca66.entry.js.map → p-4eae90f7.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-ea98795d.entry.js.map → p-4ed15eb7.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-0aeff0b6.entry.js.map → p-54ff8dcb.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-3d6dc7de.entry.js.map → p-56de9524.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-02564969.entry.js.map → p-58acbdcc.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-dc6846e1.entry.js.map → p-5e325fee.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-16e4ca3e.entry.js.map → p-5e68e5f7.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-c632261b.entry.js.map → p-5f39d366.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-a2eee29e.entry.js.map → p-5fd7abb8.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-06b5aa10.entry.js.map → p-61766ba1.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-b5f723e2.entry.js.map → p-69b6119b.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-1bcdc70b.entry.js.map → p-6c2fdad7.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-5d08ef7d.entry.js.map → p-74a15b9e.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-f3cbbaf5.entry.js.map → p-76b845b0.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-40016256.entry.js.map → p-818f71b8.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-8baf79cf.entry.js.map → p-82290560.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-3c5a0769.entry.js.map → p-874e3af6.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-8579a166.entry.js.map → p-8b61a573.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-d6660d2a.entry.js.map → p-93d5ebeb.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-54ac08f5.entry.js.map → p-9cec73a7.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-8f6f643d.entry.js.map → p-a809b9a8.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-66501d69.entry.js.map → p-aabeba98.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-0863261f.entry.js.map → p-bab6b677.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-fa8ea2db.entry.js.map → p-bd278c51.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-8e7788a1.entry.js.map → p-c30e11ce.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-6500050d.entry.js.map → p-d05ebeb1.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-1c5f50f0.entry.js.map → p-d532cab0.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-ad3f6808.entry.js.map → p-d814fd97.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-9c5f2c45.entry.js.map → p-da37b2af.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-dbcde7db.entry.js.map → p-dcacda04.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-2078a6e2.entry.js.map → p-e655e6a1.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-26623b2d.entry.js.map → p-e9015886.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-1c16aa9b.entry.js.map → p-e9d11321.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-869d6d77.js.map → p-f221011c.js.map} +0 -0
- /package/dist/lime-elements/{p-ece3a0f5.entry.js.map → p-fc078f90.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-2793f6d0.entry.js.map → p-fe5fd06b.entry.js.map} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r,c as t,h as e,g as i}from"./p-443111b3.js";import{c as n,a as o}from"./p-eab67c09.js";var f=n((function(r,t){(function(t,e){r.exports=e()})(o,(function(){var r=navigator.userAgent;var t=navigator.platform;var e=/gecko\/\d/i.test(r);var i=/MSIE \d/.test(r);var n=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(r);var o=/Edge\/(\d+)/.exec(r);var f=i||n||o;var u=f&&(i?document.documentMode||6:+(o||n)[1]);var a=!o&&/WebKit\//.test(r);var l=a&&/Qt\/\d+\.\d+/.test(r);var s=!o&&/Chrome\/(\d+)/.exec(r);var c=s&&+s[1];var v=/Opera\//.test(r);var h=/Apple Computer/.test(navigator.vendor);var d=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(r);var m=/PhantomJS/.test(r);var p=h&&(/Mobile\/\w+/.test(r)||navigator.maxTouchPoints>2);var g=/Android/.test(r);var b=p||g||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(r);var w=p||/Mac/.test(t);var k=/\bCrOS\b/.test(r);var C=/win/i.test(t);var M=v&&r.match(/Version\/(\d*\.\d*)/);if(M){M=Number(M[1])}if(M&&M>=15){v=false;a=true}var A=w&&(l||v&&(M==null||M<12.11));var y=e||f&&u>=9;function x(r){return new RegExp("(^|\\s)"+r+"(?:$|\\s)\\s*")}var L=function(r,t){var e=r.className;var i=x(t).exec(e);if(i){var n=e.slice(i.index+i[0].length);r.className=e.slice(0,i.index)+(n?i[1]+n:"")}};function S(r){for(var t=r.childNodes.length;t>0;--t){r.removeChild(r.firstChild)}return r}function N(r,t){return S(r).appendChild(t)}function E(r,t,e,i){var n=document.createElement(r);if(e){n.className=e}if(i){n.style.cssText=i}if(typeof t=="string"){n.appendChild(document.createTextNode(t))}else if(t){for(var o=0;o<t.length;++o){n.appendChild(t[o])}}return n}function D(r,t,e,i){var n=E(r,t,e,i);n.setAttribute("role","presentation");return n}var T;if(document.createRange){T=function(r,t,e,i){var n=document.createRange();n.setEnd(i||r,e);n.setStart(r,t);return n}}else{T=function(r,t,e){var i=document.body.createTextRange();try{i.moveToElementText(r.parentNode)}catch(r){return i}i.collapse(true);i.moveEnd("character",e);i.moveStart("character",t);return i}}function I(r,t){if(t.nodeType==3){t=t.parentNode}if(r.contains){return r.contains(t)}do{if(t.nodeType==11){t=t.host}if(t==r){return true}}while(t=t.parentNode)}function R(r){var t;try{t=r.activeElement}catch(e){t=r.body||null}while(t&&t.shadowRoot&&t.shadowRoot.activeElement){t=t.shadowRoot.activeElement}return t}function O(r,t){var e=r.className;if(!x(t).test(e)){r.className+=(e?" ":"")+t}}function B(r,t){var e=r.split(" ");for(var i=0;i<e.length;i++){if(e[i]&&!x(e[i]).test(t)){t+=" "+e[i]}}return t}var U=function(r){r.select()};if(p){U=function(r){r.selectionStart=0;r.selectionEnd=r.value.length}}else if(f){U=function(r){try{r.select()}catch(r){}}}function z(r){return r.display.wrapper.ownerDocument}function j(r){return z(r).defaultView}function W(r){var t=Array.prototype.slice.call(arguments,1);return function(){return r.apply(null,t)}}function F(r,t,e){if(!t){t={}}for(var i in r){if(r.hasOwnProperty(i)&&(e!==false||!t.hasOwnProperty(i))){t[i]=r[i]}}return t}function P(r,t,e,i,n){if(t==null){t=r.search(/[^\s\u00a0]/);if(t==-1){t=r.length}}for(var o=i||0,f=n||0;;){var u=r.indexOf("\t",o);if(u<0||u>=t){return f+(t-o)}f+=u-o;f+=e-f%e;o=u+1}}var G=function(){this.id=null;this.f=null;this.time=0;this.handler=W(this.onTimeout,this)};G.prototype.onTimeout=function(r){r.id=0;if(r.time<=+new Date){r.f()}else{setTimeout(r.handler,r.time-+new Date)}};G.prototype.set=function(r,t){this.f=t;var e=+new Date+r;if(!this.id||e<this.time){clearTimeout(this.id);this.id=setTimeout(this.handler,r);this.time=e}};function _(r,t){for(var e=0;e<r.length;++e){if(r[e]==t){return e}}return-1}var H=50;var V={toString:function(){return"CodeMirror.Pass"}};var $={scroll:false},Q={origin:"*mouse"},J={origin:"+move"};function K(r,t,e){for(var i=0,n=0;;){var o=r.indexOf("\t",i);if(o==-1){o=r.length}var f=o-i;if(o==r.length||n+f>=t){return i+Math.min(f,t-n)}n+=o-i;n+=e-n%e;i=o+1;if(n>=t){return i}}}var q=[""];function Y(r){while(q.length<=r){q.push(X(q)+" ")}return q[r]}function X(r){return r[r.length-1]}function Z(r,t){var e=[];for(var i=0;i<r.length;i++){e[i]=t(r[i],i)}return e}function rr(r,t,e){var i=0,n=e(t);while(i<r.length&&e(r[i])<=n){i++}r.splice(i,0,t)}function tr(){}function er(r,t){var e;if(Object.create){e=Object.create(r)}else{tr.prototype=r;e=new tr}if(t){F(t,e)}return e}var ir=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function nr(r){return/\w/.test(r)||r>""&&(r.toUpperCase()!=r.toLowerCase()||ir.test(r))}function or(r,t){if(!t){return nr(r)}if(t.source.indexOf("\\w")>-1&&nr(r)){return true}return t.test(r)}function fr(r){for(var t in r){if(r.hasOwnProperty(t)&&r[t]){return false}}return true}var ur=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function ar(r){return r.charCodeAt(0)>=768&&ur.test(r)}function lr(r,t,e){while((e<0?t>0:t<r.length)&&ar(r.charAt(t))){t+=e}return t}function sr(r,t,e){var i=t>e?-1:1;for(;;){if(t==e){return t}var n=(t+e)/2,o=i<0?Math.ceil(n):Math.floor(n);if(o==t){return r(o)?t:e}if(r(o)){e=o}else{t=o+i}}}function cr(r,t,e,i){if(!r){return i(t,e,"ltr",0)}var n=false;for(var o=0;o<r.length;++o){var f=r[o];if(f.from<e&&f.to>t||t==e&&f.to==t){i(Math.max(f.from,t),Math.min(f.to,e),f.level==1?"rtl":"ltr",o);n=true}}if(!n){i(t,e,"ltr")}}var vr=null;function hr(r,t,e){var i;vr=null;for(var n=0;n<r.length;++n){var o=r[n];if(o.from<t&&o.to>t){return n}if(o.to==t){if(o.from!=o.to&&e=="before"){i=n}else{vr=n}}if(o.from==t){if(o.from!=o.to&&e!="before"){i=n}else{vr=n}}}return i!=null?i:vr}var dr=function(){var r="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN";var t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function e(e){if(e<=247){return r.charAt(e)}else if(1424<=e&&e<=1524){return"R"}else if(1536<=e&&e<=1785){return t.charAt(e-1536)}else if(1774<=e&&e<=2220){return"r"}else if(8192<=e&&e<=8203){return"w"}else if(e==8204){return"b"}else{return"L"}}var i=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;var n=/[stwN]/,o=/[LRr]/,f=/[Lb1n]/,u=/[1n]/;function a(r,t,e){this.level=r;this.from=t;this.to=e}return function(r,t){var l=t=="ltr"?"L":"R";if(r.length==0||t=="ltr"&&!i.test(r)){return false}var s=r.length,c=[];for(var v=0;v<s;++v){c.push(e(r.charCodeAt(v)))}for(var h=0,d=l;h<s;++h){var m=c[h];if(m=="m"){c[h]=d}else{d=m}}for(var p=0,g=l;p<s;++p){var b=c[p];if(b=="1"&&g=="r"){c[p]="n"}else if(o.test(b)){g=b;if(b=="r"){c[p]="R"}}}for(var w=1,k=c[0];w<s-1;++w){var C=c[w];if(C=="+"&&k=="1"&&c[w+1]=="1"){c[w]="1"}else if(C==","&&k==c[w+1]&&(k=="1"||k=="n")){c[w]=k}k=C}for(var M=0;M<s;++M){var A=c[M];if(A==","){c[M]="N"}else if(A=="%"){var y=void 0;for(y=M+1;y<s&&c[y]=="%";++y){}var x=M&&c[M-1]=="!"||y<s&&c[y]=="1"?"1":"N";for(var L=M;L<y;++L){c[L]=x}M=y-1}}for(var S=0,N=l;S<s;++S){var E=c[S];if(N=="L"&&E=="1"){c[S]="L"}else if(o.test(E)){N=E}}for(var D=0;D<s;++D){if(n.test(c[D])){var T=void 0;for(T=D+1;T<s&&n.test(c[T]);++T){}var I=(D?c[D-1]:l)=="L";var R=(T<s?c[T]:l)=="L";var O=I==R?I?"L":"R":l;for(var B=D;B<T;++B){c[B]=O}D=T-1}}var U=[],z;for(var j=0;j<s;){if(f.test(c[j])){var W=j;for(++j;j<s&&f.test(c[j]);++j){}U.push(new a(0,W,j))}else{var F=j,P=U.length,G=t=="rtl"?1:0;for(++j;j<s&&c[j]!="L";++j){}for(var _=F;_<j;){if(u.test(c[_])){if(F<_){U.splice(P,0,new a(1,F,_));P+=G}var H=_;for(++_;_<j&&u.test(c[_]);++_){}U.splice(P,0,new a(2,H,_));P+=G;F=_}else{++_}}if(F<j){U.splice(P,0,new a(1,F,j))}}}if(t=="ltr"){if(U[0].level==1&&(z=r.match(/^\s+/))){U[0].from=z[0].length;U.unshift(new a(0,0,z[0].length))}if(X(U).level==1&&(z=r.match(/\s+$/))){X(U).to-=z[0].length;U.push(new a(0,s-z[0].length,s))}}return t=="rtl"?U.reverse():U}}();function mr(r,t){var e=r.order;if(e==null){e=r.order=dr(r.text,t)}return e}var pr=[];var gr=function(r,t,e){if(r.addEventListener){r.addEventListener(t,e,false)}else if(r.attachEvent){r.attachEvent("on"+t,e)}else{var i=r._handlers||(r._handlers={});i[t]=(i[t]||pr).concat(e)}};function br(r,t){return r._handlers&&r._handlers[t]||pr}function wr(r,t,e){if(r.removeEventListener){r.removeEventListener(t,e,false)}else if(r.detachEvent){r.detachEvent("on"+t,e)}else{var i=r._handlers,n=i&&i[t];if(n){var o=_(n,e);if(o>-1){i[t]=n.slice(0,o).concat(n.slice(o+1))}}}}function kr(r,t){var e=br(r,t);if(!e.length){return}var i=Array.prototype.slice.call(arguments,2);for(var n=0;n<e.length;++n){e[n].apply(null,i)}}function Cr(r,t,e){if(typeof t=="string"){t={type:t,preventDefault:function(){this.defaultPrevented=true}}}kr(r,e||t.type,r,t);return Sr(t)||t.codemirrorIgnore}function Mr(r){var t=r._handlers&&r._handlers.cursorActivity;if(!t){return}var e=r.curOp.cursorActivityHandlers||(r.curOp.cursorActivityHandlers=[]);for(var i=0;i<t.length;++i){if(_(e,t[i])==-1){e.push(t[i])}}}function Ar(r,t){return br(r,t).length>0}function yr(r){r.prototype.on=function(r,t){gr(this,r,t)};r.prototype.off=function(r,t){wr(this,r,t)}}function xr(r){if(r.preventDefault){r.preventDefault()}else{r.returnValue=false}}function Lr(r){if(r.stopPropagation){r.stopPropagation()}else{r.cancelBubble=true}}function Sr(r){return r.defaultPrevented!=null?r.defaultPrevented:r.returnValue==false}function Nr(r){xr(r);Lr(r)}function Er(r){return r.target||r.srcElement}function Dr(r){var t=r.which;if(t==null){if(r.button&1){t=1}else if(r.button&2){t=3}else if(r.button&4){t=2}}if(w&&r.ctrlKey&&t==1){t=3}return t}var Tr=function(){if(f&&u<9){return false}var r=E("div");return"draggable"in r||"dragDrop"in r}();var Ir;function Rr(r){if(Ir==null){var t=E("span","");N(r,E("span",[t,document.createTextNode("x")]));if(r.firstChild.offsetHeight!=0){Ir=t.offsetWidth<=1&&t.offsetHeight>2&&!(f&&u<8)}}var e=Ir?E("span",""):E("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");e.setAttribute("cm-text","");return e}var Or;function Br(r){if(Or!=null){return Or}var t=N(r,document.createTextNode("AخA"));var e=T(t,0,1).getBoundingClientRect();var i=T(t,1,2).getBoundingClientRect();S(r);if(!e||e.left==e.right){return false}return Or=i.right-e.right<3}var Ur="\n\nb".split(/\n/).length!=3?function(r){var t=0,e=[],i=r.length;while(t<=i){var n=r.indexOf("\n",t);if(n==-1){n=r.length}var o=r.slice(t,r.charAt(n-1)=="\r"?n-1:n);var f=o.indexOf("\r");if(f!=-1){e.push(o.slice(0,f));t+=f+1}else{e.push(o);t=n+1}}return e}:function(r){return r.split(/\r\n?|\n/)};var zr=window.getSelection?function(r){try{return r.selectionStart!=r.selectionEnd}catch(r){return false}}:function(r){var t;try{t=r.ownerDocument.selection.createRange()}catch(r){}if(!t||t.parentElement()!=r){return false}return t.compareEndPoints("StartToEnd",t)!=0};var jr=function(){var r=E("div");if("oncopy"in r){return true}r.setAttribute("oncopy","return;");return typeof r.oncopy=="function"}();var Wr=null;function Fr(r){if(Wr!=null){return Wr}var t=N(r,E("span","x"));var e=t.getBoundingClientRect();var i=T(t,0,1).getBoundingClientRect();return Wr=Math.abs(e.left-i.left)>1}var Pr={},Gr={};function _r(r,t){if(arguments.length>2){t.dependencies=Array.prototype.slice.call(arguments,2)}Pr[r]=t}function Hr(r,t){Gr[r]=t}function Vr(r){if(typeof r=="string"&&Gr.hasOwnProperty(r)){r=Gr[r]}else if(r&&typeof r.name=="string"&&Gr.hasOwnProperty(r.name)){var t=Gr[r.name];if(typeof t=="string"){t={name:t}}r=er(t,r);r.name=t.name}else if(typeof r=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(r)){return Vr("application/xml")}else if(typeof r=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(r)){return Vr("application/json")}if(typeof r=="string"){return{name:r}}else{return r||{name:"null"}}}function $r(r,t){t=Vr(t);var e=Pr[t.name];if(!e){return $r(r,"text/plain")}var i=e(r,t);if(Qr.hasOwnProperty(t.name)){var n=Qr[t.name];for(var o in n){if(!n.hasOwnProperty(o)){continue}if(i.hasOwnProperty(o)){i["_"+o]=i[o]}i[o]=n[o]}}i.name=t.name;if(t.helperType){i.helperType=t.helperType}if(t.modeProps){for(var f in t.modeProps){i[f]=t.modeProps[f]}}return i}var Qr={};function Jr(r,t){var e=Qr.hasOwnProperty(r)?Qr[r]:Qr[r]={};F(t,e)}function Kr(r,t){if(t===true){return t}if(r.copyState){return r.copyState(t)}var e={};for(var i in t){var n=t[i];if(n instanceof Array){n=n.concat([])}e[i]=n}return e}function qr(r,t){var e;while(r.innerMode){e=r.innerMode(t);if(!e||e.mode==r){break}t=e.state;r=e.mode}return e||{mode:r,state:t}}function Yr(r,t,e){return r.startState?r.startState(t,e):true}var Xr=function(r,t,e){this.pos=this.start=0;this.string=r;this.tabSize=t||8;this.lastColumnPos=this.lastColumnValue=0;this.lineStart=0;this.lineOracle=e};Xr.prototype.eol=function(){return this.pos>=this.string.length};Xr.prototype.sol=function(){return this.pos==this.lineStart};Xr.prototype.peek=function(){return this.string.charAt(this.pos)||undefined};Xr.prototype.next=function(){if(this.pos<this.string.length){return this.string.charAt(this.pos++)}};Xr.prototype.eat=function(r){var t=this.string.charAt(this.pos);var e;if(typeof r=="string"){e=t==r}else{e=t&&(r.test?r.test(t):r(t))}if(e){++this.pos;return t}};Xr.prototype.eatWhile=function(r){var t=this.pos;while(this.eat(r)){}return this.pos>t};Xr.prototype.eatSpace=function(){var r=this.pos;while(/[\s\u00a0]/.test(this.string.charAt(this.pos))){++this.pos}return this.pos>r};Xr.prototype.skipToEnd=function(){this.pos=this.string.length};Xr.prototype.skipTo=function(r){var t=this.string.indexOf(r,this.pos);if(t>-1){this.pos=t;return true}};Xr.prototype.backUp=function(r){this.pos-=r};Xr.prototype.column=function(){if(this.lastColumnPos<this.start){this.lastColumnValue=P(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue);this.lastColumnPos=this.start}return this.lastColumnValue-(this.lineStart?P(this.string,this.lineStart,this.tabSize):0)};Xr.prototype.indentation=function(){return P(this.string,null,this.tabSize)-(this.lineStart?P(this.string,this.lineStart,this.tabSize):0)};Xr.prototype.match=function(r,t,e){if(typeof r=="string"){var i=function(r){return e?r.toLowerCase():r};var n=this.string.substr(this.pos,r.length);if(i(n)==i(r)){if(t!==false){this.pos+=r.length}return true}}else{var o=this.string.slice(this.pos).match(r);if(o&&o.index>0){return null}if(o&&t!==false){this.pos+=o[0].length}return o}};Xr.prototype.current=function(){return this.string.slice(this.start,this.pos)};Xr.prototype.hideFirstChars=function(r,t){this.lineStart+=r;try{return t()}finally{this.lineStart-=r}};Xr.prototype.lookAhead=function(r){var t=this.lineOracle;return t&&t.lookAhead(r)};Xr.prototype.baseToken=function(){var r=this.lineOracle;return r&&r.baseToken(this.pos)};function Zr(r,t){t-=r.first;if(t<0||t>=r.size){throw new Error("There is no line "+(t+r.first)+" in the document.")}var e=r;while(!e.lines){for(var i=0;;++i){var n=e.children[i],o=n.chunkSize();if(t<o){e=n;break}t-=o}}return e.lines[t]}function rt(r,t,e){var i=[],n=t.line;r.iter(t.line,e.line+1,(function(r){var o=r.text;if(n==e.line){o=o.slice(0,e.ch)}if(n==t.line){o=o.slice(t.ch)}i.push(o);++n}));return i}function tt(r,t,e){var i=[];r.iter(t,e,(function(r){i.push(r.text)}));return i}function et(r,t){var e=t-r.height;if(e){for(var i=r;i;i=i.parent){i.height+=e}}}function it(r){if(r.parent==null){return null}var t=r.parent,e=_(t.lines,r);for(var i=t.parent;i;t=i,i=i.parent){for(var n=0;;++n){if(i.children[n]==t){break}e+=i.children[n].chunkSize()}}return e+t.first}function nt(r,t){var e=r.first;r:do{for(var i=0;i<r.children.length;++i){var n=r.children[i],o=n.height;if(t<o){r=n;continue r}t-=o;e+=n.chunkSize()}return e}while(!r.lines);var f=0;for(;f<r.lines.length;++f){var u=r.lines[f],a=u.height;if(t<a){break}t-=a}return e+f}function ot(r,t){return t>=r.first&&t<r.first+r.size}function ft(r,t){return String(r.lineNumberFormatter(t+r.firstLineNumber))}function ut(r,t,e){if(e===void 0)e=null;if(!(this instanceof ut)){return new ut(r,t,e)}this.line=r;this.ch=t;this.sticky=e}function at(r,t){return r.line-t.line||r.ch-t.ch}function lt(r,t){return r.sticky==t.sticky&&at(r,t)==0}function st(r){return ut(r.line,r.ch)}function ct(r,t){return at(r,t)<0?t:r}function vt(r,t){return at(r,t)<0?r:t}function ht(r,t){return Math.max(r.first,Math.min(t,r.first+r.size-1))}function dt(r,t){if(t.line<r.first){return ut(r.first,0)}var e=r.first+r.size-1;if(t.line>e){return ut(e,Zr(r,e).text.length)}return mt(t,Zr(r,t.line).text.length)}function mt(r,t){var e=r.ch;if(e==null||e>t){return ut(r.line,t)}else if(e<0){return ut(r.line,0)}else{return r}}function pt(r,t){var e=[];for(var i=0;i<t.length;i++){e[i]=dt(r,t[i])}return e}var gt=function(r,t){this.state=r;this.lookAhead=t};var bt=function(r,t,e,i){this.state=t;this.doc=r;this.line=e;this.maxLookAhead=i||0;this.baseTokens=null;this.baseTokenPos=1};bt.prototype.lookAhead=function(r){var t=this.doc.getLine(this.line+r);if(t!=null&&r>this.maxLookAhead){this.maxLookAhead=r}return t};bt.prototype.baseToken=function(r){if(!this.baseTokens){return null}while(this.baseTokens[this.baseTokenPos]<=r){this.baseTokenPos+=2}var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-r}};bt.prototype.nextLine=function(){this.line++;if(this.maxLookAhead>0){this.maxLookAhead--}};bt.fromSaved=function(r,t,e){if(t instanceof gt){return new bt(r,Kr(r.mode,t.state),e,t.lookAhead)}else{return new bt(r,Kr(r.mode,t),e)}};bt.prototype.save=function(r){var t=r!==false?Kr(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new gt(t,this.maxLookAhead):t};function wt(r,t,e,i){var n=[r.state.modeGen],o={};Nt(r,t.text,r.doc.mode,e,(function(r,t){return n.push(r,t)}),o,i);var f=e.state;var u=function(i){e.baseTokens=n;var u=r.state.overlays[i],a=1,l=0;e.state=true;Nt(r,t.text,u.mode,e,(function(r,t){var e=a;while(l<r){var i=n[a];if(i>r){n.splice(a,1,r,n[a+1],i)}a+=2;l=Math.min(r,i)}if(!t){return}if(u.opaque){n.splice(e,a-e,r,"overlay "+t);a=e+2}else{for(;e<a;e+=2){var o=n[e+1];n[e+1]=(o?o+" ":"")+"overlay "+t}}}),o);e.state=f;e.baseTokens=null;e.baseTokenPos=1};for(var a=0;a<r.state.overlays.length;++a)u(a);return{styles:n,classes:o.bgClass||o.textClass?o:null}}function kt(r,t,e){if(!t.styles||t.styles[0]!=r.state.modeGen){var i=Ct(r,it(t));var n=t.text.length>r.options.maxHighlightLength&&Kr(r.doc.mode,i.state);var o=wt(r,t,i);if(n){i.state=n}t.stateAfter=i.save(!n);t.styles=o.styles;if(o.classes){t.styleClasses=o.classes}else if(t.styleClasses){t.styleClasses=null}if(e===r.doc.highlightFrontier){r.doc.modeFrontier=Math.max(r.doc.modeFrontier,++r.doc.highlightFrontier)}}return t.styles}function Ct(r,t,e){var i=r.doc,n=r.display;if(!i.mode.startState){return new bt(i,true,t)}var o=Et(r,t,e);var f=o>i.first&&Zr(i,o-1).stateAfter;var u=f?bt.fromSaved(i,f,o):new bt(i,Yr(i.mode),o);i.iter(o,t,(function(e){Mt(r,e.text,u);var i=u.line;e.stateAfter=i==t-1||i%5==0||i>=n.viewFrom&&i<n.viewTo?u.save():null;u.nextLine()}));if(e){i.modeFrontier=u.line}return u}function Mt(r,t,e,i){var n=r.doc.mode;var o=new Xr(t,r.options.tabSize,e);o.start=o.pos=i||0;if(t==""){At(n,e.state)}while(!o.eol()){yt(n,o,e.state);o.start=o.pos}}function At(r,t){if(r.blankLine){return r.blankLine(t)}if(!r.innerMode){return}var e=qr(r,t);if(e.mode.blankLine){return e.mode.blankLine(e.state)}}function yt(r,t,e,i){for(var n=0;n<10;n++){if(i){i[0]=qr(r,e).mode}var o=r.token(t,e);if(t.pos>t.start){return o}}throw new Error("Mode "+r.name+" failed to advance stream.")}var xt=function(r,t,e){this.start=r.start;this.end=r.pos;this.string=r.current();this.type=t||null;this.state=e};function Lt(r,t,e,i){var n=r.doc,o=n.mode,f;t=dt(n,t);var u=Zr(n,t.line),a=Ct(r,t.line,e);var l=new Xr(u.text,r.options.tabSize,a),s;if(i){s=[]}while((i||l.pos<t.ch)&&!l.eol()){l.start=l.pos;f=yt(o,l,a.state);if(i){s.push(new xt(l,f,Kr(n.mode,a.state)))}}return i?s:new xt(l,f,a.state)}function St(r,t){if(r){for(;;){var e=r.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!e){break}r=r.slice(0,e.index)+r.slice(e.index+e[0].length);var i=e[1]?"bgClass":"textClass";if(t[i]==null){t[i]=e[2]}else if(!new RegExp("(?:^|\\s)"+e[2]+"(?:$|\\s)").test(t[i])){t[i]+=" "+e[2]}}}return r}function Nt(r,t,e,i,n,o,f){var u=e.flattenSpans;if(u==null){u=r.options.flattenSpans}var a=0,l=null;var s=new Xr(t,r.options.tabSize,i),c;var v=r.options.addModeClass&&[null];if(t==""){St(At(e,i.state),o)}while(!s.eol()){if(s.pos>r.options.maxHighlightLength){u=false;if(f){Mt(r,t,i,s.pos)}s.pos=t.length;c=null}else{c=St(yt(e,s,i.state,v),o)}if(v){var h=v[0].name;if(h){c="m-"+(c?h+" "+c:h)}}if(!u||l!=c){while(a<s.start){a=Math.min(s.start,a+5e3);n(a,l)}l=c}s.start=s.pos}while(a<s.pos){var d=Math.min(s.pos,a+5e3);n(d,l);a=d}}function Et(r,t,e){var i,n,o=r.doc;var f=e?-1:t-(r.doc.mode.innerMode?1e3:100);for(var u=t;u>f;--u){if(u<=o.first){return o.first}var a=Zr(o,u-1),l=a.stateAfter;if(l&&(!e||u+(l instanceof gt?l.lookAhead:0)<=o.modeFrontier)){return u}var s=P(a.text,null,r.options.tabSize);if(n==null||i>s){n=u-1;i=s}}return n}function Dt(r,t){r.modeFrontier=Math.min(r.modeFrontier,t);if(r.highlightFrontier<t-10){return}var e=r.first;for(var i=t-1;i>e;i--){var n=Zr(r,i).stateAfter;if(n&&(!(n instanceof gt)||i+n.lookAhead<t)){e=i+1;break}}r.highlightFrontier=Math.min(r.highlightFrontier,e)}var Tt=false,It=false;function Rt(){Tt=true}function Ot(){It=true}function Bt(r,t,e){this.marker=r;this.from=t;this.to=e}function Ut(r,t){if(r){for(var e=0;e<r.length;++e){var i=r[e];if(i.marker==t){return i}}}}function zt(r,t){var e;for(var i=0;i<r.length;++i){if(r[i]!=t){(e||(e=[])).push(r[i])}}return e}function jt(r,t,e){var i=e&&window.WeakSet&&(e.markedSpans||(e.markedSpans=new WeakSet));if(i&&r.markedSpans&&i.has(r.markedSpans)){r.markedSpans.push(t)}else{r.markedSpans=r.markedSpans?r.markedSpans.concat([t]):[t];if(i){i.add(r.markedSpans)}}t.marker.attachLine(r)}function Wt(r,t,e){var i;if(r){for(var n=0;n<r.length;++n){var o=r[n],f=o.marker;var u=o.from==null||(f.inclusiveLeft?o.from<=t:o.from<t);if(u||o.from==t&&f.type=="bookmark"&&(!e||!o.marker.insertLeft)){var a=o.to==null||(f.inclusiveRight?o.to>=t:o.to>t);(i||(i=[])).push(new Bt(f,o.from,a?null:o.to))}}}return i}function Ft(r,t,e){var i;if(r){for(var n=0;n<r.length;++n){var o=r[n],f=o.marker;var u=o.to==null||(f.inclusiveRight?o.to>=t:o.to>t);if(u||o.from==t&&f.type=="bookmark"&&(!e||o.marker.insertLeft)){var a=o.from==null||(f.inclusiveLeft?o.from<=t:o.from<t);(i||(i=[])).push(new Bt(f,a?null:o.from-t,o.to==null?null:o.to-t))}}}return i}function Pt(r,t){if(t.full){return null}var e=ot(r,t.from.line)&&Zr(r,t.from.line).markedSpans;var i=ot(r,t.to.line)&&Zr(r,t.to.line).markedSpans;if(!e&&!i){return null}var n=t.from.ch,o=t.to.ch,f=at(t.from,t.to)==0;var u=Wt(e,n,f);var a=Ft(i,o,f);var l=t.text.length==1,s=X(t.text).length+(l?n:0);if(u){for(var c=0;c<u.length;++c){var v=u[c];if(v.to==null){var h=Ut(a,v.marker);if(!h){v.to=n}else if(l){v.to=h.to==null?null:h.to+s}}}}if(a){for(var d=0;d<a.length;++d){var m=a[d];if(m.to!=null){m.to+=s}if(m.from==null){var p=Ut(u,m.marker);if(!p){m.from=s;if(l){(u||(u=[])).push(m)}}}else{m.from+=s;if(l){(u||(u=[])).push(m)}}}}if(u){u=Gt(u)}if(a&&a!=u){a=Gt(a)}var g=[u];if(!l){var b=t.text.length-2,w;if(b>0&&u){for(var k=0;k<u.length;++k){if(u[k].to==null){(w||(w=[])).push(new Bt(u[k].marker,null,null))}}}for(var C=0;C<b;++C){g.push(w)}g.push(a)}return g}function Gt(r){for(var t=0;t<r.length;++t){var e=r[t];if(e.from!=null&&e.from==e.to&&e.marker.clearWhenEmpty!==false){r.splice(t--,1)}}if(!r.length){return null}return r}function _t(r,t,e){var i=null;r.iter(t.line,e.line+1,(function(r){if(r.markedSpans){for(var t=0;t<r.markedSpans.length;++t){var e=r.markedSpans[t].marker;if(e.readOnly&&(!i||_(i,e)==-1)){(i||(i=[])).push(e)}}}}));if(!i){return null}var n=[{from:t,to:e}];for(var o=0;o<i.length;++o){var f=i[o],u=f.find(0);for(var a=0;a<n.length;++a){var l=n[a];if(at(l.to,u.from)<0||at(l.from,u.to)>0){continue}var s=[a,1],c=at(l.from,u.from),v=at(l.to,u.to);if(c<0||!f.inclusiveLeft&&!c){s.push({from:l.from,to:u.from})}if(v>0||!f.inclusiveRight&&!v){s.push({from:u.to,to:l.to})}n.splice.apply(n,s);a+=s.length-3}}return n}function Ht(r){var t=r.markedSpans;if(!t){return}for(var e=0;e<t.length;++e){t[e].marker.detachLine(r)}r.markedSpans=null}function Vt(r,t){if(!t){return}for(var e=0;e<t.length;++e){t[e].marker.attachLine(r)}r.markedSpans=t}function $t(r){return r.inclusiveLeft?-1:0}function Qt(r){return r.inclusiveRight?1:0}function Jt(r,t){var e=r.lines.length-t.lines.length;if(e!=0){return e}var i=r.find(),n=t.find();var o=at(i.from,n.from)||$t(r)-$t(t);if(o){return-o}var f=at(i.to,n.to)||Qt(r)-Qt(t);if(f){return f}return t.id-r.id}function Kt(r,t){var e=It&&r.markedSpans,i;if(e){for(var n=void 0,o=0;o<e.length;++o){n=e[o];if(n.marker.collapsed&&(t?n.from:n.to)==null&&(!i||Jt(i,n.marker)<0)){i=n.marker}}}return i}function qt(r){return Kt(r,true)}function Yt(r){return Kt(r,false)}function Xt(r,t){var e=It&&r.markedSpans,i;if(e){for(var n=0;n<e.length;++n){var o=e[n];if(o.marker.collapsed&&(o.from==null||o.from<t)&&(o.to==null||o.to>t)&&(!i||Jt(i,o.marker)<0)){i=o.marker}}}return i}function Zt(r,t,e,i,n){var o=Zr(r,t);var f=It&&o.markedSpans;if(f){for(var u=0;u<f.length;++u){var a=f[u];if(!a.marker.collapsed){continue}var l=a.marker.find(0);var s=at(l.from,e)||$t(a.marker)-$t(n);var c=at(l.to,i)||Qt(a.marker)-Qt(n);if(s>=0&&c<=0||s<=0&&c>=0){continue}if(s<=0&&(a.marker.inclusiveRight&&n.inclusiveLeft?at(l.to,e)>=0:at(l.to,e)>0)||s>=0&&(a.marker.inclusiveRight&&n.inclusiveLeft?at(l.from,i)<=0:at(l.from,i)<0)){return true}}}}function re(r){var t;while(t=qt(r)){r=t.find(-1,true).line}return r}function te(r){var t;while(t=Yt(r)){r=t.find(1,true).line}return r}function ee(r){var t,e;while(t=Yt(r)){r=t.find(1,true).line;(e||(e=[])).push(r)}return e}function ie(r,t){var e=Zr(r,t),i=re(e);if(e==i){return t}return it(i)}function ne(r,t){if(t>r.lastLine()){return t}var e=Zr(r,t),i;if(!oe(r,e)){return t}while(i=Yt(e)){e=i.find(1,true).line}return it(e)+1}function oe(r,t){var e=It&&t.markedSpans;if(e){for(var i=void 0,n=0;n<e.length;++n){i=e[n];if(!i.marker.collapsed){continue}if(i.from==null){return true}if(i.marker.widgetNode){continue}if(i.from==0&&i.marker.inclusiveLeft&&fe(r,t,i)){return true}}}}function fe(r,t,e){if(e.to==null){var i=e.marker.find(1,true);return fe(r,i.line,Ut(i.line.markedSpans,e.marker))}if(e.marker.inclusiveRight&&e.to==t.text.length){return true}for(var n=void 0,o=0;o<t.markedSpans.length;++o){n=t.markedSpans[o];if(n.marker.collapsed&&!n.marker.widgetNode&&n.from==e.to&&(n.to==null||n.to!=e.from)&&(n.marker.inclusiveLeft||e.marker.inclusiveRight)&&fe(r,t,n)){return true}}}function ue(r){r=re(r);var t=0,e=r.parent;for(var i=0;i<e.lines.length;++i){var n=e.lines[i];if(n==r){break}else{t+=n.height}}for(var o=e.parent;o;e=o,o=e.parent){for(var f=0;f<o.children.length;++f){var u=o.children[f];if(u==e){break}else{t+=u.height}}}return t}function ae(r){if(r.height==0){return 0}var t=r.text.length,e,i=r;while(e=qt(i)){var n=e.find(0,true);i=n.from.line;t+=n.from.ch-n.to.ch}i=r;while(e=Yt(i)){var o=e.find(0,true);t-=i.text.length-o.from.ch;i=o.to.line;t+=i.text.length-o.to.ch}return t}function le(r){var t=r.display,e=r.doc;t.maxLine=Zr(e,e.first);t.maxLineLength=ae(t.maxLine);t.maxLineChanged=true;e.iter((function(r){var e=ae(r);if(e>t.maxLineLength){t.maxLineLength=e;t.maxLine=r}}))}var se=function(r,t,e){this.text=r;Vt(this,t);this.height=e?e(this):1};se.prototype.lineNo=function(){return it(this)};yr(se);function ce(r,t,e,i){r.text=t;if(r.stateAfter){r.stateAfter=null}if(r.styles){r.styles=null}if(r.order!=null){r.order=null}Ht(r);Vt(r,e);var n=i?i(r):1;if(n!=r.height){et(r,n)}}function ve(r){r.parent=null;Ht(r)}var he={},de={};function me(r,t){if(!r||/^\s*$/.test(r)){return null}var e=t.addModeClass?de:he;return e[r]||(e[r]=r.replace(/\S+/g,"cm-$&"))}function pe(r,t){var e=D("span",null,null,a?"padding-right: .1px":null);var i={pre:D("pre",[e],"CodeMirror-line"),content:e,col:0,pos:0,cm:r,trailingSpace:false,splitSpaces:r.getOption("lineWrapping")};t.measure={};for(var n=0;n<=(t.rest?t.rest.length:0);n++){var o=n?t.rest[n-1]:t.line,f=void 0;i.pos=0;i.addToken=be;if(Br(r.display.measure)&&(f=mr(o,r.doc.direction))){i.addToken=ke(i.addToken,f)}i.map=[];var u=t!=r.display.externalMeasured&&it(o);Me(o,i,kt(r,o,u));if(o.styleClasses){if(o.styleClasses.bgClass){i.bgClass=B(o.styleClasses.bgClass,i.bgClass||"")}if(o.styleClasses.textClass){i.textClass=B(o.styleClasses.textClass,i.textClass||"")}}if(i.map.length==0){i.map.push(0,0,i.content.appendChild(Rr(r.display.measure)))}if(n==0){t.measure.map=i.map;t.measure.cache={}}else{(t.measure.maps||(t.measure.maps=[])).push(i.map);(t.measure.caches||(t.measure.caches=[])).push({})}}if(a){var l=i.content.lastChild;if(/\bcm-tab\b/.test(l.className)||l.querySelector&&l.querySelector(".cm-tab")){i.content.className="cm-tab-wrap-hack"}}kr(r,"renderLine",r,t.line,i.pre);if(i.pre.className){i.textClass=B(i.pre.className,i.textClass||"")}return i}function ge(r){var t=E("span","•","cm-invalidchar");t.title="\\u"+r.charCodeAt(0).toString(16);t.setAttribute("aria-label",t.title);return t}function be(r,t,e,i,n,o,a){if(!t){return}var l=r.splitSpaces?we(t,r.trailingSpace):t;var s=r.cm.state.specialChars,c=false;var v;if(!s.test(t)){r.col+=t.length;v=document.createTextNode(l);r.map.push(r.pos,r.pos+t.length,v);if(f&&u<9){c=true}r.pos+=t.length}else{v=document.createDocumentFragment();var h=0;while(true){s.lastIndex=h;var d=s.exec(t);var m=d?d.index-h:t.length-h;if(m){var p=document.createTextNode(l.slice(h,h+m));if(f&&u<9){v.appendChild(E("span",[p]))}else{v.appendChild(p)}r.map.push(r.pos,r.pos+m,p);r.col+=m;r.pos+=m}if(!d){break}h+=m+1;var g=void 0;if(d[0]=="\t"){var b=r.cm.options.tabSize,w=b-r.col%b;g=v.appendChild(E("span",Y(w),"cm-tab"));g.setAttribute("role","presentation");g.setAttribute("cm-text","\t");r.col+=w}else if(d[0]=="\r"||d[0]=="\n"){g=v.appendChild(E("span",d[0]=="\r"?"␍":"","cm-invalidchar"));g.setAttribute("cm-text",d[0]);r.col+=1}else{g=r.cm.options.specialCharPlaceholder(d[0]);g.setAttribute("cm-text",d[0]);if(f&&u<9){v.appendChild(E("span",[g]))}else{v.appendChild(g)}r.col+=1}r.map.push(r.pos,r.pos+1,g);r.pos++}}r.trailingSpace=l.charCodeAt(t.length-1)==32;if(e||i||n||c||o||a){var k=e||"";if(i){k+=i}if(n){k+=n}var C=E("span",[v],k,o);if(a){for(var M in a){if(a.hasOwnProperty(M)&&M!="style"&&M!="class"){C.setAttribute(M,a[M])}}}return r.content.appendChild(C)}r.content.appendChild(v)}function we(r,t){if(r.length>1&&!/ /.test(r)){return r}var e=t,i="";for(var n=0;n<r.length;n++){var o=r.charAt(n);if(o==" "&&e&&(n==r.length-1||r.charCodeAt(n+1)==32)){o=" "}i+=o;e=o==" "}return i}function ke(r,t){return function(e,i,n,o,f,u,a){n=n?n+" cm-force-border":"cm-force-border";var l=e.pos,s=l+i.length;for(;;){var c=void 0;for(var v=0;v<t.length;v++){c=t[v];if(c.to>l&&c.from<=l){break}}if(c.to>=s){return r(e,i,n,o,f,u,a)}r(e,i.slice(0,c.to-l),n,o,null,u,a);o=null;i=i.slice(c.to-l);l=c.to}}}function Ce(r,t,e,i){var n=!i&&e.widgetNode;if(n){r.map.push(r.pos,r.pos+t,n)}if(!i&&r.cm.display.input.needsContentAttribute){if(!n){n=r.content.appendChild(document.createElement("span"))}n.setAttribute("cm-marker",e.id)}if(n){r.cm.display.input.setUneditable(n);r.content.appendChild(n)}r.pos+=t;r.trailingSpace=false}function Me(r,t,e){var i=r.markedSpans,n=r.text,o=0;if(!i){for(var f=1;f<e.length;f+=2){t.addToken(t,n.slice(o,o=e[f]),me(e[f+1],t.cm.options))}return}var u=n.length,a=0,l=1,s="",c,v;var h=0,d,m,p,g,b;for(;;){if(h==a){d=m=p=v="";b=null;g=null;h=Infinity;var w=[],k=void 0;for(var C=0;C<i.length;++C){var M=i[C],A=M.marker;if(A.type=="bookmark"&&M.from==a&&A.widgetNode){w.push(A)}else if(M.from<=a&&(M.to==null||M.to>a||A.collapsed&&M.to==a&&M.from==a)){if(M.to!=null&&M.to!=a&&h>M.to){h=M.to;m=""}if(A.className){d+=" "+A.className}if(A.css){v=(v?v+";":"")+A.css}if(A.startStyle&&M.from==a){p+=" "+A.startStyle}if(A.endStyle&&M.to==h){(k||(k=[])).push(A.endStyle,M.to)}if(A.title){(b||(b={})).title=A.title}if(A.attributes){for(var y in A.attributes){(b||(b={}))[y]=A.attributes[y]}}if(A.collapsed&&(!g||Jt(g.marker,A)<0)){g=M}}else if(M.from>a&&h>M.from){h=M.from}}if(k){for(var x=0;x<k.length;x+=2){if(k[x+1]==h){m+=" "+k[x]}}}if(!g||g.from==a){for(var L=0;L<w.length;++L){Ce(t,0,w[L])}}if(g&&(g.from||0)==a){Ce(t,(g.to==null?u+1:g.to)-a,g.marker,g.from==null);if(g.to==null){return}if(g.to==a){g=false}}}if(a>=u){break}var S=Math.min(u,h);while(true){if(s){var N=a+s.length;if(!g){var E=N>S?s.slice(0,S-a):s;t.addToken(t,E,c?c+d:d,p,a+E.length==h?m:"",v,b)}if(N>=S){s=s.slice(S-a);a=S;break}a=N;p=""}s=n.slice(o,o=e[l++]);c=me(e[l++],t.cm.options)}}}function Ae(r,t,e){this.line=t;this.rest=ee(t);this.size=this.rest?it(X(this.rest))-e+1:1;this.node=this.text=null;this.hidden=oe(r,t)}function ye(r,t,e){var i=[],n;for(var o=t;o<e;o=n){var f=new Ae(r.doc,Zr(r.doc,o),o);n=o+f.size;i.push(f)}return i}var xe=null;function Le(r){if(xe){xe.ops.push(r)}else{r.ownsGroup=xe={ops:[r],delayedCallbacks:[]}}}function Se(r){var t=r.delayedCallbacks,e=0;do{for(;e<t.length;e++){t[e].call(null)}for(var i=0;i<r.ops.length;i++){var n=r.ops[i];if(n.cursorActivityHandlers){while(n.cursorActivityCalled<n.cursorActivityHandlers.length){n.cursorActivityHandlers[n.cursorActivityCalled++].call(null,n.cm)}}}}while(e<t.length)}function Ne(r,t){var e=r.ownsGroup;if(!e){return}try{Se(e)}finally{xe=null;t(e)}}var Ee=null;function De(r,t){var e=br(r,t);if(!e.length){return}var i=Array.prototype.slice.call(arguments,2),n;if(xe){n=xe.delayedCallbacks}else if(Ee){n=Ee}else{n=Ee=[];setTimeout(Te,0)}var o=function(r){n.push((function(){return e[r].apply(null,i)}))};for(var f=0;f<e.length;++f)o(f)}function Te(){var r=Ee;Ee=null;for(var t=0;t<r.length;++t){r[t]()}}function Ie(r,t,e,i){for(var n=0;n<t.changes.length;n++){var o=t.changes[n];if(o=="text"){Ue(r,t)}else if(o=="gutter"){je(r,t,e,i)}else if(o=="class"){ze(r,t)}else if(o=="widget"){We(r,t,i)}}t.changes=null}function Re(r){if(r.node==r.text){r.node=E("div",null,null,"position: relative");if(r.text.parentNode){r.text.parentNode.replaceChild(r.node,r.text)}r.node.appendChild(r.text);if(f&&u<8){r.node.style.zIndex=2}}return r.node}function Oe(r,t){var e=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(e){e+=" CodeMirror-linebackground"}if(t.background){if(e){t.background.className=e}else{t.background.parentNode.removeChild(t.background);t.background=null}}else if(e){var i=Re(t);t.background=i.insertBefore(E("div",null,e),i.firstChild);r.display.input.setUneditable(t.background)}}function Be(r,t){var e=r.display.externalMeasured;if(e&&e.line==t.line){r.display.externalMeasured=null;t.measure=e.measure;return e.built}return pe(r,t)}function Ue(r,t){var e=t.text.className;var i=Be(r,t);if(t.text==t.node){t.node=i.pre}t.text.parentNode.replaceChild(i.pre,t.text);t.text=i.pre;if(i.bgClass!=t.bgClass||i.textClass!=t.textClass){t.bgClass=i.bgClass;t.textClass=i.textClass;ze(r,t)}else if(e){t.text.className=e}}function ze(r,t){Oe(r,t);if(t.line.wrapClass){Re(t).className=t.line.wrapClass}else if(t.node!=t.text){t.node.className=""}var e=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=e||""}function je(r,t,e,i){if(t.gutter){t.node.removeChild(t.gutter);t.gutter=null}if(t.gutterBackground){t.node.removeChild(t.gutterBackground);t.gutterBackground=null}if(t.line.gutterClass){var n=Re(t);t.gutterBackground=E("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(r.options.fixedGutter?i.fixedPos:-i.gutterTotalWidth)+"px; width: "+i.gutterTotalWidth+"px");r.display.input.setUneditable(t.gutterBackground);n.insertBefore(t.gutterBackground,t.text)}var o=t.line.gutterMarkers;if(r.options.lineNumbers||o){var f=Re(t);var u=t.gutter=E("div",null,"CodeMirror-gutter-wrapper","left: "+(r.options.fixedGutter?i.fixedPos:-i.gutterTotalWidth)+"px");u.setAttribute("aria-hidden","true");r.display.input.setUneditable(u);f.insertBefore(u,t.text);if(t.line.gutterClass){u.className+=" "+t.line.gutterClass}if(r.options.lineNumbers&&(!o||!o["CodeMirror-linenumbers"])){t.lineNumber=u.appendChild(E("div",ft(r.options,e),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+i.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+r.display.lineNumInnerWidth+"px"))}if(o){for(var a=0;a<r.display.gutterSpecs.length;++a){var l=r.display.gutterSpecs[a].className,s=o.hasOwnProperty(l)&&o[l];if(s){u.appendChild(E("div",[s],"CodeMirror-gutter-elt","left: "+i.gutterLeft[l]+"px; width: "+i.gutterWidth[l]+"px"))}}}}}function We(r,t,e){if(t.alignable){t.alignable=null}var i=x("CodeMirror-linewidget");for(var n=t.node.firstChild,o=void 0;n;n=o){o=n.nextSibling;if(i.test(n.className)){t.node.removeChild(n)}}Pe(r,t,e)}function Fe(r,t,e,i){var n=Be(r,t);t.text=t.node=n.pre;if(n.bgClass){t.bgClass=n.bgClass}if(n.textClass){t.textClass=n.textClass}ze(r,t);je(r,t,e,i);Pe(r,t,i);return t.node}function Pe(r,t,e){Ge(r,t.line,t,e,true);if(t.rest){for(var i=0;i<t.rest.length;i++){Ge(r,t.rest[i],t,e,false)}}}function Ge(r,t,e,i,n){if(!t.widgets){return}var o=Re(e);for(var f=0,u=t.widgets;f<u.length;++f){var a=u[f],l=E("div",[a.node],"CodeMirror-linewidget"+(a.className?" "+a.className:""));if(!a.handleMouseEvents){l.setAttribute("cm-ignore-events","true")}_e(a,l,e,i);r.display.input.setUneditable(l);if(n&&a.above){o.insertBefore(l,e.gutter||e.text)}else{o.appendChild(l)}De(a,"redraw")}}function _e(r,t,e,i){if(r.noHScroll){(e.alignable||(e.alignable=[])).push(t);var n=i.wrapperWidth;t.style.left=i.fixedPos+"px";if(!r.coverGutter){n-=i.gutterTotalWidth;t.style.paddingLeft=i.gutterTotalWidth+"px"}t.style.width=n+"px"}if(r.coverGutter){t.style.zIndex=5;t.style.position="relative";if(!r.noHScroll){t.style.marginLeft=-i.gutterTotalWidth+"px"}}}function He(r){if(r.height!=null){return r.height}var t=r.doc.cm;if(!t){return 0}if(!I(document.body,r.node)){var e="position: relative;";if(r.coverGutter){e+="margin-left: -"+t.display.gutters.offsetWidth+"px;"}if(r.noHScroll){e+="width: "+t.display.wrapper.clientWidth+"px;"}N(t.display.measure,E("div",[r.node],null,e))}return r.height=r.node.parentNode.offsetHeight}function Ve(r,t){for(var e=Er(t);e!=r.wrapper;e=e.parentNode){if(!e||e.nodeType==1&&e.getAttribute("cm-ignore-events")=="true"||e.parentNode==r.sizer&&e!=r.mover){return true}}}function $e(r){return r.lineSpace.offsetTop}function Qe(r){return r.mover.offsetHeight-r.lineSpace.offsetHeight}function Je(r){if(r.cachedPaddingH){return r.cachedPaddingH}var t=N(r.measure,E("pre","x","CodeMirror-line-like"));var e=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle;var i={left:parseInt(e.paddingLeft),right:parseInt(e.paddingRight)};if(!isNaN(i.left)&&!isNaN(i.right)){r.cachedPaddingH=i}return i}function Ke(r){return H-r.display.nativeBarWidth}function qe(r){return r.display.scroller.clientWidth-Ke(r)-r.display.barWidth}function Ye(r){return r.display.scroller.clientHeight-Ke(r)-r.display.barHeight}function Xe(r,t,e){var i=r.options.lineWrapping;var n=i&&qe(r);if(!t.measure.heights||i&&t.measure.width!=n){var o=t.measure.heights=[];if(i){t.measure.width=n;var f=t.text.firstChild.getClientRects();for(var u=0;u<f.length-1;u++){var a=f[u],l=f[u+1];if(Math.abs(a.bottom-l.bottom)>2){o.push((a.bottom+l.top)/2-e.top)}}}o.push(e.bottom-e.top)}}function Ze(r,t,e){if(r.line==t){return{map:r.measure.map,cache:r.measure.cache}}if(r.rest){for(var i=0;i<r.rest.length;i++){if(r.rest[i]==t){return{map:r.measure.maps[i],cache:r.measure.caches[i]}}}for(var n=0;n<r.rest.length;n++){if(it(r.rest[n])>e){return{map:r.measure.maps[n],cache:r.measure.caches[n],before:true}}}}}function ri(r,t){t=re(t);var e=it(t);var i=r.display.externalMeasured=new Ae(r.doc,t,e);i.lineN=e;var n=i.built=pe(r,i);i.text=n.pre;N(r.display.lineMeasure,n.pre);return i}function ti(r,t,e,i){return ni(r,ii(r,t),e,i)}function ei(r,t){if(t>=r.display.viewFrom&&t<r.display.viewTo){return r.display.view[zi(r,t)]}var e=r.display.externalMeasured;if(e&&t>=e.lineN&&t<e.lineN+e.size){return e}}function ii(r,t){var e=it(t);var i=ei(r,e);if(i&&!i.text){i=null}else if(i&&i.changes){Ie(r,i,e,Ii(r));r.curOp.forceUpdate=true}if(!i){i=ri(r,t)}var n=Ze(i,t,e);return{line:t,view:i,rect:null,map:n.map,cache:n.cache,before:n.before,hasHeights:false}}function ni(r,t,e,i,n){if(t.before){e=-1}var o=e+(i||""),f;if(t.cache.hasOwnProperty(o)){f=t.cache[o]}else{if(!t.rect){t.rect=t.view.text.getBoundingClientRect()}if(!t.hasHeights){Xe(r,t.view,t.rect);t.hasHeights=true}f=ai(r,t,e,i);if(!f.bogus){t.cache[o]=f}}return{left:f.left,right:f.right,top:n?f.rtop:f.top,bottom:n?f.rbottom:f.bottom}}var oi={left:0,right:0,top:0,bottom:0};function fi(r,t,e){var i,n,o,f,u,a;for(var l=0;l<r.length;l+=3){u=r[l];a=r[l+1];if(t<u){n=0;o=1;f="left"}else if(t<a){n=t-u;o=n+1}else if(l==r.length-3||t==a&&r[l+3]>t){o=a-u;n=o-1;if(t>=a){f="right"}}if(n!=null){i=r[l+2];if(u==a&&e==(i.insertLeft?"left":"right")){f=e}if(e=="left"&&n==0){while(l&&r[l-2]==r[l-3]&&r[l-1].insertLeft){i=r[(l-=3)+2];f="left"}}if(e=="right"&&n==a-u){while(l<r.length-3&&r[l+3]==r[l+4]&&!r[l+5].insertLeft){i=r[(l+=3)+2];f="right"}}break}}return{node:i,start:n,end:o,collapse:f,coverStart:u,coverEnd:a}}function ui(r,t){var e=oi;if(t=="left"){for(var i=0;i<r.length;i++){if((e=r[i]).left!=e.right){break}}}else{for(var n=r.length-1;n>=0;n--){if((e=r[n]).left!=e.right){break}}}return e}function ai(r,t,e,i){var n=fi(t.map,e,i);var o=n.node,a=n.start,l=n.end,s=n.collapse;var c;if(o.nodeType==3){for(var v=0;v<4;v++){while(a&&ar(t.line.text.charAt(n.coverStart+a))){--a}while(n.coverStart+l<n.coverEnd&&ar(t.line.text.charAt(n.coverStart+l))){++l}if(f&&u<9&&a==0&&l==n.coverEnd-n.coverStart){c=o.parentNode.getBoundingClientRect()}else{c=ui(T(o,a,l).getClientRects(),i)}if(c.left||c.right||a==0){break}l=a;a=a-1;s="right"}if(f&&u<11){c=li(r.display.measure,c)}}else{if(a>0){s=i="right"}var h;if(r.options.lineWrapping&&(h=o.getClientRects()).length>1){c=h[i=="right"?h.length-1:0]}else{c=o.getBoundingClientRect()}}if(f&&u<9&&!a&&(!c||!c.left&&!c.right)){var d=o.parentNode.getClientRects()[0];if(d){c={left:d.left,right:d.left+Ti(r.display),top:d.top,bottom:d.bottom}}else{c=oi}}var m=c.top-t.rect.top,p=c.bottom-t.rect.top;var g=(m+p)/2;var b=t.view.measure.heights;var w=0;for(;w<b.length-1;w++){if(g<b[w]){break}}var k=w?b[w-1]:0,C=b[w];var M={left:(s=="right"?c.right:c.left)-t.rect.left,right:(s=="left"?c.left:c.right)-t.rect.left,top:k,bottom:C};if(!c.left&&!c.right){M.bogus=true}if(!r.options.singleCursorHeightPerLine){M.rtop=m;M.rbottom=p}return M}function li(r,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!Fr(r)){return t}var e=screen.logicalXDPI/screen.deviceXDPI;var i=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*e,right:t.right*e,top:t.top*i,bottom:t.bottom*i}}function si(r){if(r.measure){r.measure.cache={};r.measure.heights=null;if(r.rest){for(var t=0;t<r.rest.length;t++){r.measure.caches[t]={}}}}}function ci(r){r.display.externalMeasure=null;S(r.display.lineMeasure);for(var t=0;t<r.display.view.length;t++){si(r.display.view[t])}}function vi(r){ci(r);r.display.cachedCharWidth=r.display.cachedTextHeight=r.display.cachedPaddingH=null;if(!r.options.lineWrapping){r.display.maxLineChanged=true}r.display.lineNumChars=null}function hi(r){if(s&&g){return-(r.body.getBoundingClientRect().left-parseInt(getComputedStyle(r.body).marginLeft))}return r.defaultView.pageXOffset||(r.documentElement||r.body).scrollLeft}function di(r){if(s&&g){return-(r.body.getBoundingClientRect().top-parseInt(getComputedStyle(r.body).marginTop))}return r.defaultView.pageYOffset||(r.documentElement||r.body).scrollTop}function mi(r){var t=re(r);var e=t.widgets;var i=0;if(e){for(var n=0;n<e.length;++n){if(e[n].above){i+=He(e[n])}}}return i}function pi(r,t,e,i,n){if(!n){var o=mi(t);e.top+=o;e.bottom+=o}if(i=="line"){return e}if(!i){i="local"}var f=ue(t);if(i=="local"){f+=$e(r.display)}else{f-=r.display.viewOffset}if(i=="page"||i=="window"){var u=r.display.lineSpace.getBoundingClientRect();f+=u.top+(i=="window"?0:di(z(r)));var a=u.left+(i=="window"?0:hi(z(r)));e.left+=a;e.right+=a}e.top+=f;e.bottom+=f;return e}function gi(r,t,e){if(e=="div"){return t}var i=t.left,n=t.top;if(e=="page"){i-=hi(z(r));n-=di(z(r))}else if(e=="local"||!e){var o=r.display.sizer.getBoundingClientRect();i+=o.left;n+=o.top}var f=r.display.lineSpace.getBoundingClientRect();return{left:i-f.left,top:n-f.top}}function bi(r,t,e,i,n){if(!i){i=Zr(r.doc,t.line)}return pi(r,i,ti(r,i,t.ch,n),e)}function wi(r,t,e,i,n,o){i=i||Zr(r.doc,t.line);if(!n){n=ii(r,i)}function f(t,f){var u=ni(r,n,t,f?"right":"left",o);if(f){u.left=u.right}else{u.right=u.left}return pi(r,i,u,e)}var u=mr(i,r.doc.direction),a=t.ch,l=t.sticky;if(a>=i.text.length){a=i.text.length;l="before"}else if(a<=0){a=0;l="after"}if(!u){return f(l=="before"?a-1:a,l=="before")}function s(r,t,e){var i=u[t],n=i.level==1;return f(e?r-1:r,n!=e)}var c=hr(u,a,l);var v=vr;var h=s(a,c,l=="before");if(v!=null){h.other=s(a,v,l!="before")}return h}function ki(r,t){var e=0;t=dt(r.doc,t);if(!r.options.lineWrapping){e=Ti(r.display)*t.ch}var i=Zr(r.doc,t.line);var n=ue(i)+$e(r.display);return{left:e,right:e,top:n,bottom:n+i.height}}function Ci(r,t,e,i,n){var o=ut(r,t,e);o.xRel=n;if(i){o.outside=i}return o}function Mi(r,t,e){var i=r.doc;e+=r.display.viewOffset;if(e<0){return Ci(i.first,0,null,-1,-1)}var n=nt(i,e),o=i.first+i.size-1;if(n>o){return Ci(i.first+i.size-1,Zr(i,o).text.length,null,1,1)}if(t<0){t=0}var f=Zr(i,n);for(;;){var u=Li(r,f,n,t,e);var a=Xt(f,u.ch+(u.xRel>0||u.outside>0?1:0));if(!a){return u}var l=a.find(1);if(l.line==n){return l}f=Zr(i,n=l.line)}}function Ai(r,t,e,i){i-=mi(t);var n=t.text.length;var o=sr((function(t){return ni(r,e,t-1).bottom<=i}),n,0);n=sr((function(t){return ni(r,e,t).top>i}),o,n);return{begin:o,end:n}}function yi(r,t,e,i){if(!e){e=ii(r,t)}var n=pi(r,t,ni(r,e,i),"line").top;return Ai(r,t,e,n)}function xi(r,t,e,i){return r.bottom<=e?false:r.top>e?true:(i?r.left:r.right)>t}function Li(r,t,e,i,n){n-=ue(t);var o=ii(r,t);var f=mi(t);var u=0,a=t.text.length,l=true;var s=mr(t,r.doc.direction);if(s){var c=(r.options.lineWrapping?Ni:Si)(r,t,e,o,s,i,n);l=c.level!=1;u=l?c.from:c.to-1;a=l?c.to:c.from-1}var v=null,h=null;var d=sr((function(t){var e=ni(r,o,t);e.top+=f;e.bottom+=f;if(!xi(e,i,n,false)){return false}if(e.top<=n&&e.left<=i){v=t;h=e}return true}),u,a);var m,p,g=false;if(h){var b=i-h.left<h.right-i,w=b==l;d=v+(w?0:1);p=w?"after":"before";m=b?h.left:h.right}else{if(!l&&(d==a||d==u)){d++}p=d==0?"after":d==t.text.length?"before":ni(r,o,d-(l?1:0)).bottom+f<=n==l?"after":"before";var k=wi(r,ut(e,d,p),"line",t,o);m=k.left;g=n<k.top?-1:n>=k.bottom?1:0}d=lr(t.text,d,1);return Ci(e,d,p,g,i-m)}function Si(r,t,e,i,n,o,f){var u=sr((function(u){var a=n[u],l=a.level!=1;return xi(wi(r,ut(e,l?a.to:a.from,l?"before":"after"),"line",t,i),o,f,true)}),0,n.length-1);var a=n[u];if(u>0){var l=a.level!=1;var s=wi(r,ut(e,l?a.from:a.to,l?"after":"before"),"line",t,i);if(xi(s,o,f,true)&&s.top>f){a=n[u-1]}}return a}function Ni(r,t,e,i,n,o,f){var u=Ai(r,t,i,f);var a=u.begin;var l=u.end;if(/\s/.test(t.text.charAt(l-1))){l--}var s=null,c=null;for(var v=0;v<n.length;v++){var h=n[v];if(h.from>=l||h.to<=a){continue}var d=h.level!=1;var m=ni(r,i,d?Math.min(l,h.to)-1:Math.max(a,h.from)).right;var p=m<o?o-m+1e9:m-o;if(!s||c>p){s=h;c=p}}if(!s){s=n[n.length-1]}if(s.from<a){s={from:a,to:s.to,level:s.level}}if(s.to>l){s={from:s.from,to:l,level:s.level}}return s}var Ei;function Di(r){if(r.cachedTextHeight!=null){return r.cachedTextHeight}if(Ei==null){Ei=E("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t){Ei.appendChild(document.createTextNode("x"));Ei.appendChild(E("br"))}Ei.appendChild(document.createTextNode("x"))}N(r.measure,Ei);var e=Ei.offsetHeight/50;if(e>3){r.cachedTextHeight=e}S(r.measure);return e||1}function Ti(r){if(r.cachedCharWidth!=null){return r.cachedCharWidth}var t=E("span","xxxxxxxxxx");var e=E("pre",[t],"CodeMirror-line-like");N(r.measure,e);var i=t.getBoundingClientRect(),n=(i.right-i.left)/10;if(n>2){r.cachedCharWidth=n}return n||10}function Ii(r){var t=r.display,e={},i={};var n=t.gutters.clientLeft;for(var o=t.gutters.firstChild,f=0;o;o=o.nextSibling,++f){var u=r.display.gutterSpecs[f].className;e[u]=o.offsetLeft+o.clientLeft+n;i[u]=o.clientWidth}return{fixedPos:Ri(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:e,gutterWidth:i,wrapperWidth:t.wrapper.clientWidth}}function Ri(r){return r.scroller.getBoundingClientRect().left-r.sizer.getBoundingClientRect().left}function Oi(r){var t=Di(r.display),e=r.options.lineWrapping;var i=e&&Math.max(5,r.display.scroller.clientWidth/Ti(r.display)-3);return function(n){if(oe(r.doc,n)){return 0}var o=0;if(n.widgets){for(var f=0;f<n.widgets.length;f++){if(n.widgets[f].height){o+=n.widgets[f].height}}}if(e){return o+(Math.ceil(n.text.length/i)||1)*t}else{return o+t}}}function Bi(r){var t=r.doc,e=Oi(r);t.iter((function(r){var t=e(r);if(t!=r.height){et(r,t)}}))}function Ui(r,t,e,i){var n=r.display;if(!e&&Er(t).getAttribute("cm-not-content")=="true"){return null}var o,f,u=n.lineSpace.getBoundingClientRect();try{o=t.clientX-u.left;f=t.clientY-u.top}catch(r){return null}var a=Mi(r,o,f),l;if(i&&a.xRel>0&&(l=Zr(r.doc,a.line).text).length==a.ch){var s=P(l,l.length,r.options.tabSize)-l.length;a=ut(a.line,Math.max(0,Math.round((o-Je(r.display).left)/Ti(r.display))-s))}return a}function zi(r,t){if(t>=r.display.viewTo){return null}t-=r.display.viewFrom;if(t<0){return null}var e=r.display.view;for(var i=0;i<e.length;i++){t-=e[i].size;if(t<0){return i}}}function ji(r,t,e,i){if(t==null){t=r.doc.first}if(e==null){e=r.doc.first+r.doc.size}if(!i){i=0}var n=r.display;if(i&&e<n.viewTo&&(n.updateLineNumbers==null||n.updateLineNumbers>t)){n.updateLineNumbers=t}r.curOp.viewChanged=true;if(t>=n.viewTo){if(It&&ie(r.doc,t)<n.viewTo){Fi(r)}}else if(e<=n.viewFrom){if(It&&ne(r.doc,e+i)>n.viewFrom){Fi(r)}else{n.viewFrom+=i;n.viewTo+=i}}else if(t<=n.viewFrom&&e>=n.viewTo){Fi(r)}else if(t<=n.viewFrom){var o=Pi(r,e,e+i,1);if(o){n.view=n.view.slice(o.index);n.viewFrom=o.lineN;n.viewTo+=i}else{Fi(r)}}else if(e>=n.viewTo){var f=Pi(r,t,t,-1);if(f){n.view=n.view.slice(0,f.index);n.viewTo=f.lineN}else{Fi(r)}}else{var u=Pi(r,t,t,-1);var a=Pi(r,e,e+i,1);if(u&&a){n.view=n.view.slice(0,u.index).concat(ye(r,u.lineN,a.lineN)).concat(n.view.slice(a.index));n.viewTo+=i}else{Fi(r)}}var l=n.externalMeasured;if(l){if(e<l.lineN){l.lineN+=i}else if(t<l.lineN+l.size){n.externalMeasured=null}}}function Wi(r,t,e){r.curOp.viewChanged=true;var i=r.display,n=r.display.externalMeasured;if(n&&t>=n.lineN&&t<n.lineN+n.size){i.externalMeasured=null}if(t<i.viewFrom||t>=i.viewTo){return}var o=i.view[zi(r,t)];if(o.node==null){return}var f=o.changes||(o.changes=[]);if(_(f,e)==-1){f.push(e)}}function Fi(r){r.display.viewFrom=r.display.viewTo=r.doc.first;r.display.view=[];r.display.viewOffset=0}function Pi(r,t,e,i){var n=zi(r,t),o,f=r.display.view;if(!It||e==r.doc.first+r.doc.size){return{index:n,lineN:e}}var u=r.display.viewFrom;for(var a=0;a<n;a++){u+=f[a].size}if(u!=t){if(i>0){if(n==f.length-1){return null}o=u+f[n].size-t;n++}else{o=u-t}t+=o;e+=o}while(ie(r.doc,e)!=e){if(n==(i<0?0:f.length-1)){return null}e+=i*f[n-(i<0?1:0)].size;n+=i}return{index:n,lineN:e}}function Gi(r,t,e){var i=r.display,n=i.view;if(n.length==0||t>=i.viewTo||e<=i.viewFrom){i.view=ye(r,t,e);i.viewFrom=t}else{if(i.viewFrom>t){i.view=ye(r,t,i.viewFrom).concat(i.view)}else if(i.viewFrom<t){i.view=i.view.slice(zi(r,t))}i.viewFrom=t;if(i.viewTo<e){i.view=i.view.concat(ye(r,i.viewTo,e))}else if(i.viewTo>e){i.view=i.view.slice(0,zi(r,e))}}i.viewTo=e}function _i(r){var t=r.display.view,e=0;for(var i=0;i<t.length;i++){var n=t[i];if(!n.hidden&&(!n.node||n.changes)){++e}}return e}function Hi(r){r.display.input.showSelection(r.display.input.prepareSelection())}function Vi(r,t){if(t===void 0)t=true;var e=r.doc,i={};var n=i.cursors=document.createDocumentFragment();var o=i.selection=document.createDocumentFragment();var f=r.options.$customCursor;if(f){t=true}for(var u=0;u<e.sel.ranges.length;u++){if(!t&&u==e.sel.primIndex){continue}var a=e.sel.ranges[u];if(a.from().line>=r.display.viewTo||a.to().line<r.display.viewFrom){continue}var l=a.empty();if(f){var s=f(r,a);if(s){$i(r,s,n)}}else if(l||r.options.showCursorWhenSelecting){$i(r,a.head,n)}if(!l){Ji(r,a,o)}}return i}function $i(r,t,e){var i=wi(r,t,"div",null,null,!r.options.singleCursorHeightPerLine);var n=e.appendChild(E("div"," ","CodeMirror-cursor"));n.style.left=i.left+"px";n.style.top=i.top+"px";n.style.height=Math.max(0,i.bottom-i.top)*r.options.cursorHeight+"px";if(/\bcm-fat-cursor\b/.test(r.getWrapperElement().className)){var o=bi(r,t,"div",null,null);var f=o.right-o.left;n.style.width=(f>0?f:r.defaultCharWidth())+"px"}if(i.other){var u=e.appendChild(E("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));u.style.display="";u.style.left=i.other.left+"px";u.style.top=i.other.top+"px";u.style.height=(i.other.bottom-i.other.top)*.85+"px"}}function Qi(r,t){return r.top-t.top||r.left-t.left}function Ji(r,t,e){var i=r.display,n=r.doc;var o=document.createDocumentFragment();var f=Je(r.display),u=f.left;var a=Math.max(i.sizerWidth,qe(r)-i.sizer.offsetLeft)-f.right;var l=n.direction=="ltr";function s(r,t,e,i){if(t<0){t=0}t=Math.round(t);i=Math.round(i);o.appendChild(E("div",null,"CodeMirror-selected","position: absolute; left: "+r+"px;\n top: "+t+"px; width: "+(e==null?a-r:e)+"px;\n height: "+(i-t)+"px"))}function c(t,e,i){var o=Zr(n,t);var f=o.text.length;var c,v;function h(e,i){return bi(r,ut(t,e),"div",o,i)}function d(t,e,i){var n=yi(r,o,null,t);var f=e=="ltr"==(i=="after")?"left":"right";var u=i=="after"?n.begin:n.end-(/\s/.test(o.text.charAt(n.end-1))?2:1);return h(u,f)[f]}var m=mr(o,n.direction);cr(m,e||0,i==null?f:i,(function(r,t,n,o){var p=n=="ltr";var g=h(r,p?"left":"right");var b=h(t-1,p?"right":"left");var w=e==null&&r==0,k=i==null&&t==f;var C=o==0,M=!m||o==m.length-1;if(b.top-g.top<=3){var A=(l?w:k)&&C;var y=(l?k:w)&&M;var x=A?u:(p?g:b).left;var L=y?a:(p?b:g).right;s(x,g.top,L-x,g.bottom)}else{var S,N,E,D;if(p){S=l&&w&&C?u:g.left;N=l?a:d(r,n,"before");E=l?u:d(t,n,"after");D=l&&k&&M?a:b.right}else{S=!l?u:d(r,n,"before");N=!l&&w&&C?a:g.right;E=!l&&k&&M?u:b.left;D=!l?a:d(t,n,"after")}s(S,g.top,N-S,g.bottom);if(g.bottom<b.top){s(u,g.bottom,null,b.top)}s(E,b.top,D-E,b.bottom)}if(!c||Qi(g,c)<0){c=g}if(Qi(b,c)<0){c=b}if(!v||Qi(g,v)<0){v=g}if(Qi(b,v)<0){v=b}}));return{start:c,end:v}}var v=t.from(),h=t.to();if(v.line==h.line){c(v.line,v.ch,h.ch)}else{var d=Zr(n,v.line),m=Zr(n,h.line);var p=re(d)==re(m);var g=c(v.line,v.ch,p?d.text.length+1:null).end;var b=c(h.line,p?0:null,h.ch).start;if(p){if(g.top<b.top-2){s(g.right,g.top,null,g.bottom);s(u,b.top,b.left,b.bottom)}else{s(g.right,g.top,b.left-g.right,g.bottom)}}if(g.bottom<b.top){s(u,g.bottom,null,b.top)}}e.appendChild(o)}function Ki(r){if(!r.state.focused){return}var t=r.display;clearInterval(t.blinker);var e=true;t.cursorDiv.style.visibility="";if(r.options.cursorBlinkRate>0){t.blinker=setInterval((function(){if(!r.hasFocus()){Zi(r)}t.cursorDiv.style.visibility=(e=!e)?"":"hidden"}),r.options.cursorBlinkRate)}else if(r.options.cursorBlinkRate<0){t.cursorDiv.style.visibility="hidden"}}function qi(r){if(!r.hasFocus()){r.display.input.focus();if(!r.state.focused){Xi(r)}}}function Yi(r){r.state.delayingBlurEvent=true;setTimeout((function(){if(r.state.delayingBlurEvent){r.state.delayingBlurEvent=false;if(r.state.focused){Zi(r)}}}),100)}function Xi(r,t){if(r.state.delayingBlurEvent&&!r.state.draggingText){r.state.delayingBlurEvent=false}if(r.options.readOnly=="nocursor"){return}if(!r.state.focused){kr(r,"focus",r,t);r.state.focused=true;O(r.display.wrapper,"CodeMirror-focused");if(!r.curOp&&r.display.selForContextMenu!=r.doc.sel){r.display.input.reset();if(a){setTimeout((function(){return r.display.input.reset(true)}),20)}}r.display.input.receivedFocus()}Ki(r)}function Zi(r,t){if(r.state.delayingBlurEvent){return}if(r.state.focused){kr(r,"blur",r,t);r.state.focused=false;L(r.display.wrapper,"CodeMirror-focused")}clearInterval(r.display.blinker);setTimeout((function(){if(!r.state.focused){r.display.shift=false}}),150)}function rn(r){var t=r.display;var e=t.lineDiv.offsetTop;var i=Math.max(0,t.scroller.getBoundingClientRect().top);var n=t.lineDiv.getBoundingClientRect().top;var o=0;for(var a=0;a<t.view.length;a++){var l=t.view[a],s=r.options.lineWrapping;var c=void 0,v=0;if(l.hidden){continue}n+=l.line.height;if(f&&u<8){var h=l.node.offsetTop+l.node.offsetHeight;c=h-e;e=h}else{var d=l.node.getBoundingClientRect();c=d.bottom-d.top;if(!s&&l.text.firstChild){v=l.text.firstChild.getBoundingClientRect().right-d.left-1}}var m=l.line.height-c;if(m>.005||m<-.005){if(n<i){o-=m}et(l.line,c);tn(l.line);if(l.rest){for(var p=0;p<l.rest.length;p++){tn(l.rest[p])}}}if(v>r.display.sizerWidth){var g=Math.ceil(v/Ti(r.display));if(g>r.display.maxLineLength){r.display.maxLineLength=g;r.display.maxLine=l.line;r.display.maxLineChanged=true}}}if(Math.abs(o)>2){t.scroller.scrollTop+=o}}function tn(r){if(r.widgets){for(var t=0;t<r.widgets.length;++t){var e=r.widgets[t],i=e.node.parentNode;if(i){e.height=i.offsetHeight}}}}function en(r,t,e){var i=e&&e.top!=null?Math.max(0,e.top):r.scroller.scrollTop;i=Math.floor(i-$e(r));var n=e&&e.bottom!=null?e.bottom:i+r.wrapper.clientHeight;var o=nt(t,i),f=nt(t,n);if(e&&e.ensure){var u=e.ensure.from.line,a=e.ensure.to.line;if(u<o){o=u;f=nt(t,ue(Zr(t,u))+r.wrapper.clientHeight)}else if(Math.min(a,t.lastLine())>=f){o=nt(t,ue(Zr(t,a))-r.wrapper.clientHeight);f=a}}return{from:o,to:Math.max(f,o+1)}}function nn(r,t){if(Cr(r,"scrollCursorIntoView")){return}var e=r.display,i=e.sizer.getBoundingClientRect(),n=null;var o=e.wrapper.ownerDocument;if(t.top+i.top<0){n=true}else if(t.bottom+i.top>(o.defaultView.innerHeight||o.documentElement.clientHeight)){n=false}if(n!=null&&!m){var f=E("div","",null,"position: absolute;\n top: "+(t.top-e.viewOffset-$e(r.display))+"px;\n height: "+(t.bottom-t.top+Ke(r)+e.barHeight)+"px;\n left: "+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");r.display.lineSpace.appendChild(f);f.scrollIntoView(n);r.display.lineSpace.removeChild(f)}}function on(r,t,e,i){if(i==null){i=0}var n;if(!r.options.lineWrapping&&t==e){e=t.sticky=="before"?ut(t.line,t.ch+1,"before"):t;t=t.ch?ut(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t}for(var o=0;o<5;o++){var f=false;var u=wi(r,t);var a=!e||e==t?u:wi(r,e);n={left:Math.min(u.left,a.left),top:Math.min(u.top,a.top)-i,right:Math.max(u.left,a.left),bottom:Math.max(u.bottom,a.bottom)+i};var l=un(r,n);var s=r.doc.scrollTop,c=r.doc.scrollLeft;if(l.scrollTop!=null){dn(r,l.scrollTop);if(Math.abs(r.doc.scrollTop-s)>1){f=true}}if(l.scrollLeft!=null){pn(r,l.scrollLeft);if(Math.abs(r.doc.scrollLeft-c)>1){f=true}}if(!f){break}}return n}function fn(r,t){var e=un(r,t);if(e.scrollTop!=null){dn(r,e.scrollTop)}if(e.scrollLeft!=null){pn(r,e.scrollLeft)}}function un(r,t){var e=r.display,i=Di(r.display);if(t.top<0){t.top=0}var n=r.curOp&&r.curOp.scrollTop!=null?r.curOp.scrollTop:e.scroller.scrollTop;var o=Ye(r),f={};if(t.bottom-t.top>o){t.bottom=t.top+o}var u=r.doc.height+Qe(e);var a=t.top<i,l=t.bottom>u-i;if(t.top<n){f.scrollTop=a?0:t.top}else if(t.bottom>n+o){var s=Math.min(t.top,(l?u:t.bottom)-o);if(s!=n){f.scrollTop=s}}var c=r.options.fixedGutter?0:e.gutters.offsetWidth;var v=r.curOp&&r.curOp.scrollLeft!=null?r.curOp.scrollLeft:e.scroller.scrollLeft-c;var h=qe(r)-e.gutters.offsetWidth;var d=t.right-t.left>h;if(d){t.right=t.left+h}if(t.left<10){f.scrollLeft=0}else if(t.left<v){f.scrollLeft=Math.max(0,t.left+c-(d?0:10))}else if(t.right>h+v-3){f.scrollLeft=t.right+(d?0:10)-h}return f}function an(r,t){if(t==null){return}vn(r);r.curOp.scrollTop=(r.curOp.scrollTop==null?r.doc.scrollTop:r.curOp.scrollTop)+t}function ln(r){vn(r);var t=r.getCursor();r.curOp.scrollToPos={from:t,to:t,margin:r.options.cursorScrollMargin}}function sn(r,t,e){if(t!=null||e!=null){vn(r)}if(t!=null){r.curOp.scrollLeft=t}if(e!=null){r.curOp.scrollTop=e}}function cn(r,t){vn(r);r.curOp.scrollToPos=t}function vn(r){var t=r.curOp.scrollToPos;if(t){r.curOp.scrollToPos=null;var e=ki(r,t.from),i=ki(r,t.to);hn(r,e,i,t.margin)}}function hn(r,t,e,i){var n=un(r,{left:Math.min(t.left,e.left),top:Math.min(t.top,e.top)-i,right:Math.max(t.right,e.right),bottom:Math.max(t.bottom,e.bottom)+i});sn(r,n.scrollLeft,n.scrollTop)}function dn(r,t){if(Math.abs(r.doc.scrollTop-t)<2){return}if(!e){Vn(r,{top:t})}mn(r,t,true);if(e){Vn(r)}zn(r,100)}function mn(r,t,e){t=Math.max(0,Math.min(r.display.scroller.scrollHeight-r.display.scroller.clientHeight,t));if(r.display.scroller.scrollTop==t&&!e){return}r.doc.scrollTop=t;r.display.scrollbars.setScrollTop(t);if(r.display.scroller.scrollTop!=t){r.display.scroller.scrollTop=t}}function pn(r,t,e,i){t=Math.max(0,Math.min(t,r.display.scroller.scrollWidth-r.display.scroller.clientWidth));if((e?t==r.doc.scrollLeft:Math.abs(r.doc.scrollLeft-t)<2)&&!i){return}r.doc.scrollLeft=t;Kn(r);if(r.display.scroller.scrollLeft!=t){r.display.scroller.scrollLeft=t}r.display.scrollbars.setScrollLeft(t)}function gn(r){var t=r.display,e=t.gutters.offsetWidth;var i=Math.round(r.doc.height+Qe(r.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:r.options.fixedGutter?e:0,docHeight:i,scrollHeight:i+Ke(r)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:e}}var bn=function(r,t,e){this.cm=e;var i=this.vert=E("div",[E("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar");var n=this.horiz=E("div",[E("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");i.tabIndex=n.tabIndex=-1;r(i);r(n);gr(i,"scroll",(function(){if(i.clientHeight){t(i.scrollTop,"vertical")}}));gr(n,"scroll",(function(){if(n.clientWidth){t(n.scrollLeft,"horizontal")}}));this.checkedZeroWidth=false;if(f&&u<8){this.horiz.style.minHeight=this.vert.style.minWidth="18px"}};bn.prototype.update=function(r){var t=r.scrollWidth>r.clientWidth+1;var e=r.scrollHeight>r.clientHeight+1;var i=r.nativeBarWidth;if(e){this.vert.style.display="block";this.vert.style.bottom=t?i+"px":"0";var n=r.viewHeight-(t?i:0);this.vert.firstChild.style.height=Math.max(0,r.scrollHeight-r.clientHeight+n)+"px"}else{this.vert.scrollTop=0;this.vert.style.display="";this.vert.firstChild.style.height="0"}if(t){this.horiz.style.display="block";this.horiz.style.right=e?i+"px":"0";this.horiz.style.left=r.barLeft+"px";var o=r.viewWidth-r.barLeft-(e?i:0);this.horiz.firstChild.style.width=Math.max(0,r.scrollWidth-r.clientWidth+o)+"px"}else{this.horiz.style.display="";this.horiz.firstChild.style.width="0"}if(!this.checkedZeroWidth&&r.clientHeight>0){if(i==0){this.zeroWidthHack()}this.checkedZeroWidth=true}return{right:e?i:0,bottom:t?i:0}};bn.prototype.setScrollLeft=function(r){if(this.horiz.scrollLeft!=r){this.horiz.scrollLeft=r}if(this.disableHoriz){this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")}};bn.prototype.setScrollTop=function(r){if(this.vert.scrollTop!=r){this.vert.scrollTop=r}if(this.disableVert){this.enableZeroWidthBar(this.vert,this.disableVert,"vert")}};bn.prototype.zeroWidthHack=function(){var r=w&&!d?"12px":"18px";this.horiz.style.height=this.vert.style.width=r;this.horiz.style.visibility=this.vert.style.visibility="hidden";this.disableHoriz=new G;this.disableVert=new G};bn.prototype.enableZeroWidthBar=function(r,t,e){r.style.visibility="";function i(){var n=r.getBoundingClientRect();var o=e=="vert"?document.elementFromPoint(n.right-1,(n.top+n.bottom)/2):document.elementFromPoint((n.right+n.left)/2,n.bottom-1);if(o!=r){r.style.visibility="hidden"}else{t.set(1e3,i)}}t.set(1e3,i)};bn.prototype.clear=function(){var r=this.horiz.parentNode;r.removeChild(this.horiz);r.removeChild(this.vert)};var wn=function(){};wn.prototype.update=function(){return{bottom:0,right:0}};wn.prototype.setScrollLeft=function(){};wn.prototype.setScrollTop=function(){};wn.prototype.clear=function(){};function kn(r,t){if(!t){t=gn(r)}var e=r.display.barWidth,i=r.display.barHeight;Cn(r,t);for(var n=0;n<4&&e!=r.display.barWidth||i!=r.display.barHeight;n++){if(e!=r.display.barWidth&&r.options.lineWrapping){rn(r)}Cn(r,gn(r));e=r.display.barWidth;i=r.display.barHeight}}function Cn(r,t){var e=r.display;var i=e.scrollbars.update(t);e.sizer.style.paddingRight=(e.barWidth=i.right)+"px";e.sizer.style.paddingBottom=(e.barHeight=i.bottom)+"px";e.heightForcer.style.borderBottom=i.bottom+"px solid transparent";if(i.right&&i.bottom){e.scrollbarFiller.style.display="block";e.scrollbarFiller.style.height=i.bottom+"px";e.scrollbarFiller.style.width=i.right+"px"}else{e.scrollbarFiller.style.display=""}if(i.bottom&&r.options.coverGutterNextToScrollbar&&r.options.fixedGutter){e.gutterFiller.style.display="block";e.gutterFiller.style.height=i.bottom+"px";e.gutterFiller.style.width=t.gutterWidth+"px"}else{e.gutterFiller.style.display=""}}var Mn={native:bn,null:wn};function An(r){if(r.display.scrollbars){r.display.scrollbars.clear();if(r.display.scrollbars.addClass){L(r.display.wrapper,r.display.scrollbars.addClass)}}r.display.scrollbars=new Mn[r.options.scrollbarStyle]((function(t){r.display.wrapper.insertBefore(t,r.display.scrollbarFiller);gr(t,"mousedown",(function(){if(r.state.focused){setTimeout((function(){return r.display.input.focus()}),0)}}));t.setAttribute("cm-not-content","true")}),(function(t,e){if(e=="horizontal"){pn(r,t)}else{dn(r,t)}}),r);if(r.display.scrollbars.addClass){O(r.display.wrapper,r.display.scrollbars.addClass)}}var yn=0;function xn(r){r.curOp={cm:r,viewChanged:false,startHeight:r.doc.height,forceUpdate:false,updateInput:0,typing:false,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:false,updateMaxLine:false,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:false,id:++yn,markArrays:null};Le(r.curOp)}function Ln(r){var t=r.curOp;if(t){Ne(t,(function(r){for(var t=0;t<r.ops.length;t++){r.ops[t].cm.curOp=null}Sn(r)}))}}function Sn(r){var t=r.ops;for(var e=0;e<t.length;e++){Nn(t[e])}for(var i=0;i<t.length;i++){En(t[i])}for(var n=0;n<t.length;n++){Dn(t[n])}for(var o=0;o<t.length;o++){Tn(t[o])}for(var f=0;f<t.length;f++){In(t[f])}}function Nn(r){var t=r.cm,e=t.display;Fn(t);if(r.updateMaxLine){le(t)}r.mustUpdate=r.viewChanged||r.forceUpdate||r.scrollTop!=null||r.scrollToPos&&(r.scrollToPos.from.line<e.viewFrom||r.scrollToPos.to.line>=e.viewTo)||e.maxLineChanged&&t.options.lineWrapping;r.update=r.mustUpdate&&new Wn(t,r.mustUpdate&&{top:r.scrollTop,ensure:r.scrollToPos},r.forceUpdate)}function En(r){r.updatedDisplay=r.mustUpdate&&_n(r.cm,r.update)}function Dn(r){var t=r.cm,e=t.display;if(r.updatedDisplay){rn(t)}r.barMeasure=gn(t);if(e.maxLineChanged&&!t.options.lineWrapping){r.adjustWidthTo=ti(t,e.maxLine,e.maxLine.text.length).left+3;t.display.sizerWidth=r.adjustWidthTo;r.barMeasure.scrollWidth=Math.max(e.scroller.clientWidth,e.sizer.offsetLeft+r.adjustWidthTo+Ke(t)+t.display.barWidth);r.maxScrollLeft=Math.max(0,e.sizer.offsetLeft+r.adjustWidthTo-qe(t))}if(r.updatedDisplay||r.selectionChanged){r.preparedSelection=e.input.prepareSelection()}}function Tn(r){var t=r.cm;if(r.adjustWidthTo!=null){t.display.sizer.style.minWidth=r.adjustWidthTo+"px";if(r.maxScrollLeft<t.doc.scrollLeft){pn(t,Math.min(t.display.scroller.scrollLeft,r.maxScrollLeft),true)}t.display.maxLineChanged=false}var e=r.focus&&r.focus==R(z(t));if(r.preparedSelection){t.display.input.showSelection(r.preparedSelection,e)}if(r.updatedDisplay||r.startHeight!=t.doc.height){kn(t,r.barMeasure)}if(r.updatedDisplay){Jn(t,r.barMeasure)}if(r.selectionChanged){Ki(t)}if(t.state.focused&&r.updateInput){t.display.input.reset(r.typing)}if(e){qi(r.cm)}}function In(r){var t=r.cm,e=t.display,i=t.doc;if(r.updatedDisplay){Hn(t,r.update)}if(e.wheelStartX!=null&&(r.scrollTop!=null||r.scrollLeft!=null||r.scrollToPos)){e.wheelStartX=e.wheelStartY=null}if(r.scrollTop!=null){mn(t,r.scrollTop,r.forceScroll)}if(r.scrollLeft!=null){pn(t,r.scrollLeft,true,true)}if(r.scrollToPos){var n=on(t,dt(i,r.scrollToPos.from),dt(i,r.scrollToPos.to),r.scrollToPos.margin);nn(t,n)}var o=r.maybeHiddenMarkers,f=r.maybeUnhiddenMarkers;if(o){for(var u=0;u<o.length;++u){if(!o[u].lines.length){kr(o[u],"hide")}}}if(f){for(var a=0;a<f.length;++a){if(f[a].lines.length){kr(f[a],"unhide")}}}if(e.wrapper.offsetHeight){i.scrollTop=t.display.scroller.scrollTop}if(r.changeObjs){kr(t,"changes",t,r.changeObjs)}if(r.update){r.update.finish()}}function Rn(r,t){if(r.curOp){return t()}xn(r);try{return t()}finally{Ln(r)}}function On(r,t){return function(){if(r.curOp){return t.apply(r,arguments)}xn(r);try{return t.apply(r,arguments)}finally{Ln(r)}}}function Bn(r){return function(){if(this.curOp){return r.apply(this,arguments)}xn(this);try{return r.apply(this,arguments)}finally{Ln(this)}}}function Un(r){return function(){var t=this.cm;if(!t||t.curOp){return r.apply(this,arguments)}xn(t);try{return r.apply(this,arguments)}finally{Ln(t)}}}function zn(r,t){if(r.doc.highlightFrontier<r.display.viewTo){r.state.highlight.set(t,W(jn,r))}}function jn(r){var t=r.doc;if(t.highlightFrontier>=r.display.viewTo){return}var e=+new Date+r.options.workTime;var i=Ct(r,t.highlightFrontier);var n=[];t.iter(i.line,Math.min(t.first+t.size,r.display.viewTo+500),(function(o){if(i.line>=r.display.viewFrom){var f=o.styles;var u=o.text.length>r.options.maxHighlightLength?Kr(t.mode,i.state):null;var a=wt(r,o,i,true);if(u){i.state=u}o.styles=a.styles;var l=o.styleClasses,s=a.classes;if(s){o.styleClasses=s}else if(l){o.styleClasses=null}var c=!f||f.length!=o.styles.length||l!=s&&(!l||!s||l.bgClass!=s.bgClass||l.textClass!=s.textClass);for(var v=0;!c&&v<f.length;++v){c=f[v]!=o.styles[v]}if(c){n.push(i.line)}o.stateAfter=i.save();i.nextLine()}else{if(o.text.length<=r.options.maxHighlightLength){Mt(r,o.text,i)}o.stateAfter=i.line%5==0?i.save():null;i.nextLine()}if(+new Date>e){zn(r,r.options.workDelay);return true}}));t.highlightFrontier=i.line;t.modeFrontier=Math.max(t.modeFrontier,i.line);if(n.length){Rn(r,(function(){for(var t=0;t<n.length;t++){Wi(r,n[t],"text")}}))}}var Wn=function(r,t,e){var i=r.display;this.viewport=t;this.visible=en(i,r.doc,t);this.editorIsHidden=!i.wrapper.offsetWidth;this.wrapperHeight=i.wrapper.clientHeight;this.wrapperWidth=i.wrapper.clientWidth;this.oldDisplayWidth=qe(r);this.force=e;this.dims=Ii(r);this.events=[]};Wn.prototype.signal=function(r,t){if(Ar(r,t)){this.events.push(arguments)}};Wn.prototype.finish=function(){for(var r=0;r<this.events.length;r++){kr.apply(null,this.events[r])}};function Fn(r){var t=r.display;if(!t.scrollbarsClipped&&t.scroller.offsetWidth){t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth;t.heightForcer.style.height=Ke(r)+"px";t.sizer.style.marginBottom=-t.nativeBarWidth+"px";t.sizer.style.borderRightWidth=Ke(r)+"px";t.scrollbarsClipped=true}}function Pn(r){if(r.hasFocus()){return null}var t=R(z(r));if(!t||!I(r.display.lineDiv,t)){return null}var e={activeElt:t};if(window.getSelection){var i=j(r).getSelection();if(i.anchorNode&&i.extend&&I(r.display.lineDiv,i.anchorNode)){e.anchorNode=i.anchorNode;e.anchorOffset=i.anchorOffset;e.focusNode=i.focusNode;e.focusOffset=i.focusOffset}}return e}function Gn(r){if(!r||!r.activeElt||r.activeElt==R(r.activeElt.ownerDocument)){return}r.activeElt.focus();if(!/^(INPUT|TEXTAREA)$/.test(r.activeElt.nodeName)&&r.anchorNode&&I(document.body,r.anchorNode)&&I(document.body,r.focusNode)){var t=r.activeElt.ownerDocument;var e=t.defaultView.getSelection(),i=t.createRange();i.setEnd(r.anchorNode,r.anchorOffset);i.collapse(false);e.removeAllRanges();e.addRange(i);e.extend(r.focusNode,r.focusOffset)}}function _n(r,t){var e=r.display,i=r.doc;if(t.editorIsHidden){Fi(r);return false}if(!t.force&&t.visible.from>=e.viewFrom&&t.visible.to<=e.viewTo&&(e.updateLineNumbers==null||e.updateLineNumbers>=e.viewTo)&&e.renderedView==e.view&&_i(r)==0){return false}if(qn(r)){Fi(r);t.dims=Ii(r)}var n=i.first+i.size;var o=Math.max(t.visible.from-r.options.viewportMargin,i.first);var f=Math.min(n,t.visible.to+r.options.viewportMargin);if(e.viewFrom<o&&o-e.viewFrom<20){o=Math.max(i.first,e.viewFrom)}if(e.viewTo>f&&e.viewTo-f<20){f=Math.min(n,e.viewTo)}if(It){o=ie(r.doc,o);f=ne(r.doc,f)}var u=o!=e.viewFrom||f!=e.viewTo||e.lastWrapHeight!=t.wrapperHeight||e.lastWrapWidth!=t.wrapperWidth;Gi(r,o,f);e.viewOffset=ue(Zr(r.doc,e.viewFrom));r.display.mover.style.top=e.viewOffset+"px";var a=_i(r);if(!u&&a==0&&!t.force&&e.renderedView==e.view&&(e.updateLineNumbers==null||e.updateLineNumbers>=e.viewTo)){return false}var l=Pn(r);if(a>4){e.lineDiv.style.display="none"}$n(r,e.updateLineNumbers,t.dims);if(a>4){e.lineDiv.style.display=""}e.renderedView=e.view;Gn(l);S(e.cursorDiv);S(e.selectionDiv);e.gutters.style.height=e.sizer.style.minHeight=0;if(u){e.lastWrapHeight=t.wrapperHeight;e.lastWrapWidth=t.wrapperWidth;zn(r,400)}e.updateLineNumbers=null;return true}function Hn(r,t){var e=t.viewport;for(var i=true;;i=false){if(!i||!r.options.lineWrapping||t.oldDisplayWidth==qe(r)){if(e&&e.top!=null){e={top:Math.min(r.doc.height+Qe(r.display)-Ye(r),e.top)}}t.visible=en(r.display,r.doc,e);if(t.visible.from>=r.display.viewFrom&&t.visible.to<=r.display.viewTo){break}}else if(i){t.visible=en(r.display,r.doc,e)}if(!_n(r,t)){break}rn(r);var n=gn(r);Hi(r);kn(r,n);Jn(r,n);t.force=false}t.signal(r,"update",r);if(r.display.viewFrom!=r.display.reportedViewFrom||r.display.viewTo!=r.display.reportedViewTo){t.signal(r,"viewportChange",r,r.display.viewFrom,r.display.viewTo);r.display.reportedViewFrom=r.display.viewFrom;r.display.reportedViewTo=r.display.viewTo}}function Vn(r,t){var e=new Wn(r,t);if(_n(r,e)){rn(r);Hn(r,e);var i=gn(r);Hi(r);kn(r,i);Jn(r,i);e.finish()}}function $n(r,t,e){var i=r.display,n=r.options.lineNumbers;var o=i.lineDiv,f=o.firstChild;function u(t){var e=t.nextSibling;if(a&&w&&r.display.currentWheelTarget==t){t.style.display="none"}else{t.parentNode.removeChild(t)}return e}var l=i.view,s=i.viewFrom;for(var c=0;c<l.length;c++){var v=l[c];if(v.hidden);else if(!v.node||v.node.parentNode!=o){var h=Fe(r,v,s,e);o.insertBefore(h,f)}else{while(f!=v.node){f=u(f)}var d=n&&t!=null&&t<=s&&v.lineNumber;if(v.changes){if(_(v.changes,"gutter")>-1){d=false}Ie(r,v,s,e)}if(d){S(v.lineNumber);v.lineNumber.appendChild(document.createTextNode(ft(r.options,s)))}f=v.node.nextSibling}s+=v.size}while(f){f=u(f)}}function Qn(r){var t=r.gutters.offsetWidth;r.sizer.style.marginLeft=t+"px";De(r,"gutterChanged",r)}function Jn(r,t){r.display.sizer.style.minHeight=t.docHeight+"px";r.display.heightForcer.style.top=t.docHeight+"px";r.display.gutters.style.height=t.docHeight+r.display.barHeight+Ke(r)+"px"}function Kn(r){var t=r.display,e=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!r.options.fixedGutter)){return}var i=Ri(t)-t.scroller.scrollLeft+r.doc.scrollLeft;var n=t.gutters.offsetWidth,o=i+"px";for(var f=0;f<e.length;f++){if(!e[f].hidden){if(r.options.fixedGutter){if(e[f].gutter){e[f].gutter.style.left=o}if(e[f].gutterBackground){e[f].gutterBackground.style.left=o}}var u=e[f].alignable;if(u){for(var a=0;a<u.length;a++){u[a].style.left=o}}}}if(r.options.fixedGutter){t.gutters.style.left=i+n+"px"}}function qn(r){if(!r.options.lineNumbers){return false}var t=r.doc,e=ft(r.options,t.first+t.size-1),i=r.display;if(e.length!=i.lineNumChars){var n=i.measure.appendChild(E("div",[E("div",e)],"CodeMirror-linenumber CodeMirror-gutter-elt"));var o=n.firstChild.offsetWidth,f=n.offsetWidth-o;i.lineGutter.style.width="";i.lineNumInnerWidth=Math.max(o,i.lineGutter.offsetWidth-f)+1;i.lineNumWidth=i.lineNumInnerWidth+f;i.lineNumChars=i.lineNumInnerWidth?e.length:-1;i.lineGutter.style.width=i.lineNumWidth+"px";Qn(r.display);return true}return false}function Yn(r,t){var e=[],i=false;for(var n=0;n<r.length;n++){var o=r[n],f=null;if(typeof o!="string"){f=o.style;o=o.className}if(o=="CodeMirror-linenumbers"){if(!t){continue}else{i=true}}e.push({className:o,style:f})}if(t&&!i){e.push({className:"CodeMirror-linenumbers",style:null})}return e}function Xn(r){var t=r.gutters,e=r.gutterSpecs;S(t);r.lineGutter=null;for(var i=0;i<e.length;++i){var n=e[i];var o=n.className;var f=n.style;var u=t.appendChild(E("div",null,"CodeMirror-gutter "+o));if(f){u.style.cssText=f}if(o=="CodeMirror-linenumbers"){r.lineGutter=u;u.style.width=(r.lineNumWidth||1)+"px"}}t.style.display=e.length?"":"none";Qn(r)}function Zn(r){Xn(r.display);ji(r);Kn(r)}function ro(r,t,i,n){var o=this;this.input=i;o.scrollbarFiller=E("div",null,"CodeMirror-scrollbar-filler");o.scrollbarFiller.setAttribute("cm-not-content","true");o.gutterFiller=E("div",null,"CodeMirror-gutter-filler");o.gutterFiller.setAttribute("cm-not-content","true");o.lineDiv=D("div",null,"CodeMirror-code");o.selectionDiv=E("div",null,null,"position: relative; z-index: 1");o.cursorDiv=E("div",null,"CodeMirror-cursors");o.measure=E("div",null,"CodeMirror-measure");o.lineMeasure=E("div",null,"CodeMirror-measure");o.lineSpace=D("div",[o.measure,o.lineMeasure,o.selectionDiv,o.cursorDiv,o.lineDiv],null,"position: relative; outline: none");var l=D("div",[o.lineSpace],"CodeMirror-lines");o.mover=E("div",[l],null,"position: relative");o.sizer=E("div",[o.mover],"CodeMirror-sizer");o.sizerWidth=null;o.heightForcer=E("div",null,null,"position: absolute; height: "+H+"px; width: 1px;");o.gutters=E("div",null,"CodeMirror-gutters");o.lineGutter=null;o.scroller=E("div",[o.sizer,o.heightForcer,o.gutters],"CodeMirror-scroll");o.scroller.setAttribute("tabIndex","-1");o.wrapper=E("div",[o.scrollbarFiller,o.gutterFiller,o.scroller],"CodeMirror");if(s&&c>=105){o.wrapper.style.clipPath="inset(0px)"}o.wrapper.setAttribute("translate","no");if(f&&u<8){o.gutters.style.zIndex=-1;o.scroller.style.paddingRight=0}if(!a&&!(e&&b)){o.scroller.draggable=true}if(r){if(r.appendChild){r.appendChild(o.wrapper)}else{r(o.wrapper)}}o.viewFrom=o.viewTo=t.first;o.reportedViewFrom=o.reportedViewTo=t.first;o.view=[];o.renderedView=null;o.externalMeasured=null;o.viewOffset=0;o.lastWrapHeight=o.lastWrapWidth=0;o.updateLineNumbers=null;o.nativeBarWidth=o.barHeight=o.barWidth=0;o.scrollbarsClipped=false;o.lineNumWidth=o.lineNumInnerWidth=o.lineNumChars=null;o.alignWidgets=false;o.cachedCharWidth=o.cachedTextHeight=o.cachedPaddingH=null;o.maxLine=null;o.maxLineLength=0;o.maxLineChanged=false;o.wheelDX=o.wheelDY=o.wheelStartX=o.wheelStartY=null;o.shift=false;o.selForContextMenu=null;o.activeTouch=null;o.gutterSpecs=Yn(n.gutters,n.lineNumbers);Xn(o);i.init(o)}var to=0,eo=null;if(f){eo=-.53}else if(e){eo=15}else if(s){eo=-.7}else if(h){eo=-1/3}function io(r){var t=r.wheelDeltaX,e=r.wheelDeltaY;if(t==null&&r.detail&&r.axis==r.HORIZONTAL_AXIS){t=r.detail}if(e==null&&r.detail&&r.axis==r.VERTICAL_AXIS){e=r.detail}else if(e==null){e=r.wheelDelta}return{x:t,y:e}}function no(r){var t=io(r);t.x*=eo;t.y*=eo;return t}function oo(r,t){if(s&&c==102){if(r.display.chromeScrollHack==null){r.display.sizer.style.pointerEvents="none"}else{clearTimeout(r.display.chromeScrollHack)}r.display.chromeScrollHack=setTimeout((function(){r.display.chromeScrollHack=null;r.display.sizer.style.pointerEvents=""}),100)}var i=io(t),n=i.x,o=i.y;var f=eo;if(t.deltaMode===0){n=t.deltaX;o=t.deltaY;f=1}var u=r.display,l=u.scroller;var h=l.scrollWidth>l.clientWidth;var d=l.scrollHeight>l.clientHeight;if(!(n&&h||o&&d)){return}if(o&&w&&a){r:for(var m=t.target,p=u.view;m!=l;m=m.parentNode){for(var g=0;g<p.length;g++){if(p[g].node==m){r.display.currentWheelTarget=m;break r}}}}if(n&&!e&&!v&&f!=null){if(o&&d){dn(r,Math.max(0,l.scrollTop+o*f))}pn(r,Math.max(0,l.scrollLeft+n*f));if(!o||o&&d){xr(t)}u.wheelStartX=null;return}if(o&&f!=null){var b=o*f;var k=r.doc.scrollTop,C=k+u.wrapper.clientHeight;if(b<0){k=Math.max(0,k+b-50)}else{C=Math.min(r.doc.height,C+b+50)}Vn(r,{top:k,bottom:C})}if(to<20&&t.deltaMode!==0){if(u.wheelStartX==null){u.wheelStartX=l.scrollLeft;u.wheelStartY=l.scrollTop;u.wheelDX=n;u.wheelDY=o;setTimeout((function(){if(u.wheelStartX==null){return}var r=l.scrollLeft-u.wheelStartX;var t=l.scrollTop-u.wheelStartY;var e=t&&u.wheelDY&&t/u.wheelDY||r&&u.wheelDX&&r/u.wheelDX;u.wheelStartX=u.wheelStartY=null;if(!e){return}eo=(eo*to+e)/(to+1);++to}),200)}else{u.wheelDX+=n;u.wheelDY+=o}}}var fo=function(r,t){this.ranges=r;this.primIndex=t};fo.prototype.primary=function(){return this.ranges[this.primIndex]};fo.prototype.equals=function(r){if(r==this){return true}if(r.primIndex!=this.primIndex||r.ranges.length!=this.ranges.length){return false}for(var t=0;t<this.ranges.length;t++){var e=this.ranges[t],i=r.ranges[t];if(!lt(e.anchor,i.anchor)||!lt(e.head,i.head)){return false}}return true};fo.prototype.deepCopy=function(){var r=[];for(var t=0;t<this.ranges.length;t++){r[t]=new uo(st(this.ranges[t].anchor),st(this.ranges[t].head))}return new fo(r,this.primIndex)};fo.prototype.somethingSelected=function(){for(var r=0;r<this.ranges.length;r++){if(!this.ranges[r].empty()){return true}}return false};fo.prototype.contains=function(r,t){if(!t){t=r}for(var e=0;e<this.ranges.length;e++){var i=this.ranges[e];if(at(t,i.from())>=0&&at(r,i.to())<=0){return e}}return-1};var uo=function(r,t){this.anchor=r;this.head=t};uo.prototype.from=function(){return vt(this.anchor,this.head)};uo.prototype.to=function(){return ct(this.anchor,this.head)};uo.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function ao(r,t,e){var i=r&&r.options.selectionsMayTouch;var n=t[e];t.sort((function(r,t){return at(r.from(),t.from())}));e=_(t,n);for(var o=1;o<t.length;o++){var f=t[o],u=t[o-1];var a=at(u.to(),f.from());if(i&&!f.empty()?a>0:a>=0){var l=vt(u.from(),f.from()),s=ct(u.to(),f.to());var c=u.empty()?f.from()==f.head:u.from()==u.head;if(o<=e){--e}t.splice(--o,2,new uo(c?s:l,c?l:s))}}return new fo(t,e)}function lo(r,t){return new fo([new uo(r,t||r)],0)}function so(r){if(!r.text){return r.to}return ut(r.from.line+r.text.length-1,X(r.text).length+(r.text.length==1?r.from.ch:0))}function co(r,t){if(at(r,t.from)<0){return r}if(at(r,t.to)<=0){return so(t)}var e=r.line+t.text.length-(t.to.line-t.from.line)-1,i=r.ch;if(r.line==t.to.line){i+=so(t).ch-t.to.ch}return ut(e,i)}function vo(r,t){var e=[];for(var i=0;i<r.sel.ranges.length;i++){var n=r.sel.ranges[i];e.push(new uo(co(n.anchor,t),co(n.head,t)))}return ao(r.cm,e,r.sel.primIndex)}function ho(r,t,e){if(r.line==t.line){return ut(e.line,r.ch-t.ch+e.ch)}else{return ut(e.line+(r.line-t.line),r.ch)}}function mo(r,t,e){var i=[];var n=ut(r.first,0),o=n;for(var f=0;f<t.length;f++){var u=t[f];var a=ho(u.from,n,o);var l=ho(so(u),n,o);n=u.to;o=l;if(e=="around"){var s=r.sel.ranges[f],c=at(s.head,s.anchor)<0;i[f]=new uo(c?l:a,c?a:l)}else{i[f]=new uo(a,a)}}return new fo(i,r.sel.primIndex)}function po(r){r.doc.mode=$r(r.options,r.doc.modeOption);go(r)}function go(r){r.doc.iter((function(r){if(r.stateAfter){r.stateAfter=null}if(r.styles){r.styles=null}}));r.doc.modeFrontier=r.doc.highlightFrontier=r.doc.first;zn(r,100);r.state.modeGen++;if(r.curOp){ji(r)}}function bo(r,t){return t.from.ch==0&&t.to.ch==0&&X(t.text)==""&&(!r.cm||r.cm.options.wholeLineUpdateBefore)}function wo(r,t,e,i){function n(r){return e?e[r]:null}function o(r,e,n){ce(r,e,n,i);De(r,"change",r,t)}function f(r,t){var e=[];for(var o=r;o<t;++o){e.push(new se(l[o],n(o),i))}return e}var u=t.from,a=t.to,l=t.text;var s=Zr(r,u.line),c=Zr(r,a.line);var v=X(l),h=n(l.length-1),d=a.line-u.line;if(t.full){r.insert(0,f(0,l.length));r.remove(l.length,r.size-l.length)}else if(bo(r,t)){var m=f(0,l.length-1);o(c,c.text,h);if(d){r.remove(u.line,d)}if(m.length){r.insert(u.line,m)}}else if(s==c){if(l.length==1){o(s,s.text.slice(0,u.ch)+v+s.text.slice(a.ch),h)}else{var p=f(1,l.length-1);p.push(new se(v+s.text.slice(a.ch),h,i));o(s,s.text.slice(0,u.ch)+l[0],n(0));r.insert(u.line+1,p)}}else if(l.length==1){o(s,s.text.slice(0,u.ch)+l[0]+c.text.slice(a.ch),n(0));r.remove(u.line+1,d)}else{o(s,s.text.slice(0,u.ch)+l[0],n(0));o(c,v+c.text.slice(a.ch),h);var g=f(1,l.length-1);if(d>1){r.remove(u.line+1,d-1)}r.insert(u.line+1,g)}De(r,"change",r,t)}function ko(r,t,e){function i(r,n,o){if(r.linked){for(var f=0;f<r.linked.length;++f){var u=r.linked[f];if(u.doc==n){continue}var a=o&&u.sharedHist;if(e&&!a){continue}t(u.doc,a);i(u.doc,r,a)}}}i(r,null,true)}function Co(r,t){if(t.cm){throw new Error("This document is already in use.")}r.doc=t;t.cm=r;Bi(r);po(r);Mo(r);r.options.direction=t.direction;if(!r.options.lineWrapping){le(r)}r.options.mode=t.modeOption;ji(r)}function Mo(r){(r.doc.direction=="rtl"?O:L)(r.display.lineDiv,"CodeMirror-rtl")}function Ao(r){Rn(r,(function(){Mo(r);ji(r)}))}function yo(r){this.done=[];this.undone=[];this.undoDepth=r?r.undoDepth:Infinity;this.lastModTime=this.lastSelTime=0;this.lastOp=this.lastSelOp=null;this.lastOrigin=this.lastSelOrigin=null;this.generation=this.maxGeneration=r?r.maxGeneration:1}function xo(r,t){var e={from:st(t.from),to:so(t),text:rt(r,t.from,t.to)};Io(r,e,t.from.line,t.to.line+1);ko(r,(function(r){return Io(r,e,t.from.line,t.to.line+1)}),true);return e}function Lo(r){while(r.length){var t=X(r);if(t.ranges){r.pop()}else{break}}}function So(r,t){if(t){Lo(r.done);return X(r.done)}else if(r.done.length&&!X(r.done).ranges){return X(r.done)}else if(r.done.length>1&&!r.done[r.done.length-2].ranges){r.done.pop();return X(r.done)}}function No(r,t,e,i){var n=r.history;n.undone.length=0;var o=+new Date,f;var u;if((n.lastOp==i||n.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&n.lastModTime>o-(r.cm?r.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(f=So(n,n.lastOp==i))){u=X(f.changes);if(at(t.from,t.to)==0&&at(t.from,u.to)==0){u.to=so(t)}else{f.changes.push(xo(r,t))}}else{var a=X(n.done);if(!a||!a.ranges){To(r.sel,n.done)}f={changes:[xo(r,t)],generation:n.generation};n.done.push(f);while(n.done.length>n.undoDepth){n.done.shift();if(!n.done[0].ranges){n.done.shift()}}}n.done.push(e);n.generation=++n.maxGeneration;n.lastModTime=n.lastSelTime=o;n.lastOp=n.lastSelOp=i;n.lastOrigin=n.lastSelOrigin=t.origin;if(!u){kr(r,"historyAdded")}}function Eo(r,t,e,i){var n=t.charAt(0);return n=="*"||n=="+"&&e.ranges.length==i.ranges.length&&e.somethingSelected()==i.somethingSelected()&&new Date-r.history.lastSelTime<=(r.cm?r.cm.options.historyEventDelay:500)}function Do(r,t,e,i){var n=r.history,o=i&&i.origin;if(e==n.lastSelOp||o&&n.lastSelOrigin==o&&(n.lastModTime==n.lastSelTime&&n.lastOrigin==o||Eo(r,o,X(n.done),t))){n.done[n.done.length-1]=t}else{To(t,n.done)}n.lastSelTime=+new Date;n.lastSelOrigin=o;n.lastSelOp=e;if(i&&i.clearRedo!==false){Lo(n.undone)}}function To(r,t){var e=X(t);if(!(e&&e.ranges&&e.equals(r))){t.push(r)}}function Io(r,t,e,i){var n=t["spans_"+r.id],o=0;r.iter(Math.max(r.first,e),Math.min(r.first+r.size,i),(function(e){if(e.markedSpans){(n||(n=t["spans_"+r.id]={}))[o]=e.markedSpans}++o}))}function Ro(r){if(!r){return null}var t;for(var e=0;e<r.length;++e){if(r[e].marker.explicitlyCleared){if(!t){t=r.slice(0,e)}}else if(t){t.push(r[e])}}return!t?r:t.length?t:null}function Oo(r,t){var e=t["spans_"+r.id];if(!e){return null}var i=[];for(var n=0;n<t.text.length;++n){i.push(Ro(e[n]))}return i}function Bo(r,t){var e=Oo(r,t);var i=Pt(r,t);if(!e){return i}if(!i){return e}for(var n=0;n<e.length;++n){var o=e[n],f=i[n];if(o&&f){r:for(var u=0;u<f.length;++u){var a=f[u];for(var l=0;l<o.length;++l){if(o[l].marker==a.marker){continue r}}o.push(a)}}else if(f){e[n]=f}}return e}function Uo(r,t,e){var i=[];for(var n=0;n<r.length;++n){var o=r[n];if(o.ranges){i.push(e?fo.prototype.deepCopy.call(o):o);continue}var f=o.changes,u=[];i.push({changes:u});for(var a=0;a<f.length;++a){var l=f[a],s=void 0;u.push({from:l.from,to:l.to,text:l.text});if(t){for(var c in l){if(s=c.match(/^spans_(\d+)$/)){if(_(t,Number(s[1]))>-1){X(u)[c]=l[c];delete l[c]}}}}}}return i}function zo(r,t,e,i){if(i){var n=r.anchor;if(e){var o=at(t,n)<0;if(o!=at(e,n)<0){n=t;t=e}else if(o!=at(t,e)<0){t=e}}return new uo(n,t)}else{return new uo(e||t,t)}}function jo(r,t,e,i,n){if(n==null){n=r.cm&&(r.cm.display.shift||r.extend)}Ho(r,new fo([zo(r.sel.primary(),t,e,n)],0),i)}function Wo(r,t,e){var i=[];var n=r.cm&&(r.cm.display.shift||r.extend);for(var o=0;o<r.sel.ranges.length;o++){i[o]=zo(r.sel.ranges[o],t[o],null,n)}var f=ao(r.cm,i,r.sel.primIndex);Ho(r,f,e)}function Fo(r,t,e,i){var n=r.sel.ranges.slice(0);n[t]=e;Ho(r,ao(r.cm,n,r.sel.primIndex),i)}function Po(r,t,e,i){Ho(r,lo(t,e),i)}function Go(r,t,e){var i={ranges:t.ranges,update:function(t){this.ranges=[];for(var e=0;e<t.length;e++){this.ranges[e]=new uo(dt(r,t[e].anchor),dt(r,t[e].head))}},origin:e&&e.origin};kr(r,"beforeSelectionChange",r,i);if(r.cm){kr(r.cm,"beforeSelectionChange",r.cm,i)}if(i.ranges!=t.ranges){return ao(r.cm,i.ranges,i.ranges.length-1)}else{return t}}function _o(r,t,e){var i=r.history.done,n=X(i);if(n&&n.ranges){i[i.length-1]=t;Vo(r,t,e)}else{Ho(r,t,e)}}function Ho(r,t,e){Vo(r,t,e);Do(r,r.sel,r.cm?r.cm.curOp.id:NaN,e)}function Vo(r,t,e){if(Ar(r,"beforeSelectionChange")||r.cm&&Ar(r.cm,"beforeSelectionChange")){t=Go(r,t,e)}var i=e&&e.bias||(at(t.primary().head,r.sel.primary().head)<0?-1:1);$o(r,Jo(r,t,i,true));if(!(e&&e.scroll===false)&&r.cm&&r.cm.getOption("readOnly")!="nocursor"){ln(r.cm)}}function $o(r,t){if(t.equals(r.sel)){return}r.sel=t;if(r.cm){r.cm.curOp.updateInput=1;r.cm.curOp.selectionChanged=true;Mr(r.cm)}De(r,"cursorActivity",r)}function Qo(r){$o(r,Jo(r,r.sel,null,false))}function Jo(r,t,e,i){var n;for(var o=0;o<t.ranges.length;o++){var f=t.ranges[o];var u=t.ranges.length==r.sel.ranges.length&&r.sel.ranges[o];var a=qo(r,f.anchor,u&&u.anchor,e,i);var l=f.head==f.anchor?a:qo(r,f.head,u&&u.head,e,i);if(n||a!=f.anchor||l!=f.head){if(!n){n=t.ranges.slice(0,o)}n[o]=new uo(a,l)}}return n?ao(r.cm,n,t.primIndex):t}function Ko(r,t,e,i,n){var o=Zr(r,t.line);if(o.markedSpans){for(var f=0;f<o.markedSpans.length;++f){var u=o.markedSpans[f],a=u.marker;var l="selectLeft"in a?!a.selectLeft:a.inclusiveLeft;var s="selectRight"in a?!a.selectRight:a.inclusiveRight;if((u.from==null||(l?u.from<=t.ch:u.from<t.ch))&&(u.to==null||(s?u.to>=t.ch:u.to>t.ch))){if(n){kr(a,"beforeCursorEnter");if(a.explicitlyCleared){if(!o.markedSpans){break}else{--f;continue}}}if(!a.atomic){continue}if(e){var c=a.find(i<0?1:-1),v=void 0;if(i<0?s:l){c=Yo(r,c,-i,c&&c.line==t.line?o:null)}if(c&&c.line==t.line&&(v=at(c,e))&&(i<0?v<0:v>0)){return Ko(r,c,t,i,n)}}var h=a.find(i<0?-1:1);if(i<0?l:s){h=Yo(r,h,i,h.line==t.line?o:null)}return h?Ko(r,h,t,i,n):null}}}return t}function qo(r,t,e,i,n){var o=i||1;var f=Ko(r,t,e,o,n)||!n&&Ko(r,t,e,o,true)||Ko(r,t,e,-o,n)||!n&&Ko(r,t,e,-o,true);if(!f){r.cantEdit=true;return ut(r.first,0)}return f}function Yo(r,t,e,i){if(e<0&&t.ch==0){if(t.line>r.first){return dt(r,ut(t.line-1))}else{return null}}else if(e>0&&t.ch==(i||Zr(r,t.line)).text.length){if(t.line<r.first+r.size-1){return ut(t.line+1,0)}else{return null}}else{return new ut(t.line,t.ch+e)}}function Xo(r){r.setSelection(ut(r.firstLine(),0),ut(r.lastLine()),$)}function Zo(r,t,e){var i={canceled:false,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return i.canceled=true}};if(e){i.update=function(t,e,n,o){if(t){i.from=dt(r,t)}if(e){i.to=dt(r,e)}if(n){i.text=n}if(o!==undefined){i.origin=o}}}kr(r,"beforeChange",r,i);if(r.cm){kr(r.cm,"beforeChange",r.cm,i)}if(i.canceled){if(r.cm){r.cm.curOp.updateInput=2}return null}return{from:i.from,to:i.to,text:i.text,origin:i.origin}}function rf(r,t,e){if(r.cm){if(!r.cm.curOp){return On(r.cm,rf)(r,t,e)}if(r.cm.state.suppressEdits){return}}if(Ar(r,"beforeChange")||r.cm&&Ar(r.cm,"beforeChange")){t=Zo(r,t,true);if(!t){return}}var i=Tt&&!e&&_t(r,t.from,t.to);if(i){for(var n=i.length-1;n>=0;--n){tf(r,{from:i[n].from,to:i[n].to,text:n?[""]:t.text,origin:t.origin})}}else{tf(r,t)}}function tf(r,t){if(t.text.length==1&&t.text[0]==""&&at(t.from,t.to)==0){return}var e=vo(r,t);No(r,t,e,r.cm?r.cm.curOp.id:NaN);of(r,t,e,Pt(r,t));var i=[];ko(r,(function(r,e){if(!e&&_(i,r.history)==-1){sf(r.history,t);i.push(r.history)}of(r,t,null,Pt(r,t))}))}function ef(r,t,e){var i=r.cm&&r.cm.state.suppressEdits;if(i&&!e){return}var n=r.history,o,f=r.sel;var u=t=="undo"?n.done:n.undone,a=t=="undo"?n.undone:n.done;var l=0;for(;l<u.length;l++){o=u[l];if(e?o.ranges&&!o.equals(r.sel):!o.ranges){break}}if(l==u.length){return}n.lastOrigin=n.lastSelOrigin=null;for(;;){o=u.pop();if(o.ranges){To(o,a);if(e&&!o.equals(r.sel)){Ho(r,o,{clearRedo:false});return}f=o}else if(i){u.push(o);return}else{break}}var s=[];To(f,a);a.push({changes:s,generation:n.generation});n.generation=o.generation||++n.maxGeneration;var c=Ar(r,"beforeChange")||r.cm&&Ar(r.cm,"beforeChange");var v=function(e){var i=o.changes[e];i.origin=t;if(c&&!Zo(r,i,false)){u.length=0;return{}}s.push(xo(r,i));var n=e?vo(r,i):X(u);of(r,i,n,Bo(r,i));if(!e&&r.cm){r.cm.scrollIntoView({from:i.from,to:so(i)})}var f=[];ko(r,(function(r,t){if(!t&&_(f,r.history)==-1){sf(r.history,i);f.push(r.history)}of(r,i,null,Bo(r,i))}))};for(var h=o.changes.length-1;h>=0;--h){var d=v(h);if(d)return d.v}}function nf(r,t){if(t==0){return}r.first+=t;r.sel=new fo(Z(r.sel.ranges,(function(r){return new uo(ut(r.anchor.line+t,r.anchor.ch),ut(r.head.line+t,r.head.ch))})),r.sel.primIndex);if(r.cm){ji(r.cm,r.first,r.first-t,t);for(var e=r.cm.display,i=e.viewFrom;i<e.viewTo;i++){Wi(r.cm,i,"gutter")}}}function of(r,t,e,i){if(r.cm&&!r.cm.curOp){return On(r.cm,of)(r,t,e,i)}if(t.to.line<r.first){nf(r,t.text.length-1-(t.to.line-t.from.line));return}if(t.from.line>r.lastLine()){return}if(t.from.line<r.first){var n=t.text.length-1-(r.first-t.from.line);nf(r,n);t={from:ut(r.first,0),to:ut(t.to.line+n,t.to.ch),text:[X(t.text)],origin:t.origin}}var o=r.lastLine();if(t.to.line>o){t={from:t.from,to:ut(o,Zr(r,o).text.length),text:[t.text[0]],origin:t.origin}}t.removed=rt(r,t.from,t.to);if(!e){e=vo(r,t)}if(r.cm){ff(r.cm,t,i)}else{wo(r,t,i)}Vo(r,e,$);if(r.cantEdit&&qo(r,ut(r.firstLine(),0))){r.cantEdit=false}}function ff(r,t,e){var i=r.doc,n=r.display,o=t.from,f=t.to;var u=false,a=o.line;if(!r.options.lineWrapping){a=it(re(Zr(i,o.line)));i.iter(a,f.line+1,(function(r){if(r==n.maxLine){u=true;return true}}))}if(i.sel.contains(t.from,t.to)>-1){Mr(r)}wo(i,t,e,Oi(r));if(!r.options.lineWrapping){i.iter(a,o.line+t.text.length,(function(r){var t=ae(r);if(t>n.maxLineLength){n.maxLine=r;n.maxLineLength=t;n.maxLineChanged=true;u=false}}));if(u){r.curOp.updateMaxLine=true}}Dt(i,o.line);zn(r,400);var l=t.text.length-(f.line-o.line)-1;if(t.full){ji(r)}else if(o.line==f.line&&t.text.length==1&&!bo(r.doc,t)){Wi(r,o.line,"text")}else{ji(r,o.line,f.line+1,l)}var s=Ar(r,"changes"),c=Ar(r,"change");if(c||s){var v={from:o,to:f,text:t.text,removed:t.removed,origin:t.origin};if(c){De(r,"change",r,v)}if(s){(r.curOp.changeObjs||(r.curOp.changeObjs=[])).push(v)}}r.display.selForContextMenu=null}function uf(r,t,e,i,n){var o;if(!i){i=e}if(at(i,e)<0){o=[i,e],e=o[0],i=o[1]}if(typeof t=="string"){t=r.splitLines(t)}rf(r,{from:e,to:i,text:t,origin:n})}function af(r,t,e,i){if(e<r.line){r.line+=i}else if(t<r.line){r.line=t;r.ch=0}}function lf(r,t,e,i){for(var n=0;n<r.length;++n){var o=r[n],f=true;if(o.ranges){if(!o.copied){o=r[n]=o.deepCopy();o.copied=true}for(var u=0;u<o.ranges.length;u++){af(o.ranges[u].anchor,t,e,i);af(o.ranges[u].head,t,e,i)}continue}for(var a=0;a<o.changes.length;++a){var l=o.changes[a];if(e<l.from.line){l.from=ut(l.from.line+i,l.from.ch);l.to=ut(l.to.line+i,l.to.ch)}else if(t<=l.to.line){f=false;break}}if(!f){r.splice(0,n+1);n=0}}}function sf(r,t){var e=t.from.line,i=t.to.line,n=t.text.length-(i-e)-1;lf(r.done,e,i,n);lf(r.undone,e,i,n)}function cf(r,t,e,i){var n=t,o=t;if(typeof t=="number"){o=Zr(r,ht(r,t))}else{n=it(t)}if(n==null){return null}if(i(o,n)&&r.cm){Wi(r.cm,n,e)}return o}function vf(r){this.lines=r;this.parent=null;var t=0;for(var e=0;e<r.length;++e){r[e].parent=this;t+=r[e].height}this.height=t}vf.prototype={chunkSize:function(){return this.lines.length},removeInner:function(r,t){for(var e=r,i=r+t;e<i;++e){var n=this.lines[e];this.height-=n.height;ve(n);De(n,"delete")}this.lines.splice(r,t)},collapse:function(r){r.push.apply(r,this.lines)},insertInner:function(r,t,e){this.height+=e;this.lines=this.lines.slice(0,r).concat(t).concat(this.lines.slice(r));for(var i=0;i<t.length;++i){t[i].parent=this}},iterN:function(r,t,e){for(var i=r+t;r<i;++r){if(e(this.lines[r])){return true}}}};function hf(r){this.children=r;var t=0,e=0;for(var i=0;i<r.length;++i){var n=r[i];t+=n.chunkSize();e+=n.height;n.parent=this}this.size=t;this.height=e;this.parent=null}hf.prototype={chunkSize:function(){return this.size},removeInner:function(r,t){this.size-=t;for(var e=0;e<this.children.length;++e){var i=this.children[e],n=i.chunkSize();if(r<n){var o=Math.min(t,n-r),f=i.height;i.removeInner(r,o);this.height-=f-i.height;if(n==o){this.children.splice(e--,1);i.parent=null}if((t-=o)==0){break}r=0}else{r-=n}}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof vf))){var u=[];this.collapse(u);this.children=[new vf(u)];this.children[0].parent=this}},collapse:function(r){for(var t=0;t<this.children.length;++t){this.children[t].collapse(r)}},insertInner:function(r,t,e){this.size+=t.length;this.height+=e;for(var i=0;i<this.children.length;++i){var n=this.children[i],o=n.chunkSize();if(r<=o){n.insertInner(r,t,e);if(n.lines&&n.lines.length>50){var f=n.lines.length%25+25;for(var u=f;u<n.lines.length;){var a=new vf(n.lines.slice(u,u+=25));n.height-=a.height;this.children.splice(++i,0,a);a.parent=this}n.lines=n.lines.slice(0,f);this.maybeSpill()}break}r-=o}},maybeSpill:function(){if(this.children.length<=10){return}var r=this;do{var t=r.children.splice(r.children.length-5,5);var e=new hf(t);if(!r.parent){var i=new hf(r.children);i.parent=r;r.children=[i,e];r=i}else{r.size-=e.size;r.height-=e.height;var n=_(r.parent.children,r);r.parent.children.splice(n+1,0,e)}e.parent=r.parent}while(r.children.length>10);r.parent.maybeSpill()},iterN:function(r,t,e){for(var i=0;i<this.children.length;++i){var n=this.children[i],o=n.chunkSize();if(r<o){var f=Math.min(t,o-r);if(n.iterN(r,f,e)){return true}if((t-=f)==0){break}r=0}else{r-=o}}}};var df=function(r,t,e){if(e){for(var i in e){if(e.hasOwnProperty(i)){this[i]=e[i]}}}this.doc=r;this.node=t};df.prototype.clear=function(){var r=this.doc.cm,t=this.line.widgets,e=this.line,i=it(e);if(i==null||!t){return}for(var n=0;n<t.length;++n){if(t[n]==this){t.splice(n--,1)}}if(!t.length){e.widgets=null}var o=He(this);et(e,Math.max(0,e.height-o));if(r){Rn(r,(function(){mf(r,e,-o);Wi(r,i,"widget")}));De(r,"lineWidgetCleared",r,this,i)}};df.prototype.changed=function(){var r=this;var t=this.height,e=this.doc.cm,i=this.line;this.height=null;var n=He(this)-t;if(!n){return}if(!oe(this.doc,i)){et(i,i.height+n)}if(e){Rn(e,(function(){e.curOp.forceUpdate=true;mf(e,i,n);De(e,"lineWidgetChanged",e,r,it(i))}))}};yr(df);function mf(r,t,e){if(ue(t)<(r.curOp&&r.curOp.scrollTop||r.doc.scrollTop)){an(r,e)}}function pf(r,t,e,i){var n=new df(r,e,i);var o=r.cm;if(o&&n.noHScroll){o.display.alignWidgets=true}cf(r,t,"widget",(function(t){var e=t.widgets||(t.widgets=[]);if(n.insertAt==null){e.push(n)}else{e.splice(Math.min(e.length,Math.max(0,n.insertAt)),0,n)}n.line=t;if(o&&!oe(r,t)){var i=ue(t)<r.scrollTop;et(t,t.height+He(n));if(i){an(o,n.height)}o.curOp.forceUpdate=true}return true}));if(o){De(o,"lineWidgetAdded",o,n,typeof t=="number"?t:it(t))}return n}var gf=0;var bf=function(r,t){this.lines=[];this.type=t;this.doc=r;this.id=++gf};bf.prototype.clear=function(){if(this.explicitlyCleared){return}var r=this.doc.cm,t=r&&!r.curOp;if(t){xn(r)}if(Ar(this,"clear")){var e=this.find();if(e){De(this,"clear",e.from,e.to)}}var i=null,n=null;for(var o=0;o<this.lines.length;++o){var f=this.lines[o];var u=Ut(f.markedSpans,this);if(r&&!this.collapsed){Wi(r,it(f),"text")}else if(r){if(u.to!=null){n=it(f)}if(u.from!=null){i=it(f)}}f.markedSpans=zt(f.markedSpans,u);if(u.from==null&&this.collapsed&&!oe(this.doc,f)&&r){et(f,Di(r.display))}}if(r&&this.collapsed&&!r.options.lineWrapping){for(var a=0;a<this.lines.length;++a){var l=re(this.lines[a]),s=ae(l);if(s>r.display.maxLineLength){r.display.maxLine=l;r.display.maxLineLength=s;r.display.maxLineChanged=true}}}if(i!=null&&r&&this.collapsed){ji(r,i,n+1)}this.lines.length=0;this.explicitlyCleared=true;if(this.atomic&&this.doc.cantEdit){this.doc.cantEdit=false;if(r){Qo(r.doc)}}if(r){De(r,"markerCleared",r,this,i,n)}if(t){Ln(r)}if(this.parent){this.parent.clear()}};bf.prototype.find=function(r,t){if(r==null&&this.type=="bookmark"){r=1}var e,i;for(var n=0;n<this.lines.length;++n){var o=this.lines[n];var f=Ut(o.markedSpans,this);if(f.from!=null){e=ut(t?o:it(o),f.from);if(r==-1){return e}}if(f.to!=null){i=ut(t?o:it(o),f.to);if(r==1){return i}}}return e&&{from:e,to:i}};bf.prototype.changed=function(){var r=this;var t=this.find(-1,true),e=this,i=this.doc.cm;if(!t||!i){return}Rn(i,(function(){var n=t.line,o=it(t.line);var f=ei(i,o);if(f){si(f);i.curOp.selectionChanged=i.curOp.forceUpdate=true}i.curOp.updateMaxLine=true;if(!oe(e.doc,n)&&e.height!=null){var u=e.height;e.height=null;var a=He(e)-u;if(a){et(n,n.height+a)}}De(i,"markerChanged",i,r)}))};bf.prototype.attachLine=function(r){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;if(!t.maybeHiddenMarkers||_(t.maybeHiddenMarkers,this)==-1){(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}}this.lines.push(r)};bf.prototype.detachLine=function(r){this.lines.splice(_(this.lines,r),1);if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}};yr(bf);function wf(r,t,e,i,n){if(i&&i.shared){return Cf(r,t,e,i,n)}if(r.cm&&!r.cm.curOp){return On(r.cm,wf)(r,t,e,i,n)}var o=new bf(r,n),f=at(t,e);if(i){F(i,o,false)}if(f>0||f==0&&o.clearWhenEmpty!==false){return o}if(o.replacedWith){o.collapsed=true;o.widgetNode=D("span",[o.replacedWith],"CodeMirror-widget");if(!i.handleMouseEvents){o.widgetNode.setAttribute("cm-ignore-events","true")}if(i.insertLeft){o.widgetNode.insertLeft=true}}if(o.collapsed){if(Zt(r,t.line,t,e,o)||t.line!=e.line&&Zt(r,e.line,t,e,o)){throw new Error("Inserting collapsed marker partially overlapping an existing one")}Ot()}if(o.addToHistory){No(r,{from:t,to:e,origin:"markText"},r.sel,NaN)}var u=t.line,a=r.cm,l;r.iter(u,e.line+1,(function(i){if(a&&o.collapsed&&!a.options.lineWrapping&&re(i)==a.display.maxLine){l=true}if(o.collapsed&&u!=t.line){et(i,0)}jt(i,new Bt(o,u==t.line?t.ch:null,u==e.line?e.ch:null),r.cm&&r.cm.curOp);++u}));if(o.collapsed){r.iter(t.line,e.line+1,(function(t){if(oe(r,t)){et(t,0)}}))}if(o.clearOnEnter){gr(o,"beforeCursorEnter",(function(){return o.clear()}))}if(o.readOnly){Rt();if(r.history.done.length||r.history.undone.length){r.clearHistory()}}if(o.collapsed){o.id=++gf;o.atomic=true}if(a){if(l){a.curOp.updateMaxLine=true}if(o.collapsed){ji(a,t.line,e.line+1)}else if(o.className||o.startStyle||o.endStyle||o.css||o.attributes||o.title){for(var s=t.line;s<=e.line;s++){Wi(a,s,"text")}}if(o.atomic){Qo(a.doc)}De(a,"markerAdded",a,o)}return o}var kf=function(r,t){this.markers=r;this.primary=t;for(var e=0;e<r.length;++e){r[e].parent=this}};kf.prototype.clear=function(){if(this.explicitlyCleared){return}this.explicitlyCleared=true;for(var r=0;r<this.markers.length;++r){this.markers[r].clear()}De(this,"clear")};kf.prototype.find=function(r,t){return this.primary.find(r,t)};yr(kf);function Cf(r,t,e,i,n){i=F(i);i.shared=false;var o=[wf(r,t,e,i,n)],f=o[0];var u=i.widgetNode;ko(r,(function(r){if(u){i.widgetNode=u.cloneNode(true)}o.push(wf(r,dt(r,t),dt(r,e),i,n));for(var a=0;a<r.linked.length;++a){if(r.linked[a].isParent){return}}f=X(o)}));return new kf(o,f)}function Mf(r){return r.findMarks(ut(r.first,0),r.clipPos(ut(r.lastLine())),(function(r){return r.parent}))}function Af(r,t){for(var e=0;e<t.length;e++){var i=t[e],n=i.find();var o=r.clipPos(n.from),f=r.clipPos(n.to);if(at(o,f)){var u=wf(r,o,f,i.primary,i.primary.type);i.markers.push(u);u.parent=i}}}function yf(r){var t=function(t){var e=r[t],i=[e.primary.doc];ko(e.primary.doc,(function(r){return i.push(r)}));for(var n=0;n<e.markers.length;n++){var o=e.markers[n];if(_(i,o.doc)==-1){o.parent=null;e.markers.splice(n--,1)}}};for(var e=0;e<r.length;e++)t(e)}var xf=0;var Lf=function(r,t,e,i,n){if(!(this instanceof Lf)){return new Lf(r,t,e,i,n)}if(e==null){e=0}hf.call(this,[new vf([new se("",null)])]);this.first=e;this.scrollTop=this.scrollLeft=0;this.cantEdit=false;this.cleanGeneration=1;this.modeFrontier=this.highlightFrontier=e;var o=ut(e,0);this.sel=lo(o);this.history=new yo(null);this.id=++xf;this.modeOption=t;this.lineSep=i;this.direction=n=="rtl"?"rtl":"ltr";this.extend=false;if(typeof r=="string"){r=this.splitLines(r)}wo(this,{from:o,to:o,text:r});Ho(this,lo(o),$)};Lf.prototype=er(hf.prototype,{constructor:Lf,iter:function(r,t,e){if(e){this.iterN(r-this.first,t-r,e)}else{this.iterN(this.first,this.first+this.size,r)}},insert:function(r,t){var e=0;for(var i=0;i<t.length;++i){e+=t[i].height}this.insertInner(r-this.first,t,e)},remove:function(r,t){this.removeInner(r-this.first,t)},getValue:function(r){var t=tt(this,this.first,this.first+this.size);if(r===false){return t}return t.join(r||this.lineSeparator())},setValue:Un((function(r){var t=ut(this.first,0),e=this.first+this.size-1;rf(this,{from:t,to:ut(e,Zr(this,e).text.length),text:this.splitLines(r),origin:"setValue",full:true},true);if(this.cm){sn(this.cm,0,0)}Ho(this,lo(t),$)})),replaceRange:function(r,t,e,i){t=dt(this,t);e=e?dt(this,e):t;uf(this,r,t,e,i)},getRange:function(r,t,e){var i=rt(this,dt(this,r),dt(this,t));if(e===false){return i}if(e===""){return i.join("")}return i.join(e||this.lineSeparator())},getLine:function(r){var t=this.getLineHandle(r);return t&&t.text},getLineHandle:function(r){if(ot(this,r)){return Zr(this,r)}},getLineNumber:function(r){return it(r)},getLineHandleVisualStart:function(r){if(typeof r=="number"){r=Zr(this,r)}return re(r)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(r){return dt(this,r)},getCursor:function(r){var t=this.sel.primary(),e;if(r==null||r=="head"){e=t.head}else if(r=="anchor"){e=t.anchor}else if(r=="end"||r=="to"||r===false){e=t.to()}else{e=t.from()}return e},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:Un((function(r,t,e){Po(this,dt(this,typeof r=="number"?ut(r,t||0):r),null,e)})),setSelection:Un((function(r,t,e){Po(this,dt(this,r),dt(this,t||r),e)})),extendSelection:Un((function(r,t,e){jo(this,dt(this,r),t&&dt(this,t),e)})),extendSelections:Un((function(r,t){Wo(this,pt(this,r),t)})),extendSelectionsBy:Un((function(r,t){var e=Z(this.sel.ranges,r);Wo(this,pt(this,e),t)})),setSelections:Un((function(r,t,e){if(!r.length){return}var i=[];for(var n=0;n<r.length;n++){i[n]=new uo(dt(this,r[n].anchor),dt(this,r[n].head||r[n].anchor))}if(t==null){t=Math.min(r.length-1,this.sel.primIndex)}Ho(this,ao(this.cm,i,t),e)})),addSelection:Un((function(r,t,e){var i=this.sel.ranges.slice(0);i.push(new uo(dt(this,r),dt(this,t||r)));Ho(this,ao(this.cm,i,i.length-1),e)})),getSelection:function(r){var t=this.sel.ranges,e;for(var i=0;i<t.length;i++){var n=rt(this,t[i].from(),t[i].to());e=e?e.concat(n):n}if(r===false){return e}else{return e.join(r||this.lineSeparator())}},getSelections:function(r){var t=[],e=this.sel.ranges;for(var i=0;i<e.length;i++){var n=rt(this,e[i].from(),e[i].to());if(r!==false){n=n.join(r||this.lineSeparator())}t[i]=n}return t},replaceSelection:function(r,t,e){var i=[];for(var n=0;n<this.sel.ranges.length;n++){i[n]=r}this.replaceSelections(i,t,e||"+input")},replaceSelections:Un((function(r,t,e){var i=[],n=this.sel;for(var o=0;o<n.ranges.length;o++){var f=n.ranges[o];i[o]={from:f.from(),to:f.to(),text:this.splitLines(r[o]),origin:e}}var u=t&&t!="end"&&mo(this,i,t);for(var a=i.length-1;a>=0;a--){rf(this,i[a])}if(u){_o(this,u)}else if(this.cm){ln(this.cm)}})),undo:Un((function(){ef(this,"undo")})),redo:Un((function(){ef(this,"redo")})),undoSelection:Un((function(){ef(this,"undo",true)})),redoSelection:Un((function(){ef(this,"redo",true)})),setExtending:function(r){this.extend=r},getExtending:function(){return this.extend},historySize:function(){var r=this.history,t=0,e=0;for(var i=0;i<r.done.length;i++){if(!r.done[i].ranges){++t}}for(var n=0;n<r.undone.length;n++){if(!r.undone[n].ranges){++e}}return{undo:t,redo:e}},clearHistory:function(){var r=this;this.history=new yo(this.history);ko(this,(function(t){return t.history=r.history}),true)},markClean:function(){this.cleanGeneration=this.changeGeneration(true)},changeGeneration:function(r){if(r){this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null}return this.history.generation},isClean:function(r){return this.history.generation==(r||this.cleanGeneration)},getHistory:function(){return{done:Uo(this.history.done),undone:Uo(this.history.undone)}},setHistory:function(r){var t=this.history=new yo(this.history);t.done=Uo(r.done.slice(0),null,true);t.undone=Uo(r.undone.slice(0),null,true)},setGutterMarker:Un((function(r,t,e){return cf(this,r,"gutter",(function(r){var i=r.gutterMarkers||(r.gutterMarkers={});i[t]=e;if(!e&&fr(i)){r.gutterMarkers=null}return true}))})),clearGutter:Un((function(r){var t=this;this.iter((function(e){if(e.gutterMarkers&&e.gutterMarkers[r]){cf(t,e,"gutter",(function(){e.gutterMarkers[r]=null;if(fr(e.gutterMarkers)){e.gutterMarkers=null}return true}))}}))})),lineInfo:function(r){var t;if(typeof r=="number"){if(!ot(this,r)){return null}t=r;r=Zr(this,r);if(!r){return null}}else{t=it(r);if(t==null){return null}}return{line:t,handle:r,text:r.text,gutterMarkers:r.gutterMarkers,textClass:r.textClass,bgClass:r.bgClass,wrapClass:r.wrapClass,widgets:r.widgets}},addLineClass:Un((function(r,t,e){return cf(this,r,t=="gutter"?"gutter":"class",(function(r){var i=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!r[i]){r[i]=e}else if(x(e).test(r[i])){return false}else{r[i]+=" "+e}return true}))})),removeLineClass:Un((function(r,t,e){return cf(this,r,t=="gutter"?"gutter":"class",(function(r){var i=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";var n=r[i];if(!n){return false}else if(e==null){r[i]=null}else{var o=n.match(x(e));if(!o){return false}var f=o.index+o[0].length;r[i]=n.slice(0,o.index)+(!o.index||f==n.length?"":" ")+n.slice(f)||null}return true}))})),addLineWidget:Un((function(r,t,e){return pf(this,r,t,e)})),removeLineWidget:function(r){r.clear()},markText:function(r,t,e){return wf(this,dt(this,r),dt(this,t),e,e&&e.type||"range")},setBookmark:function(r,t){var e={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:false,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};r=dt(this,r);return wf(this,r,r,e,"bookmark")},findMarksAt:function(r){r=dt(this,r);var t=[],e=Zr(this,r.line).markedSpans;if(e){for(var i=0;i<e.length;++i){var n=e[i];if((n.from==null||n.from<=r.ch)&&(n.to==null||n.to>=r.ch)){t.push(n.marker.parent||n.marker)}}}return t},findMarks:function(r,t,e){r=dt(this,r);t=dt(this,t);var i=[],n=r.line;this.iter(r.line,t.line+1,(function(o){var f=o.markedSpans;if(f){for(var u=0;u<f.length;u++){var a=f[u];if(!(a.to!=null&&n==r.line&&r.ch>=a.to||a.from==null&&n!=r.line||a.from!=null&&n==t.line&&a.from>=t.ch)&&(!e||e(a.marker))){i.push(a.marker.parent||a.marker)}}}++n}));return i},getAllMarks:function(){var r=[];this.iter((function(t){var e=t.markedSpans;if(e){for(var i=0;i<e.length;++i){if(e[i].from!=null){r.push(e[i].marker)}}}}));return r},posFromIndex:function(r){var t,e=this.first,i=this.lineSeparator().length;this.iter((function(n){var o=n.text.length+i;if(o>r){t=r;return true}r-=o;++e}));return dt(this,ut(e,t))},indexFromPos:function(r){r=dt(this,r);var t=r.ch;if(r.line<this.first||r.ch<0){return 0}var e=this.lineSeparator().length;this.iter(this.first,r.line,(function(r){t+=r.text.length+e}));return t},copy:function(r){var t=new Lf(tt(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);t.scrollTop=this.scrollTop;t.scrollLeft=this.scrollLeft;t.sel=this.sel;t.extend=false;if(r){t.history.undoDepth=this.history.undoDepth;t.setHistory(this.getHistory())}return t},linkedDoc:function(r){if(!r){r={}}var t=this.first,e=this.first+this.size;if(r.from!=null&&r.from>t){t=r.from}if(r.to!=null&&r.to<e){e=r.to}var i=new Lf(tt(this,t,e),r.mode||this.modeOption,t,this.lineSep,this.direction);if(r.sharedHist){i.history=this.history}(this.linked||(this.linked=[])).push({doc:i,sharedHist:r.sharedHist});i.linked=[{doc:this,isParent:true,sharedHist:r.sharedHist}];Af(i,Mf(this));return i},unlinkDoc:function(r){if(r instanceof Fu){r=r.doc}if(this.linked){for(var t=0;t<this.linked.length;++t){var e=this.linked[t];if(e.doc!=r){continue}this.linked.splice(t,1);r.unlinkDoc(this);yf(Mf(this));break}}if(r.history==this.history){var i=[r.id];ko(r,(function(r){return i.push(r.id)}),true);r.history=new yo(null);r.history.done=Uo(this.history.done,i);r.history.undone=Uo(this.history.undone,i)}},iterLinkedDocs:function(r){ko(this,r)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(r){if(this.lineSep){return r.split(this.lineSep)}return Ur(r)},lineSeparator:function(){return this.lineSep||"\n"},setDirection:Un((function(r){if(r!="rtl"){r="ltr"}if(r==this.direction){return}this.direction=r;this.iter((function(r){return r.order=null}));if(this.cm){Ao(this.cm)}}))});Lf.prototype.eachLine=Lf.prototype.iter;var Sf=0;function Nf(r){var t=this;Tf(t);if(Cr(t,r)||Ve(t.display,r)){return}xr(r);if(f){Sf=+new Date}var e=Ui(t,r,true),i=r.dataTransfer.files;if(!e||t.isReadOnly()){return}if(i&&i.length&&window.FileReader&&window.File){var n=i.length,o=Array(n),u=0;var a=function(){if(++u==n){On(t,(function(){e=dt(t.doc,e);var r={from:e,to:e,text:t.doc.splitLines(o.filter((function(r){return r!=null})).join(t.doc.lineSeparator())),origin:"paste"};rf(t.doc,r);_o(t.doc,lo(dt(t.doc,e),dt(t.doc,so(r))))}))()}};var l=function(r,e){if(t.options.allowDropFileTypes&&_(t.options.allowDropFileTypes,r.type)==-1){a();return}var i=new FileReader;i.onerror=function(){return a()};i.onload=function(){var r=i.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(r)){a();return}o[e]=r;a()};i.readAsText(r)};for(var s=0;s<i.length;s++){l(i[s],s)}}else{if(t.state.draggingText&&t.doc.sel.contains(e)>-1){t.state.draggingText(r);setTimeout((function(){return t.display.input.focus()}),20);return}try{var c=r.dataTransfer.getData("Text");if(c){var v;if(t.state.draggingText&&!t.state.draggingText.copy){v=t.listSelections()}Vo(t.doc,lo(e,e));if(v){for(var h=0;h<v.length;++h){uf(t.doc,"",v[h].anchor,v[h].head,"drag")}}t.replaceSelection(c,"around","paste");t.display.input.focus()}}catch(r){}}}function Ef(r,t){if(f&&(!r.state.draggingText||+new Date-Sf<100)){Nr(t);return}if(Cr(r,t)||Ve(r.display,t)){return}t.dataTransfer.setData("Text",r.getSelection());t.dataTransfer.effectAllowed="copyMove";if(t.dataTransfer.setDragImage&&!h){var e=E("img",null,null,"position: fixed; left: 0; top: 0;");e.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==";if(v){e.width=e.height=1;r.display.wrapper.appendChild(e);e._top=e.offsetTop}t.dataTransfer.setDragImage(e,0,0);if(v){e.parentNode.removeChild(e)}}}function Df(r,t){var e=Ui(r,t);if(!e){return}var i=document.createDocumentFragment();$i(r,e,i);if(!r.display.dragCursor){r.display.dragCursor=E("div",null,"CodeMirror-cursors CodeMirror-dragcursors");r.display.lineSpace.insertBefore(r.display.dragCursor,r.display.cursorDiv)}N(r.display.dragCursor,i)}function Tf(r){if(r.display.dragCursor){r.display.lineSpace.removeChild(r.display.dragCursor);r.display.dragCursor=null}}function If(r){if(!document.getElementsByClassName){return}var t=document.getElementsByClassName("CodeMirror"),e=[];for(var i=0;i<t.length;i++){var n=t[i].CodeMirror;if(n){e.push(n)}}if(e.length){e[0].operation((function(){for(var t=0;t<e.length;t++){r(e[t])}}))}}var Rf=false;function Of(){if(Rf){return}Bf();Rf=true}function Bf(){var r;gr(window,"resize",(function(){if(r==null){r=setTimeout((function(){r=null;If(Uf)}),100)}}));gr(window,"blur",(function(){return If(Zi)}))}function Uf(r){var t=r.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null;t.scrollbarsClipped=false;r.setSize()}var zf={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Mod",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"};for(var jf=0;jf<10;jf++){zf[jf+48]=zf[jf+96]=String(jf)}for(var Wf=65;Wf<=90;Wf++){zf[Wf]=String.fromCharCode(Wf)}for(var Ff=1;Ff<=12;Ff++){zf[Ff+111]=zf[Ff+63235]="F"+Ff}var Pf={};Pf.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"};Pf.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"};Pf.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"};Pf.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]};Pf["default"]=w?Pf.macDefault:Pf.pcDefault;function Gf(r){var t=r.split(/-(?!$)/);r=t[t.length-1];var e,i,n,o;for(var f=0;f<t.length-1;f++){var u=t[f];if(/^(cmd|meta|m)$/i.test(u)){o=true}else if(/^a(lt)?$/i.test(u)){e=true}else if(/^(c|ctrl|control)$/i.test(u)){i=true}else if(/^s(hift)?$/i.test(u)){n=true}else{throw new Error("Unrecognized modifier name: "+u)}}if(e){r="Alt-"+r}if(i){r="Ctrl-"+r}if(o){r="Cmd-"+r}if(n){r="Shift-"+r}return r}function _f(r){var t={};for(var e in r){if(r.hasOwnProperty(e)){var i=r[e];if(/^(name|fallthrough|(de|at)tach)$/.test(e)){continue}if(i=="..."){delete r[e];continue}var n=Z(e.split(" "),Gf);for(var o=0;o<n.length;o++){var f=void 0,u=void 0;if(o==n.length-1){u=n.join(" ");f=i}else{u=n.slice(0,o+1).join(" ");f="..."}var a=t[u];if(!a){t[u]=f}else if(a!=f){throw new Error("Inconsistent bindings for "+u)}}delete r[e]}}for(var l in t){r[l]=t[l]}return r}function Hf(r,t,e,i){t=Jf(t);var n=t.call?t.call(r,i):t[r];if(n===false){return"nothing"}if(n==="..."){return"multi"}if(n!=null&&e(n)){return"handled"}if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!="[object Array]"){return Hf(r,t.fallthrough,e,i)}for(var o=0;o<t.fallthrough.length;o++){var f=Hf(r,t.fallthrough[o],e,i);if(f){return f}}}}function Vf(r){var t=typeof r=="string"?r:zf[r.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function $f(r,t,e){var i=r;if(t.altKey&&i!="Alt"){r="Alt-"+r}if((A?t.metaKey:t.ctrlKey)&&i!="Ctrl"){r="Ctrl-"+r}if((A?t.ctrlKey:t.metaKey)&&i!="Mod"){r="Cmd-"+r}if(!e&&t.shiftKey&&i!="Shift"){r="Shift-"+r}return r}function Qf(r,t){if(v&&r.keyCode==34&&r["char"]){return false}var e=zf[r.keyCode];if(e==null||r.altGraphKey){return false}if(r.keyCode==3&&r.code){e=r.code}return $f(e,r,t)}function Jf(r){return typeof r=="string"?Pf[r]:r}function Kf(r,t){var e=r.doc.sel.ranges,i=[];for(var n=0;n<e.length;n++){var o=t(e[n]);while(i.length&&at(o.from,X(i).to)<=0){var f=i.pop();if(at(f.from,o.from)<0){o.from=f.from;break}}i.push(o)}Rn(r,(function(){for(var t=i.length-1;t>=0;t--){uf(r.doc,"",i[t].from,i[t].to,"+delete")}ln(r)}))}function qf(r,t,e){var i=lr(r.text,t+e,e);return i<0||i>r.text.length?null:i}function Yf(r,t,e){var i=qf(r,t.ch,e);return i==null?null:new ut(t.line,i,e<0?"after":"before")}function Xf(r,t,e,i,n){if(r){if(t.doc.direction=="rtl"){n=-n}var o=mr(e,t.doc.direction);if(o){var f=n<0?X(o):o[0];var u=n<0==(f.level==1);var a=u?"after":"before";var l;if(f.level>0||t.doc.direction=="rtl"){var s=ii(t,e);l=n<0?e.text.length-1:0;var c=ni(t,s,l).top;l=sr((function(r){return ni(t,s,r).top==c}),n<0==(f.level==1)?f.from:f.to-1,l);if(a=="before"){l=qf(e,l,1)}}else{l=n<0?f.to:f.from}return new ut(i,l,a)}}return new ut(i,n<0?e.text.length:0,n<0?"before":"after")}function Zf(r,t,e,i){var n=mr(t,r.doc.direction);if(!n){return Yf(t,e,i)}if(e.ch>=t.text.length){e.ch=t.text.length;e.sticky="before"}else if(e.ch<=0){e.ch=0;e.sticky="after"}var o=hr(n,e.ch,e.sticky),f=n[o];if(r.doc.direction=="ltr"&&f.level%2==0&&(i>0?f.to>e.ch:f.from<e.ch)){return Yf(t,e,i)}var u=function(r,e){return qf(t,r instanceof ut?r.ch:r,e)};var a;var l=function(e){if(!r.options.lineWrapping){return{begin:0,end:t.text.length}}a=a||ii(r,t);return yi(r,t,a,e)};var s=l(e.sticky=="before"?u(e,-1):e.ch);if(r.doc.direction=="rtl"||f.level==1){var c=f.level==1==i<0;var v=u(e,c?1:-1);if(v!=null&&(!c?v>=f.from&&v>=s.begin:v<=f.to&&v<=s.end)){var h=c?"before":"after";return new ut(e.line,v,h)}}var d=function(r,t,i){var o=function(r,t){return t?new ut(e.line,u(r,1),"before"):new ut(e.line,r,"after")};for(;r>=0&&r<n.length;r+=t){var f=n[r];var a=t>0==(f.level!=1);var l=a?i.begin:u(i.end,-1);if(f.from<=l&&l<f.to){return o(l,a)}l=a?f.from:u(f.to,-1);if(i.begin<=l&&l<i.end){return o(l,a)}}};var m=d(o+i,i,s);if(m){return m}var p=i>0?s.end:u(s.begin,-1);if(p!=null&&!(i>0&&p==t.text.length)){m=d(i>0?0:n.length-1,i,l(p));if(m){return m}}return null}var ru={selectAll:Xo,singleSelection:function(r){return r.setSelection(r.getCursor("anchor"),r.getCursor("head"),$)},killLine:function(r){return Kf(r,(function(t){if(t.empty()){var e=Zr(r.doc,t.head.line).text.length;if(t.head.ch==e&&t.head.line<r.lastLine()){return{from:t.head,to:ut(t.head.line+1,0)}}else{return{from:t.head,to:ut(t.head.line,e)}}}else{return{from:t.from(),to:t.to()}}}))},deleteLine:function(r){return Kf(r,(function(t){return{from:ut(t.from().line,0),to:dt(r.doc,ut(t.to().line+1,0))}}))},delLineLeft:function(r){return Kf(r,(function(r){return{from:ut(r.from().line,0),to:r.from()}}))},delWrappedLineLeft:function(r){return Kf(r,(function(t){var e=r.charCoords(t.head,"div").top+5;var i=r.coordsChar({left:0,top:e},"div");return{from:i,to:t.from()}}))},delWrappedLineRight:function(r){return Kf(r,(function(t){var e=r.charCoords(t.head,"div").top+5;var i=r.coordsChar({left:r.display.lineDiv.offsetWidth+100,top:e},"div");return{from:t.from(),to:i}}))},undo:function(r){return r.undo()},redo:function(r){return r.redo()},undoSelection:function(r){return r.undoSelection()},redoSelection:function(r){return r.redoSelection()},goDocStart:function(r){return r.extendSelection(ut(r.firstLine(),0))},goDocEnd:function(r){return r.extendSelection(ut(r.lastLine()))},goLineStart:function(r){return r.extendSelectionsBy((function(t){return tu(r,t.head.line)}),{origin:"+move",bias:1})},goLineStartSmart:function(r){return r.extendSelectionsBy((function(t){return iu(r,t.head)}),{origin:"+move",bias:1})},goLineEnd:function(r){return r.extendSelectionsBy((function(t){return eu(r,t.head.line)}),{origin:"+move",bias:-1})},goLineRight:function(r){return r.extendSelectionsBy((function(t){var e=r.cursorCoords(t.head,"div").top+5;return r.coordsChar({left:r.display.lineDiv.offsetWidth+100,top:e},"div")}),J)},goLineLeft:function(r){return r.extendSelectionsBy((function(t){var e=r.cursorCoords(t.head,"div").top+5;return r.coordsChar({left:0,top:e},"div")}),J)},goLineLeftSmart:function(r){return r.extendSelectionsBy((function(t){var e=r.cursorCoords(t.head,"div").top+5;var i=r.coordsChar({left:0,top:e},"div");if(i.ch<r.getLine(i.line).search(/\S/)){return iu(r,t.head)}return i}),J)},goLineUp:function(r){return r.moveV(-1,"line")},goLineDown:function(r){return r.moveV(1,"line")},goPageUp:function(r){return r.moveV(-1,"page")},goPageDown:function(r){return r.moveV(1,"page")},goCharLeft:function(r){return r.moveH(-1,"char")},goCharRight:function(r){return r.moveH(1,"char")},goColumnLeft:function(r){return r.moveH(-1,"column")},goColumnRight:function(r){return r.moveH(1,"column")},goWordLeft:function(r){return r.moveH(-1,"word")},goGroupRight:function(r){return r.moveH(1,"group")},goGroupLeft:function(r){return r.moveH(-1,"group")},goWordRight:function(r){return r.moveH(1,"word")},delCharBefore:function(r){return r.deleteH(-1,"codepoint")},delCharAfter:function(r){return r.deleteH(1,"char")},delWordBefore:function(r){return r.deleteH(-1,"word")},delWordAfter:function(r){return r.deleteH(1,"word")},delGroupBefore:function(r){return r.deleteH(-1,"group")},delGroupAfter:function(r){return r.deleteH(1,"group")},indentAuto:function(r){return r.indentSelection("smart")},indentMore:function(r){return r.indentSelection("add")},indentLess:function(r){return r.indentSelection("subtract")},insertTab:function(r){return r.replaceSelection("\t")},insertSoftTab:function(r){var t=[],e=r.listSelections(),i=r.options.tabSize;for(var n=0;n<e.length;n++){var o=e[n].from();var f=P(r.getLine(o.line),o.ch,i);t.push(Y(i-f%i))}r.replaceSelections(t)},defaultTab:function(r){if(r.somethingSelected()){r.indentSelection("add")}else{r.execCommand("insertTab")}},transposeChars:function(r){return Rn(r,(function(){var t=r.listSelections(),e=[];for(var i=0;i<t.length;i++){if(!t[i].empty()){continue}var n=t[i].head,o=Zr(r.doc,n.line).text;if(o){if(n.ch==o.length){n=new ut(n.line,n.ch-1)}if(n.ch>0){n=new ut(n.line,n.ch+1);r.replaceRange(o.charAt(n.ch-1)+o.charAt(n.ch-2),ut(n.line,n.ch-2),n,"+transpose")}else if(n.line>r.doc.first){var f=Zr(r.doc,n.line-1).text;if(f){n=new ut(n.line,1);r.replaceRange(o.charAt(0)+r.doc.lineSeparator()+f.charAt(f.length-1),ut(n.line-1,f.length-1),n,"+transpose")}}}e.push(new uo(n,n))}r.setSelections(e)}))},newlineAndIndent:function(r){return Rn(r,(function(){var t=r.listSelections();for(var e=t.length-1;e>=0;e--){r.replaceRange(r.doc.lineSeparator(),t[e].anchor,t[e].head,"+input")}t=r.listSelections();for(var i=0;i<t.length;i++){r.indentLine(t[i].from().line,null,true)}ln(r)}))},openLine:function(r){return r.replaceSelection("\n","start")},toggleOverwrite:function(r){return r.toggleOverwrite()}};function tu(r,t){var e=Zr(r.doc,t);var i=re(e);if(i!=e){t=it(i)}return Xf(true,r,i,t,1)}function eu(r,t){var e=Zr(r.doc,t);var i=te(e);if(i!=e){t=it(i)}return Xf(true,r,e,t,-1)}function iu(r,t){var e=tu(r,t.line);var i=Zr(r.doc,e.line);var n=mr(i,r.doc.direction);if(!n||n[0].level==0){var o=Math.max(e.ch,i.text.search(/\S/));var f=t.line==e.line&&t.ch<=o&&t.ch;return ut(e.line,f?0:o,e.sticky)}return e}function nu(r,t,e){if(typeof t=="string"){t=ru[t];if(!t){return false}}r.display.input.ensurePolled();var i=r.display.shift,n=false;try{if(r.isReadOnly()){r.state.suppressEdits=true}if(e){r.display.shift=false}n=t(r)!=V}finally{r.display.shift=i;r.state.suppressEdits=false}return n}function ou(r,t,e){for(var i=0;i<r.state.keyMaps.length;i++){var n=Hf(t,r.state.keyMaps[i],e,r);if(n){return n}}return r.options.extraKeys&&Hf(t,r.options.extraKeys,e,r)||Hf(t,r.options.keyMap,e,r)}var fu=new G;function uu(r,t,e,i){var n=r.state.keySeq;if(n){if(Vf(t)){return"handled"}if(/\'$/.test(t)){r.state.keySeq=null}else{fu.set(50,(function(){if(r.state.keySeq==n){r.state.keySeq=null;r.display.input.reset()}}))}if(au(r,n+" "+t,e,i)){return true}}return au(r,t,e,i)}function au(r,t,e,i){var n=ou(r,t,i);if(n=="multi"){r.state.keySeq=t}if(n=="handled"){De(r,"keyHandled",r,t,e)}if(n=="handled"||n=="multi"){xr(e);Ki(r)}return!!n}function lu(r,t){var e=Qf(t,true);if(!e){return false}if(t.shiftKey&&!r.state.keySeq){return uu(r,"Shift-"+e,t,(function(t){return nu(r,t,true)}))||uu(r,e,t,(function(t){if(typeof t=="string"?/^go[A-Z]/.test(t):t.motion){return nu(r,t)}}))}else{return uu(r,e,t,(function(t){return nu(r,t)}))}}function su(r,t,e){return uu(r,"'"+e+"'",t,(function(t){return nu(r,t,true)}))}var cu=null;function vu(r){var t=this;if(r.target&&r.target!=t.display.input.getField()){return}t.curOp.focus=R(z(t));if(Cr(t,r)){return}if(f&&u<11&&r.keyCode==27){r.returnValue=false}var i=r.keyCode;t.display.shift=i==16||r.shiftKey;var n=lu(t,r);if(v){cu=n?i:null;if(!n&&i==88&&!jr&&(w?r.metaKey:r.ctrlKey)){t.replaceSelection("",null,"cut")}}if(e&&!w&&!n&&i==46&&r.shiftKey&&!r.ctrlKey&&document.execCommand){document.execCommand("cut")}if(i==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)){hu(t)}}function hu(r){var t=r.display.lineDiv;O(t,"CodeMirror-crosshair");function e(r){if(r.keyCode==18||!r.altKey){L(t,"CodeMirror-crosshair");wr(document,"keyup",e);wr(document,"mouseover",e)}}gr(document,"keyup",e);gr(document,"mouseover",e)}function du(r){if(r.keyCode==16){this.doc.sel.shift=false}Cr(this,r)}function mu(r){var t=this;if(r.target&&r.target!=t.display.input.getField()){return}if(Ve(t.display,r)||Cr(t,r)||r.ctrlKey&&!r.altKey||w&&r.metaKey){return}var e=r.keyCode,i=r.charCode;if(v&&e==cu){cu=null;xr(r);return}if(v&&(!r.which||r.which<10)&&lu(t,r)){return}var n=String.fromCharCode(i==null?e:i);if(n=="\b"){return}if(su(t,r,n)){return}t.display.input.onKeyPress(r)}var pu=400;var gu=function(r,t,e){this.time=r;this.pos=t;this.button=e};gu.prototype.compare=function(r,t,e){return this.time+pu>r&&at(t,this.pos)==0&&e==this.button};var bu,wu;function ku(r,t){var e=+new Date;if(wu&&wu.compare(e,r,t)){bu=wu=null;return"triple"}else if(bu&&bu.compare(e,r,t)){wu=new gu(e,r,t);bu=null;return"double"}else{bu=new gu(e,r,t);wu=null;return"single"}}function Cu(r){var t=this,e=t.display;if(Cr(t,r)||e.activeTouch&&e.input.supportsTouch()){return}e.input.ensurePolled();e.shift=r.shiftKey;if(Ve(e,r)){if(!a){e.scroller.draggable=false;setTimeout((function(){return e.scroller.draggable=true}),100)}return}if(Du(t,r)){return}var i=Ui(t,r),n=Dr(r),o=i?ku(i,n):"single";j(t).focus();if(n==1&&t.state.selectingText){t.state.selectingText(r)}if(i&&Mu(t,n,i,o,r)){return}if(n==1){if(i){yu(t,i,o,r)}else if(Er(r)==e.scroller){xr(r)}}else if(n==2){if(i){jo(t.doc,i)}setTimeout((function(){return e.input.focus()}),20)}else if(n==3){if(y){t.display.input.onContextMenu(r)}else{Yi(t)}}}function Mu(r,t,e,i,n){var o="Click";if(i=="double"){o="Double"+o}else if(i=="triple"){o="Triple"+o}o=(t==1?"Left":t==2?"Middle":"Right")+o;return uu(r,$f(o,n),n,(function(t){if(typeof t=="string"){t=ru[t]}if(!t){return false}var i=false;try{if(r.isReadOnly()){r.state.suppressEdits=true}i=t(r,e)!=V}finally{r.state.suppressEdits=false}return i}))}function Au(r,t,e){var i=r.getOption("configureMouse");var n=i?i(r,t,e):{};if(n.unit==null){var o=k?e.shiftKey&&e.metaKey:e.altKey;n.unit=o?"rectangle":t=="single"?"char":t=="double"?"word":"line"}if(n.extend==null||r.doc.extend){n.extend=r.doc.extend||e.shiftKey}if(n.addNew==null){n.addNew=w?e.metaKey:e.ctrlKey}if(n.moveOnDrag==null){n.moveOnDrag=!(w?e.altKey:e.ctrlKey)}return n}function yu(r,t,e,i){if(f){setTimeout(W(qi,r),0)}else{r.curOp.focus=R(z(r))}var n=Au(r,e,i);var o=r.doc.sel,u;if(r.options.dragDrop&&Tr&&!r.isReadOnly()&&e=="single"&&(u=o.contains(t))>-1&&(at((u=o.ranges[u]).from(),t)<0||t.xRel>0)&&(at(u.to(),t)>0||t.xRel<0)){xu(r,i,t,n)}else{Su(r,i,t,n)}}function xu(r,t,e,i){var n=r.display,o=false;var l=On(r,(function(t){if(a){n.scroller.draggable=false}r.state.draggingText=false;if(r.state.delayingBlurEvent){if(r.hasFocus()){r.state.delayingBlurEvent=false}else{Yi(r)}}wr(n.wrapper.ownerDocument,"mouseup",l);wr(n.wrapper.ownerDocument,"mousemove",s);wr(n.scroller,"dragstart",c);wr(n.scroller,"drop",l);if(!o){xr(t);if(!i.addNew){jo(r.doc,e,null,null,i.extend)}if(a&&!h||f&&u==9){setTimeout((function(){n.wrapper.ownerDocument.body.focus({preventScroll:true});n.input.focus()}),20)}else{n.input.focus()}}}));var s=function(r){o=o||Math.abs(t.clientX-r.clientX)+Math.abs(t.clientY-r.clientY)>=10};var c=function(){return o=true};if(a){n.scroller.draggable=true}r.state.draggingText=l;l.copy=!i.moveOnDrag;gr(n.wrapper.ownerDocument,"mouseup",l);gr(n.wrapper.ownerDocument,"mousemove",s);gr(n.scroller,"dragstart",c);gr(n.scroller,"drop",l);r.state.delayingBlurEvent=true;setTimeout((function(){return n.input.focus()}),20);if(n.scroller.dragDrop){n.scroller.dragDrop()}}function Lu(r,t,e){if(e=="char"){return new uo(t,t)}if(e=="word"){return r.findWordAt(t)}if(e=="line"){return new uo(ut(t.line,0),dt(r.doc,ut(t.line+1,0)))}var i=e(r,t);return new uo(i.from,i.to)}function Su(r,t,e,i){if(f){Yi(r)}var n=r.display,o=r.doc;xr(t);var u,a,l=o.sel,s=l.ranges;if(i.addNew&&!i.extend){a=o.sel.contains(e);if(a>-1){u=s[a]}else{u=new uo(e,e)}}else{u=o.sel.primary();a=o.sel.primIndex}if(i.unit=="rectangle"){if(!i.addNew){u=new uo(e,e)}e=Ui(r,t,true,true);a=-1}else{var c=Lu(r,e,i.unit);if(i.extend){u=zo(u,c.anchor,c.head,i.extend)}else{u=c}}if(!i.addNew){a=0;Ho(o,new fo([u],0),Q);l=o.sel}else if(a==-1){a=s.length;Ho(o,ao(r,s.concat([u]),a),{scroll:false,origin:"*mouse"})}else if(s.length>1&&s[a].empty()&&i.unit=="char"&&!i.extend){Ho(o,ao(r,s.slice(0,a).concat(s.slice(a+1)),0),{scroll:false,origin:"*mouse"});l=o.sel}else{Fo(o,a,u,Q)}var v=e;function h(t){if(at(v,t)==0){return}v=t;if(i.unit=="rectangle"){var n=[],f=r.options.tabSize;var s=P(Zr(o,e.line).text,e.ch,f);var c=P(Zr(o,t.line).text,t.ch,f);var h=Math.min(s,c),d=Math.max(s,c);for(var m=Math.min(e.line,t.line),p=Math.min(r.lastLine(),Math.max(e.line,t.line));m<=p;m++){var g=Zr(o,m).text,b=K(g,h,f);if(h==d){n.push(new uo(ut(m,b),ut(m,b)))}else if(g.length>b){n.push(new uo(ut(m,b),ut(m,K(g,d,f))))}}if(!n.length){n.push(new uo(e,e))}Ho(o,ao(r,l.ranges.slice(0,a).concat(n),a),{origin:"*mouse",scroll:false});r.scrollIntoView(t)}else{var w=u;var k=Lu(r,t,i.unit);var C=w.anchor,M;if(at(k.anchor,C)>0){M=k.head;C=vt(w.from(),k.anchor)}else{M=k.anchor;C=ct(w.to(),k.head)}var A=l.ranges.slice(0);A[a]=Nu(r,new uo(dt(o,C),M));Ho(o,ao(r,A,a),Q)}}var d=n.wrapper.getBoundingClientRect();var m=0;function p(t){var e=++m;var f=Ui(r,t,true,i.unit=="rectangle");if(!f){return}if(at(f,v)!=0){r.curOp.focus=R(z(r));h(f);var u=en(n,o);if(f.line>=u.to||f.line<u.from){setTimeout(On(r,(function(){if(m==e){p(t)}})),150)}}else{var a=t.clientY<d.top?-20:t.clientY>d.bottom?20:0;if(a){setTimeout(On(r,(function(){if(m!=e){return}n.scroller.scrollTop+=a;p(t)})),50)}}}function g(t){r.state.selectingText=false;m=Infinity;if(t){xr(t);n.input.focus()}wr(n.wrapper.ownerDocument,"mousemove",b);wr(n.wrapper.ownerDocument,"mouseup",w);o.history.lastSelOrigin=null}var b=On(r,(function(r){if(r.buttons===0||!Dr(r)){g(r)}else{p(r)}}));var w=On(r,g);r.state.selectingText=w;gr(n.wrapper.ownerDocument,"mousemove",b);gr(n.wrapper.ownerDocument,"mouseup",w)}function Nu(r,t){var e=t.anchor;var i=t.head;var n=Zr(r.doc,e.line);if(at(e,i)==0&&e.sticky==i.sticky){return t}var o=mr(n);if(!o){return t}var f=hr(o,e.ch,e.sticky),u=o[f];if(u.from!=e.ch&&u.to!=e.ch){return t}var a=f+(u.from==e.ch==(u.level!=1)?0:1);if(a==0||a==o.length){return t}var l;if(i.line!=e.line){l=(i.line-e.line)*(r.doc.direction=="ltr"?1:-1)>0}else{var s=hr(o,i.ch,i.sticky);var c=s-f||(i.ch-e.ch)*(u.level==1?-1:1);if(s==a-1||s==a){l=c<0}else{l=c>0}}var v=o[a+(l?-1:0)];var h=l==(v.level==1);var d=h?v.from:v.to,m=h?"after":"before";return e.ch==d&&e.sticky==m?t:new uo(new ut(e.line,d,m),i)}function Eu(r,t,e,i){var n,o;if(t.touches){n=t.touches[0].clientX;o=t.touches[0].clientY}else{try{n=t.clientX;o=t.clientY}catch(r){return false}}if(n>=Math.floor(r.display.gutters.getBoundingClientRect().right)){return false}if(i){xr(t)}var f=r.display;var u=f.lineDiv.getBoundingClientRect();if(o>u.bottom||!Ar(r,e)){return Sr(t)}o-=u.top-f.viewOffset;for(var a=0;a<r.display.gutterSpecs.length;++a){var l=f.gutters.childNodes[a];if(l&&l.getBoundingClientRect().right>=n){var s=nt(r.doc,o);var c=r.display.gutterSpecs[a];kr(r,e,r,s,c.className,t);return Sr(t)}}}function Du(r,t){return Eu(r,t,"gutterClick",true)}function Tu(r,t){if(Ve(r.display,t)||Iu(r,t)){return}if(Cr(r,t,"contextmenu")){return}if(!y){r.display.input.onContextMenu(t)}}function Iu(r,t){if(!Ar(r,"gutterContextMenu")){return false}return Eu(r,t,"gutterContextMenu",false)}function Ru(r){r.display.wrapper.className=r.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+r.options.theme.replace(/(^|\s)\s*/g," cm-s-");vi(r)}var Ou={toString:function(){return"CodeMirror.Init"}};var Bu={};var Uu={};function zu(r){var t=r.optionHandlers;function e(e,i,n,o){r.defaults[e]=i;if(n){t[e]=o?function(r,t,e){if(e!=Ou){n(r,t,e)}}:n}}r.defineOption=e;r.Init=Ou;e("value","",(function(r,t){return r.setValue(t)}),true);e("mode",null,(function(r,t){r.doc.modeOption=t;po(r)}),true);e("indentUnit",2,po,true);e("indentWithTabs",false);e("smartIndent",true);e("tabSize",4,(function(r){go(r);vi(r);ji(r)}),true);e("lineSeparator",null,(function(r,t){r.doc.lineSep=t;if(!t){return}var e=[],i=r.doc.first;r.doc.iter((function(r){for(var n=0;;){var o=r.text.indexOf(t,n);if(o==-1){break}n=o+t.length;e.push(ut(i,o))}i++}));for(var n=e.length-1;n>=0;n--){uf(r.doc,t,e[n],ut(e[n].line,e[n].ch+t.length))}}));e("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\u202d\u202e\u2066\u2067\u2069\ufeff\ufff9-\ufffc]/g,(function(r,t,e){r.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g");if(e!=Ou){r.refresh()}}));e("specialCharPlaceholder",ge,(function(r){return r.refresh()}),true);e("electricChars",true);e("inputStyle",b?"contenteditable":"textarea",(function(){throw new Error("inputStyle can not (yet) be changed in a running editor")}),true);e("spellcheck",false,(function(r,t){return r.getInputField().spellcheck=t}),true);e("autocorrect",false,(function(r,t){return r.getInputField().autocorrect=t}),true);e("autocapitalize",false,(function(r,t){return r.getInputField().autocapitalize=t}),true);e("rtlMoveVisually",!C);e("wholeLineUpdateBefore",true);e("theme","default",(function(r){Ru(r);Zn(r)}),true);e("keyMap","default",(function(r,t,e){var i=Jf(t);var n=e!=Ou&&Jf(e);if(n&&n.detach){n.detach(r,i)}if(i.attach){i.attach(r,n||null)}}));e("extraKeys",null);e("configureMouse",null);e("lineWrapping",false,Wu,true);e("gutters",[],(function(r,t){r.display.gutterSpecs=Yn(t,r.options.lineNumbers);Zn(r)}),true);e("fixedGutter",true,(function(r,t){r.display.gutters.style.left=t?Ri(r.display)+"px":"0";r.refresh()}),true);e("coverGutterNextToScrollbar",false,(function(r){return kn(r)}),true);e("scrollbarStyle","native",(function(r){An(r);kn(r);r.display.scrollbars.setScrollTop(r.doc.scrollTop);r.display.scrollbars.setScrollLeft(r.doc.scrollLeft)}),true);e("lineNumbers",false,(function(r,t){r.display.gutterSpecs=Yn(r.options.gutters,t);Zn(r)}),true);e("firstLineNumber",1,Zn,true);e("lineNumberFormatter",(function(r){return r}),Zn,true);e("showCursorWhenSelecting",false,Hi,true);e("resetSelectionOnContextMenu",true);e("lineWiseCopyCut",true);e("pasteLinesPerSelection",true);e("selectionsMayTouch",false);e("readOnly",false,(function(r,t){if(t=="nocursor"){Zi(r);r.display.input.blur()}r.display.input.readOnlyChanged(t)}));e("screenReaderLabel",null,(function(r,t){t=t===""?null:t;r.display.input.screenReaderLabelChanged(t)}));e("disableInput",false,(function(r,t){if(!t){r.display.input.reset()}}),true);e("dragDrop",true,ju);e("allowDropFileTypes",null);e("cursorBlinkRate",530);e("cursorScrollMargin",0);e("cursorHeight",1,Hi,true);e("singleCursorHeightPerLine",true,Hi,true);e("workTime",100);e("workDelay",100);e("flattenSpans",true,go,true);e("addModeClass",false,go,true);e("pollInterval",100);e("undoDepth",200,(function(r,t){return r.doc.history.undoDepth=t}));e("historyEventDelay",1250);e("viewportMargin",10,(function(r){return r.refresh()}),true);e("maxHighlightLength",1e4,go,true);e("moveInputWithCursor",true,(function(r,t){if(!t){r.display.input.resetPosition()}}));e("tabindex",null,(function(r,t){return r.display.input.getField().tabIndex=t||""}));e("autofocus",null);e("direction","ltr",(function(r,t){return r.doc.setDirection(t)}),true);e("phrases",null)}function ju(r,t,e){var i=e&&e!=Ou;if(!t!=!i){var n=r.display.dragFunctions;var o=t?gr:wr;o(r.display.scroller,"dragstart",n.start);o(r.display.scroller,"dragenter",n.enter);o(r.display.scroller,"dragover",n.over);o(r.display.scroller,"dragleave",n.leave);o(r.display.scroller,"drop",n.drop)}}function Wu(r){if(r.options.lineWrapping){O(r.display.wrapper,"CodeMirror-wrap");r.display.sizer.style.minWidth="";r.display.sizerWidth=null}else{L(r.display.wrapper,"CodeMirror-wrap");le(r)}Bi(r);ji(r);vi(r);setTimeout((function(){return kn(r)}),100)}function Fu(r,t){var e=this;if(!(this instanceof Fu)){return new Fu(r,t)}this.options=t=t?F(t):{};F(Bu,t,false);var i=t.value;if(typeof i=="string"){i=new Lf(i,t.mode,null,t.lineSeparator,t.direction)}else if(t.mode){i.modeOption=t.mode}this.doc=i;var n=new Fu.inputStyles[t.inputStyle](this);var o=this.display=new ro(r,i,n,t);o.wrapper.CodeMirror=this;Ru(this);if(t.lineWrapping){this.display.wrapper.className+=" CodeMirror-wrap"}An(this);this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:false,delayingBlurEvent:false,focused:false,suppressEdits:false,pasteIncoming:-1,cutIncoming:-1,selectingText:false,draggingText:false,highlight:new G,keySeq:null,specialChars:null};if(t.autofocus&&!b){o.input.focus()}if(f&&u<11){setTimeout((function(){return e.display.input.reset(true)}),20)}Pu(this);Of();xn(this);this.curOp.forceUpdate=true;Co(this,i);if(t.autofocus&&!b||this.hasFocus()){setTimeout((function(){if(e.hasFocus()&&!e.state.focused){Xi(e)}}),20)}else{Zi(this)}for(var l in Uu){if(Uu.hasOwnProperty(l)){Uu[l](this,t[l],Ou)}}qn(this);if(t.finishInit){t.finishInit(this)}for(var s=0;s<Gu.length;++s){Gu[s](this)}Ln(this);if(a&&t.lineWrapping&&getComputedStyle(o.lineDiv).textRendering=="optimizelegibility"){o.lineDiv.style.textRendering="auto"}}Fu.defaults=Bu;Fu.optionHandlers=Uu;function Pu(r){var t=r.display;gr(t.scroller,"mousedown",On(r,Cu));if(f&&u<11){gr(t.scroller,"dblclick",On(r,(function(t){if(Cr(r,t)){return}var e=Ui(r,t);if(!e||Du(r,t)||Ve(r.display,t)){return}xr(t);var i=r.findWordAt(e);jo(r.doc,i.anchor,i.head)})))}else{gr(t.scroller,"dblclick",(function(t){return Cr(r,t)||xr(t)}))}gr(t.scroller,"contextmenu",(function(t){return Tu(r,t)}));gr(t.input.getField(),"contextmenu",(function(e){if(!t.scroller.contains(e.target)){Tu(r,e)}}));var e,i={end:0};function n(){if(t.activeTouch){e=setTimeout((function(){return t.activeTouch=null}),1e3);i=t.activeTouch;i.end=+new Date}}function o(r){if(r.touches.length!=1){return false}var t=r.touches[0];return t.radiusX<=1&&t.radiusY<=1}function a(r,t){if(t.left==null){return true}var e=t.left-r.left,i=t.top-r.top;return e*e+i*i>20*20}gr(t.scroller,"touchstart",(function(n){if(!Cr(r,n)&&!o(n)&&!Du(r,n)){t.input.ensurePolled();clearTimeout(e);var f=+new Date;t.activeTouch={start:f,moved:false,prev:f-i.end<=300?i:null};if(n.touches.length==1){t.activeTouch.left=n.touches[0].pageX;t.activeTouch.top=n.touches[0].pageY}}}));gr(t.scroller,"touchmove",(function(){if(t.activeTouch){t.activeTouch.moved=true}}));gr(t.scroller,"touchend",(function(e){var i=t.activeTouch;if(i&&!Ve(t,e)&&i.left!=null&&!i.moved&&new Date-i.start<300){var o=r.coordsChar(t.activeTouch,"page"),f;if(!i.prev||a(i,i.prev)){f=new uo(o,o)}else if(!i.prev.prev||a(i,i.prev.prev)){f=r.findWordAt(o)}else{f=new uo(ut(o.line,0),dt(r.doc,ut(o.line+1,0)))}r.setSelection(f.anchor,f.head);r.focus();xr(e)}n()}));gr(t.scroller,"touchcancel",n);gr(t.scroller,"scroll",(function(){if(t.scroller.clientHeight){dn(r,t.scroller.scrollTop);pn(r,t.scroller.scrollLeft,true);kr(r,"scroll",r)}}));gr(t.scroller,"mousewheel",(function(t){return oo(r,t)}));gr(t.scroller,"DOMMouseScroll",(function(t){return oo(r,t)}));gr(t.wrapper,"scroll",(function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}));t.dragFunctions={enter:function(t){if(!Cr(r,t)){Nr(t)}},over:function(t){if(!Cr(r,t)){Df(r,t);Nr(t)}},start:function(t){return Ef(r,t)},drop:On(r,Nf),leave:function(t){if(!Cr(r,t)){Tf(r)}}};var l=t.input.getField();gr(l,"keyup",(function(t){return du.call(r,t)}));gr(l,"keydown",On(r,vu));gr(l,"keypress",On(r,mu));gr(l,"focus",(function(t){return Xi(r,t)}));gr(l,"blur",(function(t){return Zi(r,t)}))}var Gu=[];Fu.defineInitHook=function(r){return Gu.push(r)};function _u(r,t,e,i){var n=r.doc,o;if(e==null){e="add"}if(e=="smart"){if(!n.mode.indent){e="prev"}else{o=Ct(r,t).state}}var f=r.options.tabSize;var u=Zr(n,t),a=P(u.text,null,f);if(u.stateAfter){u.stateAfter=null}var l=u.text.match(/^\s*/)[0],s;if(!i&&!/\S/.test(u.text)){s=0;e="not"}else if(e=="smart"){s=n.mode.indent(o,u.text.slice(l.length),u.text);if(s==V||s>150){if(!i){return}e="prev"}}if(e=="prev"){if(t>n.first){s=P(Zr(n,t-1).text,null,f)}else{s=0}}else if(e=="add"){s=a+r.options.indentUnit}else if(e=="subtract"){s=a-r.options.indentUnit}else if(typeof e=="number"){s=a+e}s=Math.max(0,s);var c="",v=0;if(r.options.indentWithTabs){for(var h=Math.floor(s/f);h;--h){v+=f;c+="\t"}}if(v<s){c+=Y(s-v)}if(c!=l){uf(n,c,ut(t,0),ut(t,l.length),"+input");u.stateAfter=null;return true}else{for(var d=0;d<n.sel.ranges.length;d++){var m=n.sel.ranges[d];if(m.head.line==t&&m.head.ch<l.length){var p=ut(t,l.length);Fo(n,d,new uo(p,p));break}}}}var Hu=null;function Vu(r){Hu=r}function $u(r,t,e,i,n){var o=r.doc;r.display.shift=false;if(!i){i=o.sel}var f=+new Date-200;var u=n=="paste"||r.state.pasteIncoming>f;var a=Ur(t),l=null;if(u&&i.ranges.length>1){if(Hu&&Hu.text.join("\n")==t){if(i.ranges.length%Hu.text.length==0){l=[];for(var s=0;s<Hu.text.length;s++){l.push(o.splitLines(Hu.text[s]))}}}else if(a.length==i.ranges.length&&r.options.pasteLinesPerSelection){l=Z(a,(function(r){return[r]}))}}var c=r.curOp.updateInput;for(var v=i.ranges.length-1;v>=0;v--){var h=i.ranges[v];var d=h.from(),m=h.to();if(h.empty()){if(e&&e>0){d=ut(d.line,d.ch-e)}else if(r.state.overwrite&&!u){m=ut(m.line,Math.min(Zr(o,m.line).text.length,m.ch+X(a).length))}else if(u&&Hu&&Hu.lineWise&&Hu.text.join("\n")==a.join("\n")){d=m=ut(d.line,0)}}var p={from:d,to:m,text:l?l[v%l.length]:a,origin:n||(u?"paste":r.state.cutIncoming>f?"cut":"+input")};rf(r.doc,p);De(r,"inputRead",r,p)}if(t&&!u){Ju(r,t)}ln(r);if(r.curOp.updateInput<2){r.curOp.updateInput=c}r.curOp.typing=true;r.state.pasteIncoming=r.state.cutIncoming=-1}function Qu(r,t){var e=r.clipboardData&&r.clipboardData.getData("Text");if(e){r.preventDefault();if(!t.isReadOnly()&&!t.options.disableInput&&t.hasFocus()){Rn(t,(function(){return $u(t,e,0,null,"paste")}))}return true}}function Ju(r,t){if(!r.options.electricChars||!r.options.smartIndent){return}var e=r.doc.sel;for(var i=e.ranges.length-1;i>=0;i--){var n=e.ranges[i];if(n.head.ch>100||i&&e.ranges[i-1].head.line==n.head.line){continue}var o=r.getModeAt(n.head);var f=false;if(o.electricChars){for(var u=0;u<o.electricChars.length;u++){if(t.indexOf(o.electricChars.charAt(u))>-1){f=_u(r,n.head.line,"smart");break}}}else if(o.electricInput){if(o.electricInput.test(Zr(r.doc,n.head.line).text.slice(0,n.head.ch))){f=_u(r,n.head.line,"smart")}}if(f){De(r,"electricInput",r,n.head.line)}}}function Ku(r){var t=[],e=[];for(var i=0;i<r.doc.sel.ranges.length;i++){var n=r.doc.sel.ranges[i].head.line;var o={anchor:ut(n,0),head:ut(n+1,0)};e.push(o);t.push(r.getRange(o.anchor,o.head))}return{text:t,ranges:e}}function qu(r,t,e,i){r.setAttribute("autocorrect",e?"":"off");r.setAttribute("autocapitalize",i?"":"off");r.setAttribute("spellcheck",!!t)}function Yu(){var r=E("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; min-height: 1em; outline: none");var t=E("div",[r],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");if(a){r.style.width="1000px"}else{r.setAttribute("wrap","off")}if(p){r.style.border="1px solid black"}qu(r);return t}function Xu(r){var t=r.optionHandlers;var e=r.helpers={};r.prototype={constructor:r,focus:function(){j(this).focus();this.display.input.focus()},setOption:function(r,e){var i=this.options,n=i[r];if(i[r]==e&&r!="mode"){return}i[r]=e;if(t.hasOwnProperty(r)){On(this,t[r])(this,e,n)}kr(this,"optionChange",this,r)},getOption:function(r){return this.options[r]},getDoc:function(){return this.doc},addKeyMap:function(r,t){this.state.keyMaps[t?"push":"unshift"](Jf(r))},removeKeyMap:function(r){var t=this.state.keyMaps;for(var e=0;e<t.length;++e){if(t[e]==r||t[e].name==r){t.splice(e,1);return true}}},addOverlay:Bn((function(t,e){var i=t.token?t:r.getMode(this.options,t);if(i.startState){throw new Error("Overlays may not be stateful.")}rr(this.state.overlays,{mode:i,modeSpec:t,opaque:e&&e.opaque,priority:e&&e.priority||0},(function(r){return r.priority}));this.state.modeGen++;ji(this)})),removeOverlay:Bn((function(r){var t=this.state.overlays;for(var e=0;e<t.length;++e){var i=t[e].modeSpec;if(i==r||typeof r=="string"&&i.name==r){t.splice(e,1);this.state.modeGen++;ji(this);return}}})),indentLine:Bn((function(r,t,e){if(typeof t!="string"&&typeof t!="number"){if(t==null){t=this.options.smartIndent?"smart":"prev"}else{t=t?"add":"subtract"}}if(ot(this.doc,r)){_u(this,r,t,e)}})),indentSelection:Bn((function(r){var t=this.doc.sel.ranges,e=-1;for(var i=0;i<t.length;i++){var n=t[i];if(!n.empty()){var o=n.from(),f=n.to();var u=Math.max(e,o.line);e=Math.min(this.lastLine(),f.line-(f.ch?0:1))+1;for(var a=u;a<e;++a){_u(this,a,r)}var l=this.doc.sel.ranges;if(o.ch==0&&t.length==l.length&&l[i].from().ch>0){Fo(this.doc,i,new uo(o,l[i].to()),$)}}else if(n.head.line>e){_u(this,n.head.line,r,true);e=n.head.line;if(i==this.doc.sel.primIndex){ln(this)}}}})),getTokenAt:function(r,t){return Lt(this,r,t)},getLineTokens:function(r,t){return Lt(this,ut(r),t,true)},getTokenTypeAt:function(r){r=dt(this.doc,r);var t=kt(this,Zr(this.doc,r.line));var e=0,i=(t.length-1)/2,n=r.ch;var o;if(n==0){o=t[2]}else{for(;;){var f=e+i>>1;if((f?t[f*2-1]:0)>=n){i=f}else if(t[f*2+1]<n){e=f+1}else{o=t[f*2+2];break}}}var u=o?o.indexOf("overlay "):-1;return u<0?o:u==0?null:o.slice(0,u-1)},getModeAt:function(t){var e=this.doc.mode;if(!e.innerMode){return e}return r.innerMode(e,this.getTokenAt(t).state).mode},getHelper:function(r,t){return this.getHelpers(r,t)[0]},getHelpers:function(r,t){var i=[];if(!e.hasOwnProperty(t)){return i}var n=e[t],o=this.getModeAt(r);if(typeof o[t]=="string"){if(n[o[t]]){i.push(n[o[t]])}}else if(o[t]){for(var f=0;f<o[t].length;f++){var u=n[o[t][f]];if(u){i.push(u)}}}else if(o.helperType&&n[o.helperType]){i.push(n[o.helperType])}else if(n[o.name]){i.push(n[o.name])}for(var a=0;a<n._global.length;a++){var l=n._global[a];if(l.pred(o,this)&&_(i,l.val)==-1){i.push(l.val)}}return i},getStateAfter:function(r,t){var e=this.doc;r=ht(e,r==null?e.first+e.size-1:r);return Ct(this,r+1,t).state},cursorCoords:function(r,t){var e,i=this.doc.sel.primary();if(r==null){e=i.head}else if(typeof r=="object"){e=dt(this.doc,r)}else{e=r?i.from():i.to()}return wi(this,e,t||"page")},charCoords:function(r,t){return bi(this,dt(this.doc,r),t||"page")},coordsChar:function(r,t){r=gi(this,r,t||"page");return Mi(this,r.left,r.top)},lineAtHeight:function(r,t){r=gi(this,{top:r,left:0},t||"page").top;return nt(this.doc,r+this.display.viewOffset)},heightAtLine:function(r,t,e){var i=false,n;if(typeof r=="number"){var o=this.doc.first+this.doc.size-1;if(r<this.doc.first){r=this.doc.first}else if(r>o){r=o;i=true}n=Zr(this.doc,r)}else{n=r}return pi(this,n,{top:0,left:0},t||"page",e||i).top+(i?this.doc.height-ue(n):0)},defaultTextHeight:function(){return Di(this.display)},defaultCharWidth:function(){return Ti(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(r,t,e,i,n){var o=this.display;r=wi(this,dt(this.doc,r));var f=r.bottom,u=r.left;t.style.position="absolute";t.setAttribute("cm-ignore-events","true");this.display.input.setUneditable(t);o.sizer.appendChild(t);if(i=="over"){f=r.top}else if(i=="above"||i=="near"){var a=Math.max(o.wrapper.clientHeight,this.doc.height),l=Math.max(o.sizer.clientWidth,o.lineSpace.clientWidth);if((i=="above"||r.bottom+t.offsetHeight>a)&&r.top>t.offsetHeight){f=r.top-t.offsetHeight}else if(r.bottom+t.offsetHeight<=a){f=r.bottom}if(u+t.offsetWidth>l){u=l-t.offsetWidth}}t.style.top=f+"px";t.style.left=t.style.right="";if(n=="right"){u=o.sizer.clientWidth-t.offsetWidth;t.style.right="0px"}else{if(n=="left"){u=0}else if(n=="middle"){u=(o.sizer.clientWidth-t.offsetWidth)/2}t.style.left=u+"px"}if(e){fn(this,{left:u,top:f,right:u+t.offsetWidth,bottom:f+t.offsetHeight})}},triggerOnKeyDown:Bn(vu),triggerOnKeyPress:Bn(mu),triggerOnKeyUp:du,triggerOnMouseDown:Bn(Cu),execCommand:function(r){if(ru.hasOwnProperty(r)){return ru[r].call(null,this)}},triggerElectric:Bn((function(r){Ju(this,r)})),findPosH:function(r,t,e,i){var n=1;if(t<0){n=-1;t=-t}var o=dt(this.doc,r);for(var f=0;f<t;++f){o=Zu(this.doc,o,n,e,i);if(o.hitSide){break}}return o},moveH:Bn((function(r,t){var e=this;this.extendSelectionsBy((function(i){if(e.display.shift||e.doc.extend||i.empty()){return Zu(e.doc,i.head,r,t,e.options.rtlMoveVisually)}else{return r<0?i.from():i.to()}}),J)})),deleteH:Bn((function(r,t){var e=this.doc.sel,i=this.doc;if(e.somethingSelected()){i.replaceSelection("",null,"+delete")}else{Kf(this,(function(e){var n=Zu(i,e.head,r,t,false);return r<0?{from:n,to:e.head}:{from:e.head,to:n}}))}})),findPosV:function(r,t,e,i){var n=1,o=i;if(t<0){n=-1;t=-t}var f=dt(this.doc,r);for(var u=0;u<t;++u){var a=wi(this,f,"div");if(o==null){o=a.left}else{a.left=o}f=ra(this,a,n,e);if(f.hitSide){break}}return f},moveV:Bn((function(r,t){var e=this;var i=this.doc,n=[];var o=!this.display.shift&&!i.extend&&i.sel.somethingSelected();i.extendSelectionsBy((function(f){if(o){return r<0?f.from():f.to()}var u=wi(e,f.head,"div");if(f.goalColumn!=null){u.left=f.goalColumn}n.push(u.left);var a=ra(e,u,r,t);if(t=="page"&&f==i.sel.primary()){an(e,bi(e,a,"div").top-u.top)}return a}),J);if(n.length){for(var f=0;f<i.sel.ranges.length;f++){i.sel.ranges[f].goalColumn=n[f]}}})),findWordAt:function(r){var t=this.doc,e=Zr(t,r.line).text;var i=r.ch,n=r.ch;if(e){var o=this.getHelper(r,"wordChars");if((r.sticky=="before"||n==e.length)&&i){--i}else{++n}var f=e.charAt(i);var u=or(f,o)?function(r){return or(r,o)}:/\s/.test(f)?function(r){return/\s/.test(r)}:function(r){return!/\s/.test(r)&&!or(r)};while(i>0&&u(e.charAt(i-1))){--i}while(n<e.length&&u(e.charAt(n))){++n}}return new uo(ut(r.line,i),ut(r.line,n))},toggleOverwrite:function(r){if(r!=null&&r==this.state.overwrite){return}if(this.state.overwrite=!this.state.overwrite){O(this.display.cursorDiv,"CodeMirror-overwrite")}else{L(this.display.cursorDiv,"CodeMirror-overwrite")}kr(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==R(z(this))},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:Bn((function(r,t){sn(this,r,t)})),getScrollInfo:function(){var r=this.display.scroller;return{left:r.scrollLeft,top:r.scrollTop,height:r.scrollHeight-Ke(this)-this.display.barHeight,width:r.scrollWidth-Ke(this)-this.display.barWidth,clientHeight:Ye(this),clientWidth:qe(this)}},scrollIntoView:Bn((function(r,t){if(r==null){r={from:this.doc.sel.primary().head,to:null};if(t==null){t=this.options.cursorScrollMargin}}else if(typeof r=="number"){r={from:ut(r,0),to:null}}else if(r.from==null){r={from:r,to:null}}if(!r.to){r.to=r.from}r.margin=t||0;if(r.from.line!=null){cn(this,r)}else{hn(this,r.from,r.to,r.margin)}})),setSize:Bn((function(r,t){var e=this;var i=function(r){return typeof r=="number"||/^\d+$/.test(String(r))?r+"px":r};if(r!=null){this.display.wrapper.style.width=i(r)}if(t!=null){this.display.wrapper.style.height=i(t)}if(this.options.lineWrapping){ci(this)}var n=this.display.viewFrom;this.doc.iter(n,this.display.viewTo,(function(r){if(r.widgets){for(var t=0;t<r.widgets.length;t++){if(r.widgets[t].noHScroll){Wi(e,n,"widget");break}}}++n}));this.curOp.forceUpdate=true;kr(this,"refresh",this)})),operation:function(r){return Rn(this,r)},startOperation:function(){return xn(this)},endOperation:function(){return Ln(this)},refresh:Bn((function(){var r=this.display.cachedTextHeight;ji(this);this.curOp.forceUpdate=true;vi(this);sn(this,this.doc.scrollLeft,this.doc.scrollTop);Qn(this.display);if(r==null||Math.abs(r-Di(this.display))>.5||this.options.lineWrapping){Bi(this)}kr(this,"refresh",this)})),swapDoc:Bn((function(r){var t=this.doc;t.cm=null;if(this.state.selectingText){this.state.selectingText()}Co(this,r);vi(this);this.display.input.reset();sn(this,r.scrollLeft,r.scrollTop);this.curOp.forceScroll=true;De(this,"swapDoc",this,t);return t})),phrase:function(r){var t=this.options.phrases;return t&&Object.prototype.hasOwnProperty.call(t,r)?t[r]:r},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}};yr(r);r.registerHelper=function(t,i,n){if(!e.hasOwnProperty(t)){e[t]=r[t]={_global:[]}}e[t][i]=n};r.registerGlobalHelper=function(t,i,n,o){r.registerHelper(t,i,o);e[t]._global.push({pred:n,val:o})}}function Zu(r,t,e,i,n){var o=t;var f=e;var u=Zr(r,t.line);var a=n&&r.direction=="rtl"?-e:e;function l(){var e=t.line+a;if(e<r.first||e>=r.first+r.size){return false}t=new ut(e,t.ch,t.sticky);return u=Zr(r,e)}function s(o){var f;if(i=="codepoint"){var s=u.text.charCodeAt(t.ch+(e>0?0:-1));if(isNaN(s)){f=null}else{var c=e>0?s>=55296&&s<56320:s>=56320&&s<57343;f=new ut(t.line,Math.max(0,Math.min(u.text.length,t.ch+e*(c?2:1))),-e)}}else if(n){f=Zf(r.cm,u,t,e)}else{f=Yf(u,t,e)}if(f==null){if(!o&&l()){t=Xf(n,r.cm,u,t.line,a)}else{return false}}else{t=f}return true}if(i=="char"||i=="codepoint"){s()}else if(i=="column"){s(true)}else if(i=="word"||i=="group"){var c=null,v=i=="group";var h=r.cm&&r.cm.getHelper(t,"wordChars");for(var d=true;;d=false){if(e<0&&!s(!d)){break}var m=u.text.charAt(t.ch)||"\n";var p=or(m,h)?"w":v&&m=="\n"?"n":!v||/\s/.test(m)?null:"p";if(v&&!d&&!p){p="s"}if(c&&c!=p){if(e<0){e=1;s();t.sticky="after"}break}if(p){c=p}if(e>0&&!s(!d)){break}}}var g=qo(r,t,o,f,true);if(lt(o,g)){g.hitSide=true}return g}function ra(r,t,e,i){var n=r.doc,o=t.left,f;if(i=="page"){var u=Math.min(r.display.wrapper.clientHeight,j(r).innerHeight||n(r).documentElement.clientHeight);var a=Math.max(u-.5*Di(r.display),3);f=(e>0?t.bottom:t.top)+e*a}else if(i=="line"){f=e>0?t.bottom+3:t.top-3}var l;for(;;){l=Mi(r,o,f);if(!l.outside){break}if(e<0?f<=0:f>=n.height){l.hitSide=true;break}f+=e*5}return l}var ta=function(r){this.cm=r;this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null;this.polling=new G;this.composing=null;this.gracePeriod=false;this.readDOMTimeout=null};ta.prototype.init=function(r){var t=this;var e=this,i=e.cm;var n=e.div=r.lineDiv;n.contentEditable=true;qu(n,i.options.spellcheck,i.options.autocorrect,i.options.autocapitalize);function o(r){for(var t=r.target;t;t=t.parentNode){if(t==n){return true}if(/\bCodeMirror-(?:line)?widget\b/.test(t.className)){break}}return false}gr(n,"paste",(function(r){if(!o(r)||Cr(i,r)||Qu(r,i)){return}if(u<=11){setTimeout(On(i,(function(){return t.updateFromDOM()})),20)}}));gr(n,"compositionstart",(function(r){t.composing={data:r.data,done:false}}));gr(n,"compositionupdate",(function(r){if(!t.composing){t.composing={data:r.data,done:false}}}));gr(n,"compositionend",(function(r){if(t.composing){if(r.data!=t.composing.data){t.readFromDOMSoon()}t.composing.done=true}}));gr(n,"touchstart",(function(){return e.forceCompositionEnd()}));gr(n,"input",(function(){if(!t.composing){t.readFromDOMSoon()}}));function f(r){if(!o(r)||Cr(i,r)){return}if(i.somethingSelected()){Vu({lineWise:false,text:i.getSelections()});if(r.type=="cut"){i.replaceSelection("",null,"cut")}}else if(!i.options.lineWiseCopyCut){return}else{var t=Ku(i);Vu({lineWise:true,text:t.text});if(r.type=="cut"){i.operation((function(){i.setSelections(t.ranges,0,$);i.replaceSelection("",null,"cut")}))}}if(r.clipboardData){r.clipboardData.clearData();var f=Hu.text.join("\n");r.clipboardData.setData("Text",f);if(r.clipboardData.getData("Text")==f){r.preventDefault();return}}var u=Yu(),a=u.firstChild;i.display.lineSpace.insertBefore(u,i.display.lineSpace.firstChild);a.value=Hu.text.join("\n");var l=R(n.ownerDocument);U(a);setTimeout((function(){i.display.lineSpace.removeChild(u);l.focus();if(l==n){e.showPrimarySelection()}}),50)}gr(n,"copy",f);gr(n,"cut",f)};ta.prototype.screenReaderLabelChanged=function(r){if(r){this.div.setAttribute("aria-label",r)}else{this.div.removeAttribute("aria-label")}};ta.prototype.prepareSelection=function(){var r=Vi(this.cm,false);r.focus=R(this.div.ownerDocument)==this.div;return r};ta.prototype.showSelection=function(r,t){if(!r||!this.cm.display.view.length){return}if(r.focus||t){this.showPrimarySelection()}this.showMultipleSelections(r)};ta.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()};ta.prototype.showPrimarySelection=function(){var r=this.getSelection(),t=this.cm,i=t.doc.sel.primary();var n=i.from(),o=i.to();if(t.display.viewTo==t.display.viewFrom||n.line>=t.display.viewTo||o.line<t.display.viewFrom){r.removeAllRanges();return}var f=fa(t,r.anchorNode,r.anchorOffset);var u=fa(t,r.focusNode,r.focusOffset);if(f&&!f.bad&&u&&!u.bad&&at(vt(f,u),n)==0&&at(ct(f,u),o)==0){return}var a=t.display.view;var l=n.line>=t.display.viewFrom&&ea(t,n)||{node:a[0].measure.map[2],offset:0};var s=o.line<t.display.viewTo&&ea(t,o);if(!s){var c=a[a.length-1].measure;var v=c.maps?c.maps[c.maps.length-1]:c.map;s={node:v[v.length-1],offset:v[v.length-2]-v[v.length-3]}}if(!l||!s){r.removeAllRanges();return}var h=r.rangeCount&&r.getRangeAt(0),d;try{d=T(l.node,l.offset,s.offset,s.node)}catch(r){}if(d){if(!e&&t.state.focused){r.collapse(l.node,l.offset);if(!d.collapsed){r.removeAllRanges();r.addRange(d)}}else{r.removeAllRanges();r.addRange(d)}if(h&&r.anchorNode==null){r.addRange(h)}else if(e){this.startGracePeriod()}}this.rememberSelection()};ta.prototype.startGracePeriod=function(){var r=this;clearTimeout(this.gracePeriod);this.gracePeriod=setTimeout((function(){r.gracePeriod=false;if(r.selectionChanged()){r.cm.operation((function(){return r.cm.curOp.selectionChanged=true}))}}),20)};ta.prototype.showMultipleSelections=function(r){N(this.cm.display.cursorDiv,r.cursors);N(this.cm.display.selectionDiv,r.selection)};ta.prototype.rememberSelection=function(){var r=this.getSelection();this.lastAnchorNode=r.anchorNode;this.lastAnchorOffset=r.anchorOffset;this.lastFocusNode=r.focusNode;this.lastFocusOffset=r.focusOffset};ta.prototype.selectionInEditor=function(){var r=this.getSelection();if(!r.rangeCount){return false}var t=r.getRangeAt(0).commonAncestorContainer;return I(this.div,t)};ta.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"){if(!this.selectionInEditor()||R(this.div.ownerDocument)!=this.div){this.showSelection(this.prepareSelection(),true)}this.div.focus()}};ta.prototype.blur=function(){this.div.blur()};ta.prototype.getField=function(){return this.div};ta.prototype.supportsTouch=function(){return true};ta.prototype.receivedFocus=function(){var r=this;var t=this;if(this.selectionInEditor()){setTimeout((function(){return r.pollSelection()}),20)}else{Rn(this.cm,(function(){return t.cm.curOp.selectionChanged=true}))}function e(){if(t.cm.state.focused){t.pollSelection();t.polling.set(t.cm.options.pollInterval,e)}}this.polling.set(this.cm.options.pollInterval,e)};ta.prototype.selectionChanged=function(){var r=this.getSelection();return r.anchorNode!=this.lastAnchorNode||r.anchorOffset!=this.lastAnchorOffset||r.focusNode!=this.lastFocusNode||r.focusOffset!=this.lastFocusOffset};ta.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged()){return}var r=this.getSelection(),t=this.cm;if(g&&s&&this.cm.display.gutterSpecs.length&&ia(r.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs});this.blur();this.focus();return}if(this.composing){return}this.rememberSelection();var e=fa(t,r.anchorNode,r.anchorOffset);var i=fa(t,r.focusNode,r.focusOffset);if(e&&i){Rn(t,(function(){Ho(t.doc,lo(e,i),$);if(e.bad||i.bad){t.curOp.selectionChanged=true}}))}};ta.prototype.pollContent=function(){if(this.readDOMTimeout!=null){clearTimeout(this.readDOMTimeout);this.readDOMTimeout=null}var r=this.cm,t=r.display,e=r.doc.sel.primary();var i=e.from(),n=e.to();if(i.ch==0&&i.line>r.firstLine()){i=ut(i.line-1,Zr(r.doc,i.line-1).length)}if(n.ch==Zr(r.doc,n.line).text.length&&n.line<r.lastLine()){n=ut(n.line+1,0)}if(i.line<t.viewFrom||n.line>t.viewTo-1){return false}var o,f,u;if(i.line==t.viewFrom||(o=zi(r,i.line))==0){f=it(t.view[0].line);u=t.view[0].node}else{f=it(t.view[o].line);u=t.view[o-1].node.nextSibling}var a=zi(r,n.line);var l,s;if(a==t.view.length-1){l=t.viewTo-1;s=t.lineDiv.lastChild}else{l=it(t.view[a+1].line)-1;s=t.view[a+1].node.previousSibling}if(!u){return false}var c=r.doc.splitLines(oa(r,u,s,f,l));var v=rt(r.doc,ut(f,0),ut(l,Zr(r.doc,l).text.length));while(c.length>1&&v.length>1){if(X(c)==X(v)){c.pop();v.pop();l--}else if(c[0]==v[0]){c.shift();v.shift();f++}else{break}}var h=0,d=0;var m=c[0],p=v[0],g=Math.min(m.length,p.length);while(h<g&&m.charCodeAt(h)==p.charCodeAt(h)){++h}var b=X(c),w=X(v);var k=Math.min(b.length-(c.length==1?h:0),w.length-(v.length==1?h:0));while(d<k&&b.charCodeAt(b.length-d-1)==w.charCodeAt(w.length-d-1)){++d}if(c.length==1&&v.length==1&&f==i.line){while(h&&h>i.ch&&b.charCodeAt(b.length-d-1)==w.charCodeAt(w.length-d-1)){h--;d++}}c[c.length-1]=b.slice(0,b.length-d).replace(/^\u200b+/,"");c[0]=c[0].slice(h).replace(/\u200b+$/,"");var C=ut(f,h);var M=ut(l,v.length?X(v).length-d:0);if(c.length>1||c[0]||at(C,M)){uf(r.doc,c,C,M,"+input");return true}};ta.prototype.ensurePolled=function(){this.forceCompositionEnd()};ta.prototype.reset=function(){this.forceCompositionEnd()};ta.prototype.forceCompositionEnd=function(){if(!this.composing){return}clearTimeout(this.readDOMTimeout);this.composing=null;this.updateFromDOM();this.div.blur();this.div.focus()};ta.prototype.readFromDOMSoon=function(){var r=this;if(this.readDOMTimeout!=null){return}this.readDOMTimeout=setTimeout((function(){r.readDOMTimeout=null;if(r.composing){if(r.composing.done){r.composing=null}else{return}}r.updateFromDOM()}),80)};ta.prototype.updateFromDOM=function(){var r=this;if(this.cm.isReadOnly()||!this.pollContent()){Rn(this.cm,(function(){return ji(r.cm)}))}};ta.prototype.setUneditable=function(r){r.contentEditable="false"};ta.prototype.onKeyPress=function(r){if(r.charCode==0||this.composing){return}r.preventDefault();if(!this.cm.isReadOnly()){On(this.cm,$u)(this.cm,String.fromCharCode(r.charCode==null?r.keyCode:r.charCode),0)}};ta.prototype.readOnlyChanged=function(r){this.div.contentEditable=String(r!="nocursor")};ta.prototype.onContextMenu=function(){};ta.prototype.resetPosition=function(){};ta.prototype.needsContentAttribute=true;function ea(r,t){var e=ei(r,t.line);if(!e||e.hidden){return null}var i=Zr(r.doc,t.line);var n=Ze(e,i,t.line);var o=mr(i,r.doc.direction),f="left";if(o){var u=hr(o,t.ch);f=u%2?"right":"left"}var a=fi(n.map,t.ch,f);a.offset=a.collapse=="right"?a.end:a.start;return a}function ia(r){for(var t=r;t;t=t.parentNode){if(/CodeMirror-gutter-wrapper/.test(t.className)){return true}}return false}function na(r,t){if(t){r.bad=true}return r}function oa(r,t,e,i,n){var o="",f=false,u=r.doc.lineSeparator(),a=false;function l(r){return function(t){return t.id==r}}function s(){if(f){o+=u;if(a){o+=u}f=a=false}}function c(r){if(r){s();o+=r}}function v(t){if(t.nodeType==1){var e=t.getAttribute("cm-text");if(e){c(e);return}var o=t.getAttribute("cm-marker"),h;if(o){var d=r.findMarks(ut(i,0),ut(n+1,0),l(+o));if(d.length&&(h=d[0].find(0))){c(rt(r.doc,h.from,h.to).join(u))}return}if(t.getAttribute("contenteditable")=="false"){return}var m=/^(pre|div|p|li|table|br)$/i.test(t.nodeName);if(!/^br$/i.test(t.nodeName)&&t.textContent.length==0){return}if(m){s()}for(var p=0;p<t.childNodes.length;p++){v(t.childNodes[p])}if(/^(pre|p)$/i.test(t.nodeName)){a=true}if(m){f=true}}else if(t.nodeType==3){c(t.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}}for(;;){v(t);if(t==e){break}t=t.nextSibling;a=false}return o}function fa(r,t,e){var i;if(t==r.display.lineDiv){i=r.display.lineDiv.childNodes[e];if(!i){return na(r.clipPos(ut(r.display.viewTo-1)),true)}t=null;e=0}else{for(i=t;;i=i.parentNode){if(!i||i==r.display.lineDiv){return null}if(i.parentNode&&i.parentNode==r.display.lineDiv){break}}}for(var n=0;n<r.display.view.length;n++){var o=r.display.view[n];if(o.node==i){return ua(o,t,e)}}}function ua(r,t,e){var i=r.text.firstChild,n=false;if(!t||!I(i,t)){return na(ut(it(r.line),0),true)}if(t==i){n=true;t=i.childNodes[e];e=0;if(!t){var o=r.rest?X(r.rest):r.line;return na(ut(it(o),o.text.length),n)}}var f=t.nodeType==3?t:null,u=t;if(!f&&t.childNodes.length==1&&t.firstChild.nodeType==3){f=t.firstChild;if(e){e=f.nodeValue.length}}while(u.parentNode!=i){u=u.parentNode}var a=r.measure,l=a.maps;function s(t,e,i){for(var n=-1;n<(l?l.length:0);n++){var o=n<0?a.map:l[n];for(var f=0;f<o.length;f+=3){var u=o[f+2];if(u==t||u==e){var s=it(n<0?r.line:r.rest[n]);var c=o[f]+i;if(i<0||u!=t){c=o[f+(i?1:0)]}return ut(s,c)}}}}var c=s(f,u,e);if(c){return na(c,n)}for(var v=u.nextSibling,h=f?f.nodeValue.length-e:0;v;v=v.nextSibling){c=s(v,v.firstChild,0);if(c){return na(ut(c.line,c.ch-h),n)}else{h+=v.textContent.length}}for(var d=u.previousSibling,m=e;d;d=d.previousSibling){c=s(d,d.firstChild,-1);if(c){return na(ut(c.line,c.ch+m),n)}else{m+=d.textContent.length}}}var aa=function(r){this.cm=r;this.prevInput="";this.pollingFast=false;this.polling=new G;this.hasSelection=false;this.composing=null;this.resetting=false};aa.prototype.init=function(r){var t=this;var e=this,i=this.cm;this.createField(r);var n=this.textarea;r.wrapper.insertBefore(this.wrapper,r.wrapper.firstChild);if(p){n.style.width="0px"}gr(n,"input",(function(){if(f&&u>=9&&t.hasSelection){t.hasSelection=null}e.poll()}));gr(n,"paste",(function(r){if(Cr(i,r)||Qu(r,i)){return}i.state.pasteIncoming=+new Date;e.fastPoll()}));function o(r){if(Cr(i,r)){return}if(i.somethingSelected()){Vu({lineWise:false,text:i.getSelections()})}else if(!i.options.lineWiseCopyCut){return}else{var t=Ku(i);Vu({lineWise:true,text:t.text});if(r.type=="cut"){i.setSelections(t.ranges,null,$)}else{e.prevInput="";n.value=t.text.join("\n");U(n)}}if(r.type=="cut"){i.state.cutIncoming=+new Date}}gr(n,"cut",o);gr(n,"copy",o);gr(r.scroller,"paste",(function(t){if(Ve(r,t)||Cr(i,t)){return}if(!n.dispatchEvent){i.state.pasteIncoming=+new Date;e.focus();return}var o=new Event("paste");o.clipboardData=t.clipboardData;n.dispatchEvent(o)}));gr(r.lineSpace,"selectstart",(function(t){if(!Ve(r,t)){xr(t)}}));gr(n,"compositionstart",(function(){var r=i.getCursor("from");if(e.composing){e.composing.range.clear()}e.composing={start:r,range:i.markText(r,i.getCursor("to"),{className:"CodeMirror-composing"})}}));gr(n,"compositionend",(function(){if(e.composing){e.poll();e.composing.range.clear();e.composing=null}}))};aa.prototype.createField=function(r){this.wrapper=Yu();this.textarea=this.wrapper.firstChild};aa.prototype.screenReaderLabelChanged=function(r){if(r){this.textarea.setAttribute("aria-label",r)}else{this.textarea.removeAttribute("aria-label")}};aa.prototype.prepareSelection=function(){var r=this.cm,t=r.display,e=r.doc;var i=Vi(r);if(r.options.moveInputWithCursor){var n=wi(r,e.sel.primary().head,"div");var o=t.wrapper.getBoundingClientRect(),f=t.lineDiv.getBoundingClientRect();i.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,n.top+f.top-o.top));i.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,n.left+f.left-o.left))}return i};aa.prototype.showSelection=function(r){var t=this.cm,e=t.display;N(e.cursorDiv,r.cursors);N(e.selectionDiv,r.selection);if(r.teTop!=null){this.wrapper.style.top=r.teTop+"px";this.wrapper.style.left=r.teLeft+"px"}};aa.prototype.reset=function(r){if(this.contextMenuPending||this.composing&&r){return}var t=this.cm;this.resetting=true;if(t.somethingSelected()){this.prevInput="";var e=t.getSelection();this.textarea.value=e;if(t.state.focused){U(this.textarea)}if(f&&u>=9){this.hasSelection=e}}else if(!r){this.prevInput=this.textarea.value="";if(f&&u>=9){this.hasSelection=null}}this.resetting=false};aa.prototype.getField=function(){return this.textarea};aa.prototype.supportsTouch=function(){return false};aa.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!b||R(this.textarea.ownerDocument)!=this.textarea)){try{this.textarea.focus()}catch(r){}}};aa.prototype.blur=function(){this.textarea.blur()};aa.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0};aa.prototype.receivedFocus=function(){this.slowPoll()};aa.prototype.slowPoll=function(){var r=this;if(this.pollingFast){return}this.polling.set(this.cm.options.pollInterval,(function(){r.poll();if(r.cm.state.focused){r.slowPoll()}}))};aa.prototype.fastPoll=function(){var r=false,t=this;t.pollingFast=true;function e(){var i=t.poll();if(!i&&!r){r=true;t.polling.set(60,e)}else{t.pollingFast=false;t.slowPoll()}}t.polling.set(20,e)};aa.prototype.poll=function(){var r=this;var t=this.cm,e=this.textarea,i=this.prevInput;if(this.contextMenuPending||this.resetting||!t.state.focused||zr(e)&&!i&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq){return false}var n=e.value;if(n==i&&!t.somethingSelected()){return false}if(f&&u>=9&&this.hasSelection===n||w&&/[\uf700-\uf7ff]/.test(n)){t.display.input.reset();return false}if(t.doc.sel==t.display.selForContextMenu){var o=n.charCodeAt(0);if(o==8203&&!i){i=""}if(o==8666){this.reset();return this.cm.execCommand("undo")}}var a=0,l=Math.min(i.length,n.length);while(a<l&&i.charCodeAt(a)==n.charCodeAt(a)){++a}Rn(t,(function(){$u(t,n.slice(a),i.length-a,null,r.composing?"*compose":null);if(n.length>1e3||n.indexOf("\n")>-1){e.value=r.prevInput=""}else{r.prevInput=n}if(r.composing){r.composing.range.clear();r.composing.range=t.markText(r.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"})}}));return true};aa.prototype.ensurePolled=function(){if(this.pollingFast&&this.poll()){this.pollingFast=false}};aa.prototype.onKeyPress=function(){if(f&&u>=9){this.hasSelection=null}this.fastPoll()};aa.prototype.onContextMenu=function(r){var t=this,e=t.cm,i=e.display,n=t.textarea;if(t.contextMenuPending){t.contextMenuPending()}var o=Ui(e,r),l=i.scroller.scrollTop;if(!o||v){return}var s=e.options.resetSelectionOnContextMenu;if(s&&e.doc.sel.contains(o)==-1){On(e,Ho)(e.doc,lo(o),$)}var c=n.style.cssText,h=t.wrapper.style.cssText;var d=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static";n.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(r.clientY-d.top-5)+"px; left: "+(r.clientX-d.left-5)+"px;\n z-index: 1000; background: "+(f?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);";var m;if(a){m=n.ownerDocument.defaultView.scrollY}i.input.focus();if(a){n.ownerDocument.defaultView.scrollTo(null,m)}i.input.reset();if(!e.somethingSelected()){n.value=t.prevInput=" "}t.contextMenuPending=g;i.selForContextMenu=e.doc.sel;clearTimeout(i.detectingSelectAll);function p(){if(n.selectionStart!=null){var r=e.somethingSelected();var o=""+(r?n.value:"");n.value="⇚";n.value=o;t.prevInput=r?"":"";n.selectionStart=1;n.selectionEnd=o.length;i.selForContextMenu=e.doc.sel}}function g(){if(t.contextMenuPending!=g){return}t.contextMenuPending=false;t.wrapper.style.cssText=h;n.style.cssText=c;if(f&&u<9){i.scrollbars.setScrollTop(i.scroller.scrollTop=l)}if(n.selectionStart!=null){if(!f||f&&u<9){p()}var r=0,o=function(){if(i.selForContextMenu==e.doc.sel&&n.selectionStart==0&&n.selectionEnd>0&&t.prevInput==""){On(e,Xo)(e)}else if(r++<10){i.detectingSelectAll=setTimeout(o,500)}else{i.selForContextMenu=null;i.input.reset()}};i.detectingSelectAll=setTimeout(o,200)}}if(f&&u>=9){p()}if(y){Nr(r);var b=function(){wr(window,"mouseup",b);setTimeout(g,20)};gr(window,"mouseup",b)}else{setTimeout(g,50)}};aa.prototype.readOnlyChanged=function(r){if(!r){this.reset()}this.textarea.disabled=r=="nocursor";this.textarea.readOnly=!!r};aa.prototype.setUneditable=function(){};aa.prototype.needsContentAttribute=false;function la(r,t){t=t?F(t):{};t.value=r.value;if(!t.tabindex&&r.tabIndex){t.tabindex=r.tabIndex}if(!t.placeholder&&r.placeholder){t.placeholder=r.placeholder}if(t.autofocus==null){var e=R(r.ownerDocument);t.autofocus=e==r||r.getAttribute("autofocus")!=null&&e==document.body}function i(){r.value=u.getValue()}var n;if(r.form){gr(r.form,"submit",i);if(!t.leaveSubmitMethodAlone){var o=r.form;n=o.submit;try{var f=o.submit=function(){i();o.submit=n;o.submit();o.submit=f}}catch(r){}}}t.finishInit=function(e){e.save=i;e.getTextArea=function(){return r};e.toTextArea=function(){e.toTextArea=isNaN;i();r.parentNode.removeChild(e.getWrapperElement());r.style.display="";if(r.form){wr(r.form,"submit",i);if(!t.leaveSubmitMethodAlone&&typeof r.form.submit=="function"){r.form.submit=n}}}};r.style.display="none";var u=Fu((function(t){return r.parentNode.insertBefore(t,r.nextSibling)}),t);return u}function sa(r){r.off=wr;r.on=gr;r.wheelEventPixels=no;r.Doc=Lf;r.splitLines=Ur;r.countColumn=P;r.findColumn=K;r.isWordChar=nr;r.Pass=V;r.signal=kr;r.Line=se;r.changeEnd=so;r.scrollbarModel=Mn;r.Pos=ut;r.cmpPos=at;r.modes=Pr;r.mimeModes=Gr;r.resolveMode=Vr;r.getMode=$r;r.modeExtensions=Qr;r.extendMode=Jr;r.copyState=Kr;r.startState=Yr;r.innerMode=qr;r.commands=ru;r.keyMap=Pf;r.keyName=Qf;r.isModifierKey=Vf;r.lookupKey=Hf;r.normalizeKeyMap=_f;r.StringStream=Xr;r.SharedTextMarker=kf;r.TextMarker=bf;r.LineWidget=df;r.e_preventDefault=xr;r.e_stopPropagation=Lr;r.e_stop=Nr;r.addClass=O;r.contains=I;r.rmClass=L;r.keyNames=zf}zu(Fu);Xu(Fu);var ca="iter insert remove copy getEditor constructor".split(" ");for(var va in Lf.prototype){if(Lf.prototype.hasOwnProperty(va)&&_(ca,va)<0){Fu.prototype[va]=function(r){return function(){return r.apply(this.doc,arguments)}}(Lf.prototype[va])}}yr(Lf);Fu.inputStyles={textarea:aa,contenteditable:ta};Fu.defineMode=function(r){if(!Fu.defaults.mode&&r!="null"){Fu.defaults.mode=r}_r.apply(this,arguments)};Fu.defineMIME=Hr;Fu.defineMode("null",(function(){return{token:function(r){return r.skipToEnd()}}}));Fu.defineMIME("text/plain","null");Fu.defineExtension=function(r,t){Fu.prototype[r]=t};Fu.defineDocExtension=function(r,t){Lf.prototype[r]=t};Fu.fromTextArea=la;sa(Fu);Fu.version="5.65.9";return Fu}))}));n((function(r,t){(function(r){r(f)})((function(r){r.defineMode("javascript",(function(t,e){var i=t.indentUnit;var n=e.statementIndent;var o=e.jsonld;var f=e.json||o;var u=e.trackScope!==false;var a=e.typescript;var l=e.wordCharacters||/[\w$\xa1-\uffff]/;var s=function(){function r(r){return{type:r,style:"keyword"}}var t=r("keyword a"),e=r("keyword b"),i=r("keyword c"),n=r("keyword d");var o=r("operator"),f={type:"atom",style:"atom"};return{if:r("if"),while:t,with:t,else:e,do:e,try:e,finally:e,return:n,break:n,continue:n,new:r("new"),delete:i,void:i,throw:i,debugger:r("debugger"),var:r("var"),const:r("var"),let:r("var"),function:r("function"),catch:r("catch"),for:r("for"),switch:r("switch"),case:r("case"),default:r("default"),in:o,typeof:o,instanceof:o,true:f,false:f,null:f,undefined:f,NaN:f,Infinity:f,this:r("this"),class:r("class"),super:r("atom"),yield:i,export:r("export"),import:r("import"),extends:i,await:i}}();var c=/[+\-*&%=<>!?|~^@]/;var v=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function h(r){var t=false,e,i=false;while((e=r.next())!=null){if(!t){if(e=="/"&&!i)return;if(e=="[")i=true;else if(i&&e=="]")i=false}t=!t&&e=="\\"}}var d,m;function p(r,t,e){d=r;m=e;return t}function g(r,t){var e=r.next();if(e=='"'||e=="'"){t.tokenize=b(e);return t.tokenize(r,t)}else if(e=="."&&r.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/)){return p("number","number")}else if(e=="."&&r.match("..")){return p("spread","meta")}else if(/[\[\]{}\(\),;\:\.]/.test(e)){return p(e)}else if(e=="="&&r.eat(">")){return p("=>","operator")}else if(e=="0"&&r.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/)){return p("number","number")}else if(/\d/.test(e)){r.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/);return p("number","number")}else if(e=="/"){if(r.eat("*")){t.tokenize=w;return w(r,t)}else if(r.eat("/")){r.skipToEnd();return p("comment","comment")}else if(nt(r,t,1)){h(r);r.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/);return p("regexp","string-2")}else{r.eat("=");return p("operator","operator",r.current())}}else if(e=="`"){t.tokenize=k;return k(r,t)}else if(e=="#"&&r.peek()=="!"){r.skipToEnd();return p("meta","meta")}else if(e=="#"&&r.eatWhile(l)){return p("variable","property")}else if(e=="<"&&r.match("!--")||e=="-"&&r.match("->")&&!/\S/.test(r.string.slice(0,r.start))){r.skipToEnd();return p("comment","comment")}else if(c.test(e)){if(e!=">"||!t.lexical||t.lexical.type!=">"){if(r.eat("=")){if(e=="!"||e=="=")r.eat("=")}else if(/[<>*+\-|&?]/.test(e)){r.eat(e);if(e==">")r.eat(e)}}if(e=="?"&&r.eat("."))return p(".");return p("operator","operator",r.current())}else if(l.test(e)){r.eatWhile(l);var i=r.current();if(t.lastType!="."){if(s.propertyIsEnumerable(i)){var n=s[i];return p(n.type,n.style,i)}if(i=="async"&&r.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/,false))return p("async","keyword",i)}return p("variable","variable",i)}}function b(r){return function(t,e){var i=false,n;if(o&&t.peek()=="@"&&t.match(v)){e.tokenize=g;return p("jsonld-keyword","meta")}while((n=t.next())!=null){if(n==r&&!i)break;i=!i&&n=="\\"}if(!i)e.tokenize=g;return p("string","string")}}function w(r,t){var e=false,i;while(i=r.next()){if(i=="/"&&e){t.tokenize=g;break}e=i=="*"}return p("comment","comment")}function k(r,t){var e=false,i;while((i=r.next())!=null){if(!e&&(i=="`"||i=="$"&&r.eat("{"))){t.tokenize=g;break}e=!e&&i=="\\"}return p("quasi","string-2",r.current())}var C="([{}])";function M(r,t){if(t.fatArrowAt)t.fatArrowAt=null;var e=r.string.indexOf("=>",r.start);if(e<0)return;if(a){var i=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(r.string.slice(r.start,e));if(i)e=i.index}var n=0,o=false;for(var f=e-1;f>=0;--f){var u=r.string.charAt(f);var s=C.indexOf(u);if(s>=0&&s<3){if(!n){++f;break}if(--n==0){if(u=="(")o=true;break}}else if(s>=3&&s<6){++n}else if(l.test(u)){o=true}else if(/["'\/`]/.test(u)){for(;;--f){if(f==0)return;var c=r.string.charAt(f-1);if(c==u&&r.string.charAt(f-2)!="\\"){f--;break}}}else if(o&&!n){++f;break}}if(o&&!n)t.fatArrowAt=f}var A={atom:true,number:true,variable:true,string:true,regexp:true,this:true,import:true,"jsonld-keyword":true};function y(r,t,e,i,n,o){this.indented=r;this.column=t;this.type=e;this.prev=n;this.info=o;if(i!=null)this.align=i}function x(r,t){if(!u)return false;for(var e=r.localVars;e;e=e.next)if(e.name==t)return true;for(var i=r.context;i;i=i.prev){for(var e=i.vars;e;e=e.next)if(e.name==t)return true}}function L(r,t,e,i,n){var o=r.cc;S.state=r;S.stream=n;S.marked=null,S.cc=o;S.style=t;if(!r.lexical.hasOwnProperty("align"))r.lexical.align=true;while(true){var u=o.length?o.pop():f?V:_;if(u(e,i)){while(o.length&&o[o.length-1].lex)o.pop()();if(S.marked)return S.marked;if(e=="variable"&&x(r,i))return"variable-2";return t}}}var S={state:null,column:null,marked:null,cc:null};function N(){for(var r=arguments.length-1;r>=0;r--)S.cc.push(arguments[r])}function E(){N.apply(null,arguments);return true}function D(r,t){for(var e=t;e;e=e.next)if(e.name==r)return true;return false}function T(r){var t=S.state;S.marked="def";if(!u)return;if(t.context){if(t.lexical.info=="var"&&t.context&&t.context.block){var i=I(r,t.context);if(i!=null){t.context=i;return}}else if(!D(r,t.localVars)){t.localVars=new B(r,t.localVars);return}}if(e.globalVars&&!D(r,t.globalVars))t.globalVars=new B(r,t.globalVars)}function I(r,t){if(!t){return null}else if(t.block){var e=I(r,t.prev);if(!e)return null;if(e==t.prev)return t;return new O(e,t.vars,true)}else if(D(r,t.vars)){return t}else{return new O(t.prev,new B(r,t.vars),false)}}function R(r){return r=="public"||r=="private"||r=="protected"||r=="abstract"||r=="readonly"}function O(r,t,e){this.prev=r;this.vars=t;this.block=e}function B(r,t){this.name=r;this.next=t}var U=new B("this",new B("arguments",null));function z(){S.state.context=new O(S.state.context,S.state.localVars,false);S.state.localVars=U}function j(){S.state.context=new O(S.state.context,S.state.localVars,true);S.state.localVars=null}z.lex=j.lex=true;function W(){S.state.localVars=S.state.context.vars;S.state.context=S.state.context.prev}W.lex=true;function F(r,t){var e=function(){var e=S.state,i=e.indented;if(e.lexical.type=="stat")i=e.lexical.indented;else for(var n=e.lexical;n&&n.type==")"&&n.align;n=n.prev)i=n.indented;e.lexical=new y(i,S.stream.column(),r,null,e.lexical,t)};e.lex=true;return e}function P(){var r=S.state;if(r.lexical.prev){if(r.lexical.type==")")r.indented=r.lexical.indented;r.lexical=r.lexical.prev}}P.lex=true;function G(r){function t(e){if(e==r)return E();else if(r==";"||e=="}"||e==")"||e=="]")return N();else return E(t)}return t}function _(r,t){if(r=="var")return E(F("vardef",t),Nr,G(";"),P);if(r=="keyword a")return E(F("form"),Q,_,P);if(r=="keyword b")return E(F("form"),_,P);if(r=="keyword d")return S.stream.match(/^\s*$/,false)?E():E(F("stat"),K,G(";"),P);if(r=="debugger")return E(G(";"));if(r=="{")return E(F("}"),j,vr,P,W);if(r==";")return E();if(r=="if"){if(S.state.lexical.info=="else"&&S.state.cc[S.state.cc.length-1]==P)S.state.cc.pop()();return E(F("form"),Q,_,P,Or)}if(r=="function")return E(jr);if(r=="for")return E(F("form"),j,Br,_,W,P);if(r=="class"||a&&t=="interface"){S.marked="keyword";return E(F("form",r=="class"?r:t),_r,P)}if(r=="variable"){if(a&&t=="declare"){S.marked="keyword";return E(_)}else if(a&&(t=="module"||t=="enum"||t=="type")&&S.stream.match(/^\s*\w/,false)){S.marked="keyword";if(t=="enum")return E(tt);else if(t=="type")return E(Fr,G("operator"),gr,G(";"));else return E(F("form"),Er,G("{"),F("}"),vr,P,P)}else if(a&&t=="namespace"){S.marked="keyword";return E(F("form"),V,_,P)}else if(a&&t=="abstract"){S.marked="keyword";return E(_)}else{return E(F("stat"),or)}}if(r=="switch")return E(F("form"),Q,G("{"),F("}","switch"),j,vr,P,P,W);if(r=="case")return E(V,G(":"));if(r=="default")return E(G(":"));if(r=="catch")return E(F("form"),z,H,_,P,W);if(r=="export")return E(F("stat"),Qr,P);if(r=="import")return E(F("stat"),Kr,P);if(r=="async")return E(_);if(t=="@")return E(V,_);return N(F("stat"),V,G(";"),P)}function H(r){if(r=="(")return E(Pr,G(")"))}function V(r,t){return J(r,t,false)}function $(r,t){return J(r,t,true)}function Q(r){if(r!="(")return N();return E(F(")"),K,G(")"),P)}function J(r,t,e){if(S.state.fatArrowAt==S.stream.start){var i=e?tr:rr;if(r=="(")return E(z,F(")"),sr(Pr,")"),P,G("=>"),i,W);else if(r=="variable")return N(z,Er,G("=>"),i,W)}var n=e?Y:q;if(A.hasOwnProperty(r))return E(n);if(r=="function")return E(jr,n);if(r=="class"||a&&t=="interface"){S.marked="keyword";return E(F("form"),Gr,P)}if(r=="keyword c"||r=="async")return E(e?$:V);if(r=="(")return E(F(")"),K,G(")"),P,n);if(r=="operator"||r=="spread")return E(e?$:V);if(r=="[")return E(F("]"),rt,P,n);if(r=="{")return cr(ur,"}",null,n);if(r=="quasi")return N(X,n);if(r=="new")return E(er(e));return E()}function K(r){if(r.match(/[;\}\)\],]/))return N();return N(V)}function q(r,t){if(r==",")return E(K);return Y(r,t,false)}function Y(r,t,e){var i=e==false?q:Y;var n=e==false?V:$;if(r=="=>")return E(z,e?tr:rr,W);if(r=="operator"){if(/\+\+|--/.test(t)||a&&t=="!")return E(i);if(a&&t=="<"&&S.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/,false))return E(F(">"),sr(gr,">"),P,i);if(t=="?")return E(V,G(":"),n);return E(n)}if(r=="quasi"){return N(X,i)}if(r==";")return;if(r=="(")return cr($,")","call",i);if(r==".")return E(fr,i);if(r=="[")return E(F("]"),K,G("]"),P,i);if(a&&t=="as"){S.marked="keyword";return E(gr,i)}if(r=="regexp"){S.state.lastType=S.marked="operator";S.stream.backUp(S.stream.pos-S.stream.start-1);return E(n)}}function X(r,t){if(r!="quasi")return N();if(t.slice(t.length-2)!="${")return E(X);return E(K,Z)}function Z(r){if(r=="}"){S.marked="string-2";S.state.tokenize=k;return E(X)}}function rr(r){M(S.stream,S.state);return N(r=="{"?_:V)}function tr(r){M(S.stream,S.state);return N(r=="{"?_:$)}function er(r){return function(t){if(t==".")return E(r?nr:ir);else if(t=="variable"&&a)return E(xr,r?Y:q);else return N(r?$:V)}}function ir(r,t){if(t=="target"){S.marked="keyword";return E(q)}}function nr(r,t){if(t=="target"){S.marked="keyword";return E(Y)}}function or(r){if(r==":")return E(P,_);return N(q,G(";"),P)}function fr(r){if(r=="variable"){S.marked="property";return E()}}function ur(r,t){if(r=="async"){S.marked="property";return E(ur)}else if(r=="variable"||S.style=="keyword"){S.marked="property";if(t=="get"||t=="set")return E(ar);var e;if(a&&S.state.fatArrowAt==S.stream.start&&(e=S.stream.match(/^\s*:\s*/,false)))S.state.fatArrowAt=S.stream.pos+e[0].length;return E(lr)}else if(r=="number"||r=="string"){S.marked=o?"property":S.style+" property";return E(lr)}else if(r=="jsonld-keyword"){return E(lr)}else if(a&&R(t)){S.marked="keyword";return E(ur)}else if(r=="["){return E(V,hr,G("]"),lr)}else if(r=="spread"){return E($,lr)}else if(t=="*"){S.marked="keyword";return E(ur)}else if(r==":"){return N(lr)}}function ar(r){if(r!="variable")return N(lr);S.marked="property";return E(jr)}function lr(r){if(r==":")return E($);if(r=="(")return N(jr)}function sr(r,t,e){function i(n,o){if(e?e.indexOf(n)>-1:n==","){var f=S.state.lexical;if(f.info=="call")f.pos=(f.pos||0)+1;return E((function(e,i){if(e==t||i==t)return N();return N(r)}),i)}if(n==t||o==t)return E();if(e&&e.indexOf(";")>-1)return N(r);return E(G(t))}return function(e,n){if(e==t||n==t)return E();return N(r,i)}}function cr(r,t,e){for(var i=3;i<arguments.length;i++)S.cc.push(arguments[i]);return E(F(t,e),sr(r,t),P)}function vr(r){if(r=="}")return E();return N(_,vr)}function hr(r,t){if(a){if(r==":")return E(gr);if(t=="?")return E(hr)}}function dr(r,t){if(a&&(r==":"||t=="in"))return E(gr)}function mr(r){if(a&&r==":"){if(S.stream.match(/^\s*\w+\s+is\b/,false))return E(V,pr,gr);else return E(gr)}}function pr(r,t){if(t=="is"){S.marked="keyword";return E()}}function gr(r,t){if(t=="keyof"||t=="typeof"||t=="infer"||t=="readonly"){S.marked="keyword";return E(t=="typeof"?$:gr)}if(r=="variable"||t=="void"){S.marked="type";return E(yr)}if(t=="|"||t=="&")return E(gr);if(r=="string"||r=="number"||r=="atom")return E(yr);if(r=="[")return E(F("]"),sr(gr,"]",","),P,yr);if(r=="{")return E(F("}"),wr,P,yr);if(r=="(")return E(sr(Ar,")"),br,yr);if(r=="<")return E(sr(gr,">"),gr);if(r=="quasi"){return N(Cr,yr)}}function br(r){if(r=="=>")return E(gr)}function wr(r){if(r.match(/[\}\)\]]/))return E();if(r==","||r==";")return E(wr);return N(kr,wr)}function kr(r,t){if(r=="variable"||S.style=="keyword"){S.marked="property";return E(kr)}else if(t=="?"||r=="number"||r=="string"){return E(kr)}else if(r==":"){return E(gr)}else if(r=="["){return E(G("variable"),dr,G("]"),kr)}else if(r=="("){return N(Wr,kr)}else if(!r.match(/[;\}\)\],]/)){return E()}}function Cr(r,t){if(r!="quasi")return N();if(t.slice(t.length-2)!="${")return E(Cr);return E(gr,Mr)}function Mr(r){if(r=="}"){S.marked="string-2";S.state.tokenize=k;return E(Cr)}}function Ar(r,t){if(r=="variable"&&S.stream.match(/^\s*[?:]/,false)||t=="?")return E(Ar);if(r==":")return E(gr);if(r=="spread")return E(Ar);return N(gr)}function yr(r,t){if(t=="<")return E(F(">"),sr(gr,">"),P,yr);if(t=="|"||r=="."||t=="&")return E(gr);if(r=="[")return E(gr,G("]"),yr);if(t=="extends"||t=="implements"){S.marked="keyword";return E(gr)}if(t=="?")return E(gr,G(":"),gr)}function xr(r,t){if(t=="<")return E(F(">"),sr(gr,">"),P,yr)}function Lr(){return N(gr,Sr)}function Sr(r,t){if(t=="=")return E(gr)}function Nr(r,t){if(t=="enum"){S.marked="keyword";return E(tt)}return N(Er,hr,Ir,Rr)}function Er(r,t){if(a&&R(t)){S.marked="keyword";return E(Er)}if(r=="variable"){T(t);return E()}if(r=="spread")return E(Er);if(r=="[")return cr(Tr,"]");if(r=="{")return cr(Dr,"}")}function Dr(r,t){if(r=="variable"&&!S.stream.match(/^\s*:/,false)){T(t);return E(Ir)}if(r=="variable")S.marked="property";if(r=="spread")return E(Er);if(r=="}")return N();if(r=="[")return E(V,G("]"),G(":"),Dr);return E(G(":"),Er,Ir)}function Tr(){return N(Er,Ir)}function Ir(r,t){if(t=="=")return E($)}function Rr(r){if(r==",")return E(Nr)}function Or(r,t){if(r=="keyword b"&&t=="else")return E(F("form","else"),_,P)}function Br(r,t){if(t=="await")return E(Br);if(r=="(")return E(F(")"),Ur,P)}function Ur(r){if(r=="var")return E(Nr,zr);if(r=="variable")return E(zr);return N(zr)}function zr(r,t){if(r==")")return E();if(r==";")return E(zr);if(t=="in"||t=="of"){S.marked="keyword";return E(V,zr)}return N(V,zr)}function jr(r,t){if(t=="*"){S.marked="keyword";return E(jr)}if(r=="variable"){T(t);return E(jr)}if(r=="(")return E(z,F(")"),sr(Pr,")"),P,mr,_,W);if(a&&t=="<")return E(F(">"),sr(Lr,">"),P,jr)}function Wr(r,t){if(t=="*"){S.marked="keyword";return E(Wr)}if(r=="variable"){T(t);return E(Wr)}if(r=="(")return E(z,F(")"),sr(Pr,")"),P,mr,W);if(a&&t=="<")return E(F(">"),sr(Lr,">"),P,Wr)}function Fr(r,t){if(r=="keyword"||r=="variable"){S.marked="type";return E(Fr)}else if(t=="<"){return E(F(">"),sr(Lr,">"),P)}}function Pr(r,t){if(t=="@")E(V,Pr);if(r=="spread")return E(Pr);if(a&&R(t)){S.marked="keyword";return E(Pr)}if(a&&r=="this")return E(hr,Ir);return N(Er,hr,Ir)}function Gr(r,t){if(r=="variable")return _r(r,t);return Hr(r,t)}function _r(r,t){if(r=="variable"){T(t);return E(Hr)}}function Hr(r,t){if(t=="<")return E(F(">"),sr(Lr,">"),P,Hr);if(t=="extends"||t=="implements"||a&&r==","){if(t=="implements")S.marked="keyword";return E(a?gr:V,Hr)}if(r=="{")return E(F("}"),Vr,P)}function Vr(r,t){if(r=="async"||r=="variable"&&(t=="static"||t=="get"||t=="set"||a&&R(t))&&S.stream.match(/^\s+[\w$\xa1-\uffff]/,false)){S.marked="keyword";return E(Vr)}if(r=="variable"||S.style=="keyword"){S.marked="property";return E($r,Vr)}if(r=="number"||r=="string")return E($r,Vr);if(r=="[")return E(V,hr,G("]"),$r,Vr);if(t=="*"){S.marked="keyword";return E(Vr)}if(a&&r=="(")return N(Wr,Vr);if(r==";"||r==",")return E(Vr);if(r=="}")return E();if(t=="@")return E(V,Vr)}function $r(r,t){if(t=="!")return E($r);if(t=="?")return E($r);if(r==":")return E(gr,Ir);if(t=="=")return E($);var e=S.state.lexical.prev,i=e&&e.info=="interface";return N(i?Wr:jr)}function Qr(r,t){if(t=="*"){S.marked="keyword";return E(Zr,G(";"))}if(t=="default"){S.marked="keyword";return E(V,G(";"))}if(r=="{")return E(sr(Jr,"}"),Zr,G(";"));return N(_)}function Jr(r,t){if(t=="as"){S.marked="keyword";return E(G("variable"))}if(r=="variable")return N($,Jr)}function Kr(r){if(r=="string")return E();if(r=="(")return N(V);if(r==".")return N(q);return N(qr,Yr,Zr)}function qr(r,t){if(r=="{")return cr(qr,"}");if(r=="variable")T(t);if(t=="*")S.marked="keyword";return E(Xr)}function Yr(r){if(r==",")return E(qr,Yr)}function Xr(r,t){if(t=="as"){S.marked="keyword";return E(qr)}}function Zr(r,t){if(t=="from"){S.marked="keyword";return E(V)}}function rt(r){if(r=="]")return E();return N(sr($,"]"))}function tt(){return N(F("form"),Er,G("{"),F("}"),sr(et,"}"),P,P)}function et(){return N(Er,Ir)}function it(r,t){return r.lastType=="operator"||r.lastType==","||c.test(t.charAt(0))||/[,.]/.test(t.charAt(0))}function nt(r,t,e){return t.tokenize==g&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(t.lastType)||t.lastType=="quasi"&&/\{\s*$/.test(r.string.slice(0,r.pos-(e||0)))}return{startState:function(r){var t={tokenize:g,lastType:"sof",cc:[],lexical:new y((r||0)-i,0,"block",false),localVars:e.localVars,context:e.localVars&&new O(null,null,false),indented:r||0};if(e.globalVars&&typeof e.globalVars=="object")t.globalVars=e.globalVars;return t},token:function(r,t){if(r.sol()){if(!t.lexical.hasOwnProperty("align"))t.lexical.align=false;t.indented=r.indentation();M(r,t)}if(t.tokenize!=w&&r.eatSpace())return null;var e=t.tokenize(r,t);if(d=="comment")return e;t.lastType=d=="operator"&&(m=="++"||m=="--")?"incdec":d;return L(t,e,d,m,r)},indent:function(t,o){if(t.tokenize==w||t.tokenize==k)return r.Pass;if(t.tokenize!=g)return 0;var f=o&&o.charAt(0),u=t.lexical,a;if(!/^\s*else\b/.test(o))for(var l=t.cc.length-1;l>=0;--l){var s=t.cc[l];if(s==P)u=u.prev;else if(s!=Or&&s!=W)break}while((u.type=="stat"||u.type=="form")&&(f=="}"||(a=t.cc[t.cc.length-1])&&(a==q||a==Y)&&!/^[,\.=+\-*:?[\(]/.test(o)))u=u.prev;if(n&&u.type==")"&&u.prev.type=="stat")u=u.prev;var c=u.type,v=f==c;if(c=="vardef")return u.indented+(t.lastType=="operator"||t.lastType==","?u.info.length+1:0);else if(c=="form"&&f=="{")return u.indented;else if(c=="form")return u.indented+i;else if(c=="stat")return u.indented+(it(t,o)?n||i:0);else if(u.info=="switch"&&!v&&e.doubleIndentSwitch!=false)return u.indented+(/^(?:case|default)\b/.test(o)?i:2*i);else if(u.align)return u.column+(v?0:1);else return u.indented+(v?0:i)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:f?null:"/*",blockCommentEnd:f?null:"*/",blockCommentContinue:f?null:" * ",lineComment:f?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:f?"json":"javascript",jsonldMode:o,jsonMode:f,expressionAllowed:nt,skipExpression:function(t){L(t,"atom","atom","true",new r.StringStream("",2,null))}}}));r.registerHelper("wordChars","javascript",/[\w$]/);r.defineMIME("text/javascript","javascript");r.defineMIME("text/ecmascript","javascript");r.defineMIME("application/javascript","javascript");r.defineMIME("application/x-javascript","javascript");r.defineMIME("application/ecmascript","javascript");r.defineMIME("application/json",{name:"javascript",json:true});r.defineMIME("application/x-json",{name:"javascript",json:true});r.defineMIME("application/manifest+json",{name:"javascript",json:true});r.defineMIME("application/ld+json",{name:"javascript",jsonld:true});r.defineMIME("text/typescript",{name:"javascript",typescript:true});r.defineMIME("application/typescript",{name:"javascript",typescript:true})}))}));n((function(r,t){(function(r){r(f)})((function(r){r.defineMode("jinja2",(function(){var r=["and","as","block","endblock","by","cycle","debug","else","elif","extends","filter","endfilter","firstof","do","for","endfor","if","endif","ifchanged","endifchanged","ifequal","endifequal","ifnotequal","set","raw","endraw","endifnotequal","in","include","load","not","now","or","parsed","regroup","reversed","spaceless","call","endcall","macro","endmacro","endspaceless","ssi","templatetag","openblock","closeblock","openvariable","closevariable","without","context","openbrace","closebrace","opencomment","closecomment","widthratio","url","with","endwith","get_current_language","trans","endtrans","noop","blocktrans","endblocktrans","get_available_languages","get_current_language_bidi","pluralize","autoescape","endautoescape"],t=/^[+\-*&%=<>!?|~^]/,e=/^[:\[\(\{]/,i=["true","false"],n=/^(\d[+\-\*\/])?\d+(\.\d+)?/;r=new RegExp("(("+r.join(")|(")+"))\\b");i=new RegExp("(("+i.join(")|(")+"))\\b");function o(o,f){var u=o.peek();if(f.incomment){if(!o.skipTo("#}")){o.skipToEnd()}else{o.eatWhile(/\#|}/);f.incomment=false}return"comment"}else if(f.intag){if(f.operator){f.operator=false;if(o.match(i)){return"atom"}if(o.match(n)){return"number"}}if(f.sign){f.sign=false;if(o.match(i)){return"atom"}if(o.match(n)){return"number"}}if(f.instring){if(u==f.instring){f.instring=false}o.next();return"string"}else if(u=="'"||u=='"'){f.instring=u;o.next();return"string"}else if(f.inbraces>0&&u==")"){o.next();f.inbraces--}else if(u=="("){o.next();f.inbraces++}else if(f.inbrackets>0&&u=="]"){o.next();f.inbrackets--}else if(u=="["){o.next();f.inbrackets++}else if(!f.lineTag&&(o.match(f.intag+"}")||o.eat("-")&&o.match(f.intag+"}"))){f.intag=false;return"tag"}else if(o.match(t)){f.operator=true;return"operator"}else if(o.match(e)){f.sign=true}else{if(o.column()==1&&f.lineTag&&o.match(r)){return"keyword"}if(o.eat(" ")||o.sol()){if(o.match(r)){return"keyword"}if(o.match(i)){return"atom"}if(o.match(n)){return"number"}if(o.sol()){o.next()}}else{o.next()}}return"variable"}else if(o.eat("{")){if(o.eat("#")){f.incomment=true;if(!o.skipTo("#}")){o.skipToEnd()}else{o.eatWhile(/\#|}/);f.incomment=false}return"comment"}else if(u=o.eat(/\{|%/)){f.intag=u;f.inbraces=0;f.inbrackets=0;if(u=="{"){f.intag="}"}o.eat("-");return"tag"}}else if(o.eat("#")){if(o.peek()=="#"){o.skipToEnd();return"comment"}else if(!o.eol()){f.intag=true;f.lineTag=true;f.inbraces=0;f.inbrackets=0;return"tag"}}o.next()}return{startState:function(){return{tokenize:o,inbrackets:0,inbraces:0}},token:function(r,t){var e=t.tokenize(r,t);if(r.eol()&&t.lineTag&&!t.instring&&t.inbraces==0&&t.inbrackets==0){t.intag=false;t.lineTag=false}return e},blockCommentStart:"{#",blockCommentEnd:"#}",lineComment:"##"}}));r.defineMIME("text/jinja2","jinja2")}))}));n((function(r,t){(function(r){r(f)})((function(r){var t="CodeMirror-activeline";var e="CodeMirror-activeline-background";var i="CodeMirror-activeline-gutter";r.defineOption("styleActiveLine",false,(function(t,e,i){var o=i==r.Init?false:i;if(e==o)return;if(o){t.off("beforeSelectionChange",u);n(t);delete t.state.activeLines}if(e){t.state.activeLines=[];f(t,t.listSelections());t.on("beforeSelectionChange",u)}}));function n(r){for(var n=0;n<r.state.activeLines.length;n++){r.removeLineClass(r.state.activeLines[n],"wrap",t);r.removeLineClass(r.state.activeLines[n],"background",e);r.removeLineClass(r.state.activeLines[n],"gutter",i)}}function o(r,t){if(r.length!=t.length)return false;for(var e=0;e<r.length;e++)if(r[e]!=t[e])return false;return true}function f(r,f){var u=[];for(var a=0;a<f.length;a++){var l=f[a];var s=r.getOption("styleActiveLine");if(typeof s=="object"&&s.nonEmpty?l.anchor.line!=l.head.line:!l.empty())continue;var c=r.getLineHandleVisualStart(l.head.line);if(u[u.length-1]!=c)u.push(c)}if(o(r.state.activeLines,u))return;r.operation((function(){n(r);for(var o=0;o<u.length;o++){r.addLineClass(u[o],"wrap",t);r.addLineClass(u[o],"background",e);r.addLineClass(u[o],"gutter",i)}r.state.activeLines=u}))}function u(r,t){f(r,t.ranges)}}))}));n((function(r,t){(function(r){r(f)})((function(r){var t=/MSIE \d/.test(navigator.userAgent)&&(document.documentMode==null||document.documentMode<8);var e=r.Pos;var i={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<","<":">>",">":"<<"};function n(r){return r&&r.bracketRegex||/[(){}[\]]/}function o(r,t,o){var u=r.getLineHandle(t.line),a=t.ch-1;var l=o&&o.afterCursor;if(l==null)l=/(^| )cm-fat-cursor($| )/.test(r.getWrapperElement().className);var s=n(o);var c=!l&&a>=0&&s.test(u.text.charAt(a))&&i[u.text.charAt(a)]||s.test(u.text.charAt(a+1))&&i[u.text.charAt(++a)];if(!c)return null;var v=c.charAt(1)==">"?1:-1;if(o&&o.strict&&v>0!=(a==t.ch))return null;var h=r.getTokenTypeAt(e(t.line,a+1));var d=f(r,e(t.line,a+(v>0?1:0)),v,h,o);if(d==null)return null;return{from:e(t.line,a),to:d&&d.pos,match:d&&d.ch==c.charAt(0),forward:v>0}}function f(r,t,o,f,u){var a=u&&u.maxScanLineLength||1e4;var l=u&&u.maxScanLines||1e3;var s=[];var c=n(u);var v=o>0?Math.min(t.line+l,r.lastLine()+1):Math.max(r.firstLine()-1,t.line-l);for(var h=t.line;h!=v;h+=o){var d=r.getLine(h);if(!d)continue;var m=o>0?0:d.length-1,p=o>0?d.length:-1;if(d.length>a)continue;if(h==t.line)m=t.ch-(o<0?1:0);for(;m!=p;m+=o){var g=d.charAt(m);if(c.test(g)&&(f===undefined||(r.getTokenTypeAt(e(h,m+1))||"")==(f||""))){var b=i[g];if(b&&b.charAt(1)==">"==o>0)s.push(g);else if(!s.length)return{pos:e(h,m),ch:g};else s.pop()}}}return h-o==(o>0?r.lastLine():r.firstLine())?false:null}function u(r,i,n){var f=r.state.matchBrackets.maxHighlightLineLength||1e3,u=n&&n.highlightNonMatching;var a=[],l=r.listSelections();for(var s=0;s<l.length;s++){var c=l[s].empty()&&o(r,l[s].head,n);if(c&&(c.match||u!==false)&&r.getLine(c.from.line).length<=f){var v=c.match?"CodeMirror-matchingbracket":"CodeMirror-nonmatchingbracket";a.push(r.markText(c.from,e(c.from.line,c.from.ch+1),{className:v}));if(c.to&&r.getLine(c.to.line).length<=f)a.push(r.markText(c.to,e(c.to.line,c.to.ch+1),{className:v}))}}if(a.length){if(t&&r.state.focused)r.focus();var h=function(){r.operation((function(){for(var r=0;r<a.length;r++)a[r].clear()}))};if(i)setTimeout(h,800);else return h}}function a(r){r.operation((function(){if(r.state.matchBrackets.currentlyHighlighted){r.state.matchBrackets.currentlyHighlighted();r.state.matchBrackets.currentlyHighlighted=null}r.state.matchBrackets.currentlyHighlighted=u(r,false,r.state.matchBrackets)}))}function l(r){if(r.state.matchBrackets&&r.state.matchBrackets.currentlyHighlighted){r.state.matchBrackets.currentlyHighlighted();r.state.matchBrackets.currentlyHighlighted=null}}r.defineOption("matchBrackets",false,(function(t,e,i){if(i&&i!=r.Init){t.off("cursorActivity",a);t.off("focus",a);t.off("blur",l);l(t)}if(e){t.state.matchBrackets=typeof e=="object"?e:{};t.on("cursorActivity",a);t.on("focus",a);t.on("blur",l)}}));r.defineExtension("matchBrackets",(function(){u(this,true)}));r.defineExtension("findMatchingBracket",(function(r,t,e){if(e||typeof t=="boolean"){if(!e){t=t?{strict:true}:null}else{e.strict=t;t=e}}return o(this,r,t)}));r.defineExtension("scanForBracket",(function(r,t,e,i){return f(this,r,t,e,i)}))}))}));n((function(r,t){(function(r){r(f)})((function(r){var t="CodeMirror-lint-markers";var e="CodeMirror-lint-line-";function i(t,e,i){var n=document.createElement("div");n.className="CodeMirror-lint-tooltip cm-s-"+t.options.theme;n.appendChild(i.cloneNode(true));if(t.state.lint.options.selfContain)t.getWrapperElement().appendChild(n);else document.body.appendChild(n);function o(t){if(!n.parentNode)return r.off(document,"mousemove",o);n.style.top=Math.max(0,t.clientY-n.offsetHeight-5)+"px";n.style.left=t.clientX+5+"px"}r.on(document,"mousemove",o);o(e);if(n.style.opacity!=null)n.style.opacity=1;return n}function n(r){if(r.parentNode)r.parentNode.removeChild(r)}function o(r){if(!r.parentNode)return;if(r.style.opacity==null)n(r);r.style.opacity=0;setTimeout((function(){n(r)}),600)}function f(t,e,n,f){var u=i(t,e,n);function a(){r.off(f,"mouseout",a);if(u){o(u);u=null}}var l=setInterval((function(){if(u)for(var r=f;;r=r.parentNode){if(r&&r.nodeType==11)r=r.host;if(r==document.body)return;if(!r){a();break}}if(!u)return clearInterval(l)}),400);r.on(f,"mouseout",a)}function u(r,t,e){this.marked=[];if(t instanceof Function)t={getAnnotations:t};if(!t||t===true)t={};this.options={};this.linterOptions=t.options||{};for(var i in a)this.options[i]=a[i];for(var i in t){if(a.hasOwnProperty(i)){if(t[i]!=null)this.options[i]=t[i]}else if(!t.options){this.linterOptions[i]=t[i]}}this.timeout=null;this.hasGutter=e;this.onMouseOver=function(t){k(r,t)};this.waitingFor=0}var a={highlightLines:false,tooltips:true,delay:500,lintOnChange:true,getAnnotations:null,async:false,selfContain:null,formatAnnotation:null,onUpdateLinting:null};function l(r){var e=r.state.lint;if(e.hasGutter)r.clearGutter(t);if(e.options.highlightLines)s(r);for(var i=0;i<e.marked.length;++i)e.marked[i].clear();e.marked.length=0}function s(r){r.eachLine((function(t){var e=t.wrapClass&&/\bCodeMirror-lint-line-\w+\b/.exec(t.wrapClass);if(e)r.removeLineClass(t,"wrap",e[0])}))}function c(t,e,i,n,o){var u=document.createElement("div"),a=u;u.className="CodeMirror-lint-marker CodeMirror-lint-marker-"+i;if(n){a=u.appendChild(document.createElement("div"));a.className="CodeMirror-lint-marker CodeMirror-lint-marker-multiple"}if(o!=false)r.on(a,"mouseover",(function(r){f(t,r,e,a)}));return u}function v(r,t){if(r=="error")return r;else return t}function h(r){var t=[];for(var e=0;e<r.length;++e){var i=r[e],n=i.from.line;(t[n]||(t[n]=[])).push(i)}return t}function d(r){var t=r.severity;if(!t)t="error";var e=document.createElement("div");e.className="CodeMirror-lint-message CodeMirror-lint-message-"+t;if(typeof r.messageHTML!="undefined"){e.innerHTML=r.messageHTML}else{e.appendChild(document.createTextNode(r.message))}return e}function m(t,e){var i=t.state.lint;var n=++i.waitingFor;function o(){n=-1;t.off("change",o)}t.on("change",o);e(t.getValue(),(function(e,f){t.off("change",o);if(i.waitingFor!=n)return;if(f&&e instanceof r)e=f;t.operation((function(){g(t,e)}))}),i.linterOptions,t)}function p(t){var e=t.state.lint;if(!e)return;var i=e.options;var n=i.getAnnotations||t.getHelper(r.Pos(0,0),"lint");if(!n)return;if(i.async||n.async){m(t,n)}else{var o=n(t.getValue(),e.linterOptions,t);if(!o)return;if(o.then)o.then((function(r){t.operation((function(){g(t,r)}))}));else t.operation((function(){g(t,o)}))}}function g(r,i){var n=r.state.lint;if(!n)return;var o=n.options;l(r);var f=h(i);for(var u=0;u<f.length;++u){var a=f[u];if(!a)continue;var s=[];a=a.filter((function(r){return s.indexOf(r.message)>-1?false:s.push(r.message)}));var m=null;var p=n.hasGutter&&document.createDocumentFragment();for(var g=0;g<a.length;++g){var b=a[g];var w=b.severity;if(!w)w="error";m=v(m,w);if(o.formatAnnotation)b=o.formatAnnotation(b);if(n.hasGutter)p.appendChild(d(b));if(b.to)n.marked.push(r.markText(b.from,b.to,{className:"CodeMirror-lint-mark CodeMirror-lint-mark-"+w,__annotation:b}))}if(n.hasGutter)r.setGutterMarker(u,t,c(r,p,m,f[u].length>1,o.tooltips));if(o.highlightLines)r.addLineClass(u,"wrap",e+m)}if(o.onUpdateLinting)o.onUpdateLinting(i,f,r)}function b(r){var t=r.state.lint;if(!t)return;clearTimeout(t.timeout);t.timeout=setTimeout((function(){p(r)}),t.options.delay)}function w(r,t,e){var i=e.target||e.srcElement;var n=document.createDocumentFragment();for(var o=0;o<t.length;o++){var u=t[o];n.appendChild(d(u))}f(r,e,n,i)}function k(r,t){var e=t.target||t.srcElement;if(!/\bCodeMirror-lint-mark-/.test(e.className))return;var i=e.getBoundingClientRect(),n=(i.left+i.right)/2,o=(i.top+i.bottom)/2;var f=r.findMarksAt(r.coordsChar({left:n,top:o},"client"));var u=[];for(var a=0;a<f.length;++a){var l=f[a].__annotation;if(l)u.push(l)}if(u.length)w(r,u,t)}r.defineOption("lint",false,(function(e,i,n){if(n&&n!=r.Init){l(e);if(e.state.lint.options.lintOnChange!==false)e.off("change",b);r.off(e.getWrapperElement(),"mouseover",e.state.lint.onMouseOver);clearTimeout(e.state.lint.timeout);delete e.state.lint}if(i){var o=e.getOption("gutters"),f=false;for(var a=0;a<o.length;++a)if(o[a]==t)f=true;var s=e.state.lint=new u(e,i,f);if(s.options.lintOnChange)e.on("change",b);if(s.options.tooltips!=false&&s.options.tooltips!="gutter")r.on(e.getWrapperElement(),"mouseover",s.onMouseOver);p(e)}}));r.defineExtension("performLint",(function(){p(this)}))}))}));n((function(r,t){(function(r){r(f)})((function(r){r.registerHelper("lint","json",(function(t){var e=[];if(!window.jsonlint){if(window.console){window.console.error("Error: window.jsonlint not defined, CodeMirror JSON linting cannot run.")}return e}var i=window.jsonlint.parser||window.jsonlint;i.parseError=function(t,i){var n=i.loc;e.push({from:r.Pos(n.first_line-1,n.first_column),to:r.Pos(n.last_line-1,n.last_column),message:t})};try{i.parse(t)}catch(r){}return e}))}))}));var u=n((function(r,t){(function(r){r(f)})((function(r){function t(t,i,o,f){if(o&&o.call){var u=o;o=null}else{var u=n(t,o,"rangeFinder")}if(typeof i=="number")i=r.Pos(i,0);var a=n(t,o,"minFoldSize");function l(r){var e=u(t,i);if(!e||e.to.line-e.from.line<a)return null;if(f==="fold")return e;var n=t.findMarksAt(e.from);for(var o=0;o<n.length;++o){if(n[o].__isFold){if(!r)return null;e.cleared=true;n[o].clear()}}return e}var s=l(true);if(n(t,o,"scanUp"))while(!s&&i.line>t.firstLine()){i=r.Pos(i.line-1,0);s=l(false)}if(!s||s.cleared||f==="unfold")return;var c=e(t,o,s);r.on(c,"mousedown",(function(t){v.clear();r.e_preventDefault(t)}));var v=t.markText(s.from,s.to,{replacedWith:c,clearOnEnter:n(t,o,"clearOnEnter"),__isFold:true});v.on("clear",(function(e,i){r.signal(t,"unfold",t,e,i)}));r.signal(t,"fold",t,s.from,s.to)}function e(r,t,e){var i=n(r,t,"widget");if(typeof i=="function"){i=i(e.from,e.to)}if(typeof i=="string"){var o=document.createTextNode(i);i=document.createElement("span");i.appendChild(o);i.className="CodeMirror-foldmarker"}else if(i){i=i.cloneNode(true)}return i}r.newFoldFunction=function(r,e){return function(i,n){t(i,n,{rangeFinder:r,widget:e})}};r.defineExtension("foldCode",(function(r,e,i){t(this,r,e,i)}));r.defineExtension("isFolded",(function(r){var t=this.findMarksAt(r);for(var e=0;e<t.length;++e)if(t[e].__isFold)return true}));r.commands.toggleFold=function(r){r.foldCode(r.getCursor())};r.commands.fold=function(r){r.foldCode(r.getCursor(),null,"fold")};r.commands.unfold=function(r){r.foldCode(r.getCursor(),{scanUp:false},"unfold")};r.commands.foldAll=function(t){t.operation((function(){for(var e=t.firstLine(),i=t.lastLine();e<=i;e++)t.foldCode(r.Pos(e,0),{scanUp:false},"fold")}))};r.commands.unfoldAll=function(t){t.operation((function(){for(var e=t.firstLine(),i=t.lastLine();e<=i;e++)t.foldCode(r.Pos(e,0),{scanUp:false},"unfold")}))};r.registerHelper("fold","combine",(function(){var r=Array.prototype.slice.call(arguments,0);return function(t,e){for(var i=0;i<r.length;++i){var n=r[i](t,e);if(n)return n}}}));r.registerHelper("fold","auto",(function(r,t){var e=r.getHelpers(t,"fold");for(var i=0;i<e.length;i++){var n=e[i](r,t);if(n)return n}}));var i={rangeFinder:r.fold.auto,widget:"↔",minFoldSize:0,scanUp:false,clearOnEnter:true};r.defineOption("foldOptions",null);function n(r,t,e){if(t&&t[e]!==undefined)return t[e];var n=r.options.foldOptions;if(n&&n[e]!==undefined)return n[e];return i[e]}r.defineExtension("foldOption",(function(r,t){return n(this,r,t)}))}))}));n((function(r,t){(function(r){r(f,u)})((function(r){r.defineOption("foldGutter",false,(function(t,n,o){if(o&&o!=r.Init){t.clearGutter(t.state.foldGutter.options.gutter);t.state.foldGutter=null;t.off("gutterClick",l);t.off("changes",c);t.off("viewportChange",v);t.off("fold",h);t.off("unfold",h);t.off("swapDoc",c);t.off("optionChange",s)}if(n){t.state.foldGutter=new e(i(n));a(t);t.on("gutterClick",l);t.on("changes",c);t.on("viewportChange",v);t.on("fold",h);t.on("unfold",h);t.on("swapDoc",c);t.on("optionChange",s)}}));var t=r.Pos;function e(r){this.options=r;this.from=this.to=0}function i(r){if(r===true)r={};if(r.gutter==null)r.gutter="CodeMirror-foldgutter";if(r.indicatorOpen==null)r.indicatorOpen="CodeMirror-foldgutter-open";if(r.indicatorFolded==null)r.indicatorFolded="CodeMirror-foldgutter-folded";return r}function n(r,e){var i=r.findMarks(t(e,0),t(e+1,0));for(var n=0;n<i.length;++n){if(i[n].__isFold){var o=i[n].find(-1);if(o&&o.line===e)return i[n]}}}function o(r){if(typeof r=="string"){var t=document.createElement("div");t.className=r+" CodeMirror-guttermarker-subtle";return t}else{return r.cloneNode(true)}}function f(r,e,i){var f=r.state.foldGutter.options,a=e-1;var l=r.foldOption(f,"minFoldSize");var s=r.foldOption(f,"rangeFinder");var c=typeof f.indicatorFolded=="string"&&u(f.indicatorFolded);var v=typeof f.indicatorOpen=="string"&&u(f.indicatorOpen);r.eachLine(e,i,(function(e){++a;var i=null;var u=e.gutterMarkers;if(u)u=u[f.gutter];if(n(r,a)){if(c&&u&&c.test(u.className))return;i=o(f.indicatorFolded)}else{var h=t(a,0);var d=s&&s(r,h);if(d&&d.to.line-d.from.line>=l){if(v&&u&&v.test(u.className))return;i=o(f.indicatorOpen)}}if(!i&&!u)return;r.setGutterMarker(e,f.gutter,i)}))}function u(r){return new RegExp("(^|\\s)"+r+"(?:$|\\s)\\s*")}function a(r){var t=r.getViewport(),e=r.state.foldGutter;if(!e)return;r.operation((function(){f(r,t.from,t.to)}));e.from=t.from;e.to=t.to}function l(r,e,i){var o=r.state.foldGutter;if(!o)return;var f=o.options;if(i!=f.gutter)return;var u=n(r,e);if(u)u.clear();else r.foldCode(t(e,0),f)}function s(r,t){if(t=="mode")c(r)}function c(r){var t=r.state.foldGutter;if(!t)return;var e=t.options;t.from=t.to=0;clearTimeout(t.changeUpdate);t.changeUpdate=setTimeout((function(){a(r)}),e.foldOnChangeTimeSpan||600)}function v(r){var t=r.state.foldGutter;if(!t)return;var e=t.options;clearTimeout(t.changeUpdate);t.changeUpdate=setTimeout((function(){var e=r.getViewport();if(t.from==t.to||e.from-t.to>20||t.from-e.to>20){a(r)}else{r.operation((function(){if(e.from<t.from){f(r,e.from,t.from);t.from=e.from}if(e.to>t.to){f(r,t.to,e.to);t.to=e.to}}))}}),e.updateViewportTimeSpan||400)}function h(r,t){var e=r.state.foldGutter;if(!e)return;var i=t.line;if(i>=e.from&&i<e.to)f(r,i,i+1)}}))}));n((function(r,t){(function(r){r(f)})((function(r){function t(t){return function(e,i){var n=i.line,o=e.getLine(n);function f(t){var f;for(var u=i.ch,a=0;;){var l=u<=0?-1:o.lastIndexOf(t[0],u-1);if(l==-1){if(a==1)break;a=1;u=o.length;continue}if(a==1&&l<i.ch)break;f=e.getTokenTypeAt(r.Pos(n,l+1));if(!/^(comment|string)/.test(f))return{ch:l+1,tokenType:f,pair:t};u=l-1}}function u(t){var i=1,o=e.lastLine(),f,u=t.ch,a;r:for(var l=n;l<=o;++l){var s=e.getLine(l),c=l==n?u:0;for(;;){var v=s.indexOf(t.pair[0],c),h=s.indexOf(t.pair[1],c);if(v<0)v=s.length;if(h<0)h=s.length;c=Math.min(v,h);if(c==s.length)break;if(e.getTokenTypeAt(r.Pos(l,c+1))==t.tokenType){if(c==v)++i;else if(!--i){f=l;a=c;break r}}++c}}if(f==null||n==f)return null;return{from:r.Pos(n,u),to:r.Pos(f,a)}}var a=[];for(var l=0;l<t.length;l++){var s=f(t[l]);if(s)a.push(s)}a.sort((function(r,t){return r.ch-t.ch}));for(var l=0;l<a.length;l++){var c=u(a[l]);if(c)return c}return null}}r.registerHelper("fold","brace",t([["{","}"],["[","]"]]));r.registerHelper("fold","brace-paren",t([["{","}"],["[","]"],["(",")"]]));r.registerHelper("fold","import",(function(t,e){function i(e){if(e<t.firstLine()||e>t.lastLine())return null;var i=t.getTokenAt(r.Pos(e,1));if(!/\S/.test(i.string))i=t.getTokenAt(r.Pos(e,i.end+1));if(i.type!="keyword"||i.string!="import")return null;for(var n=e,o=Math.min(t.lastLine(),e+10);n<=o;++n){var f=t.getLine(n),u=f.indexOf(";");if(u!=-1)return{startCh:i.end,end:r.Pos(n,u)}}}var n=e.line,o=i(n),f;if(!o||i(n-1)||(f=i(n-2))&&f.end.line==n-1)return null;for(var u=o.end;;){var a=i(u.line+1);if(a==null)break;u=a.end}return{from:t.clipPos(r.Pos(n,o.startCh+1)),to:u}}));r.registerHelper("fold","include",(function(t,e){function i(e){if(e<t.firstLine()||e>t.lastLine())return null;var i=t.getTokenAt(r.Pos(e,1));if(!/\S/.test(i.string))i=t.getTokenAt(r.Pos(e,i.end+1));if(i.type=="meta"&&i.string.slice(0,8)=="#include")return i.start+8}var n=e.line,o=i(n);if(o==null||i(n-1)!=null)return null;for(var f=n;;){var u=i(f+1);if(u==null)break;++f}return{from:r.Pos(n,o+1),to:t.clipPos(r.Pos(f))}}))}))}));var a=n((function(r){var t=function(){var r=true,t=false;var e={};var i=function(){var r;var t;var e={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"};var i;var n=function(t){throw{name:"SyntaxError",message:t,at:r,text:i}};var o=function(e){if(e&&e!==t){n("Expected '"+e+"' instead of '"+t+"'")}t=i.charAt(r);r+=1;return t};var f=function(){var r;var e="";if(t==="-"){e="-";o("-")}while(t>="0"&&t<="9"){e+=t;o()}if(t==="."){e+=".";while(o()&&t>="0"&&t<="9"){e+=t}}if(t==="e"||t==="E"){e+=t;o();if(t==="-"||t==="+"){e+=t;o()}while(t>="0"&&t<="9"){e+=t;o()}}r=+e;if(!isFinite(r)){n("Bad number")}else{return r}};var u=function(){var r;var i;var f="";var u;if(t==='"'){while(o()){if(t==='"'){o();return f}if(t==="\\"){o();if(t==="u"){u=0;for(i=0;i<4;i+=1){r=parseInt(o(),16);if(!isFinite(r)){break}u=u*16+r}f+=String.fromCharCode(u)}else if(typeof e[t]==="string"){f+=e[t]}else{break}}else{f+=t}}}n("Bad string")};var a=function(){while(t&&t<=" "){o()}};var l=function(){switch(t){case"t":o("t");o("r");o("u");o("e");return true;case"f":o("f");o("a");o("l");o("s");o("e");return false;case"n":o("n");o("u");o("l");o("l");return null}n("Unexpected '"+t+"'")};var s;var c=function(){var r=[];if(t==="["){o("[");a();if(t==="]"){o("]");return r}while(t){r.push(s());a();if(t==="]"){o("]");return r}o(",");a()}}n("Bad array")};var v=function(){var r;var e={};if(t==="{"){o("{");a();if(t==="}"){o("}");return e}while(t){r=u();a();o(":");if(Object.hasOwnProperty.call(e,r)){n("Duplicate key '"+r+"'")}e[r]=s();a();if(t==="}"){o("}");return e}o(",");a()}}n("Bad object")};s=function(){a();switch(t){case"{":return v();case"[":return c();case'"':return u();case"-":return f();default:return t>="0"&&t<="9"?f():l()}};return function(e,o){var f;i=e;r=0;t=" ";f=s();a();if(t){n("Syntax error")}return typeof o==="function"?function r(t,e){var i;var n;var f=t[e];if(f&&typeof f==="object"){for(i in f){if(Object.prototype.hasOwnProperty.call(f,i)){n=r(f,i);if(n!==undefined){f[i]=n}else{delete f[i]}}}}return o.call(t,e,f)}({"":f},""):f}}();var n=function(){var r={trace:function r(){},yy:{},symbols_:{error:2,JSONString:3,STRING:4,JSONNumber:5,NUMBER:6,JSONNullLiteral:7,NULL:8,JSONBooleanLiteral:9,TRUE:10,FALSE:11,JSONText:12,JSONValue:13,EOF:14,JSONObject:15,JSONArray:16,"{":17,"}":18,JSONMemberList:19,JSONMember:20,":":21,",":22,"[":23,"]":24,JSONElementList:25,$accept:0,$end:1},terminals_:{2:"error",4:"STRING",6:"NUMBER",8:"NULL",10:"TRUE",11:"FALSE",14:"EOF",17:"{",18:"}",21:":",22:",",23:"[",24:"]"},productions_:[0,[3,1],[5,1],[7,1],[9,1],[9,1],[12,2],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[15,2],[15,3],[20,3],[19,1],[19,3],[16,2],[16,3],[25,1],[25,3]],performAction:function r(t,e,i,n,o,f,u){var a=f.length-1;switch(o){case 1:this.$=t.replace(/\\(\\|")/g,"$"+"1").replace(/\\n/g,"\n").replace(/\\r/g,"\r").replace(/\\t/g,"\t").replace(/\\v/g,"\v").replace(/\\f/g,"\f").replace(/\\b/g,"\b");break;case 2:this.$=Number(t);break;case 3:this.$=null;break;case 4:this.$=true;break;case 5:this.$=false;break;case 6:return this.$=f[a-1];case 13:this.$={};break;case 14:this.$=f[a-1];break;case 15:this.$=[f[a-2],f[a]];break;case 16:this.$={};this.$[f[a][0]]=f[a][1];break;case 17:this.$=f[a-2];f[a-2][f[a][0]]=f[a][1];break;case 18:this.$=[];break;case 19:this.$=f[a-1];break;case 20:this.$=[f[a]];break;case 21:this.$=f[a-2];f[a-2].push(f[a]);break}},table:[{3:5,4:[1,12],5:6,6:[1,13],7:3,8:[1,9],9:4,10:[1,10],11:[1,11],12:1,13:2,15:7,16:8,17:[1,14],23:[1,15]},{1:[3]},{14:[1,16]},{14:[2,7],18:[2,7],22:[2,7],24:[2,7]},{14:[2,8],18:[2,8],22:[2,8],24:[2,8]},{14:[2,9],18:[2,9],22:[2,9],24:[2,9]},{14:[2,10],18:[2,10],22:[2,10],24:[2,10]},{14:[2,11],18:[2,11],22:[2,11],24:[2,11]},{14:[2,12],18:[2,12],22:[2,12],24:[2,12]},{14:[2,3],18:[2,3],22:[2,3],24:[2,3]},{14:[2,4],18:[2,4],22:[2,4],24:[2,4]},{14:[2,5],18:[2,5],22:[2,5],24:[2,5]},{14:[2,1],18:[2,1],21:[2,1],22:[2,1],24:[2,1]},{14:[2,2],18:[2,2],22:[2,2],24:[2,2]},{3:20,4:[1,12],18:[1,17],19:18,20:19},{3:5,4:[1,12],5:6,6:[1,13],7:3,8:[1,9],9:4,10:[1,10],11:[1,11],13:23,15:7,16:8,17:[1,14],23:[1,15],24:[1,21],25:22},{1:[2,6]},{14:[2,13],18:[2,13],22:[2,13],24:[2,13]},{18:[1,24],22:[1,25]},{18:[2,16],22:[2,16]},{21:[1,26]},{14:[2,18],18:[2,18],22:[2,18],24:[2,18]},{22:[1,28],24:[1,27]},{22:[2,20],24:[2,20]},{14:[2,14],18:[2,14],22:[2,14],24:[2,14]},{3:20,4:[1,12],20:29},{3:5,4:[1,12],5:6,6:[1,13],7:3,8:[1,9],9:4,10:[1,10],11:[1,11],13:30,15:7,16:8,17:[1,14],23:[1,15]},{14:[2,19],18:[2,19],22:[2,19],24:[2,19]},{3:5,4:[1,12],5:6,6:[1,13],7:3,8:[1,9],9:4,10:[1,10],11:[1,11],13:31,15:7,16:8,17:[1,14],23:[1,15]},{18:[2,17],22:[2,17]},{18:[2,15],22:[2,15]},{22:[2,21],24:[2,21]}],defaultActions:{16:[2,6]},parseError:function r(t,e){throw new Error(t)},parse:function r(t){var e=this,i=[0],n=[null],o=[],f=this.table,u="",a=0,l=0,s=0,c=2,v=1;this.lexer.setInput(t);this.lexer.yy=this.yy;this.yy.lexer=this.lexer;if(typeof this.lexer.yylloc=="undefined")this.lexer.yylloc={};var h=this.lexer.yylloc;o.push(h);if(typeof this.yy.parseError==="function")this.parseError=this.yy.parseError;function d(r){i.length=i.length-2*r;n.length=n.length-r;o.length=o.length-r}function m(){var r;r=e.lexer.lex()||1;if(typeof r!=="number"){r=e.symbols_[r]||r}return r}var p,g,b,w,k,C={},M,A,y,x;while(true){b=i[i.length-1];if(this.defaultActions[b]){w=this.defaultActions[b]}else{if(p==null)p=m();w=f[b]&&f[b][p]}if(typeof w==="undefined"||!w.length||!w[0]){if(!s){x=[];for(M in f[b])if(this.terminals_[M]&&M>2){x.push("'"+this.terminals_[M]+"'")}var L="";if(this.lexer.showPosition){L="Parse error on line "+(a+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+x.join(", ")+", got '"+this.terminals_[p]+"'"}else{L="Parse error on line "+(a+1)+": Unexpected "+(p==1?"end of input":"'"+(this.terminals_[p]||p)+"'")}this.parseError(L,{text:this.lexer.match,token:this.terminals_[p]||p,line:this.lexer.yylineno,loc:h,expected:x})}if(s==3){if(p==v){throw new Error(L||"Parsing halted.")}l=this.lexer.yyleng;u=this.lexer.yytext;a=this.lexer.yylineno;h=this.lexer.yylloc;p=m()}while(1){if(c.toString()in f[b]){break}if(b==0){throw new Error(L||"Parsing halted.")}d(1);b=i[i.length-1]}g=p;p=c;b=i[i.length-1];w=f[b]&&f[b][c];s=3}if(w[0]instanceof Array&&w.length>1){throw new Error("Parse Error: multiple actions possible at state: "+b+", token: "+p)}switch(w[0]){case 1:i.push(p);n.push(this.lexer.yytext);o.push(this.lexer.yylloc);i.push(w[1]);p=null;if(!g){l=this.lexer.yyleng;u=this.lexer.yytext;a=this.lexer.yylineno;h=this.lexer.yylloc;if(s>0)s--}else{p=g;g=null}break;case 2:A=this.productions_[w[1]][1];C.$=n[n.length-A];C._$={first_line:o[o.length-(A||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(A||1)].first_column,last_column:o[o.length-1].last_column};k=this.performAction.call(C,u,l,a,this.yy,w[1],n,o);if(typeof k!=="undefined"){return k}if(A){i=i.slice(0,-1*A*2);n=n.slice(0,-1*A);o=o.slice(0,-1*A)}i.push(this.productions_[w[1]][0]);n.push(C.$);o.push(C._$);y=f[i[i.length-2]][i[i.length-1]];i.push(y);break;case 3:return true}}return true}};var t=function(){var r={EOF:1,parseError:function r(t,e){if(this.yy.parseError){this.yy.parseError(t,e)}else{throw new Error(t)}},setInput:function(r){this._input=r;this._more=this._less=this.done=false;this.yylineno=this.yyleng=0;this.yytext=this.matched=this.match="";this.conditionStack=["INITIAL"];this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0};return this},input:function(){var r=this._input[0];this.yytext+=r;this.yyleng++;this.match+=r;this.matched+=r;var t=r.match(/\n/);if(t)this.yylineno++;this._input=this._input.slice(1);return r},unput:function(r){this._input=r+this._input;return this},more:function(){this._more=true;return this},less:function(r){this._input=this.match.slice(r)+this._input},pastInput:function(){var r=this.matched.substr(0,this.matched.length-this.match.length);return(r.length>20?"...":"")+r.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var r=this.match;if(r.length<20){r+=this._input.substr(0,20-r.length)}return(r.substr(0,20)+(r.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var r=this.pastInput();var t=new Array(r.length+1).join("-");return r+this.upcomingInput()+"\n"+t+"^"},next:function(){if(this.done){return this.EOF}if(!this._input)this.done=true;var r,t,e,i,n;if(!this._more){this.yytext="";this.match=""}var o=this._currentRules();for(var f=0;f<o.length;f++){e=this._input.match(this.rules[o[f]]);if(e&&(!t||e[0].length>t[0].length)){t=e;i=f;if(!this.options.flex)break}}if(t){n=t[0].match(/\n.*/g);if(n)this.yylineno+=n.length;this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:n?n[n.length-1].length-1:this.yylloc.last_column+t[0].length};this.yytext+=t[0];this.match+=t[0];this.yyleng=this.yytext.length;this._more=false;this._input=this._input.slice(t[0].length);this.matched+=t[0];r=this.performAction.call(this,this.yy,this,o[i],this.conditionStack[this.conditionStack.length-1]);if(this.done&&this._input)this.done=false;if(r)return r;else return}if(this._input===""){return this.EOF}else{this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}},lex:function r(){var t=this.next();if(typeof t!=="undefined"){return t}else{return this.lex()}},begin:function r(t){this.conditionStack.push(t)},popState:function r(){return this.conditionStack.pop()},_currentRules:function r(){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules},topState:function(){return this.conditionStack[this.conditionStack.length-2]},pushState:function r(t){this.begin(t)}};r.options={};r.performAction=function r(t,e,i,n){switch(i){case 0:break;case 1:return 6;case 2:e.yytext=e.yytext.substr(1,e.yyleng-2);return 4;case 3:return 17;case 4:return 18;case 5:return 23;case 6:return 24;case 7:return 22;case 8:return 21;case 9:return 10;case 10:return 11;case 11:return 8;case 12:return 14;case 13:return"INVALID"}};r.rules=[/^(?:\s+)/,/^(?:(-?([0-9]|[1-9][0-9]+))(\.[0-9]+)?([eE][-+]?[0-9]+)?\b)/,/^(?:"(?:\\[\\"bfnrt/]|\\u[a-fA-F0-9]{4}|[^\\\0-\x09\x0a-\x1f"])*")/,/^(?:\{)/,/^(?:\})/,/^(?:\[)/,/^(?:\])/,/^(?:,)/,/^(?::)/,/^(?:true\b)/,/^(?:false\b)/,/^(?:null\b)/,/^(?:$)/,/^(?:.)/];r.conditions={INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13],inclusive:true}};return r}();r.lexer=t;return r}();var o=n.parse;n.parse=function(t){var e=o.call(n,t);var f=typeof i==="undefined"?r("./doug-json-parse"):i;try{f(t)}catch(r){if(/Duplicate key|Bad string|Unexpected/.test(r.message)){var u=t.substring(0,r.at).split("\n");var a=u.length;var l=u[a-1].length-1;this.parseError(r.message,{line:a,col:l,message:r.message.replace(/./,(function(r){return r.toLowerCase()}))});throw SyntaxError(r.message+" on line "+a)}}return e};if(typeof e!=="undefined"){e.parser=n;e.parse=function(){return n.parse.apply(n,arguments)};e.main=function t(i){if(!i[1])throw new Error("Usage: "+i[0]+" FILE");if(typeof process!=="undefined"){var n=r("fs").readFileSync(r("path").join(process.cwd(),i[1]),"utf8")}else{var o=r("file").path(r("file").cwd());var n=o.join(i[1]).read({charset:"utf-8"})}return e.parser.parse(n)};if(r.main===t){e.main(typeof process!=="undefined"?process.argv.slice(1):r("system").args)}}return e}();if(r.exports)r.exports=t}));const l="@charset \"UTF-8\";.CodeMirror{font-family:monospace;height:300px;color:black;direction:ltr}.CodeMirror-lines{padding:4px 0;}.CodeMirror pre.CodeMirror-line,.CodeMirror pre.CodeMirror-line-like{padding:0 4px;}.CodeMirror-scrollbar-filler,.CodeMirror-gutter-filler{background-color:white;}.CodeMirror-gutters{border-right:1px solid #ddd;background-color:#f7f7f7;white-space:nowrap}.CodeMirror-linenumber{padding:0 3px 0 5px;min-width:20px;text-align:right;color:#999;white-space:nowrap}.CodeMirror-guttermarker{color:black}.CodeMirror-guttermarker-subtle{color:#999}.CodeMirror-cursor{border-left:1px solid black;border-right:none;width:0}.CodeMirror div.CodeMirror-secondarycursor{border-left:1px solid silver}.cm-fat-cursor .CodeMirror-cursor{width:auto;border:0 !important;background:#7e7}.cm-fat-cursor div.CodeMirror-cursors{z-index:1}.cm-fat-cursor .CodeMirror-line::selection,.cm-fat-cursor .CodeMirror-line>span::selection,.cm-fat-cursor .CodeMirror-line>span>span::selection{background:transparent}.cm-fat-cursor .CodeMirror-line::-moz-selection,.cm-fat-cursor .CodeMirror-line>span::-moz-selection,.cm-fat-cursor .CodeMirror-line>span>span::-moz-selection{background:transparent}.cm-fat-cursor{caret-color:transparent}@-moz-keyframes blink{0%{}50%{background-color:transparent}100%{}}@-webkit-keyframes blink{0%{}50%{background-color:transparent}100%{}}@keyframes blink{0%{}50%{background-color:transparent}100%{}}.cm-tab{display:inline-block;text-decoration:inherit}.CodeMirror-rulers{position:absolute;left:0;right:0;top:-50px;bottom:0;overflow:hidden}.CodeMirror-ruler{border-left:1px solid #ccc;top:0;bottom:0;position:absolute}.cm-s-default .cm-header{color:blue}.cm-s-default .cm-quote{color:#090}.cm-negative{color:#d44}.cm-positive{color:#292}.cm-header,.cm-strong{font-weight:bold}.cm-em{font-style:italic}.cm-link{text-decoration:underline}.cm-strikethrough{text-decoration:line-through}.cm-s-default .cm-keyword{color:#708}.cm-s-default .cm-atom{color:#219}.cm-s-default .cm-number{color:#164}.cm-s-default .cm-def{color:#00f}.cm-s-default .cm-variable-2{color:#05a}.cm-s-default .cm-variable-3,.cm-s-default .cm-type{color:#085}.cm-s-default .cm-comment{color:#a50}.cm-s-default .cm-string{color:#a11}.cm-s-default .cm-string-2{color:#f50}.cm-s-default .cm-meta{color:#555}.cm-s-default .cm-qualifier{color:#555}.cm-s-default .cm-builtin{color:#30a}.cm-s-default .cm-bracket{color:#997}.cm-s-default .cm-tag{color:#170}.cm-s-default .cm-attribute{color:#00c}.cm-s-default .cm-hr{color:#999}.cm-s-default .cm-link{color:#00c}.cm-s-default .cm-error{color:#f00}.cm-invalidchar{color:#f00}.CodeMirror-composing{border-bottom:2px solid}div.CodeMirror span.CodeMirror-matchingbracket{color:#0b0}div.CodeMirror span.CodeMirror-nonmatchingbracket{color:#a22}.CodeMirror-matchingtag{background:rgba(255, 150, 0, .3)}.CodeMirror-activeline-background{background:#e8f2ff}.CodeMirror{position:relative;overflow:hidden;background:white}.CodeMirror-scroll{overflow:scroll !important;margin-bottom:-50px;margin-right:-50px;padding-bottom:50px;height:100%;outline:none;position:relative;z-index:0}.CodeMirror-sizer{position:relative;border-right:50px solid transparent}.CodeMirror-vscrollbar,.CodeMirror-hscrollbar,.CodeMirror-scrollbar-filler,.CodeMirror-gutter-filler{position:absolute;z-index:6;display:none;outline:none}.CodeMirror-vscrollbar{right:0;top:0;overflow-x:hidden;overflow-y:scroll}.CodeMirror-hscrollbar{bottom:0;left:0;overflow-y:hidden;overflow-x:scroll}.CodeMirror-scrollbar-filler{right:0;bottom:0}.CodeMirror-gutter-filler{left:0;bottom:0}.CodeMirror-gutters{position:absolute;left:0;top:0;min-height:100%;z-index:3}.CodeMirror-gutter{white-space:normal;height:100%;display:inline-block;vertical-align:top;margin-bottom:-50px}.CodeMirror-gutter-wrapper{position:absolute;z-index:4;background:none !important;border:none !important}.CodeMirror-gutter-background{position:absolute;top:0;bottom:0;z-index:4}.CodeMirror-gutter-elt{position:absolute;cursor:default;z-index:4}.CodeMirror-gutter-wrapper ::selection{background-color:transparent}.CodeMirror-gutter-wrapper ::-moz-selection{background-color:transparent}.CodeMirror-lines{cursor:text;min-height:1px;}.CodeMirror pre.CodeMirror-line,.CodeMirror pre.CodeMirror-line-like{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0;border-width:0;background:transparent;font-family:inherit;font-size:inherit;margin:0;white-space:pre;word-wrap:normal;line-height:inherit;color:inherit;z-index:2;position:relative;overflow:visible;-webkit-tap-highlight-color:transparent;-webkit-font-variant-ligatures:contextual;font-variant-ligatures:contextual}.CodeMirror-wrap pre.CodeMirror-line,.CodeMirror-wrap pre.CodeMirror-line-like{word-wrap:break-word;white-space:pre-wrap;word-break:normal}.CodeMirror-linebackground{position:absolute;left:0;right:0;top:0;bottom:0;z-index:0}.CodeMirror-linewidget{position:relative;z-index:2;padding:0.1px;}.CodeMirror-rtl pre{direction:rtl}.CodeMirror-code{outline:none}.CodeMirror-scroll,.CodeMirror-sizer,.CodeMirror-gutter,.CodeMirror-gutters,.CodeMirror-linenumber{-moz-box-sizing:content-box;box-sizing:content-box}.CodeMirror-measure{position:absolute;width:100%;height:0;overflow:hidden;visibility:hidden}.CodeMirror-cursor{position:absolute;pointer-events:none}.CodeMirror-measure pre{position:static}div.CodeMirror-cursors{visibility:hidden;position:relative;z-index:3}div.CodeMirror-dragcursors{visibility:visible}.CodeMirror-focused div.CodeMirror-cursors{visibility:visible}.CodeMirror-selected{background:#d9d9d9}.CodeMirror-focused .CodeMirror-selected{background:#d7d4f0}.CodeMirror-crosshair{cursor:crosshair}.CodeMirror-line::selection,.CodeMirror-line>span::selection,.CodeMirror-line>span>span::selection{background:#d7d4f0}.CodeMirror-line::-moz-selection,.CodeMirror-line>span::-moz-selection,.CodeMirror-line>span>span::-moz-selection{background:#d7d4f0}.cm-searching{background-color:#ffa;background-color:rgba(255, 255, 0, .4)}.cm-force-border{padding-right:.1px}@media print{.CodeMirror div.CodeMirror-cursors{visibility:hidden}}.cm-tab-wrap-hack:after{content:''}span.CodeMirror-selectedtext{background:none}.CodeMirror-lint-markers{width:16px}.CodeMirror-lint-tooltip{background-color:#ffd;border:1px solid black;border-radius:4px 4px 4px 4px;color:black;font-family:monospace;font-size:10pt;overflow:hidden;padding:2px 5px;position:fixed;white-space:pre;white-space:pre-wrap;z-index:100;max-width:600px;opacity:0;transition:opacity .4s;-moz-transition:opacity .4s;-webkit-transition:opacity .4s;-o-transition:opacity .4s;-ms-transition:opacity .4s}.CodeMirror-lint-mark{background-position:left bottom;background-repeat:repeat-x}.CodeMirror-lint-mark-warning{background-image:url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJFhQXEbhTg7YAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAMklEQVQI12NkgIIvJ3QXMjAwdDN+OaEbysDA4MPAwNDNwMCwiOHLCd1zX07o6kBVGQEAKBANtobskNMAAAAASUVORK5CYII=\")}.CodeMirror-lint-mark-error{background-image:url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJDw4cOCW1/KIAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAHElEQVQI12NggIL/DAz/GdA5/xkY/qPKMDAwAADLZwf5rvm+LQAAAABJRU5ErkJggg==\")}.CodeMirror-lint-marker{background-position:center center;background-repeat:no-repeat;cursor:pointer;display:inline-block;height:16px;width:16px;vertical-align:middle;position:relative}.CodeMirror-lint-message{padding-left:18px;background-position:top left;background-repeat:no-repeat}.CodeMirror-lint-marker-warning,.CodeMirror-lint-message-warning{background-image:url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAANlBMVEX/uwDvrwD/uwD/uwD/uwD/uwD/uwD/uwD/uwD6twD/uwAAAADurwD2tQD7uAD+ugAAAAD/uwDhmeTRAAAADHRSTlMJ8mN1EYcbmiixgACm7WbuAAAAVklEQVR42n3PUQqAIBBFUU1LLc3u/jdbOJoW1P08DA9Gba8+YWJ6gNJoNYIBzAA2chBth5kLmG9YUoG0NHAUwFXwO9LuBQL1giCQb8gC9Oro2vp5rncCIY8L8uEx5ZkAAAAASUVORK5CYII=\")}.CodeMirror-lint-marker-error,.CodeMirror-lint-message-error{background-image:url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAHlBMVEW7AAC7AACxAAC7AAC7AAAAAAC4AAC5AAD///+7AAAUdclpAAAABnRSTlMXnORSiwCK0ZKSAAAATUlEQVR42mWPOQ7AQAgDuQLx/z8csYRmPRIFIwRGnosRrpamvkKi0FTIiMASR3hhKW+hAN6/tIWhu9PDWiTGNEkTtIOucA5Oyr9ckPgAWm0GPBog6v4AAAAASUVORK5CYII=\")}.CodeMirror-lint-marker-multiple{background-image:url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAAHCAMAAADzjKfhAAAACVBMVEUAAAAAAAC/v7914kyHAAAAAXRSTlMAQObYZgAAACNJREFUeNo1ioEJAAAIwmz/H90iFFSGJgFMe3gaLZ0od+9/AQZ0ADosbYraAAAAAElFTkSuQmCC\");background-repeat:no-repeat;background-position:right bottom;width:100%;height:100%}.CodeMirror-lint-line-error{background-color:rgba(183, 76, 81, 0.08)}.CodeMirror-lint-line-warning{background-color:rgba(255, 211, 0, 0.1)}.CodeMirror-foldmarker{color:blue;text-shadow:#b9f 1px 1px 2px, #b9f -1px -1px 2px, #b9f 1px -1px 2px, #b9f -1px 1px 2px;font-family:arial;line-height:.3;cursor:pointer}.CodeMirror-foldgutter{width:.7em}.CodeMirror-foldgutter-open,.CodeMirror-foldgutter-folded{cursor:pointer}.CodeMirror-foldgutter-open:after{content:\"\\25BE\"}.CodeMirror-foldgutter-folded:after{content:\"\\25B8\"}:host{display:flex;font-size:var(--code-editor-font-size, 0.8125rem);--code-editor-neutral-text-color:var(--contrast-1100);--code-editor-background-color:var(--contrast-200);--code-editor-gutter-background-color:var(--contrast-300);--code-editor-line-number-text-color:var(--contrast-700);--code-editor-cursor-color:var(--color-amber-dark);--code-editor-selection-highlight-color:var(--color-cyan-default);--code-editor-selection-lowlight-color:var(--contrast-600)}:host .cm-attribute,:host .cm-property,:host .cm-keyword{color:rgb(var(--color-violet-light))}:host .cm-operator{color:rgb(var(--color-sky-dark))}:host .cm-variable{color:rgb(var(--color-pink-light))}:host .cm-variable-2{color:rgb(var(--contrast-1100))}:host .cm-variable-3,:host .cm-type{color:rgb(var(--color-amber-darker))}:host .cm-builtin,:host .cm-meta{color:rgb(var(--color-amber-default))}:host .cm-atom{color:rgb(var(--color-coral-default))}:host .cm-tag,:host .cm-number{color:rgb(var(--color-magenta-default))}:host .cm-def{color:rgb(var(--color-sky-default))}:host .cm-string{color:rgb(var(--color-green-dark))}:host .cm-string-2{color:rgb(var(--color-pink-default))}:host .cm-qualifier{color:rgb(var(--color-grass-default))}:host .cm-error{color:rgb(var(--color-white));background-color:rgb(var(--color-red-default))}:host .cm-comment{color:rgba(var(--code-editor-neutral-text-color), 0.7)}@media (prefers-color-scheme: dark){:root:not([data-theme=force-light]) :host{--code-editor-neutral-text-color:var(--contrast-1600);--code-editor-line-number-text-color:var(--contrast-800);--code-editor-cursor-color:var(--color-amber-default);--code-editor-selection-highlight-color:var(--color-cyan-light);--code-editor-selection-lowlight-color:var(--contrast-100)}:root:not([data-theme=force-light]) :host .cm-attribute,:root:not([data-theme=force-light]) :host .cm-property,:root:not([data-theme=force-light]) :host .cm-keyword{color:rgb(var(--color-purple-lighter))}:root:not([data-theme=force-light]) :host .cm-operator{color:rgb(var(--color-sky-lighter))}:root:not([data-theme=force-light]) :host .cm-variable-3,:root:not([data-theme=force-light]) :host .cm-type{color:rgb(var(--color-yellow-light))}:root:not([data-theme=force-light]) :host .cm-atom{color:rgb(var(--color-coral-light))}:root:not([data-theme=force-light]) :host .cm-tag,:root:not([data-theme=force-light]) :host .cm-number{color:rgb(var(--color-magenta-light))}:root:not([data-theme=force-light]) :host .cm-def{color:rgb(var(--color-sky-light))}:root:not([data-theme=force-light]) :host .cm-string{color:rgb(var(--color-lime-light))}:root:not([data-theme=force-light]) :host .cm-string-2{color:rgb(var(--color-pink-lighter))}:root:not([data-theme=force-light]) :host .cm-qualifier{color:rgb(var(--color-grass-light))}:root:not([data-theme=force-light]) :host .cm-comment{color:rgba(var(--code-editor-neutral-text-color), 0.4)}}:root[data-theme=force-dark] :host{--code-editor-neutral-text-color:var(--contrast-1600);--code-editor-line-number-text-color:var(--contrast-800);--code-editor-cursor-color:var(--color-amber-default);--code-editor-selection-highlight-color:var(--color-cyan-light);--code-editor-selection-lowlight-color:var(--contrast-100)}:root[data-theme=force-dark] :host .cm-attribute,:root[data-theme=force-dark] :host .cm-property,:root[data-theme=force-dark] :host .cm-keyword{color:rgb(var(--color-purple-lighter))}:root[data-theme=force-dark] :host .cm-operator{color:rgb(var(--color-sky-lighter))}:root[data-theme=force-dark] :host .cm-variable-3,:root[data-theme=force-dark] :host .cm-type{color:rgb(var(--color-yellow-light))}:root[data-theme=force-dark] :host .cm-atom{color:rgb(var(--color-coral-light))}:root[data-theme=force-dark] :host .cm-tag,:root[data-theme=force-dark] :host .cm-number{color:rgb(var(--color-magenta-light))}:root[data-theme=force-dark] :host .cm-def{color:rgb(var(--color-sky-light))}:root[data-theme=force-dark] :host .cm-string{color:rgb(var(--color-lime-light))}:root[data-theme=force-dark] :host .cm-string-2{color:rgb(var(--color-pink-lighter))}:root[data-theme=force-dark] :host .cm-qualifier{color:rgb(var(--color-grass-light))}:root[data-theme=force-dark] :host .cm-comment{color:rgba(var(--code-editor-neutral-text-color), 0.4)}.editor{display:flex;align-items:stretch;width:100%}.editor.readonly .CodeMirror-focused .CodeMirror-cursors{visibility:visible !important}.cm-s-lime.CodeMirror{font-family:ui-monospace, \"Cascadia Code\", \"Source Code Pro\", Menlo, Consolas, \"DejaVu Sans Mono\", monospace;color:rgb(var(--code-editor-neutral-text-color));background-color:rgb(var(--code-editor-background-color));border-radius:0.25rem;height:auto;width:100%}.cm-s-lime .CodeMirror-scroll{max-height:var(--code-editor-max-height, 10rem)}.cm-s-lime.CodeMirror-focused div.CodeMirror-selected{background:rgba(var(--code-editor-selection-highlight-color), 0.15)}.cm-s-lime div.CodeMirror-selected{background:rgba(var(--code-editor-selection-highlight-color), 0.05)}.cm-s-lime .CodeMirror-gutters{background-color:rgb(var(--code-editor-gutter-background-color));color:rgb(var(--code-editor-line-number-text-color));border:none}.cm-s-lime .CodeMirror-guttermarker,.cm-s-lime .CodeMirror-guttermarker-subtle,.cm-s-lime .CodeMirror-linenumber{color:rgb(var(--code-editor-line-number-text-color))}.cm-s-lime .CodeMirror-cursor{border-left:1px solid rgb(var(--code-editor-cursor-color))}.editor.readonly .cm-s-lime .CodeMirror-cursor{border-color:rgba(var(--code-editor-neutral-text-color), 0.5);border-width:0.125rem}.cm-s-lime .CodeMirror-activeline-background{background:rgba(var(--code-editor-selection-lowlight-color), 0.5)}.cm-s-lime .CodeMirror-matchingbracket{font-weight:bold;color:rgb(var(--code-editor-neutral-text-color)) !important;background:rgba(var(--code-editor-selection-highlight-color), 0.15);position:relative}.cm-s-lime .CodeMirror-matchingbracket:before{content:\"_\";color:rgb(var(--code-editor-selection-highlight-color), 0.8);position:absolute;bottom:-0.4rem;left:0;right:0}.cm-s-lime .CodeMirror-lint-marker-error,.cm-s-lime .CodeMirror-lint-message-error{background-image:url(\"data:image/svg+xml; utf8, <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'><defs/><path fill='rgb(255,255,255)' d='M7.219 5.781L5.78 7.22 14.563 16 5.78 24.781 7.22 26.22 16 17.437l8.781 8.782 1.438-1.438L17.437 16l8.782-8.781L24.78 5.78 16 14.563z'/></svg>\");background-color:rgb(var(--color-red-default));background-size:0.75rem;border-radius:50%}.cm-s-lime .CodeMirror-foldmarker{position:relative;transition:color var(--limel-clickable-transition-speed, 0.4s) ease, background-color var(--limel-clickable-transition-speed, 0.4s) ease, box-shadow var(--limel-clickable-transform-speed, 0.4s) ease, transform var(--limel-clickable-transform-speed, 0.4s) var(--limel-clickable-transform-timing-function, ease);cursor:pointer;color:transparent;background-color:var(--lime-elevated-surface-background-color);box-shadow:var(--button-shadow-normal);text-shadow:none;padding:0 0.5rem;border-radius:1rem;background-image:url(\"data:image/svg+xml; utf8, <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' xml:space='preserve'><circle fill='rgba(186,186,192,0.7)' cx='16' cy='16' r='2'/><circle fill='rgba(186,186,192,0.7)' cx='26' cy='16' r='2'/><circle fill='rgba(186,186,192,0.7)' cx='6' cy='16' r='2'/></svg>\");background-size:contain;background-repeat:no-repeat;background-position:center}.cm-s-lime .CodeMirror-foldmarker:hover,.cm-s-lime .CodeMirror-foldmarker:focus,.cm-s-lime .CodeMirror-foldmarker:focus-visible{will-change:color, background-color, box-shadow, transform}.cm-s-lime .CodeMirror-foldmarker:hover{transform:translate3d(0, -0.04rem, 0);color:var(--mdc-theme-on-surface);background-color:var(--lime-elevated-surface-background-color);box-shadow:var(--button-shadow-hovered)}.cm-s-lime .CodeMirror-foldmarker:active{--limel-clickable-transform-timing-function:cubic-bezier(\n 0.83,\n -0.15,\n 0.49,\n 1.16\n );transform:translate3d(0, 0.05rem, 0);box-shadow:var(--button-shadow-pressed)}.cm-s-lime .CodeMirror-foldmarker:hover,.cm-s-lime .CodeMirror-foldmarker:active{--limel-clickable-transition-speed:0.2s;--limel-clickable-transform-speed:0.16s}.cm-s-lime [class^=CodeMirror-foldgutter]{color:var(--code-editor-neutral-text-color);transition:opacity 0.2s ease;opacity:0.4}.cm-s-lime [class^=CodeMirror-foldgutter]:hover{opacity:1}.cm-s-lime .CodeMirror-foldgutter-folded{opacity:0.7}";const s=class{constructor(e){r(this,e);this.change=t(this,"change",7);this.handleChangeDarkMode=()=>{if(this.colorScheme!=="auto"){return}this.forceRedraw()};this.handleChange=()=>{this.change.emit(this.editor.getValue())};this.handleResize=()=>{if(!this.editor){return}this.editor.refresh()};this.value="";this.language=undefined;this.readonly=false;this.lineNumbers=false;this.fold=false;this.lint=false;this.colorScheme="auto";this.random=undefined}connectedCallback(){this.observer=new ResizeObserver(this.handleResize);this.observer.observe(this.host);this.darkMode.addEventListener("change",this.handleChangeDarkMode)}disconnectedCallback(){var r;this.observer.unobserve(this.host);(r=this.editor)===null||r===void 0?void 0:r.off("change",this.handleChange);this.editor=null;this.darkMode.removeEventListener("change",this.handleChangeDarkMode);const t=this.host.shadowRoot.querySelector(".editor");t===null||t===void 0?void 0:t.childNodes.forEach((r=>{r.remove()}))}componentDidRender(){if(this.editor){return}this.editor=this.createEditor()}watchValue(r){if(!this.editor){return}const t=this.editor.getValue();if(r===t){return}this.editor.getDoc().setValue(r||"")}createEditor(){const r=this.getOptions();const t=f(this.host.shadowRoot.querySelector(".editor"),r);t.on("change",this.handleChange);t.setOption("extraKeys",{Tab:r=>{const t=Array(r.getOption("indentUnit")+1).join(" ");r.replaceSelection(t)}});return t}getOptions(){let r=this.language;const t=4;let e="lime light";const i=[];if(this.isDarkMode()){e="lime dark"}if(this.language==="json"){r={name:"application/json",json:true};if(this.lint){i.push("CodeMirror-lint-markers");if(!("jsonlint"in window)){window["jsonlint"]=a}}}else if(this.language==="typescript"){r={name:"application/typescript",typescript:true}}if(this.fold){i.push("CodeMirror-foldgutter")}return{mode:r,value:this.value||"",theme:e,readOnly:this.readonly,tabSize:t,indentUnit:t,lineNumbers:this.lineNumbers,styleActiveLine:true,matchBrackets:true,lint:this.lint,foldGutter:this.fold,gutters:i}}isDarkMode(){if(this.colorScheme!=="auto"){return this.colorScheme==="dark"}return this.darkMode.matches}render(){const r={editor:true,readonly:this.readonly,"is-dark-mode":this.isDarkMode(),"is-light-mode":!this.isDarkMode()};return e("div",{class:r})}forceRedraw(){this.random=Math.random()}get darkMode(){return matchMedia("(prefers-color-scheme: dark)")}get host(){return i(this)}static get watchers(){return{value:["watchValue"]}}};s.style=l;export{s as limel_code_editor};
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r,c as t,h as e,g as i}from"./p-288f0842.js";import{c as n,a as o}from"./p-eab67c09.js";var f=n((function(r,t){(function(t,e){r.exports=e()})(o,(function(){var r=navigator.userAgent;var t=navigator.platform;var e=/gecko\/\d/i.test(r);var i=/MSIE \d/.test(r);var n=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(r);var o=/Edge\/(\d+)/.exec(r);var f=i||n||o;var u=f&&(i?document.documentMode||6:+(o||n)[1]);var a=!o&&/WebKit\//.test(r);var l=a&&/Qt\/\d+\.\d+/.test(r);var s=!o&&/Chrome\/(\d+)/.exec(r);var c=s&&+s[1];var v=/Opera\//.test(r);var h=/Apple Computer/.test(navigator.vendor);var d=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(r);var m=/PhantomJS/.test(r);var p=h&&(/Mobile\/\w+/.test(r)||navigator.maxTouchPoints>2);var g=/Android/.test(r);var b=p||g||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(r);var w=p||/Mac/.test(t);var k=/\bCrOS\b/.test(r);var C=/win/i.test(t);var M=v&&r.match(/Version\/(\d*\.\d*)/);if(M){M=Number(M[1])}if(M&&M>=15){v=false;a=true}var A=w&&(l||v&&(M==null||M<12.11));var y=e||f&&u>=9;function x(r){return new RegExp("(^|\\s)"+r+"(?:$|\\s)\\s*")}var L=function(r,t){var e=r.className;var i=x(t).exec(e);if(i){var n=e.slice(i.index+i[0].length);r.className=e.slice(0,i.index)+(n?i[1]+n:"")}};function S(r){for(var t=r.childNodes.length;t>0;--t){r.removeChild(r.firstChild)}return r}function N(r,t){return S(r).appendChild(t)}function E(r,t,e,i){var n=document.createElement(r);if(e){n.className=e}if(i){n.style.cssText=i}if(typeof t=="string"){n.appendChild(document.createTextNode(t))}else if(t){for(var o=0;o<t.length;++o){n.appendChild(t[o])}}return n}function D(r,t,e,i){var n=E(r,t,e,i);n.setAttribute("role","presentation");return n}var T;if(document.createRange){T=function(r,t,e,i){var n=document.createRange();n.setEnd(i||r,e);n.setStart(r,t);return n}}else{T=function(r,t,e){var i=document.body.createTextRange();try{i.moveToElementText(r.parentNode)}catch(r){return i}i.collapse(true);i.moveEnd("character",e);i.moveStart("character",t);return i}}function I(r,t){if(t.nodeType==3){t=t.parentNode}if(r.contains){return r.contains(t)}do{if(t.nodeType==11){t=t.host}if(t==r){return true}}while(t=t.parentNode)}function R(r){var t;try{t=r.activeElement}catch(e){t=r.body||null}while(t&&t.shadowRoot&&t.shadowRoot.activeElement){t=t.shadowRoot.activeElement}return t}function O(r,t){var e=r.className;if(!x(t).test(e)){r.className+=(e?" ":"")+t}}function B(r,t){var e=r.split(" ");for(var i=0;i<e.length;i++){if(e[i]&&!x(e[i]).test(t)){t+=" "+e[i]}}return t}var U=function(r){r.select()};if(p){U=function(r){r.selectionStart=0;r.selectionEnd=r.value.length}}else if(f){U=function(r){try{r.select()}catch(r){}}}function z(r){return r.display.wrapper.ownerDocument}function j(r){return z(r).defaultView}function W(r){var t=Array.prototype.slice.call(arguments,1);return function(){return r.apply(null,t)}}function F(r,t,e){if(!t){t={}}for(var i in r){if(r.hasOwnProperty(i)&&(e!==false||!t.hasOwnProperty(i))){t[i]=r[i]}}return t}function P(r,t,e,i,n){if(t==null){t=r.search(/[^\s\u00a0]/);if(t==-1){t=r.length}}for(var o=i||0,f=n||0;;){var u=r.indexOf("\t",o);if(u<0||u>=t){return f+(t-o)}f+=u-o;f+=e-f%e;o=u+1}}var G=function(){this.id=null;this.f=null;this.time=0;this.handler=W(this.onTimeout,this)};G.prototype.onTimeout=function(r){r.id=0;if(r.time<=+new Date){r.f()}else{setTimeout(r.handler,r.time-+new Date)}};G.prototype.set=function(r,t){this.f=t;var e=+new Date+r;if(!this.id||e<this.time){clearTimeout(this.id);this.id=setTimeout(this.handler,r);this.time=e}};function _(r,t){for(var e=0;e<r.length;++e){if(r[e]==t){return e}}return-1}var H=50;var V={toString:function(){return"CodeMirror.Pass"}};var $={scroll:false},Q={origin:"*mouse"},J={origin:"+move"};function K(r,t,e){for(var i=0,n=0;;){var o=r.indexOf("\t",i);if(o==-1){o=r.length}var f=o-i;if(o==r.length||n+f>=t){return i+Math.min(f,t-n)}n+=o-i;n+=e-n%e;i=o+1;if(n>=t){return i}}}var q=[""];function Y(r){while(q.length<=r){q.push(X(q)+" ")}return q[r]}function X(r){return r[r.length-1]}function Z(r,t){var e=[];for(var i=0;i<r.length;i++){e[i]=t(r[i],i)}return e}function rr(r,t,e){var i=0,n=e(t);while(i<r.length&&e(r[i])<=n){i++}r.splice(i,0,t)}function tr(){}function er(r,t){var e;if(Object.create){e=Object.create(r)}else{tr.prototype=r;e=new tr}if(t){F(t,e)}return e}var ir=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function nr(r){return/\w/.test(r)||r>""&&(r.toUpperCase()!=r.toLowerCase()||ir.test(r))}function or(r,t){if(!t){return nr(r)}if(t.source.indexOf("\\w")>-1&&nr(r)){return true}return t.test(r)}function fr(r){for(var t in r){if(r.hasOwnProperty(t)&&r[t]){return false}}return true}var ur=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function ar(r){return r.charCodeAt(0)>=768&&ur.test(r)}function lr(r,t,e){while((e<0?t>0:t<r.length)&&ar(r.charAt(t))){t+=e}return t}function sr(r,t,e){var i=t>e?-1:1;for(;;){if(t==e){return t}var n=(t+e)/2,o=i<0?Math.ceil(n):Math.floor(n);if(o==t){return r(o)?t:e}if(r(o)){e=o}else{t=o+i}}}function cr(r,t,e,i){if(!r){return i(t,e,"ltr",0)}var n=false;for(var o=0;o<r.length;++o){var f=r[o];if(f.from<e&&f.to>t||t==e&&f.to==t){i(Math.max(f.from,t),Math.min(f.to,e),f.level==1?"rtl":"ltr",o);n=true}}if(!n){i(t,e,"ltr")}}var vr=null;function hr(r,t,e){var i;vr=null;for(var n=0;n<r.length;++n){var o=r[n];if(o.from<t&&o.to>t){return n}if(o.to==t){if(o.from!=o.to&&e=="before"){i=n}else{vr=n}}if(o.from==t){if(o.from!=o.to&&e!="before"){i=n}else{vr=n}}}return i!=null?i:vr}var dr=function(){var r="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN";var t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function e(e){if(e<=247){return r.charAt(e)}else if(1424<=e&&e<=1524){return"R"}else if(1536<=e&&e<=1785){return t.charAt(e-1536)}else if(1774<=e&&e<=2220){return"r"}else if(8192<=e&&e<=8203){return"w"}else if(e==8204){return"b"}else{return"L"}}var i=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;var n=/[stwN]/,o=/[LRr]/,f=/[Lb1n]/,u=/[1n]/;function a(r,t,e){this.level=r;this.from=t;this.to=e}return function(r,t){var l=t=="ltr"?"L":"R";if(r.length==0||t=="ltr"&&!i.test(r)){return false}var s=r.length,c=[];for(var v=0;v<s;++v){c.push(e(r.charCodeAt(v)))}for(var h=0,d=l;h<s;++h){var m=c[h];if(m=="m"){c[h]=d}else{d=m}}for(var p=0,g=l;p<s;++p){var b=c[p];if(b=="1"&&g=="r"){c[p]="n"}else if(o.test(b)){g=b;if(b=="r"){c[p]="R"}}}for(var w=1,k=c[0];w<s-1;++w){var C=c[w];if(C=="+"&&k=="1"&&c[w+1]=="1"){c[w]="1"}else if(C==","&&k==c[w+1]&&(k=="1"||k=="n")){c[w]=k}k=C}for(var M=0;M<s;++M){var A=c[M];if(A==","){c[M]="N"}else if(A=="%"){var y=void 0;for(y=M+1;y<s&&c[y]=="%";++y){}var x=M&&c[M-1]=="!"||y<s&&c[y]=="1"?"1":"N";for(var L=M;L<y;++L){c[L]=x}M=y-1}}for(var S=0,N=l;S<s;++S){var E=c[S];if(N=="L"&&E=="1"){c[S]="L"}else if(o.test(E)){N=E}}for(var D=0;D<s;++D){if(n.test(c[D])){var T=void 0;for(T=D+1;T<s&&n.test(c[T]);++T){}var I=(D?c[D-1]:l)=="L";var R=(T<s?c[T]:l)=="L";var O=I==R?I?"L":"R":l;for(var B=D;B<T;++B){c[B]=O}D=T-1}}var U=[],z;for(var j=0;j<s;){if(f.test(c[j])){var W=j;for(++j;j<s&&f.test(c[j]);++j){}U.push(new a(0,W,j))}else{var F=j,P=U.length,G=t=="rtl"?1:0;for(++j;j<s&&c[j]!="L";++j){}for(var _=F;_<j;){if(u.test(c[_])){if(F<_){U.splice(P,0,new a(1,F,_));P+=G}var H=_;for(++_;_<j&&u.test(c[_]);++_){}U.splice(P,0,new a(2,H,_));P+=G;F=_}else{++_}}if(F<j){U.splice(P,0,new a(1,F,j))}}}if(t=="ltr"){if(U[0].level==1&&(z=r.match(/^\s+/))){U[0].from=z[0].length;U.unshift(new a(0,0,z[0].length))}if(X(U).level==1&&(z=r.match(/\s+$/))){X(U).to-=z[0].length;U.push(new a(0,s-z[0].length,s))}}return t=="rtl"?U.reverse():U}}();function mr(r,t){var e=r.order;if(e==null){e=r.order=dr(r.text,t)}return e}var pr=[];var gr=function(r,t,e){if(r.addEventListener){r.addEventListener(t,e,false)}else if(r.attachEvent){r.attachEvent("on"+t,e)}else{var i=r._handlers||(r._handlers={});i[t]=(i[t]||pr).concat(e)}};function br(r,t){return r._handlers&&r._handlers[t]||pr}function wr(r,t,e){if(r.removeEventListener){r.removeEventListener(t,e,false)}else if(r.detachEvent){r.detachEvent("on"+t,e)}else{var i=r._handlers,n=i&&i[t];if(n){var o=_(n,e);if(o>-1){i[t]=n.slice(0,o).concat(n.slice(o+1))}}}}function kr(r,t){var e=br(r,t);if(!e.length){return}var i=Array.prototype.slice.call(arguments,2);for(var n=0;n<e.length;++n){e[n].apply(null,i)}}function Cr(r,t,e){if(typeof t=="string"){t={type:t,preventDefault:function(){this.defaultPrevented=true}}}kr(r,e||t.type,r,t);return Sr(t)||t.codemirrorIgnore}function Mr(r){var t=r._handlers&&r._handlers.cursorActivity;if(!t){return}var e=r.curOp.cursorActivityHandlers||(r.curOp.cursorActivityHandlers=[]);for(var i=0;i<t.length;++i){if(_(e,t[i])==-1){e.push(t[i])}}}function Ar(r,t){return br(r,t).length>0}function yr(r){r.prototype.on=function(r,t){gr(this,r,t)};r.prototype.off=function(r,t){wr(this,r,t)}}function xr(r){if(r.preventDefault){r.preventDefault()}else{r.returnValue=false}}function Lr(r){if(r.stopPropagation){r.stopPropagation()}else{r.cancelBubble=true}}function Sr(r){return r.defaultPrevented!=null?r.defaultPrevented:r.returnValue==false}function Nr(r){xr(r);Lr(r)}function Er(r){return r.target||r.srcElement}function Dr(r){var t=r.which;if(t==null){if(r.button&1){t=1}else if(r.button&2){t=3}else if(r.button&4){t=2}}if(w&&r.ctrlKey&&t==1){t=3}return t}var Tr=function(){if(f&&u<9){return false}var r=E("div");return"draggable"in r||"dragDrop"in r}();var Ir;function Rr(r){if(Ir==null){var t=E("span","");N(r,E("span",[t,document.createTextNode("x")]));if(r.firstChild.offsetHeight!=0){Ir=t.offsetWidth<=1&&t.offsetHeight>2&&!(f&&u<8)}}var e=Ir?E("span",""):E("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");e.setAttribute("cm-text","");return e}var Or;function Br(r){if(Or!=null){return Or}var t=N(r,document.createTextNode("AخA"));var e=T(t,0,1).getBoundingClientRect();var i=T(t,1,2).getBoundingClientRect();S(r);if(!e||e.left==e.right){return false}return Or=i.right-e.right<3}var Ur="\n\nb".split(/\n/).length!=3?function(r){var t=0,e=[],i=r.length;while(t<=i){var n=r.indexOf("\n",t);if(n==-1){n=r.length}var o=r.slice(t,r.charAt(n-1)=="\r"?n-1:n);var f=o.indexOf("\r");if(f!=-1){e.push(o.slice(0,f));t+=f+1}else{e.push(o);t=n+1}}return e}:function(r){return r.split(/\r\n?|\n/)};var zr=window.getSelection?function(r){try{return r.selectionStart!=r.selectionEnd}catch(r){return false}}:function(r){var t;try{t=r.ownerDocument.selection.createRange()}catch(r){}if(!t||t.parentElement()!=r){return false}return t.compareEndPoints("StartToEnd",t)!=0};var jr=function(){var r=E("div");if("oncopy"in r){return true}r.setAttribute("oncopy","return;");return typeof r.oncopy=="function"}();var Wr=null;function Fr(r){if(Wr!=null){return Wr}var t=N(r,E("span","x"));var e=t.getBoundingClientRect();var i=T(t,0,1).getBoundingClientRect();return Wr=Math.abs(e.left-i.left)>1}var Pr={},Gr={};function _r(r,t){if(arguments.length>2){t.dependencies=Array.prototype.slice.call(arguments,2)}Pr[r]=t}function Hr(r,t){Gr[r]=t}function Vr(r){if(typeof r=="string"&&Gr.hasOwnProperty(r)){r=Gr[r]}else if(r&&typeof r.name=="string"&&Gr.hasOwnProperty(r.name)){var t=Gr[r.name];if(typeof t=="string"){t={name:t}}r=er(t,r);r.name=t.name}else if(typeof r=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(r)){return Vr("application/xml")}else if(typeof r=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(r)){return Vr("application/json")}if(typeof r=="string"){return{name:r}}else{return r||{name:"null"}}}function $r(r,t){t=Vr(t);var e=Pr[t.name];if(!e){return $r(r,"text/plain")}var i=e(r,t);if(Qr.hasOwnProperty(t.name)){var n=Qr[t.name];for(var o in n){if(!n.hasOwnProperty(o)){continue}if(i.hasOwnProperty(o)){i["_"+o]=i[o]}i[o]=n[o]}}i.name=t.name;if(t.helperType){i.helperType=t.helperType}if(t.modeProps){for(var f in t.modeProps){i[f]=t.modeProps[f]}}return i}var Qr={};function Jr(r,t){var e=Qr.hasOwnProperty(r)?Qr[r]:Qr[r]={};F(t,e)}function Kr(r,t){if(t===true){return t}if(r.copyState){return r.copyState(t)}var e={};for(var i in t){var n=t[i];if(n instanceof Array){n=n.concat([])}e[i]=n}return e}function qr(r,t){var e;while(r.innerMode){e=r.innerMode(t);if(!e||e.mode==r){break}t=e.state;r=e.mode}return e||{mode:r,state:t}}function Yr(r,t,e){return r.startState?r.startState(t,e):true}var Xr=function(r,t,e){this.pos=this.start=0;this.string=r;this.tabSize=t||8;this.lastColumnPos=this.lastColumnValue=0;this.lineStart=0;this.lineOracle=e};Xr.prototype.eol=function(){return this.pos>=this.string.length};Xr.prototype.sol=function(){return this.pos==this.lineStart};Xr.prototype.peek=function(){return this.string.charAt(this.pos)||undefined};Xr.prototype.next=function(){if(this.pos<this.string.length){return this.string.charAt(this.pos++)}};Xr.prototype.eat=function(r){var t=this.string.charAt(this.pos);var e;if(typeof r=="string"){e=t==r}else{e=t&&(r.test?r.test(t):r(t))}if(e){++this.pos;return t}};Xr.prototype.eatWhile=function(r){var t=this.pos;while(this.eat(r)){}return this.pos>t};Xr.prototype.eatSpace=function(){var r=this.pos;while(/[\s\u00a0]/.test(this.string.charAt(this.pos))){++this.pos}return this.pos>r};Xr.prototype.skipToEnd=function(){this.pos=this.string.length};Xr.prototype.skipTo=function(r){var t=this.string.indexOf(r,this.pos);if(t>-1){this.pos=t;return true}};Xr.prototype.backUp=function(r){this.pos-=r};Xr.prototype.column=function(){if(this.lastColumnPos<this.start){this.lastColumnValue=P(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue);this.lastColumnPos=this.start}return this.lastColumnValue-(this.lineStart?P(this.string,this.lineStart,this.tabSize):0)};Xr.prototype.indentation=function(){return P(this.string,null,this.tabSize)-(this.lineStart?P(this.string,this.lineStart,this.tabSize):0)};Xr.prototype.match=function(r,t,e){if(typeof r=="string"){var i=function(r){return e?r.toLowerCase():r};var n=this.string.substr(this.pos,r.length);if(i(n)==i(r)){if(t!==false){this.pos+=r.length}return true}}else{var o=this.string.slice(this.pos).match(r);if(o&&o.index>0){return null}if(o&&t!==false){this.pos+=o[0].length}return o}};Xr.prototype.current=function(){return this.string.slice(this.start,this.pos)};Xr.prototype.hideFirstChars=function(r,t){this.lineStart+=r;try{return t()}finally{this.lineStart-=r}};Xr.prototype.lookAhead=function(r){var t=this.lineOracle;return t&&t.lookAhead(r)};Xr.prototype.baseToken=function(){var r=this.lineOracle;return r&&r.baseToken(this.pos)};function Zr(r,t){t-=r.first;if(t<0||t>=r.size){throw new Error("There is no line "+(t+r.first)+" in the document.")}var e=r;while(!e.lines){for(var i=0;;++i){var n=e.children[i],o=n.chunkSize();if(t<o){e=n;break}t-=o}}return e.lines[t]}function rt(r,t,e){var i=[],n=t.line;r.iter(t.line,e.line+1,(function(r){var o=r.text;if(n==e.line){o=o.slice(0,e.ch)}if(n==t.line){o=o.slice(t.ch)}i.push(o);++n}));return i}function tt(r,t,e){var i=[];r.iter(t,e,(function(r){i.push(r.text)}));return i}function et(r,t){var e=t-r.height;if(e){for(var i=r;i;i=i.parent){i.height+=e}}}function it(r){if(r.parent==null){return null}var t=r.parent,e=_(t.lines,r);for(var i=t.parent;i;t=i,i=i.parent){for(var n=0;;++n){if(i.children[n]==t){break}e+=i.children[n].chunkSize()}}return e+t.first}function nt(r,t){var e=r.first;r:do{for(var i=0;i<r.children.length;++i){var n=r.children[i],o=n.height;if(t<o){r=n;continue r}t-=o;e+=n.chunkSize()}return e}while(!r.lines);var f=0;for(;f<r.lines.length;++f){var u=r.lines[f],a=u.height;if(t<a){break}t-=a}return e+f}function ot(r,t){return t>=r.first&&t<r.first+r.size}function ft(r,t){return String(r.lineNumberFormatter(t+r.firstLineNumber))}function ut(r,t,e){if(e===void 0)e=null;if(!(this instanceof ut)){return new ut(r,t,e)}this.line=r;this.ch=t;this.sticky=e}function at(r,t){return r.line-t.line||r.ch-t.ch}function lt(r,t){return r.sticky==t.sticky&&at(r,t)==0}function st(r){return ut(r.line,r.ch)}function ct(r,t){return at(r,t)<0?t:r}function vt(r,t){return at(r,t)<0?r:t}function ht(r,t){return Math.max(r.first,Math.min(t,r.first+r.size-1))}function dt(r,t){if(t.line<r.first){return ut(r.first,0)}var e=r.first+r.size-1;if(t.line>e){return ut(e,Zr(r,e).text.length)}return mt(t,Zr(r,t.line).text.length)}function mt(r,t){var e=r.ch;if(e==null||e>t){return ut(r.line,t)}else if(e<0){return ut(r.line,0)}else{return r}}function pt(r,t){var e=[];for(var i=0;i<t.length;i++){e[i]=dt(r,t[i])}return e}var gt=function(r,t){this.state=r;this.lookAhead=t};var bt=function(r,t,e,i){this.state=t;this.doc=r;this.line=e;this.maxLookAhead=i||0;this.baseTokens=null;this.baseTokenPos=1};bt.prototype.lookAhead=function(r){var t=this.doc.getLine(this.line+r);if(t!=null&&r>this.maxLookAhead){this.maxLookAhead=r}return t};bt.prototype.baseToken=function(r){if(!this.baseTokens){return null}while(this.baseTokens[this.baseTokenPos]<=r){this.baseTokenPos+=2}var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-r}};bt.prototype.nextLine=function(){this.line++;if(this.maxLookAhead>0){this.maxLookAhead--}};bt.fromSaved=function(r,t,e){if(t instanceof gt){return new bt(r,Kr(r.mode,t.state),e,t.lookAhead)}else{return new bt(r,Kr(r.mode,t),e)}};bt.prototype.save=function(r){var t=r!==false?Kr(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new gt(t,this.maxLookAhead):t};function wt(r,t,e,i){var n=[r.state.modeGen],o={};Nt(r,t.text,r.doc.mode,e,(function(r,t){return n.push(r,t)}),o,i);var f=e.state;var u=function(i){e.baseTokens=n;var u=r.state.overlays[i],a=1,l=0;e.state=true;Nt(r,t.text,u.mode,e,(function(r,t){var e=a;while(l<r){var i=n[a];if(i>r){n.splice(a,1,r,n[a+1],i)}a+=2;l=Math.min(r,i)}if(!t){return}if(u.opaque){n.splice(e,a-e,r,"overlay "+t);a=e+2}else{for(;e<a;e+=2){var o=n[e+1];n[e+1]=(o?o+" ":"")+"overlay "+t}}}),o);e.state=f;e.baseTokens=null;e.baseTokenPos=1};for(var a=0;a<r.state.overlays.length;++a)u(a);return{styles:n,classes:o.bgClass||o.textClass?o:null}}function kt(r,t,e){if(!t.styles||t.styles[0]!=r.state.modeGen){var i=Ct(r,it(t));var n=t.text.length>r.options.maxHighlightLength&&Kr(r.doc.mode,i.state);var o=wt(r,t,i);if(n){i.state=n}t.stateAfter=i.save(!n);t.styles=o.styles;if(o.classes){t.styleClasses=o.classes}else if(t.styleClasses){t.styleClasses=null}if(e===r.doc.highlightFrontier){r.doc.modeFrontier=Math.max(r.doc.modeFrontier,++r.doc.highlightFrontier)}}return t.styles}function Ct(r,t,e){var i=r.doc,n=r.display;if(!i.mode.startState){return new bt(i,true,t)}var o=Et(r,t,e);var f=o>i.first&&Zr(i,o-1).stateAfter;var u=f?bt.fromSaved(i,f,o):new bt(i,Yr(i.mode),o);i.iter(o,t,(function(e){Mt(r,e.text,u);var i=u.line;e.stateAfter=i==t-1||i%5==0||i>=n.viewFrom&&i<n.viewTo?u.save():null;u.nextLine()}));if(e){i.modeFrontier=u.line}return u}function Mt(r,t,e,i){var n=r.doc.mode;var o=new Xr(t,r.options.tabSize,e);o.start=o.pos=i||0;if(t==""){At(n,e.state)}while(!o.eol()){yt(n,o,e.state);o.start=o.pos}}function At(r,t){if(r.blankLine){return r.blankLine(t)}if(!r.innerMode){return}var e=qr(r,t);if(e.mode.blankLine){return e.mode.blankLine(e.state)}}function yt(r,t,e,i){for(var n=0;n<10;n++){if(i){i[0]=qr(r,e).mode}var o=r.token(t,e);if(t.pos>t.start){return o}}throw new Error("Mode "+r.name+" failed to advance stream.")}var xt=function(r,t,e){this.start=r.start;this.end=r.pos;this.string=r.current();this.type=t||null;this.state=e};function Lt(r,t,e,i){var n=r.doc,o=n.mode,f;t=dt(n,t);var u=Zr(n,t.line),a=Ct(r,t.line,e);var l=new Xr(u.text,r.options.tabSize,a),s;if(i){s=[]}while((i||l.pos<t.ch)&&!l.eol()){l.start=l.pos;f=yt(o,l,a.state);if(i){s.push(new xt(l,f,Kr(n.mode,a.state)))}}return i?s:new xt(l,f,a.state)}function St(r,t){if(r){for(;;){var e=r.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!e){break}r=r.slice(0,e.index)+r.slice(e.index+e[0].length);var i=e[1]?"bgClass":"textClass";if(t[i]==null){t[i]=e[2]}else if(!new RegExp("(?:^|\\s)"+e[2]+"(?:$|\\s)").test(t[i])){t[i]+=" "+e[2]}}}return r}function Nt(r,t,e,i,n,o,f){var u=e.flattenSpans;if(u==null){u=r.options.flattenSpans}var a=0,l=null;var s=new Xr(t,r.options.tabSize,i),c;var v=r.options.addModeClass&&[null];if(t==""){St(At(e,i.state),o)}while(!s.eol()){if(s.pos>r.options.maxHighlightLength){u=false;if(f){Mt(r,t,i,s.pos)}s.pos=t.length;c=null}else{c=St(yt(e,s,i.state,v),o)}if(v){var h=v[0].name;if(h){c="m-"+(c?h+" "+c:h)}}if(!u||l!=c){while(a<s.start){a=Math.min(s.start,a+5e3);n(a,l)}l=c}s.start=s.pos}while(a<s.pos){var d=Math.min(s.pos,a+5e3);n(d,l);a=d}}function Et(r,t,e){var i,n,o=r.doc;var f=e?-1:t-(r.doc.mode.innerMode?1e3:100);for(var u=t;u>f;--u){if(u<=o.first){return o.first}var a=Zr(o,u-1),l=a.stateAfter;if(l&&(!e||u+(l instanceof gt?l.lookAhead:0)<=o.modeFrontier)){return u}var s=P(a.text,null,r.options.tabSize);if(n==null||i>s){n=u-1;i=s}}return n}function Dt(r,t){r.modeFrontier=Math.min(r.modeFrontier,t);if(r.highlightFrontier<t-10){return}var e=r.first;for(var i=t-1;i>e;i--){var n=Zr(r,i).stateAfter;if(n&&(!(n instanceof gt)||i+n.lookAhead<t)){e=i+1;break}}r.highlightFrontier=Math.min(r.highlightFrontier,e)}var Tt=false,It=false;function Rt(){Tt=true}function Ot(){It=true}function Bt(r,t,e){this.marker=r;this.from=t;this.to=e}function Ut(r,t){if(r){for(var e=0;e<r.length;++e){var i=r[e];if(i.marker==t){return i}}}}function zt(r,t){var e;for(var i=0;i<r.length;++i){if(r[i]!=t){(e||(e=[])).push(r[i])}}return e}function jt(r,t,e){var i=e&&window.WeakSet&&(e.markedSpans||(e.markedSpans=new WeakSet));if(i&&r.markedSpans&&i.has(r.markedSpans)){r.markedSpans.push(t)}else{r.markedSpans=r.markedSpans?r.markedSpans.concat([t]):[t];if(i){i.add(r.markedSpans)}}t.marker.attachLine(r)}function Wt(r,t,e){var i;if(r){for(var n=0;n<r.length;++n){var o=r[n],f=o.marker;var u=o.from==null||(f.inclusiveLeft?o.from<=t:o.from<t);if(u||o.from==t&&f.type=="bookmark"&&(!e||!o.marker.insertLeft)){var a=o.to==null||(f.inclusiveRight?o.to>=t:o.to>t);(i||(i=[])).push(new Bt(f,o.from,a?null:o.to))}}}return i}function Ft(r,t,e){var i;if(r){for(var n=0;n<r.length;++n){var o=r[n],f=o.marker;var u=o.to==null||(f.inclusiveRight?o.to>=t:o.to>t);if(u||o.from==t&&f.type=="bookmark"&&(!e||o.marker.insertLeft)){var a=o.from==null||(f.inclusiveLeft?o.from<=t:o.from<t);(i||(i=[])).push(new Bt(f,a?null:o.from-t,o.to==null?null:o.to-t))}}}return i}function Pt(r,t){if(t.full){return null}var e=ot(r,t.from.line)&&Zr(r,t.from.line).markedSpans;var i=ot(r,t.to.line)&&Zr(r,t.to.line).markedSpans;if(!e&&!i){return null}var n=t.from.ch,o=t.to.ch,f=at(t.from,t.to)==0;var u=Wt(e,n,f);var a=Ft(i,o,f);var l=t.text.length==1,s=X(t.text).length+(l?n:0);if(u){for(var c=0;c<u.length;++c){var v=u[c];if(v.to==null){var h=Ut(a,v.marker);if(!h){v.to=n}else if(l){v.to=h.to==null?null:h.to+s}}}}if(a){for(var d=0;d<a.length;++d){var m=a[d];if(m.to!=null){m.to+=s}if(m.from==null){var p=Ut(u,m.marker);if(!p){m.from=s;if(l){(u||(u=[])).push(m)}}}else{m.from+=s;if(l){(u||(u=[])).push(m)}}}}if(u){u=Gt(u)}if(a&&a!=u){a=Gt(a)}var g=[u];if(!l){var b=t.text.length-2,w;if(b>0&&u){for(var k=0;k<u.length;++k){if(u[k].to==null){(w||(w=[])).push(new Bt(u[k].marker,null,null))}}}for(var C=0;C<b;++C){g.push(w)}g.push(a)}return g}function Gt(r){for(var t=0;t<r.length;++t){var e=r[t];if(e.from!=null&&e.from==e.to&&e.marker.clearWhenEmpty!==false){r.splice(t--,1)}}if(!r.length){return null}return r}function _t(r,t,e){var i=null;r.iter(t.line,e.line+1,(function(r){if(r.markedSpans){for(var t=0;t<r.markedSpans.length;++t){var e=r.markedSpans[t].marker;if(e.readOnly&&(!i||_(i,e)==-1)){(i||(i=[])).push(e)}}}}));if(!i){return null}var n=[{from:t,to:e}];for(var o=0;o<i.length;++o){var f=i[o],u=f.find(0);for(var a=0;a<n.length;++a){var l=n[a];if(at(l.to,u.from)<0||at(l.from,u.to)>0){continue}var s=[a,1],c=at(l.from,u.from),v=at(l.to,u.to);if(c<0||!f.inclusiveLeft&&!c){s.push({from:l.from,to:u.from})}if(v>0||!f.inclusiveRight&&!v){s.push({from:u.to,to:l.to})}n.splice.apply(n,s);a+=s.length-3}}return n}function Ht(r){var t=r.markedSpans;if(!t){return}for(var e=0;e<t.length;++e){t[e].marker.detachLine(r)}r.markedSpans=null}function Vt(r,t){if(!t){return}for(var e=0;e<t.length;++e){t[e].marker.attachLine(r)}r.markedSpans=t}function $t(r){return r.inclusiveLeft?-1:0}function Qt(r){return r.inclusiveRight?1:0}function Jt(r,t){var e=r.lines.length-t.lines.length;if(e!=0){return e}var i=r.find(),n=t.find();var o=at(i.from,n.from)||$t(r)-$t(t);if(o){return-o}var f=at(i.to,n.to)||Qt(r)-Qt(t);if(f){return f}return t.id-r.id}function Kt(r,t){var e=It&&r.markedSpans,i;if(e){for(var n=void 0,o=0;o<e.length;++o){n=e[o];if(n.marker.collapsed&&(t?n.from:n.to)==null&&(!i||Jt(i,n.marker)<0)){i=n.marker}}}return i}function qt(r){return Kt(r,true)}function Yt(r){return Kt(r,false)}function Xt(r,t){var e=It&&r.markedSpans,i;if(e){for(var n=0;n<e.length;++n){var o=e[n];if(o.marker.collapsed&&(o.from==null||o.from<t)&&(o.to==null||o.to>t)&&(!i||Jt(i,o.marker)<0)){i=o.marker}}}return i}function Zt(r,t,e,i,n){var o=Zr(r,t);var f=It&&o.markedSpans;if(f){for(var u=0;u<f.length;++u){var a=f[u];if(!a.marker.collapsed){continue}var l=a.marker.find(0);var s=at(l.from,e)||$t(a.marker)-$t(n);var c=at(l.to,i)||Qt(a.marker)-Qt(n);if(s>=0&&c<=0||s<=0&&c>=0){continue}if(s<=0&&(a.marker.inclusiveRight&&n.inclusiveLeft?at(l.to,e)>=0:at(l.to,e)>0)||s>=0&&(a.marker.inclusiveRight&&n.inclusiveLeft?at(l.from,i)<=0:at(l.from,i)<0)){return true}}}}function re(r){var t;while(t=qt(r)){r=t.find(-1,true).line}return r}function te(r){var t;while(t=Yt(r)){r=t.find(1,true).line}return r}function ee(r){var t,e;while(t=Yt(r)){r=t.find(1,true).line;(e||(e=[])).push(r)}return e}function ie(r,t){var e=Zr(r,t),i=re(e);if(e==i){return t}return it(i)}function ne(r,t){if(t>r.lastLine()){return t}var e=Zr(r,t),i;if(!oe(r,e)){return t}while(i=Yt(e)){e=i.find(1,true).line}return it(e)+1}function oe(r,t){var e=It&&t.markedSpans;if(e){for(var i=void 0,n=0;n<e.length;++n){i=e[n];if(!i.marker.collapsed){continue}if(i.from==null){return true}if(i.marker.widgetNode){continue}if(i.from==0&&i.marker.inclusiveLeft&&fe(r,t,i)){return true}}}}function fe(r,t,e){if(e.to==null){var i=e.marker.find(1,true);return fe(r,i.line,Ut(i.line.markedSpans,e.marker))}if(e.marker.inclusiveRight&&e.to==t.text.length){return true}for(var n=void 0,o=0;o<t.markedSpans.length;++o){n=t.markedSpans[o];if(n.marker.collapsed&&!n.marker.widgetNode&&n.from==e.to&&(n.to==null||n.to!=e.from)&&(n.marker.inclusiveLeft||e.marker.inclusiveRight)&&fe(r,t,n)){return true}}}function ue(r){r=re(r);var t=0,e=r.parent;for(var i=0;i<e.lines.length;++i){var n=e.lines[i];if(n==r){break}else{t+=n.height}}for(var o=e.parent;o;e=o,o=e.parent){for(var f=0;f<o.children.length;++f){var u=o.children[f];if(u==e){break}else{t+=u.height}}}return t}function ae(r){if(r.height==0){return 0}var t=r.text.length,e,i=r;while(e=qt(i)){var n=e.find(0,true);i=n.from.line;t+=n.from.ch-n.to.ch}i=r;while(e=Yt(i)){var o=e.find(0,true);t-=i.text.length-o.from.ch;i=o.to.line;t+=i.text.length-o.to.ch}return t}function le(r){var t=r.display,e=r.doc;t.maxLine=Zr(e,e.first);t.maxLineLength=ae(t.maxLine);t.maxLineChanged=true;e.iter((function(r){var e=ae(r);if(e>t.maxLineLength){t.maxLineLength=e;t.maxLine=r}}))}var se=function(r,t,e){this.text=r;Vt(this,t);this.height=e?e(this):1};se.prototype.lineNo=function(){return it(this)};yr(se);function ce(r,t,e,i){r.text=t;if(r.stateAfter){r.stateAfter=null}if(r.styles){r.styles=null}if(r.order!=null){r.order=null}Ht(r);Vt(r,e);var n=i?i(r):1;if(n!=r.height){et(r,n)}}function ve(r){r.parent=null;Ht(r)}var he={},de={};function me(r,t){if(!r||/^\s*$/.test(r)){return null}var e=t.addModeClass?de:he;return e[r]||(e[r]=r.replace(/\S+/g,"cm-$&"))}function pe(r,t){var e=D("span",null,null,a?"padding-right: .1px":null);var i={pre:D("pre",[e],"CodeMirror-line"),content:e,col:0,pos:0,cm:r,trailingSpace:false,splitSpaces:r.getOption("lineWrapping")};t.measure={};for(var n=0;n<=(t.rest?t.rest.length:0);n++){var o=n?t.rest[n-1]:t.line,f=void 0;i.pos=0;i.addToken=be;if(Br(r.display.measure)&&(f=mr(o,r.doc.direction))){i.addToken=ke(i.addToken,f)}i.map=[];var u=t!=r.display.externalMeasured&&it(o);Me(o,i,kt(r,o,u));if(o.styleClasses){if(o.styleClasses.bgClass){i.bgClass=B(o.styleClasses.bgClass,i.bgClass||"")}if(o.styleClasses.textClass){i.textClass=B(o.styleClasses.textClass,i.textClass||"")}}if(i.map.length==0){i.map.push(0,0,i.content.appendChild(Rr(r.display.measure)))}if(n==0){t.measure.map=i.map;t.measure.cache={}}else{(t.measure.maps||(t.measure.maps=[])).push(i.map);(t.measure.caches||(t.measure.caches=[])).push({})}}if(a){var l=i.content.lastChild;if(/\bcm-tab\b/.test(l.className)||l.querySelector&&l.querySelector(".cm-tab")){i.content.className="cm-tab-wrap-hack"}}kr(r,"renderLine",r,t.line,i.pre);if(i.pre.className){i.textClass=B(i.pre.className,i.textClass||"")}return i}function ge(r){var t=E("span","•","cm-invalidchar");t.title="\\u"+r.charCodeAt(0).toString(16);t.setAttribute("aria-label",t.title);return t}function be(r,t,e,i,n,o,a){if(!t){return}var l=r.splitSpaces?we(t,r.trailingSpace):t;var s=r.cm.state.specialChars,c=false;var v;if(!s.test(t)){r.col+=t.length;v=document.createTextNode(l);r.map.push(r.pos,r.pos+t.length,v);if(f&&u<9){c=true}r.pos+=t.length}else{v=document.createDocumentFragment();var h=0;while(true){s.lastIndex=h;var d=s.exec(t);var m=d?d.index-h:t.length-h;if(m){var p=document.createTextNode(l.slice(h,h+m));if(f&&u<9){v.appendChild(E("span",[p]))}else{v.appendChild(p)}r.map.push(r.pos,r.pos+m,p);r.col+=m;r.pos+=m}if(!d){break}h+=m+1;var g=void 0;if(d[0]=="\t"){var b=r.cm.options.tabSize,w=b-r.col%b;g=v.appendChild(E("span",Y(w),"cm-tab"));g.setAttribute("role","presentation");g.setAttribute("cm-text","\t");r.col+=w}else if(d[0]=="\r"||d[0]=="\n"){g=v.appendChild(E("span",d[0]=="\r"?"␍":"","cm-invalidchar"));g.setAttribute("cm-text",d[0]);r.col+=1}else{g=r.cm.options.specialCharPlaceholder(d[0]);g.setAttribute("cm-text",d[0]);if(f&&u<9){v.appendChild(E("span",[g]))}else{v.appendChild(g)}r.col+=1}r.map.push(r.pos,r.pos+1,g);r.pos++}}r.trailingSpace=l.charCodeAt(t.length-1)==32;if(e||i||n||c||o||a){var k=e||"";if(i){k+=i}if(n){k+=n}var C=E("span",[v],k,o);if(a){for(var M in a){if(a.hasOwnProperty(M)&&M!="style"&&M!="class"){C.setAttribute(M,a[M])}}}return r.content.appendChild(C)}r.content.appendChild(v)}function we(r,t){if(r.length>1&&!/ /.test(r)){return r}var e=t,i="";for(var n=0;n<r.length;n++){var o=r.charAt(n);if(o==" "&&e&&(n==r.length-1||r.charCodeAt(n+1)==32)){o=" "}i+=o;e=o==" "}return i}function ke(r,t){return function(e,i,n,o,f,u,a){n=n?n+" cm-force-border":"cm-force-border";var l=e.pos,s=l+i.length;for(;;){var c=void 0;for(var v=0;v<t.length;v++){c=t[v];if(c.to>l&&c.from<=l){break}}if(c.to>=s){return r(e,i,n,o,f,u,a)}r(e,i.slice(0,c.to-l),n,o,null,u,a);o=null;i=i.slice(c.to-l);l=c.to}}}function Ce(r,t,e,i){var n=!i&&e.widgetNode;if(n){r.map.push(r.pos,r.pos+t,n)}if(!i&&r.cm.display.input.needsContentAttribute){if(!n){n=r.content.appendChild(document.createElement("span"))}n.setAttribute("cm-marker",e.id)}if(n){r.cm.display.input.setUneditable(n);r.content.appendChild(n)}r.pos+=t;r.trailingSpace=false}function Me(r,t,e){var i=r.markedSpans,n=r.text,o=0;if(!i){for(var f=1;f<e.length;f+=2){t.addToken(t,n.slice(o,o=e[f]),me(e[f+1],t.cm.options))}return}var u=n.length,a=0,l=1,s="",c,v;var h=0,d,m,p,g,b;for(;;){if(h==a){d=m=p=v="";b=null;g=null;h=Infinity;var w=[],k=void 0;for(var C=0;C<i.length;++C){var M=i[C],A=M.marker;if(A.type=="bookmark"&&M.from==a&&A.widgetNode){w.push(A)}else if(M.from<=a&&(M.to==null||M.to>a||A.collapsed&&M.to==a&&M.from==a)){if(M.to!=null&&M.to!=a&&h>M.to){h=M.to;m=""}if(A.className){d+=" "+A.className}if(A.css){v=(v?v+";":"")+A.css}if(A.startStyle&&M.from==a){p+=" "+A.startStyle}if(A.endStyle&&M.to==h){(k||(k=[])).push(A.endStyle,M.to)}if(A.title){(b||(b={})).title=A.title}if(A.attributes){for(var y in A.attributes){(b||(b={}))[y]=A.attributes[y]}}if(A.collapsed&&(!g||Jt(g.marker,A)<0)){g=M}}else if(M.from>a&&h>M.from){h=M.from}}if(k){for(var x=0;x<k.length;x+=2){if(k[x+1]==h){m+=" "+k[x]}}}if(!g||g.from==a){for(var L=0;L<w.length;++L){Ce(t,0,w[L])}}if(g&&(g.from||0)==a){Ce(t,(g.to==null?u+1:g.to)-a,g.marker,g.from==null);if(g.to==null){return}if(g.to==a){g=false}}}if(a>=u){break}var S=Math.min(u,h);while(true){if(s){var N=a+s.length;if(!g){var E=N>S?s.slice(0,S-a):s;t.addToken(t,E,c?c+d:d,p,a+E.length==h?m:"",v,b)}if(N>=S){s=s.slice(S-a);a=S;break}a=N;p=""}s=n.slice(o,o=e[l++]);c=me(e[l++],t.cm.options)}}}function Ae(r,t,e){this.line=t;this.rest=ee(t);this.size=this.rest?it(X(this.rest))-e+1:1;this.node=this.text=null;this.hidden=oe(r,t)}function ye(r,t,e){var i=[],n;for(var o=t;o<e;o=n){var f=new Ae(r.doc,Zr(r.doc,o),o);n=o+f.size;i.push(f)}return i}var xe=null;function Le(r){if(xe){xe.ops.push(r)}else{r.ownsGroup=xe={ops:[r],delayedCallbacks:[]}}}function Se(r){var t=r.delayedCallbacks,e=0;do{for(;e<t.length;e++){t[e].call(null)}for(var i=0;i<r.ops.length;i++){var n=r.ops[i];if(n.cursorActivityHandlers){while(n.cursorActivityCalled<n.cursorActivityHandlers.length){n.cursorActivityHandlers[n.cursorActivityCalled++].call(null,n.cm)}}}}while(e<t.length)}function Ne(r,t){var e=r.ownsGroup;if(!e){return}try{Se(e)}finally{xe=null;t(e)}}var Ee=null;function De(r,t){var e=br(r,t);if(!e.length){return}var i=Array.prototype.slice.call(arguments,2),n;if(xe){n=xe.delayedCallbacks}else if(Ee){n=Ee}else{n=Ee=[];setTimeout(Te,0)}var o=function(r){n.push((function(){return e[r].apply(null,i)}))};for(var f=0;f<e.length;++f)o(f)}function Te(){var r=Ee;Ee=null;for(var t=0;t<r.length;++t){r[t]()}}function Ie(r,t,e,i){for(var n=0;n<t.changes.length;n++){var o=t.changes[n];if(o=="text"){Ue(r,t)}else if(o=="gutter"){je(r,t,e,i)}else if(o=="class"){ze(r,t)}else if(o=="widget"){We(r,t,i)}}t.changes=null}function Re(r){if(r.node==r.text){r.node=E("div",null,null,"position: relative");if(r.text.parentNode){r.text.parentNode.replaceChild(r.node,r.text)}r.node.appendChild(r.text);if(f&&u<8){r.node.style.zIndex=2}}return r.node}function Oe(r,t){var e=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(e){e+=" CodeMirror-linebackground"}if(t.background){if(e){t.background.className=e}else{t.background.parentNode.removeChild(t.background);t.background=null}}else if(e){var i=Re(t);t.background=i.insertBefore(E("div",null,e),i.firstChild);r.display.input.setUneditable(t.background)}}function Be(r,t){var e=r.display.externalMeasured;if(e&&e.line==t.line){r.display.externalMeasured=null;t.measure=e.measure;return e.built}return pe(r,t)}function Ue(r,t){var e=t.text.className;var i=Be(r,t);if(t.text==t.node){t.node=i.pre}t.text.parentNode.replaceChild(i.pre,t.text);t.text=i.pre;if(i.bgClass!=t.bgClass||i.textClass!=t.textClass){t.bgClass=i.bgClass;t.textClass=i.textClass;ze(r,t)}else if(e){t.text.className=e}}function ze(r,t){Oe(r,t);if(t.line.wrapClass){Re(t).className=t.line.wrapClass}else if(t.node!=t.text){t.node.className=""}var e=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=e||""}function je(r,t,e,i){if(t.gutter){t.node.removeChild(t.gutter);t.gutter=null}if(t.gutterBackground){t.node.removeChild(t.gutterBackground);t.gutterBackground=null}if(t.line.gutterClass){var n=Re(t);t.gutterBackground=E("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(r.options.fixedGutter?i.fixedPos:-i.gutterTotalWidth)+"px; width: "+i.gutterTotalWidth+"px");r.display.input.setUneditable(t.gutterBackground);n.insertBefore(t.gutterBackground,t.text)}var o=t.line.gutterMarkers;if(r.options.lineNumbers||o){var f=Re(t);var u=t.gutter=E("div",null,"CodeMirror-gutter-wrapper","left: "+(r.options.fixedGutter?i.fixedPos:-i.gutterTotalWidth)+"px");u.setAttribute("aria-hidden","true");r.display.input.setUneditable(u);f.insertBefore(u,t.text);if(t.line.gutterClass){u.className+=" "+t.line.gutterClass}if(r.options.lineNumbers&&(!o||!o["CodeMirror-linenumbers"])){t.lineNumber=u.appendChild(E("div",ft(r.options,e),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+i.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+r.display.lineNumInnerWidth+"px"))}if(o){for(var a=0;a<r.display.gutterSpecs.length;++a){var l=r.display.gutterSpecs[a].className,s=o.hasOwnProperty(l)&&o[l];if(s){u.appendChild(E("div",[s],"CodeMirror-gutter-elt","left: "+i.gutterLeft[l]+"px; width: "+i.gutterWidth[l]+"px"))}}}}}function We(r,t,e){if(t.alignable){t.alignable=null}var i=x("CodeMirror-linewidget");for(var n=t.node.firstChild,o=void 0;n;n=o){o=n.nextSibling;if(i.test(n.className)){t.node.removeChild(n)}}Pe(r,t,e)}function Fe(r,t,e,i){var n=Be(r,t);t.text=t.node=n.pre;if(n.bgClass){t.bgClass=n.bgClass}if(n.textClass){t.textClass=n.textClass}ze(r,t);je(r,t,e,i);Pe(r,t,i);return t.node}function Pe(r,t,e){Ge(r,t.line,t,e,true);if(t.rest){for(var i=0;i<t.rest.length;i++){Ge(r,t.rest[i],t,e,false)}}}function Ge(r,t,e,i,n){if(!t.widgets){return}var o=Re(e);for(var f=0,u=t.widgets;f<u.length;++f){var a=u[f],l=E("div",[a.node],"CodeMirror-linewidget"+(a.className?" "+a.className:""));if(!a.handleMouseEvents){l.setAttribute("cm-ignore-events","true")}_e(a,l,e,i);r.display.input.setUneditable(l);if(n&&a.above){o.insertBefore(l,e.gutter||e.text)}else{o.appendChild(l)}De(a,"redraw")}}function _e(r,t,e,i){if(r.noHScroll){(e.alignable||(e.alignable=[])).push(t);var n=i.wrapperWidth;t.style.left=i.fixedPos+"px";if(!r.coverGutter){n-=i.gutterTotalWidth;t.style.paddingLeft=i.gutterTotalWidth+"px"}t.style.width=n+"px"}if(r.coverGutter){t.style.zIndex=5;t.style.position="relative";if(!r.noHScroll){t.style.marginLeft=-i.gutterTotalWidth+"px"}}}function He(r){if(r.height!=null){return r.height}var t=r.doc.cm;if(!t){return 0}if(!I(document.body,r.node)){var e="position: relative;";if(r.coverGutter){e+="margin-left: -"+t.display.gutters.offsetWidth+"px;"}if(r.noHScroll){e+="width: "+t.display.wrapper.clientWidth+"px;"}N(t.display.measure,E("div",[r.node],null,e))}return r.height=r.node.parentNode.offsetHeight}function Ve(r,t){for(var e=Er(t);e!=r.wrapper;e=e.parentNode){if(!e||e.nodeType==1&&e.getAttribute("cm-ignore-events")=="true"||e.parentNode==r.sizer&&e!=r.mover){return true}}}function $e(r){return r.lineSpace.offsetTop}function Qe(r){return r.mover.offsetHeight-r.lineSpace.offsetHeight}function Je(r){if(r.cachedPaddingH){return r.cachedPaddingH}var t=N(r.measure,E("pre","x","CodeMirror-line-like"));var e=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle;var i={left:parseInt(e.paddingLeft),right:parseInt(e.paddingRight)};if(!isNaN(i.left)&&!isNaN(i.right)){r.cachedPaddingH=i}return i}function Ke(r){return H-r.display.nativeBarWidth}function qe(r){return r.display.scroller.clientWidth-Ke(r)-r.display.barWidth}function Ye(r){return r.display.scroller.clientHeight-Ke(r)-r.display.barHeight}function Xe(r,t,e){var i=r.options.lineWrapping;var n=i&&qe(r);if(!t.measure.heights||i&&t.measure.width!=n){var o=t.measure.heights=[];if(i){t.measure.width=n;var f=t.text.firstChild.getClientRects();for(var u=0;u<f.length-1;u++){var a=f[u],l=f[u+1];if(Math.abs(a.bottom-l.bottom)>2){o.push((a.bottom+l.top)/2-e.top)}}}o.push(e.bottom-e.top)}}function Ze(r,t,e){if(r.line==t){return{map:r.measure.map,cache:r.measure.cache}}if(r.rest){for(var i=0;i<r.rest.length;i++){if(r.rest[i]==t){return{map:r.measure.maps[i],cache:r.measure.caches[i]}}}for(var n=0;n<r.rest.length;n++){if(it(r.rest[n])>e){return{map:r.measure.maps[n],cache:r.measure.caches[n],before:true}}}}}function ri(r,t){t=re(t);var e=it(t);var i=r.display.externalMeasured=new Ae(r.doc,t,e);i.lineN=e;var n=i.built=pe(r,i);i.text=n.pre;N(r.display.lineMeasure,n.pre);return i}function ti(r,t,e,i){return ni(r,ii(r,t),e,i)}function ei(r,t){if(t>=r.display.viewFrom&&t<r.display.viewTo){return r.display.view[zi(r,t)]}var e=r.display.externalMeasured;if(e&&t>=e.lineN&&t<e.lineN+e.size){return e}}function ii(r,t){var e=it(t);var i=ei(r,e);if(i&&!i.text){i=null}else if(i&&i.changes){Ie(r,i,e,Ii(r));r.curOp.forceUpdate=true}if(!i){i=ri(r,t)}var n=Ze(i,t,e);return{line:t,view:i,rect:null,map:n.map,cache:n.cache,before:n.before,hasHeights:false}}function ni(r,t,e,i,n){if(t.before){e=-1}var o=e+(i||""),f;if(t.cache.hasOwnProperty(o)){f=t.cache[o]}else{if(!t.rect){t.rect=t.view.text.getBoundingClientRect()}if(!t.hasHeights){Xe(r,t.view,t.rect);t.hasHeights=true}f=ai(r,t,e,i);if(!f.bogus){t.cache[o]=f}}return{left:f.left,right:f.right,top:n?f.rtop:f.top,bottom:n?f.rbottom:f.bottom}}var oi={left:0,right:0,top:0,bottom:0};function fi(r,t,e){var i,n,o,f,u,a;for(var l=0;l<r.length;l+=3){u=r[l];a=r[l+1];if(t<u){n=0;o=1;f="left"}else if(t<a){n=t-u;o=n+1}else if(l==r.length-3||t==a&&r[l+3]>t){o=a-u;n=o-1;if(t>=a){f="right"}}if(n!=null){i=r[l+2];if(u==a&&e==(i.insertLeft?"left":"right")){f=e}if(e=="left"&&n==0){while(l&&r[l-2]==r[l-3]&&r[l-1].insertLeft){i=r[(l-=3)+2];f="left"}}if(e=="right"&&n==a-u){while(l<r.length-3&&r[l+3]==r[l+4]&&!r[l+5].insertLeft){i=r[(l+=3)+2];f="right"}}break}}return{node:i,start:n,end:o,collapse:f,coverStart:u,coverEnd:a}}function ui(r,t){var e=oi;if(t=="left"){for(var i=0;i<r.length;i++){if((e=r[i]).left!=e.right){break}}}else{for(var n=r.length-1;n>=0;n--){if((e=r[n]).left!=e.right){break}}}return e}function ai(r,t,e,i){var n=fi(t.map,e,i);var o=n.node,a=n.start,l=n.end,s=n.collapse;var c;if(o.nodeType==3){for(var v=0;v<4;v++){while(a&&ar(t.line.text.charAt(n.coverStart+a))){--a}while(n.coverStart+l<n.coverEnd&&ar(t.line.text.charAt(n.coverStart+l))){++l}if(f&&u<9&&a==0&&l==n.coverEnd-n.coverStart){c=o.parentNode.getBoundingClientRect()}else{c=ui(T(o,a,l).getClientRects(),i)}if(c.left||c.right||a==0){break}l=a;a=a-1;s="right"}if(f&&u<11){c=li(r.display.measure,c)}}else{if(a>0){s=i="right"}var h;if(r.options.lineWrapping&&(h=o.getClientRects()).length>1){c=h[i=="right"?h.length-1:0]}else{c=o.getBoundingClientRect()}}if(f&&u<9&&!a&&(!c||!c.left&&!c.right)){var d=o.parentNode.getClientRects()[0];if(d){c={left:d.left,right:d.left+Ti(r.display),top:d.top,bottom:d.bottom}}else{c=oi}}var m=c.top-t.rect.top,p=c.bottom-t.rect.top;var g=(m+p)/2;var b=t.view.measure.heights;var w=0;for(;w<b.length-1;w++){if(g<b[w]){break}}var k=w?b[w-1]:0,C=b[w];var M={left:(s=="right"?c.right:c.left)-t.rect.left,right:(s=="left"?c.left:c.right)-t.rect.left,top:k,bottom:C};if(!c.left&&!c.right){M.bogus=true}if(!r.options.singleCursorHeightPerLine){M.rtop=m;M.rbottom=p}return M}function li(r,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!Fr(r)){return t}var e=screen.logicalXDPI/screen.deviceXDPI;var i=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*e,right:t.right*e,top:t.top*i,bottom:t.bottom*i}}function si(r){if(r.measure){r.measure.cache={};r.measure.heights=null;if(r.rest){for(var t=0;t<r.rest.length;t++){r.measure.caches[t]={}}}}}function ci(r){r.display.externalMeasure=null;S(r.display.lineMeasure);for(var t=0;t<r.display.view.length;t++){si(r.display.view[t])}}function vi(r){ci(r);r.display.cachedCharWidth=r.display.cachedTextHeight=r.display.cachedPaddingH=null;if(!r.options.lineWrapping){r.display.maxLineChanged=true}r.display.lineNumChars=null}function hi(r){if(s&&g){return-(r.body.getBoundingClientRect().left-parseInt(getComputedStyle(r.body).marginLeft))}return r.defaultView.pageXOffset||(r.documentElement||r.body).scrollLeft}function di(r){if(s&&g){return-(r.body.getBoundingClientRect().top-parseInt(getComputedStyle(r.body).marginTop))}return r.defaultView.pageYOffset||(r.documentElement||r.body).scrollTop}function mi(r){var t=re(r);var e=t.widgets;var i=0;if(e){for(var n=0;n<e.length;++n){if(e[n].above){i+=He(e[n])}}}return i}function pi(r,t,e,i,n){if(!n){var o=mi(t);e.top+=o;e.bottom+=o}if(i=="line"){return e}if(!i){i="local"}var f=ue(t);if(i=="local"){f+=$e(r.display)}else{f-=r.display.viewOffset}if(i=="page"||i=="window"){var u=r.display.lineSpace.getBoundingClientRect();f+=u.top+(i=="window"?0:di(z(r)));var a=u.left+(i=="window"?0:hi(z(r)));e.left+=a;e.right+=a}e.top+=f;e.bottom+=f;return e}function gi(r,t,e){if(e=="div"){return t}var i=t.left,n=t.top;if(e=="page"){i-=hi(z(r));n-=di(z(r))}else if(e=="local"||!e){var o=r.display.sizer.getBoundingClientRect();i+=o.left;n+=o.top}var f=r.display.lineSpace.getBoundingClientRect();return{left:i-f.left,top:n-f.top}}function bi(r,t,e,i,n){if(!i){i=Zr(r.doc,t.line)}return pi(r,i,ti(r,i,t.ch,n),e)}function wi(r,t,e,i,n,o){i=i||Zr(r.doc,t.line);if(!n){n=ii(r,i)}function f(t,f){var u=ni(r,n,t,f?"right":"left",o);if(f){u.left=u.right}else{u.right=u.left}return pi(r,i,u,e)}var u=mr(i,r.doc.direction),a=t.ch,l=t.sticky;if(a>=i.text.length){a=i.text.length;l="before"}else if(a<=0){a=0;l="after"}if(!u){return f(l=="before"?a-1:a,l=="before")}function s(r,t,e){var i=u[t],n=i.level==1;return f(e?r-1:r,n!=e)}var c=hr(u,a,l);var v=vr;var h=s(a,c,l=="before");if(v!=null){h.other=s(a,v,l!="before")}return h}function ki(r,t){var e=0;t=dt(r.doc,t);if(!r.options.lineWrapping){e=Ti(r.display)*t.ch}var i=Zr(r.doc,t.line);var n=ue(i)+$e(r.display);return{left:e,right:e,top:n,bottom:n+i.height}}function Ci(r,t,e,i,n){var o=ut(r,t,e);o.xRel=n;if(i){o.outside=i}return o}function Mi(r,t,e){var i=r.doc;e+=r.display.viewOffset;if(e<0){return Ci(i.first,0,null,-1,-1)}var n=nt(i,e),o=i.first+i.size-1;if(n>o){return Ci(i.first+i.size-1,Zr(i,o).text.length,null,1,1)}if(t<0){t=0}var f=Zr(i,n);for(;;){var u=Li(r,f,n,t,e);var a=Xt(f,u.ch+(u.xRel>0||u.outside>0?1:0));if(!a){return u}var l=a.find(1);if(l.line==n){return l}f=Zr(i,n=l.line)}}function Ai(r,t,e,i){i-=mi(t);var n=t.text.length;var o=sr((function(t){return ni(r,e,t-1).bottom<=i}),n,0);n=sr((function(t){return ni(r,e,t).top>i}),o,n);return{begin:o,end:n}}function yi(r,t,e,i){if(!e){e=ii(r,t)}var n=pi(r,t,ni(r,e,i),"line").top;return Ai(r,t,e,n)}function xi(r,t,e,i){return r.bottom<=e?false:r.top>e?true:(i?r.left:r.right)>t}function Li(r,t,e,i,n){n-=ue(t);var o=ii(r,t);var f=mi(t);var u=0,a=t.text.length,l=true;var s=mr(t,r.doc.direction);if(s){var c=(r.options.lineWrapping?Ni:Si)(r,t,e,o,s,i,n);l=c.level!=1;u=l?c.from:c.to-1;a=l?c.to:c.from-1}var v=null,h=null;var d=sr((function(t){var e=ni(r,o,t);e.top+=f;e.bottom+=f;if(!xi(e,i,n,false)){return false}if(e.top<=n&&e.left<=i){v=t;h=e}return true}),u,a);var m,p,g=false;if(h){var b=i-h.left<h.right-i,w=b==l;d=v+(w?0:1);p=w?"after":"before";m=b?h.left:h.right}else{if(!l&&(d==a||d==u)){d++}p=d==0?"after":d==t.text.length?"before":ni(r,o,d-(l?1:0)).bottom+f<=n==l?"after":"before";var k=wi(r,ut(e,d,p),"line",t,o);m=k.left;g=n<k.top?-1:n>=k.bottom?1:0}d=lr(t.text,d,1);return Ci(e,d,p,g,i-m)}function Si(r,t,e,i,n,o,f){var u=sr((function(u){var a=n[u],l=a.level!=1;return xi(wi(r,ut(e,l?a.to:a.from,l?"before":"after"),"line",t,i),o,f,true)}),0,n.length-1);var a=n[u];if(u>0){var l=a.level!=1;var s=wi(r,ut(e,l?a.from:a.to,l?"after":"before"),"line",t,i);if(xi(s,o,f,true)&&s.top>f){a=n[u-1]}}return a}function Ni(r,t,e,i,n,o,f){var u=Ai(r,t,i,f);var a=u.begin;var l=u.end;if(/\s/.test(t.text.charAt(l-1))){l--}var s=null,c=null;for(var v=0;v<n.length;v++){var h=n[v];if(h.from>=l||h.to<=a){continue}var d=h.level!=1;var m=ni(r,i,d?Math.min(l,h.to)-1:Math.max(a,h.from)).right;var p=m<o?o-m+1e9:m-o;if(!s||c>p){s=h;c=p}}if(!s){s=n[n.length-1]}if(s.from<a){s={from:a,to:s.to,level:s.level}}if(s.to>l){s={from:s.from,to:l,level:s.level}}return s}var Ei;function Di(r){if(r.cachedTextHeight!=null){return r.cachedTextHeight}if(Ei==null){Ei=E("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t){Ei.appendChild(document.createTextNode("x"));Ei.appendChild(E("br"))}Ei.appendChild(document.createTextNode("x"))}N(r.measure,Ei);var e=Ei.offsetHeight/50;if(e>3){r.cachedTextHeight=e}S(r.measure);return e||1}function Ti(r){if(r.cachedCharWidth!=null){return r.cachedCharWidth}var t=E("span","xxxxxxxxxx");var e=E("pre",[t],"CodeMirror-line-like");N(r.measure,e);var i=t.getBoundingClientRect(),n=(i.right-i.left)/10;if(n>2){r.cachedCharWidth=n}return n||10}function Ii(r){var t=r.display,e={},i={};var n=t.gutters.clientLeft;for(var o=t.gutters.firstChild,f=0;o;o=o.nextSibling,++f){var u=r.display.gutterSpecs[f].className;e[u]=o.offsetLeft+o.clientLeft+n;i[u]=o.clientWidth}return{fixedPos:Ri(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:e,gutterWidth:i,wrapperWidth:t.wrapper.clientWidth}}function Ri(r){return r.scroller.getBoundingClientRect().left-r.sizer.getBoundingClientRect().left}function Oi(r){var t=Di(r.display),e=r.options.lineWrapping;var i=e&&Math.max(5,r.display.scroller.clientWidth/Ti(r.display)-3);return function(n){if(oe(r.doc,n)){return 0}var o=0;if(n.widgets){for(var f=0;f<n.widgets.length;f++){if(n.widgets[f].height){o+=n.widgets[f].height}}}if(e){return o+(Math.ceil(n.text.length/i)||1)*t}else{return o+t}}}function Bi(r){var t=r.doc,e=Oi(r);t.iter((function(r){var t=e(r);if(t!=r.height){et(r,t)}}))}function Ui(r,t,e,i){var n=r.display;if(!e&&Er(t).getAttribute("cm-not-content")=="true"){return null}var o,f,u=n.lineSpace.getBoundingClientRect();try{o=t.clientX-u.left;f=t.clientY-u.top}catch(r){return null}var a=Mi(r,o,f),l;if(i&&a.xRel>0&&(l=Zr(r.doc,a.line).text).length==a.ch){var s=P(l,l.length,r.options.tabSize)-l.length;a=ut(a.line,Math.max(0,Math.round((o-Je(r.display).left)/Ti(r.display))-s))}return a}function zi(r,t){if(t>=r.display.viewTo){return null}t-=r.display.viewFrom;if(t<0){return null}var e=r.display.view;for(var i=0;i<e.length;i++){t-=e[i].size;if(t<0){return i}}}function ji(r,t,e,i){if(t==null){t=r.doc.first}if(e==null){e=r.doc.first+r.doc.size}if(!i){i=0}var n=r.display;if(i&&e<n.viewTo&&(n.updateLineNumbers==null||n.updateLineNumbers>t)){n.updateLineNumbers=t}r.curOp.viewChanged=true;if(t>=n.viewTo){if(It&&ie(r.doc,t)<n.viewTo){Fi(r)}}else if(e<=n.viewFrom){if(It&&ne(r.doc,e+i)>n.viewFrom){Fi(r)}else{n.viewFrom+=i;n.viewTo+=i}}else if(t<=n.viewFrom&&e>=n.viewTo){Fi(r)}else if(t<=n.viewFrom){var o=Pi(r,e,e+i,1);if(o){n.view=n.view.slice(o.index);n.viewFrom=o.lineN;n.viewTo+=i}else{Fi(r)}}else if(e>=n.viewTo){var f=Pi(r,t,t,-1);if(f){n.view=n.view.slice(0,f.index);n.viewTo=f.lineN}else{Fi(r)}}else{var u=Pi(r,t,t,-1);var a=Pi(r,e,e+i,1);if(u&&a){n.view=n.view.slice(0,u.index).concat(ye(r,u.lineN,a.lineN)).concat(n.view.slice(a.index));n.viewTo+=i}else{Fi(r)}}var l=n.externalMeasured;if(l){if(e<l.lineN){l.lineN+=i}else if(t<l.lineN+l.size){n.externalMeasured=null}}}function Wi(r,t,e){r.curOp.viewChanged=true;var i=r.display,n=r.display.externalMeasured;if(n&&t>=n.lineN&&t<n.lineN+n.size){i.externalMeasured=null}if(t<i.viewFrom||t>=i.viewTo){return}var o=i.view[zi(r,t)];if(o.node==null){return}var f=o.changes||(o.changes=[]);if(_(f,e)==-1){f.push(e)}}function Fi(r){r.display.viewFrom=r.display.viewTo=r.doc.first;r.display.view=[];r.display.viewOffset=0}function Pi(r,t,e,i){var n=zi(r,t),o,f=r.display.view;if(!It||e==r.doc.first+r.doc.size){return{index:n,lineN:e}}var u=r.display.viewFrom;for(var a=0;a<n;a++){u+=f[a].size}if(u!=t){if(i>0){if(n==f.length-1){return null}o=u+f[n].size-t;n++}else{o=u-t}t+=o;e+=o}while(ie(r.doc,e)!=e){if(n==(i<0?0:f.length-1)){return null}e+=i*f[n-(i<0?1:0)].size;n+=i}return{index:n,lineN:e}}function Gi(r,t,e){var i=r.display,n=i.view;if(n.length==0||t>=i.viewTo||e<=i.viewFrom){i.view=ye(r,t,e);i.viewFrom=t}else{if(i.viewFrom>t){i.view=ye(r,t,i.viewFrom).concat(i.view)}else if(i.viewFrom<t){i.view=i.view.slice(zi(r,t))}i.viewFrom=t;if(i.viewTo<e){i.view=i.view.concat(ye(r,i.viewTo,e))}else if(i.viewTo>e){i.view=i.view.slice(0,zi(r,e))}}i.viewTo=e}function _i(r){var t=r.display.view,e=0;for(var i=0;i<t.length;i++){var n=t[i];if(!n.hidden&&(!n.node||n.changes)){++e}}return e}function Hi(r){r.display.input.showSelection(r.display.input.prepareSelection())}function Vi(r,t){if(t===void 0)t=true;var e=r.doc,i={};var n=i.cursors=document.createDocumentFragment();var o=i.selection=document.createDocumentFragment();var f=r.options.$customCursor;if(f){t=true}for(var u=0;u<e.sel.ranges.length;u++){if(!t&&u==e.sel.primIndex){continue}var a=e.sel.ranges[u];if(a.from().line>=r.display.viewTo||a.to().line<r.display.viewFrom){continue}var l=a.empty();if(f){var s=f(r,a);if(s){$i(r,s,n)}}else if(l||r.options.showCursorWhenSelecting){$i(r,a.head,n)}if(!l){Ji(r,a,o)}}return i}function $i(r,t,e){var i=wi(r,t,"div",null,null,!r.options.singleCursorHeightPerLine);var n=e.appendChild(E("div"," ","CodeMirror-cursor"));n.style.left=i.left+"px";n.style.top=i.top+"px";n.style.height=Math.max(0,i.bottom-i.top)*r.options.cursorHeight+"px";if(/\bcm-fat-cursor\b/.test(r.getWrapperElement().className)){var o=bi(r,t,"div",null,null);var f=o.right-o.left;n.style.width=(f>0?f:r.defaultCharWidth())+"px"}if(i.other){var u=e.appendChild(E("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));u.style.display="";u.style.left=i.other.left+"px";u.style.top=i.other.top+"px";u.style.height=(i.other.bottom-i.other.top)*.85+"px"}}function Qi(r,t){return r.top-t.top||r.left-t.left}function Ji(r,t,e){var i=r.display,n=r.doc;var o=document.createDocumentFragment();var f=Je(r.display),u=f.left;var a=Math.max(i.sizerWidth,qe(r)-i.sizer.offsetLeft)-f.right;var l=n.direction=="ltr";function s(r,t,e,i){if(t<0){t=0}t=Math.round(t);i=Math.round(i);o.appendChild(E("div",null,"CodeMirror-selected","position: absolute; left: "+r+"px;\n top: "+t+"px; width: "+(e==null?a-r:e)+"px;\n height: "+(i-t)+"px"))}function c(t,e,i){var o=Zr(n,t);var f=o.text.length;var c,v;function h(e,i){return bi(r,ut(t,e),"div",o,i)}function d(t,e,i){var n=yi(r,o,null,t);var f=e=="ltr"==(i=="after")?"left":"right";var u=i=="after"?n.begin:n.end-(/\s/.test(o.text.charAt(n.end-1))?2:1);return h(u,f)[f]}var m=mr(o,n.direction);cr(m,e||0,i==null?f:i,(function(r,t,n,o){var p=n=="ltr";var g=h(r,p?"left":"right");var b=h(t-1,p?"right":"left");var w=e==null&&r==0,k=i==null&&t==f;var C=o==0,M=!m||o==m.length-1;if(b.top-g.top<=3){var A=(l?w:k)&&C;var y=(l?k:w)&&M;var x=A?u:(p?g:b).left;var L=y?a:(p?b:g).right;s(x,g.top,L-x,g.bottom)}else{var S,N,E,D;if(p){S=l&&w&&C?u:g.left;N=l?a:d(r,n,"before");E=l?u:d(t,n,"after");D=l&&k&&M?a:b.right}else{S=!l?u:d(r,n,"before");N=!l&&w&&C?a:g.right;E=!l&&k&&M?u:b.left;D=!l?a:d(t,n,"after")}s(S,g.top,N-S,g.bottom);if(g.bottom<b.top){s(u,g.bottom,null,b.top)}s(E,b.top,D-E,b.bottom)}if(!c||Qi(g,c)<0){c=g}if(Qi(b,c)<0){c=b}if(!v||Qi(g,v)<0){v=g}if(Qi(b,v)<0){v=b}}));return{start:c,end:v}}var v=t.from(),h=t.to();if(v.line==h.line){c(v.line,v.ch,h.ch)}else{var d=Zr(n,v.line),m=Zr(n,h.line);var p=re(d)==re(m);var g=c(v.line,v.ch,p?d.text.length+1:null).end;var b=c(h.line,p?0:null,h.ch).start;if(p){if(g.top<b.top-2){s(g.right,g.top,null,g.bottom);s(u,b.top,b.left,b.bottom)}else{s(g.right,g.top,b.left-g.right,g.bottom)}}if(g.bottom<b.top){s(u,g.bottom,null,b.top)}}e.appendChild(o)}function Ki(r){if(!r.state.focused){return}var t=r.display;clearInterval(t.blinker);var e=true;t.cursorDiv.style.visibility="";if(r.options.cursorBlinkRate>0){t.blinker=setInterval((function(){if(!r.hasFocus()){Zi(r)}t.cursorDiv.style.visibility=(e=!e)?"":"hidden"}),r.options.cursorBlinkRate)}else if(r.options.cursorBlinkRate<0){t.cursorDiv.style.visibility="hidden"}}function qi(r){if(!r.hasFocus()){r.display.input.focus();if(!r.state.focused){Xi(r)}}}function Yi(r){r.state.delayingBlurEvent=true;setTimeout((function(){if(r.state.delayingBlurEvent){r.state.delayingBlurEvent=false;if(r.state.focused){Zi(r)}}}),100)}function Xi(r,t){if(r.state.delayingBlurEvent&&!r.state.draggingText){r.state.delayingBlurEvent=false}if(r.options.readOnly=="nocursor"){return}if(!r.state.focused){kr(r,"focus",r,t);r.state.focused=true;O(r.display.wrapper,"CodeMirror-focused");if(!r.curOp&&r.display.selForContextMenu!=r.doc.sel){r.display.input.reset();if(a){setTimeout((function(){return r.display.input.reset(true)}),20)}}r.display.input.receivedFocus()}Ki(r)}function Zi(r,t){if(r.state.delayingBlurEvent){return}if(r.state.focused){kr(r,"blur",r,t);r.state.focused=false;L(r.display.wrapper,"CodeMirror-focused")}clearInterval(r.display.blinker);setTimeout((function(){if(!r.state.focused){r.display.shift=false}}),150)}function rn(r){var t=r.display;var e=t.lineDiv.offsetTop;var i=Math.max(0,t.scroller.getBoundingClientRect().top);var n=t.lineDiv.getBoundingClientRect().top;var o=0;for(var a=0;a<t.view.length;a++){var l=t.view[a],s=r.options.lineWrapping;var c=void 0,v=0;if(l.hidden){continue}n+=l.line.height;if(f&&u<8){var h=l.node.offsetTop+l.node.offsetHeight;c=h-e;e=h}else{var d=l.node.getBoundingClientRect();c=d.bottom-d.top;if(!s&&l.text.firstChild){v=l.text.firstChild.getBoundingClientRect().right-d.left-1}}var m=l.line.height-c;if(m>.005||m<-.005){if(n<i){o-=m}et(l.line,c);tn(l.line);if(l.rest){for(var p=0;p<l.rest.length;p++){tn(l.rest[p])}}}if(v>r.display.sizerWidth){var g=Math.ceil(v/Ti(r.display));if(g>r.display.maxLineLength){r.display.maxLineLength=g;r.display.maxLine=l.line;r.display.maxLineChanged=true}}}if(Math.abs(o)>2){t.scroller.scrollTop+=o}}function tn(r){if(r.widgets){for(var t=0;t<r.widgets.length;++t){var e=r.widgets[t],i=e.node.parentNode;if(i){e.height=i.offsetHeight}}}}function en(r,t,e){var i=e&&e.top!=null?Math.max(0,e.top):r.scroller.scrollTop;i=Math.floor(i-$e(r));var n=e&&e.bottom!=null?e.bottom:i+r.wrapper.clientHeight;var o=nt(t,i),f=nt(t,n);if(e&&e.ensure){var u=e.ensure.from.line,a=e.ensure.to.line;if(u<o){o=u;f=nt(t,ue(Zr(t,u))+r.wrapper.clientHeight)}else if(Math.min(a,t.lastLine())>=f){o=nt(t,ue(Zr(t,a))-r.wrapper.clientHeight);f=a}}return{from:o,to:Math.max(f,o+1)}}function nn(r,t){if(Cr(r,"scrollCursorIntoView")){return}var e=r.display,i=e.sizer.getBoundingClientRect(),n=null;var o=e.wrapper.ownerDocument;if(t.top+i.top<0){n=true}else if(t.bottom+i.top>(o.defaultView.innerHeight||o.documentElement.clientHeight)){n=false}if(n!=null&&!m){var f=E("div","",null,"position: absolute;\n top: "+(t.top-e.viewOffset-$e(r.display))+"px;\n height: "+(t.bottom-t.top+Ke(r)+e.barHeight)+"px;\n left: "+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");r.display.lineSpace.appendChild(f);f.scrollIntoView(n);r.display.lineSpace.removeChild(f)}}function on(r,t,e,i){if(i==null){i=0}var n;if(!r.options.lineWrapping&&t==e){e=t.sticky=="before"?ut(t.line,t.ch+1,"before"):t;t=t.ch?ut(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t}for(var o=0;o<5;o++){var f=false;var u=wi(r,t);var a=!e||e==t?u:wi(r,e);n={left:Math.min(u.left,a.left),top:Math.min(u.top,a.top)-i,right:Math.max(u.left,a.left),bottom:Math.max(u.bottom,a.bottom)+i};var l=un(r,n);var s=r.doc.scrollTop,c=r.doc.scrollLeft;if(l.scrollTop!=null){dn(r,l.scrollTop);if(Math.abs(r.doc.scrollTop-s)>1){f=true}}if(l.scrollLeft!=null){pn(r,l.scrollLeft);if(Math.abs(r.doc.scrollLeft-c)>1){f=true}}if(!f){break}}return n}function fn(r,t){var e=un(r,t);if(e.scrollTop!=null){dn(r,e.scrollTop)}if(e.scrollLeft!=null){pn(r,e.scrollLeft)}}function un(r,t){var e=r.display,i=Di(r.display);if(t.top<0){t.top=0}var n=r.curOp&&r.curOp.scrollTop!=null?r.curOp.scrollTop:e.scroller.scrollTop;var o=Ye(r),f={};if(t.bottom-t.top>o){t.bottom=t.top+o}var u=r.doc.height+Qe(e);var a=t.top<i,l=t.bottom>u-i;if(t.top<n){f.scrollTop=a?0:t.top}else if(t.bottom>n+o){var s=Math.min(t.top,(l?u:t.bottom)-o);if(s!=n){f.scrollTop=s}}var c=r.options.fixedGutter?0:e.gutters.offsetWidth;var v=r.curOp&&r.curOp.scrollLeft!=null?r.curOp.scrollLeft:e.scroller.scrollLeft-c;var h=qe(r)-e.gutters.offsetWidth;var d=t.right-t.left>h;if(d){t.right=t.left+h}if(t.left<10){f.scrollLeft=0}else if(t.left<v){f.scrollLeft=Math.max(0,t.left+c-(d?0:10))}else if(t.right>h+v-3){f.scrollLeft=t.right+(d?0:10)-h}return f}function an(r,t){if(t==null){return}vn(r);r.curOp.scrollTop=(r.curOp.scrollTop==null?r.doc.scrollTop:r.curOp.scrollTop)+t}function ln(r){vn(r);var t=r.getCursor();r.curOp.scrollToPos={from:t,to:t,margin:r.options.cursorScrollMargin}}function sn(r,t,e){if(t!=null||e!=null){vn(r)}if(t!=null){r.curOp.scrollLeft=t}if(e!=null){r.curOp.scrollTop=e}}function cn(r,t){vn(r);r.curOp.scrollToPos=t}function vn(r){var t=r.curOp.scrollToPos;if(t){r.curOp.scrollToPos=null;var e=ki(r,t.from),i=ki(r,t.to);hn(r,e,i,t.margin)}}function hn(r,t,e,i){var n=un(r,{left:Math.min(t.left,e.left),top:Math.min(t.top,e.top)-i,right:Math.max(t.right,e.right),bottom:Math.max(t.bottom,e.bottom)+i});sn(r,n.scrollLeft,n.scrollTop)}function dn(r,t){if(Math.abs(r.doc.scrollTop-t)<2){return}if(!e){Vn(r,{top:t})}mn(r,t,true);if(e){Vn(r)}zn(r,100)}function mn(r,t,e){t=Math.max(0,Math.min(r.display.scroller.scrollHeight-r.display.scroller.clientHeight,t));if(r.display.scroller.scrollTop==t&&!e){return}r.doc.scrollTop=t;r.display.scrollbars.setScrollTop(t);if(r.display.scroller.scrollTop!=t){r.display.scroller.scrollTop=t}}function pn(r,t,e,i){t=Math.max(0,Math.min(t,r.display.scroller.scrollWidth-r.display.scroller.clientWidth));if((e?t==r.doc.scrollLeft:Math.abs(r.doc.scrollLeft-t)<2)&&!i){return}r.doc.scrollLeft=t;Kn(r);if(r.display.scroller.scrollLeft!=t){r.display.scroller.scrollLeft=t}r.display.scrollbars.setScrollLeft(t)}function gn(r){var t=r.display,e=t.gutters.offsetWidth;var i=Math.round(r.doc.height+Qe(r.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:r.options.fixedGutter?e:0,docHeight:i,scrollHeight:i+Ke(r)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:e}}var bn=function(r,t,e){this.cm=e;var i=this.vert=E("div",[E("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar");var n=this.horiz=E("div",[E("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");i.tabIndex=n.tabIndex=-1;r(i);r(n);gr(i,"scroll",(function(){if(i.clientHeight){t(i.scrollTop,"vertical")}}));gr(n,"scroll",(function(){if(n.clientWidth){t(n.scrollLeft,"horizontal")}}));this.checkedZeroWidth=false;if(f&&u<8){this.horiz.style.minHeight=this.vert.style.minWidth="18px"}};bn.prototype.update=function(r){var t=r.scrollWidth>r.clientWidth+1;var e=r.scrollHeight>r.clientHeight+1;var i=r.nativeBarWidth;if(e){this.vert.style.display="block";this.vert.style.bottom=t?i+"px":"0";var n=r.viewHeight-(t?i:0);this.vert.firstChild.style.height=Math.max(0,r.scrollHeight-r.clientHeight+n)+"px"}else{this.vert.scrollTop=0;this.vert.style.display="";this.vert.firstChild.style.height="0"}if(t){this.horiz.style.display="block";this.horiz.style.right=e?i+"px":"0";this.horiz.style.left=r.barLeft+"px";var o=r.viewWidth-r.barLeft-(e?i:0);this.horiz.firstChild.style.width=Math.max(0,r.scrollWidth-r.clientWidth+o)+"px"}else{this.horiz.style.display="";this.horiz.firstChild.style.width="0"}if(!this.checkedZeroWidth&&r.clientHeight>0){if(i==0){this.zeroWidthHack()}this.checkedZeroWidth=true}return{right:e?i:0,bottom:t?i:0}};bn.prototype.setScrollLeft=function(r){if(this.horiz.scrollLeft!=r){this.horiz.scrollLeft=r}if(this.disableHoriz){this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")}};bn.prototype.setScrollTop=function(r){if(this.vert.scrollTop!=r){this.vert.scrollTop=r}if(this.disableVert){this.enableZeroWidthBar(this.vert,this.disableVert,"vert")}};bn.prototype.zeroWidthHack=function(){var r=w&&!d?"12px":"18px";this.horiz.style.height=this.vert.style.width=r;this.horiz.style.visibility=this.vert.style.visibility="hidden";this.disableHoriz=new G;this.disableVert=new G};bn.prototype.enableZeroWidthBar=function(r,t,e){r.style.visibility="";function i(){var n=r.getBoundingClientRect();var o=e=="vert"?document.elementFromPoint(n.right-1,(n.top+n.bottom)/2):document.elementFromPoint((n.right+n.left)/2,n.bottom-1);if(o!=r){r.style.visibility="hidden"}else{t.set(1e3,i)}}t.set(1e3,i)};bn.prototype.clear=function(){var r=this.horiz.parentNode;r.removeChild(this.horiz);r.removeChild(this.vert)};var wn=function(){};wn.prototype.update=function(){return{bottom:0,right:0}};wn.prototype.setScrollLeft=function(){};wn.prototype.setScrollTop=function(){};wn.prototype.clear=function(){};function kn(r,t){if(!t){t=gn(r)}var e=r.display.barWidth,i=r.display.barHeight;Cn(r,t);for(var n=0;n<4&&e!=r.display.barWidth||i!=r.display.barHeight;n++){if(e!=r.display.barWidth&&r.options.lineWrapping){rn(r)}Cn(r,gn(r));e=r.display.barWidth;i=r.display.barHeight}}function Cn(r,t){var e=r.display;var i=e.scrollbars.update(t);e.sizer.style.paddingRight=(e.barWidth=i.right)+"px";e.sizer.style.paddingBottom=(e.barHeight=i.bottom)+"px";e.heightForcer.style.borderBottom=i.bottom+"px solid transparent";if(i.right&&i.bottom){e.scrollbarFiller.style.display="block";e.scrollbarFiller.style.height=i.bottom+"px";e.scrollbarFiller.style.width=i.right+"px"}else{e.scrollbarFiller.style.display=""}if(i.bottom&&r.options.coverGutterNextToScrollbar&&r.options.fixedGutter){e.gutterFiller.style.display="block";e.gutterFiller.style.height=i.bottom+"px";e.gutterFiller.style.width=t.gutterWidth+"px"}else{e.gutterFiller.style.display=""}}var Mn={native:bn,null:wn};function An(r){if(r.display.scrollbars){r.display.scrollbars.clear();if(r.display.scrollbars.addClass){L(r.display.wrapper,r.display.scrollbars.addClass)}}r.display.scrollbars=new Mn[r.options.scrollbarStyle]((function(t){r.display.wrapper.insertBefore(t,r.display.scrollbarFiller);gr(t,"mousedown",(function(){if(r.state.focused){setTimeout((function(){return r.display.input.focus()}),0)}}));t.setAttribute("cm-not-content","true")}),(function(t,e){if(e=="horizontal"){pn(r,t)}else{dn(r,t)}}),r);if(r.display.scrollbars.addClass){O(r.display.wrapper,r.display.scrollbars.addClass)}}var yn=0;function xn(r){r.curOp={cm:r,viewChanged:false,startHeight:r.doc.height,forceUpdate:false,updateInput:0,typing:false,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:false,updateMaxLine:false,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:false,id:++yn,markArrays:null};Le(r.curOp)}function Ln(r){var t=r.curOp;if(t){Ne(t,(function(r){for(var t=0;t<r.ops.length;t++){r.ops[t].cm.curOp=null}Sn(r)}))}}function Sn(r){var t=r.ops;for(var e=0;e<t.length;e++){Nn(t[e])}for(var i=0;i<t.length;i++){En(t[i])}for(var n=0;n<t.length;n++){Dn(t[n])}for(var o=0;o<t.length;o++){Tn(t[o])}for(var f=0;f<t.length;f++){In(t[f])}}function Nn(r){var t=r.cm,e=t.display;Fn(t);if(r.updateMaxLine){le(t)}r.mustUpdate=r.viewChanged||r.forceUpdate||r.scrollTop!=null||r.scrollToPos&&(r.scrollToPos.from.line<e.viewFrom||r.scrollToPos.to.line>=e.viewTo)||e.maxLineChanged&&t.options.lineWrapping;r.update=r.mustUpdate&&new Wn(t,r.mustUpdate&&{top:r.scrollTop,ensure:r.scrollToPos},r.forceUpdate)}function En(r){r.updatedDisplay=r.mustUpdate&&_n(r.cm,r.update)}function Dn(r){var t=r.cm,e=t.display;if(r.updatedDisplay){rn(t)}r.barMeasure=gn(t);if(e.maxLineChanged&&!t.options.lineWrapping){r.adjustWidthTo=ti(t,e.maxLine,e.maxLine.text.length).left+3;t.display.sizerWidth=r.adjustWidthTo;r.barMeasure.scrollWidth=Math.max(e.scroller.clientWidth,e.sizer.offsetLeft+r.adjustWidthTo+Ke(t)+t.display.barWidth);r.maxScrollLeft=Math.max(0,e.sizer.offsetLeft+r.adjustWidthTo-qe(t))}if(r.updatedDisplay||r.selectionChanged){r.preparedSelection=e.input.prepareSelection()}}function Tn(r){var t=r.cm;if(r.adjustWidthTo!=null){t.display.sizer.style.minWidth=r.adjustWidthTo+"px";if(r.maxScrollLeft<t.doc.scrollLeft){pn(t,Math.min(t.display.scroller.scrollLeft,r.maxScrollLeft),true)}t.display.maxLineChanged=false}var e=r.focus&&r.focus==R(z(t));if(r.preparedSelection){t.display.input.showSelection(r.preparedSelection,e)}if(r.updatedDisplay||r.startHeight!=t.doc.height){kn(t,r.barMeasure)}if(r.updatedDisplay){Jn(t,r.barMeasure)}if(r.selectionChanged){Ki(t)}if(t.state.focused&&r.updateInput){t.display.input.reset(r.typing)}if(e){qi(r.cm)}}function In(r){var t=r.cm,e=t.display,i=t.doc;if(r.updatedDisplay){Hn(t,r.update)}if(e.wheelStartX!=null&&(r.scrollTop!=null||r.scrollLeft!=null||r.scrollToPos)){e.wheelStartX=e.wheelStartY=null}if(r.scrollTop!=null){mn(t,r.scrollTop,r.forceScroll)}if(r.scrollLeft!=null){pn(t,r.scrollLeft,true,true)}if(r.scrollToPos){var n=on(t,dt(i,r.scrollToPos.from),dt(i,r.scrollToPos.to),r.scrollToPos.margin);nn(t,n)}var o=r.maybeHiddenMarkers,f=r.maybeUnhiddenMarkers;if(o){for(var u=0;u<o.length;++u){if(!o[u].lines.length){kr(o[u],"hide")}}}if(f){for(var a=0;a<f.length;++a){if(f[a].lines.length){kr(f[a],"unhide")}}}if(e.wrapper.offsetHeight){i.scrollTop=t.display.scroller.scrollTop}if(r.changeObjs){kr(t,"changes",t,r.changeObjs)}if(r.update){r.update.finish()}}function Rn(r,t){if(r.curOp){return t()}xn(r);try{return t()}finally{Ln(r)}}function On(r,t){return function(){if(r.curOp){return t.apply(r,arguments)}xn(r);try{return t.apply(r,arguments)}finally{Ln(r)}}}function Bn(r){return function(){if(this.curOp){return r.apply(this,arguments)}xn(this);try{return r.apply(this,arguments)}finally{Ln(this)}}}function Un(r){return function(){var t=this.cm;if(!t||t.curOp){return r.apply(this,arguments)}xn(t);try{return r.apply(this,arguments)}finally{Ln(t)}}}function zn(r,t){if(r.doc.highlightFrontier<r.display.viewTo){r.state.highlight.set(t,W(jn,r))}}function jn(r){var t=r.doc;if(t.highlightFrontier>=r.display.viewTo){return}var e=+new Date+r.options.workTime;var i=Ct(r,t.highlightFrontier);var n=[];t.iter(i.line,Math.min(t.first+t.size,r.display.viewTo+500),(function(o){if(i.line>=r.display.viewFrom){var f=o.styles;var u=o.text.length>r.options.maxHighlightLength?Kr(t.mode,i.state):null;var a=wt(r,o,i,true);if(u){i.state=u}o.styles=a.styles;var l=o.styleClasses,s=a.classes;if(s){o.styleClasses=s}else if(l){o.styleClasses=null}var c=!f||f.length!=o.styles.length||l!=s&&(!l||!s||l.bgClass!=s.bgClass||l.textClass!=s.textClass);for(var v=0;!c&&v<f.length;++v){c=f[v]!=o.styles[v]}if(c){n.push(i.line)}o.stateAfter=i.save();i.nextLine()}else{if(o.text.length<=r.options.maxHighlightLength){Mt(r,o.text,i)}o.stateAfter=i.line%5==0?i.save():null;i.nextLine()}if(+new Date>e){zn(r,r.options.workDelay);return true}}));t.highlightFrontier=i.line;t.modeFrontier=Math.max(t.modeFrontier,i.line);if(n.length){Rn(r,(function(){for(var t=0;t<n.length;t++){Wi(r,n[t],"text")}}))}}var Wn=function(r,t,e){var i=r.display;this.viewport=t;this.visible=en(i,r.doc,t);this.editorIsHidden=!i.wrapper.offsetWidth;this.wrapperHeight=i.wrapper.clientHeight;this.wrapperWidth=i.wrapper.clientWidth;this.oldDisplayWidth=qe(r);this.force=e;this.dims=Ii(r);this.events=[]};Wn.prototype.signal=function(r,t){if(Ar(r,t)){this.events.push(arguments)}};Wn.prototype.finish=function(){for(var r=0;r<this.events.length;r++){kr.apply(null,this.events[r])}};function Fn(r){var t=r.display;if(!t.scrollbarsClipped&&t.scroller.offsetWidth){t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth;t.heightForcer.style.height=Ke(r)+"px";t.sizer.style.marginBottom=-t.nativeBarWidth+"px";t.sizer.style.borderRightWidth=Ke(r)+"px";t.scrollbarsClipped=true}}function Pn(r){if(r.hasFocus()){return null}var t=R(z(r));if(!t||!I(r.display.lineDiv,t)){return null}var e={activeElt:t};if(window.getSelection){var i=j(r).getSelection();if(i.anchorNode&&i.extend&&I(r.display.lineDiv,i.anchorNode)){e.anchorNode=i.anchorNode;e.anchorOffset=i.anchorOffset;e.focusNode=i.focusNode;e.focusOffset=i.focusOffset}}return e}function Gn(r){if(!r||!r.activeElt||r.activeElt==R(r.activeElt.ownerDocument)){return}r.activeElt.focus();if(!/^(INPUT|TEXTAREA)$/.test(r.activeElt.nodeName)&&r.anchorNode&&I(document.body,r.anchorNode)&&I(document.body,r.focusNode)){var t=r.activeElt.ownerDocument;var e=t.defaultView.getSelection(),i=t.createRange();i.setEnd(r.anchorNode,r.anchorOffset);i.collapse(false);e.removeAllRanges();e.addRange(i);e.extend(r.focusNode,r.focusOffset)}}function _n(r,t){var e=r.display,i=r.doc;if(t.editorIsHidden){Fi(r);return false}if(!t.force&&t.visible.from>=e.viewFrom&&t.visible.to<=e.viewTo&&(e.updateLineNumbers==null||e.updateLineNumbers>=e.viewTo)&&e.renderedView==e.view&&_i(r)==0){return false}if(qn(r)){Fi(r);t.dims=Ii(r)}var n=i.first+i.size;var o=Math.max(t.visible.from-r.options.viewportMargin,i.first);var f=Math.min(n,t.visible.to+r.options.viewportMargin);if(e.viewFrom<o&&o-e.viewFrom<20){o=Math.max(i.first,e.viewFrom)}if(e.viewTo>f&&e.viewTo-f<20){f=Math.min(n,e.viewTo)}if(It){o=ie(r.doc,o);f=ne(r.doc,f)}var u=o!=e.viewFrom||f!=e.viewTo||e.lastWrapHeight!=t.wrapperHeight||e.lastWrapWidth!=t.wrapperWidth;Gi(r,o,f);e.viewOffset=ue(Zr(r.doc,e.viewFrom));r.display.mover.style.top=e.viewOffset+"px";var a=_i(r);if(!u&&a==0&&!t.force&&e.renderedView==e.view&&(e.updateLineNumbers==null||e.updateLineNumbers>=e.viewTo)){return false}var l=Pn(r);if(a>4){e.lineDiv.style.display="none"}$n(r,e.updateLineNumbers,t.dims);if(a>4){e.lineDiv.style.display=""}e.renderedView=e.view;Gn(l);S(e.cursorDiv);S(e.selectionDiv);e.gutters.style.height=e.sizer.style.minHeight=0;if(u){e.lastWrapHeight=t.wrapperHeight;e.lastWrapWidth=t.wrapperWidth;zn(r,400)}e.updateLineNumbers=null;return true}function Hn(r,t){var e=t.viewport;for(var i=true;;i=false){if(!i||!r.options.lineWrapping||t.oldDisplayWidth==qe(r)){if(e&&e.top!=null){e={top:Math.min(r.doc.height+Qe(r.display)-Ye(r),e.top)}}t.visible=en(r.display,r.doc,e);if(t.visible.from>=r.display.viewFrom&&t.visible.to<=r.display.viewTo){break}}else if(i){t.visible=en(r.display,r.doc,e)}if(!_n(r,t)){break}rn(r);var n=gn(r);Hi(r);kn(r,n);Jn(r,n);t.force=false}t.signal(r,"update",r);if(r.display.viewFrom!=r.display.reportedViewFrom||r.display.viewTo!=r.display.reportedViewTo){t.signal(r,"viewportChange",r,r.display.viewFrom,r.display.viewTo);r.display.reportedViewFrom=r.display.viewFrom;r.display.reportedViewTo=r.display.viewTo}}function Vn(r,t){var e=new Wn(r,t);if(_n(r,e)){rn(r);Hn(r,e);var i=gn(r);Hi(r);kn(r,i);Jn(r,i);e.finish()}}function $n(r,t,e){var i=r.display,n=r.options.lineNumbers;var o=i.lineDiv,f=o.firstChild;function u(t){var e=t.nextSibling;if(a&&w&&r.display.currentWheelTarget==t){t.style.display="none"}else{t.parentNode.removeChild(t)}return e}var l=i.view,s=i.viewFrom;for(var c=0;c<l.length;c++){var v=l[c];if(v.hidden);else if(!v.node||v.node.parentNode!=o){var h=Fe(r,v,s,e);o.insertBefore(h,f)}else{while(f!=v.node){f=u(f)}var d=n&&t!=null&&t<=s&&v.lineNumber;if(v.changes){if(_(v.changes,"gutter")>-1){d=false}Ie(r,v,s,e)}if(d){S(v.lineNumber);v.lineNumber.appendChild(document.createTextNode(ft(r.options,s)))}f=v.node.nextSibling}s+=v.size}while(f){f=u(f)}}function Qn(r){var t=r.gutters.offsetWidth;r.sizer.style.marginLeft=t+"px";De(r,"gutterChanged",r)}function Jn(r,t){r.display.sizer.style.minHeight=t.docHeight+"px";r.display.heightForcer.style.top=t.docHeight+"px";r.display.gutters.style.height=t.docHeight+r.display.barHeight+Ke(r)+"px"}function Kn(r){var t=r.display,e=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!r.options.fixedGutter)){return}var i=Ri(t)-t.scroller.scrollLeft+r.doc.scrollLeft;var n=t.gutters.offsetWidth,o=i+"px";for(var f=0;f<e.length;f++){if(!e[f].hidden){if(r.options.fixedGutter){if(e[f].gutter){e[f].gutter.style.left=o}if(e[f].gutterBackground){e[f].gutterBackground.style.left=o}}var u=e[f].alignable;if(u){for(var a=0;a<u.length;a++){u[a].style.left=o}}}}if(r.options.fixedGutter){t.gutters.style.left=i+n+"px"}}function qn(r){if(!r.options.lineNumbers){return false}var t=r.doc,e=ft(r.options,t.first+t.size-1),i=r.display;if(e.length!=i.lineNumChars){var n=i.measure.appendChild(E("div",[E("div",e)],"CodeMirror-linenumber CodeMirror-gutter-elt"));var o=n.firstChild.offsetWidth,f=n.offsetWidth-o;i.lineGutter.style.width="";i.lineNumInnerWidth=Math.max(o,i.lineGutter.offsetWidth-f)+1;i.lineNumWidth=i.lineNumInnerWidth+f;i.lineNumChars=i.lineNumInnerWidth?e.length:-1;i.lineGutter.style.width=i.lineNumWidth+"px";Qn(r.display);return true}return false}function Yn(r,t){var e=[],i=false;for(var n=0;n<r.length;n++){var o=r[n],f=null;if(typeof o!="string"){f=o.style;o=o.className}if(o=="CodeMirror-linenumbers"){if(!t){continue}else{i=true}}e.push({className:o,style:f})}if(t&&!i){e.push({className:"CodeMirror-linenumbers",style:null})}return e}function Xn(r){var t=r.gutters,e=r.gutterSpecs;S(t);r.lineGutter=null;for(var i=0;i<e.length;++i){var n=e[i];var o=n.className;var f=n.style;var u=t.appendChild(E("div",null,"CodeMirror-gutter "+o));if(f){u.style.cssText=f}if(o=="CodeMirror-linenumbers"){r.lineGutter=u;u.style.width=(r.lineNumWidth||1)+"px"}}t.style.display=e.length?"":"none";Qn(r)}function Zn(r){Xn(r.display);ji(r);Kn(r)}function ro(r,t,i,n){var o=this;this.input=i;o.scrollbarFiller=E("div",null,"CodeMirror-scrollbar-filler");o.scrollbarFiller.setAttribute("cm-not-content","true");o.gutterFiller=E("div",null,"CodeMirror-gutter-filler");o.gutterFiller.setAttribute("cm-not-content","true");o.lineDiv=D("div",null,"CodeMirror-code");o.selectionDiv=E("div",null,null,"position: relative; z-index: 1");o.cursorDiv=E("div",null,"CodeMirror-cursors");o.measure=E("div",null,"CodeMirror-measure");o.lineMeasure=E("div",null,"CodeMirror-measure");o.lineSpace=D("div",[o.measure,o.lineMeasure,o.selectionDiv,o.cursorDiv,o.lineDiv],null,"position: relative; outline: none");var l=D("div",[o.lineSpace],"CodeMirror-lines");o.mover=E("div",[l],null,"position: relative");o.sizer=E("div",[o.mover],"CodeMirror-sizer");o.sizerWidth=null;o.heightForcer=E("div",null,null,"position: absolute; height: "+H+"px; width: 1px;");o.gutters=E("div",null,"CodeMirror-gutters");o.lineGutter=null;o.scroller=E("div",[o.sizer,o.heightForcer,o.gutters],"CodeMirror-scroll");o.scroller.setAttribute("tabIndex","-1");o.wrapper=E("div",[o.scrollbarFiller,o.gutterFiller,o.scroller],"CodeMirror");if(s&&c>=105){o.wrapper.style.clipPath="inset(0px)"}o.wrapper.setAttribute("translate","no");if(f&&u<8){o.gutters.style.zIndex=-1;o.scroller.style.paddingRight=0}if(!a&&!(e&&b)){o.scroller.draggable=true}if(r){if(r.appendChild){r.appendChild(o.wrapper)}else{r(o.wrapper)}}o.viewFrom=o.viewTo=t.first;o.reportedViewFrom=o.reportedViewTo=t.first;o.view=[];o.renderedView=null;o.externalMeasured=null;o.viewOffset=0;o.lastWrapHeight=o.lastWrapWidth=0;o.updateLineNumbers=null;o.nativeBarWidth=o.barHeight=o.barWidth=0;o.scrollbarsClipped=false;o.lineNumWidth=o.lineNumInnerWidth=o.lineNumChars=null;o.alignWidgets=false;o.cachedCharWidth=o.cachedTextHeight=o.cachedPaddingH=null;o.maxLine=null;o.maxLineLength=0;o.maxLineChanged=false;o.wheelDX=o.wheelDY=o.wheelStartX=o.wheelStartY=null;o.shift=false;o.selForContextMenu=null;o.activeTouch=null;o.gutterSpecs=Yn(n.gutters,n.lineNumbers);Xn(o);i.init(o)}var to=0,eo=null;if(f){eo=-.53}else if(e){eo=15}else if(s){eo=-.7}else if(h){eo=-1/3}function io(r){var t=r.wheelDeltaX,e=r.wheelDeltaY;if(t==null&&r.detail&&r.axis==r.HORIZONTAL_AXIS){t=r.detail}if(e==null&&r.detail&&r.axis==r.VERTICAL_AXIS){e=r.detail}else if(e==null){e=r.wheelDelta}return{x:t,y:e}}function no(r){var t=io(r);t.x*=eo;t.y*=eo;return t}function oo(r,t){if(s&&c==102){if(r.display.chromeScrollHack==null){r.display.sizer.style.pointerEvents="none"}else{clearTimeout(r.display.chromeScrollHack)}r.display.chromeScrollHack=setTimeout((function(){r.display.chromeScrollHack=null;r.display.sizer.style.pointerEvents=""}),100)}var i=io(t),n=i.x,o=i.y;var f=eo;if(t.deltaMode===0){n=t.deltaX;o=t.deltaY;f=1}var u=r.display,l=u.scroller;var h=l.scrollWidth>l.clientWidth;var d=l.scrollHeight>l.clientHeight;if(!(n&&h||o&&d)){return}if(o&&w&&a){r:for(var m=t.target,p=u.view;m!=l;m=m.parentNode){for(var g=0;g<p.length;g++){if(p[g].node==m){r.display.currentWheelTarget=m;break r}}}}if(n&&!e&&!v&&f!=null){if(o&&d){dn(r,Math.max(0,l.scrollTop+o*f))}pn(r,Math.max(0,l.scrollLeft+n*f));if(!o||o&&d){xr(t)}u.wheelStartX=null;return}if(o&&f!=null){var b=o*f;var k=r.doc.scrollTop,C=k+u.wrapper.clientHeight;if(b<0){k=Math.max(0,k+b-50)}else{C=Math.min(r.doc.height,C+b+50)}Vn(r,{top:k,bottom:C})}if(to<20&&t.deltaMode!==0){if(u.wheelStartX==null){u.wheelStartX=l.scrollLeft;u.wheelStartY=l.scrollTop;u.wheelDX=n;u.wheelDY=o;setTimeout((function(){if(u.wheelStartX==null){return}var r=l.scrollLeft-u.wheelStartX;var t=l.scrollTop-u.wheelStartY;var e=t&&u.wheelDY&&t/u.wheelDY||r&&u.wheelDX&&r/u.wheelDX;u.wheelStartX=u.wheelStartY=null;if(!e){return}eo=(eo*to+e)/(to+1);++to}),200)}else{u.wheelDX+=n;u.wheelDY+=o}}}var fo=function(r,t){this.ranges=r;this.primIndex=t};fo.prototype.primary=function(){return this.ranges[this.primIndex]};fo.prototype.equals=function(r){if(r==this){return true}if(r.primIndex!=this.primIndex||r.ranges.length!=this.ranges.length){return false}for(var t=0;t<this.ranges.length;t++){var e=this.ranges[t],i=r.ranges[t];if(!lt(e.anchor,i.anchor)||!lt(e.head,i.head)){return false}}return true};fo.prototype.deepCopy=function(){var r=[];for(var t=0;t<this.ranges.length;t++){r[t]=new uo(st(this.ranges[t].anchor),st(this.ranges[t].head))}return new fo(r,this.primIndex)};fo.prototype.somethingSelected=function(){for(var r=0;r<this.ranges.length;r++){if(!this.ranges[r].empty()){return true}}return false};fo.prototype.contains=function(r,t){if(!t){t=r}for(var e=0;e<this.ranges.length;e++){var i=this.ranges[e];if(at(t,i.from())>=0&&at(r,i.to())<=0){return e}}return-1};var uo=function(r,t){this.anchor=r;this.head=t};uo.prototype.from=function(){return vt(this.anchor,this.head)};uo.prototype.to=function(){return ct(this.anchor,this.head)};uo.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function ao(r,t,e){var i=r&&r.options.selectionsMayTouch;var n=t[e];t.sort((function(r,t){return at(r.from(),t.from())}));e=_(t,n);for(var o=1;o<t.length;o++){var f=t[o],u=t[o-1];var a=at(u.to(),f.from());if(i&&!f.empty()?a>0:a>=0){var l=vt(u.from(),f.from()),s=ct(u.to(),f.to());var c=u.empty()?f.from()==f.head:u.from()==u.head;if(o<=e){--e}t.splice(--o,2,new uo(c?s:l,c?l:s))}}return new fo(t,e)}function lo(r,t){return new fo([new uo(r,t||r)],0)}function so(r){if(!r.text){return r.to}return ut(r.from.line+r.text.length-1,X(r.text).length+(r.text.length==1?r.from.ch:0))}function co(r,t){if(at(r,t.from)<0){return r}if(at(r,t.to)<=0){return so(t)}var e=r.line+t.text.length-(t.to.line-t.from.line)-1,i=r.ch;if(r.line==t.to.line){i+=so(t).ch-t.to.ch}return ut(e,i)}function vo(r,t){var e=[];for(var i=0;i<r.sel.ranges.length;i++){var n=r.sel.ranges[i];e.push(new uo(co(n.anchor,t),co(n.head,t)))}return ao(r.cm,e,r.sel.primIndex)}function ho(r,t,e){if(r.line==t.line){return ut(e.line,r.ch-t.ch+e.ch)}else{return ut(e.line+(r.line-t.line),r.ch)}}function mo(r,t,e){var i=[];var n=ut(r.first,0),o=n;for(var f=0;f<t.length;f++){var u=t[f];var a=ho(u.from,n,o);var l=ho(so(u),n,o);n=u.to;o=l;if(e=="around"){var s=r.sel.ranges[f],c=at(s.head,s.anchor)<0;i[f]=new uo(c?l:a,c?a:l)}else{i[f]=new uo(a,a)}}return new fo(i,r.sel.primIndex)}function po(r){r.doc.mode=$r(r.options,r.doc.modeOption);go(r)}function go(r){r.doc.iter((function(r){if(r.stateAfter){r.stateAfter=null}if(r.styles){r.styles=null}}));r.doc.modeFrontier=r.doc.highlightFrontier=r.doc.first;zn(r,100);r.state.modeGen++;if(r.curOp){ji(r)}}function bo(r,t){return t.from.ch==0&&t.to.ch==0&&X(t.text)==""&&(!r.cm||r.cm.options.wholeLineUpdateBefore)}function wo(r,t,e,i){function n(r){return e?e[r]:null}function o(r,e,n){ce(r,e,n,i);De(r,"change",r,t)}function f(r,t){var e=[];for(var o=r;o<t;++o){e.push(new se(l[o],n(o),i))}return e}var u=t.from,a=t.to,l=t.text;var s=Zr(r,u.line),c=Zr(r,a.line);var v=X(l),h=n(l.length-1),d=a.line-u.line;if(t.full){r.insert(0,f(0,l.length));r.remove(l.length,r.size-l.length)}else if(bo(r,t)){var m=f(0,l.length-1);o(c,c.text,h);if(d){r.remove(u.line,d)}if(m.length){r.insert(u.line,m)}}else if(s==c){if(l.length==1){o(s,s.text.slice(0,u.ch)+v+s.text.slice(a.ch),h)}else{var p=f(1,l.length-1);p.push(new se(v+s.text.slice(a.ch),h,i));o(s,s.text.slice(0,u.ch)+l[0],n(0));r.insert(u.line+1,p)}}else if(l.length==1){o(s,s.text.slice(0,u.ch)+l[0]+c.text.slice(a.ch),n(0));r.remove(u.line+1,d)}else{o(s,s.text.slice(0,u.ch)+l[0],n(0));o(c,v+c.text.slice(a.ch),h);var g=f(1,l.length-1);if(d>1){r.remove(u.line+1,d-1)}r.insert(u.line+1,g)}De(r,"change",r,t)}function ko(r,t,e){function i(r,n,o){if(r.linked){for(var f=0;f<r.linked.length;++f){var u=r.linked[f];if(u.doc==n){continue}var a=o&&u.sharedHist;if(e&&!a){continue}t(u.doc,a);i(u.doc,r,a)}}}i(r,null,true)}function Co(r,t){if(t.cm){throw new Error("This document is already in use.")}r.doc=t;t.cm=r;Bi(r);po(r);Mo(r);r.options.direction=t.direction;if(!r.options.lineWrapping){le(r)}r.options.mode=t.modeOption;ji(r)}function Mo(r){(r.doc.direction=="rtl"?O:L)(r.display.lineDiv,"CodeMirror-rtl")}function Ao(r){Rn(r,(function(){Mo(r);ji(r)}))}function yo(r){this.done=[];this.undone=[];this.undoDepth=r?r.undoDepth:Infinity;this.lastModTime=this.lastSelTime=0;this.lastOp=this.lastSelOp=null;this.lastOrigin=this.lastSelOrigin=null;this.generation=this.maxGeneration=r?r.maxGeneration:1}function xo(r,t){var e={from:st(t.from),to:so(t),text:rt(r,t.from,t.to)};Io(r,e,t.from.line,t.to.line+1);ko(r,(function(r){return Io(r,e,t.from.line,t.to.line+1)}),true);return e}function Lo(r){while(r.length){var t=X(r);if(t.ranges){r.pop()}else{break}}}function So(r,t){if(t){Lo(r.done);return X(r.done)}else if(r.done.length&&!X(r.done).ranges){return X(r.done)}else if(r.done.length>1&&!r.done[r.done.length-2].ranges){r.done.pop();return X(r.done)}}function No(r,t,e,i){var n=r.history;n.undone.length=0;var o=+new Date,f;var u;if((n.lastOp==i||n.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&n.lastModTime>o-(r.cm?r.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(f=So(n,n.lastOp==i))){u=X(f.changes);if(at(t.from,t.to)==0&&at(t.from,u.to)==0){u.to=so(t)}else{f.changes.push(xo(r,t))}}else{var a=X(n.done);if(!a||!a.ranges){To(r.sel,n.done)}f={changes:[xo(r,t)],generation:n.generation};n.done.push(f);while(n.done.length>n.undoDepth){n.done.shift();if(!n.done[0].ranges){n.done.shift()}}}n.done.push(e);n.generation=++n.maxGeneration;n.lastModTime=n.lastSelTime=o;n.lastOp=n.lastSelOp=i;n.lastOrigin=n.lastSelOrigin=t.origin;if(!u){kr(r,"historyAdded")}}function Eo(r,t,e,i){var n=t.charAt(0);return n=="*"||n=="+"&&e.ranges.length==i.ranges.length&&e.somethingSelected()==i.somethingSelected()&&new Date-r.history.lastSelTime<=(r.cm?r.cm.options.historyEventDelay:500)}function Do(r,t,e,i){var n=r.history,o=i&&i.origin;if(e==n.lastSelOp||o&&n.lastSelOrigin==o&&(n.lastModTime==n.lastSelTime&&n.lastOrigin==o||Eo(r,o,X(n.done),t))){n.done[n.done.length-1]=t}else{To(t,n.done)}n.lastSelTime=+new Date;n.lastSelOrigin=o;n.lastSelOp=e;if(i&&i.clearRedo!==false){Lo(n.undone)}}function To(r,t){var e=X(t);if(!(e&&e.ranges&&e.equals(r))){t.push(r)}}function Io(r,t,e,i){var n=t["spans_"+r.id],o=0;r.iter(Math.max(r.first,e),Math.min(r.first+r.size,i),(function(e){if(e.markedSpans){(n||(n=t["spans_"+r.id]={}))[o]=e.markedSpans}++o}))}function Ro(r){if(!r){return null}var t;for(var e=0;e<r.length;++e){if(r[e].marker.explicitlyCleared){if(!t){t=r.slice(0,e)}}else if(t){t.push(r[e])}}return!t?r:t.length?t:null}function Oo(r,t){var e=t["spans_"+r.id];if(!e){return null}var i=[];for(var n=0;n<t.text.length;++n){i.push(Ro(e[n]))}return i}function Bo(r,t){var e=Oo(r,t);var i=Pt(r,t);if(!e){return i}if(!i){return e}for(var n=0;n<e.length;++n){var o=e[n],f=i[n];if(o&&f){r:for(var u=0;u<f.length;++u){var a=f[u];for(var l=0;l<o.length;++l){if(o[l].marker==a.marker){continue r}}o.push(a)}}else if(f){e[n]=f}}return e}function Uo(r,t,e){var i=[];for(var n=0;n<r.length;++n){var o=r[n];if(o.ranges){i.push(e?fo.prototype.deepCopy.call(o):o);continue}var f=o.changes,u=[];i.push({changes:u});for(var a=0;a<f.length;++a){var l=f[a],s=void 0;u.push({from:l.from,to:l.to,text:l.text});if(t){for(var c in l){if(s=c.match(/^spans_(\d+)$/)){if(_(t,Number(s[1]))>-1){X(u)[c]=l[c];delete l[c]}}}}}}return i}function zo(r,t,e,i){if(i){var n=r.anchor;if(e){var o=at(t,n)<0;if(o!=at(e,n)<0){n=t;t=e}else if(o!=at(t,e)<0){t=e}}return new uo(n,t)}else{return new uo(e||t,t)}}function jo(r,t,e,i,n){if(n==null){n=r.cm&&(r.cm.display.shift||r.extend)}Ho(r,new fo([zo(r.sel.primary(),t,e,n)],0),i)}function Wo(r,t,e){var i=[];var n=r.cm&&(r.cm.display.shift||r.extend);for(var o=0;o<r.sel.ranges.length;o++){i[o]=zo(r.sel.ranges[o],t[o],null,n)}var f=ao(r.cm,i,r.sel.primIndex);Ho(r,f,e)}function Fo(r,t,e,i){var n=r.sel.ranges.slice(0);n[t]=e;Ho(r,ao(r.cm,n,r.sel.primIndex),i)}function Po(r,t,e,i){Ho(r,lo(t,e),i)}function Go(r,t,e){var i={ranges:t.ranges,update:function(t){this.ranges=[];for(var e=0;e<t.length;e++){this.ranges[e]=new uo(dt(r,t[e].anchor),dt(r,t[e].head))}},origin:e&&e.origin};kr(r,"beforeSelectionChange",r,i);if(r.cm){kr(r.cm,"beforeSelectionChange",r.cm,i)}if(i.ranges!=t.ranges){return ao(r.cm,i.ranges,i.ranges.length-1)}else{return t}}function _o(r,t,e){var i=r.history.done,n=X(i);if(n&&n.ranges){i[i.length-1]=t;Vo(r,t,e)}else{Ho(r,t,e)}}function Ho(r,t,e){Vo(r,t,e);Do(r,r.sel,r.cm?r.cm.curOp.id:NaN,e)}function Vo(r,t,e){if(Ar(r,"beforeSelectionChange")||r.cm&&Ar(r.cm,"beforeSelectionChange")){t=Go(r,t,e)}var i=e&&e.bias||(at(t.primary().head,r.sel.primary().head)<0?-1:1);$o(r,Jo(r,t,i,true));if(!(e&&e.scroll===false)&&r.cm&&r.cm.getOption("readOnly")!="nocursor"){ln(r.cm)}}function $o(r,t){if(t.equals(r.sel)){return}r.sel=t;if(r.cm){r.cm.curOp.updateInput=1;r.cm.curOp.selectionChanged=true;Mr(r.cm)}De(r,"cursorActivity",r)}function Qo(r){$o(r,Jo(r,r.sel,null,false))}function Jo(r,t,e,i){var n;for(var o=0;o<t.ranges.length;o++){var f=t.ranges[o];var u=t.ranges.length==r.sel.ranges.length&&r.sel.ranges[o];var a=qo(r,f.anchor,u&&u.anchor,e,i);var l=f.head==f.anchor?a:qo(r,f.head,u&&u.head,e,i);if(n||a!=f.anchor||l!=f.head){if(!n){n=t.ranges.slice(0,o)}n[o]=new uo(a,l)}}return n?ao(r.cm,n,t.primIndex):t}function Ko(r,t,e,i,n){var o=Zr(r,t.line);if(o.markedSpans){for(var f=0;f<o.markedSpans.length;++f){var u=o.markedSpans[f],a=u.marker;var l="selectLeft"in a?!a.selectLeft:a.inclusiveLeft;var s="selectRight"in a?!a.selectRight:a.inclusiveRight;if((u.from==null||(l?u.from<=t.ch:u.from<t.ch))&&(u.to==null||(s?u.to>=t.ch:u.to>t.ch))){if(n){kr(a,"beforeCursorEnter");if(a.explicitlyCleared){if(!o.markedSpans){break}else{--f;continue}}}if(!a.atomic){continue}if(e){var c=a.find(i<0?1:-1),v=void 0;if(i<0?s:l){c=Yo(r,c,-i,c&&c.line==t.line?o:null)}if(c&&c.line==t.line&&(v=at(c,e))&&(i<0?v<0:v>0)){return Ko(r,c,t,i,n)}}var h=a.find(i<0?-1:1);if(i<0?l:s){h=Yo(r,h,i,h.line==t.line?o:null)}return h?Ko(r,h,t,i,n):null}}}return t}function qo(r,t,e,i,n){var o=i||1;var f=Ko(r,t,e,o,n)||!n&&Ko(r,t,e,o,true)||Ko(r,t,e,-o,n)||!n&&Ko(r,t,e,-o,true);if(!f){r.cantEdit=true;return ut(r.first,0)}return f}function Yo(r,t,e,i){if(e<0&&t.ch==0){if(t.line>r.first){return dt(r,ut(t.line-1))}else{return null}}else if(e>0&&t.ch==(i||Zr(r,t.line)).text.length){if(t.line<r.first+r.size-1){return ut(t.line+1,0)}else{return null}}else{return new ut(t.line,t.ch+e)}}function Xo(r){r.setSelection(ut(r.firstLine(),0),ut(r.lastLine()),$)}function Zo(r,t,e){var i={canceled:false,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return i.canceled=true}};if(e){i.update=function(t,e,n,o){if(t){i.from=dt(r,t)}if(e){i.to=dt(r,e)}if(n){i.text=n}if(o!==undefined){i.origin=o}}}kr(r,"beforeChange",r,i);if(r.cm){kr(r.cm,"beforeChange",r.cm,i)}if(i.canceled){if(r.cm){r.cm.curOp.updateInput=2}return null}return{from:i.from,to:i.to,text:i.text,origin:i.origin}}function rf(r,t,e){if(r.cm){if(!r.cm.curOp){return On(r.cm,rf)(r,t,e)}if(r.cm.state.suppressEdits){return}}if(Ar(r,"beforeChange")||r.cm&&Ar(r.cm,"beforeChange")){t=Zo(r,t,true);if(!t){return}}var i=Tt&&!e&&_t(r,t.from,t.to);if(i){for(var n=i.length-1;n>=0;--n){tf(r,{from:i[n].from,to:i[n].to,text:n?[""]:t.text,origin:t.origin})}}else{tf(r,t)}}function tf(r,t){if(t.text.length==1&&t.text[0]==""&&at(t.from,t.to)==0){return}var e=vo(r,t);No(r,t,e,r.cm?r.cm.curOp.id:NaN);of(r,t,e,Pt(r,t));var i=[];ko(r,(function(r,e){if(!e&&_(i,r.history)==-1){sf(r.history,t);i.push(r.history)}of(r,t,null,Pt(r,t))}))}function ef(r,t,e){var i=r.cm&&r.cm.state.suppressEdits;if(i&&!e){return}var n=r.history,o,f=r.sel;var u=t=="undo"?n.done:n.undone,a=t=="undo"?n.undone:n.done;var l=0;for(;l<u.length;l++){o=u[l];if(e?o.ranges&&!o.equals(r.sel):!o.ranges){break}}if(l==u.length){return}n.lastOrigin=n.lastSelOrigin=null;for(;;){o=u.pop();if(o.ranges){To(o,a);if(e&&!o.equals(r.sel)){Ho(r,o,{clearRedo:false});return}f=o}else if(i){u.push(o);return}else{break}}var s=[];To(f,a);a.push({changes:s,generation:n.generation});n.generation=o.generation||++n.maxGeneration;var c=Ar(r,"beforeChange")||r.cm&&Ar(r.cm,"beforeChange");var v=function(e){var i=o.changes[e];i.origin=t;if(c&&!Zo(r,i,false)){u.length=0;return{}}s.push(xo(r,i));var n=e?vo(r,i):X(u);of(r,i,n,Bo(r,i));if(!e&&r.cm){r.cm.scrollIntoView({from:i.from,to:so(i)})}var f=[];ko(r,(function(r,t){if(!t&&_(f,r.history)==-1){sf(r.history,i);f.push(r.history)}of(r,i,null,Bo(r,i))}))};for(var h=o.changes.length-1;h>=0;--h){var d=v(h);if(d)return d.v}}function nf(r,t){if(t==0){return}r.first+=t;r.sel=new fo(Z(r.sel.ranges,(function(r){return new uo(ut(r.anchor.line+t,r.anchor.ch),ut(r.head.line+t,r.head.ch))})),r.sel.primIndex);if(r.cm){ji(r.cm,r.first,r.first-t,t);for(var e=r.cm.display,i=e.viewFrom;i<e.viewTo;i++){Wi(r.cm,i,"gutter")}}}function of(r,t,e,i){if(r.cm&&!r.cm.curOp){return On(r.cm,of)(r,t,e,i)}if(t.to.line<r.first){nf(r,t.text.length-1-(t.to.line-t.from.line));return}if(t.from.line>r.lastLine()){return}if(t.from.line<r.first){var n=t.text.length-1-(r.first-t.from.line);nf(r,n);t={from:ut(r.first,0),to:ut(t.to.line+n,t.to.ch),text:[X(t.text)],origin:t.origin}}var o=r.lastLine();if(t.to.line>o){t={from:t.from,to:ut(o,Zr(r,o).text.length),text:[t.text[0]],origin:t.origin}}t.removed=rt(r,t.from,t.to);if(!e){e=vo(r,t)}if(r.cm){ff(r.cm,t,i)}else{wo(r,t,i)}Vo(r,e,$);if(r.cantEdit&&qo(r,ut(r.firstLine(),0))){r.cantEdit=false}}function ff(r,t,e){var i=r.doc,n=r.display,o=t.from,f=t.to;var u=false,a=o.line;if(!r.options.lineWrapping){a=it(re(Zr(i,o.line)));i.iter(a,f.line+1,(function(r){if(r==n.maxLine){u=true;return true}}))}if(i.sel.contains(t.from,t.to)>-1){Mr(r)}wo(i,t,e,Oi(r));if(!r.options.lineWrapping){i.iter(a,o.line+t.text.length,(function(r){var t=ae(r);if(t>n.maxLineLength){n.maxLine=r;n.maxLineLength=t;n.maxLineChanged=true;u=false}}));if(u){r.curOp.updateMaxLine=true}}Dt(i,o.line);zn(r,400);var l=t.text.length-(f.line-o.line)-1;if(t.full){ji(r)}else if(o.line==f.line&&t.text.length==1&&!bo(r.doc,t)){Wi(r,o.line,"text")}else{ji(r,o.line,f.line+1,l)}var s=Ar(r,"changes"),c=Ar(r,"change");if(c||s){var v={from:o,to:f,text:t.text,removed:t.removed,origin:t.origin};if(c){De(r,"change",r,v)}if(s){(r.curOp.changeObjs||(r.curOp.changeObjs=[])).push(v)}}r.display.selForContextMenu=null}function uf(r,t,e,i,n){var o;if(!i){i=e}if(at(i,e)<0){o=[i,e],e=o[0],i=o[1]}if(typeof t=="string"){t=r.splitLines(t)}rf(r,{from:e,to:i,text:t,origin:n})}function af(r,t,e,i){if(e<r.line){r.line+=i}else if(t<r.line){r.line=t;r.ch=0}}function lf(r,t,e,i){for(var n=0;n<r.length;++n){var o=r[n],f=true;if(o.ranges){if(!o.copied){o=r[n]=o.deepCopy();o.copied=true}for(var u=0;u<o.ranges.length;u++){af(o.ranges[u].anchor,t,e,i);af(o.ranges[u].head,t,e,i)}continue}for(var a=0;a<o.changes.length;++a){var l=o.changes[a];if(e<l.from.line){l.from=ut(l.from.line+i,l.from.ch);l.to=ut(l.to.line+i,l.to.ch)}else if(t<=l.to.line){f=false;break}}if(!f){r.splice(0,n+1);n=0}}}function sf(r,t){var e=t.from.line,i=t.to.line,n=t.text.length-(i-e)-1;lf(r.done,e,i,n);lf(r.undone,e,i,n)}function cf(r,t,e,i){var n=t,o=t;if(typeof t=="number"){o=Zr(r,ht(r,t))}else{n=it(t)}if(n==null){return null}if(i(o,n)&&r.cm){Wi(r.cm,n,e)}return o}function vf(r){this.lines=r;this.parent=null;var t=0;for(var e=0;e<r.length;++e){r[e].parent=this;t+=r[e].height}this.height=t}vf.prototype={chunkSize:function(){return this.lines.length},removeInner:function(r,t){for(var e=r,i=r+t;e<i;++e){var n=this.lines[e];this.height-=n.height;ve(n);De(n,"delete")}this.lines.splice(r,t)},collapse:function(r){r.push.apply(r,this.lines)},insertInner:function(r,t,e){this.height+=e;this.lines=this.lines.slice(0,r).concat(t).concat(this.lines.slice(r));for(var i=0;i<t.length;++i){t[i].parent=this}},iterN:function(r,t,e){for(var i=r+t;r<i;++r){if(e(this.lines[r])){return true}}}};function hf(r){this.children=r;var t=0,e=0;for(var i=0;i<r.length;++i){var n=r[i];t+=n.chunkSize();e+=n.height;n.parent=this}this.size=t;this.height=e;this.parent=null}hf.prototype={chunkSize:function(){return this.size},removeInner:function(r,t){this.size-=t;for(var e=0;e<this.children.length;++e){var i=this.children[e],n=i.chunkSize();if(r<n){var o=Math.min(t,n-r),f=i.height;i.removeInner(r,o);this.height-=f-i.height;if(n==o){this.children.splice(e--,1);i.parent=null}if((t-=o)==0){break}r=0}else{r-=n}}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof vf))){var u=[];this.collapse(u);this.children=[new vf(u)];this.children[0].parent=this}},collapse:function(r){for(var t=0;t<this.children.length;++t){this.children[t].collapse(r)}},insertInner:function(r,t,e){this.size+=t.length;this.height+=e;for(var i=0;i<this.children.length;++i){var n=this.children[i],o=n.chunkSize();if(r<=o){n.insertInner(r,t,e);if(n.lines&&n.lines.length>50){var f=n.lines.length%25+25;for(var u=f;u<n.lines.length;){var a=new vf(n.lines.slice(u,u+=25));n.height-=a.height;this.children.splice(++i,0,a);a.parent=this}n.lines=n.lines.slice(0,f);this.maybeSpill()}break}r-=o}},maybeSpill:function(){if(this.children.length<=10){return}var r=this;do{var t=r.children.splice(r.children.length-5,5);var e=new hf(t);if(!r.parent){var i=new hf(r.children);i.parent=r;r.children=[i,e];r=i}else{r.size-=e.size;r.height-=e.height;var n=_(r.parent.children,r);r.parent.children.splice(n+1,0,e)}e.parent=r.parent}while(r.children.length>10);r.parent.maybeSpill()},iterN:function(r,t,e){for(var i=0;i<this.children.length;++i){var n=this.children[i],o=n.chunkSize();if(r<o){var f=Math.min(t,o-r);if(n.iterN(r,f,e)){return true}if((t-=f)==0){break}r=0}else{r-=o}}}};var df=function(r,t,e){if(e){for(var i in e){if(e.hasOwnProperty(i)){this[i]=e[i]}}}this.doc=r;this.node=t};df.prototype.clear=function(){var r=this.doc.cm,t=this.line.widgets,e=this.line,i=it(e);if(i==null||!t){return}for(var n=0;n<t.length;++n){if(t[n]==this){t.splice(n--,1)}}if(!t.length){e.widgets=null}var o=He(this);et(e,Math.max(0,e.height-o));if(r){Rn(r,(function(){mf(r,e,-o);Wi(r,i,"widget")}));De(r,"lineWidgetCleared",r,this,i)}};df.prototype.changed=function(){var r=this;var t=this.height,e=this.doc.cm,i=this.line;this.height=null;var n=He(this)-t;if(!n){return}if(!oe(this.doc,i)){et(i,i.height+n)}if(e){Rn(e,(function(){e.curOp.forceUpdate=true;mf(e,i,n);De(e,"lineWidgetChanged",e,r,it(i))}))}};yr(df);function mf(r,t,e){if(ue(t)<(r.curOp&&r.curOp.scrollTop||r.doc.scrollTop)){an(r,e)}}function pf(r,t,e,i){var n=new df(r,e,i);var o=r.cm;if(o&&n.noHScroll){o.display.alignWidgets=true}cf(r,t,"widget",(function(t){var e=t.widgets||(t.widgets=[]);if(n.insertAt==null){e.push(n)}else{e.splice(Math.min(e.length,Math.max(0,n.insertAt)),0,n)}n.line=t;if(o&&!oe(r,t)){var i=ue(t)<r.scrollTop;et(t,t.height+He(n));if(i){an(o,n.height)}o.curOp.forceUpdate=true}return true}));if(o){De(o,"lineWidgetAdded",o,n,typeof t=="number"?t:it(t))}return n}var gf=0;var bf=function(r,t){this.lines=[];this.type=t;this.doc=r;this.id=++gf};bf.prototype.clear=function(){if(this.explicitlyCleared){return}var r=this.doc.cm,t=r&&!r.curOp;if(t){xn(r)}if(Ar(this,"clear")){var e=this.find();if(e){De(this,"clear",e.from,e.to)}}var i=null,n=null;for(var o=0;o<this.lines.length;++o){var f=this.lines[o];var u=Ut(f.markedSpans,this);if(r&&!this.collapsed){Wi(r,it(f),"text")}else if(r){if(u.to!=null){n=it(f)}if(u.from!=null){i=it(f)}}f.markedSpans=zt(f.markedSpans,u);if(u.from==null&&this.collapsed&&!oe(this.doc,f)&&r){et(f,Di(r.display))}}if(r&&this.collapsed&&!r.options.lineWrapping){for(var a=0;a<this.lines.length;++a){var l=re(this.lines[a]),s=ae(l);if(s>r.display.maxLineLength){r.display.maxLine=l;r.display.maxLineLength=s;r.display.maxLineChanged=true}}}if(i!=null&&r&&this.collapsed){ji(r,i,n+1)}this.lines.length=0;this.explicitlyCleared=true;if(this.atomic&&this.doc.cantEdit){this.doc.cantEdit=false;if(r){Qo(r.doc)}}if(r){De(r,"markerCleared",r,this,i,n)}if(t){Ln(r)}if(this.parent){this.parent.clear()}};bf.prototype.find=function(r,t){if(r==null&&this.type=="bookmark"){r=1}var e,i;for(var n=0;n<this.lines.length;++n){var o=this.lines[n];var f=Ut(o.markedSpans,this);if(f.from!=null){e=ut(t?o:it(o),f.from);if(r==-1){return e}}if(f.to!=null){i=ut(t?o:it(o),f.to);if(r==1){return i}}}return e&&{from:e,to:i}};bf.prototype.changed=function(){var r=this;var t=this.find(-1,true),e=this,i=this.doc.cm;if(!t||!i){return}Rn(i,(function(){var n=t.line,o=it(t.line);var f=ei(i,o);if(f){si(f);i.curOp.selectionChanged=i.curOp.forceUpdate=true}i.curOp.updateMaxLine=true;if(!oe(e.doc,n)&&e.height!=null){var u=e.height;e.height=null;var a=He(e)-u;if(a){et(n,n.height+a)}}De(i,"markerChanged",i,r)}))};bf.prototype.attachLine=function(r){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;if(!t.maybeHiddenMarkers||_(t.maybeHiddenMarkers,this)==-1){(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}}this.lines.push(r)};bf.prototype.detachLine=function(r){this.lines.splice(_(this.lines,r),1);if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}};yr(bf);function wf(r,t,e,i,n){if(i&&i.shared){return Cf(r,t,e,i,n)}if(r.cm&&!r.cm.curOp){return On(r.cm,wf)(r,t,e,i,n)}var o=new bf(r,n),f=at(t,e);if(i){F(i,o,false)}if(f>0||f==0&&o.clearWhenEmpty!==false){return o}if(o.replacedWith){o.collapsed=true;o.widgetNode=D("span",[o.replacedWith],"CodeMirror-widget");if(!i.handleMouseEvents){o.widgetNode.setAttribute("cm-ignore-events","true")}if(i.insertLeft){o.widgetNode.insertLeft=true}}if(o.collapsed){if(Zt(r,t.line,t,e,o)||t.line!=e.line&&Zt(r,e.line,t,e,o)){throw new Error("Inserting collapsed marker partially overlapping an existing one")}Ot()}if(o.addToHistory){No(r,{from:t,to:e,origin:"markText"},r.sel,NaN)}var u=t.line,a=r.cm,l;r.iter(u,e.line+1,(function(i){if(a&&o.collapsed&&!a.options.lineWrapping&&re(i)==a.display.maxLine){l=true}if(o.collapsed&&u!=t.line){et(i,0)}jt(i,new Bt(o,u==t.line?t.ch:null,u==e.line?e.ch:null),r.cm&&r.cm.curOp);++u}));if(o.collapsed){r.iter(t.line,e.line+1,(function(t){if(oe(r,t)){et(t,0)}}))}if(o.clearOnEnter){gr(o,"beforeCursorEnter",(function(){return o.clear()}))}if(o.readOnly){Rt();if(r.history.done.length||r.history.undone.length){r.clearHistory()}}if(o.collapsed){o.id=++gf;o.atomic=true}if(a){if(l){a.curOp.updateMaxLine=true}if(o.collapsed){ji(a,t.line,e.line+1)}else if(o.className||o.startStyle||o.endStyle||o.css||o.attributes||o.title){for(var s=t.line;s<=e.line;s++){Wi(a,s,"text")}}if(o.atomic){Qo(a.doc)}De(a,"markerAdded",a,o)}return o}var kf=function(r,t){this.markers=r;this.primary=t;for(var e=0;e<r.length;++e){r[e].parent=this}};kf.prototype.clear=function(){if(this.explicitlyCleared){return}this.explicitlyCleared=true;for(var r=0;r<this.markers.length;++r){this.markers[r].clear()}De(this,"clear")};kf.prototype.find=function(r,t){return this.primary.find(r,t)};yr(kf);function Cf(r,t,e,i,n){i=F(i);i.shared=false;var o=[wf(r,t,e,i,n)],f=o[0];var u=i.widgetNode;ko(r,(function(r){if(u){i.widgetNode=u.cloneNode(true)}o.push(wf(r,dt(r,t),dt(r,e),i,n));for(var a=0;a<r.linked.length;++a){if(r.linked[a].isParent){return}}f=X(o)}));return new kf(o,f)}function Mf(r){return r.findMarks(ut(r.first,0),r.clipPos(ut(r.lastLine())),(function(r){return r.parent}))}function Af(r,t){for(var e=0;e<t.length;e++){var i=t[e],n=i.find();var o=r.clipPos(n.from),f=r.clipPos(n.to);if(at(o,f)){var u=wf(r,o,f,i.primary,i.primary.type);i.markers.push(u);u.parent=i}}}function yf(r){var t=function(t){var e=r[t],i=[e.primary.doc];ko(e.primary.doc,(function(r){return i.push(r)}));for(var n=0;n<e.markers.length;n++){var o=e.markers[n];if(_(i,o.doc)==-1){o.parent=null;e.markers.splice(n--,1)}}};for(var e=0;e<r.length;e++)t(e)}var xf=0;var Lf=function(r,t,e,i,n){if(!(this instanceof Lf)){return new Lf(r,t,e,i,n)}if(e==null){e=0}hf.call(this,[new vf([new se("",null)])]);this.first=e;this.scrollTop=this.scrollLeft=0;this.cantEdit=false;this.cleanGeneration=1;this.modeFrontier=this.highlightFrontier=e;var o=ut(e,0);this.sel=lo(o);this.history=new yo(null);this.id=++xf;this.modeOption=t;this.lineSep=i;this.direction=n=="rtl"?"rtl":"ltr";this.extend=false;if(typeof r=="string"){r=this.splitLines(r)}wo(this,{from:o,to:o,text:r});Ho(this,lo(o),$)};Lf.prototype=er(hf.prototype,{constructor:Lf,iter:function(r,t,e){if(e){this.iterN(r-this.first,t-r,e)}else{this.iterN(this.first,this.first+this.size,r)}},insert:function(r,t){var e=0;for(var i=0;i<t.length;++i){e+=t[i].height}this.insertInner(r-this.first,t,e)},remove:function(r,t){this.removeInner(r-this.first,t)},getValue:function(r){var t=tt(this,this.first,this.first+this.size);if(r===false){return t}return t.join(r||this.lineSeparator())},setValue:Un((function(r){var t=ut(this.first,0),e=this.first+this.size-1;rf(this,{from:t,to:ut(e,Zr(this,e).text.length),text:this.splitLines(r),origin:"setValue",full:true},true);if(this.cm){sn(this.cm,0,0)}Ho(this,lo(t),$)})),replaceRange:function(r,t,e,i){t=dt(this,t);e=e?dt(this,e):t;uf(this,r,t,e,i)},getRange:function(r,t,e){var i=rt(this,dt(this,r),dt(this,t));if(e===false){return i}if(e===""){return i.join("")}return i.join(e||this.lineSeparator())},getLine:function(r){var t=this.getLineHandle(r);return t&&t.text},getLineHandle:function(r){if(ot(this,r)){return Zr(this,r)}},getLineNumber:function(r){return it(r)},getLineHandleVisualStart:function(r){if(typeof r=="number"){r=Zr(this,r)}return re(r)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(r){return dt(this,r)},getCursor:function(r){var t=this.sel.primary(),e;if(r==null||r=="head"){e=t.head}else if(r=="anchor"){e=t.anchor}else if(r=="end"||r=="to"||r===false){e=t.to()}else{e=t.from()}return e},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:Un((function(r,t,e){Po(this,dt(this,typeof r=="number"?ut(r,t||0):r),null,e)})),setSelection:Un((function(r,t,e){Po(this,dt(this,r),dt(this,t||r),e)})),extendSelection:Un((function(r,t,e){jo(this,dt(this,r),t&&dt(this,t),e)})),extendSelections:Un((function(r,t){Wo(this,pt(this,r),t)})),extendSelectionsBy:Un((function(r,t){var e=Z(this.sel.ranges,r);Wo(this,pt(this,e),t)})),setSelections:Un((function(r,t,e){if(!r.length){return}var i=[];for(var n=0;n<r.length;n++){i[n]=new uo(dt(this,r[n].anchor),dt(this,r[n].head||r[n].anchor))}if(t==null){t=Math.min(r.length-1,this.sel.primIndex)}Ho(this,ao(this.cm,i,t),e)})),addSelection:Un((function(r,t,e){var i=this.sel.ranges.slice(0);i.push(new uo(dt(this,r),dt(this,t||r)));Ho(this,ao(this.cm,i,i.length-1),e)})),getSelection:function(r){var t=this.sel.ranges,e;for(var i=0;i<t.length;i++){var n=rt(this,t[i].from(),t[i].to());e=e?e.concat(n):n}if(r===false){return e}else{return e.join(r||this.lineSeparator())}},getSelections:function(r){var t=[],e=this.sel.ranges;for(var i=0;i<e.length;i++){var n=rt(this,e[i].from(),e[i].to());if(r!==false){n=n.join(r||this.lineSeparator())}t[i]=n}return t},replaceSelection:function(r,t,e){var i=[];for(var n=0;n<this.sel.ranges.length;n++){i[n]=r}this.replaceSelections(i,t,e||"+input")},replaceSelections:Un((function(r,t,e){var i=[],n=this.sel;for(var o=0;o<n.ranges.length;o++){var f=n.ranges[o];i[o]={from:f.from(),to:f.to(),text:this.splitLines(r[o]),origin:e}}var u=t&&t!="end"&&mo(this,i,t);for(var a=i.length-1;a>=0;a--){rf(this,i[a])}if(u){_o(this,u)}else if(this.cm){ln(this.cm)}})),undo:Un((function(){ef(this,"undo")})),redo:Un((function(){ef(this,"redo")})),undoSelection:Un((function(){ef(this,"undo",true)})),redoSelection:Un((function(){ef(this,"redo",true)})),setExtending:function(r){this.extend=r},getExtending:function(){return this.extend},historySize:function(){var r=this.history,t=0,e=0;for(var i=0;i<r.done.length;i++){if(!r.done[i].ranges){++t}}for(var n=0;n<r.undone.length;n++){if(!r.undone[n].ranges){++e}}return{undo:t,redo:e}},clearHistory:function(){var r=this;this.history=new yo(this.history);ko(this,(function(t){return t.history=r.history}),true)},markClean:function(){this.cleanGeneration=this.changeGeneration(true)},changeGeneration:function(r){if(r){this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null}return this.history.generation},isClean:function(r){return this.history.generation==(r||this.cleanGeneration)},getHistory:function(){return{done:Uo(this.history.done),undone:Uo(this.history.undone)}},setHistory:function(r){var t=this.history=new yo(this.history);t.done=Uo(r.done.slice(0),null,true);t.undone=Uo(r.undone.slice(0),null,true)},setGutterMarker:Un((function(r,t,e){return cf(this,r,"gutter",(function(r){var i=r.gutterMarkers||(r.gutterMarkers={});i[t]=e;if(!e&&fr(i)){r.gutterMarkers=null}return true}))})),clearGutter:Un((function(r){var t=this;this.iter((function(e){if(e.gutterMarkers&&e.gutterMarkers[r]){cf(t,e,"gutter",(function(){e.gutterMarkers[r]=null;if(fr(e.gutterMarkers)){e.gutterMarkers=null}return true}))}}))})),lineInfo:function(r){var t;if(typeof r=="number"){if(!ot(this,r)){return null}t=r;r=Zr(this,r);if(!r){return null}}else{t=it(r);if(t==null){return null}}return{line:t,handle:r,text:r.text,gutterMarkers:r.gutterMarkers,textClass:r.textClass,bgClass:r.bgClass,wrapClass:r.wrapClass,widgets:r.widgets}},addLineClass:Un((function(r,t,e){return cf(this,r,t=="gutter"?"gutter":"class",(function(r){var i=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!r[i]){r[i]=e}else if(x(e).test(r[i])){return false}else{r[i]+=" "+e}return true}))})),removeLineClass:Un((function(r,t,e){return cf(this,r,t=="gutter"?"gutter":"class",(function(r){var i=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";var n=r[i];if(!n){return false}else if(e==null){r[i]=null}else{var o=n.match(x(e));if(!o){return false}var f=o.index+o[0].length;r[i]=n.slice(0,o.index)+(!o.index||f==n.length?"":" ")+n.slice(f)||null}return true}))})),addLineWidget:Un((function(r,t,e){return pf(this,r,t,e)})),removeLineWidget:function(r){r.clear()},markText:function(r,t,e){return wf(this,dt(this,r),dt(this,t),e,e&&e.type||"range")},setBookmark:function(r,t){var e={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:false,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};r=dt(this,r);return wf(this,r,r,e,"bookmark")},findMarksAt:function(r){r=dt(this,r);var t=[],e=Zr(this,r.line).markedSpans;if(e){for(var i=0;i<e.length;++i){var n=e[i];if((n.from==null||n.from<=r.ch)&&(n.to==null||n.to>=r.ch)){t.push(n.marker.parent||n.marker)}}}return t},findMarks:function(r,t,e){r=dt(this,r);t=dt(this,t);var i=[],n=r.line;this.iter(r.line,t.line+1,(function(o){var f=o.markedSpans;if(f){for(var u=0;u<f.length;u++){var a=f[u];if(!(a.to!=null&&n==r.line&&r.ch>=a.to||a.from==null&&n!=r.line||a.from!=null&&n==t.line&&a.from>=t.ch)&&(!e||e(a.marker))){i.push(a.marker.parent||a.marker)}}}++n}));return i},getAllMarks:function(){var r=[];this.iter((function(t){var e=t.markedSpans;if(e){for(var i=0;i<e.length;++i){if(e[i].from!=null){r.push(e[i].marker)}}}}));return r},posFromIndex:function(r){var t,e=this.first,i=this.lineSeparator().length;this.iter((function(n){var o=n.text.length+i;if(o>r){t=r;return true}r-=o;++e}));return dt(this,ut(e,t))},indexFromPos:function(r){r=dt(this,r);var t=r.ch;if(r.line<this.first||r.ch<0){return 0}var e=this.lineSeparator().length;this.iter(this.first,r.line,(function(r){t+=r.text.length+e}));return t},copy:function(r){var t=new Lf(tt(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);t.scrollTop=this.scrollTop;t.scrollLeft=this.scrollLeft;t.sel=this.sel;t.extend=false;if(r){t.history.undoDepth=this.history.undoDepth;t.setHistory(this.getHistory())}return t},linkedDoc:function(r){if(!r){r={}}var t=this.first,e=this.first+this.size;if(r.from!=null&&r.from>t){t=r.from}if(r.to!=null&&r.to<e){e=r.to}var i=new Lf(tt(this,t,e),r.mode||this.modeOption,t,this.lineSep,this.direction);if(r.sharedHist){i.history=this.history}(this.linked||(this.linked=[])).push({doc:i,sharedHist:r.sharedHist});i.linked=[{doc:this,isParent:true,sharedHist:r.sharedHist}];Af(i,Mf(this));return i},unlinkDoc:function(r){if(r instanceof Fu){r=r.doc}if(this.linked){for(var t=0;t<this.linked.length;++t){var e=this.linked[t];if(e.doc!=r){continue}this.linked.splice(t,1);r.unlinkDoc(this);yf(Mf(this));break}}if(r.history==this.history){var i=[r.id];ko(r,(function(r){return i.push(r.id)}),true);r.history=new yo(null);r.history.done=Uo(this.history.done,i);r.history.undone=Uo(this.history.undone,i)}},iterLinkedDocs:function(r){ko(this,r)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(r){if(this.lineSep){return r.split(this.lineSep)}return Ur(r)},lineSeparator:function(){return this.lineSep||"\n"},setDirection:Un((function(r){if(r!="rtl"){r="ltr"}if(r==this.direction){return}this.direction=r;this.iter((function(r){return r.order=null}));if(this.cm){Ao(this.cm)}}))});Lf.prototype.eachLine=Lf.prototype.iter;var Sf=0;function Nf(r){var t=this;Tf(t);if(Cr(t,r)||Ve(t.display,r)){return}xr(r);if(f){Sf=+new Date}var e=Ui(t,r,true),i=r.dataTransfer.files;if(!e||t.isReadOnly()){return}if(i&&i.length&&window.FileReader&&window.File){var n=i.length,o=Array(n),u=0;var a=function(){if(++u==n){On(t,(function(){e=dt(t.doc,e);var r={from:e,to:e,text:t.doc.splitLines(o.filter((function(r){return r!=null})).join(t.doc.lineSeparator())),origin:"paste"};rf(t.doc,r);_o(t.doc,lo(dt(t.doc,e),dt(t.doc,so(r))))}))()}};var l=function(r,e){if(t.options.allowDropFileTypes&&_(t.options.allowDropFileTypes,r.type)==-1){a();return}var i=new FileReader;i.onerror=function(){return a()};i.onload=function(){var r=i.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(r)){a();return}o[e]=r;a()};i.readAsText(r)};for(var s=0;s<i.length;s++){l(i[s],s)}}else{if(t.state.draggingText&&t.doc.sel.contains(e)>-1){t.state.draggingText(r);setTimeout((function(){return t.display.input.focus()}),20);return}try{var c=r.dataTransfer.getData("Text");if(c){var v;if(t.state.draggingText&&!t.state.draggingText.copy){v=t.listSelections()}Vo(t.doc,lo(e,e));if(v){for(var h=0;h<v.length;++h){uf(t.doc,"",v[h].anchor,v[h].head,"drag")}}t.replaceSelection(c,"around","paste");t.display.input.focus()}}catch(r){}}}function Ef(r,t){if(f&&(!r.state.draggingText||+new Date-Sf<100)){Nr(t);return}if(Cr(r,t)||Ve(r.display,t)){return}t.dataTransfer.setData("Text",r.getSelection());t.dataTransfer.effectAllowed="copyMove";if(t.dataTransfer.setDragImage&&!h){var e=E("img",null,null,"position: fixed; left: 0; top: 0;");e.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==";if(v){e.width=e.height=1;r.display.wrapper.appendChild(e);e._top=e.offsetTop}t.dataTransfer.setDragImage(e,0,0);if(v){e.parentNode.removeChild(e)}}}function Df(r,t){var e=Ui(r,t);if(!e){return}var i=document.createDocumentFragment();$i(r,e,i);if(!r.display.dragCursor){r.display.dragCursor=E("div",null,"CodeMirror-cursors CodeMirror-dragcursors");r.display.lineSpace.insertBefore(r.display.dragCursor,r.display.cursorDiv)}N(r.display.dragCursor,i)}function Tf(r){if(r.display.dragCursor){r.display.lineSpace.removeChild(r.display.dragCursor);r.display.dragCursor=null}}function If(r){if(!document.getElementsByClassName){return}var t=document.getElementsByClassName("CodeMirror"),e=[];for(var i=0;i<t.length;i++){var n=t[i].CodeMirror;if(n){e.push(n)}}if(e.length){e[0].operation((function(){for(var t=0;t<e.length;t++){r(e[t])}}))}}var Rf=false;function Of(){if(Rf){return}Bf();Rf=true}function Bf(){var r;gr(window,"resize",(function(){if(r==null){r=setTimeout((function(){r=null;If(Uf)}),100)}}));gr(window,"blur",(function(){return If(Zi)}))}function Uf(r){var t=r.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null;t.scrollbarsClipped=false;r.setSize()}var zf={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Mod",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"};for(var jf=0;jf<10;jf++){zf[jf+48]=zf[jf+96]=String(jf)}for(var Wf=65;Wf<=90;Wf++){zf[Wf]=String.fromCharCode(Wf)}for(var Ff=1;Ff<=12;Ff++){zf[Ff+111]=zf[Ff+63235]="F"+Ff}var Pf={};Pf.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"};Pf.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"};Pf.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"};Pf.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]};Pf["default"]=w?Pf.macDefault:Pf.pcDefault;function Gf(r){var t=r.split(/-(?!$)/);r=t[t.length-1];var e,i,n,o;for(var f=0;f<t.length-1;f++){var u=t[f];if(/^(cmd|meta|m)$/i.test(u)){o=true}else if(/^a(lt)?$/i.test(u)){e=true}else if(/^(c|ctrl|control)$/i.test(u)){i=true}else if(/^s(hift)?$/i.test(u)){n=true}else{throw new Error("Unrecognized modifier name: "+u)}}if(e){r="Alt-"+r}if(i){r="Ctrl-"+r}if(o){r="Cmd-"+r}if(n){r="Shift-"+r}return r}function _f(r){var t={};for(var e in r){if(r.hasOwnProperty(e)){var i=r[e];if(/^(name|fallthrough|(de|at)tach)$/.test(e)){continue}if(i=="..."){delete r[e];continue}var n=Z(e.split(" "),Gf);for(var o=0;o<n.length;o++){var f=void 0,u=void 0;if(o==n.length-1){u=n.join(" ");f=i}else{u=n.slice(0,o+1).join(" ");f="..."}var a=t[u];if(!a){t[u]=f}else if(a!=f){throw new Error("Inconsistent bindings for "+u)}}delete r[e]}}for(var l in t){r[l]=t[l]}return r}function Hf(r,t,e,i){t=Jf(t);var n=t.call?t.call(r,i):t[r];if(n===false){return"nothing"}if(n==="..."){return"multi"}if(n!=null&&e(n)){return"handled"}if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!="[object Array]"){return Hf(r,t.fallthrough,e,i)}for(var o=0;o<t.fallthrough.length;o++){var f=Hf(r,t.fallthrough[o],e,i);if(f){return f}}}}function Vf(r){var t=typeof r=="string"?r:zf[r.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function $f(r,t,e){var i=r;if(t.altKey&&i!="Alt"){r="Alt-"+r}if((A?t.metaKey:t.ctrlKey)&&i!="Ctrl"){r="Ctrl-"+r}if((A?t.ctrlKey:t.metaKey)&&i!="Mod"){r="Cmd-"+r}if(!e&&t.shiftKey&&i!="Shift"){r="Shift-"+r}return r}function Qf(r,t){if(v&&r.keyCode==34&&r["char"]){return false}var e=zf[r.keyCode];if(e==null||r.altGraphKey){return false}if(r.keyCode==3&&r.code){e=r.code}return $f(e,r,t)}function Jf(r){return typeof r=="string"?Pf[r]:r}function Kf(r,t){var e=r.doc.sel.ranges,i=[];for(var n=0;n<e.length;n++){var o=t(e[n]);while(i.length&&at(o.from,X(i).to)<=0){var f=i.pop();if(at(f.from,o.from)<0){o.from=f.from;break}}i.push(o)}Rn(r,(function(){for(var t=i.length-1;t>=0;t--){uf(r.doc,"",i[t].from,i[t].to,"+delete")}ln(r)}))}function qf(r,t,e){var i=lr(r.text,t+e,e);return i<0||i>r.text.length?null:i}function Yf(r,t,e){var i=qf(r,t.ch,e);return i==null?null:new ut(t.line,i,e<0?"after":"before")}function Xf(r,t,e,i,n){if(r){if(t.doc.direction=="rtl"){n=-n}var o=mr(e,t.doc.direction);if(o){var f=n<0?X(o):o[0];var u=n<0==(f.level==1);var a=u?"after":"before";var l;if(f.level>0||t.doc.direction=="rtl"){var s=ii(t,e);l=n<0?e.text.length-1:0;var c=ni(t,s,l).top;l=sr((function(r){return ni(t,s,r).top==c}),n<0==(f.level==1)?f.from:f.to-1,l);if(a=="before"){l=qf(e,l,1)}}else{l=n<0?f.to:f.from}return new ut(i,l,a)}}return new ut(i,n<0?e.text.length:0,n<0?"before":"after")}function Zf(r,t,e,i){var n=mr(t,r.doc.direction);if(!n){return Yf(t,e,i)}if(e.ch>=t.text.length){e.ch=t.text.length;e.sticky="before"}else if(e.ch<=0){e.ch=0;e.sticky="after"}var o=hr(n,e.ch,e.sticky),f=n[o];if(r.doc.direction=="ltr"&&f.level%2==0&&(i>0?f.to>e.ch:f.from<e.ch)){return Yf(t,e,i)}var u=function(r,e){return qf(t,r instanceof ut?r.ch:r,e)};var a;var l=function(e){if(!r.options.lineWrapping){return{begin:0,end:t.text.length}}a=a||ii(r,t);return yi(r,t,a,e)};var s=l(e.sticky=="before"?u(e,-1):e.ch);if(r.doc.direction=="rtl"||f.level==1){var c=f.level==1==i<0;var v=u(e,c?1:-1);if(v!=null&&(!c?v>=f.from&&v>=s.begin:v<=f.to&&v<=s.end)){var h=c?"before":"after";return new ut(e.line,v,h)}}var d=function(r,t,i){var o=function(r,t){return t?new ut(e.line,u(r,1),"before"):new ut(e.line,r,"after")};for(;r>=0&&r<n.length;r+=t){var f=n[r];var a=t>0==(f.level!=1);var l=a?i.begin:u(i.end,-1);if(f.from<=l&&l<f.to){return o(l,a)}l=a?f.from:u(f.to,-1);if(i.begin<=l&&l<i.end){return o(l,a)}}};var m=d(o+i,i,s);if(m){return m}var p=i>0?s.end:u(s.begin,-1);if(p!=null&&!(i>0&&p==t.text.length)){m=d(i>0?0:n.length-1,i,l(p));if(m){return m}}return null}var ru={selectAll:Xo,singleSelection:function(r){return r.setSelection(r.getCursor("anchor"),r.getCursor("head"),$)},killLine:function(r){return Kf(r,(function(t){if(t.empty()){var e=Zr(r.doc,t.head.line).text.length;if(t.head.ch==e&&t.head.line<r.lastLine()){return{from:t.head,to:ut(t.head.line+1,0)}}else{return{from:t.head,to:ut(t.head.line,e)}}}else{return{from:t.from(),to:t.to()}}}))},deleteLine:function(r){return Kf(r,(function(t){return{from:ut(t.from().line,0),to:dt(r.doc,ut(t.to().line+1,0))}}))},delLineLeft:function(r){return Kf(r,(function(r){return{from:ut(r.from().line,0),to:r.from()}}))},delWrappedLineLeft:function(r){return Kf(r,(function(t){var e=r.charCoords(t.head,"div").top+5;var i=r.coordsChar({left:0,top:e},"div");return{from:i,to:t.from()}}))},delWrappedLineRight:function(r){return Kf(r,(function(t){var e=r.charCoords(t.head,"div").top+5;var i=r.coordsChar({left:r.display.lineDiv.offsetWidth+100,top:e},"div");return{from:t.from(),to:i}}))},undo:function(r){return r.undo()},redo:function(r){return r.redo()},undoSelection:function(r){return r.undoSelection()},redoSelection:function(r){return r.redoSelection()},goDocStart:function(r){return r.extendSelection(ut(r.firstLine(),0))},goDocEnd:function(r){return r.extendSelection(ut(r.lastLine()))},goLineStart:function(r){return r.extendSelectionsBy((function(t){return tu(r,t.head.line)}),{origin:"+move",bias:1})},goLineStartSmart:function(r){return r.extendSelectionsBy((function(t){return iu(r,t.head)}),{origin:"+move",bias:1})},goLineEnd:function(r){return r.extendSelectionsBy((function(t){return eu(r,t.head.line)}),{origin:"+move",bias:-1})},goLineRight:function(r){return r.extendSelectionsBy((function(t){var e=r.cursorCoords(t.head,"div").top+5;return r.coordsChar({left:r.display.lineDiv.offsetWidth+100,top:e},"div")}),J)},goLineLeft:function(r){return r.extendSelectionsBy((function(t){var e=r.cursorCoords(t.head,"div").top+5;return r.coordsChar({left:0,top:e},"div")}),J)},goLineLeftSmart:function(r){return r.extendSelectionsBy((function(t){var e=r.cursorCoords(t.head,"div").top+5;var i=r.coordsChar({left:0,top:e},"div");if(i.ch<r.getLine(i.line).search(/\S/)){return iu(r,t.head)}return i}),J)},goLineUp:function(r){return r.moveV(-1,"line")},goLineDown:function(r){return r.moveV(1,"line")},goPageUp:function(r){return r.moveV(-1,"page")},goPageDown:function(r){return r.moveV(1,"page")},goCharLeft:function(r){return r.moveH(-1,"char")},goCharRight:function(r){return r.moveH(1,"char")},goColumnLeft:function(r){return r.moveH(-1,"column")},goColumnRight:function(r){return r.moveH(1,"column")},goWordLeft:function(r){return r.moveH(-1,"word")},goGroupRight:function(r){return r.moveH(1,"group")},goGroupLeft:function(r){return r.moveH(-1,"group")},goWordRight:function(r){return r.moveH(1,"word")},delCharBefore:function(r){return r.deleteH(-1,"codepoint")},delCharAfter:function(r){return r.deleteH(1,"char")},delWordBefore:function(r){return r.deleteH(-1,"word")},delWordAfter:function(r){return r.deleteH(1,"word")},delGroupBefore:function(r){return r.deleteH(-1,"group")},delGroupAfter:function(r){return r.deleteH(1,"group")},indentAuto:function(r){return r.indentSelection("smart")},indentMore:function(r){return r.indentSelection("add")},indentLess:function(r){return r.indentSelection("subtract")},insertTab:function(r){return r.replaceSelection("\t")},insertSoftTab:function(r){var t=[],e=r.listSelections(),i=r.options.tabSize;for(var n=0;n<e.length;n++){var o=e[n].from();var f=P(r.getLine(o.line),o.ch,i);t.push(Y(i-f%i))}r.replaceSelections(t)},defaultTab:function(r){if(r.somethingSelected()){r.indentSelection("add")}else{r.execCommand("insertTab")}},transposeChars:function(r){return Rn(r,(function(){var t=r.listSelections(),e=[];for(var i=0;i<t.length;i++){if(!t[i].empty()){continue}var n=t[i].head,o=Zr(r.doc,n.line).text;if(o){if(n.ch==o.length){n=new ut(n.line,n.ch-1)}if(n.ch>0){n=new ut(n.line,n.ch+1);r.replaceRange(o.charAt(n.ch-1)+o.charAt(n.ch-2),ut(n.line,n.ch-2),n,"+transpose")}else if(n.line>r.doc.first){var f=Zr(r.doc,n.line-1).text;if(f){n=new ut(n.line,1);r.replaceRange(o.charAt(0)+r.doc.lineSeparator()+f.charAt(f.length-1),ut(n.line-1,f.length-1),n,"+transpose")}}}e.push(new uo(n,n))}r.setSelections(e)}))},newlineAndIndent:function(r){return Rn(r,(function(){var t=r.listSelections();for(var e=t.length-1;e>=0;e--){r.replaceRange(r.doc.lineSeparator(),t[e].anchor,t[e].head,"+input")}t=r.listSelections();for(var i=0;i<t.length;i++){r.indentLine(t[i].from().line,null,true)}ln(r)}))},openLine:function(r){return r.replaceSelection("\n","start")},toggleOverwrite:function(r){return r.toggleOverwrite()}};function tu(r,t){var e=Zr(r.doc,t);var i=re(e);if(i!=e){t=it(i)}return Xf(true,r,i,t,1)}function eu(r,t){var e=Zr(r.doc,t);var i=te(e);if(i!=e){t=it(i)}return Xf(true,r,e,t,-1)}function iu(r,t){var e=tu(r,t.line);var i=Zr(r.doc,e.line);var n=mr(i,r.doc.direction);if(!n||n[0].level==0){var o=Math.max(e.ch,i.text.search(/\S/));var f=t.line==e.line&&t.ch<=o&&t.ch;return ut(e.line,f?0:o,e.sticky)}return e}function nu(r,t,e){if(typeof t=="string"){t=ru[t];if(!t){return false}}r.display.input.ensurePolled();var i=r.display.shift,n=false;try{if(r.isReadOnly()){r.state.suppressEdits=true}if(e){r.display.shift=false}n=t(r)!=V}finally{r.display.shift=i;r.state.suppressEdits=false}return n}function ou(r,t,e){for(var i=0;i<r.state.keyMaps.length;i++){var n=Hf(t,r.state.keyMaps[i],e,r);if(n){return n}}return r.options.extraKeys&&Hf(t,r.options.extraKeys,e,r)||Hf(t,r.options.keyMap,e,r)}var fu=new G;function uu(r,t,e,i){var n=r.state.keySeq;if(n){if(Vf(t)){return"handled"}if(/\'$/.test(t)){r.state.keySeq=null}else{fu.set(50,(function(){if(r.state.keySeq==n){r.state.keySeq=null;r.display.input.reset()}}))}if(au(r,n+" "+t,e,i)){return true}}return au(r,t,e,i)}function au(r,t,e,i){var n=ou(r,t,i);if(n=="multi"){r.state.keySeq=t}if(n=="handled"){De(r,"keyHandled",r,t,e)}if(n=="handled"||n=="multi"){xr(e);Ki(r)}return!!n}function lu(r,t){var e=Qf(t,true);if(!e){return false}if(t.shiftKey&&!r.state.keySeq){return uu(r,"Shift-"+e,t,(function(t){return nu(r,t,true)}))||uu(r,e,t,(function(t){if(typeof t=="string"?/^go[A-Z]/.test(t):t.motion){return nu(r,t)}}))}else{return uu(r,e,t,(function(t){return nu(r,t)}))}}function su(r,t,e){return uu(r,"'"+e+"'",t,(function(t){return nu(r,t,true)}))}var cu=null;function vu(r){var t=this;if(r.target&&r.target!=t.display.input.getField()){return}t.curOp.focus=R(z(t));if(Cr(t,r)){return}if(f&&u<11&&r.keyCode==27){r.returnValue=false}var i=r.keyCode;t.display.shift=i==16||r.shiftKey;var n=lu(t,r);if(v){cu=n?i:null;if(!n&&i==88&&!jr&&(w?r.metaKey:r.ctrlKey)){t.replaceSelection("",null,"cut")}}if(e&&!w&&!n&&i==46&&r.shiftKey&&!r.ctrlKey&&document.execCommand){document.execCommand("cut")}if(i==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)){hu(t)}}function hu(r){var t=r.display.lineDiv;O(t,"CodeMirror-crosshair");function e(r){if(r.keyCode==18||!r.altKey){L(t,"CodeMirror-crosshair");wr(document,"keyup",e);wr(document,"mouseover",e)}}gr(document,"keyup",e);gr(document,"mouseover",e)}function du(r){if(r.keyCode==16){this.doc.sel.shift=false}Cr(this,r)}function mu(r){var t=this;if(r.target&&r.target!=t.display.input.getField()){return}if(Ve(t.display,r)||Cr(t,r)||r.ctrlKey&&!r.altKey||w&&r.metaKey){return}var e=r.keyCode,i=r.charCode;if(v&&e==cu){cu=null;xr(r);return}if(v&&(!r.which||r.which<10)&&lu(t,r)){return}var n=String.fromCharCode(i==null?e:i);if(n=="\b"){return}if(su(t,r,n)){return}t.display.input.onKeyPress(r)}var pu=400;var gu=function(r,t,e){this.time=r;this.pos=t;this.button=e};gu.prototype.compare=function(r,t,e){return this.time+pu>r&&at(t,this.pos)==0&&e==this.button};var bu,wu;function ku(r,t){var e=+new Date;if(wu&&wu.compare(e,r,t)){bu=wu=null;return"triple"}else if(bu&&bu.compare(e,r,t)){wu=new gu(e,r,t);bu=null;return"double"}else{bu=new gu(e,r,t);wu=null;return"single"}}function Cu(r){var t=this,e=t.display;if(Cr(t,r)||e.activeTouch&&e.input.supportsTouch()){return}e.input.ensurePolled();e.shift=r.shiftKey;if(Ve(e,r)){if(!a){e.scroller.draggable=false;setTimeout((function(){return e.scroller.draggable=true}),100)}return}if(Du(t,r)){return}var i=Ui(t,r),n=Dr(r),o=i?ku(i,n):"single";j(t).focus();if(n==1&&t.state.selectingText){t.state.selectingText(r)}if(i&&Mu(t,n,i,o,r)){return}if(n==1){if(i){yu(t,i,o,r)}else if(Er(r)==e.scroller){xr(r)}}else if(n==2){if(i){jo(t.doc,i)}setTimeout((function(){return e.input.focus()}),20)}else if(n==3){if(y){t.display.input.onContextMenu(r)}else{Yi(t)}}}function Mu(r,t,e,i,n){var o="Click";if(i=="double"){o="Double"+o}else if(i=="triple"){o="Triple"+o}o=(t==1?"Left":t==2?"Middle":"Right")+o;return uu(r,$f(o,n),n,(function(t){if(typeof t=="string"){t=ru[t]}if(!t){return false}var i=false;try{if(r.isReadOnly()){r.state.suppressEdits=true}i=t(r,e)!=V}finally{r.state.suppressEdits=false}return i}))}function Au(r,t,e){var i=r.getOption("configureMouse");var n=i?i(r,t,e):{};if(n.unit==null){var o=k?e.shiftKey&&e.metaKey:e.altKey;n.unit=o?"rectangle":t=="single"?"char":t=="double"?"word":"line"}if(n.extend==null||r.doc.extend){n.extend=r.doc.extend||e.shiftKey}if(n.addNew==null){n.addNew=w?e.metaKey:e.ctrlKey}if(n.moveOnDrag==null){n.moveOnDrag=!(w?e.altKey:e.ctrlKey)}return n}function yu(r,t,e,i){if(f){setTimeout(W(qi,r),0)}else{r.curOp.focus=R(z(r))}var n=Au(r,e,i);var o=r.doc.sel,u;if(r.options.dragDrop&&Tr&&!r.isReadOnly()&&e=="single"&&(u=o.contains(t))>-1&&(at((u=o.ranges[u]).from(),t)<0||t.xRel>0)&&(at(u.to(),t)>0||t.xRel<0)){xu(r,i,t,n)}else{Su(r,i,t,n)}}function xu(r,t,e,i){var n=r.display,o=false;var l=On(r,(function(t){if(a){n.scroller.draggable=false}r.state.draggingText=false;if(r.state.delayingBlurEvent){if(r.hasFocus()){r.state.delayingBlurEvent=false}else{Yi(r)}}wr(n.wrapper.ownerDocument,"mouseup",l);wr(n.wrapper.ownerDocument,"mousemove",s);wr(n.scroller,"dragstart",c);wr(n.scroller,"drop",l);if(!o){xr(t);if(!i.addNew){jo(r.doc,e,null,null,i.extend)}if(a&&!h||f&&u==9){setTimeout((function(){n.wrapper.ownerDocument.body.focus({preventScroll:true});n.input.focus()}),20)}else{n.input.focus()}}}));var s=function(r){o=o||Math.abs(t.clientX-r.clientX)+Math.abs(t.clientY-r.clientY)>=10};var c=function(){return o=true};if(a){n.scroller.draggable=true}r.state.draggingText=l;l.copy=!i.moveOnDrag;gr(n.wrapper.ownerDocument,"mouseup",l);gr(n.wrapper.ownerDocument,"mousemove",s);gr(n.scroller,"dragstart",c);gr(n.scroller,"drop",l);r.state.delayingBlurEvent=true;setTimeout((function(){return n.input.focus()}),20);if(n.scroller.dragDrop){n.scroller.dragDrop()}}function Lu(r,t,e){if(e=="char"){return new uo(t,t)}if(e=="word"){return r.findWordAt(t)}if(e=="line"){return new uo(ut(t.line,0),dt(r.doc,ut(t.line+1,0)))}var i=e(r,t);return new uo(i.from,i.to)}function Su(r,t,e,i){if(f){Yi(r)}var n=r.display,o=r.doc;xr(t);var u,a,l=o.sel,s=l.ranges;if(i.addNew&&!i.extend){a=o.sel.contains(e);if(a>-1){u=s[a]}else{u=new uo(e,e)}}else{u=o.sel.primary();a=o.sel.primIndex}if(i.unit=="rectangle"){if(!i.addNew){u=new uo(e,e)}e=Ui(r,t,true,true);a=-1}else{var c=Lu(r,e,i.unit);if(i.extend){u=zo(u,c.anchor,c.head,i.extend)}else{u=c}}if(!i.addNew){a=0;Ho(o,new fo([u],0),Q);l=o.sel}else if(a==-1){a=s.length;Ho(o,ao(r,s.concat([u]),a),{scroll:false,origin:"*mouse"})}else if(s.length>1&&s[a].empty()&&i.unit=="char"&&!i.extend){Ho(o,ao(r,s.slice(0,a).concat(s.slice(a+1)),0),{scroll:false,origin:"*mouse"});l=o.sel}else{Fo(o,a,u,Q)}var v=e;function h(t){if(at(v,t)==0){return}v=t;if(i.unit=="rectangle"){var n=[],f=r.options.tabSize;var s=P(Zr(o,e.line).text,e.ch,f);var c=P(Zr(o,t.line).text,t.ch,f);var h=Math.min(s,c),d=Math.max(s,c);for(var m=Math.min(e.line,t.line),p=Math.min(r.lastLine(),Math.max(e.line,t.line));m<=p;m++){var g=Zr(o,m).text,b=K(g,h,f);if(h==d){n.push(new uo(ut(m,b),ut(m,b)))}else if(g.length>b){n.push(new uo(ut(m,b),ut(m,K(g,d,f))))}}if(!n.length){n.push(new uo(e,e))}Ho(o,ao(r,l.ranges.slice(0,a).concat(n),a),{origin:"*mouse",scroll:false});r.scrollIntoView(t)}else{var w=u;var k=Lu(r,t,i.unit);var C=w.anchor,M;if(at(k.anchor,C)>0){M=k.head;C=vt(w.from(),k.anchor)}else{M=k.anchor;C=ct(w.to(),k.head)}var A=l.ranges.slice(0);A[a]=Nu(r,new uo(dt(o,C),M));Ho(o,ao(r,A,a),Q)}}var d=n.wrapper.getBoundingClientRect();var m=0;function p(t){var e=++m;var f=Ui(r,t,true,i.unit=="rectangle");if(!f){return}if(at(f,v)!=0){r.curOp.focus=R(z(r));h(f);var u=en(n,o);if(f.line>=u.to||f.line<u.from){setTimeout(On(r,(function(){if(m==e){p(t)}})),150)}}else{var a=t.clientY<d.top?-20:t.clientY>d.bottom?20:0;if(a){setTimeout(On(r,(function(){if(m!=e){return}n.scroller.scrollTop+=a;p(t)})),50)}}}function g(t){r.state.selectingText=false;m=Infinity;if(t){xr(t);n.input.focus()}wr(n.wrapper.ownerDocument,"mousemove",b);wr(n.wrapper.ownerDocument,"mouseup",w);o.history.lastSelOrigin=null}var b=On(r,(function(r){if(r.buttons===0||!Dr(r)){g(r)}else{p(r)}}));var w=On(r,g);r.state.selectingText=w;gr(n.wrapper.ownerDocument,"mousemove",b);gr(n.wrapper.ownerDocument,"mouseup",w)}function Nu(r,t){var e=t.anchor;var i=t.head;var n=Zr(r.doc,e.line);if(at(e,i)==0&&e.sticky==i.sticky){return t}var o=mr(n);if(!o){return t}var f=hr(o,e.ch,e.sticky),u=o[f];if(u.from!=e.ch&&u.to!=e.ch){return t}var a=f+(u.from==e.ch==(u.level!=1)?0:1);if(a==0||a==o.length){return t}var l;if(i.line!=e.line){l=(i.line-e.line)*(r.doc.direction=="ltr"?1:-1)>0}else{var s=hr(o,i.ch,i.sticky);var c=s-f||(i.ch-e.ch)*(u.level==1?-1:1);if(s==a-1||s==a){l=c<0}else{l=c>0}}var v=o[a+(l?-1:0)];var h=l==(v.level==1);var d=h?v.from:v.to,m=h?"after":"before";return e.ch==d&&e.sticky==m?t:new uo(new ut(e.line,d,m),i)}function Eu(r,t,e,i){var n,o;if(t.touches){n=t.touches[0].clientX;o=t.touches[0].clientY}else{try{n=t.clientX;o=t.clientY}catch(r){return false}}if(n>=Math.floor(r.display.gutters.getBoundingClientRect().right)){return false}if(i){xr(t)}var f=r.display;var u=f.lineDiv.getBoundingClientRect();if(o>u.bottom||!Ar(r,e)){return Sr(t)}o-=u.top-f.viewOffset;for(var a=0;a<r.display.gutterSpecs.length;++a){var l=f.gutters.childNodes[a];if(l&&l.getBoundingClientRect().right>=n){var s=nt(r.doc,o);var c=r.display.gutterSpecs[a];kr(r,e,r,s,c.className,t);return Sr(t)}}}function Du(r,t){return Eu(r,t,"gutterClick",true)}function Tu(r,t){if(Ve(r.display,t)||Iu(r,t)){return}if(Cr(r,t,"contextmenu")){return}if(!y){r.display.input.onContextMenu(t)}}function Iu(r,t){if(!Ar(r,"gutterContextMenu")){return false}return Eu(r,t,"gutterContextMenu",false)}function Ru(r){r.display.wrapper.className=r.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+r.options.theme.replace(/(^|\s)\s*/g," cm-s-");vi(r)}var Ou={toString:function(){return"CodeMirror.Init"}};var Bu={};var Uu={};function zu(r){var t=r.optionHandlers;function e(e,i,n,o){r.defaults[e]=i;if(n){t[e]=o?function(r,t,e){if(e!=Ou){n(r,t,e)}}:n}}r.defineOption=e;r.Init=Ou;e("value","",(function(r,t){return r.setValue(t)}),true);e("mode",null,(function(r,t){r.doc.modeOption=t;po(r)}),true);e("indentUnit",2,po,true);e("indentWithTabs",false);e("smartIndent",true);e("tabSize",4,(function(r){go(r);vi(r);ji(r)}),true);e("lineSeparator",null,(function(r,t){r.doc.lineSep=t;if(!t){return}var e=[],i=r.doc.first;r.doc.iter((function(r){for(var n=0;;){var o=r.text.indexOf(t,n);if(o==-1){break}n=o+t.length;e.push(ut(i,o))}i++}));for(var n=e.length-1;n>=0;n--){uf(r.doc,t,e[n],ut(e[n].line,e[n].ch+t.length))}}));e("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\u202d\u202e\u2066\u2067\u2069\ufeff\ufff9-\ufffc]/g,(function(r,t,e){r.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g");if(e!=Ou){r.refresh()}}));e("specialCharPlaceholder",ge,(function(r){return r.refresh()}),true);e("electricChars",true);e("inputStyle",b?"contenteditable":"textarea",(function(){throw new Error("inputStyle can not (yet) be changed in a running editor")}),true);e("spellcheck",false,(function(r,t){return r.getInputField().spellcheck=t}),true);e("autocorrect",false,(function(r,t){return r.getInputField().autocorrect=t}),true);e("autocapitalize",false,(function(r,t){return r.getInputField().autocapitalize=t}),true);e("rtlMoveVisually",!C);e("wholeLineUpdateBefore",true);e("theme","default",(function(r){Ru(r);Zn(r)}),true);e("keyMap","default",(function(r,t,e){var i=Jf(t);var n=e!=Ou&&Jf(e);if(n&&n.detach){n.detach(r,i)}if(i.attach){i.attach(r,n||null)}}));e("extraKeys",null);e("configureMouse",null);e("lineWrapping",false,Wu,true);e("gutters",[],(function(r,t){r.display.gutterSpecs=Yn(t,r.options.lineNumbers);Zn(r)}),true);e("fixedGutter",true,(function(r,t){r.display.gutters.style.left=t?Ri(r.display)+"px":"0";r.refresh()}),true);e("coverGutterNextToScrollbar",false,(function(r){return kn(r)}),true);e("scrollbarStyle","native",(function(r){An(r);kn(r);r.display.scrollbars.setScrollTop(r.doc.scrollTop);r.display.scrollbars.setScrollLeft(r.doc.scrollLeft)}),true);e("lineNumbers",false,(function(r,t){r.display.gutterSpecs=Yn(r.options.gutters,t);Zn(r)}),true);e("firstLineNumber",1,Zn,true);e("lineNumberFormatter",(function(r){return r}),Zn,true);e("showCursorWhenSelecting",false,Hi,true);e("resetSelectionOnContextMenu",true);e("lineWiseCopyCut",true);e("pasteLinesPerSelection",true);e("selectionsMayTouch",false);e("readOnly",false,(function(r,t){if(t=="nocursor"){Zi(r);r.display.input.blur()}r.display.input.readOnlyChanged(t)}));e("screenReaderLabel",null,(function(r,t){t=t===""?null:t;r.display.input.screenReaderLabelChanged(t)}));e("disableInput",false,(function(r,t){if(!t){r.display.input.reset()}}),true);e("dragDrop",true,ju);e("allowDropFileTypes",null);e("cursorBlinkRate",530);e("cursorScrollMargin",0);e("cursorHeight",1,Hi,true);e("singleCursorHeightPerLine",true,Hi,true);e("workTime",100);e("workDelay",100);e("flattenSpans",true,go,true);e("addModeClass",false,go,true);e("pollInterval",100);e("undoDepth",200,(function(r,t){return r.doc.history.undoDepth=t}));e("historyEventDelay",1250);e("viewportMargin",10,(function(r){return r.refresh()}),true);e("maxHighlightLength",1e4,go,true);e("moveInputWithCursor",true,(function(r,t){if(!t){r.display.input.resetPosition()}}));e("tabindex",null,(function(r,t){return r.display.input.getField().tabIndex=t||""}));e("autofocus",null);e("direction","ltr",(function(r,t){return r.doc.setDirection(t)}),true);e("phrases",null)}function ju(r,t,e){var i=e&&e!=Ou;if(!t!=!i){var n=r.display.dragFunctions;var o=t?gr:wr;o(r.display.scroller,"dragstart",n.start);o(r.display.scroller,"dragenter",n.enter);o(r.display.scroller,"dragover",n.over);o(r.display.scroller,"dragleave",n.leave);o(r.display.scroller,"drop",n.drop)}}function Wu(r){if(r.options.lineWrapping){O(r.display.wrapper,"CodeMirror-wrap");r.display.sizer.style.minWidth="";r.display.sizerWidth=null}else{L(r.display.wrapper,"CodeMirror-wrap");le(r)}Bi(r);ji(r);vi(r);setTimeout((function(){return kn(r)}),100)}function Fu(r,t){var e=this;if(!(this instanceof Fu)){return new Fu(r,t)}this.options=t=t?F(t):{};F(Bu,t,false);var i=t.value;if(typeof i=="string"){i=new Lf(i,t.mode,null,t.lineSeparator,t.direction)}else if(t.mode){i.modeOption=t.mode}this.doc=i;var n=new Fu.inputStyles[t.inputStyle](this);var o=this.display=new ro(r,i,n,t);o.wrapper.CodeMirror=this;Ru(this);if(t.lineWrapping){this.display.wrapper.className+=" CodeMirror-wrap"}An(this);this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:false,delayingBlurEvent:false,focused:false,suppressEdits:false,pasteIncoming:-1,cutIncoming:-1,selectingText:false,draggingText:false,highlight:new G,keySeq:null,specialChars:null};if(t.autofocus&&!b){o.input.focus()}if(f&&u<11){setTimeout((function(){return e.display.input.reset(true)}),20)}Pu(this);Of();xn(this);this.curOp.forceUpdate=true;Co(this,i);if(t.autofocus&&!b||this.hasFocus()){setTimeout((function(){if(e.hasFocus()&&!e.state.focused){Xi(e)}}),20)}else{Zi(this)}for(var l in Uu){if(Uu.hasOwnProperty(l)){Uu[l](this,t[l],Ou)}}qn(this);if(t.finishInit){t.finishInit(this)}for(var s=0;s<Gu.length;++s){Gu[s](this)}Ln(this);if(a&&t.lineWrapping&&getComputedStyle(o.lineDiv).textRendering=="optimizelegibility"){o.lineDiv.style.textRendering="auto"}}Fu.defaults=Bu;Fu.optionHandlers=Uu;function Pu(r){var t=r.display;gr(t.scroller,"mousedown",On(r,Cu));if(f&&u<11){gr(t.scroller,"dblclick",On(r,(function(t){if(Cr(r,t)){return}var e=Ui(r,t);if(!e||Du(r,t)||Ve(r.display,t)){return}xr(t);var i=r.findWordAt(e);jo(r.doc,i.anchor,i.head)})))}else{gr(t.scroller,"dblclick",(function(t){return Cr(r,t)||xr(t)}))}gr(t.scroller,"contextmenu",(function(t){return Tu(r,t)}));gr(t.input.getField(),"contextmenu",(function(e){if(!t.scroller.contains(e.target)){Tu(r,e)}}));var e,i={end:0};function n(){if(t.activeTouch){e=setTimeout((function(){return t.activeTouch=null}),1e3);i=t.activeTouch;i.end=+new Date}}function o(r){if(r.touches.length!=1){return false}var t=r.touches[0];return t.radiusX<=1&&t.radiusY<=1}function a(r,t){if(t.left==null){return true}var e=t.left-r.left,i=t.top-r.top;return e*e+i*i>20*20}gr(t.scroller,"touchstart",(function(n){if(!Cr(r,n)&&!o(n)&&!Du(r,n)){t.input.ensurePolled();clearTimeout(e);var f=+new Date;t.activeTouch={start:f,moved:false,prev:f-i.end<=300?i:null};if(n.touches.length==1){t.activeTouch.left=n.touches[0].pageX;t.activeTouch.top=n.touches[0].pageY}}}));gr(t.scroller,"touchmove",(function(){if(t.activeTouch){t.activeTouch.moved=true}}));gr(t.scroller,"touchend",(function(e){var i=t.activeTouch;if(i&&!Ve(t,e)&&i.left!=null&&!i.moved&&new Date-i.start<300){var o=r.coordsChar(t.activeTouch,"page"),f;if(!i.prev||a(i,i.prev)){f=new uo(o,o)}else if(!i.prev.prev||a(i,i.prev.prev)){f=r.findWordAt(o)}else{f=new uo(ut(o.line,0),dt(r.doc,ut(o.line+1,0)))}r.setSelection(f.anchor,f.head);r.focus();xr(e)}n()}));gr(t.scroller,"touchcancel",n);gr(t.scroller,"scroll",(function(){if(t.scroller.clientHeight){dn(r,t.scroller.scrollTop);pn(r,t.scroller.scrollLeft,true);kr(r,"scroll",r)}}));gr(t.scroller,"mousewheel",(function(t){return oo(r,t)}));gr(t.scroller,"DOMMouseScroll",(function(t){return oo(r,t)}));gr(t.wrapper,"scroll",(function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}));t.dragFunctions={enter:function(t){if(!Cr(r,t)){Nr(t)}},over:function(t){if(!Cr(r,t)){Df(r,t);Nr(t)}},start:function(t){return Ef(r,t)},drop:On(r,Nf),leave:function(t){if(!Cr(r,t)){Tf(r)}}};var l=t.input.getField();gr(l,"keyup",(function(t){return du.call(r,t)}));gr(l,"keydown",On(r,vu));gr(l,"keypress",On(r,mu));gr(l,"focus",(function(t){return Xi(r,t)}));gr(l,"blur",(function(t){return Zi(r,t)}))}var Gu=[];Fu.defineInitHook=function(r){return Gu.push(r)};function _u(r,t,e,i){var n=r.doc,o;if(e==null){e="add"}if(e=="smart"){if(!n.mode.indent){e="prev"}else{o=Ct(r,t).state}}var f=r.options.tabSize;var u=Zr(n,t),a=P(u.text,null,f);if(u.stateAfter){u.stateAfter=null}var l=u.text.match(/^\s*/)[0],s;if(!i&&!/\S/.test(u.text)){s=0;e="not"}else if(e=="smart"){s=n.mode.indent(o,u.text.slice(l.length),u.text);if(s==V||s>150){if(!i){return}e="prev"}}if(e=="prev"){if(t>n.first){s=P(Zr(n,t-1).text,null,f)}else{s=0}}else if(e=="add"){s=a+r.options.indentUnit}else if(e=="subtract"){s=a-r.options.indentUnit}else if(typeof e=="number"){s=a+e}s=Math.max(0,s);var c="",v=0;if(r.options.indentWithTabs){for(var h=Math.floor(s/f);h;--h){v+=f;c+="\t"}}if(v<s){c+=Y(s-v)}if(c!=l){uf(n,c,ut(t,0),ut(t,l.length),"+input");u.stateAfter=null;return true}else{for(var d=0;d<n.sel.ranges.length;d++){var m=n.sel.ranges[d];if(m.head.line==t&&m.head.ch<l.length){var p=ut(t,l.length);Fo(n,d,new uo(p,p));break}}}}var Hu=null;function Vu(r){Hu=r}function $u(r,t,e,i,n){var o=r.doc;r.display.shift=false;if(!i){i=o.sel}var f=+new Date-200;var u=n=="paste"||r.state.pasteIncoming>f;var a=Ur(t),l=null;if(u&&i.ranges.length>1){if(Hu&&Hu.text.join("\n")==t){if(i.ranges.length%Hu.text.length==0){l=[];for(var s=0;s<Hu.text.length;s++){l.push(o.splitLines(Hu.text[s]))}}}else if(a.length==i.ranges.length&&r.options.pasteLinesPerSelection){l=Z(a,(function(r){return[r]}))}}var c=r.curOp.updateInput;for(var v=i.ranges.length-1;v>=0;v--){var h=i.ranges[v];var d=h.from(),m=h.to();if(h.empty()){if(e&&e>0){d=ut(d.line,d.ch-e)}else if(r.state.overwrite&&!u){m=ut(m.line,Math.min(Zr(o,m.line).text.length,m.ch+X(a).length))}else if(u&&Hu&&Hu.lineWise&&Hu.text.join("\n")==a.join("\n")){d=m=ut(d.line,0)}}var p={from:d,to:m,text:l?l[v%l.length]:a,origin:n||(u?"paste":r.state.cutIncoming>f?"cut":"+input")};rf(r.doc,p);De(r,"inputRead",r,p)}if(t&&!u){Ju(r,t)}ln(r);if(r.curOp.updateInput<2){r.curOp.updateInput=c}r.curOp.typing=true;r.state.pasteIncoming=r.state.cutIncoming=-1}function Qu(r,t){var e=r.clipboardData&&r.clipboardData.getData("Text");if(e){r.preventDefault();if(!t.isReadOnly()&&!t.options.disableInput&&t.hasFocus()){Rn(t,(function(){return $u(t,e,0,null,"paste")}))}return true}}function Ju(r,t){if(!r.options.electricChars||!r.options.smartIndent){return}var e=r.doc.sel;for(var i=e.ranges.length-1;i>=0;i--){var n=e.ranges[i];if(n.head.ch>100||i&&e.ranges[i-1].head.line==n.head.line){continue}var o=r.getModeAt(n.head);var f=false;if(o.electricChars){for(var u=0;u<o.electricChars.length;u++){if(t.indexOf(o.electricChars.charAt(u))>-1){f=_u(r,n.head.line,"smart");break}}}else if(o.electricInput){if(o.electricInput.test(Zr(r.doc,n.head.line).text.slice(0,n.head.ch))){f=_u(r,n.head.line,"smart")}}if(f){De(r,"electricInput",r,n.head.line)}}}function Ku(r){var t=[],e=[];for(var i=0;i<r.doc.sel.ranges.length;i++){var n=r.doc.sel.ranges[i].head.line;var o={anchor:ut(n,0),head:ut(n+1,0)};e.push(o);t.push(r.getRange(o.anchor,o.head))}return{text:t,ranges:e}}function qu(r,t,e,i){r.setAttribute("autocorrect",e?"":"off");r.setAttribute("autocapitalize",i?"":"off");r.setAttribute("spellcheck",!!t)}function Yu(){var r=E("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; min-height: 1em; outline: none");var t=E("div",[r],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");if(a){r.style.width="1000px"}else{r.setAttribute("wrap","off")}if(p){r.style.border="1px solid black"}qu(r);return t}function Xu(r){var t=r.optionHandlers;var e=r.helpers={};r.prototype={constructor:r,focus:function(){j(this).focus();this.display.input.focus()},setOption:function(r,e){var i=this.options,n=i[r];if(i[r]==e&&r!="mode"){return}i[r]=e;if(t.hasOwnProperty(r)){On(this,t[r])(this,e,n)}kr(this,"optionChange",this,r)},getOption:function(r){return this.options[r]},getDoc:function(){return this.doc},addKeyMap:function(r,t){this.state.keyMaps[t?"push":"unshift"](Jf(r))},removeKeyMap:function(r){var t=this.state.keyMaps;for(var e=0;e<t.length;++e){if(t[e]==r||t[e].name==r){t.splice(e,1);return true}}},addOverlay:Bn((function(t,e){var i=t.token?t:r.getMode(this.options,t);if(i.startState){throw new Error("Overlays may not be stateful.")}rr(this.state.overlays,{mode:i,modeSpec:t,opaque:e&&e.opaque,priority:e&&e.priority||0},(function(r){return r.priority}));this.state.modeGen++;ji(this)})),removeOverlay:Bn((function(r){var t=this.state.overlays;for(var e=0;e<t.length;++e){var i=t[e].modeSpec;if(i==r||typeof r=="string"&&i.name==r){t.splice(e,1);this.state.modeGen++;ji(this);return}}})),indentLine:Bn((function(r,t,e){if(typeof t!="string"&&typeof t!="number"){if(t==null){t=this.options.smartIndent?"smart":"prev"}else{t=t?"add":"subtract"}}if(ot(this.doc,r)){_u(this,r,t,e)}})),indentSelection:Bn((function(r){var t=this.doc.sel.ranges,e=-1;for(var i=0;i<t.length;i++){var n=t[i];if(!n.empty()){var o=n.from(),f=n.to();var u=Math.max(e,o.line);e=Math.min(this.lastLine(),f.line-(f.ch?0:1))+1;for(var a=u;a<e;++a){_u(this,a,r)}var l=this.doc.sel.ranges;if(o.ch==0&&t.length==l.length&&l[i].from().ch>0){Fo(this.doc,i,new uo(o,l[i].to()),$)}}else if(n.head.line>e){_u(this,n.head.line,r,true);e=n.head.line;if(i==this.doc.sel.primIndex){ln(this)}}}})),getTokenAt:function(r,t){return Lt(this,r,t)},getLineTokens:function(r,t){return Lt(this,ut(r),t,true)},getTokenTypeAt:function(r){r=dt(this.doc,r);var t=kt(this,Zr(this.doc,r.line));var e=0,i=(t.length-1)/2,n=r.ch;var o;if(n==0){o=t[2]}else{for(;;){var f=e+i>>1;if((f?t[f*2-1]:0)>=n){i=f}else if(t[f*2+1]<n){e=f+1}else{o=t[f*2+2];break}}}var u=o?o.indexOf("overlay "):-1;return u<0?o:u==0?null:o.slice(0,u-1)},getModeAt:function(t){var e=this.doc.mode;if(!e.innerMode){return e}return r.innerMode(e,this.getTokenAt(t).state).mode},getHelper:function(r,t){return this.getHelpers(r,t)[0]},getHelpers:function(r,t){var i=[];if(!e.hasOwnProperty(t)){return i}var n=e[t],o=this.getModeAt(r);if(typeof o[t]=="string"){if(n[o[t]]){i.push(n[o[t]])}}else if(o[t]){for(var f=0;f<o[t].length;f++){var u=n[o[t][f]];if(u){i.push(u)}}}else if(o.helperType&&n[o.helperType]){i.push(n[o.helperType])}else if(n[o.name]){i.push(n[o.name])}for(var a=0;a<n._global.length;a++){var l=n._global[a];if(l.pred(o,this)&&_(i,l.val)==-1){i.push(l.val)}}return i},getStateAfter:function(r,t){var e=this.doc;r=ht(e,r==null?e.first+e.size-1:r);return Ct(this,r+1,t).state},cursorCoords:function(r,t){var e,i=this.doc.sel.primary();if(r==null){e=i.head}else if(typeof r=="object"){e=dt(this.doc,r)}else{e=r?i.from():i.to()}return wi(this,e,t||"page")},charCoords:function(r,t){return bi(this,dt(this.doc,r),t||"page")},coordsChar:function(r,t){r=gi(this,r,t||"page");return Mi(this,r.left,r.top)},lineAtHeight:function(r,t){r=gi(this,{top:r,left:0},t||"page").top;return nt(this.doc,r+this.display.viewOffset)},heightAtLine:function(r,t,e){var i=false,n;if(typeof r=="number"){var o=this.doc.first+this.doc.size-1;if(r<this.doc.first){r=this.doc.first}else if(r>o){r=o;i=true}n=Zr(this.doc,r)}else{n=r}return pi(this,n,{top:0,left:0},t||"page",e||i).top+(i?this.doc.height-ue(n):0)},defaultTextHeight:function(){return Di(this.display)},defaultCharWidth:function(){return Ti(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(r,t,e,i,n){var o=this.display;r=wi(this,dt(this.doc,r));var f=r.bottom,u=r.left;t.style.position="absolute";t.setAttribute("cm-ignore-events","true");this.display.input.setUneditable(t);o.sizer.appendChild(t);if(i=="over"){f=r.top}else if(i=="above"||i=="near"){var a=Math.max(o.wrapper.clientHeight,this.doc.height),l=Math.max(o.sizer.clientWidth,o.lineSpace.clientWidth);if((i=="above"||r.bottom+t.offsetHeight>a)&&r.top>t.offsetHeight){f=r.top-t.offsetHeight}else if(r.bottom+t.offsetHeight<=a){f=r.bottom}if(u+t.offsetWidth>l){u=l-t.offsetWidth}}t.style.top=f+"px";t.style.left=t.style.right="";if(n=="right"){u=o.sizer.clientWidth-t.offsetWidth;t.style.right="0px"}else{if(n=="left"){u=0}else if(n=="middle"){u=(o.sizer.clientWidth-t.offsetWidth)/2}t.style.left=u+"px"}if(e){fn(this,{left:u,top:f,right:u+t.offsetWidth,bottom:f+t.offsetHeight})}},triggerOnKeyDown:Bn(vu),triggerOnKeyPress:Bn(mu),triggerOnKeyUp:du,triggerOnMouseDown:Bn(Cu),execCommand:function(r){if(ru.hasOwnProperty(r)){return ru[r].call(null,this)}},triggerElectric:Bn((function(r){Ju(this,r)})),findPosH:function(r,t,e,i){var n=1;if(t<0){n=-1;t=-t}var o=dt(this.doc,r);for(var f=0;f<t;++f){o=Zu(this.doc,o,n,e,i);if(o.hitSide){break}}return o},moveH:Bn((function(r,t){var e=this;this.extendSelectionsBy((function(i){if(e.display.shift||e.doc.extend||i.empty()){return Zu(e.doc,i.head,r,t,e.options.rtlMoveVisually)}else{return r<0?i.from():i.to()}}),J)})),deleteH:Bn((function(r,t){var e=this.doc.sel,i=this.doc;if(e.somethingSelected()){i.replaceSelection("",null,"+delete")}else{Kf(this,(function(e){var n=Zu(i,e.head,r,t,false);return r<0?{from:n,to:e.head}:{from:e.head,to:n}}))}})),findPosV:function(r,t,e,i){var n=1,o=i;if(t<0){n=-1;t=-t}var f=dt(this.doc,r);for(var u=0;u<t;++u){var a=wi(this,f,"div");if(o==null){o=a.left}else{a.left=o}f=ra(this,a,n,e);if(f.hitSide){break}}return f},moveV:Bn((function(r,t){var e=this;var i=this.doc,n=[];var o=!this.display.shift&&!i.extend&&i.sel.somethingSelected();i.extendSelectionsBy((function(f){if(o){return r<0?f.from():f.to()}var u=wi(e,f.head,"div");if(f.goalColumn!=null){u.left=f.goalColumn}n.push(u.left);var a=ra(e,u,r,t);if(t=="page"&&f==i.sel.primary()){an(e,bi(e,a,"div").top-u.top)}return a}),J);if(n.length){for(var f=0;f<i.sel.ranges.length;f++){i.sel.ranges[f].goalColumn=n[f]}}})),findWordAt:function(r){var t=this.doc,e=Zr(t,r.line).text;var i=r.ch,n=r.ch;if(e){var o=this.getHelper(r,"wordChars");if((r.sticky=="before"||n==e.length)&&i){--i}else{++n}var f=e.charAt(i);var u=or(f,o)?function(r){return or(r,o)}:/\s/.test(f)?function(r){return/\s/.test(r)}:function(r){return!/\s/.test(r)&&!or(r)};while(i>0&&u(e.charAt(i-1))){--i}while(n<e.length&&u(e.charAt(n))){++n}}return new uo(ut(r.line,i),ut(r.line,n))},toggleOverwrite:function(r){if(r!=null&&r==this.state.overwrite){return}if(this.state.overwrite=!this.state.overwrite){O(this.display.cursorDiv,"CodeMirror-overwrite")}else{L(this.display.cursorDiv,"CodeMirror-overwrite")}kr(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==R(z(this))},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:Bn((function(r,t){sn(this,r,t)})),getScrollInfo:function(){var r=this.display.scroller;return{left:r.scrollLeft,top:r.scrollTop,height:r.scrollHeight-Ke(this)-this.display.barHeight,width:r.scrollWidth-Ke(this)-this.display.barWidth,clientHeight:Ye(this),clientWidth:qe(this)}},scrollIntoView:Bn((function(r,t){if(r==null){r={from:this.doc.sel.primary().head,to:null};if(t==null){t=this.options.cursorScrollMargin}}else if(typeof r=="number"){r={from:ut(r,0),to:null}}else if(r.from==null){r={from:r,to:null}}if(!r.to){r.to=r.from}r.margin=t||0;if(r.from.line!=null){cn(this,r)}else{hn(this,r.from,r.to,r.margin)}})),setSize:Bn((function(r,t){var e=this;var i=function(r){return typeof r=="number"||/^\d+$/.test(String(r))?r+"px":r};if(r!=null){this.display.wrapper.style.width=i(r)}if(t!=null){this.display.wrapper.style.height=i(t)}if(this.options.lineWrapping){ci(this)}var n=this.display.viewFrom;this.doc.iter(n,this.display.viewTo,(function(r){if(r.widgets){for(var t=0;t<r.widgets.length;t++){if(r.widgets[t].noHScroll){Wi(e,n,"widget");break}}}++n}));this.curOp.forceUpdate=true;kr(this,"refresh",this)})),operation:function(r){return Rn(this,r)},startOperation:function(){return xn(this)},endOperation:function(){return Ln(this)},refresh:Bn((function(){var r=this.display.cachedTextHeight;ji(this);this.curOp.forceUpdate=true;vi(this);sn(this,this.doc.scrollLeft,this.doc.scrollTop);Qn(this.display);if(r==null||Math.abs(r-Di(this.display))>.5||this.options.lineWrapping){Bi(this)}kr(this,"refresh",this)})),swapDoc:Bn((function(r){var t=this.doc;t.cm=null;if(this.state.selectingText){this.state.selectingText()}Co(this,r);vi(this);this.display.input.reset();sn(this,r.scrollLeft,r.scrollTop);this.curOp.forceScroll=true;De(this,"swapDoc",this,t);return t})),phrase:function(r){var t=this.options.phrases;return t&&Object.prototype.hasOwnProperty.call(t,r)?t[r]:r},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}};yr(r);r.registerHelper=function(t,i,n){if(!e.hasOwnProperty(t)){e[t]=r[t]={_global:[]}}e[t][i]=n};r.registerGlobalHelper=function(t,i,n,o){r.registerHelper(t,i,o);e[t]._global.push({pred:n,val:o})}}function Zu(r,t,e,i,n){var o=t;var f=e;var u=Zr(r,t.line);var a=n&&r.direction=="rtl"?-e:e;function l(){var e=t.line+a;if(e<r.first||e>=r.first+r.size){return false}t=new ut(e,t.ch,t.sticky);return u=Zr(r,e)}function s(o){var f;if(i=="codepoint"){var s=u.text.charCodeAt(t.ch+(e>0?0:-1));if(isNaN(s)){f=null}else{var c=e>0?s>=55296&&s<56320:s>=56320&&s<57343;f=new ut(t.line,Math.max(0,Math.min(u.text.length,t.ch+e*(c?2:1))),-e)}}else if(n){f=Zf(r.cm,u,t,e)}else{f=Yf(u,t,e)}if(f==null){if(!o&&l()){t=Xf(n,r.cm,u,t.line,a)}else{return false}}else{t=f}return true}if(i=="char"||i=="codepoint"){s()}else if(i=="column"){s(true)}else if(i=="word"||i=="group"){var c=null,v=i=="group";var h=r.cm&&r.cm.getHelper(t,"wordChars");for(var d=true;;d=false){if(e<0&&!s(!d)){break}var m=u.text.charAt(t.ch)||"\n";var p=or(m,h)?"w":v&&m=="\n"?"n":!v||/\s/.test(m)?null:"p";if(v&&!d&&!p){p="s"}if(c&&c!=p){if(e<0){e=1;s();t.sticky="after"}break}if(p){c=p}if(e>0&&!s(!d)){break}}}var g=qo(r,t,o,f,true);if(lt(o,g)){g.hitSide=true}return g}function ra(r,t,e,i){var n=r.doc,o=t.left,f;if(i=="page"){var u=Math.min(r.display.wrapper.clientHeight,j(r).innerHeight||n(r).documentElement.clientHeight);var a=Math.max(u-.5*Di(r.display),3);f=(e>0?t.bottom:t.top)+e*a}else if(i=="line"){f=e>0?t.bottom+3:t.top-3}var l;for(;;){l=Mi(r,o,f);if(!l.outside){break}if(e<0?f<=0:f>=n.height){l.hitSide=true;break}f+=e*5}return l}var ta=function(r){this.cm=r;this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null;this.polling=new G;this.composing=null;this.gracePeriod=false;this.readDOMTimeout=null};ta.prototype.init=function(r){var t=this;var e=this,i=e.cm;var n=e.div=r.lineDiv;n.contentEditable=true;qu(n,i.options.spellcheck,i.options.autocorrect,i.options.autocapitalize);function o(r){for(var t=r.target;t;t=t.parentNode){if(t==n){return true}if(/\bCodeMirror-(?:line)?widget\b/.test(t.className)){break}}return false}gr(n,"paste",(function(r){if(!o(r)||Cr(i,r)||Qu(r,i)){return}if(u<=11){setTimeout(On(i,(function(){return t.updateFromDOM()})),20)}}));gr(n,"compositionstart",(function(r){t.composing={data:r.data,done:false}}));gr(n,"compositionupdate",(function(r){if(!t.composing){t.composing={data:r.data,done:false}}}));gr(n,"compositionend",(function(r){if(t.composing){if(r.data!=t.composing.data){t.readFromDOMSoon()}t.composing.done=true}}));gr(n,"touchstart",(function(){return e.forceCompositionEnd()}));gr(n,"input",(function(){if(!t.composing){t.readFromDOMSoon()}}));function f(r){if(!o(r)||Cr(i,r)){return}if(i.somethingSelected()){Vu({lineWise:false,text:i.getSelections()});if(r.type=="cut"){i.replaceSelection("",null,"cut")}}else if(!i.options.lineWiseCopyCut){return}else{var t=Ku(i);Vu({lineWise:true,text:t.text});if(r.type=="cut"){i.operation((function(){i.setSelections(t.ranges,0,$);i.replaceSelection("",null,"cut")}))}}if(r.clipboardData){r.clipboardData.clearData();var f=Hu.text.join("\n");r.clipboardData.setData("Text",f);if(r.clipboardData.getData("Text")==f){r.preventDefault();return}}var u=Yu(),a=u.firstChild;i.display.lineSpace.insertBefore(u,i.display.lineSpace.firstChild);a.value=Hu.text.join("\n");var l=R(n.ownerDocument);U(a);setTimeout((function(){i.display.lineSpace.removeChild(u);l.focus();if(l==n){e.showPrimarySelection()}}),50)}gr(n,"copy",f);gr(n,"cut",f)};ta.prototype.screenReaderLabelChanged=function(r){if(r){this.div.setAttribute("aria-label",r)}else{this.div.removeAttribute("aria-label")}};ta.prototype.prepareSelection=function(){var r=Vi(this.cm,false);r.focus=R(this.div.ownerDocument)==this.div;return r};ta.prototype.showSelection=function(r,t){if(!r||!this.cm.display.view.length){return}if(r.focus||t){this.showPrimarySelection()}this.showMultipleSelections(r)};ta.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()};ta.prototype.showPrimarySelection=function(){var r=this.getSelection(),t=this.cm,i=t.doc.sel.primary();var n=i.from(),o=i.to();if(t.display.viewTo==t.display.viewFrom||n.line>=t.display.viewTo||o.line<t.display.viewFrom){r.removeAllRanges();return}var f=fa(t,r.anchorNode,r.anchorOffset);var u=fa(t,r.focusNode,r.focusOffset);if(f&&!f.bad&&u&&!u.bad&&at(vt(f,u),n)==0&&at(ct(f,u),o)==0){return}var a=t.display.view;var l=n.line>=t.display.viewFrom&&ea(t,n)||{node:a[0].measure.map[2],offset:0};var s=o.line<t.display.viewTo&&ea(t,o);if(!s){var c=a[a.length-1].measure;var v=c.maps?c.maps[c.maps.length-1]:c.map;s={node:v[v.length-1],offset:v[v.length-2]-v[v.length-3]}}if(!l||!s){r.removeAllRanges();return}var h=r.rangeCount&&r.getRangeAt(0),d;try{d=T(l.node,l.offset,s.offset,s.node)}catch(r){}if(d){if(!e&&t.state.focused){r.collapse(l.node,l.offset);if(!d.collapsed){r.removeAllRanges();r.addRange(d)}}else{r.removeAllRanges();r.addRange(d)}if(h&&r.anchorNode==null){r.addRange(h)}else if(e){this.startGracePeriod()}}this.rememberSelection()};ta.prototype.startGracePeriod=function(){var r=this;clearTimeout(this.gracePeriod);this.gracePeriod=setTimeout((function(){r.gracePeriod=false;if(r.selectionChanged()){r.cm.operation((function(){return r.cm.curOp.selectionChanged=true}))}}),20)};ta.prototype.showMultipleSelections=function(r){N(this.cm.display.cursorDiv,r.cursors);N(this.cm.display.selectionDiv,r.selection)};ta.prototype.rememberSelection=function(){var r=this.getSelection();this.lastAnchorNode=r.anchorNode;this.lastAnchorOffset=r.anchorOffset;this.lastFocusNode=r.focusNode;this.lastFocusOffset=r.focusOffset};ta.prototype.selectionInEditor=function(){var r=this.getSelection();if(!r.rangeCount){return false}var t=r.getRangeAt(0).commonAncestorContainer;return I(this.div,t)};ta.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"){if(!this.selectionInEditor()||R(this.div.ownerDocument)!=this.div){this.showSelection(this.prepareSelection(),true)}this.div.focus()}};ta.prototype.blur=function(){this.div.blur()};ta.prototype.getField=function(){return this.div};ta.prototype.supportsTouch=function(){return true};ta.prototype.receivedFocus=function(){var r=this;var t=this;if(this.selectionInEditor()){setTimeout((function(){return r.pollSelection()}),20)}else{Rn(this.cm,(function(){return t.cm.curOp.selectionChanged=true}))}function e(){if(t.cm.state.focused){t.pollSelection();t.polling.set(t.cm.options.pollInterval,e)}}this.polling.set(this.cm.options.pollInterval,e)};ta.prototype.selectionChanged=function(){var r=this.getSelection();return r.anchorNode!=this.lastAnchorNode||r.anchorOffset!=this.lastAnchorOffset||r.focusNode!=this.lastFocusNode||r.focusOffset!=this.lastFocusOffset};ta.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged()){return}var r=this.getSelection(),t=this.cm;if(g&&s&&this.cm.display.gutterSpecs.length&&ia(r.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs});this.blur();this.focus();return}if(this.composing){return}this.rememberSelection();var e=fa(t,r.anchorNode,r.anchorOffset);var i=fa(t,r.focusNode,r.focusOffset);if(e&&i){Rn(t,(function(){Ho(t.doc,lo(e,i),$);if(e.bad||i.bad){t.curOp.selectionChanged=true}}))}};ta.prototype.pollContent=function(){if(this.readDOMTimeout!=null){clearTimeout(this.readDOMTimeout);this.readDOMTimeout=null}var r=this.cm,t=r.display,e=r.doc.sel.primary();var i=e.from(),n=e.to();if(i.ch==0&&i.line>r.firstLine()){i=ut(i.line-1,Zr(r.doc,i.line-1).length)}if(n.ch==Zr(r.doc,n.line).text.length&&n.line<r.lastLine()){n=ut(n.line+1,0)}if(i.line<t.viewFrom||n.line>t.viewTo-1){return false}var o,f,u;if(i.line==t.viewFrom||(o=zi(r,i.line))==0){f=it(t.view[0].line);u=t.view[0].node}else{f=it(t.view[o].line);u=t.view[o-1].node.nextSibling}var a=zi(r,n.line);var l,s;if(a==t.view.length-1){l=t.viewTo-1;s=t.lineDiv.lastChild}else{l=it(t.view[a+1].line)-1;s=t.view[a+1].node.previousSibling}if(!u){return false}var c=r.doc.splitLines(oa(r,u,s,f,l));var v=rt(r.doc,ut(f,0),ut(l,Zr(r.doc,l).text.length));while(c.length>1&&v.length>1){if(X(c)==X(v)){c.pop();v.pop();l--}else if(c[0]==v[0]){c.shift();v.shift();f++}else{break}}var h=0,d=0;var m=c[0],p=v[0],g=Math.min(m.length,p.length);while(h<g&&m.charCodeAt(h)==p.charCodeAt(h)){++h}var b=X(c),w=X(v);var k=Math.min(b.length-(c.length==1?h:0),w.length-(v.length==1?h:0));while(d<k&&b.charCodeAt(b.length-d-1)==w.charCodeAt(w.length-d-1)){++d}if(c.length==1&&v.length==1&&f==i.line){while(h&&h>i.ch&&b.charCodeAt(b.length-d-1)==w.charCodeAt(w.length-d-1)){h--;d++}}c[c.length-1]=b.slice(0,b.length-d).replace(/^\u200b+/,"");c[0]=c[0].slice(h).replace(/\u200b+$/,"");var C=ut(f,h);var M=ut(l,v.length?X(v).length-d:0);if(c.length>1||c[0]||at(C,M)){uf(r.doc,c,C,M,"+input");return true}};ta.prototype.ensurePolled=function(){this.forceCompositionEnd()};ta.prototype.reset=function(){this.forceCompositionEnd()};ta.prototype.forceCompositionEnd=function(){if(!this.composing){return}clearTimeout(this.readDOMTimeout);this.composing=null;this.updateFromDOM();this.div.blur();this.div.focus()};ta.prototype.readFromDOMSoon=function(){var r=this;if(this.readDOMTimeout!=null){return}this.readDOMTimeout=setTimeout((function(){r.readDOMTimeout=null;if(r.composing){if(r.composing.done){r.composing=null}else{return}}r.updateFromDOM()}),80)};ta.prototype.updateFromDOM=function(){var r=this;if(this.cm.isReadOnly()||!this.pollContent()){Rn(this.cm,(function(){return ji(r.cm)}))}};ta.prototype.setUneditable=function(r){r.contentEditable="false"};ta.prototype.onKeyPress=function(r){if(r.charCode==0||this.composing){return}r.preventDefault();if(!this.cm.isReadOnly()){On(this.cm,$u)(this.cm,String.fromCharCode(r.charCode==null?r.keyCode:r.charCode),0)}};ta.prototype.readOnlyChanged=function(r){this.div.contentEditable=String(r!="nocursor")};ta.prototype.onContextMenu=function(){};ta.prototype.resetPosition=function(){};ta.prototype.needsContentAttribute=true;function ea(r,t){var e=ei(r,t.line);if(!e||e.hidden){return null}var i=Zr(r.doc,t.line);var n=Ze(e,i,t.line);var o=mr(i,r.doc.direction),f="left";if(o){var u=hr(o,t.ch);f=u%2?"right":"left"}var a=fi(n.map,t.ch,f);a.offset=a.collapse=="right"?a.end:a.start;return a}function ia(r){for(var t=r;t;t=t.parentNode){if(/CodeMirror-gutter-wrapper/.test(t.className)){return true}}return false}function na(r,t){if(t){r.bad=true}return r}function oa(r,t,e,i,n){var o="",f=false,u=r.doc.lineSeparator(),a=false;function l(r){return function(t){return t.id==r}}function s(){if(f){o+=u;if(a){o+=u}f=a=false}}function c(r){if(r){s();o+=r}}function v(t){if(t.nodeType==1){var e=t.getAttribute("cm-text");if(e){c(e);return}var o=t.getAttribute("cm-marker"),h;if(o){var d=r.findMarks(ut(i,0),ut(n+1,0),l(+o));if(d.length&&(h=d[0].find(0))){c(rt(r.doc,h.from,h.to).join(u))}return}if(t.getAttribute("contenteditable")=="false"){return}var m=/^(pre|div|p|li|table|br)$/i.test(t.nodeName);if(!/^br$/i.test(t.nodeName)&&t.textContent.length==0){return}if(m){s()}for(var p=0;p<t.childNodes.length;p++){v(t.childNodes[p])}if(/^(pre|p)$/i.test(t.nodeName)){a=true}if(m){f=true}}else if(t.nodeType==3){c(t.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}}for(;;){v(t);if(t==e){break}t=t.nextSibling;a=false}return o}function fa(r,t,e){var i;if(t==r.display.lineDiv){i=r.display.lineDiv.childNodes[e];if(!i){return na(r.clipPos(ut(r.display.viewTo-1)),true)}t=null;e=0}else{for(i=t;;i=i.parentNode){if(!i||i==r.display.lineDiv){return null}if(i.parentNode&&i.parentNode==r.display.lineDiv){break}}}for(var n=0;n<r.display.view.length;n++){var o=r.display.view[n];if(o.node==i){return ua(o,t,e)}}}function ua(r,t,e){var i=r.text.firstChild,n=false;if(!t||!I(i,t)){return na(ut(it(r.line),0),true)}if(t==i){n=true;t=i.childNodes[e];e=0;if(!t){var o=r.rest?X(r.rest):r.line;return na(ut(it(o),o.text.length),n)}}var f=t.nodeType==3?t:null,u=t;if(!f&&t.childNodes.length==1&&t.firstChild.nodeType==3){f=t.firstChild;if(e){e=f.nodeValue.length}}while(u.parentNode!=i){u=u.parentNode}var a=r.measure,l=a.maps;function s(t,e,i){for(var n=-1;n<(l?l.length:0);n++){var o=n<0?a.map:l[n];for(var f=0;f<o.length;f+=3){var u=o[f+2];if(u==t||u==e){var s=it(n<0?r.line:r.rest[n]);var c=o[f]+i;if(i<0||u!=t){c=o[f+(i?1:0)]}return ut(s,c)}}}}var c=s(f,u,e);if(c){return na(c,n)}for(var v=u.nextSibling,h=f?f.nodeValue.length-e:0;v;v=v.nextSibling){c=s(v,v.firstChild,0);if(c){return na(ut(c.line,c.ch-h),n)}else{h+=v.textContent.length}}for(var d=u.previousSibling,m=e;d;d=d.previousSibling){c=s(d,d.firstChild,-1);if(c){return na(ut(c.line,c.ch+m),n)}else{m+=d.textContent.length}}}var aa=function(r){this.cm=r;this.prevInput="";this.pollingFast=false;this.polling=new G;this.hasSelection=false;this.composing=null;this.resetting=false};aa.prototype.init=function(r){var t=this;var e=this,i=this.cm;this.createField(r);var n=this.textarea;r.wrapper.insertBefore(this.wrapper,r.wrapper.firstChild);if(p){n.style.width="0px"}gr(n,"input",(function(){if(f&&u>=9&&t.hasSelection){t.hasSelection=null}e.poll()}));gr(n,"paste",(function(r){if(Cr(i,r)||Qu(r,i)){return}i.state.pasteIncoming=+new Date;e.fastPoll()}));function o(r){if(Cr(i,r)){return}if(i.somethingSelected()){Vu({lineWise:false,text:i.getSelections()})}else if(!i.options.lineWiseCopyCut){return}else{var t=Ku(i);Vu({lineWise:true,text:t.text});if(r.type=="cut"){i.setSelections(t.ranges,null,$)}else{e.prevInput="";n.value=t.text.join("\n");U(n)}}if(r.type=="cut"){i.state.cutIncoming=+new Date}}gr(n,"cut",o);gr(n,"copy",o);gr(r.scroller,"paste",(function(t){if(Ve(r,t)||Cr(i,t)){return}if(!n.dispatchEvent){i.state.pasteIncoming=+new Date;e.focus();return}var o=new Event("paste");o.clipboardData=t.clipboardData;n.dispatchEvent(o)}));gr(r.lineSpace,"selectstart",(function(t){if(!Ve(r,t)){xr(t)}}));gr(n,"compositionstart",(function(){var r=i.getCursor("from");if(e.composing){e.composing.range.clear()}e.composing={start:r,range:i.markText(r,i.getCursor("to"),{className:"CodeMirror-composing"})}}));gr(n,"compositionend",(function(){if(e.composing){e.poll();e.composing.range.clear();e.composing=null}}))};aa.prototype.createField=function(r){this.wrapper=Yu();this.textarea=this.wrapper.firstChild};aa.prototype.screenReaderLabelChanged=function(r){if(r){this.textarea.setAttribute("aria-label",r)}else{this.textarea.removeAttribute("aria-label")}};aa.prototype.prepareSelection=function(){var r=this.cm,t=r.display,e=r.doc;var i=Vi(r);if(r.options.moveInputWithCursor){var n=wi(r,e.sel.primary().head,"div");var o=t.wrapper.getBoundingClientRect(),f=t.lineDiv.getBoundingClientRect();i.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,n.top+f.top-o.top));i.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,n.left+f.left-o.left))}return i};aa.prototype.showSelection=function(r){var t=this.cm,e=t.display;N(e.cursorDiv,r.cursors);N(e.selectionDiv,r.selection);if(r.teTop!=null){this.wrapper.style.top=r.teTop+"px";this.wrapper.style.left=r.teLeft+"px"}};aa.prototype.reset=function(r){if(this.contextMenuPending||this.composing&&r){return}var t=this.cm;this.resetting=true;if(t.somethingSelected()){this.prevInput="";var e=t.getSelection();this.textarea.value=e;if(t.state.focused){U(this.textarea)}if(f&&u>=9){this.hasSelection=e}}else if(!r){this.prevInput=this.textarea.value="";if(f&&u>=9){this.hasSelection=null}}this.resetting=false};aa.prototype.getField=function(){return this.textarea};aa.prototype.supportsTouch=function(){return false};aa.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!b||R(this.textarea.ownerDocument)!=this.textarea)){try{this.textarea.focus()}catch(r){}}};aa.prototype.blur=function(){this.textarea.blur()};aa.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0};aa.prototype.receivedFocus=function(){this.slowPoll()};aa.prototype.slowPoll=function(){var r=this;if(this.pollingFast){return}this.polling.set(this.cm.options.pollInterval,(function(){r.poll();if(r.cm.state.focused){r.slowPoll()}}))};aa.prototype.fastPoll=function(){var r=false,t=this;t.pollingFast=true;function e(){var i=t.poll();if(!i&&!r){r=true;t.polling.set(60,e)}else{t.pollingFast=false;t.slowPoll()}}t.polling.set(20,e)};aa.prototype.poll=function(){var r=this;var t=this.cm,e=this.textarea,i=this.prevInput;if(this.contextMenuPending||this.resetting||!t.state.focused||zr(e)&&!i&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq){return false}var n=e.value;if(n==i&&!t.somethingSelected()){return false}if(f&&u>=9&&this.hasSelection===n||w&&/[\uf700-\uf7ff]/.test(n)){t.display.input.reset();return false}if(t.doc.sel==t.display.selForContextMenu){var o=n.charCodeAt(0);if(o==8203&&!i){i=""}if(o==8666){this.reset();return this.cm.execCommand("undo")}}var a=0,l=Math.min(i.length,n.length);while(a<l&&i.charCodeAt(a)==n.charCodeAt(a)){++a}Rn(t,(function(){$u(t,n.slice(a),i.length-a,null,r.composing?"*compose":null);if(n.length>1e3||n.indexOf("\n")>-1){e.value=r.prevInput=""}else{r.prevInput=n}if(r.composing){r.composing.range.clear();r.composing.range=t.markText(r.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"})}}));return true};aa.prototype.ensurePolled=function(){if(this.pollingFast&&this.poll()){this.pollingFast=false}};aa.prototype.onKeyPress=function(){if(f&&u>=9){this.hasSelection=null}this.fastPoll()};aa.prototype.onContextMenu=function(r){var t=this,e=t.cm,i=e.display,n=t.textarea;if(t.contextMenuPending){t.contextMenuPending()}var o=Ui(e,r),l=i.scroller.scrollTop;if(!o||v){return}var s=e.options.resetSelectionOnContextMenu;if(s&&e.doc.sel.contains(o)==-1){On(e,Ho)(e.doc,lo(o),$)}var c=n.style.cssText,h=t.wrapper.style.cssText;var d=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static";n.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(r.clientY-d.top-5)+"px; left: "+(r.clientX-d.left-5)+"px;\n z-index: 1000; background: "+(f?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);";var m;if(a){m=n.ownerDocument.defaultView.scrollY}i.input.focus();if(a){n.ownerDocument.defaultView.scrollTo(null,m)}i.input.reset();if(!e.somethingSelected()){n.value=t.prevInput=" "}t.contextMenuPending=g;i.selForContextMenu=e.doc.sel;clearTimeout(i.detectingSelectAll);function p(){if(n.selectionStart!=null){var r=e.somethingSelected();var o=""+(r?n.value:"");n.value="⇚";n.value=o;t.prevInput=r?"":"";n.selectionStart=1;n.selectionEnd=o.length;i.selForContextMenu=e.doc.sel}}function g(){if(t.contextMenuPending!=g){return}t.contextMenuPending=false;t.wrapper.style.cssText=h;n.style.cssText=c;if(f&&u<9){i.scrollbars.setScrollTop(i.scroller.scrollTop=l)}if(n.selectionStart!=null){if(!f||f&&u<9){p()}var r=0,o=function(){if(i.selForContextMenu==e.doc.sel&&n.selectionStart==0&&n.selectionEnd>0&&t.prevInput==""){On(e,Xo)(e)}else if(r++<10){i.detectingSelectAll=setTimeout(o,500)}else{i.selForContextMenu=null;i.input.reset()}};i.detectingSelectAll=setTimeout(o,200)}}if(f&&u>=9){p()}if(y){Nr(r);var b=function(){wr(window,"mouseup",b);setTimeout(g,20)};gr(window,"mouseup",b)}else{setTimeout(g,50)}};aa.prototype.readOnlyChanged=function(r){if(!r){this.reset()}this.textarea.disabled=r=="nocursor";this.textarea.readOnly=!!r};aa.prototype.setUneditable=function(){};aa.prototype.needsContentAttribute=false;function la(r,t){t=t?F(t):{};t.value=r.value;if(!t.tabindex&&r.tabIndex){t.tabindex=r.tabIndex}if(!t.placeholder&&r.placeholder){t.placeholder=r.placeholder}if(t.autofocus==null){var e=R(r.ownerDocument);t.autofocus=e==r||r.getAttribute("autofocus")!=null&&e==document.body}function i(){r.value=u.getValue()}var n;if(r.form){gr(r.form,"submit",i);if(!t.leaveSubmitMethodAlone){var o=r.form;n=o.submit;try{var f=o.submit=function(){i();o.submit=n;o.submit();o.submit=f}}catch(r){}}}t.finishInit=function(e){e.save=i;e.getTextArea=function(){return r};e.toTextArea=function(){e.toTextArea=isNaN;i();r.parentNode.removeChild(e.getWrapperElement());r.style.display="";if(r.form){wr(r.form,"submit",i);if(!t.leaveSubmitMethodAlone&&typeof r.form.submit=="function"){r.form.submit=n}}}};r.style.display="none";var u=Fu((function(t){return r.parentNode.insertBefore(t,r.nextSibling)}),t);return u}function sa(r){r.off=wr;r.on=gr;r.wheelEventPixels=no;r.Doc=Lf;r.splitLines=Ur;r.countColumn=P;r.findColumn=K;r.isWordChar=nr;r.Pass=V;r.signal=kr;r.Line=se;r.changeEnd=so;r.scrollbarModel=Mn;r.Pos=ut;r.cmpPos=at;r.modes=Pr;r.mimeModes=Gr;r.resolveMode=Vr;r.getMode=$r;r.modeExtensions=Qr;r.extendMode=Jr;r.copyState=Kr;r.startState=Yr;r.innerMode=qr;r.commands=ru;r.keyMap=Pf;r.keyName=Qf;r.isModifierKey=Vf;r.lookupKey=Hf;r.normalizeKeyMap=_f;r.StringStream=Xr;r.SharedTextMarker=kf;r.TextMarker=bf;r.LineWidget=df;r.e_preventDefault=xr;r.e_stopPropagation=Lr;r.e_stop=Nr;r.addClass=O;r.contains=I;r.rmClass=L;r.keyNames=zf}zu(Fu);Xu(Fu);var ca="iter insert remove copy getEditor constructor".split(" ");for(var va in Lf.prototype){if(Lf.prototype.hasOwnProperty(va)&&_(ca,va)<0){Fu.prototype[va]=function(r){return function(){return r.apply(this.doc,arguments)}}(Lf.prototype[va])}}yr(Lf);Fu.inputStyles={textarea:aa,contenteditable:ta};Fu.defineMode=function(r){if(!Fu.defaults.mode&&r!="null"){Fu.defaults.mode=r}_r.apply(this,arguments)};Fu.defineMIME=Hr;Fu.defineMode("null",(function(){return{token:function(r){return r.skipToEnd()}}}));Fu.defineMIME("text/plain","null");Fu.defineExtension=function(r,t){Fu.prototype[r]=t};Fu.defineDocExtension=function(r,t){Lf.prototype[r]=t};Fu.fromTextArea=la;sa(Fu);Fu.version="5.65.9";return Fu}))}));n((function(r,t){(function(r){r(f)})((function(r){r.defineMode("javascript",(function(t,e){var i=t.indentUnit;var n=e.statementIndent;var o=e.jsonld;var f=e.json||o;var u=e.trackScope!==false;var a=e.typescript;var l=e.wordCharacters||/[\w$\xa1-\uffff]/;var s=function(){function r(r){return{type:r,style:"keyword"}}var t=r("keyword a"),e=r("keyword b"),i=r("keyword c"),n=r("keyword d");var o=r("operator"),f={type:"atom",style:"atom"};return{if:r("if"),while:t,with:t,else:e,do:e,try:e,finally:e,return:n,break:n,continue:n,new:r("new"),delete:i,void:i,throw:i,debugger:r("debugger"),var:r("var"),const:r("var"),let:r("var"),function:r("function"),catch:r("catch"),for:r("for"),switch:r("switch"),case:r("case"),default:r("default"),in:o,typeof:o,instanceof:o,true:f,false:f,null:f,undefined:f,NaN:f,Infinity:f,this:r("this"),class:r("class"),super:r("atom"),yield:i,export:r("export"),import:r("import"),extends:i,await:i}}();var c=/[+\-*&%=<>!?|~^@]/;var v=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function h(r){var t=false,e,i=false;while((e=r.next())!=null){if(!t){if(e=="/"&&!i)return;if(e=="[")i=true;else if(i&&e=="]")i=false}t=!t&&e=="\\"}}var d,m;function p(r,t,e){d=r;m=e;return t}function g(r,t){var e=r.next();if(e=='"'||e=="'"){t.tokenize=b(e);return t.tokenize(r,t)}else if(e=="."&&r.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/)){return p("number","number")}else if(e=="."&&r.match("..")){return p("spread","meta")}else if(/[\[\]{}\(\),;\:\.]/.test(e)){return p(e)}else if(e=="="&&r.eat(">")){return p("=>","operator")}else if(e=="0"&&r.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/)){return p("number","number")}else if(/\d/.test(e)){r.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/);return p("number","number")}else if(e=="/"){if(r.eat("*")){t.tokenize=w;return w(r,t)}else if(r.eat("/")){r.skipToEnd();return p("comment","comment")}else if(nt(r,t,1)){h(r);r.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/);return p("regexp","string-2")}else{r.eat("=");return p("operator","operator",r.current())}}else if(e=="`"){t.tokenize=k;return k(r,t)}else if(e=="#"&&r.peek()=="!"){r.skipToEnd();return p("meta","meta")}else if(e=="#"&&r.eatWhile(l)){return p("variable","property")}else if(e=="<"&&r.match("!--")||e=="-"&&r.match("->")&&!/\S/.test(r.string.slice(0,r.start))){r.skipToEnd();return p("comment","comment")}else if(c.test(e)){if(e!=">"||!t.lexical||t.lexical.type!=">"){if(r.eat("=")){if(e=="!"||e=="=")r.eat("=")}else if(/[<>*+\-|&?]/.test(e)){r.eat(e);if(e==">")r.eat(e)}}if(e=="?"&&r.eat("."))return p(".");return p("operator","operator",r.current())}else if(l.test(e)){r.eatWhile(l);var i=r.current();if(t.lastType!="."){if(s.propertyIsEnumerable(i)){var n=s[i];return p(n.type,n.style,i)}if(i=="async"&&r.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/,false))return p("async","keyword",i)}return p("variable","variable",i)}}function b(r){return function(t,e){var i=false,n;if(o&&t.peek()=="@"&&t.match(v)){e.tokenize=g;return p("jsonld-keyword","meta")}while((n=t.next())!=null){if(n==r&&!i)break;i=!i&&n=="\\"}if(!i)e.tokenize=g;return p("string","string")}}function w(r,t){var e=false,i;while(i=r.next()){if(i=="/"&&e){t.tokenize=g;break}e=i=="*"}return p("comment","comment")}function k(r,t){var e=false,i;while((i=r.next())!=null){if(!e&&(i=="`"||i=="$"&&r.eat("{"))){t.tokenize=g;break}e=!e&&i=="\\"}return p("quasi","string-2",r.current())}var C="([{}])";function M(r,t){if(t.fatArrowAt)t.fatArrowAt=null;var e=r.string.indexOf("=>",r.start);if(e<0)return;if(a){var i=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(r.string.slice(r.start,e));if(i)e=i.index}var n=0,o=false;for(var f=e-1;f>=0;--f){var u=r.string.charAt(f);var s=C.indexOf(u);if(s>=0&&s<3){if(!n){++f;break}if(--n==0){if(u=="(")o=true;break}}else if(s>=3&&s<6){++n}else if(l.test(u)){o=true}else if(/["'\/`]/.test(u)){for(;;--f){if(f==0)return;var c=r.string.charAt(f-1);if(c==u&&r.string.charAt(f-2)!="\\"){f--;break}}}else if(o&&!n){++f;break}}if(o&&!n)t.fatArrowAt=f}var A={atom:true,number:true,variable:true,string:true,regexp:true,this:true,import:true,"jsonld-keyword":true};function y(r,t,e,i,n,o){this.indented=r;this.column=t;this.type=e;this.prev=n;this.info=o;if(i!=null)this.align=i}function x(r,t){if(!u)return false;for(var e=r.localVars;e;e=e.next)if(e.name==t)return true;for(var i=r.context;i;i=i.prev){for(var e=i.vars;e;e=e.next)if(e.name==t)return true}}function L(r,t,e,i,n){var o=r.cc;S.state=r;S.stream=n;S.marked=null,S.cc=o;S.style=t;if(!r.lexical.hasOwnProperty("align"))r.lexical.align=true;while(true){var u=o.length?o.pop():f?V:_;if(u(e,i)){while(o.length&&o[o.length-1].lex)o.pop()();if(S.marked)return S.marked;if(e=="variable"&&x(r,i))return"variable-2";return t}}}var S={state:null,column:null,marked:null,cc:null};function N(){for(var r=arguments.length-1;r>=0;r--)S.cc.push(arguments[r])}function E(){N.apply(null,arguments);return true}function D(r,t){for(var e=t;e;e=e.next)if(e.name==r)return true;return false}function T(r){var t=S.state;S.marked="def";if(!u)return;if(t.context){if(t.lexical.info=="var"&&t.context&&t.context.block){var i=I(r,t.context);if(i!=null){t.context=i;return}}else if(!D(r,t.localVars)){t.localVars=new B(r,t.localVars);return}}if(e.globalVars&&!D(r,t.globalVars))t.globalVars=new B(r,t.globalVars)}function I(r,t){if(!t){return null}else if(t.block){var e=I(r,t.prev);if(!e)return null;if(e==t.prev)return t;return new O(e,t.vars,true)}else if(D(r,t.vars)){return t}else{return new O(t.prev,new B(r,t.vars),false)}}function R(r){return r=="public"||r=="private"||r=="protected"||r=="abstract"||r=="readonly"}function O(r,t,e){this.prev=r;this.vars=t;this.block=e}function B(r,t){this.name=r;this.next=t}var U=new B("this",new B("arguments",null));function z(){S.state.context=new O(S.state.context,S.state.localVars,false);S.state.localVars=U}function j(){S.state.context=new O(S.state.context,S.state.localVars,true);S.state.localVars=null}z.lex=j.lex=true;function W(){S.state.localVars=S.state.context.vars;S.state.context=S.state.context.prev}W.lex=true;function F(r,t){var e=function(){var e=S.state,i=e.indented;if(e.lexical.type=="stat")i=e.lexical.indented;else for(var n=e.lexical;n&&n.type==")"&&n.align;n=n.prev)i=n.indented;e.lexical=new y(i,S.stream.column(),r,null,e.lexical,t)};e.lex=true;return e}function P(){var r=S.state;if(r.lexical.prev){if(r.lexical.type==")")r.indented=r.lexical.indented;r.lexical=r.lexical.prev}}P.lex=true;function G(r){function t(e){if(e==r)return E();else if(r==";"||e=="}"||e==")"||e=="]")return N();else return E(t)}return t}function _(r,t){if(r=="var")return E(F("vardef",t),Nr,G(";"),P);if(r=="keyword a")return E(F("form"),Q,_,P);if(r=="keyword b")return E(F("form"),_,P);if(r=="keyword d")return S.stream.match(/^\s*$/,false)?E():E(F("stat"),K,G(";"),P);if(r=="debugger")return E(G(";"));if(r=="{")return E(F("}"),j,vr,P,W);if(r==";")return E();if(r=="if"){if(S.state.lexical.info=="else"&&S.state.cc[S.state.cc.length-1]==P)S.state.cc.pop()();return E(F("form"),Q,_,P,Or)}if(r=="function")return E(jr);if(r=="for")return E(F("form"),j,Br,_,W,P);if(r=="class"||a&&t=="interface"){S.marked="keyword";return E(F("form",r=="class"?r:t),_r,P)}if(r=="variable"){if(a&&t=="declare"){S.marked="keyword";return E(_)}else if(a&&(t=="module"||t=="enum"||t=="type")&&S.stream.match(/^\s*\w/,false)){S.marked="keyword";if(t=="enum")return E(tt);else if(t=="type")return E(Fr,G("operator"),gr,G(";"));else return E(F("form"),Er,G("{"),F("}"),vr,P,P)}else if(a&&t=="namespace"){S.marked="keyword";return E(F("form"),V,_,P)}else if(a&&t=="abstract"){S.marked="keyword";return E(_)}else{return E(F("stat"),or)}}if(r=="switch")return E(F("form"),Q,G("{"),F("}","switch"),j,vr,P,P,W);if(r=="case")return E(V,G(":"));if(r=="default")return E(G(":"));if(r=="catch")return E(F("form"),z,H,_,P,W);if(r=="export")return E(F("stat"),Qr,P);if(r=="import")return E(F("stat"),Kr,P);if(r=="async")return E(_);if(t=="@")return E(V,_);return N(F("stat"),V,G(";"),P)}function H(r){if(r=="(")return E(Pr,G(")"))}function V(r,t){return J(r,t,false)}function $(r,t){return J(r,t,true)}function Q(r){if(r!="(")return N();return E(F(")"),K,G(")"),P)}function J(r,t,e){if(S.state.fatArrowAt==S.stream.start){var i=e?tr:rr;if(r=="(")return E(z,F(")"),sr(Pr,")"),P,G("=>"),i,W);else if(r=="variable")return N(z,Er,G("=>"),i,W)}var n=e?Y:q;if(A.hasOwnProperty(r))return E(n);if(r=="function")return E(jr,n);if(r=="class"||a&&t=="interface"){S.marked="keyword";return E(F("form"),Gr,P)}if(r=="keyword c"||r=="async")return E(e?$:V);if(r=="(")return E(F(")"),K,G(")"),P,n);if(r=="operator"||r=="spread")return E(e?$:V);if(r=="[")return E(F("]"),rt,P,n);if(r=="{")return cr(ur,"}",null,n);if(r=="quasi")return N(X,n);if(r=="new")return E(er(e));return E()}function K(r){if(r.match(/[;\}\)\],]/))return N();return N(V)}function q(r,t){if(r==",")return E(K);return Y(r,t,false)}function Y(r,t,e){var i=e==false?q:Y;var n=e==false?V:$;if(r=="=>")return E(z,e?tr:rr,W);if(r=="operator"){if(/\+\+|--/.test(t)||a&&t=="!")return E(i);if(a&&t=="<"&&S.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/,false))return E(F(">"),sr(gr,">"),P,i);if(t=="?")return E(V,G(":"),n);return E(n)}if(r=="quasi"){return N(X,i)}if(r==";")return;if(r=="(")return cr($,")","call",i);if(r==".")return E(fr,i);if(r=="[")return E(F("]"),K,G("]"),P,i);if(a&&t=="as"){S.marked="keyword";return E(gr,i)}if(r=="regexp"){S.state.lastType=S.marked="operator";S.stream.backUp(S.stream.pos-S.stream.start-1);return E(n)}}function X(r,t){if(r!="quasi")return N();if(t.slice(t.length-2)!="${")return E(X);return E(K,Z)}function Z(r){if(r=="}"){S.marked="string-2";S.state.tokenize=k;return E(X)}}function rr(r){M(S.stream,S.state);return N(r=="{"?_:V)}function tr(r){M(S.stream,S.state);return N(r=="{"?_:$)}function er(r){return function(t){if(t==".")return E(r?nr:ir);else if(t=="variable"&&a)return E(xr,r?Y:q);else return N(r?$:V)}}function ir(r,t){if(t=="target"){S.marked="keyword";return E(q)}}function nr(r,t){if(t=="target"){S.marked="keyword";return E(Y)}}function or(r){if(r==":")return E(P,_);return N(q,G(";"),P)}function fr(r){if(r=="variable"){S.marked="property";return E()}}function ur(r,t){if(r=="async"){S.marked="property";return E(ur)}else if(r=="variable"||S.style=="keyword"){S.marked="property";if(t=="get"||t=="set")return E(ar);var e;if(a&&S.state.fatArrowAt==S.stream.start&&(e=S.stream.match(/^\s*:\s*/,false)))S.state.fatArrowAt=S.stream.pos+e[0].length;return E(lr)}else if(r=="number"||r=="string"){S.marked=o?"property":S.style+" property";return E(lr)}else if(r=="jsonld-keyword"){return E(lr)}else if(a&&R(t)){S.marked="keyword";return E(ur)}else if(r=="["){return E(V,hr,G("]"),lr)}else if(r=="spread"){return E($,lr)}else if(t=="*"){S.marked="keyword";return E(ur)}else if(r==":"){return N(lr)}}function ar(r){if(r!="variable")return N(lr);S.marked="property";return E(jr)}function lr(r){if(r==":")return E($);if(r=="(")return N(jr)}function sr(r,t,e){function i(n,o){if(e?e.indexOf(n)>-1:n==","){var f=S.state.lexical;if(f.info=="call")f.pos=(f.pos||0)+1;return E((function(e,i){if(e==t||i==t)return N();return N(r)}),i)}if(n==t||o==t)return E();if(e&&e.indexOf(";")>-1)return N(r);return E(G(t))}return function(e,n){if(e==t||n==t)return E();return N(r,i)}}function cr(r,t,e){for(var i=3;i<arguments.length;i++)S.cc.push(arguments[i]);return E(F(t,e),sr(r,t),P)}function vr(r){if(r=="}")return E();return N(_,vr)}function hr(r,t){if(a){if(r==":")return E(gr);if(t=="?")return E(hr)}}function dr(r,t){if(a&&(r==":"||t=="in"))return E(gr)}function mr(r){if(a&&r==":"){if(S.stream.match(/^\s*\w+\s+is\b/,false))return E(V,pr,gr);else return E(gr)}}function pr(r,t){if(t=="is"){S.marked="keyword";return E()}}function gr(r,t){if(t=="keyof"||t=="typeof"||t=="infer"||t=="readonly"){S.marked="keyword";return E(t=="typeof"?$:gr)}if(r=="variable"||t=="void"){S.marked="type";return E(yr)}if(t=="|"||t=="&")return E(gr);if(r=="string"||r=="number"||r=="atom")return E(yr);if(r=="[")return E(F("]"),sr(gr,"]",","),P,yr);if(r=="{")return E(F("}"),wr,P,yr);if(r=="(")return E(sr(Ar,")"),br,yr);if(r=="<")return E(sr(gr,">"),gr);if(r=="quasi"){return N(Cr,yr)}}function br(r){if(r=="=>")return E(gr)}function wr(r){if(r.match(/[\}\)\]]/))return E();if(r==","||r==";")return E(wr);return N(kr,wr)}function kr(r,t){if(r=="variable"||S.style=="keyword"){S.marked="property";return E(kr)}else if(t=="?"||r=="number"||r=="string"){return E(kr)}else if(r==":"){return E(gr)}else if(r=="["){return E(G("variable"),dr,G("]"),kr)}else if(r=="("){return N(Wr,kr)}else if(!r.match(/[;\}\)\],]/)){return E()}}function Cr(r,t){if(r!="quasi")return N();if(t.slice(t.length-2)!="${")return E(Cr);return E(gr,Mr)}function Mr(r){if(r=="}"){S.marked="string-2";S.state.tokenize=k;return E(Cr)}}function Ar(r,t){if(r=="variable"&&S.stream.match(/^\s*[?:]/,false)||t=="?")return E(Ar);if(r==":")return E(gr);if(r=="spread")return E(Ar);return N(gr)}function yr(r,t){if(t=="<")return E(F(">"),sr(gr,">"),P,yr);if(t=="|"||r=="."||t=="&")return E(gr);if(r=="[")return E(gr,G("]"),yr);if(t=="extends"||t=="implements"){S.marked="keyword";return E(gr)}if(t=="?")return E(gr,G(":"),gr)}function xr(r,t){if(t=="<")return E(F(">"),sr(gr,">"),P,yr)}function Lr(){return N(gr,Sr)}function Sr(r,t){if(t=="=")return E(gr)}function Nr(r,t){if(t=="enum"){S.marked="keyword";return E(tt)}return N(Er,hr,Ir,Rr)}function Er(r,t){if(a&&R(t)){S.marked="keyword";return E(Er)}if(r=="variable"){T(t);return E()}if(r=="spread")return E(Er);if(r=="[")return cr(Tr,"]");if(r=="{")return cr(Dr,"}")}function Dr(r,t){if(r=="variable"&&!S.stream.match(/^\s*:/,false)){T(t);return E(Ir)}if(r=="variable")S.marked="property";if(r=="spread")return E(Er);if(r=="}")return N();if(r=="[")return E(V,G("]"),G(":"),Dr);return E(G(":"),Er,Ir)}function Tr(){return N(Er,Ir)}function Ir(r,t){if(t=="=")return E($)}function Rr(r){if(r==",")return E(Nr)}function Or(r,t){if(r=="keyword b"&&t=="else")return E(F("form","else"),_,P)}function Br(r,t){if(t=="await")return E(Br);if(r=="(")return E(F(")"),Ur,P)}function Ur(r){if(r=="var")return E(Nr,zr);if(r=="variable")return E(zr);return N(zr)}function zr(r,t){if(r==")")return E();if(r==";")return E(zr);if(t=="in"||t=="of"){S.marked="keyword";return E(V,zr)}return N(V,zr)}function jr(r,t){if(t=="*"){S.marked="keyword";return E(jr)}if(r=="variable"){T(t);return E(jr)}if(r=="(")return E(z,F(")"),sr(Pr,")"),P,mr,_,W);if(a&&t=="<")return E(F(">"),sr(Lr,">"),P,jr)}function Wr(r,t){if(t=="*"){S.marked="keyword";return E(Wr)}if(r=="variable"){T(t);return E(Wr)}if(r=="(")return E(z,F(")"),sr(Pr,")"),P,mr,W);if(a&&t=="<")return E(F(">"),sr(Lr,">"),P,Wr)}function Fr(r,t){if(r=="keyword"||r=="variable"){S.marked="type";return E(Fr)}else if(t=="<"){return E(F(">"),sr(Lr,">"),P)}}function Pr(r,t){if(t=="@")E(V,Pr);if(r=="spread")return E(Pr);if(a&&R(t)){S.marked="keyword";return E(Pr)}if(a&&r=="this")return E(hr,Ir);return N(Er,hr,Ir)}function Gr(r,t){if(r=="variable")return _r(r,t);return Hr(r,t)}function _r(r,t){if(r=="variable"){T(t);return E(Hr)}}function Hr(r,t){if(t=="<")return E(F(">"),sr(Lr,">"),P,Hr);if(t=="extends"||t=="implements"||a&&r==","){if(t=="implements")S.marked="keyword";return E(a?gr:V,Hr)}if(r=="{")return E(F("}"),Vr,P)}function Vr(r,t){if(r=="async"||r=="variable"&&(t=="static"||t=="get"||t=="set"||a&&R(t))&&S.stream.match(/^\s+[\w$\xa1-\uffff]/,false)){S.marked="keyword";return E(Vr)}if(r=="variable"||S.style=="keyword"){S.marked="property";return E($r,Vr)}if(r=="number"||r=="string")return E($r,Vr);if(r=="[")return E(V,hr,G("]"),$r,Vr);if(t=="*"){S.marked="keyword";return E(Vr)}if(a&&r=="(")return N(Wr,Vr);if(r==";"||r==",")return E(Vr);if(r=="}")return E();if(t=="@")return E(V,Vr)}function $r(r,t){if(t=="!")return E($r);if(t=="?")return E($r);if(r==":")return E(gr,Ir);if(t=="=")return E($);var e=S.state.lexical.prev,i=e&&e.info=="interface";return N(i?Wr:jr)}function Qr(r,t){if(t=="*"){S.marked="keyword";return E(Zr,G(";"))}if(t=="default"){S.marked="keyword";return E(V,G(";"))}if(r=="{")return E(sr(Jr,"}"),Zr,G(";"));return N(_)}function Jr(r,t){if(t=="as"){S.marked="keyword";return E(G("variable"))}if(r=="variable")return N($,Jr)}function Kr(r){if(r=="string")return E();if(r=="(")return N(V);if(r==".")return N(q);return N(qr,Yr,Zr)}function qr(r,t){if(r=="{")return cr(qr,"}");if(r=="variable")T(t);if(t=="*")S.marked="keyword";return E(Xr)}function Yr(r){if(r==",")return E(qr,Yr)}function Xr(r,t){if(t=="as"){S.marked="keyword";return E(qr)}}function Zr(r,t){if(t=="from"){S.marked="keyword";return E(V)}}function rt(r){if(r=="]")return E();return N(sr($,"]"))}function tt(){return N(F("form"),Er,G("{"),F("}"),sr(et,"}"),P,P)}function et(){return N(Er,Ir)}function it(r,t){return r.lastType=="operator"||r.lastType==","||c.test(t.charAt(0))||/[,.]/.test(t.charAt(0))}function nt(r,t,e){return t.tokenize==g&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(t.lastType)||t.lastType=="quasi"&&/\{\s*$/.test(r.string.slice(0,r.pos-(e||0)))}return{startState:function(r){var t={tokenize:g,lastType:"sof",cc:[],lexical:new y((r||0)-i,0,"block",false),localVars:e.localVars,context:e.localVars&&new O(null,null,false),indented:r||0};if(e.globalVars&&typeof e.globalVars=="object")t.globalVars=e.globalVars;return t},token:function(r,t){if(r.sol()){if(!t.lexical.hasOwnProperty("align"))t.lexical.align=false;t.indented=r.indentation();M(r,t)}if(t.tokenize!=w&&r.eatSpace())return null;var e=t.tokenize(r,t);if(d=="comment")return e;t.lastType=d=="operator"&&(m=="++"||m=="--")?"incdec":d;return L(t,e,d,m,r)},indent:function(t,o){if(t.tokenize==w||t.tokenize==k)return r.Pass;if(t.tokenize!=g)return 0;var f=o&&o.charAt(0),u=t.lexical,a;if(!/^\s*else\b/.test(o))for(var l=t.cc.length-1;l>=0;--l){var s=t.cc[l];if(s==P)u=u.prev;else if(s!=Or&&s!=W)break}while((u.type=="stat"||u.type=="form")&&(f=="}"||(a=t.cc[t.cc.length-1])&&(a==q||a==Y)&&!/^[,\.=+\-*:?[\(]/.test(o)))u=u.prev;if(n&&u.type==")"&&u.prev.type=="stat")u=u.prev;var c=u.type,v=f==c;if(c=="vardef")return u.indented+(t.lastType=="operator"||t.lastType==","?u.info.length+1:0);else if(c=="form"&&f=="{")return u.indented;else if(c=="form")return u.indented+i;else if(c=="stat")return u.indented+(it(t,o)?n||i:0);else if(u.info=="switch"&&!v&&e.doubleIndentSwitch!=false)return u.indented+(/^(?:case|default)\b/.test(o)?i:2*i);else if(u.align)return u.column+(v?0:1);else return u.indented+(v?0:i)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:f?null:"/*",blockCommentEnd:f?null:"*/",blockCommentContinue:f?null:" * ",lineComment:f?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:f?"json":"javascript",jsonldMode:o,jsonMode:f,expressionAllowed:nt,skipExpression:function(t){L(t,"atom","atom","true",new r.StringStream("",2,null))}}}));r.registerHelper("wordChars","javascript",/[\w$]/);r.defineMIME("text/javascript","javascript");r.defineMIME("text/ecmascript","javascript");r.defineMIME("application/javascript","javascript");r.defineMIME("application/x-javascript","javascript");r.defineMIME("application/ecmascript","javascript");r.defineMIME("application/json",{name:"javascript",json:true});r.defineMIME("application/x-json",{name:"javascript",json:true});r.defineMIME("application/manifest+json",{name:"javascript",json:true});r.defineMIME("application/ld+json",{name:"javascript",jsonld:true});r.defineMIME("text/typescript",{name:"javascript",typescript:true});r.defineMIME("application/typescript",{name:"javascript",typescript:true})}))}));n((function(r,t){(function(r){r(f)})((function(r){r.defineMode("jinja2",(function(){var r=["and","as","block","endblock","by","cycle","debug","else","elif","extends","filter","endfilter","firstof","do","for","endfor","if","endif","ifchanged","endifchanged","ifequal","endifequal","ifnotequal","set","raw","endraw","endifnotequal","in","include","load","not","now","or","parsed","regroup","reversed","spaceless","call","endcall","macro","endmacro","endspaceless","ssi","templatetag","openblock","closeblock","openvariable","closevariable","without","context","openbrace","closebrace","opencomment","closecomment","widthratio","url","with","endwith","get_current_language","trans","endtrans","noop","blocktrans","endblocktrans","get_available_languages","get_current_language_bidi","pluralize","autoescape","endautoescape"],t=/^[+\-*&%=<>!?|~^]/,e=/^[:\[\(\{]/,i=["true","false"],n=/^(\d[+\-\*\/])?\d+(\.\d+)?/;r=new RegExp("(("+r.join(")|(")+"))\\b");i=new RegExp("(("+i.join(")|(")+"))\\b");function o(o,f){var u=o.peek();if(f.incomment){if(!o.skipTo("#}")){o.skipToEnd()}else{o.eatWhile(/\#|}/);f.incomment=false}return"comment"}else if(f.intag){if(f.operator){f.operator=false;if(o.match(i)){return"atom"}if(o.match(n)){return"number"}}if(f.sign){f.sign=false;if(o.match(i)){return"atom"}if(o.match(n)){return"number"}}if(f.instring){if(u==f.instring){f.instring=false}o.next();return"string"}else if(u=="'"||u=='"'){f.instring=u;o.next();return"string"}else if(f.inbraces>0&&u==")"){o.next();f.inbraces--}else if(u=="("){o.next();f.inbraces++}else if(f.inbrackets>0&&u=="]"){o.next();f.inbrackets--}else if(u=="["){o.next();f.inbrackets++}else if(!f.lineTag&&(o.match(f.intag+"}")||o.eat("-")&&o.match(f.intag+"}"))){f.intag=false;return"tag"}else if(o.match(t)){f.operator=true;return"operator"}else if(o.match(e)){f.sign=true}else{if(o.column()==1&&f.lineTag&&o.match(r)){return"keyword"}if(o.eat(" ")||o.sol()){if(o.match(r)){return"keyword"}if(o.match(i)){return"atom"}if(o.match(n)){return"number"}if(o.sol()){o.next()}}else{o.next()}}return"variable"}else if(o.eat("{")){if(o.eat("#")){f.incomment=true;if(!o.skipTo("#}")){o.skipToEnd()}else{o.eatWhile(/\#|}/);f.incomment=false}return"comment"}else if(u=o.eat(/\{|%/)){f.intag=u;f.inbraces=0;f.inbrackets=0;if(u=="{"){f.intag="}"}o.eat("-");return"tag"}}else if(o.eat("#")){if(o.peek()=="#"){o.skipToEnd();return"comment"}else if(!o.eol()){f.intag=true;f.lineTag=true;f.inbraces=0;f.inbrackets=0;return"tag"}}o.next()}return{startState:function(){return{tokenize:o,inbrackets:0,inbraces:0}},token:function(r,t){var e=t.tokenize(r,t);if(r.eol()&&t.lineTag&&!t.instring&&t.inbraces==0&&t.inbrackets==0){t.intag=false;t.lineTag=false}return e},blockCommentStart:"{#",blockCommentEnd:"#}",lineComment:"##"}}));r.defineMIME("text/jinja2","jinja2")}))}));n((function(r,t){(function(r){r(f)})((function(r){var t="CodeMirror-activeline";var e="CodeMirror-activeline-background";var i="CodeMirror-activeline-gutter";r.defineOption("styleActiveLine",false,(function(t,e,i){var o=i==r.Init?false:i;if(e==o)return;if(o){t.off("beforeSelectionChange",u);n(t);delete t.state.activeLines}if(e){t.state.activeLines=[];f(t,t.listSelections());t.on("beforeSelectionChange",u)}}));function n(r){for(var n=0;n<r.state.activeLines.length;n++){r.removeLineClass(r.state.activeLines[n],"wrap",t);r.removeLineClass(r.state.activeLines[n],"background",e);r.removeLineClass(r.state.activeLines[n],"gutter",i)}}function o(r,t){if(r.length!=t.length)return false;for(var e=0;e<r.length;e++)if(r[e]!=t[e])return false;return true}function f(r,f){var u=[];for(var a=0;a<f.length;a++){var l=f[a];var s=r.getOption("styleActiveLine");if(typeof s=="object"&&s.nonEmpty?l.anchor.line!=l.head.line:!l.empty())continue;var c=r.getLineHandleVisualStart(l.head.line);if(u[u.length-1]!=c)u.push(c)}if(o(r.state.activeLines,u))return;r.operation((function(){n(r);for(var o=0;o<u.length;o++){r.addLineClass(u[o],"wrap",t);r.addLineClass(u[o],"background",e);r.addLineClass(u[o],"gutter",i)}r.state.activeLines=u}))}function u(r,t){f(r,t.ranges)}}))}));n((function(r,t){(function(r){r(f)})((function(r){var t=/MSIE \d/.test(navigator.userAgent)&&(document.documentMode==null||document.documentMode<8);var e=r.Pos;var i={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<","<":">>",">":"<<"};function n(r){return r&&r.bracketRegex||/[(){}[\]]/}function o(r,t,o){var u=r.getLineHandle(t.line),a=t.ch-1;var l=o&&o.afterCursor;if(l==null)l=/(^| )cm-fat-cursor($| )/.test(r.getWrapperElement().className);var s=n(o);var c=!l&&a>=0&&s.test(u.text.charAt(a))&&i[u.text.charAt(a)]||s.test(u.text.charAt(a+1))&&i[u.text.charAt(++a)];if(!c)return null;var v=c.charAt(1)==">"?1:-1;if(o&&o.strict&&v>0!=(a==t.ch))return null;var h=r.getTokenTypeAt(e(t.line,a+1));var d=f(r,e(t.line,a+(v>0?1:0)),v,h,o);if(d==null)return null;return{from:e(t.line,a),to:d&&d.pos,match:d&&d.ch==c.charAt(0),forward:v>0}}function f(r,t,o,f,u){var a=u&&u.maxScanLineLength||1e4;var l=u&&u.maxScanLines||1e3;var s=[];var c=n(u);var v=o>0?Math.min(t.line+l,r.lastLine()+1):Math.max(r.firstLine()-1,t.line-l);for(var h=t.line;h!=v;h+=o){var d=r.getLine(h);if(!d)continue;var m=o>0?0:d.length-1,p=o>0?d.length:-1;if(d.length>a)continue;if(h==t.line)m=t.ch-(o<0?1:0);for(;m!=p;m+=o){var g=d.charAt(m);if(c.test(g)&&(f===undefined||(r.getTokenTypeAt(e(h,m+1))||"")==(f||""))){var b=i[g];if(b&&b.charAt(1)==">"==o>0)s.push(g);else if(!s.length)return{pos:e(h,m),ch:g};else s.pop()}}}return h-o==(o>0?r.lastLine():r.firstLine())?false:null}function u(r,i,n){var f=r.state.matchBrackets.maxHighlightLineLength||1e3,u=n&&n.highlightNonMatching;var a=[],l=r.listSelections();for(var s=0;s<l.length;s++){var c=l[s].empty()&&o(r,l[s].head,n);if(c&&(c.match||u!==false)&&r.getLine(c.from.line).length<=f){var v=c.match?"CodeMirror-matchingbracket":"CodeMirror-nonmatchingbracket";a.push(r.markText(c.from,e(c.from.line,c.from.ch+1),{className:v}));if(c.to&&r.getLine(c.to.line).length<=f)a.push(r.markText(c.to,e(c.to.line,c.to.ch+1),{className:v}))}}if(a.length){if(t&&r.state.focused)r.focus();var h=function(){r.operation((function(){for(var r=0;r<a.length;r++)a[r].clear()}))};if(i)setTimeout(h,800);else return h}}function a(r){r.operation((function(){if(r.state.matchBrackets.currentlyHighlighted){r.state.matchBrackets.currentlyHighlighted();r.state.matchBrackets.currentlyHighlighted=null}r.state.matchBrackets.currentlyHighlighted=u(r,false,r.state.matchBrackets)}))}function l(r){if(r.state.matchBrackets&&r.state.matchBrackets.currentlyHighlighted){r.state.matchBrackets.currentlyHighlighted();r.state.matchBrackets.currentlyHighlighted=null}}r.defineOption("matchBrackets",false,(function(t,e,i){if(i&&i!=r.Init){t.off("cursorActivity",a);t.off("focus",a);t.off("blur",l);l(t)}if(e){t.state.matchBrackets=typeof e=="object"?e:{};t.on("cursorActivity",a);t.on("focus",a);t.on("blur",l)}}));r.defineExtension("matchBrackets",(function(){u(this,true)}));r.defineExtension("findMatchingBracket",(function(r,t,e){if(e||typeof t=="boolean"){if(!e){t=t?{strict:true}:null}else{e.strict=t;t=e}}return o(this,r,t)}));r.defineExtension("scanForBracket",(function(r,t,e,i){return f(this,r,t,e,i)}))}))}));n((function(r,t){(function(r){r(f)})((function(r){var t="CodeMirror-lint-markers";var e="CodeMirror-lint-line-";function i(t,e,i){var n=document.createElement("div");n.className="CodeMirror-lint-tooltip cm-s-"+t.options.theme;n.appendChild(i.cloneNode(true));if(t.state.lint.options.selfContain)t.getWrapperElement().appendChild(n);else document.body.appendChild(n);function o(t){if(!n.parentNode)return r.off(document,"mousemove",o);n.style.top=Math.max(0,t.clientY-n.offsetHeight-5)+"px";n.style.left=t.clientX+5+"px"}r.on(document,"mousemove",o);o(e);if(n.style.opacity!=null)n.style.opacity=1;return n}function n(r){if(r.parentNode)r.parentNode.removeChild(r)}function o(r){if(!r.parentNode)return;if(r.style.opacity==null)n(r);r.style.opacity=0;setTimeout((function(){n(r)}),600)}function f(t,e,n,f){var u=i(t,e,n);function a(){r.off(f,"mouseout",a);if(u){o(u);u=null}}var l=setInterval((function(){if(u)for(var r=f;;r=r.parentNode){if(r&&r.nodeType==11)r=r.host;if(r==document.body)return;if(!r){a();break}}if(!u)return clearInterval(l)}),400);r.on(f,"mouseout",a)}function u(r,t,e){this.marked=[];if(t instanceof Function)t={getAnnotations:t};if(!t||t===true)t={};this.options={};this.linterOptions=t.options||{};for(var i in a)this.options[i]=a[i];for(var i in t){if(a.hasOwnProperty(i)){if(t[i]!=null)this.options[i]=t[i]}else if(!t.options){this.linterOptions[i]=t[i]}}this.timeout=null;this.hasGutter=e;this.onMouseOver=function(t){k(r,t)};this.waitingFor=0}var a={highlightLines:false,tooltips:true,delay:500,lintOnChange:true,getAnnotations:null,async:false,selfContain:null,formatAnnotation:null,onUpdateLinting:null};function l(r){var e=r.state.lint;if(e.hasGutter)r.clearGutter(t);if(e.options.highlightLines)s(r);for(var i=0;i<e.marked.length;++i)e.marked[i].clear();e.marked.length=0}function s(r){r.eachLine((function(t){var e=t.wrapClass&&/\bCodeMirror-lint-line-\w+\b/.exec(t.wrapClass);if(e)r.removeLineClass(t,"wrap",e[0])}))}function c(t,e,i,n,o){var u=document.createElement("div"),a=u;u.className="CodeMirror-lint-marker CodeMirror-lint-marker-"+i;if(n){a=u.appendChild(document.createElement("div"));a.className="CodeMirror-lint-marker CodeMirror-lint-marker-multiple"}if(o!=false)r.on(a,"mouseover",(function(r){f(t,r,e,a)}));return u}function v(r,t){if(r=="error")return r;else return t}function h(r){var t=[];for(var e=0;e<r.length;++e){var i=r[e],n=i.from.line;(t[n]||(t[n]=[])).push(i)}return t}function d(r){var t=r.severity;if(!t)t="error";var e=document.createElement("div");e.className="CodeMirror-lint-message CodeMirror-lint-message-"+t;if(typeof r.messageHTML!="undefined"){e.innerHTML=r.messageHTML}else{e.appendChild(document.createTextNode(r.message))}return e}function m(t,e){var i=t.state.lint;var n=++i.waitingFor;function o(){n=-1;t.off("change",o)}t.on("change",o);e(t.getValue(),(function(e,f){t.off("change",o);if(i.waitingFor!=n)return;if(f&&e instanceof r)e=f;t.operation((function(){g(t,e)}))}),i.linterOptions,t)}function p(t){var e=t.state.lint;if(!e)return;var i=e.options;var n=i.getAnnotations||t.getHelper(r.Pos(0,0),"lint");if(!n)return;if(i.async||n.async){m(t,n)}else{var o=n(t.getValue(),e.linterOptions,t);if(!o)return;if(o.then)o.then((function(r){t.operation((function(){g(t,r)}))}));else t.operation((function(){g(t,o)}))}}function g(r,i){var n=r.state.lint;if(!n)return;var o=n.options;l(r);var f=h(i);for(var u=0;u<f.length;++u){var a=f[u];if(!a)continue;var s=[];a=a.filter((function(r){return s.indexOf(r.message)>-1?false:s.push(r.message)}));var m=null;var p=n.hasGutter&&document.createDocumentFragment();for(var g=0;g<a.length;++g){var b=a[g];var w=b.severity;if(!w)w="error";m=v(m,w);if(o.formatAnnotation)b=o.formatAnnotation(b);if(n.hasGutter)p.appendChild(d(b));if(b.to)n.marked.push(r.markText(b.from,b.to,{className:"CodeMirror-lint-mark CodeMirror-lint-mark-"+w,__annotation:b}))}if(n.hasGutter)r.setGutterMarker(u,t,c(r,p,m,f[u].length>1,o.tooltips));if(o.highlightLines)r.addLineClass(u,"wrap",e+m)}if(o.onUpdateLinting)o.onUpdateLinting(i,f,r)}function b(r){var t=r.state.lint;if(!t)return;clearTimeout(t.timeout);t.timeout=setTimeout((function(){p(r)}),t.options.delay)}function w(r,t,e){var i=e.target||e.srcElement;var n=document.createDocumentFragment();for(var o=0;o<t.length;o++){var u=t[o];n.appendChild(d(u))}f(r,e,n,i)}function k(r,t){var e=t.target||t.srcElement;if(!/\bCodeMirror-lint-mark-/.test(e.className))return;var i=e.getBoundingClientRect(),n=(i.left+i.right)/2,o=(i.top+i.bottom)/2;var f=r.findMarksAt(r.coordsChar({left:n,top:o},"client"));var u=[];for(var a=0;a<f.length;++a){var l=f[a].__annotation;if(l)u.push(l)}if(u.length)w(r,u,t)}r.defineOption("lint",false,(function(e,i,n){if(n&&n!=r.Init){l(e);if(e.state.lint.options.lintOnChange!==false)e.off("change",b);r.off(e.getWrapperElement(),"mouseover",e.state.lint.onMouseOver);clearTimeout(e.state.lint.timeout);delete e.state.lint}if(i){var o=e.getOption("gutters"),f=false;for(var a=0;a<o.length;++a)if(o[a]==t)f=true;var s=e.state.lint=new u(e,i,f);if(s.options.lintOnChange)e.on("change",b);if(s.options.tooltips!=false&&s.options.tooltips!="gutter")r.on(e.getWrapperElement(),"mouseover",s.onMouseOver);p(e)}}));r.defineExtension("performLint",(function(){p(this)}))}))}));n((function(r,t){(function(r){r(f)})((function(r){r.registerHelper("lint","json",(function(t){var e=[];if(!window.jsonlint){if(window.console){window.console.error("Error: window.jsonlint not defined, CodeMirror JSON linting cannot run.")}return e}var i=window.jsonlint.parser||window.jsonlint;i.parseError=function(t,i){var n=i.loc;e.push({from:r.Pos(n.first_line-1,n.first_column),to:r.Pos(n.last_line-1,n.last_column),message:t})};try{i.parse(t)}catch(r){}return e}))}))}));var u=n((function(r,t){(function(r){r(f)})((function(r){function t(t,i,o,f){if(o&&o.call){var u=o;o=null}else{var u=n(t,o,"rangeFinder")}if(typeof i=="number")i=r.Pos(i,0);var a=n(t,o,"minFoldSize");function l(r){var e=u(t,i);if(!e||e.to.line-e.from.line<a)return null;if(f==="fold")return e;var n=t.findMarksAt(e.from);for(var o=0;o<n.length;++o){if(n[o].__isFold){if(!r)return null;e.cleared=true;n[o].clear()}}return e}var s=l(true);if(n(t,o,"scanUp"))while(!s&&i.line>t.firstLine()){i=r.Pos(i.line-1,0);s=l(false)}if(!s||s.cleared||f==="unfold")return;var c=e(t,o,s);r.on(c,"mousedown",(function(t){v.clear();r.e_preventDefault(t)}));var v=t.markText(s.from,s.to,{replacedWith:c,clearOnEnter:n(t,o,"clearOnEnter"),__isFold:true});v.on("clear",(function(e,i){r.signal(t,"unfold",t,e,i)}));r.signal(t,"fold",t,s.from,s.to)}function e(r,t,e){var i=n(r,t,"widget");if(typeof i=="function"){i=i(e.from,e.to)}if(typeof i=="string"){var o=document.createTextNode(i);i=document.createElement("span");i.appendChild(o);i.className="CodeMirror-foldmarker"}else if(i){i=i.cloneNode(true)}return i}r.newFoldFunction=function(r,e){return function(i,n){t(i,n,{rangeFinder:r,widget:e})}};r.defineExtension("foldCode",(function(r,e,i){t(this,r,e,i)}));r.defineExtension("isFolded",(function(r){var t=this.findMarksAt(r);for(var e=0;e<t.length;++e)if(t[e].__isFold)return true}));r.commands.toggleFold=function(r){r.foldCode(r.getCursor())};r.commands.fold=function(r){r.foldCode(r.getCursor(),null,"fold")};r.commands.unfold=function(r){r.foldCode(r.getCursor(),{scanUp:false},"unfold")};r.commands.foldAll=function(t){t.operation((function(){for(var e=t.firstLine(),i=t.lastLine();e<=i;e++)t.foldCode(r.Pos(e,0),{scanUp:false},"fold")}))};r.commands.unfoldAll=function(t){t.operation((function(){for(var e=t.firstLine(),i=t.lastLine();e<=i;e++)t.foldCode(r.Pos(e,0),{scanUp:false},"unfold")}))};r.registerHelper("fold","combine",(function(){var r=Array.prototype.slice.call(arguments,0);return function(t,e){for(var i=0;i<r.length;++i){var n=r[i](t,e);if(n)return n}}}));r.registerHelper("fold","auto",(function(r,t){var e=r.getHelpers(t,"fold");for(var i=0;i<e.length;i++){var n=e[i](r,t);if(n)return n}}));var i={rangeFinder:r.fold.auto,widget:"↔",minFoldSize:0,scanUp:false,clearOnEnter:true};r.defineOption("foldOptions",null);function n(r,t,e){if(t&&t[e]!==undefined)return t[e];var n=r.options.foldOptions;if(n&&n[e]!==undefined)return n[e];return i[e]}r.defineExtension("foldOption",(function(r,t){return n(this,r,t)}))}))}));n((function(r,t){(function(r){r(f,u)})((function(r){r.defineOption("foldGutter",false,(function(t,n,o){if(o&&o!=r.Init){t.clearGutter(t.state.foldGutter.options.gutter);t.state.foldGutter=null;t.off("gutterClick",l);t.off("changes",c);t.off("viewportChange",v);t.off("fold",h);t.off("unfold",h);t.off("swapDoc",c);t.off("optionChange",s)}if(n){t.state.foldGutter=new e(i(n));a(t);t.on("gutterClick",l);t.on("changes",c);t.on("viewportChange",v);t.on("fold",h);t.on("unfold",h);t.on("swapDoc",c);t.on("optionChange",s)}}));var t=r.Pos;function e(r){this.options=r;this.from=this.to=0}function i(r){if(r===true)r={};if(r.gutter==null)r.gutter="CodeMirror-foldgutter";if(r.indicatorOpen==null)r.indicatorOpen="CodeMirror-foldgutter-open";if(r.indicatorFolded==null)r.indicatorFolded="CodeMirror-foldgutter-folded";return r}function n(r,e){var i=r.findMarks(t(e,0),t(e+1,0));for(var n=0;n<i.length;++n){if(i[n].__isFold){var o=i[n].find(-1);if(o&&o.line===e)return i[n]}}}function o(r){if(typeof r=="string"){var t=document.createElement("div");t.className=r+" CodeMirror-guttermarker-subtle";return t}else{return r.cloneNode(true)}}function f(r,e,i){var f=r.state.foldGutter.options,a=e-1;var l=r.foldOption(f,"minFoldSize");var s=r.foldOption(f,"rangeFinder");var c=typeof f.indicatorFolded=="string"&&u(f.indicatorFolded);var v=typeof f.indicatorOpen=="string"&&u(f.indicatorOpen);r.eachLine(e,i,(function(e){++a;var i=null;var u=e.gutterMarkers;if(u)u=u[f.gutter];if(n(r,a)){if(c&&u&&c.test(u.className))return;i=o(f.indicatorFolded)}else{var h=t(a,0);var d=s&&s(r,h);if(d&&d.to.line-d.from.line>=l){if(v&&u&&v.test(u.className))return;i=o(f.indicatorOpen)}}if(!i&&!u)return;r.setGutterMarker(e,f.gutter,i)}))}function u(r){return new RegExp("(^|\\s)"+r+"(?:$|\\s)\\s*")}function a(r){var t=r.getViewport(),e=r.state.foldGutter;if(!e)return;r.operation((function(){f(r,t.from,t.to)}));e.from=t.from;e.to=t.to}function l(r,e,i){var o=r.state.foldGutter;if(!o)return;var f=o.options;if(i!=f.gutter)return;var u=n(r,e);if(u)u.clear();else r.foldCode(t(e,0),f)}function s(r,t){if(t=="mode")c(r)}function c(r){var t=r.state.foldGutter;if(!t)return;var e=t.options;t.from=t.to=0;clearTimeout(t.changeUpdate);t.changeUpdate=setTimeout((function(){a(r)}),e.foldOnChangeTimeSpan||600)}function v(r){var t=r.state.foldGutter;if(!t)return;var e=t.options;clearTimeout(t.changeUpdate);t.changeUpdate=setTimeout((function(){var e=r.getViewport();if(t.from==t.to||e.from-t.to>20||t.from-e.to>20){a(r)}else{r.operation((function(){if(e.from<t.from){f(r,e.from,t.from);t.from=e.from}if(e.to>t.to){f(r,t.to,e.to);t.to=e.to}}))}}),e.updateViewportTimeSpan||400)}function h(r,t){var e=r.state.foldGutter;if(!e)return;var i=t.line;if(i>=e.from&&i<e.to)f(r,i,i+1)}}))}));n((function(r,t){(function(r){r(f)})((function(r){function t(t){return function(e,i){var n=i.line,o=e.getLine(n);function f(t){var f;for(var u=i.ch,a=0;;){var l=u<=0?-1:o.lastIndexOf(t[0],u-1);if(l==-1){if(a==1)break;a=1;u=o.length;continue}if(a==1&&l<i.ch)break;f=e.getTokenTypeAt(r.Pos(n,l+1));if(!/^(comment|string)/.test(f))return{ch:l+1,tokenType:f,pair:t};u=l-1}}function u(t){var i=1,o=e.lastLine(),f,u=t.ch,a;r:for(var l=n;l<=o;++l){var s=e.getLine(l),c=l==n?u:0;for(;;){var v=s.indexOf(t.pair[0],c),h=s.indexOf(t.pair[1],c);if(v<0)v=s.length;if(h<0)h=s.length;c=Math.min(v,h);if(c==s.length)break;if(e.getTokenTypeAt(r.Pos(l,c+1))==t.tokenType){if(c==v)++i;else if(!--i){f=l;a=c;break r}}++c}}if(f==null||n==f)return null;return{from:r.Pos(n,u),to:r.Pos(f,a)}}var a=[];for(var l=0;l<t.length;l++){var s=f(t[l]);if(s)a.push(s)}a.sort((function(r,t){return r.ch-t.ch}));for(var l=0;l<a.length;l++){var c=u(a[l]);if(c)return c}return null}}r.registerHelper("fold","brace",t([["{","}"],["[","]"]]));r.registerHelper("fold","brace-paren",t([["{","}"],["[","]"],["(",")"]]));r.registerHelper("fold","import",(function(t,e){function i(e){if(e<t.firstLine()||e>t.lastLine())return null;var i=t.getTokenAt(r.Pos(e,1));if(!/\S/.test(i.string))i=t.getTokenAt(r.Pos(e,i.end+1));if(i.type!="keyword"||i.string!="import")return null;for(var n=e,o=Math.min(t.lastLine(),e+10);n<=o;++n){var f=t.getLine(n),u=f.indexOf(";");if(u!=-1)return{startCh:i.end,end:r.Pos(n,u)}}}var n=e.line,o=i(n),f;if(!o||i(n-1)||(f=i(n-2))&&f.end.line==n-1)return null;for(var u=o.end;;){var a=i(u.line+1);if(a==null)break;u=a.end}return{from:t.clipPos(r.Pos(n,o.startCh+1)),to:u}}));r.registerHelper("fold","include",(function(t,e){function i(e){if(e<t.firstLine()||e>t.lastLine())return null;var i=t.getTokenAt(r.Pos(e,1));if(!/\S/.test(i.string))i=t.getTokenAt(r.Pos(e,i.end+1));if(i.type=="meta"&&i.string.slice(0,8)=="#include")return i.start+8}var n=e.line,o=i(n);if(o==null||i(n-1)!=null)return null;for(var f=n;;){var u=i(f+1);if(u==null)break;++f}return{from:r.Pos(n,o+1),to:t.clipPos(r.Pos(f))}}))}))}));var a=n((function(r){var t=function(){var r=true,t=false;var e={};var i=function(){var r;var t;var e={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"};var i;var n=function(t){throw{name:"SyntaxError",message:t,at:r,text:i}};var o=function(e){if(e&&e!==t){n("Expected '"+e+"' instead of '"+t+"'")}t=i.charAt(r);r+=1;return t};var f=function(){var r;var e="";if(t==="-"){e="-";o("-")}while(t>="0"&&t<="9"){e+=t;o()}if(t==="."){e+=".";while(o()&&t>="0"&&t<="9"){e+=t}}if(t==="e"||t==="E"){e+=t;o();if(t==="-"||t==="+"){e+=t;o()}while(t>="0"&&t<="9"){e+=t;o()}}r=+e;if(!isFinite(r)){n("Bad number")}else{return r}};var u=function(){var r;var i;var f="";var u;if(t==='"'){while(o()){if(t==='"'){o();return f}if(t==="\\"){o();if(t==="u"){u=0;for(i=0;i<4;i+=1){r=parseInt(o(),16);if(!isFinite(r)){break}u=u*16+r}f+=String.fromCharCode(u)}else if(typeof e[t]==="string"){f+=e[t]}else{break}}else{f+=t}}}n("Bad string")};var a=function(){while(t&&t<=" "){o()}};var l=function(){switch(t){case"t":o("t");o("r");o("u");o("e");return true;case"f":o("f");o("a");o("l");o("s");o("e");return false;case"n":o("n");o("u");o("l");o("l");return null}n("Unexpected '"+t+"'")};var s;var c=function(){var r=[];if(t==="["){o("[");a();if(t==="]"){o("]");return r}while(t){r.push(s());a();if(t==="]"){o("]");return r}o(",");a()}}n("Bad array")};var v=function(){var r;var e={};if(t==="{"){o("{");a();if(t==="}"){o("}");return e}while(t){r=u();a();o(":");if(Object.hasOwnProperty.call(e,r)){n("Duplicate key '"+r+"'")}e[r]=s();a();if(t==="}"){o("}");return e}o(",");a()}}n("Bad object")};s=function(){a();switch(t){case"{":return v();case"[":return c();case'"':return u();case"-":return f();default:return t>="0"&&t<="9"?f():l()}};return function(e,o){var f;i=e;r=0;t=" ";f=s();a();if(t){n("Syntax error")}return typeof o==="function"?function r(t,e){var i;var n;var f=t[e];if(f&&typeof f==="object"){for(i in f){if(Object.prototype.hasOwnProperty.call(f,i)){n=r(f,i);if(n!==undefined){f[i]=n}else{delete f[i]}}}}return o.call(t,e,f)}({"":f},""):f}}();var n=function(){var r={trace:function r(){},yy:{},symbols_:{error:2,JSONString:3,STRING:4,JSONNumber:5,NUMBER:6,JSONNullLiteral:7,NULL:8,JSONBooleanLiteral:9,TRUE:10,FALSE:11,JSONText:12,JSONValue:13,EOF:14,JSONObject:15,JSONArray:16,"{":17,"}":18,JSONMemberList:19,JSONMember:20,":":21,",":22,"[":23,"]":24,JSONElementList:25,$accept:0,$end:1},terminals_:{2:"error",4:"STRING",6:"NUMBER",8:"NULL",10:"TRUE",11:"FALSE",14:"EOF",17:"{",18:"}",21:":",22:",",23:"[",24:"]"},productions_:[0,[3,1],[5,1],[7,1],[9,1],[9,1],[12,2],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[15,2],[15,3],[20,3],[19,1],[19,3],[16,2],[16,3],[25,1],[25,3]],performAction:function r(t,e,i,n,o,f,u){var a=f.length-1;switch(o){case 1:this.$=t.replace(/\\(\\|")/g,"$"+"1").replace(/\\n/g,"\n").replace(/\\r/g,"\r").replace(/\\t/g,"\t").replace(/\\v/g,"\v").replace(/\\f/g,"\f").replace(/\\b/g,"\b");break;case 2:this.$=Number(t);break;case 3:this.$=null;break;case 4:this.$=true;break;case 5:this.$=false;break;case 6:return this.$=f[a-1];case 13:this.$={};break;case 14:this.$=f[a-1];break;case 15:this.$=[f[a-2],f[a]];break;case 16:this.$={};this.$[f[a][0]]=f[a][1];break;case 17:this.$=f[a-2];f[a-2][f[a][0]]=f[a][1];break;case 18:this.$=[];break;case 19:this.$=f[a-1];break;case 20:this.$=[f[a]];break;case 21:this.$=f[a-2];f[a-2].push(f[a]);break}},table:[{3:5,4:[1,12],5:6,6:[1,13],7:3,8:[1,9],9:4,10:[1,10],11:[1,11],12:1,13:2,15:7,16:8,17:[1,14],23:[1,15]},{1:[3]},{14:[1,16]},{14:[2,7],18:[2,7],22:[2,7],24:[2,7]},{14:[2,8],18:[2,8],22:[2,8],24:[2,8]},{14:[2,9],18:[2,9],22:[2,9],24:[2,9]},{14:[2,10],18:[2,10],22:[2,10],24:[2,10]},{14:[2,11],18:[2,11],22:[2,11],24:[2,11]},{14:[2,12],18:[2,12],22:[2,12],24:[2,12]},{14:[2,3],18:[2,3],22:[2,3],24:[2,3]},{14:[2,4],18:[2,4],22:[2,4],24:[2,4]},{14:[2,5],18:[2,5],22:[2,5],24:[2,5]},{14:[2,1],18:[2,1],21:[2,1],22:[2,1],24:[2,1]},{14:[2,2],18:[2,2],22:[2,2],24:[2,2]},{3:20,4:[1,12],18:[1,17],19:18,20:19},{3:5,4:[1,12],5:6,6:[1,13],7:3,8:[1,9],9:4,10:[1,10],11:[1,11],13:23,15:7,16:8,17:[1,14],23:[1,15],24:[1,21],25:22},{1:[2,6]},{14:[2,13],18:[2,13],22:[2,13],24:[2,13]},{18:[1,24],22:[1,25]},{18:[2,16],22:[2,16]},{21:[1,26]},{14:[2,18],18:[2,18],22:[2,18],24:[2,18]},{22:[1,28],24:[1,27]},{22:[2,20],24:[2,20]},{14:[2,14],18:[2,14],22:[2,14],24:[2,14]},{3:20,4:[1,12],20:29},{3:5,4:[1,12],5:6,6:[1,13],7:3,8:[1,9],9:4,10:[1,10],11:[1,11],13:30,15:7,16:8,17:[1,14],23:[1,15]},{14:[2,19],18:[2,19],22:[2,19],24:[2,19]},{3:5,4:[1,12],5:6,6:[1,13],7:3,8:[1,9],9:4,10:[1,10],11:[1,11],13:31,15:7,16:8,17:[1,14],23:[1,15]},{18:[2,17],22:[2,17]},{18:[2,15],22:[2,15]},{22:[2,21],24:[2,21]}],defaultActions:{16:[2,6]},parseError:function r(t,e){throw new Error(t)},parse:function r(t){var e=this,i=[0],n=[null],o=[],f=this.table,u="",a=0,l=0,s=0,c=2,v=1;this.lexer.setInput(t);this.lexer.yy=this.yy;this.yy.lexer=this.lexer;if(typeof this.lexer.yylloc=="undefined")this.lexer.yylloc={};var h=this.lexer.yylloc;o.push(h);if(typeof this.yy.parseError==="function")this.parseError=this.yy.parseError;function d(r){i.length=i.length-2*r;n.length=n.length-r;o.length=o.length-r}function m(){var r;r=e.lexer.lex()||1;if(typeof r!=="number"){r=e.symbols_[r]||r}return r}var p,g,b,w,k,C={},M,A,y,x;while(true){b=i[i.length-1];if(this.defaultActions[b]){w=this.defaultActions[b]}else{if(p==null)p=m();w=f[b]&&f[b][p]}if(typeof w==="undefined"||!w.length||!w[0]){if(!s){x=[];for(M in f[b])if(this.terminals_[M]&&M>2){x.push("'"+this.terminals_[M]+"'")}var L="";if(this.lexer.showPosition){L="Parse error on line "+(a+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+x.join(", ")+", got '"+this.terminals_[p]+"'"}else{L="Parse error on line "+(a+1)+": Unexpected "+(p==1?"end of input":"'"+(this.terminals_[p]||p)+"'")}this.parseError(L,{text:this.lexer.match,token:this.terminals_[p]||p,line:this.lexer.yylineno,loc:h,expected:x})}if(s==3){if(p==v){throw new Error(L||"Parsing halted.")}l=this.lexer.yyleng;u=this.lexer.yytext;a=this.lexer.yylineno;h=this.lexer.yylloc;p=m()}while(1){if(c.toString()in f[b]){break}if(b==0){throw new Error(L||"Parsing halted.")}d(1);b=i[i.length-1]}g=p;p=c;b=i[i.length-1];w=f[b]&&f[b][c];s=3}if(w[0]instanceof Array&&w.length>1){throw new Error("Parse Error: multiple actions possible at state: "+b+", token: "+p)}switch(w[0]){case 1:i.push(p);n.push(this.lexer.yytext);o.push(this.lexer.yylloc);i.push(w[1]);p=null;if(!g){l=this.lexer.yyleng;u=this.lexer.yytext;a=this.lexer.yylineno;h=this.lexer.yylloc;if(s>0)s--}else{p=g;g=null}break;case 2:A=this.productions_[w[1]][1];C.$=n[n.length-A];C._$={first_line:o[o.length-(A||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(A||1)].first_column,last_column:o[o.length-1].last_column};k=this.performAction.call(C,u,l,a,this.yy,w[1],n,o);if(typeof k!=="undefined"){return k}if(A){i=i.slice(0,-1*A*2);n=n.slice(0,-1*A);o=o.slice(0,-1*A)}i.push(this.productions_[w[1]][0]);n.push(C.$);o.push(C._$);y=f[i[i.length-2]][i[i.length-1]];i.push(y);break;case 3:return true}}return true}};var t=function(){var r={EOF:1,parseError:function r(t,e){if(this.yy.parseError){this.yy.parseError(t,e)}else{throw new Error(t)}},setInput:function(r){this._input=r;this._more=this._less=this.done=false;this.yylineno=this.yyleng=0;this.yytext=this.matched=this.match="";this.conditionStack=["INITIAL"];this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0};return this},input:function(){var r=this._input[0];this.yytext+=r;this.yyleng++;this.match+=r;this.matched+=r;var t=r.match(/\n/);if(t)this.yylineno++;this._input=this._input.slice(1);return r},unput:function(r){this._input=r+this._input;return this},more:function(){this._more=true;return this},less:function(r){this._input=this.match.slice(r)+this._input},pastInput:function(){var r=this.matched.substr(0,this.matched.length-this.match.length);return(r.length>20?"...":"")+r.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var r=this.match;if(r.length<20){r+=this._input.substr(0,20-r.length)}return(r.substr(0,20)+(r.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var r=this.pastInput();var t=new Array(r.length+1).join("-");return r+this.upcomingInput()+"\n"+t+"^"},next:function(){if(this.done){return this.EOF}if(!this._input)this.done=true;var r,t,e,i,n;if(!this._more){this.yytext="";this.match=""}var o=this._currentRules();for(var f=0;f<o.length;f++){e=this._input.match(this.rules[o[f]]);if(e&&(!t||e[0].length>t[0].length)){t=e;i=f;if(!this.options.flex)break}}if(t){n=t[0].match(/\n.*/g);if(n)this.yylineno+=n.length;this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:n?n[n.length-1].length-1:this.yylloc.last_column+t[0].length};this.yytext+=t[0];this.match+=t[0];this.yyleng=this.yytext.length;this._more=false;this._input=this._input.slice(t[0].length);this.matched+=t[0];r=this.performAction.call(this,this.yy,this,o[i],this.conditionStack[this.conditionStack.length-1]);if(this.done&&this._input)this.done=false;if(r)return r;else return}if(this._input===""){return this.EOF}else{this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}},lex:function r(){var t=this.next();if(typeof t!=="undefined"){return t}else{return this.lex()}},begin:function r(t){this.conditionStack.push(t)},popState:function r(){return this.conditionStack.pop()},_currentRules:function r(){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules},topState:function(){return this.conditionStack[this.conditionStack.length-2]},pushState:function r(t){this.begin(t)}};r.options={};r.performAction=function r(t,e,i,n){switch(i){case 0:break;case 1:return 6;case 2:e.yytext=e.yytext.substr(1,e.yyleng-2);return 4;case 3:return 17;case 4:return 18;case 5:return 23;case 6:return 24;case 7:return 22;case 8:return 21;case 9:return 10;case 10:return 11;case 11:return 8;case 12:return 14;case 13:return"INVALID"}};r.rules=[/^(?:\s+)/,/^(?:(-?([0-9]|[1-9][0-9]+))(\.[0-9]+)?([eE][-+]?[0-9]+)?\b)/,/^(?:"(?:\\[\\"bfnrt/]|\\u[a-fA-F0-9]{4}|[^\\\0-\x09\x0a-\x1f"])*")/,/^(?:\{)/,/^(?:\})/,/^(?:\[)/,/^(?:\])/,/^(?:,)/,/^(?::)/,/^(?:true\b)/,/^(?:false\b)/,/^(?:null\b)/,/^(?:$)/,/^(?:.)/];r.conditions={INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13],inclusive:true}};return r}();r.lexer=t;return r}();var o=n.parse;n.parse=function(t){var e=o.call(n,t);var f=typeof i==="undefined"?r("./doug-json-parse"):i;try{f(t)}catch(r){if(/Duplicate key|Bad string|Unexpected/.test(r.message)){var u=t.substring(0,r.at).split("\n");var a=u.length;var l=u[a-1].length-1;this.parseError(r.message,{line:a,col:l,message:r.message.replace(/./,(function(r){return r.toLowerCase()}))});throw SyntaxError(r.message+" on line "+a)}}return e};if(typeof e!=="undefined"){e.parser=n;e.parse=function(){return n.parse.apply(n,arguments)};e.main=function t(i){if(!i[1])throw new Error("Usage: "+i[0]+" FILE");if(typeof process!=="undefined"){var n=r("fs").readFileSync(r("path").join(process.cwd(),i[1]),"utf8")}else{var o=r("file").path(r("file").cwd());var n=o.join(i[1]).read({charset:"utf-8"})}return e.parser.parse(n)};if(r.main===t){e.main(typeof process!=="undefined"?process.argv.slice(1):r("system").args)}}return e}();if(r.exports)r.exports=t}));const l="@charset \"UTF-8\";.CodeMirror{font-family:monospace;height:300px;color:black;direction:ltr}.CodeMirror-lines{padding:4px 0;}.CodeMirror pre.CodeMirror-line,.CodeMirror pre.CodeMirror-line-like{padding:0 4px;}.CodeMirror-scrollbar-filler,.CodeMirror-gutter-filler{background-color:white;}.CodeMirror-gutters{border-right:1px solid #ddd;background-color:#f7f7f7;white-space:nowrap}.CodeMirror-linenumber{padding:0 3px 0 5px;min-width:20px;text-align:right;color:#999;white-space:nowrap}.CodeMirror-guttermarker{color:black}.CodeMirror-guttermarker-subtle{color:#999}.CodeMirror-cursor{border-left:1px solid black;border-right:none;width:0}.CodeMirror div.CodeMirror-secondarycursor{border-left:1px solid silver}.cm-fat-cursor .CodeMirror-cursor{width:auto;border:0 !important;background:#7e7}.cm-fat-cursor div.CodeMirror-cursors{z-index:1}.cm-fat-cursor .CodeMirror-line::selection,.cm-fat-cursor .CodeMirror-line>span::selection,.cm-fat-cursor .CodeMirror-line>span>span::selection{background:transparent}.cm-fat-cursor .CodeMirror-line::-moz-selection,.cm-fat-cursor .CodeMirror-line>span::-moz-selection,.cm-fat-cursor .CodeMirror-line>span>span::-moz-selection{background:transparent}.cm-fat-cursor{caret-color:transparent}@-moz-keyframes blink{0%{}50%{background-color:transparent}100%{}}@-webkit-keyframes blink{0%{}50%{background-color:transparent}100%{}}@keyframes blink{0%{}50%{background-color:transparent}100%{}}.cm-tab{display:inline-block;text-decoration:inherit}.CodeMirror-rulers{position:absolute;left:0;right:0;top:-50px;bottom:0;overflow:hidden}.CodeMirror-ruler{border-left:1px solid #ccc;top:0;bottom:0;position:absolute}.cm-s-default .cm-header{color:blue}.cm-s-default .cm-quote{color:#090}.cm-negative{color:#d44}.cm-positive{color:#292}.cm-header,.cm-strong{font-weight:bold}.cm-em{font-style:italic}.cm-link{text-decoration:underline}.cm-strikethrough{text-decoration:line-through}.cm-s-default .cm-keyword{color:#708}.cm-s-default .cm-atom{color:#219}.cm-s-default .cm-number{color:#164}.cm-s-default .cm-def{color:#00f}.cm-s-default .cm-variable-2{color:#05a}.cm-s-default .cm-variable-3,.cm-s-default .cm-type{color:#085}.cm-s-default .cm-comment{color:#a50}.cm-s-default .cm-string{color:#a11}.cm-s-default .cm-string-2{color:#f50}.cm-s-default .cm-meta{color:#555}.cm-s-default .cm-qualifier{color:#555}.cm-s-default .cm-builtin{color:#30a}.cm-s-default .cm-bracket{color:#997}.cm-s-default .cm-tag{color:#170}.cm-s-default .cm-attribute{color:#00c}.cm-s-default .cm-hr{color:#999}.cm-s-default .cm-link{color:#00c}.cm-s-default .cm-error{color:#f00}.cm-invalidchar{color:#f00}.CodeMirror-composing{border-bottom:2px solid}div.CodeMirror span.CodeMirror-matchingbracket{color:#0b0}div.CodeMirror span.CodeMirror-nonmatchingbracket{color:#a22}.CodeMirror-matchingtag{background:rgba(255, 150, 0, .3)}.CodeMirror-activeline-background{background:#e8f2ff}.CodeMirror{position:relative;overflow:hidden;background:white}.CodeMirror-scroll{overflow:scroll !important;margin-bottom:-50px;margin-right:-50px;padding-bottom:50px;height:100%;outline:none;position:relative;z-index:0}.CodeMirror-sizer{position:relative;border-right:50px solid transparent}.CodeMirror-vscrollbar,.CodeMirror-hscrollbar,.CodeMirror-scrollbar-filler,.CodeMirror-gutter-filler{position:absolute;z-index:6;display:none;outline:none}.CodeMirror-vscrollbar{right:0;top:0;overflow-x:hidden;overflow-y:scroll}.CodeMirror-hscrollbar{bottom:0;left:0;overflow-y:hidden;overflow-x:scroll}.CodeMirror-scrollbar-filler{right:0;bottom:0}.CodeMirror-gutter-filler{left:0;bottom:0}.CodeMirror-gutters{position:absolute;left:0;top:0;min-height:100%;z-index:3}.CodeMirror-gutter{white-space:normal;height:100%;display:inline-block;vertical-align:top;margin-bottom:-50px}.CodeMirror-gutter-wrapper{position:absolute;z-index:4;background:none !important;border:none !important}.CodeMirror-gutter-background{position:absolute;top:0;bottom:0;z-index:4}.CodeMirror-gutter-elt{position:absolute;cursor:default;z-index:4}.CodeMirror-gutter-wrapper ::selection{background-color:transparent}.CodeMirror-gutter-wrapper ::-moz-selection{background-color:transparent}.CodeMirror-lines{cursor:text;min-height:1px;}.CodeMirror pre.CodeMirror-line,.CodeMirror pre.CodeMirror-line-like{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0;border-width:0;background:transparent;font-family:inherit;font-size:inherit;margin:0;white-space:pre;word-wrap:normal;line-height:inherit;color:inherit;z-index:2;position:relative;overflow:visible;-webkit-tap-highlight-color:transparent;-webkit-font-variant-ligatures:contextual;font-variant-ligatures:contextual}.CodeMirror-wrap pre.CodeMirror-line,.CodeMirror-wrap pre.CodeMirror-line-like{word-wrap:break-word;white-space:pre-wrap;word-break:normal}.CodeMirror-linebackground{position:absolute;left:0;right:0;top:0;bottom:0;z-index:0}.CodeMirror-linewidget{position:relative;z-index:2;padding:0.1px;}.CodeMirror-rtl pre{direction:rtl}.CodeMirror-code{outline:none}.CodeMirror-scroll,.CodeMirror-sizer,.CodeMirror-gutter,.CodeMirror-gutters,.CodeMirror-linenumber{-moz-box-sizing:content-box;box-sizing:content-box}.CodeMirror-measure{position:absolute;width:100%;height:0;overflow:hidden;visibility:hidden}.CodeMirror-cursor{position:absolute;pointer-events:none}.CodeMirror-measure pre{position:static}div.CodeMirror-cursors{visibility:hidden;position:relative;z-index:3}div.CodeMirror-dragcursors{visibility:visible}.CodeMirror-focused div.CodeMirror-cursors{visibility:visible}.CodeMirror-selected{background:#d9d9d9}.CodeMirror-focused .CodeMirror-selected{background:#d7d4f0}.CodeMirror-crosshair{cursor:crosshair}.CodeMirror-line::selection,.CodeMirror-line>span::selection,.CodeMirror-line>span>span::selection{background:#d7d4f0}.CodeMirror-line::-moz-selection,.CodeMirror-line>span::-moz-selection,.CodeMirror-line>span>span::-moz-selection{background:#d7d4f0}.cm-searching{background-color:#ffa;background-color:rgba(255, 255, 0, .4)}.cm-force-border{padding-right:.1px}@media print{.CodeMirror div.CodeMirror-cursors{visibility:hidden}}.cm-tab-wrap-hack:after{content:''}span.CodeMirror-selectedtext{background:none}.CodeMirror-lint-markers{width:16px}.CodeMirror-lint-tooltip{background-color:#ffd;border:1px solid black;border-radius:4px 4px 4px 4px;color:black;font-family:monospace;font-size:10pt;overflow:hidden;padding:2px 5px;position:fixed;white-space:pre;white-space:pre-wrap;z-index:100;max-width:600px;opacity:0;transition:opacity .4s;-moz-transition:opacity .4s;-webkit-transition:opacity .4s;-o-transition:opacity .4s;-ms-transition:opacity .4s}.CodeMirror-lint-mark{background-position:left bottom;background-repeat:repeat-x}.CodeMirror-lint-mark-warning{background-image:url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJFhQXEbhTg7YAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAMklEQVQI12NkgIIvJ3QXMjAwdDN+OaEbysDA4MPAwNDNwMCwiOHLCd1zX07o6kBVGQEAKBANtobskNMAAAAASUVORK5CYII=\")}.CodeMirror-lint-mark-error{background-image:url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJDw4cOCW1/KIAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAHElEQVQI12NggIL/DAz/GdA5/xkY/qPKMDAwAADLZwf5rvm+LQAAAABJRU5ErkJggg==\")}.CodeMirror-lint-marker{background-position:center center;background-repeat:no-repeat;cursor:pointer;display:inline-block;height:16px;width:16px;vertical-align:middle;position:relative}.CodeMirror-lint-message{padding-left:18px;background-position:top left;background-repeat:no-repeat}.CodeMirror-lint-marker-warning,.CodeMirror-lint-message-warning{background-image:url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAANlBMVEX/uwDvrwD/uwD/uwD/uwD/uwD/uwD/uwD/uwD6twD/uwAAAADurwD2tQD7uAD+ugAAAAD/uwDhmeTRAAAADHRSTlMJ8mN1EYcbmiixgACm7WbuAAAAVklEQVR42n3PUQqAIBBFUU1LLc3u/jdbOJoW1P08DA9Gba8+YWJ6gNJoNYIBzAA2chBth5kLmG9YUoG0NHAUwFXwO9LuBQL1giCQb8gC9Oro2vp5rncCIY8L8uEx5ZkAAAAASUVORK5CYII=\")}.CodeMirror-lint-marker-error,.CodeMirror-lint-message-error{background-image:url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAHlBMVEW7AAC7AACxAAC7AAC7AAAAAAC4AAC5AAD///+7AAAUdclpAAAABnRSTlMXnORSiwCK0ZKSAAAATUlEQVR42mWPOQ7AQAgDuQLx/z8csYRmPRIFIwRGnosRrpamvkKi0FTIiMASR3hhKW+hAN6/tIWhu9PDWiTGNEkTtIOucA5Oyr9ckPgAWm0GPBog6v4AAAAASUVORK5CYII=\")}.CodeMirror-lint-marker-multiple{background-image:url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAAHCAMAAADzjKfhAAAACVBMVEUAAAAAAAC/v7914kyHAAAAAXRSTlMAQObYZgAAACNJREFUeNo1ioEJAAAIwmz/H90iFFSGJgFMe3gaLZ0od+9/AQZ0ADosbYraAAAAAElFTkSuQmCC\");background-repeat:no-repeat;background-position:right bottom;width:100%;height:100%}.CodeMirror-lint-line-error{background-color:rgba(183, 76, 81, 0.08)}.CodeMirror-lint-line-warning{background-color:rgba(255, 211, 0, 0.1)}.CodeMirror-foldmarker{color:blue;text-shadow:#b9f 1px 1px 2px, #b9f -1px -1px 2px, #b9f 1px -1px 2px, #b9f -1px 1px 2px;font-family:arial;line-height:.3;cursor:pointer}.CodeMirror-foldgutter{width:.7em}.CodeMirror-foldgutter-open,.CodeMirror-foldgutter-folded{cursor:pointer}.CodeMirror-foldgutter-open:after{content:\"\\25BE\"}.CodeMirror-foldgutter-folded:after{content:\"\\25B8\"}:host{display:flex;font-size:var(--code-editor-font-size, 0.8125rem);--code-editor-neutral-text-color:var(--contrast-1100);--code-editor-background-color:var(--contrast-200);--code-editor-gutter-background-color:var(--contrast-300);--code-editor-line-number-text-color:var(--contrast-700);--code-editor-cursor-color:var(--color-amber-dark);--code-editor-selection-highlight-color:var(--color-cyan-default);--code-editor-selection-lowlight-color:var(--contrast-600)}:host .cm-attribute,:host .cm-property,:host .cm-keyword{color:rgb(var(--color-violet-light))}:host .cm-operator{color:rgb(var(--color-sky-dark))}:host .cm-variable{color:rgb(var(--color-pink-light))}:host .cm-variable-2{color:rgb(var(--contrast-1100))}:host .cm-variable-3,:host .cm-type{color:rgb(var(--color-amber-darker))}:host .cm-builtin,:host .cm-meta{color:rgb(var(--color-amber-default))}:host .cm-atom{color:rgb(var(--color-coral-default))}:host .cm-tag,:host .cm-number{color:rgb(var(--color-magenta-default))}:host .cm-def{color:rgb(var(--color-sky-default))}:host .cm-string{color:rgb(var(--color-green-dark))}:host .cm-string-2{color:rgb(var(--color-pink-default))}:host .cm-qualifier{color:rgb(var(--color-grass-default))}:host .cm-error{color:rgb(var(--color-white));background-color:rgb(var(--color-red-default))}:host .cm-comment{color:rgba(var(--code-editor-neutral-text-color), 0.7)}@media (prefers-color-scheme: dark){:root:not([data-theme=force-light]) :host{--code-editor-neutral-text-color:var(--contrast-1600);--code-editor-line-number-text-color:var(--contrast-800);--code-editor-cursor-color:var(--color-amber-default);--code-editor-selection-highlight-color:var(--color-cyan-light);--code-editor-selection-lowlight-color:var(--contrast-100)}:root:not([data-theme=force-light]) :host .cm-attribute,:root:not([data-theme=force-light]) :host .cm-property,:root:not([data-theme=force-light]) :host .cm-keyword{color:rgb(var(--color-purple-lighter))}:root:not([data-theme=force-light]) :host .cm-operator{color:rgb(var(--color-sky-lighter))}:root:not([data-theme=force-light]) :host .cm-variable-3,:root:not([data-theme=force-light]) :host .cm-type{color:rgb(var(--color-yellow-light))}:root:not([data-theme=force-light]) :host .cm-atom{color:rgb(var(--color-coral-light))}:root:not([data-theme=force-light]) :host .cm-tag,:root:not([data-theme=force-light]) :host .cm-number{color:rgb(var(--color-magenta-light))}:root:not([data-theme=force-light]) :host .cm-def{color:rgb(var(--color-sky-light))}:root:not([data-theme=force-light]) :host .cm-string{color:rgb(var(--color-lime-light))}:root:not([data-theme=force-light]) :host .cm-string-2{color:rgb(var(--color-pink-lighter))}:root:not([data-theme=force-light]) :host .cm-qualifier{color:rgb(var(--color-grass-light))}:root:not([data-theme=force-light]) :host .cm-comment{color:rgba(var(--code-editor-neutral-text-color), 0.4)}}:root[data-theme=force-dark] :host{--code-editor-neutral-text-color:var(--contrast-1600);--code-editor-line-number-text-color:var(--contrast-800);--code-editor-cursor-color:var(--color-amber-default);--code-editor-selection-highlight-color:var(--color-cyan-light);--code-editor-selection-lowlight-color:var(--contrast-100)}:root[data-theme=force-dark] :host .cm-attribute,:root[data-theme=force-dark] :host .cm-property,:root[data-theme=force-dark] :host .cm-keyword{color:rgb(var(--color-purple-lighter))}:root[data-theme=force-dark] :host .cm-operator{color:rgb(var(--color-sky-lighter))}:root[data-theme=force-dark] :host .cm-variable-3,:root[data-theme=force-dark] :host .cm-type{color:rgb(var(--color-yellow-light))}:root[data-theme=force-dark] :host .cm-atom{color:rgb(var(--color-coral-light))}:root[data-theme=force-dark] :host .cm-tag,:root[data-theme=force-dark] :host .cm-number{color:rgb(var(--color-magenta-light))}:root[data-theme=force-dark] :host .cm-def{color:rgb(var(--color-sky-light))}:root[data-theme=force-dark] :host .cm-string{color:rgb(var(--color-lime-light))}:root[data-theme=force-dark] :host .cm-string-2{color:rgb(var(--color-pink-lighter))}:root[data-theme=force-dark] :host .cm-qualifier{color:rgb(var(--color-grass-light))}:root[data-theme=force-dark] :host .cm-comment{color:rgba(var(--code-editor-neutral-text-color), 0.4)}.editor{display:flex;align-items:stretch;width:100%}.editor.readonly .CodeMirror-focused .CodeMirror-cursors{visibility:visible !important}.cm-s-lime.CodeMirror{font-family:ui-monospace, \"Cascadia Code\", \"Source Code Pro\", Menlo, Consolas, \"DejaVu Sans Mono\", monospace;color:rgb(var(--code-editor-neutral-text-color));background-color:rgb(var(--code-editor-background-color));border-radius:0.25rem;height:auto;width:100%}.cm-s-lime .CodeMirror-scroll{max-height:var(--code-editor-max-height, 10rem)}.cm-s-lime.CodeMirror-focused div.CodeMirror-selected{background:rgba(var(--code-editor-selection-highlight-color), 0.15)}.cm-s-lime div.CodeMirror-selected{background:rgba(var(--code-editor-selection-highlight-color), 0.05)}.cm-s-lime .CodeMirror-gutters{background-color:rgb(var(--code-editor-gutter-background-color));color:rgb(var(--code-editor-line-number-text-color));border:none}.cm-s-lime .CodeMirror-guttermarker,.cm-s-lime .CodeMirror-guttermarker-subtle,.cm-s-lime .CodeMirror-linenumber{color:rgb(var(--code-editor-line-number-text-color))}.cm-s-lime .CodeMirror-cursor{border-left:1px solid rgb(var(--code-editor-cursor-color))}.editor.readonly .cm-s-lime .CodeMirror-cursor{border-color:rgba(var(--code-editor-neutral-text-color), 0.5);border-width:0.125rem}.cm-s-lime .CodeMirror-activeline-background{background:rgba(var(--code-editor-selection-lowlight-color), 0.5)}.cm-s-lime .CodeMirror-matchingbracket{font-weight:bold;color:rgb(var(--code-editor-neutral-text-color)) !important;background:rgba(var(--code-editor-selection-highlight-color), 0.15);position:relative}.cm-s-lime .CodeMirror-matchingbracket:before{content:\"_\";color:rgb(var(--code-editor-selection-highlight-color), 0.8);position:absolute;bottom:-0.4rem;left:0;right:0}.cm-s-lime .CodeMirror-lint-marker-error,.cm-s-lime .CodeMirror-lint-message-error{background-image:url(\"data:image/svg+xml; utf8, <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'><defs/><path fill='rgb(255,255,255)' d='M7.219 5.781L5.78 7.22 14.563 16 5.78 24.781 7.22 26.22 16 17.437l8.781 8.782 1.438-1.438L17.437 16l8.782-8.781L24.78 5.78 16 14.563z'/></svg>\");background-color:rgb(var(--color-red-default));background-size:0.75rem;border-radius:50%}.cm-s-lime .CodeMirror-foldmarker{position:relative;transition:color var(--limel-clickable-transition-speed, 0.4s) ease, background-color var(--limel-clickable-transition-speed, 0.4s) ease, box-shadow var(--limel-clickable-transform-speed, 0.4s) ease, transform var(--limel-clickable-transform-speed, 0.4s) var(--limel-clickable-transform-timing-function, ease);cursor:pointer;color:transparent;background-color:var(--lime-elevated-surface-background-color);box-shadow:var(--button-shadow-normal);text-shadow:none;padding:0 0.5rem;border-radius:1rem;background-image:url(\"data:image/svg+xml; utf8, <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' xml:space='preserve'><circle fill='rgba(186,186,192,0.7)' cx='16' cy='16' r='2'/><circle fill='rgba(186,186,192,0.7)' cx='26' cy='16' r='2'/><circle fill='rgba(186,186,192,0.7)' cx='6' cy='16' r='2'/></svg>\");background-size:contain;background-repeat:no-repeat;background-position:center}.cm-s-lime .CodeMirror-foldmarker:hover,.cm-s-lime .CodeMirror-foldmarker:focus,.cm-s-lime .CodeMirror-foldmarker:focus-visible{will-change:color, background-color, box-shadow, transform}.cm-s-lime .CodeMirror-foldmarker:hover{transform:translate3d(0, -0.04rem, 0);color:var(--mdc-theme-on-surface);background-color:var(--lime-elevated-surface-background-color);box-shadow:var(--button-shadow-hovered)}.cm-s-lime .CodeMirror-foldmarker:active{--limel-clickable-transform-timing-function:cubic-bezier(\n 0.83,\n -0.15,\n 0.49,\n 1.16\n );transform:translate3d(0, 0.05rem, 0);box-shadow:var(--button-shadow-pressed)}.cm-s-lime .CodeMirror-foldmarker:hover,.cm-s-lime .CodeMirror-foldmarker:active{--limel-clickable-transition-speed:0.2s;--limel-clickable-transform-speed:0.16s}.cm-s-lime [class^=CodeMirror-foldgutter]{color:var(--code-editor-neutral-text-color);transition:opacity 0.2s ease;opacity:0.4}.cm-s-lime [class^=CodeMirror-foldgutter]:hover{opacity:1}.cm-s-lime .CodeMirror-foldgutter-folded{opacity:0.7}";const s=class{constructor(e){r(this,e);this.change=t(this,"change",7);this.handleChangeDarkMode=()=>{if(this.colorScheme!=="auto"){return}this.forceRedraw()};this.handleChange=()=>{this.change.emit(this.editor.getValue())};this.handleResize=()=>{if(!this.editor){return}this.editor.refresh()};this.value="";this.language=undefined;this.readonly=false;this.lineNumbers=false;this.fold=false;this.lint=false;this.colorScheme="auto";this.random=undefined}connectedCallback(){this.observer=new ResizeObserver(this.handleResize);this.observer.observe(this.host);this.darkMode.addEventListener("change",this.handleChangeDarkMode)}disconnectedCallback(){var r;this.observer.unobserve(this.host);(r=this.editor)===null||r===void 0?void 0:r.off("change",this.handleChange);this.editor=null;this.darkMode.removeEventListener("change",this.handleChangeDarkMode);const t=this.host.shadowRoot.querySelector(".editor");t===null||t===void 0?void 0:t.childNodes.forEach((r=>{r.remove()}))}componentDidRender(){if(this.editor){return}this.editor=this.createEditor()}watchValue(r){if(!this.editor){return}const t=this.editor.getValue();if(r===t){return}this.editor.getDoc().setValue(r||"")}createEditor(){const r=this.getOptions();const t=f(this.host.shadowRoot.querySelector(".editor"),r);t.on("change",this.handleChange);t.setOption("extraKeys",{Tab:r=>{const t=Array(r.getOption("indentUnit")+1).join(" ");r.replaceSelection(t)}});return t}getOptions(){let r=this.language;const t=4;let e="lime light";const i=[];if(this.isDarkMode()){e="lime dark"}if(this.language==="json"){r={name:"application/json",json:true};if(this.lint){i.push("CodeMirror-lint-markers");if(!("jsonlint"in window)){window["jsonlint"]=a}}}else if(this.language==="typescript"){r={name:"application/typescript",typescript:true}}if(this.fold){i.push("CodeMirror-foldgutter")}return{mode:r,value:this.value||"",theme:e,readOnly:this.readonly,tabSize:t,indentUnit:t,lineNumbers:this.lineNumbers,styleActiveLine:true,matchBrackets:true,lint:this.lint,foldGutter:this.fold,gutters:i}}isDarkMode(){if(this.colorScheme!=="auto"){return this.colorScheme==="dark"}return this.darkMode.matches}render(){const r={editor:true,readonly:this.readonly,"is-dark-mode":this.isDarkMode(),"is-light-mode":!this.isDarkMode()};return e("div",{class:r})}forceRedraw(){this.random=Math.random()}get darkMode(){return matchMedia("(prefers-color-scheme: dark)")}get host(){return i(this)}static get watchers(){return{value:["watchValue"]}}};s.style=l;export{s as limel_code_editor};
|
|
2
|
+
//# sourceMappingURL=p-30cef284.entry.js.map
|