planet-editor 0.1.0
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/LICENSE +24 -0
- package/README.md +129 -0
- package/THIRD-PARTY-LICENSES.md +76 -0
- package/dist/lib/components/planet-extension/node-background-extension.d.ts +23 -0
- package/dist/lib/components/planet-extension/search-extension.d.ts +39 -0
- package/dist/lib/components/planet-icons/align-center-icon.d.ts +3 -0
- package/dist/lib/components/planet-icons/align-justify-icon.d.ts +3 -0
- package/dist/lib/components/planet-icons/align-left-icon.d.ts +3 -0
- package/dist/lib/components/planet-icons/align-right-icon.d.ts +3 -0
- package/dist/lib/components/planet-icons/arrow-left-icon.d.ts +3 -0
- package/dist/lib/components/planet-icons/ban-icon.d.ts +3 -0
- package/dist/lib/components/planet-icons/blockquote-icon.d.ts +3 -0
- package/dist/lib/components/planet-icons/bold-icon.d.ts +3 -0
- package/dist/lib/components/planet-icons/check-icon.d.ts +3 -0
- package/dist/lib/components/planet-icons/chevron-down-icon.d.ts +3 -0
- package/dist/lib/components/planet-icons/close-icon.d.ts +3 -0
- package/dist/lib/components/planet-icons/code-block-icon.d.ts +3 -0
- package/dist/lib/components/planet-icons/code2-icon.d.ts +3 -0
- package/dist/lib/components/planet-icons/corner-down-left-icon.d.ts +3 -0
- package/dist/lib/components/planet-icons/external-link-icon.d.ts +3 -0
- package/dist/lib/components/planet-icons/heading-five-icon.d.ts +3 -0
- package/dist/lib/components/planet-icons/heading-four-icon.d.ts +3 -0
- package/dist/lib/components/planet-icons/heading-icon.d.ts +3 -0
- package/dist/lib/components/planet-icons/heading-one-icon.d.ts +3 -0
- package/dist/lib/components/planet-icons/heading-six-icon.d.ts +3 -0
- package/dist/lib/components/planet-icons/heading-three-icon.d.ts +3 -0
- package/dist/lib/components/planet-icons/heading-two-icon.d.ts +3 -0
- package/dist/lib/components/planet-icons/highlighter-icon.d.ts +3 -0
- package/dist/lib/components/planet-icons/image-plus-icon.d.ts +3 -0
- package/dist/lib/components/planet-icons/italic-icon.d.ts +3 -0
- package/dist/lib/components/planet-icons/line-numbers-icon.d.ts +3 -0
- package/dist/lib/components/planet-icons/link-icon.d.ts +3 -0
- package/dist/lib/components/planet-icons/list-icon.d.ts +3 -0
- package/dist/lib/components/planet-icons/list-ordered-icon.d.ts +3 -0
- package/dist/lib/components/planet-icons/list-todo-icon.d.ts +3 -0
- package/dist/lib/components/planet-icons/moon-star-icon.d.ts +3 -0
- package/dist/lib/components/planet-icons/redo2-icon.d.ts +3 -0
- package/dist/lib/components/planet-icons/search-icon.d.ts +3 -0
- package/dist/lib/components/planet-icons/strike-icon.d.ts +3 -0
- package/dist/lib/components/planet-icons/subscript-icon.d.ts +3 -0
- package/dist/lib/components/planet-icons/sun-icon.d.ts +3 -0
- package/dist/lib/components/planet-icons/superscript-icon.d.ts +3 -0
- package/dist/lib/components/planet-icons/table-icon.d.ts +3 -0
- package/dist/lib/components/planet-icons/trash-icon.d.ts +3 -0
- package/dist/lib/components/planet-icons/underline-icon.d.ts +3 -0
- package/dist/lib/components/planet-icons/undo2-icon.d.ts +3 -0
- package/dist/lib/components/planet-node/horizontal-rule-node/horizontal-rule-node-extension.d.ts +2 -0
- package/dist/lib/components/planet-node/image-node/resizable-image-extension.d.ts +10 -0
- package/dist/lib/components/planet-node/image-node/resizable-image-node-view.d.ts +7 -0
- package/dist/lib/components/planet-node/image-upload-node/image-upload-node-extension.d.ts +58 -0
- package/dist/lib/components/planet-node/image-upload-node/image-upload-node.d.ts +68 -0
- package/dist/lib/components/planet-node/image-upload-node/index.d.ts +1 -0
- package/dist/lib/components/planet-templates/simple/data/content.json.d.ts +479 -0
- package/dist/lib/components/planet-templates/simple/simple-editor.d.ts +31 -0
- package/dist/lib/components/planet-templates/simple/theme-toggle.d.ts +1 -0
- package/dist/lib/components/planet-ui/blockquote-button/blockquote-button.d.ts +22 -0
- package/dist/lib/components/planet-ui/blockquote-button/index.d.ts +2 -0
- package/dist/lib/components/planet-ui/blockquote-button/use-blockquote.d.ts +80 -0
- package/dist/lib/components/planet-ui/code-block-button/code-block-button.d.ts +22 -0
- package/dist/lib/components/planet-ui/code-block-button/index.d.ts +2 -0
- package/dist/lib/components/planet-ui/code-block-button/use-code-block.d.ts +87 -0
- package/dist/lib/components/planet-ui/color-highlight-button/color-highlight-button.d.ts +45 -0
- package/dist/lib/components/planet-ui/color-highlight-button/index.d.ts +2 -0
- package/dist/lib/components/planet-ui/color-highlight-button/use-color-highlight.d.ts +93 -0
- package/dist/lib/components/planet-ui/color-highlight-popover/color-highlight-popover.d.ts +35 -0
- package/dist/lib/components/planet-ui/color-highlight-popover/index.d.ts +1 -0
- package/dist/lib/components/planet-ui/font-size-dropdown-menu/font-size-dropdown-menu.d.ts +10 -0
- package/dist/lib/components/planet-ui/font-size-dropdown-menu/index.d.ts +1 -0
- package/dist/lib/components/planet-ui/heading-button/heading-button.d.ts +23 -0
- package/dist/lib/components/planet-ui/heading-button/index.d.ts +2 -0
- package/dist/lib/components/planet-ui/heading-button/use-heading.d.ts +108 -0
- package/dist/lib/components/planet-ui/heading-dropdown-menu/heading-dropdown-menu.d.ts +19 -0
- package/dist/lib/components/planet-ui/heading-dropdown-menu/index.d.ts +2 -0
- package/dist/lib/components/planet-ui/heading-dropdown-menu/use-heading-dropdown-menu.d.ts +73 -0
- package/dist/lib/components/planet-ui/image-upload-button/image-upload-button.d.ts +29 -0
- package/dist/lib/components/planet-ui/image-upload-button/index.d.ts +2 -0
- package/dist/lib/components/planet-ui/image-upload-button/use-image-upload.d.ts +84 -0
- package/dist/lib/components/planet-ui/link-popover/index.d.ts +2 -0
- package/dist/lib/components/planet-ui/link-popover/link-popover.d.ts +57 -0
- package/dist/lib/components/planet-ui/link-popover/use-link-popover.d.ts +117 -0
- package/dist/lib/components/planet-ui/list-button/index.d.ts +2 -0
- package/dist/lib/components/planet-ui/list-button/list-button.d.ts +23 -0
- package/dist/lib/components/planet-ui/list-button/use-list.d.ts +97 -0
- package/dist/lib/components/planet-ui/list-dropdown-menu/index.d.ts +1 -0
- package/dist/lib/components/planet-ui/list-dropdown-menu/list-dropdown-menu.d.ts +28 -0
- package/dist/lib/components/planet-ui/list-dropdown-menu/use-list-dropdown-menu.d.ts +90 -0
- package/dist/lib/components/planet-ui/mark-button/index.d.ts +2 -0
- package/dist/lib/components/planet-ui/mark-button/mark-button.d.ts +23 -0
- package/dist/lib/components/planet-ui/mark-button/use-mark.d.ts +104 -0
- package/dist/lib/components/planet-ui/search-bar/index.d.ts +1 -0
- package/dist/lib/components/planet-ui/search-bar/search-bar.d.ts +11 -0
- package/dist/lib/components/planet-ui/table-dropdown-menu/index.d.ts +1 -0
- package/dist/lib/components/planet-ui/table-dropdown-menu/table-dropdown-menu.d.ts +11 -0
- package/dist/lib/components/planet-ui/text-align-button/index.d.ts +2 -0
- package/dist/lib/components/planet-ui/text-align-button/text-align-button.d.ts +30 -0
- package/dist/lib/components/planet-ui/text-align-button/use-text-align.d.ts +101 -0
- package/dist/lib/components/planet-ui/undo-redo-button/index.d.ts +2 -0
- package/dist/lib/components/planet-ui/undo-redo-button/undo-redo-button.d.ts +23 -0
- package/dist/lib/components/planet-ui/undo-redo-button/use-undo-redo.d.ts +90 -0
- package/dist/lib/components/planet-ui-primitive/badge/badge.d.ts +8 -0
- package/dist/lib/components/planet-ui-primitive/badge/index.d.ts +1 -0
- package/dist/lib/components/planet-ui-primitive/button/button.d.ts +14 -0
- package/dist/lib/components/planet-ui-primitive/button/index.d.ts +1 -0
- package/dist/lib/components/planet-ui-primitive/button-group/button-group.d.ts +10 -0
- package/dist/lib/components/planet-ui-primitive/button-group/index.d.ts +1 -0
- package/dist/lib/components/planet-ui-primitive/card/card.d.ts +9 -0
- package/dist/lib/components/planet-ui-primitive/card/index.d.ts +1 -0
- package/dist/lib/components/planet-ui-primitive/dropdown-menu/dropdown-menu.d.ts +28 -0
- package/dist/lib/components/planet-ui-primitive/dropdown-menu/index.d.ts +1 -0
- package/dist/lib/components/planet-ui-primitive/input/index.d.ts +1 -0
- package/dist/lib/components/planet-ui-primitive/input/input.d.ts +2 -0
- package/dist/lib/components/planet-ui-primitive/popover/index.d.ts +1 -0
- package/dist/lib/components/planet-ui-primitive/popover/popover.d.ts +5 -0
- package/dist/lib/components/planet-ui-primitive/separator/index.d.ts +1 -0
- package/dist/lib/components/planet-ui-primitive/separator/separator.d.ts +5 -0
- package/dist/lib/components/planet-ui-primitive/spacer/index.d.ts +1 -0
- package/dist/lib/components/planet-ui-primitive/spacer/spacer.d.ts +5 -0
- package/dist/lib/components/planet-ui-primitive/toolbar/index.d.ts +1 -0
- package/dist/lib/components/planet-ui-primitive/toolbar/toolbar.d.ts +8 -0
- package/dist/lib/components/planet-ui-primitive/tooltip/index.d.ts +1 -0
- package/dist/lib/components/planet-ui-primitive/tooltip/tooltip.d.ts +28 -0
- package/dist/lib/favicon.svg +1 -0
- package/dist/lib/hooks/use-composed-ref.d.ts +3 -0
- package/dist/lib/hooks/use-cursor-visibility.d.ts +20 -0
- package/dist/lib/hooks/use-element-rect.d.ts +35 -0
- package/dist/lib/hooks/use-is-breakpoint.d.ts +9 -0
- package/dist/lib/hooks/use-line-numbers.d.ts +15 -0
- package/dist/lib/hooks/use-menu-navigation.d.ts +52 -0
- package/dist/lib/hooks/use-planet-editor.d.ts +6 -0
- package/dist/lib/hooks/use-scrolling.d.ts +8 -0
- package/dist/lib/hooks/use-throttled-callback.d.ts +18 -0
- package/dist/lib/hooks/use-unmount.d.ts +7 -0
- package/dist/lib/hooks/use-window-size.d.ts +35 -0
- package/dist/lib/icons.svg +24 -0
- package/dist/lib/images/planet-ui-placeholder-image.svg +10 -0
- package/dist/lib/index.js +5102 -0
- package/dist/lib/lib/index.d.ts +2 -0
- package/dist/lib/lib/planet-utils.d.ts +173 -0
- package/dist/lib/lib/upload.d.ts +10 -0
- package/dist/lib/styles.css +2 -0
- package/dist/web-component/favicon.svg +1 -0
- package/dist/web-component/icons.svg +24 -0
- package/dist/web-component/images/planet-ui-placeholder-image.svg +10 -0
- package/dist/web-component/planet-editor.css +2 -0
- package/dist/web-component/planet-editor.html +224 -0
- package/dist/web-component/planet-editor.js +203 -0
- package/package.json +101 -0
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
|
+
<title>Planet Editor</title>
|
|
7
|
+
<style>
|
|
8
|
+
html, body { margin: 0; padding: 0; }
|
|
9
|
+
planet-editor { display: block; min-height: 100vh; }
|
|
10
|
+
</style>
|
|
11
|
+
<style>.planet-tooltip{--tt-tooltip-bg:var(--tt-gray-light-900);--tt-tooltip-text:var(--white);--tt-kbd:var(--tt-gray-dark-a-400)}.dark .planet-tooltip{--tt-tooltip-bg:var(--white);--tt-tooltip-text:var(--tt-gray-light-600);--tt-kbd:var(--tt-gray-light-a-400)}.planet-tooltip{z-index:50;border-radius:var(--tt-radius-md,.375rem);background-color:var(--tt-tooltip-bg);color:var(--tt-tooltip-text);text-align:center;padding:.375rem .5rem;font-size:.75rem;font-weight:500;overflow:hidden;box-shadow:0 4px 6px -1px #0000001a}.planet-tooltip kbd{text-align:center;vertical-align:baseline;text-transform:capitalize;color:var(--tt-kbd);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif;display:inline-block}.planet-button{--tt-button-default-bg-color:var(--tt-gray-light-a-100);--tt-button-hover-bg-color:var(--tt-gray-light-200);--tt-button-active-bg-color:var(--tt-gray-light-a-200);--tt-button-active-bg-color-emphasized:var(--tt-brand-color-100);--tt-button-active-bg-color-subdued:var(--tt-gray-light-a-200);--tt-button-active-hover-bg-color:var(--tt-gray-light-300);--tt-button-active-hover-bg-color-emphasized:var(--tt-brand-color-200);--tt-button-active-hover-bg-color-subdued:var(--tt-gray-light-a-300);--tt-button-disabled-bg-color:var(--tt-gray-light-a-50)}.dark .planet-button{--tt-button-default-bg-color:var(--tt-gray-dark-a-100);--tt-button-hover-bg-color:var(--tt-gray-dark-200);--tt-button-active-bg-color:var(--tt-gray-dark-a-200);--tt-button-active-bg-color-emphasized:var(--tt-brand-color-900);--tt-button-active-bg-color-subdued:var(--tt-gray-dark-a-200);--tt-button-active-hover-bg-color:var(--tt-gray-dark-300);--tt-button-active-hover-bg-color-emphasized:var(--tt-brand-color-800);--tt-button-active-hover-bg-color-subdued:var(--tt-gray-dark-a-300);--tt-button-disabled-bg-color:var(--tt-gray-dark-a-50)}.planet-button{--tt-button-default-text-color:var(--tt-gray-light-a-600);--tt-button-hover-text-color:var(--tt-gray-light-a-900);--tt-button-active-text-color:var(--tt-gray-light-a-900);--tt-button-active-text-color-emphasized:var(--tt-gray-light-a-900);--tt-button-active-text-color-subdued:var(--tt-gray-light-a-900);--tt-button-disabled-text-color:var(--tt-gray-light-a-400)}.dark .planet-button{--tt-button-default-text-color:var(--tt-gray-dark-a-600);--tt-button-hover-text-color:var(--tt-gray-dark-a-900);--tt-button-active-text-color:var(--tt-gray-dark-a-900);--tt-button-active-text-color-emphasized:var(--tt-gray-dark-a-900);--tt-button-active-text-color-subdued:var(--tt-gray-dark-a-900);--tt-button-disabled-text-color:var(--tt-gray-dark-a-300)}.planet-button{--tt-button-default-icon-color:var(--tt-brand-color-400);--tt-button-hover-icon-color:var(--tt-brand-color-500);--tt-button-active-icon-color:var(--tt-brand-color-500);--tt-button-active-icon-color-emphasized:var(--tt-brand-color-600);--tt-button-active-icon-color-subdued:var(--tt-gray-light-a-900);--tt-button-disabled-icon-color:var(--tt-gray-light-a-400)}.dark .planet-button{--tt-button-default-icon-color:var(--tt-brand-color-300);--tt-button-hover-icon-color:var(--tt-brand-color-400);--tt-button-active-icon-color:var(--tt-brand-color-400);--tt-button-active-icon-color-emphasized:var(--tt-brand-color-300);--tt-button-active-icon-color-subdued:var(--tt-gray-dark-a-900);--tt-button-disabled-icon-color:var(--tt-gray-dark-a-400)}.planet-button{--tt-button-default-icon-sub-color:var(--tt-gray-light-a-400);--tt-button-hover-icon-sub-color:var(--tt-gray-light-a-500);--tt-button-active-icon-sub-color:var(--tt-gray-light-a-400);--tt-button-active-icon-sub-color-emphasized:var(--tt-gray-light-a-500);--tt-button-active-icon-sub-color-subdued:var(--tt-gray-light-a-400);--tt-button-disabled-icon-sub-color:var(--tt-gray-light-a-100)}.dark .planet-button{--tt-button-default-icon-sub-color:var(--tt-gray-dark-a-300);--tt-button-hover-icon-sub-color:var(--tt-gray-dark-a-400);--tt-button-active-icon-sub-color:var(--tt-gray-dark-a-300);--tt-button-active-icon-sub-color-emphasized:var(--tt-gray-dark-a-400);--tt-button-active-icon-sub-color-subdued:var(--tt-gray-dark-a-300);--tt-button-disabled-icon-sub-color:var(--tt-gray-dark-a-100)}.planet-button{--tt-button-default-dropdown-arrows-color:var(--tt-gray-light-a-600);--tt-button-hover-dropdown-arrows-color:var(--tt-gray-light-a-700);--tt-button-active-dropdown-arrows-color:var(--tt-gray-light-a-600);--tt-button-active-dropdown-arrows-color-emphasized:var(--tt-gray-light-a-700);--tt-button-active-dropdown-arrows-color-subdued:var(--tt-gray-light-a-600);--tt-button-disabled-dropdown-arrows-color:var(--tt-gray-light-a-400)}.dark .planet-button{--tt-button-default-dropdown-arrows-color:var(--tt-gray-dark-a-600);--tt-button-hover-dropdown-arrows-color:var(--tt-gray-dark-a-700);--tt-button-active-dropdown-arrows-color:var(--tt-gray-dark-a-600);--tt-button-active-dropdown-arrows-color-emphasized:var(--tt-gray-dark-a-700);--tt-button-active-dropdown-arrows-color-subdued:var(--tt-gray-dark-a-600);--tt-button-disabled-dropdown-arrows-color:var(--tt-gray-dark-a-400)}.planet-button[data-style=ghost]{--tt-button-default-bg-color:var(--transparent);--tt-button-hover-bg-color:var(--tt-gray-light-200);--tt-button-active-bg-color:var(--tt-gray-light-a-100);--tt-button-active-bg-color-emphasized:var(--tt-brand-color-100);--tt-button-active-bg-color-subdued:var(--tt-gray-light-a-100);--tt-button-active-hover-bg-color:var(--tt-gray-light-200);--tt-button-active-hover-bg-color-emphasized:var(--tt-brand-color-200);--tt-button-active-hover-bg-color-subdued:var(--tt-gray-light-a-200);--tt-button-disabled-bg-color:var(--transparent)}.dark .planet-button[data-style=ghost]{--tt-button-default-bg-color:var(--transparent);--tt-button-hover-bg-color:var(--tt-gray-dark-200);--tt-button-active-bg-color:var(--tt-gray-dark-a-100);--tt-button-active-bg-color-emphasized:var(--tt-brand-color-900);--tt-button-active-bg-color-subdued:var(--tt-gray-dark-a-100);--tt-button-active-hover-bg-color:var(--tt-gray-dark-200);--tt-button-active-hover-bg-color-emphasized:var(--tt-brand-color-800);--tt-button-active-hover-bg-color-subdued:var(--tt-gray-dark-a-200);--tt-button-disabled-bg-color:var(--transparent)}.planet-button[data-style=ghost]{--tt-button-default-text-color:var(--tt-gray-light-a-600);--tt-button-hover-text-color:var(--tt-gray-light-a-900);--tt-button-active-text-color:var(--tt-gray-light-a-900);--tt-button-active-text-color-emphasized:var(--tt-gray-light-a-900);--tt-button-active-text-color-subdued:var(--tt-gray-light-a-900);--tt-button-disabled-text-color:var(--tt-gray-light-a-400)}.dark .planet-button[data-style=ghost]{--tt-button-default-text-color:var(--tt-gray-dark-a-600);--tt-button-hover-text-color:var(--tt-gray-dark-a-900);--tt-button-active-text-color:var(--tt-gray-dark-a-900);--tt-button-active-text-color-emphasized:var(--tt-gray-dark-a-900);--tt-button-active-text-color-subdued:var(--tt-gray-dark-a-900);--tt-button-disabled-text-color:var(--tt-gray-dark-a-300)}.planet-button[data-style=ghost]{--tt-button-default-icon-color:var(--tt-brand-color-400);--tt-button-hover-icon-color:var(--tt-brand-color-500);--tt-button-active-icon-color:var(--tt-brand-color-500);--tt-button-active-icon-color-emphasized:var(--tt-brand-color-600);--tt-button-active-icon-color-subdued:var(--tt-gray-light-a-900);--tt-button-disabled-icon-color:var(--tt-gray-light-a-400)}.dark .planet-button[data-style=ghost]{--tt-button-default-icon-color:var(--tt-brand-color-300);--tt-button-hover-icon-color:var(--tt-brand-color-400);--tt-button-active-icon-color:var(--tt-brand-color-400);--tt-button-active-icon-color-emphasized:var(--tt-brand-color-300);--tt-button-active-icon-color-subdued:var(--tt-gray-dark-a-900);--tt-button-disabled-icon-color:var(--tt-gray-dark-a-400)}.planet-button[data-style=ghost]{--tt-button-default-icon-sub-color:var(--tt-gray-light-a-400);--tt-button-hover-icon-sub-color:var(--tt-gray-light-a-500);--tt-button-active-icon-sub-color:var(--tt-gray-light-a-400);--tt-button-active-icon-sub-color-emphasized:var(--tt-gray-light-a-500);--tt-button-active-icon-sub-color-subdued:var(--tt-gray-light-a-400);--tt-button-disabled-icon-sub-color:var(--tt-gray-light-a-100)}.dark .planet-button[data-style=ghost]{--tt-button-default-icon-sub-color:var(--tt-gray-dark-a-300);--tt-button-hover-icon-sub-color:var(--tt-gray-dark-a-400);--tt-button-active-icon-sub-color:var(--tt-gray-dark-a-300);--tt-button-active-icon-sub-color-emphasized:var(--tt-gray-dark-a-400);--tt-button-active-icon-sub-color-subdued:var(--tt-gray-dark-a-300);--tt-button-disabled-icon-sub-color:var(--tt-gray-dark-a-100)}.planet-button[data-style=ghost]{--tt-button-default-dropdown-arrows-color:var(--tt-gray-light-a-600);--tt-button-hover-dropdown-arrows-color:var(--tt-gray-light-a-700);--tt-button-active-dropdown-arrows-color:var(--tt-gray-light-a-600);--tt-button-active-dropdown-arrows-color-emphasized:var(--tt-gray-light-a-700);--tt-button-active-dropdown-arrows-color-subdued:var(--tt-gray-light-a-600);--tt-button-disabled-dropdown-arrows-color:var(--tt-gray-light-a-400)}.dark .planet-button[data-style=ghost]{--tt-button-default-dropdown-arrows-color:var(--tt-gray-dark-a-600);--tt-button-hover-dropdown-arrows-color:var(--tt-gray-dark-a-700);--tt-button-active-dropdown-arrows-color:var(--tt-gray-dark-a-600);--tt-button-active-dropdown-arrows-color-emphasized:var(--tt-gray-dark-a-700);--tt-button-active-dropdown-arrows-color-subdued:var(--tt-gray-dark-a-600);--tt-button-disabled-dropdown-arrows-color:var(--tt-gray-dark-a-400)}.planet-button[data-style=primary]{--tt-button-default-bg-color:var(--tt-brand-color-500);--tt-button-hover-bg-color:var(--tt-brand-color-600);--tt-button-active-bg-color:var(--tt-brand-color-100);--tt-button-active-bg-color-emphasized:var(--tt-brand-color-100);--tt-button-active-bg-color-subdued:var(--tt-brand-color-100);--tt-button-active-hover-bg-color:var(--tt-brand-color-200);--tt-button-active-hover-bg-color-emphasized:var(--tt-brand-color-200);--tt-button-active-hover-bg-color-subdued:var(--tt-brand-color-200);--tt-button-disabled-bg-color:var(--tt-gray-light-a-100)}.dark .planet-button[data-style=primary]{--tt-button-default-bg-color:var(--tt-brand-color-500);--tt-button-hover-bg-color:var(--tt-brand-color-600);--tt-button-active-bg-color:var(--tt-brand-color-900);--tt-button-active-bg-color-emphasized:var(--tt-brand-color-900);--tt-button-active-bg-color-subdued:var(--tt-brand-color-900);--tt-button-active-hover-bg-color:var(--tt-brand-color-800);--tt-button-active-hover-bg-color-emphasized:var(--tt-brand-color-800);--tt-button-active-hover-bg-color-subdued:var(--tt-brand-color-800);--tt-button-disabled-bg-color:var(--tt-gray-dark-a-100)}.planet-button[data-style=primary]{--tt-button-default-text-color:var(--white);--tt-button-hover-text-color:var(--white);--tt-button-active-text-color:var(--tt-gray-light-a-900);--tt-button-active-text-color-emphasized:var(--tt-gray-light-a-900);--tt-button-active-text-color-subdued:var(--tt-gray-light-a-900);--tt-button-disabled-text-color:var(--tt-gray-light-a-400)}.dark .planet-button[data-style=primary]{--tt-button-default-text-color:var(--white);--tt-button-hover-text-color:var(--white);--tt-button-active-text-color:var(--tt-gray-dark-a-900);--tt-button-active-text-color-emphasized:var(--tt-gray-dark-a-900);--tt-button-active-text-color-subdued:var(--tt-gray-dark-a-900);--tt-button-disabled-text-color:var(--tt-gray-dark-a-300)}.planet-button[data-style=primary]{--tt-button-default-icon-color:var(--white);--tt-button-hover-icon-color:var(--white);--tt-button-active-icon-color:var(--tt-brand-color-600);--tt-button-active-icon-color-emphasized:var(--tt-brand-color-600);--tt-button-active-icon-color-subdued:var(--tt-brand-color-600);--tt-button-disabled-icon-color:var(--tt-gray-light-a-400)}.dark .planet-button[data-style=primary]{--tt-button-default-icon-color:var(--white);--tt-button-hover-icon-color:var(--white);--tt-button-active-icon-color:var(--tt-brand-color-400);--tt-button-active-icon-color-emphasized:var(--tt-brand-color-400);--tt-button-active-icon-color-subdued:var(--tt-brand-color-400);--tt-button-disabled-icon-color:var(--tt-gray-dark-a-300)}.planet-button[data-style=primary]{--tt-button-default-icon-sub-color:var(--tt-gray-dark-a-500);--tt-button-hover-icon-sub-color:var(--tt-gray-dark-a-500);--tt-button-active-icon-sub-color:var(--tt-gray-light-a-500);--tt-button-active-icon-sub-color-emphasized:var(--tt-gray-light-a-500);--tt-button-active-icon-sub-color-subdued:var(--tt-gray-light-a-500);--tt-button-disabled-icon-sub-color:var(--tt-gray-light-a-100)}.dark .planet-button[data-style=primary]{--tt-button-default-icon-sub-color:var(--tt-gray-dark-a-400);--tt-button-hover-icon-sub-color:var(--tt-gray-dark-a-500);--tt-button-active-icon-sub-color:var(--tt-gray-dark-a-300);--tt-button-active-icon-sub-color-emphasized:var(--tt-gray-dark-a-400);--tt-button-active-icon-sub-color-subdued:var(--tt-gray-dark-a-300);--tt-button-disabled-icon-sub-color:var(--tt-gray-dark-a-100)}.planet-button[data-style=primary]{--tt-button-default-dropdown-arrows-color:var(--white);--tt-button-hover-dropdown-arrows-color:var(--white);--tt-button-active-dropdown-arrows-color:var(--tt-gray-light-a-700);--tt-button-active-dropdown-arrows-color-emphasized:var(--tt-gray-light-a-700);--tt-button-active-dropdown-arrows-color-subdued:var(--tt-gray-light-a-700);--tt-button-disabled-dropdown-arrows-color:var(--tt-gray-light-a-400)}.dark .planet-button[data-style=primary]{--tt-button-default-dropdown-arrows-color:var(--white);--tt-button-hover-dropdown-arrows-color:var(--white);--tt-button-active-dropdown-arrows-color:var(--tt-gray-dark-a-600);--tt-button-active-dropdown-arrows-color-emphasized:var(--tt-gray-dark-a-600);--tt-button-active-dropdown-arrows-color-subdued:var(--tt-gray-dark-a-600);--tt-button-disabled-dropdown-arrows-color:var(--tt-gray-dark-a-400)}.planet-button{font-feature-settings:"salt" on, "cv01" on;border-radius:var(--tt-radius-lg,.75rem);min-width:2rem;height:2rem;transition-property:background,color,opacity;transition-duration:var(--tt-transition-duration-default);transition-timing-function:var(--tt-transition-easing-default);border:none;justify-content:center;align-items:center;gap:.25rem;padding:.5rem;font-size:.875rem;font-weight:500;line-height:1.15;display:flex}.planet-button:focus-visible{outline:none}.planet-button[data-highlighted=true],.planet-button[data-focus-visible=true]{background-color:var(--tt-button-hover-bg-color);color:var(--tt-button-hover-text-color)}.planet-button[data-weight=small]{width:1.5rem;min-width:1.5rem;padding-left:0;padding-right:0}.planet-button[data-size=large]{min-width:2.375rem;height:2.375rem;padding:.625rem;font-size:.9375rem}.planet-button[data-size=small]{border-radius:var(--tt-radius-md,.5rem);min-width:1.5rem;height:1.5rem;padding:.3125rem;font-size:.75rem;line-height:1.2}.planet-button .planet-button-text{text-align:left;flex-grow:1;padding:0 .125rem;line-height:1.5rem}.planet-button[data-text-trim=on] .planet-button-text{text-overflow:ellipsis;overflow:hidden}.planet-button .planet-button-icon,.planet-button .planet-button-icon-sub,.planet-button .planet-button-dropdown-arrows,.planet-button .planet-button-dropdown-small{flex-shrink:0}.planet-button .planet-button-icon{width:1rem;height:1rem}.planet-button[data-size=large] .planet-button-icon{width:1.125rem;height:1.125rem}.planet-button[data-size=small] .planet-button-icon{width:.875rem;height:.875rem}.planet-button .planet-button-icon-sub{width:1rem;height:1rem}.planet-button[data-size=large] .planet-button-icon-sub{width:1.125rem;height:1.125rem}.planet-button[data-size=small] .planet-button-icon-sub{width:.875rem;height:.875rem}.planet-button .planet-button-dropdown-arrows{width:.75rem;height:.75rem}.planet-button[data-size=large] .planet-button-dropdown-arrows{width:.875rem;height:.875rem}.planet-button[data-size=small] .planet-button-dropdown-arrows,.planet-button .planet-button-dropdown-small{width:.625rem;height:.625rem}.planet-button[data-size=large] .planet-button-dropdown-small{width:.75rem;height:.75rem}.planet-button[data-size=small] .planet-button-dropdown-small{width:.5rem;height:.5rem}.planet-button:has(>svg):not(:has(>:not(svg))){gap:.125rem}:is(.planet-button:has(>svg):not(:has(>:not(svg)))[data-size=large],.planet-button:has(>svg):not(:has(>:not(svg)))[data-size=small]){gap:.125rem}.planet-button:has(>svg:nth-of-type(2)):has(>.planet-button-dropdown-small):not(:has(>svg:nth-of-type(3))):not(:has(>.planet-button-text)){gap:0;padding-right:.25rem}.planet-button:has(>svg:nth-of-type(2)):has(>.planet-button-dropdown-small):not(:has(>svg:nth-of-type(3))):not(:has(>.planet-button-text))[data-size=large]{padding-right:.375rem}.planet-button:has(>svg:nth-of-type(2)):has(>.planet-button-dropdown-small):not(:has(>svg:nth-of-type(3))):not(:has(>.planet-button-text))[data-size=small]{padding-right:.25rem}.planet-button .planet-button-emoji{justify-content:center;width:1rem;display:flex}.planet-button[data-size=large] .planet-button-emoji{width:1.125rem}.planet-button[data-size=small] .planet-button-emoji{width:.875rem}.planet-button{background-color:var(--tt-button-default-bg-color);color:var(--tt-button-default-text-color)}.planet-button .planet-button-icon{color:var(--tt-button-default-icon-color)}.planet-button .planet-button-icon-sub{color:var(--tt-button-default-icon-sub-color)}.planet-button .planet-button-dropdown-arrows,.planet-button .planet-button-dropdown-small{color:var(--tt-button-default-dropdown-arrows-color)}.planet-button:hover:not([data-active-item=true]):not([disabled]),.planet-button[data-active-item=true]:not([disabled]),.planet-button[data-highlighted]:not([disabled]):not([data-highlighted=false]){background-color:var(--tt-button-hover-bg-color);color:var(--tt-button-hover-text-color)}.planet-button:hover:not([data-active-item=true]):not([disabled]) .planet-button-icon,.planet-button[data-active-item=true]:not([disabled]) .planet-button-icon,.planet-button[data-highlighted]:not([disabled]):not([data-highlighted=false]) .planet-button-icon{color:var(--tt-button-hover-icon-color)}.planet-button:hover:not([data-active-item=true]):not([disabled]) .planet-button-icon-sub,.planet-button[data-active-item=true]:not([disabled]) .planet-button-icon-sub,.planet-button[data-highlighted]:not([disabled]):not([data-highlighted=false]) .planet-button-icon-sub{color:var(--tt-button-hover-icon-sub-color)}.planet-button:hover:not([data-active-item=true]):not([disabled]) .planet-button-dropdown-arrows,.planet-button:hover:not([data-active-item=true]):not([disabled]) .planet-button-dropdown-small,.planet-button[data-active-item=true]:not([disabled]) .planet-button-dropdown-arrows,.planet-button[data-active-item=true]:not([disabled]) .planet-button-dropdown-small,.planet-button[data-highlighted]:not([disabled]):not([data-highlighted=false]) .planet-button-dropdown-arrows,.planet-button[data-highlighted]:not([disabled]):not([data-highlighted=false]) .planet-button-dropdown-small{color:var(--tt-button-hover-dropdown-arrows-color)}.planet-button[data-active-state=on]:not([disabled]),.planet-button[data-state=open]:not([disabled]){background-color:var(--tt-button-active-bg-color);color:var(--tt-button-active-text-color)}.planet-button[data-active-state=on]:not([disabled]) .planet-button-icon,.planet-button[data-state=open]:not([disabled]) .planet-button-icon{color:var(--tt-button-active-icon-color)}.planet-button[data-active-state=on]:not([disabled]) .planet-button-icon-sub,.planet-button[data-state=open]:not([disabled]) .planet-button-icon-sub{color:var(--tt-button-active-icon-sub-color)}.planet-button[data-active-state=on]:not([disabled]) .planet-button-dropdown-arrows,.planet-button[data-active-state=on]:not([disabled]) .planet-button-dropdown-small,.planet-button[data-state=open]:not([disabled]) .planet-button-dropdown-arrows,.planet-button[data-state=open]:not([disabled]) .planet-button-dropdown-small{color:var(--tt-button-active-dropdown-arrows-color)}.planet-button[data-active-state=on]:not([disabled]):hover,.planet-button[data-state=open]:not([disabled]):hover{background-color:var(--tt-button-active-hover-bg-color)}.planet-button[data-active-state=on]:not([disabled])[data-appearance=emphasized],.planet-button[data-state=open]:not([disabled])[data-appearance=emphasized]{background-color:var(--tt-button-active-bg-color-emphasized);color:var(--tt-button-active-text-color-emphasized)}.planet-button[data-active-state=on]:not([disabled])[data-appearance=emphasized] .planet-button-icon,.planet-button[data-state=open]:not([disabled])[data-appearance=emphasized] .planet-button-icon{color:var(--tt-button-active-icon-color-emphasized)}.planet-button[data-active-state=on]:not([disabled])[data-appearance=emphasized] .planet-button-icon-sub,.planet-button[data-state=open]:not([disabled])[data-appearance=emphasized] .planet-button-icon-sub{color:var(--tt-button-active-icon-sub-color-emphasized)}.planet-button[data-active-state=on]:not([disabled])[data-appearance=emphasized] .planet-button-dropdown-arrows,.planet-button[data-active-state=on]:not([disabled])[data-appearance=emphasized] .planet-button-dropdown-small,.planet-button[data-state=open]:not([disabled])[data-appearance=emphasized] .planet-button-dropdown-arrows,.planet-button[data-state=open]:not([disabled])[data-appearance=emphasized] .planet-button-dropdown-small{color:var(--tt-button-active-dropdown-arrows-color-emphasized)}.planet-button[data-active-state=on]:not([disabled])[data-appearance=emphasized]:hover,.planet-button[data-state=open]:not([disabled])[data-appearance=emphasized]:hover{background-color:var(--tt-button-active-hover-bg-color-emphasized)}.planet-button[data-active-state=on]:not([disabled])[data-appearance=subdued],.planet-button[data-state=open]:not([disabled])[data-appearance=subdued]{background-color:var(--tt-button-active-bg-color-subdued);color:var(--tt-button-active-text-color-subdued)}.planet-button[data-active-state=on]:not([disabled])[data-appearance=subdued] .planet-button-icon,.planet-button[data-state=open]:not([disabled])[data-appearance=subdued] .planet-button-icon{color:var(--tt-button-active-icon-color-subdued)}.planet-button[data-active-state=on]:not([disabled])[data-appearance=subdued] .planet-button-icon-sub,.planet-button[data-state=open]:not([disabled])[data-appearance=subdued] .planet-button-icon-sub{color:var(--tt-button-active-icon-sub-color-subdued)}.planet-button[data-active-state=on]:not([disabled])[data-appearance=subdued] .planet-button-dropdown-arrows,.planet-button[data-active-state=on]:not([disabled])[data-appearance=subdued] .planet-button-dropdown-small,.planet-button[data-state=open]:not([disabled])[data-appearance=subdued] .planet-button-dropdown-arrows,.planet-button[data-state=open]:not([disabled])[data-appearance=subdued] .planet-button-dropdown-small{color:var(--tt-button-active-dropdown-arrows-color-subdued)}.planet-button[data-active-state=on]:not([disabled])[data-appearance=subdued]:hover,.planet-button[data-state=open]:not([disabled])[data-appearance=subdued]:hover{background-color:var(--tt-button-active-hover-bg-color-subdued)}.planet-button[data-active-state=on]:not([disabled])[data-appearance=subdued]:hover .planet-button-icon,.planet-button[data-state=open]:not([disabled])[data-appearance=subdued]:hover .planet-button-icon{color:var(--tt-button-active-icon-color-subdued)}.planet-button:disabled{background-color:var(--tt-button-disabled-bg-color);color:var(--tt-button-disabled-text-color)}.planet-button:disabled .planet-button-icon{color:var(--tt-button-disabled-icon-color)}.planet-separator{--tt-link-border-color:var(--tt-gray-light-a-200)}.dark .planet-separator{--tt-link-border-color:var(--tt-gray-dark-a-200)}.planet-separator{background-color:var(--tt-link-border-color);flex-shrink:0}.planet-separator[data-orientation=horizontal]{width:100%;height:1px;margin:.5rem 0}.planet-separator[data-orientation=vertical]{width:1px;height:1.5rem}:root{--tt-toolbar-height:2.75rem;--tt-safe-area-bottom:env(safe-area-inset-bottom,0px);--tt-toolbar-bg-color:var(--white);--tt-toolbar-border-color:var(--tt-gray-light-a-100)}.dark{--tt-toolbar-bg-color:var(--black);--tt-toolbar-border-color:var(--tt-gray-dark-a-50)}.planet-toolbar{align-items:center;gap:.25rem;display:flex}.planet-toolbar-group{align-items:center;gap:.125rem;display:flex}.planet-toolbar-group:empty,.planet-toolbar-group:empty+.planet-separator,.planet-separator+.planet-toolbar-group:empty{display:none}.planet-toolbar[data-variant=fixed]{z-index:50;width:100%;min-height:var(--tt-toolbar-height);background:var(--tt-toolbar-bg-color);border-bottom:1px solid var(--tt-toolbar-border-color);overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch;scrollbar-width:none;-ms-overflow-style:none;padding:0 .5rem;position:sticky;top:0;overflow-x:auto}.planet-toolbar[data-variant=fixed]::-webkit-scrollbar{display:none}@media (width<=480px){.planet-toolbar[data-variant=fixed]{height:calc(var(--tt-toolbar-height) + var(--tt-safe-area-bottom));border-top:1px solid var(--tt-toolbar-border-color);padding:0 .5rem var(--tt-safe-area-bottom);border-bottom:none;flex-wrap:nowrap;justify-content:flex-start;position:absolute;top:auto}.planet-toolbar[data-variant=fixed] .planet-toolbar-group{flex:none}}.planet-toolbar[data-variant=floating]{--tt-toolbar-padding:.125rem;--tt-toolbar-border-width:1px;border-radius:calc(var(--tt-toolbar-padding) + var(--tt-radius-lg) + var(--tt-toolbar-border-width));border:var(--tt-toolbar-border-width) solid var(--tt-toolbar-border-color);background-color:var(--tt-toolbar-bg-color);box-shadow:var(--tt-shadow-elevated-md);outline:none;padding:.188rem;overflow:hidden}.planet-toolbar[data-variant=floating][data-plain=true]{box-shadow:none;background-color:#0000;border:none;border-radius:0;padding:0}@media screen and (width<=480px){.planet-toolbar[data-variant=floating]{width:100%;box-shadow:none;border:none;border-radius:0}}:root{--planet-image-upload-active:var(--tt-brand-color-500);--planet-image-upload-progress-bg:var(--tt-brand-color-50);--planet-image-upload-icon-bg:var(--tt-brand-color-500);--planet-image-upload-text-color:var(--tt-gray-light-a-700);--planet-image-upload-subtext-color:var(--tt-gray-light-a-400);--planet-image-upload-border:var(--tt-gray-light-a-300);--planet-image-upload-border-hover:var(--tt-gray-light-a-400);--planet-image-upload-border-active:var(--tt-brand-color-500);--planet-image-upload-icon-doc-bg:var(--tt-gray-light-a-200);--planet-image-upload-icon-doc-border:var(--tt-gray-light-300);--planet-image-upload-icon-color:var(--white)}.dark{--planet-image-upload-active:var(--tt-brand-color-400);--planet-image-upload-progress-bg:var(--tt-brand-color-900);--planet-image-upload-icon-bg:var(--tt-brand-color-400);--planet-image-upload-text-color:var(--tt-gray-dark-a-700);--planet-image-upload-subtext-color:var(--tt-gray-dark-a-400);--planet-image-upload-border:var(--tt-gray-dark-a-300);--planet-image-upload-border-hover:var(--tt-gray-dark-a-400);--planet-image-upload-border-active:var(--tt-brand-color-400);--planet-image-upload-icon-doc-bg:var(--tt-gray-dark-a-200);--planet-image-upload-icon-doc-border:var(--tt-gray-dark-300);--planet-image-upload-icon-color:var(--black)}.planet-image-upload{margin:2rem 0}.planet-image-upload input[type=file]{display:none}.planet-image-upload .planet-image-upload-dropzone{-webkit-user-select:none;user-select:none;justify-content:center;align-items:flex-start;width:3.125rem;height:3.75rem;display:inline-flex;position:relative}.planet-image-upload .planet-image-upload-icon-container{background-color:var(--planet-image-upload-icon-bg);border-radius:var(--tt-radius-lg,.75rem);justify-content:center;align-items:center;width:1.75rem;height:1.75rem;display:flex;position:absolute;bottom:0;right:0}.planet-image-upload .planet-image-upload-icon{width:.875rem;height:.875rem;color:var(--planet-image-upload-icon-color)}.planet-image-upload .planet-image-upload-dropzone-rect-primary{color:var(--planet-image-upload-icon-doc-bg);position:absolute}.planet-image-upload .planet-image-upload-dropzone-rect-secondary{color:var(--planet-image-upload-icon-doc-border);position:absolute;top:0;bottom:0;right:.25rem}.planet-image-upload .planet-image-upload-text{color:var(--planet-image-upload-text-color);font-size:.875rem;font-weight:500;line-height:normal}.planet-image-upload .planet-image-upload-text em{font-style:normal;text-decoration:underline}.planet-image-upload .planet-image-upload-subtext{color:var(--planet-image-upload-subtext-color);font-size:.75rem;font-weight:600;line-height:normal}.planet-image-upload .planet-image-upload-drag-area{border:1.5px dashed var(--planet-image-upload-border);border-radius:var(--tt-radius-md,.5rem);text-align:center;cursor:pointer;padding:2rem 1.5rem;transition:all .2s;position:relative;overflow:hidden}.planet-image-upload .planet-image-upload-drag-area:hover{border-color:var(--planet-image-upload-border-hover)}.planet-image-upload .planet-image-upload-drag-area.drag-active{border-color:var(--planet-image-upload-border-active);background-color:rgba(var(--planet-image-upload-active-rgb,0, 123, 255), .05)}.planet-image-upload .planet-image-upload-drag-area.drag-over{border-color:var(--planet-image-upload-border-active);background-color:rgba(var(--planet-image-upload-active-rgb,0, 123, 255), .1)}.planet-image-upload .planet-image-upload-content{-webkit-user-select:none;user-select:none;flex-direction:column;justify-content:center;align-items:center;gap:.25rem;display:flex}.planet-image-upload .planet-image-upload-previews{flex-direction:column;gap:.75rem;display:flex}.planet-image-upload .planet-image-upload-header{border-bottom:1px solid var(--planet-image-upload-border);justify-content:space-between;align-items:center;margin-bottom:.5rem;padding:.5rem 0;display:flex}.planet-image-upload .planet-image-upload-header span{color:var(--planet-image-upload-text-color);font-size:.875rem;font-weight:500}.planet-image-upload .planet-image-upload-preview{border-radius:var(--tt-radius-md,.5rem);position:relative;overflow:hidden}.planet-image-upload .planet-image-upload-preview .planet-image-upload-progress{background-color:var(--planet-image-upload-progress-bg);transition:all .3s ease-out;position:absolute;inset:0}.planet-image-upload .planet-image-upload-preview .planet-image-upload-preview-content{border:1px solid var(--planet-image-upload-border);border-radius:var(--tt-radius-md,.5rem);justify-content:space-between;align-items:center;padding:1rem;display:flex;position:relative}.planet-image-upload .planet-image-upload-preview .planet-image-upload-file-info{align-items:center;gap:.75rem;height:2rem;display:flex}.planet-image-upload .planet-image-upload-preview .planet-image-upload-file-info .planet-image-upload-file-icon{background-color:var(--planet-image-upload-icon-bg);border-radius:var(--tt-radius-lg,.75rem);padding:.5rem}.planet-image-upload .planet-image-upload-preview .planet-image-upload-file-info .planet-image-upload-file-icon svg{width:.875rem;height:.875rem;color:var(--planet-image-upload-icon-color)}.planet-image-upload .planet-image-upload-preview .planet-image-upload-details{flex-direction:column;display:flex}.planet-image-upload .planet-image-upload-preview .planet-image-upload-actions{align-items:center;gap:.5rem;display:flex}.planet-image-upload .planet-image-upload-preview .planet-image-upload-actions .planet-image-upload-progress-text{color:var(--planet-image-upload-border-active);font-size:.75rem;font-weight:600}.tiptap.ProseMirror.ProseMirror-focused .ProseMirror-selectednode .planet-image-upload-drag-area{border-color:var(--planet-image-upload-active)}@media (width<=480px){.planet-image-upload .planet-image-upload-drag-area{padding:1.5rem 1rem}.planet-image-upload .planet-image-upload-header{flex-direction:column;align-items:flex-start;gap:.5rem}.planet-image-upload .planet-image-upload-preview-content{padding:.75rem}}.tiptap.ProseMirror{--blockquote-bg-color:var(--tt-gray-light-900)}.dark .tiptap.ProseMirror{--blockquote-bg-color:var(--tt-gray-dark-900)}.tiptap.ProseMirror blockquote{margin:1.5rem 0;padding-top:.375em;padding-bottom:.375em;padding-left:1em;position:relative}.tiptap.ProseMirror blockquote p{margin-top:0}.tiptap.ProseMirror blockquote:before,.tiptap.ProseMirror blockquote.is-empty:before{background-color:var(--blockquote-bg-color);content:"";border-radius:0;width:.25em;height:100%;position:absolute;top:0;bottom:0;left:0}.tiptap.ProseMirror{--tt-inline-code-bg-color:var(--tt-gray-light-a-100);--tt-inline-code-text-color:var(--tt-gray-light-a-700);--tt-inline-code-border-color:var(--tt-gray-light-a-200);--tt-codeblock-bg:var(--tt-gray-light-a-50);--tt-codeblock-text:var(--tt-gray-light-a-800);--tt-codeblock-border:var(--tt-gray-light-a-200)}.dark .tiptap.ProseMirror{--tt-inline-code-bg-color:var(--tt-gray-dark-a-100);--tt-inline-code-text-color:var(--tt-gray-dark-a-700);--tt-inline-code-border-color:var(--tt-gray-dark-a-200);--tt-codeblock-bg:var(--tt-gray-dark-a-50);--tt-codeblock-text:var(--tt-gray-dark-a-800);--tt-codeblock-border:var(--tt-gray-dark-a-200)}.tiptap.ProseMirror code{background-color:var(--tt-inline-code-bg-color);color:var(--tt-inline-code-text-color);border:1px solid var(--tt-inline-code-border-color);border-radius:6px/.375rem;padding:.1em .2em;font-family:JetBrains Mono NL,monospace;font-size:.875em;line-height:1.4}.tiptap.ProseMirror pre{background-color:var(--tt-codeblock-bg);color:var(--tt-codeblock-text);border:1px solid var(--tt-codeblock-border);border-radius:6px/.375rem;margin-top:1.5em;margin-bottom:1.5em;padding:1em;font-size:1rem}.tiptap.ProseMirror pre code{-webkit-text-fill-color:inherit;color:inherit;background-color:#0000;border:none;border-radius:0}.tiptap.ProseMirror{--horizontal-rule-color:var(--tt-gray-light-a-200)}.dark .tiptap.ProseMirror{--horizontal-rule-color:var(--tt-gray-dark-a-200)}.tiptap.ProseMirror hr{background-color:var(--horizontal-rule-color);border:none;height:1px}.tiptap.ProseMirror [data-type=horizontalRule]{margin-top:2.25em;margin-bottom:2.25em;padding-top:.75rem;padding-bottom:.75rem}.tiptap.ProseMirror{--tt-checklist-bg-color:var(--tt-gray-light-a-100);--tt-checklist-bg-active-color:var(--tt-gray-light-a-900);--tt-checklist-border-color:var(--tt-gray-light-a-200);--tt-checklist-border-active-color:var(--tt-gray-light-a-900);--tt-checklist-check-icon-color:var(--white);--tt-checklist-text-active:var(--tt-gray-light-a-500)}.dark .tiptap.ProseMirror{--tt-checklist-bg-color:var(--tt-gray-dark-a-100);--tt-checklist-bg-active-color:var(--tt-gray-dark-a-900);--tt-checklist-border-color:var(--tt-gray-dark-a-200);--tt-checklist-border-active-color:var(--tt-gray-dark-a-900);--tt-checklist-check-icon-color:var(--black);--tt-checklist-text-active:var(--tt-gray-dark-a-500)}.tiptap.ProseMirror ol,.tiptap.ProseMirror ul{margin-top:1.5em;margin-bottom:1.5em;padding-left:1.5em}.tiptap.ProseMirror ol:first-child,.tiptap.ProseMirror ul:first-child{margin-top:0}.tiptap.ProseMirror ol:last-child,.tiptap.ProseMirror ul:last-child{margin-bottom:0}.tiptap.ProseMirror ol ol,.tiptap.ProseMirror ol ul,.tiptap.ProseMirror ul ol,.tiptap.ProseMirror ul ul{margin-top:0;margin-bottom:0}.tiptap.ProseMirror li p{margin-top:0;line-height:1.6}.tiptap.ProseMirror ol{list-style:decimal}.tiptap.ProseMirror ol ol{list-style:lower-alpha}.tiptap.ProseMirror ol ol ol{list-style:lower-roman}.tiptap.ProseMirror ol ol ol ol{list-style:decimal}.tiptap.ProseMirror ol ol ol ol ol{list-style:lower-alpha}.tiptap.ProseMirror ol ol ol ol ol ol{list-style:lower-roman}.tiptap.ProseMirror ol ol ol ol ol ol ol{list-style:decimal}.tiptap.ProseMirror ol ol ol ol ol ol ol ol{list-style:lower-alpha}.tiptap.ProseMirror ol ol ol ol ol ol ol ol ol{list-style:lower-roman}.tiptap.ProseMirror ul:not([data-type=taskList]){list-style:outside}.tiptap.ProseMirror ul:not([data-type=taskList]) ul{list-style:circle}.tiptap.ProseMirror ul:not([data-type=taskList]) ul ul{list-style:square}.tiptap.ProseMirror ul:not([data-type=taskList]) ul ul ul{list-style:outside}.tiptap.ProseMirror ul:not([data-type=taskList]) ul ul ul ul{list-style:circle}.tiptap.ProseMirror ul:not([data-type=taskList]) ul ul ul ul ul{list-style:square}.tiptap.ProseMirror ul:not([data-type=taskList]) ul ul ul ul ul ul{list-style:outside}.tiptap.ProseMirror ul:not([data-type=taskList]) ul ul ul ul ul ul ul{list-style:circle}.tiptap.ProseMirror ul:not([data-type=taskList]) ul ul ul ul ul ul ul ul{list-style:square}.tiptap.ProseMirror ul[data-type=taskList]{padding-left:.25em}.tiptap.ProseMirror ul[data-type=taskList] li{flex-direction:row;align-items:flex-start;display:flex}.tiptap.ProseMirror ul[data-type=taskList] li:not(:has(>p:first-child)){list-style-type:none}.tiptap.ProseMirror ul[data-type=taskList] li[data-checked=true]>div>p{opacity:.5;text-decoration:line-through}.tiptap.ProseMirror ul[data-type=taskList] li[data-checked=true]>div>p span{text-decoration:line-through}.tiptap.ProseMirror ul[data-type=taskList] li label{padding-top:.375rem;padding-right:.5rem;position:relative}.tiptap.ProseMirror ul[data-type=taskList] li label input[type=checkbox]{opacity:0;width:0;height:0;position:absolute}.tiptap.ProseMirror ul[data-type=taskList] li label span{border:1px solid var(--tt-checklist-border-color);border-radius:var(--tt-radius-xs,.25rem);cursor:pointer;background-color:var(--tt-checklist-bg-color);width:1em;height:1em;transition:background-color 80ms ease-out,border-color 80ms ease-out;display:block;position:relative}.tiptap.ProseMirror ul[data-type=taskList] li label span:before{content:"";background-color:var(--tt-checklist-check-icon-color);opacity:0;width:.75em;height:.75em;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);-webkit-mask:url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22currentColor%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M21.4142%204.58579C22.1953%205.36683%2022.1953%206.63317%2021.4142%207.41421L10.4142%2018.4142C9.63317%2019.1953%208.36684%2019.1953%207.58579%2018.4142L2.58579%2013.4142C1.80474%2012.6332%201.80474%2011.3668%202.58579%2010.5858C3.36683%209.80474%204.63317%209.80474%205.41421%2010.5858L9%2014.1716L18.5858%204.58579C19.3668%203.80474%2020.6332%203.80474%2021.4142%204.58579Z%22%20fill%3D%22currentColor%22%2F%3E%3C%2Fsvg%3E) 50%/contain no-repeat;mask:url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22currentColor%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M21.4142%204.58579C22.1953%205.36683%2022.1953%206.63317%2021.4142%207.41421L10.4142%2018.4142C9.63317%2019.1953%208.36684%2019.1953%207.58579%2018.4142L2.58579%2013.4142C1.80474%2012.6332%201.80474%2011.3668%202.58579%2010.5858C3.36683%209.80474%204.63317%209.80474%205.41421%2010.5858L9%2014.1716L18.5858%204.58579C19.3668%203.80474%2020.6332%203.80474%2021.4142%204.58579Z%22%20fill%3D%22currentColor%22%2F%3E%3C%2Fsvg%3E) 50%/contain no-repeat}.tiptap.ProseMirror ul[data-type=taskList] li label input[type=checkbox]:checked+span{background:var(--tt-checklist-bg-active-color);border-color:var(--tt-checklist-border-active-color)}.tiptap.ProseMirror ul[data-type=taskList] li label input[type=checkbox]:checked+span:before{opacity:1}.tiptap.ProseMirror ul[data-type=taskList] li div{flex:1;min-width:0}.tiptap.ProseMirror img{max-width:100%;height:auto;display:block}.tiptap.ProseMirror p>img{display:inline-block}.tiptap.ProseMirror>img:not([data-type=emoji] img){border-radius:var(--tt-radius-xs,.25rem);outline:.125rem solid #0000;margin:2rem 0}.tiptap.ProseMirror img:not([data-type=emoji] img).ProseMirror-selectednode{outline-color:var(--tt-brand-color-500)}.tiptap.ProseMirror figure.resizable-image{flex-direction:column;align-items:center;margin:2rem 0;display:flex}.tiptap.ProseMirror figure.resizable-image .resizable-image-frame{max-width:100%;line-height:0;position:relative}.tiptap.ProseMirror figure.resizable-image .resizable-image-frame img{border-radius:var(--tt-radius-xs,.25rem);outline:.125rem solid #0000;max-width:100%;height:auto;margin:0}.tiptap.ProseMirror figure.resizable-image.is-selected .resizable-image-frame img{outline-color:var(--tt-brand-color-500)}.tiptap.ProseMirror figure.resizable-image .resizable-image-handle{background:var(--tt-brand-color-500,#aa3bff);border:2px solid var(--white,#fff);cursor:nwse-resize;opacity:0;z-index:5;border-radius:9999px;width:14px;height:14px;transition:opacity .12s;position:absolute;bottom:-5px;right:-5px}.tiptap.ProseMirror figure.resizable-image:hover .resizable-image-handle,.tiptap.ProseMirror figure.resizable-image.is-selected .resizable-image-handle{opacity:1}.tiptap.ProseMirror figure.resizable-image figcaption{text-align:center;width:100%;max-width:100%;color:var(--tt-gray-light-a-600,#71717a);margin-top:.5rem;font-size:.85rem;line-height:1.4}.dark .tiptap.ProseMirror figure.resizable-image figcaption{color:var(--tt-gray-dark-a-600,#a1a1aa)}.tiptap.ProseMirror figure.resizable-image .resizable-image-caption-input{text-align:center;width:100%;font:inherit;color:inherit;background:0 0;border:none;outline:none}.tiptap.ProseMirror figure.resizable-image .resizable-image-caption-input::placeholder{color:var(--tt-gray-light-a-400,#c4c4cc)}.tiptap.ProseMirror .planet-thread:has(>img){margin:2rem 0}.tiptap.ProseMirror .planet-thread:has(>img) img{border-radius:var(--tt-radius-xs,.25rem);outline:.125rem solid #0000}.tiptap.ProseMirror .planet-thread img{margin:0}.tiptap.ProseMirror h1,.tiptap.ProseMirror h2,.tiptap.ProseMirror h3,.tiptap.ProseMirror h4{color:inherit;font-style:inherit;position:relative}.tiptap.ProseMirror>h1:first-child,.tiptap.ProseMirror>h2:first-child,.tiptap.ProseMirror>h3:first-child,.tiptap.ProseMirror>h4:first-child,.tiptap.ProseMirror>.ProseMirror-widget+h1,.tiptap.ProseMirror>.ProseMirror-widget+h2,.tiptap.ProseMirror>.ProseMirror-widget+h3,.tiptap.ProseMirror>.ProseMirror-widget+h4{margin-top:0}.tiptap.ProseMirror h1{margin-top:3em;font-size:1.5em;font-weight:700}.tiptap.ProseMirror h2{margin-top:2.5em;font-size:1.25em;font-weight:700}.tiptap.ProseMirror h3{margin-top:2em;font-size:1.125em;font-weight:600}.tiptap.ProseMirror h4{margin-top:2em;font-size:1em;font-weight:600}.tiptap.ProseMirror{--tt-collaboration-carets-label:var(--tt-gray-light-900);--link-text-color:var(--tt-brand-color-500);--thread-text:var(--tt-gray-light-900);--placeholder-color:var(--tt-gray-light-a-400);--thread-bg-color:var(--tt-color-yellow-inc-2);--planet-ai-insertion-color:var(--tt-brand-color-600)}.dark .tiptap.ProseMirror{--tt-collaboration-carets-label:var(--tt-gray-dark-100);--link-text-color:var(--tt-brand-color-400);--thread-text:var(--tt-gray-dark-900);--placeholder-color:var(--tt-gray-dark-a-400);--thread-bg-color:var(--tt-color-yellow-dec-2);--planet-ai-insertion-color:var(--tt-brand-color-400)}.tiptap.ProseMirror>*{position:relative}.tiptap.ProseMirror{white-space:pre-wrap;caret-color:var(--tt-cursor-color);outline:none}.tiptap.ProseMirror p:not(:first-child):not(td p):not(th p){margin-top:20px;font-size:1rem;font-weight:400;line-height:1.6}.tiptap.ProseMirror:not(.readonly):not(.ProseMirror-hideselection) ::selection{background-color:var(--tt-selection-color)}.tiptap.ProseMirror:not(.readonly):not(.ProseMirror-hideselection) .selection::selection{background:0 0}.tiptap.ProseMirror .selection{background-color:var(--tt-selection-color);display:inline}.tiptap.ProseMirror .ProseMirror-selectednode:not(img):not(pre):not(.react-renderer){border-radius:var(--tt-radius-md);background-color:var(--tt-selection-color)}.tiptap.ProseMirror .ProseMirror-hideselection{caret-color:#0000}.tiptap.ProseMirror.resize-cursor{cursor:ew-resize;cursor:col-resize}.tiptap.ProseMirror a span{text-decoration:underline}.tiptap.ProseMirror s span{text-decoration:line-through}.tiptap.ProseMirror u span{text-decoration:underline}.tiptap.ProseMirror .planet-ai-insertion{color:var(--planet-ai-insertion-color)}.tiptap.ProseMirror .collaboration-carets__caret{pointer-events:none;word-break:normal;border-left:1px solid #0000;border-right:1px solid #0000;margin-left:-1px;margin-right:-1px;position:relative}.tiptap.ProseMirror .collaboration-carets__label{color:var(--tt-collaboration-carets-label);-webkit-user-select:none;user-select:none;white-space:nowrap;border-radius:.25rem .25rem .25rem 0;padding:.125rem .375rem;font-size:.75rem;font-weight:600;line-height:1;position:absolute;top:-1.3em;left:-1px}.tiptap.ProseMirror [data-type=emoji] img{cursor:text;width:1.25em;height:1.25em;display:inline-block}.tiptap.ProseMirror a{color:var(--link-text-color);text-decoration:underline}.tiptap.ProseMirror [data-type=mention]{color:var(--tt-brand-color-500);display:inline-block}.tiptap.ProseMirror .planet-thread.planet-thread--unresolved.planet-thread--inline{color:var(--thread-text);border-bottom:2px dashed var(--tt-color-yellow-base);font-weight:600;transition:color .2s ease-in-out,background-color .2s ease-in-out}.tiptap.ProseMirror .planet-thread.planet-thread--unresolved.planet-thread--inline.planet-thread--selected,.tiptap.ProseMirror .planet-thread.planet-thread--unresolved.planet-thread--inline.planet-thread--hovered{background-color:var(--thread-bg-color);border-bottom-color:#0000}.tiptap.ProseMirror .planet-thread.planet-thread--unresolved.planet-thread--block:has(img){outline:.125rem solid var(--tt-color-yellow-base);border-radius:var(--tt-radius-xs,.25rem);width:fit-content;overflow:hidden}.tiptap.ProseMirror .planet-thread.planet-thread--unresolved.planet-thread--block:has(img).planet-thread--selected{outline-width:.25rem;outline-color:var(--tt-color-yellow-base)}.tiptap.ProseMirror .planet-thread.planet-thread--unresolved.planet-thread--block:has(img).planet-thread--hovered{outline-width:.25rem}.tiptap.ProseMirror .planet-thread.planet-thread--unresolved.planet-thread--block:not(:has(img)){border-bottom:.125rem dashed var(--tt-color-yellow-base);border-top:.125rem dashed var(--tt-color-yellow-base);border-radius:.25rem;outline:.25rem solid #0000}:is(.tiptap.ProseMirror .planet-thread.planet-thread--unresolved.planet-thread--block:not(:has(img)).planet-thread--hovered,.tiptap.ProseMirror .planet-thread.planet-thread--unresolved.planet-thread--block:not(:has(img)).planet-thread--selected){background-color:var(--tt-color-yellow-base);outline-color:var(--tt-color-yellow-base)}.tiptap.ProseMirror .planet-thread.planet-thread--resolved.planet-thread--inline.planet-thread--selected{background-color:var(--tt-color-yellow-base);opacity:.5;border-color:#0000}.tiptap.ProseMirror .planet-thread.planet-thread--block:has(.react-renderer){margin-top:3rem;margin-bottom:3rem}.is-empty:not(.with-slash)[data-placeholder]:has(>.ProseMirror-trailingBreak:only-child):before{content:attr(data-placeholder)}.is-empty.with-slash[data-placeholder]:has(>.ProseMirror-trailingBreak:only-child):before{content:"Write, type '/' for commands…";font-style:italic}.is-empty[data-placeholder]:has(>.ProseMirror-trailingBreak:only-child):before{pointer-events:none;width:100%;height:0;text-align:inherit;position:absolute;left:0;right:0}.is-empty[data-placeholder]:has(>.ProseMirror-trailingBreak):before{color:var(--placeholder-color)}.prosemirror-dropcursor-block,.prosemirror-dropcursor-inline{cursor:grabbing;border-radius:.25rem;width:100%;height:.188rem;margin-left:-1px;margin-right:-1px;background:var(--tt-brand-color-400)!important}.tiptap.ProseMirror{--tt-indent-unit:24px}.tiptap.ProseMirror [data-indent]{margin-left:calc(var(--tt-indent-unit) * var(--tt-indent-level,0));transition:margin-left .2s ease-in-out}.planet-badge{--tt-badge-border-color:var(--tt-gray-light-a-200);--tt-badge-border-color-subdued:var(--tt-gray-light-a-200);--tt-badge-border-color-emphasized:var(--tt-gray-light-a-600);--tt-badge-text-color:var(--tt-gray-light-a-500);--tt-badge-text-color-subdued:var(--tt-gray-light-a-400);--tt-badge-text-color-emphasized:var(--tt-gray-light-a-600);--tt-badge-bg-color:var(--white);--tt-badge-bg-color-subdued:var(--white);--tt-badge-bg-color-emphasized:var(--white);--tt-badge-icon-color:var(--tt-gray-light-a-500);--tt-badge-icon-color-subdued:var(--tt-gray-light-a-400);--tt-badge-icon-color-emphasized:var(--tt-brand-color-600)}.dark .planet-badge{--tt-badge-border-color:var(--tt-gray-dark-a-200);--tt-badge-border-color-subdued:var(--tt-gray-dark-a-200);--tt-badge-border-color-emphasized:var(--tt-gray-dark-a-500);--tt-badge-text-color:var(--tt-gray-dark-a-500);--tt-badge-text-color-subdued:var(--tt-gray-dark-a-400);--tt-badge-text-color-emphasized:var(--tt-gray-dark-a-600);--tt-badge-bg-color:var(--black);--tt-badge-bg-color-subdued:var(--black);--tt-badge-bg-color-emphasized:var(--black);--tt-badge-icon-color:var(--tt-gray-dark-a-500);--tt-badge-icon-color-subdued:var(--tt-gray-dark-a-400);--tt-badge-icon-color-emphasized:var(--tt-brand-color-400)}.planet-badge[data-style=ghost]{--tt-badge-border-color:var(--tt-gray-light-a-200);--tt-badge-border-color-subdued:var(--tt-gray-light-a-200);--tt-badge-border-color-emphasized:var(--tt-gray-light-a-600);--tt-badge-text-color:var(--tt-gray-light-a-500);--tt-badge-text-color-subdued:var(--tt-gray-light-a-400);--tt-badge-text-color-emphasized:var(--tt-gray-light-a-600);--tt-badge-bg-color:var(--transparent);--tt-badge-bg-color-subdued:var(--transparent);--tt-badge-bg-color-emphasized:var(--transparent);--tt-badge-icon-color:var(--tt-gray-light-a-500);--tt-badge-icon-color-subdued:var(--tt-gray-light-a-400);--tt-badge-icon-color-emphasized:var(--tt-brand-color-600)}.dark .planet-badge[data-style=ghost]{--tt-badge-border-color:var(--tt-gray-dark-a-200);--tt-badge-border-color-subdued:var(--tt-gray-dark-a-200);--tt-badge-border-color-emphasized:var(--tt-gray-dark-a-500);--tt-badge-text-color:var(--tt-gray-dark-a-500);--tt-badge-text-color-subdued:var(--tt-gray-dark-a-400);--tt-badge-text-color-emphasized:var(--tt-gray-dark-a-600);--tt-badge-bg-color:var(--transparent);--tt-badge-bg-color-subdued:var(--transparent);--tt-badge-bg-color-emphasized:var(--transparent);--tt-badge-icon-color:var(--tt-gray-dark-a-500);--tt-badge-icon-color-subdued:var(--tt-gray-dark-a-400);--tt-badge-icon-color-emphasized:var(--tt-brand-color-400)}.planet-badge[data-style=gray]{--tt-badge-border-color:var(--tt-gray-light-a-200);--tt-badge-border-color-subdued:var(--tt-gray-light-a-200);--tt-badge-border-color-emphasized:var(--tt-gray-light-a-500);--tt-badge-text-color:var(--tt-gray-light-a-500);--tt-badge-text-color-subdued:var(--tt-gray-light-a-400);--tt-badge-text-color-emphasized:var(--white);--tt-badge-bg-color:var(--tt-gray-light-a-100);--tt-badge-bg-color-subdued:var(--tt-gray-light-a-50);--tt-badge-bg-color-emphasized:var(--tt-gray-light-a-700);--tt-badge-icon-color:var(--tt-gray-light-a-500);--tt-badge-icon-color-subdued:var(--tt-gray-light-a-400);--tt-badge-icon-color-emphasized:var(--white)}.dark .planet-badge[data-style=gray]{--tt-badge-border-color:var(--tt-gray-dark-a-200);--tt-badge-border-color-subdued:var(--tt-gray-dark-a-200);--tt-badge-border-color-emphasized:var(--tt-gray-dark-a-500);--tt-badge-text-color:var(--tt-gray-dark-a-500);--tt-badge-text-color-subdued:var(--tt-gray-dark-a-400);--tt-badge-text-color-emphasized:var(--black);--tt-badge-bg-color:var(--tt-gray-dark-a-100);--tt-badge-bg-color-subdued:var(--tt-gray-dark-a-50);--tt-badge-bg-color-emphasized:var(--tt-gray-dark-a-800);--tt-badge-icon-color:var(--tt-gray-dark-a-500);--tt-badge-icon-color-subdued:var(--tt-gray-dark-a-400);--tt-badge-icon-color-emphasized:var(--black)}.planet-badge[data-style=green]{--tt-badge-border-color:var(--tt-color-green-inc-2);--tt-badge-border-color-subdued:var(--tt-color-green-inc-3);--tt-badge-border-color-emphasized:var(--tt-color-green-dec-2);--tt-badge-text-color:var(--tt-color-green-dec-3);--tt-badge-text-color-subdued:var(--tt-color-green-dec-2);--tt-badge-text-color-emphasized:var(--tt-color-green-inc-5);--tt-badge-bg-color:var(--tt-color-green-inc-4);--tt-badge-bg-color-subdued:var(--tt-color-green-inc-5);--tt-badge-bg-color-emphasized:var(--tt-color-green-dec-1);--tt-badge-icon-color:var(--tt-color-green-dec-3);--tt-badge-icon-color-subdued:var(--tt-color-green-dec-2);--tt-badge-icon-color-emphasized:var(--tt-color-green-inc-5)}.dark .planet-badge[data-style=green]{--tt-badge-border-color:var(--tt-color-green-dec-2);--tt-badge-border-color-subdued:var(--tt-color-green-dec-3);--tt-badge-border-color-emphasized:var(--tt-color-green-base);--tt-badge-text-color:var(--tt-color-green-inc-3);--tt-badge-text-color-subdued:var(--tt-color-green-inc-2);--tt-badge-text-color-emphasized:var(--tt-color-green-dec-5);--tt-badge-bg-color:var(--tt-color-green-dec-4);--tt-badge-bg-color-subdued:var(--tt-color-green-dec-5);--tt-badge-bg-color-emphasized:var(--tt-color-green-inc-1);--tt-badge-icon-color:var(--tt-color-green-inc-3);--tt-badge-icon-color-subdued:var(--tt-color-green-inc-2);--tt-badge-icon-color-emphasized:var(--tt-color-green-dec-5)}.planet-badge[data-style=yellow]{--tt-badge-border-color:var(--tt-color-yellow-inc-2);--tt-badge-border-color-subdued:var(--tt-color-yellow-inc-3);--tt-badge-border-color-emphasized:var(--tt-color-yellow-dec-1);--tt-badge-text-color:var(--tt-color-yellow-dec-3);--tt-badge-text-color-subdued:var(--tt-color-yellow-dec-2);--tt-badge-text-color-emphasized:var(--tt-color-yellow-dec-3);--tt-badge-bg-color:var(--tt-color-yellow-inc-4);--tt-badge-bg-color-subdued:var(--tt-color-yellow-inc-5);--tt-badge-bg-color-emphasized:var(--tt-color-yellow-base);--tt-badge-icon-color:var(--tt-color-yellow-dec-3);--tt-badge-icon-color-subdued:var(--tt-color-yellow-dec-2);--tt-badge-icon-color-emphasized:var(--tt-color-yellow-dec-3)}.dark .planet-badge[data-style=yellow]{--tt-badge-border-color:var(--tt-color-yellow-dec-2);--tt-badge-border-color-subdued:var(--tt-color-yellow-dec-3);--tt-badge-border-color-emphasized:var(--tt-color-yellow-inc-1);--tt-badge-text-color:var(--tt-color-yellow-inc-3);--tt-badge-text-color-subdued:var(--tt-color-yellow-inc-2);--tt-badge-text-color-emphasized:var(--tt-color-yellow-dec-3);--tt-badge-bg-color:var(--tt-color-yellow-dec-4);--tt-badge-bg-color-subdued:var(--tt-color-yellow-dec-5);--tt-badge-bg-color-emphasized:var(--tt-color-yellow-base);--tt-badge-icon-color:var(--tt-color-yellow-inc-3);--tt-badge-icon-color-subdued:var(--tt-color-yellow-inc-2);--tt-badge-icon-color-emphasized:var(--tt-color-yellow-dec-3)}.planet-badge[data-style=red]{--tt-badge-border-color:var(--tt-color-red-inc-2);--tt-badge-border-color-subdued:var(--tt-color-red-inc-3);--tt-badge-border-color-emphasized:var(--tt-color-red-dec-2);--tt-badge-text-color:var(--tt-color-red-dec-3);--tt-badge-text-color-subdued:var(--tt-color-red-dec-2);--tt-badge-text-color-emphasized:var(--tt-color-red-inc-5);--tt-badge-bg-color:var(--tt-color-red-inc-4);--tt-badge-bg-color-subdued:var(--tt-color-red-inc-5);--tt-badge-bg-color-emphasized:var(--tt-color-red-dec-1);--tt-badge-icon-color:var(--tt-color-red-dec-3);--tt-badge-icon-color-subdued:var(--tt-color-red-dec-2);--tt-badge-icon-color-emphasized:var(--tt-color-red-inc-5)}.dark .planet-badge[data-style=red]{--tt-badge-border-color:var(--tt-color-red-dec-2);--tt-badge-border-color-subdued:var(--tt-color-red-dec-3);--tt-badge-border-color-emphasized:var(--tt-color-red-base);--tt-badge-text-color:var(--tt-color-red-inc-3);--tt-badge-text-color-subdued:var(--tt-color-red-inc-2);--tt-badge-text-color-emphasized:var(--tt-color-red-dec-5);--tt-badge-bg-color:var(--tt-color-red-dec-4);--tt-badge-bg-color-subdued:var(--tt-color-red-dec-5);--tt-badge-bg-color-emphasized:var(--tt-color-red-inc-1);--tt-badge-icon-color:var(--tt-color-red-inc-3);--tt-badge-icon-color-subdued:var(--tt-color-red-inc-2);--tt-badge-icon-color-emphasized:var(--tt-color-red-dec-5)}.planet-badge[data-style=brand]{--tt-badge-border-color:var(--tt-brand-color-300);--tt-badge-border-color-subdued:var(--tt-brand-color-200);--tt-badge-border-color-emphasized:var(--tt-brand-color-600);--tt-badge-text-color:var(--tt-brand-color-800);--tt-badge-text-color-subdued:var(--tt-brand-color-700);--tt-badge-text-color-emphasized:var(--tt-brand-color-50);--tt-badge-bg-color:var(--tt-brand-color-100);--tt-badge-bg-color-subdued:var(--tt-brand-color-50);--tt-badge-bg-color-emphasized:var(--tt-brand-color-600);--tt-badge-icon-color:var(--tt-brand-color-800);--tt-badge-icon-color-subdued:var(--tt-brand-color-700);--tt-badge-icon-color-emphasized:var(--tt-brand-color-100)}.dark .planet-badge[data-style=brand]{--tt-badge-border-color:var(--tt-brand-color-700);--tt-badge-border-color-subdued:var(--tt-brand-color-800);--tt-badge-border-color-emphasized:var(--tt-brand-color-400);--tt-badge-text-color:var(--tt-brand-color-200);--tt-badge-text-color-subdued:var(--tt-brand-color-300);--tt-badge-text-color-emphasized:var(--tt-brand-color-950);--tt-badge-bg-color:var(--tt-brand-color-900);--tt-badge-bg-color-subdued:var(--tt-brand-color-950);--tt-badge-bg-color-emphasized:var(--tt-brand-color-400);--tt-badge-icon-color:var(--tt-brand-color-200);--tt-badge-icon-color-subdued:var(--tt-brand-color-300);--tt-badge-icon-color-emphasized:var(--tt-brand-color-900)}.planet-badge-group{flex-wrap:wrap;align-items:center;gap:.25rem;display:flex}.planet-badge-group [data-orientation=vertical]{flex-direction:column}.planet-badge-group [data-orientation=horizontal]{flex-direction:row}.planet-badge{font-feature-settings:"salt" on, "cv01" on;border-radius:var(--tt-radius-sm,.375rem);min-width:1.25rem;height:1.25rem;transition-property:background,color,opacity;transition-duration:var(--tt-transition-duration-default);transition-timing-function:var(--tt-transition-easing-default);border:1px solid;justify-content:center;align-items:center;padding:.25rem;font-size:.625rem;font-weight:700;line-height:1.15;display:flex}.planet-badge[data-size=large]{border-radius:var(--tt-radius-md,.375rem);min-width:1.5rem;height:1.5rem;padding:.375rem;font-size:.75rem}.planet-badge[data-size=small]{border-radius:var(--tt-radius-xs,.25rem);min-width:1rem;height:1rem;padding:.125rem}.planet-badge .planet-badge-text{text-align:left;flex-grow:1;padding:0 .125rem}.planet-badge[data-text-trim=on] .planet-badge-text{text-overflow:ellipsis;overflow:hidden}.planet-badge .planet-badge-icon{pointer-events:none;flex-shrink:0;width:.625rem;height:.625rem}.planet-badge[data-size=large] .planet-badge-icon{width:.75rem;height:.75rem}.planet-badge{background-color:var(--tt-badge-bg-color);border-color:var(--tt-badge-border-color);color:var(--tt-badge-text-color)}.planet-badge .planet-badge-icon{color:var(--tt-badge-icon-color)}.planet-badge[data-appearance=emphasized]{background-color:var(--tt-badge-bg-color-emphasized);border-color:var(--tt-badge-border-color-emphasized);color:var(--tt-badge-text-color-emphasized)}.planet-badge[data-appearance=emphasized] .planet-badge-icon{color:var(--tt-badge-icon-color-emphasized)}.planet-badge[data-appearance=subdued]{background-color:var(--tt-badge-bg-color-subdued);border-color:var(--tt-badge-border-color-subdued);color:var(--tt-badge-text-color-subdued)}.planet-badge[data-appearance=subdued] .planet-badge-icon{color:var(--tt-badge-icon-color-subdued)}:root{--tt-dropdown-menu-bg-color:var(--white);--tt-dropdown-menu-text-color:var(--tt-gray-light-a-600);--tt-dropdown-menu-label-color:var(--tt-gray-light-a-800)}:root.dark,.dark{--tt-dropdown-menu-bg-color:var(--tt-gray-dark-50);--tt-dropdown-menu-text-color:var(--tt-gray-dark-a-600);--tt-dropdown-menu-label-color:var(--tt-gray-dark-a-800)}.planet-dropdown-menu-content{--slide-x:0px;--slide-y:0px;--padding:.375rem;z-index:50;min-width:8rem;max-height:var(--radix-dropdown-menu-content-available-height);border-radius:calc(var(--padding) + var(--tt-radius-lg));background-color:var(--tt-dropdown-menu-bg-color);color:var(--tt-dropdown-menu-text-color);box-shadow:var(--tt-shadow-elevated-md);transform-origin:var(--radix-dropdown-menu-content-transform-origin);padding:.375rem;transition-duration:.1s;position:relative;overflow:hidden auto}.planet-dropdown-menu-content[data-side=bottom]{--slide-y:-.5rem}.planet-dropdown-menu-content[data-side=top]{--slide-y:.5rem}.planet-dropdown-menu-content[data-side=left]{--slide-x:.5rem}.planet-dropdown-menu-content[data-side=right]{--slide-x:-.5rem}.planet-dropdown-menu-content[data-state=open]{animation:.1s forwards dropdown-in}.planet-dropdown-menu-content[data-state=closed]{animation:.1s forwards dropdown-out;overflow:hidden}.planet-dropdown-menu-sub-content{--slide-x:0px;--slide-y:0px;--padding:.375rem;z-index:50;border-radius:calc(var(--padding) + var(--tt-radius-lg));background-color:var(--tt-dropdown-menu-bg-color);min-width:6rem;box-shadow:var(--tt-shadow-elevated-md);color:var(--tt-dropdown-menu-text-color);transform-origin:var(--radix-dropdown-menu-content-transform-origin);padding:.25rem;transition-duration:.1s;overflow:hidden}.planet-dropdown-menu-sub-content[data-side=bottom]{--slide-y:-.5rem}.planet-dropdown-menu-sub-content[data-side=top]{--slide-y:.5rem}.planet-dropdown-menu-sub-content[data-side=left]{--slide-x:.5rem}.planet-dropdown-menu-sub-content[data-side=right]{--slide-x:-.5rem}.planet-dropdown-menu-sub-content[data-state=open]{animation:.1s forwards dropdown-in}.planet-dropdown-menu-sub-content[data-state=closed]{animation:.1s forwards dropdown-out}@keyframes dropdown-in{0%{opacity:0;transform:scale(.95) translate(var(--slide-x), var(--slide-y))}to{opacity:1;transform:scale(1)translate(0)}}@keyframes dropdown-out{0%{opacity:1;transform:scale(1)translate(0)}to{opacity:0;transform:scale(.95) translate(var(--slide-x), var(--slide-y))}}.planet-dropdown-menu-label{text-transform:capitalize;color:var(--tt-dropdown-menu-label-color);padding:.75rem .5rem .25rem;font-size:.75rem;font-weight:600;line-height:normal}.planet-dropdown-menu-label[data-inset=true]{padding-left:1.75rem}.planet-dropdown-menu-group,.planet-dropdown-menu-group[data-orientation=vertical]{flex-direction:column;display:flex}.planet-dropdown-menu-group[data-orientation=horizontal]{flex-direction:row;align-items:center;gap:.25rem;display:flex}:root{--tt-input-placeholder:var(--tt-gray-light-a-400);--tt-input-border:var(--tt-gray-light-a-200);--tt-input-border-focus:var(--tt-gray-light-a-300)}.dark{--tt-input-placeholder:var(--tt-gray-dark-a-400);--tt-input-border:var(--tt-gray-dark-a-200);--tt-input-border-focus:var(--tt-gray-dark-a-300)}.planet-input{border-radius:var(--tt-radius-md);border:1px solid var(--tt-input-border);background:0 0;outline:none;width:100%;min-width:0;height:2rem;padding:.25rem .625rem;font-size:1rem;transition:color,background-color,border-color .15s}.planet-input::placeholder{color:var(--tt-input-placeholder)}.planet-input:focus-visible{border-color:var(--tt-input-border-focus)}@media (width>=768px){.planet-input{font-size:.875rem}}.planet-popover{--tt-popover-bg-color:var(--white);--tt-popover-border-color:var(--tt-gray-light-a-100);--tt-popover-text-color:var(--tt-gray-light-a-600)}:root.dark,.dark{--tt-popover-border-color:var(--tt-gray-dark-a-50);--tt-popover-bg-color:var(--tt-gray-dark-50);--tt-popover-text-color:var(--tt-gray-dark-a-600)}.planet-popover{z-index:50;transform-origin:var(--radix-popover-content-transform-origin);max-height:var(--radix-popover-content-available-height);outline:none}.planet-popover>*{max-height:var(--radix-popover-content-available-height)}.planet-popover[data-state=open]{animation:.15s cubic-bezier(.16,1,.3,1) fadeIn,.15s cubic-bezier(.16,1,.3,1) zoomIn}.planet-popover[data-state=closed]{animation:.15s cubic-bezier(.16,1,.3,1) fadeOut,.15s cubic-bezier(.16,1,.3,1) zoomOut}.planet-popover[data-side=top],.planet-popover[data-side=top-start],.planet-popover[data-side=top-end]{animation:.15s cubic-bezier(.16,1,.3,1) slideFromBottom}.planet-popover[data-side=right],.planet-popover[data-side=right-start],.planet-popover[data-side=right-end]{animation:.15s cubic-bezier(.16,1,.3,1) slideFromLeft}.planet-popover[data-side=bottom],.planet-popover[data-side=bottom-start],.planet-popover[data-side=bottom-end]{animation:.15s cubic-bezier(.16,1,.3,1) slideFromTop}.planet-popover[data-side=left],.planet-popover[data-side=left-start],.planet-popover[data-side=left-end]{animation:.15s cubic-bezier(.16,1,.3,1) slideFromRight}:root{--planet-card-bg-color:var(--white);--planet-card-border-color:var(--tt-gray-light-a-100);--planet-card-group-label-color:var(--tt-gray-light-a-800)}.dark{--planet-card-bg-color:var(--tt-gray-dark-50);--planet-card-border-color:var(--tt-gray-dark-a-100);--planet-card-group-label-color:var(--tt-gray-dark-a-800)}.planet-card{--padding:.375rem;--border-width:1px;border-radius:calc(var(--padding) + var(--tt-radius-lg));box-shadow:var(--tt-shadow-elevated-md);background-color:var(--planet-card-bg-color);border:1px solid var(--planet-card-border-color);word-wrap:break-word;background-clip:border-box;outline:none;flex-direction:column;align-items:center;min-width:0;display:flex;position:relative}.planet-card-header{border-bottom:var(--border-width) solid var(--planet-card-border-color);flex:none;justify-content:space-between;align-items:center;width:100%;padding:.375rem;display:flex}.planet-card-body{flex:auto;padding:.375rem;overflow-y:auto}.planet-card-item-group{vertical-align:middle;min-width:max-content;display:flex;position:relative}.planet-card-item-group[data-orientation=vertical]{flex-direction:column;justify-content:center}.planet-card-item-group[data-orientation=horizontal]{flex-direction:row;align-items:center;gap:.25rem}.planet-card-group-label{text-transform:capitalize;color:var(--planet-card-group-label-color);padding:.75rem .5rem .25rem;font-size:.75rem;font-weight:600;line-height:normal}.planet-button-highlight{border-radius:var(--tt-radius-xl);background-color:var(--highlight-color);width:1.25rem;height:1.25rem;margin:0 -.175rem;transition:transform .2s;position:relative}.planet-button-highlight:after{content:"";border-radius:inherit;box-sizing:border-box;border:1px solid var(--highlight-color);filter:brightness(95%);mix-blend-mode:multiply;width:100%;height:100%;position:absolute;top:0;left:0}.dark .planet-button-highlight:after{filter:brightness(140%);mix-blend-mode:lighten}.planet-button[data-active-state=on] .planet-button-highlight:after{filter:brightness(80%)}.dark .planet-button[data-active-state=on] .planet-button-highlight:after{filter:brightness(180%)}.planet-button-group{align-items:stretch;width:fit-content;display:flex}.planet-button-group:has(>[data-slot=planet-button-group]){gap:.125rem}.planet-button-group>:focus-visible{z-index:10;position:relative}.planet-button-group>[data-slot=select-trigger]:not([class*=w-]){width:fit-content}.planet-button-group>input{flex:1}.planet-button-group-horizontal>[data-slot]{border-top-right-radius:0;border-bottom-right-radius:0}.planet-button-group-horizontal>[data-slot]:not(:has(~[data-slot])){border-top-right-radius:var(--tt-radius-lg)!important;border-bottom-right-radius:var(--tt-radius-lg)!important}.planet-button-group-horizontal>[data-slot]~[data-slot]{border-left-width:0;border-top-left-radius:0;border-bottom-left-radius:0}.planet-button-group-horizontal:has(select[aria-hidden=true]:last-child)>[data-slot=select-trigger]:last-of-type{border-top-right-radius:var(--tt-radius-lg);border-bottom-right-radius:var(--tt-radius-lg)}.planet-button-group-vertical{flex-direction:column}.planet-button-group-vertical>[data-slot]{border-bottom-right-radius:0;border-bottom-left-radius:0}.planet-button-group-vertical>[data-slot]:not(:has(~[data-slot])){border-bottom-left-radius:var(--tt-radius-lg)!important;border-bottom-right-radius:var(--tt-radius-lg)!important}.planet-button-group-vertical>[data-slot]~[data-slot]{border-top-width:0;border-top-left-radius:0;border-top-right-radius:0}.planet-button-group-separator{align-self:stretch;position:relative}.planet-button-group-separator[data-orientation=horizontal]{width:auto;margin-left:1px;margin-right:1px}.planet-button-group-separator[data-orientation=vertical]{height:auto;margin-top:1px;margin-bottom:1px}.planet-link-input{text-overflow:ellipsis;white-space:nowrap;border:none;min-width:12rem;padding-right:0;font-size:.875rem}.planet-link-input:focus{text-overflow:clip;overflow:visible}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}@keyframes fadeOut{0%{opacity:1}to{opacity:0}}@keyframes zoomIn{0%{transform:scale(.95)}to{transform:scale(1)}}@keyframes zoomOut{0%{transform:scale(1)}to{transform:scale(.95)}}@keyframes zoom{0%{opacity:0;transform:scale(.95)}to{opacity:1;transform:scale(1)}}@keyframes slideFromTop{0%{transform:translateY(-.5rem)}to{transform:translateY(0)}}@keyframes slideFromRight{0%{transform:translate(.5rem)}to{transform:translate(0)}}@keyframes slideFromLeft{0%{transform:translate(-.5rem)}to{transform:translate(0)}}@keyframes slideFromBottom{0%{transform:translateY(.5rem)}to{transform:translateY(0)}}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}body{--tt-toolbar-height:44px;--tt-theme-text:var(--tt-gray-light-900)}.dark body{--tt-theme-text:var(--tt-gray-dark-900)}body{color:var(--tt-theme-text);font-optical-sizing:auto;overscroll-behavior-y:none;padding:0;font-family:Inter,sans-serif;font-style:normal;font-weight:400}html,body{overscroll-behavior-x:none}html,body,#root,#app{background-color:var(--tt-bg-color);height:100%}::-webkit-scrollbar{width:.25rem}*{scrollbar-width:thin;scrollbar-color:var(--tt-scrollbar-color) transparent}::-webkit-scrollbar-thumb{background-color:var(--tt-scrollbar-color);border-radius:9999px}::-webkit-scrollbar-track{background:0 0}.tiptap.ProseMirror{font-family:DM Sans,sans-serif}.simple-editor-wrapper{width:100vw;height:100vh;overflow:auto}.simple-editor-content{flex-direction:column;flex:1;width:100%;max-width:800px;height:100%;margin:0 auto;display:flex}.simple-editor-content .tiptap.ProseMirror.simple-editor{flex:1;padding:3rem 3rem 30vh}@media screen and (width<=480px){.simple-editor-content .tiptap.ProseMirror.simple-editor{padding:1rem 1.5rem 30vh}}.tiptap.ProseMirror table{border-collapse:collapse;table-layout:fixed;width:100%;margin:1.25rem 0;overflow:hidden}.tiptap.ProseMirror table td,.tiptap.ProseMirror table th{border:1px solid var(--tt-gray-light-a-300,#d4d4d8);box-sizing:border-box;vertical-align:top;min-width:1em;padding:.4rem .6rem;position:relative}.tiptap.ProseMirror table td>*,.tiptap.ProseMirror table th>*{margin-bottom:0}.tiptap.ProseMirror table th{background-color:var(--tt-gray-light-a-100,#f4f4f5);text-align:left;font-weight:600}.tiptap.ProseMirror table .selectedCell:after{background:var(--tt-brand-color-100,#aa3bff26);content:"";pointer-events:none;z-index:2;position:absolute;inset:0}.tiptap.ProseMirror table .column-resize-handle{background-color:var(--tt-brand-color-500,#aa3bff);pointer-events:none;width:3px;position:absolute;top:0;bottom:-2px;right:-2px}.tiptap.ProseMirror .tableWrapper{margin:1.25rem 0;overflow-x:auto}.tiptap.ProseMirror.resize-cursor{cursor:ew-resize}.dark .tiptap.ProseMirror table td,.dark .tiptap.ProseMirror table th{border-color:var(--tt-gray-dark-a-300,#3f3f46)}.dark .tiptap.ProseMirror table th{background-color:var(--tt-gray-dark-a-100,#27272a)}.simple-editor-wrapper[data-line-numbers=true]{--planet-gutter-width:4.75rem;position:relative}.simple-editor-wrapper[data-line-numbers=true] .tiptap.ProseMirror.simple-editor{padding-left:var(--planet-gutter-width);position:relative}.simple-editor-wrapper[data-line-numbers=true] .tiptap.ProseMirror.simple-editor:before{content:"";top:0;bottom:0;left:calc(var(--planet-gutter-width) - 1rem);background-color:var(--tt-gray-light-a-200);pointer-events:none;width:1px;position:absolute}.planet-line-gutter{pointer-events:none;-webkit-user-select:none;user-select:none;z-index:0;width:3rem;position:absolute;top:0}.planet-line-number{text-align:right;letter-spacing:.02em;width:100%;color:var(--tt-gray-light-a-400);font-family:SFMono-Regular,ui-monospace,Menlo,Consolas,monospace;font-size:.72rem;position:absolute;left:0}.dark .simple-editor-wrapper[data-line-numbers=true] .tiptap.ProseMirror.simple-editor:before{background-color:var(--tt-gray-dark-a-200)}.dark .planet-line-number{color:var(--tt-gray-dark-a-400)}.simple-editor-wrapper{position:relative}.tiptap.ProseMirror .planet-search-match{background-color:var(--tt-brand-color-200);border-radius:2px}.tiptap.ProseMirror .planet-search-match--current{background-color:var(--tt-brand-color-400);box-shadow:0 0 0 1px var(--tt-brand-color-500)}.planet-search-bar{top:calc(var(--tt-toolbar-height,44px) + .5rem);z-index:20;border:1px solid var(--tt-gray-light-a-200);background-color:#fff;border-radius:.625rem;align-items:center;gap:.125rem;padding:.25rem .375rem;display:flex;position:absolute;right:1rem;box-shadow:0 6px 20px #0000001f}.dark .planet-search-bar{border-color:var(--tt-gray-dark-a-200);background-color:#1c1c1f;box-shadow:0 6px 20px #00000073}.planet-search-input{width:12rem;color:var(--tt-theme-text);background:0 0;border:0;outline:none;padding:.25rem .4rem;font-size:.875rem}.planet-search-input::placeholder{color:var(--tt-gray-light-a-400)}.dark .planet-search-input::placeholder{color:var(--tt-gray-dark-a-400)}.planet-search-count{font-variant-numeric:tabular-nums;text-align:center;min-width:2.75rem;color:var(--tt-gray-light-a-500);padding:0 .25rem;font-size:.75rem}.dark .planet-search-count{color:var(--tt-gray-dark-a-500)}.planet-search-case{font-size:.78rem;font-weight:600;line-height:1}:root{overflow-wrap:break-word;-webkit-text-size-adjust:none;-moz-text-size-adjust:none;text-size-adjust:none;text-rendering:optimizelegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;--tt-gray-light-a-50:#3838380a;--tt-gray-light-a-100:#0f16240d;--tt-gray-light-a-200:#25272d1a;--tt-gray-light-a-300:#2f323733;--tt-gray-light-a-400:#282c336b;--tt-gray-light-a-500:#34373ca3;--tt-gray-light-a-600:#24272ec7;--tt-gray-light-a-700:#23252ade;--tt-gray-light-a-800:#1e2024f2;--tt-gray-light-a-900:#1d1e20fa;--tt-gray-light-50:#fafafa;--tt-gray-light-100:#f4f4f5;--tt-gray-light-200:#eaeaeb;--tt-gray-light-300:#d5d6d7;--tt-gray-light-400:#a6a7ab;--tt-gray-light-500:#7d7f82;--tt-gray-light-600:#53565a;--tt-gray-light-700:#404145;--tt-gray-light-800:#2c2d30;--tt-gray-light-900:#222325;--tt-gray-dark-a-50:#e8e8fd0d;--tt-gray-dark-a-100:#e7e7f312;--tt-gray-dark-a-200:#eeeef61c;--tt-gray-dark-a-300:#efeff538;--tt-gray-dark-a-400:#f4f4ff5e;--tt-gray-dark-a-500:#eceefd80;--tt-gray-dark-a-600:#f7f7fda3;--tt-gray-dark-a-700:#fbfbfebf;--tt-gray-dark-a-800:#fdfdfde0;--tt-gray-dark-a-900:#fffffff5;--tt-gray-dark-50:#19191a;--tt-gray-dark-100:#202022;--tt-gray-dark-200:#2d2d2f;--tt-gray-dark-300:#464649;--tt-gray-dark-400:#636369;--tt-gray-dark-500:#7c7c83;--tt-gray-dark-600:#a3a3a8;--tt-gray-dark-700:#c0c0c3;--tt-gray-dark-800:#e0e0e1;--tt-gray-dark-900:#f5f5f5;--tt-brand-color-50:#faf1ec;--tt-brand-color-100:#f4dace;--tt-brand-color-200:#ebbba6;--tt-brand-color-300:#e29e82;--tt-brand-color-400:#dc8b6b;--tt-brand-color-500:#d97757;--tt-brand-color-600:#c56342;--tt-brand-color-700:#a44e30;--tt-brand-color-800:#823d25;--tt-brand-color-900:#5e2c1b;--tt-brand-color-950:#30180d;--tt-color-green-inc-5:#f0fff2;--tt-color-green-inc-4:#d6ffdc;--tt-color-green-inc-3:#b8ffc5;--tt-color-green-inc-2:#90fea8;--tt-color-green-inc-1:#67fe92;--tt-color-green-base:#01fe73;--tt-color-green-dec-1:#03ce5e;--tt-color-green-dec-2:#02a247;--tt-color-green-dec-3:#007a35;--tt-color-green-dec-4:#005221;--tt-color-green-dec-5:#002e0f;--tt-color-yellow-inc-5:#fffcf0;--tt-color-yellow-inc-4:#fff7d1;--tt-color-yellow-inc-3:#fff1ad;--tt-color-yellow-inc-2:#ffeb8a;--tt-color-yellow-inc-1:#ffe45c;--tt-color-yellow-base:#fd0;--tt-color-yellow-dec-1:#d1b500;--tt-color-yellow-dec-2:#a38d00;--tt-color-yellow-dec-3:#7a6a00;--tt-color-yellow-dec-4:#524500;--tt-color-yellow-dec-5:#2e2600;--tt-color-red-inc-5:#ffeeeb;--tt-color-red-inc-4:#ffcdc2;--tt-color-red-inc-3:#fa9;--tt-color-red-inc-2:#ff8a75;--tt-color-red-inc-1:#ff5d47;--tt-color-red-base:#ff3014;--tt-color-red-dec-1:#d11800;--tt-color-red-dec-2:#a30e00;--tt-color-red-dec-3:#7a0800;--tt-color-red-dec-4:#520400;--tt-color-red-dec-5:#2e0100;--white:#fff;--black:#0e0e11;--transparent:#fff0;--tt-shadow-elevated-md:0px 16px 48px 0px #1118270a, 0px 12px 24px 0px #1118270a, 0px 6px 8px 0px #11182705, 0px 2px 3px 0px #11182705;--tt-radius-xxs:.125rem;--tt-radius-xs:.25rem;--tt-radius-sm:.375rem;--tt-radius-md:.5rem;--tt-radius-lg:.75rem;--tt-radius-xl:1rem;--tt-transition-duration-short:.1s;--tt-transition-duration-default:.2s;--tt-transition-duration-long:.64s;--tt-transition-easing-default:cubic-bezier(.46, .03, .52, .96);--tt-transition-easing-cubic:cubic-bezier(.65, .05, .36, 1);--tt-transition-easing-quart:cubic-bezier(.77, 0, .18, 1);--tt-transition-easing-circ:cubic-bezier(.79, .14, .15, .86);--tt-transition-easing-back:cubic-bezier(.68, -.55, .27, 1.55);--tt-accent-contrast:8%;--tt-destructive-contrast:8%;--tt-foreground-contrast:8%}:root,:root *,:root :before,:root :after{box-sizing:border-box;transition:none var(--tt-transition-duration-default) var(--tt-transition-easing-default)}:root{--tt-bg-color:var(--white);--tt-border-color:var(--tt-gray-light-a-200);--tt-border-color-tint:var(--tt-gray-light-a-100);--tt-sidebar-bg-color:var(--tt-gray-light-100);--tt-scrollbar-color:var(--tt-gray-light-a-200);--tt-cursor-color:var(--tt-brand-color-500);--tt-selection-color:#9d8aff33;--tt-card-bg-color:var(--white);--tt-card-border-color:var(--tt-gray-light-a-100)}.dark{--tt-bg-color:var(--black);--tt-border-color:var(--tt-gray-dark-a-200);--tt-border-color-tint:var(--tt-gray-dark-a-100);--tt-sidebar-bg-color:var(--tt-gray-dark-100);--tt-scrollbar-color:var(--tt-gray-dark-a-200);--tt-cursor-color:var(--tt-brand-color-400);--tt-selection-color:#7a52ff33;--tt-card-bg-color:var(--tt-gray-dark-50);--tt-card-border-color:var(--tt-gray-dark-a-50);--tt-shadow-elevated-md:0px 16px 48px 0px #00000080, 0px 12px 24px 0px #0000003d, 0px 6px 8px 0px #00000038, 0px 2px 3px 0px #0000001f}:root{--tt-color-text-gray:#787673;--tt-color-text-brown:#9d6a53;--tt-color-text-orange:#d9730d;--tt-color-text-yellow:#ca922f;--tt-color-text-green:#448361;--tt-color-text-blue:#327da9;--tt-color-text-purple:#8f64af;--tt-color-text-pink:#c24c8b;--tt-color-text-red:#d34a45;--tt-color-text-gray-contrast:#54473126;--tt-color-text-brown-contrast:#d2a28e59;--tt-color-text-orange-contrast:#e07b3845;--tt-color-text-yellow-contrast:#ecbe4163;--tt-color-text-green-contrast:#7bb78145;--tt-color-text-blue-contrast:#5ea6cf45;--tt-color-text-purple-contrast:#a881c545;--tt-color-text-pink-contrast:#e189b445;--tt-color-text-red-contrast:#f4aa9f66}.dark{--tt-color-text-gray:#9c9c9c;--tt-color-text-brown:#b9856e;--tt-color-text-orange:#c77d48;--tt-color-text-yellow:#ca994e;--tt-color-text-green:#519e71;--tt-color-text-blue:#3699d3;--tt-color-text-purple:#9e69d3;--tt-color-text-pink:#d15796;--tt-color-text-red:#df5553;--tt-color-text-gray-contrast:#ffffff17;--tt-color-text-brown-contrast:#b9674640;--tt-color-text-orange-contrast:#e97d2533;--tt-color-text-yellow-contrast:#b3823d33;--tt-color-text-green-contrast:#2d9a6533;--tt-color-text-blue-contrast:#327da933;--tt-color-text-purple-contrast:#9b60d22e;--tt-color-text-pink-contrast:#dc4c9238;--tt-color-text-red-contrast:#dd555540}:root{--tt-color-highlight-yellow:#fef9c3;--tt-color-highlight-green:#dcfce7;--tt-color-highlight-blue:#e0f2fe;--tt-color-highlight-purple:#f3e8ff;--tt-color-highlight-red:#ffe4e6;--tt-color-highlight-gray:#f8f8f7;--tt-color-highlight-brown:#f4eeee;--tt-color-highlight-orange:#fbecdd;--tt-color-highlight-pink:#fcf1f6;--tt-color-highlight-yellow-contrast:#fbe604;--tt-color-highlight-green-contrast:#c7fad8;--tt-color-highlight-blue-contrast:#ceeafd;--tt-color-highlight-purple-contrast:#e4ccff;--tt-color-highlight-red-contrast:#ffccd0;--tt-color-highlight-gray-contrast:#54483126;--tt-color-highlight-brown-contrast:#d2a28d59;--tt-color-highlight-orange-contrast:#e07c3945;--tt-color-highlight-pink-contrast:#e188b345}.dark{--tt-color-highlight-yellow:#6b6524;--tt-color-highlight-green:#509568;--tt-color-highlight-blue:#6e92aa;--tt-color-highlight-purple:#583e74;--tt-color-highlight-red:#743e42;--tt-color-highlight-gray:#2f2f2f;--tt-color-highlight-brown:#4a3228;--tt-color-highlight-orange:#5c3b23;--tt-color-highlight-pink:#4e2c3c;--tt-color-highlight-yellow-contrast:#58531e;--tt-color-highlight-green-contrast:#47855d;--tt-color-highlight-blue-contrast:#5e86a1;--tt-color-highlight-purple-contrast:#4c3564;--tt-color-highlight-red-contrast:#643539;--tt-color-highlight-gray-contrast:#ffffff18;--tt-color-highlight-brown-contrast:#b8654540;--tt-color-highlight-orange-contrast:#e97e2533;--tt-color-highlight-pink-contrast:#dc4c9138}html,body{margin:0;padding:0}#root{min-height:100svh}
|
|
12
|
+
/*$vite$:1*/</style>
|
|
13
|
+
</head>
|
|
14
|
+
<body>
|
|
15
|
+
<!-- Initial content via the "content" attribute (HTML). Remove
|
|
16
|
+
"line-numbers" to start without the gutter; add "editable=\"false\""
|
|
17
|
+
for read-only. Listen for the "change" event to read { html, json }. -->
|
|
18
|
+
<planet-editor content="<h1>Planet Editor</h1><p>Start typing…</p>"></planet-editor>
|
|
19
|
+
|
|
20
|
+
<script>(function(){var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,a)=>(a=n==null?{}:e(i(n)),s(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n)),l=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function ee(e,t){return E(e.type,t,e.props)}function D(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function O(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var k=/\/+/g;function te(e,t){return typeof e==`object`&&e&&e.key!=null?O(``+e.key):t.toString(36)}function A(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function ne(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,ne(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+te(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(k,`$&/`)+`/`),ne(o,r,i,``,function(e){return e})):o!=null&&(D(o)&&(o=ee(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(k,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+te(a,u),c+=ne(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+te(a,u++),c+=ne(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return ne(A(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function re(e,t,n){if(e==null)return e;var r=[],i=0;return ne(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function ie(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var j=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},M={map:re,forEach:function(e,t,n){re(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return re(e,function(){t++}),t},toArray:function(e){return re(e,function(e){return e})||[]},only:function(e){if(!D(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=M,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!T.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return E(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)T.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return E(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=D,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:ie}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,j)}catch(e){j(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.2.7`})),u=o(((e,t)=>{t.exports=l()})),d=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,S||(S=!0,D());else{var t=n(l);t!==null&&te(x,t.startTime-e)}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function ee(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&te(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?D():S=!1}}}var D;if(typeof y==`function`)D=function(){y(ee)};else if(typeof MessageChannel<`u`){var O=new MessageChannel,k=O.port2;O.port1.onmessage=ee,D=function(){k.postMessage(null)}}else D=function(){_(ee,0)};function te(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,te(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,D()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),f=o(((e,t)=>{t.exports=d()})),p=o((e=>{var t=u();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`);function o(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var s=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return o(e,t,null,r)},e.flushSync=function(e){var t=s.T,n=i.p;try{if(s.T=null,i.p=2,e)return e()}finally{s.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`)if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=c(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??i.d.M(e)},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`)if(t){var n=c(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else i.d.m(e)},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return s.H.useFormState(e,t,n)},e.useFormStatus=function(){return s.H.useHostTransitionStatus()},e.version=`19.2.7`})),m=o(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=p()})),h=o((e=>{var t=f(),n=u(),r=m();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function s(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(o(e)!==e)throw Error(i(188))}function d(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function p(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=p(e),t!==null)return t;e=e.sibling}return null}var h=Object.assign,g=Symbol.for(`react.element`),_=Symbol.for(`react.transitional.element`),v=Symbol.for(`react.portal`),y=Symbol.for(`react.fragment`),b=Symbol.for(`react.strict_mode`),x=Symbol.for(`react.profiler`),S=Symbol.for(`react.consumer`),C=Symbol.for(`react.context`),w=Symbol.for(`react.forward_ref`),T=Symbol.for(`react.suspense`),E=Symbol.for(`react.suspense_list`),ee=Symbol.for(`react.memo`),D=Symbol.for(`react.lazy`),O=Symbol.for(`react.activity`),k=Symbol.for(`react.memo_cache_sentinel`),te=Symbol.iterator;function A(e){return typeof e!=`object`||!e?null:(e=te&&e[te]||e[`@@iterator`],typeof e==`function`?e:null)}var ne=Symbol.for(`react.client.reference`);function re(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===ne?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case y:return`Fragment`;case x:return`Profiler`;case b:return`StrictMode`;case T:return`Suspense`;case E:return`SuspenseList`;case O:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case v:return`Portal`;case C:return e.displayName||`Context`;case S:return(e._context.displayName||`Context`)+`.Consumer`;case w:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case ee:return t=e.displayName||null,t===null?re(e.type)||`Memo`:t;case D:t=e._payload,e=e._init;try{return re(e(t))}catch{}}return null}var ie=Array.isArray,j=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,M=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ae={pending:!1,data:null,method:null,action:null},oe=[],se=-1;function ce(e){return{current:e}}function le(e){0>se||(e.current=oe[se],oe[se]=null,se--)}function ue(e,t){se++,oe[se]=e.current,e.current=t}var de=ce(null),fe=ce(null),pe=ce(null),me=ce(null);function he(e,t){switch(ue(pe,t),ue(fe,e),ue(de,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Jd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Jd(t),e=Yd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}le(de),ue(de,e)}function ge(){le(de),le(fe),le(pe)}function _e(e){e.memoizedState!==null&&ue(me,e);var t=de.current,n=Yd(t,e.type);t!==n&&(ue(fe,e),ue(de,n))}function ve(e){fe.current===e&&(le(de),le(fe)),me.current===e&&(le(me),ap._currentValue=ae)}var ye,be;function xe(e){if(ye===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);ye=t&&t[1]||``,be=-1<e.stack.indexOf(`
|
|
21
|
+
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
|
22
|
+
`+ye+e+be}var Se=!1;function Ce(e,t){if(!e||Se)return``;Se=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
|
|
23
|
+
`),l=s.split(`
|
|
24
|
+
`);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
|
|
25
|
+
`+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{Se=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?xe(n):``}function we(e,t){switch(e.tag){case 26:case 27:case 5:return xe(e.type);case 16:return xe(`Lazy`);case 13:return e.child!==t&&t!==null?xe(`Suspense Fallback`):xe(`Suspense`);case 19:return xe(`SuspenseList`);case 0:case 15:return Ce(e.type,!1);case 11:return Ce(e.type.render,!1);case 1:return Ce(e.type,!0);case 31:return xe(`Activity`);default:return``}}function Te(e){try{var t=``,n=null;do t+=we(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
|
|
26
|
+
Error generating stack: `+e.message+`
|
|
27
|
+
`+e.stack}}var Ee=Object.prototype.hasOwnProperty,De=t.unstable_scheduleCallback,Oe=t.unstable_cancelCallback,ke=t.unstable_shouldYield,Ae=t.unstable_requestPaint,je=t.unstable_now,Me=t.unstable_getCurrentPriorityLevel,Ne=t.unstable_ImmediatePriority,Pe=t.unstable_UserBlockingPriority,Fe=t.unstable_NormalPriority,Ie=t.unstable_LowPriority,Le=t.unstable_IdlePriority,Re=t.log,ze=t.unstable_setDisableYieldValue,Be=null,Ve=null;function He(e){if(typeof Re==`function`&&ze(e),Ve&&typeof Ve.setStrictMode==`function`)try{Ve.setStrictMode(Be,e)}catch{}}var Ue=Math.clz32?Math.clz32:Ke,We=Math.log,Ge=Math.LN2;function Ke(e){return e>>>=0,e===0?32:31-(We(e)/Ge|0)|0}var qe=256,Je=262144,Ye=4194304;function Xe(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Ze(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=Xe(n))):i=Xe(o):i=Xe(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=Xe(n))):i=Xe(o)):i=Xe(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function Qe(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function $e(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function et(){var e=Ye;return Ye<<=1,!(Ye&62914560)&&(Ye=4194304),e}function tt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function nt(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function rt(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-Ue(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&it(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function it(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Ue(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function at(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Ue(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function ot(e,t){var n=t&-t;return n=n&42?1:st(n),(n&(e.suspendedLanes|t))===0?n:0}function st(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function ct(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function lt(){var e=M.p;return e===0?(e=window.event,e===void 0?32:yp(e.type)):e}function ut(e,t){var n=M.p;try{return M.p=e,t()}finally{M.p=n}}var dt=Math.random().toString(36).slice(2),ft=`__reactFiber$`+dt,pt=`__reactProps$`+dt,mt=`__reactContainer$`+dt,ht=`__reactEvents$`+dt,gt=`__reactListeners$`+dt,_t=`__reactHandles$`+dt,vt=`__reactResources$`+dt,yt=`__reactMarker$`+dt;function bt(e){delete e[ft],delete e[pt],delete e[ht],delete e[gt],delete e[_t]}function xt(e){var t=e[ft];if(t)return t;for(var n=e.parentNode;n;){if(t=n[mt]||n[ft]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=vf(e);e!==null;){if(n=e[ft])return n;e=vf(e)}return t}e=n,n=e.parentNode}return null}function St(e){if(e=e[ft]||e[mt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Ct(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function wt(e){var t=e[vt];return t||=e[vt]={hoistableStyles:new Map,hoistableScripts:new Map},t}function Tt(e){e[yt]=!0}var Et=new Set,Dt={};function Ot(e,t){kt(e,t),kt(e+`Capture`,t)}function kt(e,t){for(Dt[e]=t,e=0;e<t.length;e++)Et.add(t[e])}var At=RegExp(`^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`),jt={},Mt={};function Nt(e){return Ee.call(Mt,e)?!0:Ee.call(jt,e)?!1:At.test(e)?Mt[e]=!0:(jt[e]=!0,!1)}function Pt(e,t,n){if(Nt(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,``+n)}}function Ft(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,``+n)}}function It(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,``+r)}}function Lt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Rt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function zt(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Bt(e){if(!e._valueTracker){var t=Rt(e)?`checked`:`value`;e._valueTracker=zt(e,t,``+e[t])}}function Vt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Rt(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function Ht(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}var Ut=/[\n"\\]/g;function Wt(e){return e.replace(Ut,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Gt(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+Lt(t)):e.value!==``+Lt(t)&&(e.value=``+Lt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):qt(e,o,Lt(n)):qt(e,o,Lt(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+Lt(s):e.removeAttribute(`name`)}function Kt(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){Bt(e);return}n=n==null?``:``+Lt(n),t=t==null?n:``+Lt(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),Bt(e)}function qt(e,t,n){t===`number`&&Ht(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function Jt(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+Lt(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function Yt(e,t,n){if(t!=null&&(t=``+Lt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+Lt(n)}function Xt(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(ie(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Lt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Bt(e)}function Zt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Qt=new Set(`animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp`.split(` `));function $t(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||Qt.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function en(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&$t(e,a,r)}else for(var o in t)t.hasOwnProperty(o)&&$t(e,o,t[o])}function tn(e){if(e.indexOf(`-`)===-1)return!1;switch(e){case`annotation-xml`:case`color-profile`:case`font-face`:case`font-face-src`:case`font-face-uri`:case`font-face-format`:case`font-face-name`:case`missing-glyph`:return!1;default:return!0}}var nn=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),rn=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function an(e){return rn.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function on(){}var sn=null;function cn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ln=null,un=null;function dn(e){var t=St(e);if(t&&(e=t.stateNode)){var n=e[pt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Gt(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+Wt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[pt]||null;if(!a)throw Error(i(90));Gt(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&Vt(r)}break a;case`textarea`:Yt(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&Jt(e,!!n.multiple,t,!1)}}}var fn=!1;function pn(e,t,n){if(fn)return e(t,n);fn=!0;try{return e(t)}finally{if(fn=!1,(ln!==null||un!==null)&&(Eu(),ln&&(t=ln,e=un,un=ln=null,dn(t),e)))for(t=0;t<e.length;t++)dn(e[t])}}function mn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[pt]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=!(e===`button`||e===`input`||e===`select`||e===`textarea`)),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(i(231,t,typeof n));return n}var hn=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),gn=!1;if(hn)try{var _n={};Object.defineProperty(_n,"passive",{get:function(){gn=!0}}),window.addEventListener(`test`,_n,_n),window.removeEventListener(`test`,_n,_n)}catch{gn=!1}var vn=null,yn=null,bn=null;function xn(){if(bn)return bn;var e,t=yn,n=t.length,r,i=`value`in vn?vn.value:vn.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return bn=i.slice(e,1<r?1-r:void 0)}function Sn(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Cn(){return!0}function wn(){return!1}function Tn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?Cn:wn,this.isPropagationStopped=wn,this}return h(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=Cn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=Cn)},persist:function(){},isPersistent:Cn}),t}var En={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Dn=Tn(En),On=h({},En,{view:0,detail:0}),N=Tn(On),kn,An,jn,P=h({},On,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Vn,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==jn&&(jn&&e.type===`mousemove`?(kn=e.screenX-jn.screenX,An=e.screenY-jn.screenY):An=kn=0,jn=e),kn)},movementY:function(e){return`movementY`in e?e.movementY:An}}),Mn=Tn(P),F=Tn(h({},P,{dataTransfer:0})),Nn=Tn(h({},On,{relatedTarget:0})),Pn=Tn(h({},En,{animationName:0,elapsedTime:0,pseudoElement:0})),Fn=Tn(h({},En,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),In=Tn(h({},En,{data:0})),Ln={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Rn={8:`Backspace`,9:`Tab`,12:`Clear`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,19:`Pause`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,45:`Insert`,46:`Delete`,112:`F1`,113:`F2`,114:`F3`,115:`F4`,116:`F5`,117:`F6`,118:`F7`,119:`F8`,120:`F9`,121:`F10`,122:`F11`,123:`F12`,144:`NumLock`,145:`ScrollLock`,224:`Meta`},zn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Bn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=zn[e])?!!t[e]:!1}function Vn(){return Bn}var Hn=Tn(h({},On,{key:function(e){if(e.key){var t=Ln[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=Sn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Rn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Vn,charCode:function(e){return e.type===`keypress`?Sn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?Sn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Un=Tn(h({},P,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Wn=Tn(h({},On,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Vn})),Gn=Tn(h({},En,{propertyName:0,elapsedTime:0,pseudoElement:0})),Kn=Tn(h({},P,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),qn=Tn(h({},En,{newState:0,oldState:0})),Jn=[9,13,27,32],Yn=hn&&`CompositionEvent`in window,Xn=null;hn&&`documentMode`in document&&(Xn=document.documentMode);var Zn=hn&&`TextEvent`in window&&!Xn,Qn=hn&&(!Yn||Xn&&8<Xn&&11>=Xn),$n=` `,er=!1;function tr(e,t){switch(e){case`keyup`:return Jn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function nr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var rr=!1;function ir(e,t){switch(e){case`compositionend`:return nr(t);case`keypress`:return t.which===32?(er=!0,$n):null;case`textInput`:return e=t.data,e===$n&&er?null:e;default:return null}}function ar(e,t){if(rr)return e===`compositionend`||!Yn&&tr(e,t)?(e=xn(),bn=yn=vn=null,rr=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return Qn&&t.locale!==`ko`?null:t.data;default:return null}}var or={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function sr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!or[e.type]:t===`textarea`}function cr(e,t,n,r){ln?un?un.push(r):un=[r]:ln=r,t=Nd(t,`onChange`),0<t.length&&(n=new Dn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var lr=null,ur=null;function dr(e){Ed(e,0)}function fr(e){if(Vt(Ct(e)))return e}function pr(e,t){if(e===`change`)return t}var mr=!1;if(hn){var hr;if(hn){var gr=`oninput`in document;if(!gr){var _r=document.createElement(`div`);_r.setAttribute(`oninput`,`return;`),gr=typeof _r.oninput==`function`}hr=gr}else hr=!1;mr=hr&&(!document.documentMode||9<document.documentMode)}function vr(){lr&&(lr.detachEvent(`onpropertychange`,yr),ur=lr=null)}function yr(e){if(e.propertyName===`value`&&fr(ur)){var t=[];cr(t,ur,e,cn(e)),pn(dr,t)}}function br(e,t,n){e===`focusin`?(vr(),lr=t,ur=n,lr.attachEvent(`onpropertychange`,yr)):e===`focusout`&&vr()}function xr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return fr(ur)}function Sr(e,t){if(e===`click`)return fr(t)}function Cr(e,t){if(e===`input`||e===`change`)return fr(t)}function wr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Tr=typeof Object.is==`function`?Object.is:wr;function Er(e,t){if(Tr(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!Ee.call(t,i)||!Tr(e[i],t[i]))return!1}return!0}function Dr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Or(e,t){var n=Dr(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=Dr(n)}}function kr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?kr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Ar(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Ht(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Ht(e.document)}return t}function jr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var Mr=hn&&`documentMode`in document&&11>=document.documentMode,Nr=null,Pr=null,Fr=null,Ir=!1;function Lr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Ir||Nr==null||Nr!==Ht(r)||(r=Nr,`selectionStart`in r&&jr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Fr&&Er(Fr,r)||(Fr=r,r=Nd(Pr,`onSelect`),0<r.length&&(t=new Dn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Nr)))}function Rr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var zr={animationend:Rr(`Animation`,`AnimationEnd`),animationiteration:Rr(`Animation`,`AnimationIteration`),animationstart:Rr(`Animation`,`AnimationStart`),transitionrun:Rr(`Transition`,`TransitionRun`),transitionstart:Rr(`Transition`,`TransitionStart`),transitioncancel:Rr(`Transition`,`TransitionCancel`),transitionend:Rr(`Transition`,`TransitionEnd`)},Br={},Vr={};hn&&(Vr=document.createElement(`div`).style,`AnimationEvent`in window||(delete zr.animationend.animation,delete zr.animationiteration.animation,delete zr.animationstart.animation),`TransitionEvent`in window||delete zr.transitionend.transition);function Hr(e){if(Br[e])return Br[e];if(!zr[e])return e;var t=zr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Vr)return Br[e]=t[n];return e}var Ur=Hr(`animationend`),Wr=Hr(`animationiteration`),Gr=Hr(`animationstart`),Kr=Hr(`transitionrun`),qr=Hr(`transitionstart`),Jr=Hr(`transitioncancel`),Yr=Hr(`transitionend`),Xr=new Map,Zr=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel`.split(` `);Zr.push(`scrollEnd`);function Qr(e,t){Xr.set(e,t),Ot(t,[e])}var $r=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},ei=[],ti=0,ni=0;function ri(){for(var e=ti,t=ni=ti=0;t<e;){var n=ei[t];ei[t++]=null;var r=ei[t];ei[t++]=null;var i=ei[t];ei[t++]=null;var a=ei[t];if(ei[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&si(n,i,a)}}function ii(e,t,n,r){ei[ti++]=e,ei[ti++]=t,ei[ti++]=n,ei[ti++]=r,ni|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function ai(e,t,n,r){return ii(e,t,n,r),ci(e)}function oi(e,t){return ii(e,null,null,t),ci(e)}function si(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-Ue(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function ci(e){if(50<_u)throw _u=0,vu=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var li={};function ui(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function di(e,t,n,r){return new ui(e,t,n,r)}function fi(e){return e=e.prototype,!(!e||!e.isReactComponent)}function pi(e,t){var n=e.alternate;return n===null?(n=di(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function mi(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function hi(e,t,n,r,a,o){var s=0;if(r=e,typeof e==`function`)fi(e)&&(s=1);else if(typeof e==`string`)s=Xf(e,n,de.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case O:return e=di(31,n,t,a),e.elementType=O,e.lanes=o,e;case y:return gi(n.children,a,o,t);case b:s=8,a|=24;break;case x:return e=di(12,n,t,a|2),e.elementType=x,e.lanes=o,e;case T:return e=di(13,n,t,a),e.elementType=T,e.lanes=o,e;case E:return e=di(19,n,t,a),e.elementType=E,e.lanes=o,e;default:if(typeof e==`object`&&e)switch(e.$$typeof){case C:s=10;break a;case S:s=9;break a;case w:s=11;break a;case ee:s=14;break a;case D:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=di(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function gi(e,t,n,r){return e=di(7,e,r,t),e.lanes=n,e}function _i(e,t,n){return e=di(6,e,null,t),e.lanes=n,e}function vi(e){var t=di(18,null,null,0);return t.stateNode=e,t}function yi(e,t,n){return t=di(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var bi=new WeakMap;function xi(e,t){if(typeof e==`object`&&e){var n=bi.get(e);return n===void 0?(t={value:e,source:t,stack:Te(t)},bi.set(e,t),t):n}return{value:e,source:t,stack:Te(t)}}var Si=[],Ci=0,wi=null,Ti=0,Ei=[],Di=0,Oi=null,ki=1,Ai=``;function ji(e,t){Si[Ci++]=Ti,Si[Ci++]=wi,wi=e,Ti=t}function Mi(e,t,n){Ei[Di++]=ki,Ei[Di++]=Ai,Ei[Di++]=Oi,Oi=e;var r=ki;e=Ai;var i=32-Ue(r)-1;r&=~(1<<i),n+=1;var a=32-Ue(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,ki=1<<32-Ue(t)+i|n<<i|r,Ai=a+e}else ki=1<<a|n<<i|r,Ai=e}function Ni(e){e.return!==null&&(ji(e,1),Mi(e,1,0))}function Pi(e){for(;e===wi;)wi=Si[--Ci],Si[Ci]=null,Ti=Si[--Ci],Si[Ci]=null;for(;e===Oi;)Oi=Ei[--Di],Ei[Di]=null,Ai=Ei[--Di],Ei[Di]=null,ki=Ei[--Di],Ei[Di]=null}function Fi(e,t){Ei[Di++]=ki,Ei[Di++]=Ai,Ei[Di++]=Oi,ki=t.id,Ai=t.overflow,Oi=e}var Ii=null,Li=null,I=!1,Ri=null,zi=!1,Bi=Error(i(519));function Vi(e){throw qi(xi(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),Bi}function Hi(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[ft]=e,t[pt]=r,n){case`dialog`:K(`cancel`,t),K(`close`,t);break;case`iframe`:case`object`:case`embed`:K(`load`,t);break;case`video`:case`audio`:for(n=0;n<wd.length;n++)K(wd[n],t);break;case`source`:K(`error`,t);break;case`img`:case`image`:case`link`:K(`error`,t),K(`load`,t);break;case`details`:K(`toggle`,t);break;case`input`:K(`invalid`,t),Kt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:K(`invalid`,t);break;case`textarea`:K(`invalid`,t),Xt(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||Rd(t.textContent,n)?(r.popover!=null&&(K(`beforetoggle`,t),K(`toggle`,t)),r.onScroll!=null&&K(`scroll`,t),r.onScrollEnd!=null&&K(`scrollend`,t),r.onClick!=null&&(t.onclick=on),t=!0):t=!1,t||Vi(e,!0)}function Ui(e){for(Ii=e.return;Ii;)switch(Ii.tag){case 5:case 31:case 13:zi=!1;return;case 27:case 3:zi=!0;return;default:Ii=Ii.return}}function Wi(e){if(e!==Ii)return!1;if(!I)return Ui(e),I=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!==`form`&&n!==`button`)||Xd(e.type,e.memoizedProps)),n=!n),n&&Li&&Vi(e),Ui(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Li=_f(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Li=_f(e)}else t===27?(t=Li,af(e.type)?(e=gf,gf=null,Li=e):Li=t):Li=Ii?hf(e.stateNode.nextSibling):null;return!0}function Gi(){Li=Ii=null,I=!1}function Ki(){var e=Ri;return e!==null&&(ru===null?ru=e:ru.push.apply(ru,e),Ri=null),e}function qi(e){Ri===null?Ri=[e]:Ri.push(e)}var Ji=ce(null),Yi=null,Xi=null;function Zi(e,t,n){ue(Ji,t._currentValue),t._currentValue=n}function Qi(e){e._currentValue=Ji.current,le(Ji)}function $i(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function ea(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),$i(o.return,n,e),r||(s=null);break a}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(i(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),$i(s,n,e),s=null}else s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function ta(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;Tr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===me.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[ap]:e.push(ap))}a=a.return}e!==null&&ea(t,e,n,r),t.flags|=262144}function na(e){for(e=e.firstContext;e!==null;){if(!Tr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ra(e){Yi=e,Xi=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function ia(e){return oa(Yi,e)}function aa(e,t){return Yi===null&&ra(e),oa(e,t)}function oa(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Xi===null){if(e===null)throw Error(i(308));Xi=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Xi=Xi.next=t;return n}var sa=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},ca=t.unstable_scheduleCallback,la=t.unstable_NormalPriority,ua={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function da(){return{controller:new sa,data:new Map,refCount:0}}function fa(e){e.refCount--,e.refCount===0&&ca(la,function(){e.controller.abort()})}var pa=null,ma=0,ha=0,ga=null;function _a(e,t){if(pa===null){var n=pa=[];ma=0,ha=vd(),ga={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return ma++,t.then(va,va),t}function va(){if(--ma===0&&pa!==null){ga!==null&&(ga.status=`fulfilled`);var e=pa;pa=null,ha=0,ga=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function ya(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var ba=j.S;j.S=function(e,t){ou=je(),typeof t==`object`&&t&&typeof t.then==`function`&&_a(e,t),ba!==null&&ba(e,t)};var xa=ce(null);function Sa(){var e=xa.current;return e===null?B.pooledCache:e}function Ca(e,t){t===null?ue(xa,xa.current):ue(xa,t.pool)}function wa(){var e=Sa();return e===null?null:{parent:ua._currentValue,pool:e}}var Ta=Error(i(460)),Ea=Error(i(474)),Da=Error(i(542)),Oa={then:function(){}};function ka(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Aa(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(on,on),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Pa(e),e;default:if(typeof t.status==`string`)t.then(on,on);else{if(e=B,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Pa(e),e}throw Ma=t,Ta}}function ja(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(Ma=e,Ta):e}}var Ma=null;function Na(){if(Ma===null)throw Error(i(459));var e=Ma;return Ma=null,e}function Pa(e){if(e===Ta||e===Da)throw Error(i(483))}var Fa=null,Ia=0;function La(e){var t=Ia;return Ia+=1,Fa===null&&(Fa=[]),Aa(Fa,e,t)}function Ra(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function za(e,t){throw t.$$typeof===g?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function Ba(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function a(e,t){return e=pi(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=67108866,n):(r=r.index,r<n?(t.flags|=67108866,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=67108866),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=_i(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===y?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===D&&ja(i)===t.type)?(t=a(t,n.props),Ra(t,n),t.return=e,t):(t=hi(n.type,n.key,n.props,null,e.mode,r),Ra(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=yi(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=gi(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=_i(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case _:return n=hi(t.type,t.key,t.props,null,e.mode,n),Ra(n,t),n.return=e,n;case v:return t=yi(t,e.mode,n),t.return=e,t;case D:return t=ja(t),f(e,t,n)}if(ie(t)||A(t))return t=gi(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,La(t),n);if(t.$$typeof===C)return f(e,aa(e,t),n);za(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case _:return n.key===i?l(e,t,n,r):null;case v:return n.key===i?u(e,t,n,r):null;case D:return n=ja(n),p(e,t,n,r)}if(ie(n)||A(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,La(n),r);if(n.$$typeof===C)return p(e,t,aa(e,n),r);za(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case _:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case v:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case D:return r=ja(r),m(e,t,n,r,i)}if(ie(r)||A(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,La(r),i);if(r.$$typeof===C)return m(e,t,n,aa(t,r),i);za(t,r)}return null}function h(i,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),I&&ji(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return I&&ji(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&g.alternate!==null&&d.delete(g.key===null?h:g.key),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),I&&ji(i,h),l}function g(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),I&&ji(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return I&&ji(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),I&&ji(a,g),u}function b(e,r,o,c){if(typeof o==`object`&&o&&o.type===y&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case _:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===y){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===D&&ja(l)===r.type){n(e,r.sibling),c=a(r,o.props),Ra(c,o),c.return=e,e=c;break a}n(e,r);break}else t(e,r);r=r.sibling}o.type===y?(c=gi(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=hi(o.type,o.key,o.props,null,e.mode,c),Ra(c,o),c.return=e,e=c)}return s(e);case v:a:{for(l=o.key;r!==null;){if(r.key===l)if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}else{n(e,r);break}else t(e,r);r=r.sibling}c=yi(o,e.mode,c),c.return=e,e=c}return s(e);case D:return o=ja(o),b(e,r,o,c)}if(ie(o))return h(e,r,o,c);if(A(o)){if(l=A(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return b(e,r,La(o),c);if(o.$$typeof===C)return b(e,r,aa(e,o),c);za(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=_i(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Ia=0;var i=b(e,t,n,r);return Fa=null,i}catch(t){if(t===Ta||t===Da)throw t;var a=di(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Va=Ba(!0),Ha=Ba(!1),Ua=!1;function Wa(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ga(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Ka(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function qa(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,z&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=ci(e),si(e,null,n),t}return ii(e,r,t,n),ci(e)}function Ja(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,at(e,n)}}function Ya(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Xa=!1;function Za(){if(Xa){var e=ga;if(e!==null)throw e}}function Qa(e,t,n,r){Xa=!1;var i=e.updateQueue;Ua=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(H&f)===f:(r&f)===f){f!==0&&f===ha&&(Xa=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,g=s;f=t;var _=n;switch(g.tag){case 1:if(m=g.payload,typeof m==`function`){d=m.call(_,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=g.payload,f=typeof m==`function`?m.call(_,d,f):m,f==null)break a;d=h({},d,f);break a;case 2:Ua=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),Ql|=o,e.lanes=o,e.memoizedState=d}}function $a(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function eo(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)$a(n[e],t)}var to=ce(null),no=ce(0);function ro(e,t){e=Xl,ue(no,e),ue(to,t),Xl=e|t.baseLanes}function io(){ue(no,Xl),ue(to,to.current)}function ao(){Xl=no.current,le(to),le(no)}var oo=ce(null),so=null;function co(e){var t=e.alternate;ue(mo,mo.current&1),ue(oo,e),so===null&&(t===null||to.current!==null||t.memoizedState!==null)&&(so=e)}function lo(e){ue(mo,mo.current),ue(oo,e),so===null&&(so=e)}function uo(e){e.tag===22?(ue(mo,mo.current),ue(oo,e),so===null&&(so=e)):fo(e)}function fo(){ue(mo,mo.current),ue(oo,oo.current)}function po(e){le(oo),so===e&&(so=null),le(mo)}var mo=ce(0);function ho(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||ff(n)||pf(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder===`forwards`||t.memoizedProps.revealOrder===`backwards`||t.memoizedProps.revealOrder===`unstable_legacy-backwards`||t.memoizedProps.revealOrder===`together`)){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var go=0,L=null,R=null,_o=null,vo=!1,yo=!1,bo=!1,xo=0,So=0,Co=null,wo=0;function To(){throw Error(i(321))}function Eo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Tr(e[n],t[n]))return!1;return!0}function Do(e,t,n,r,i,a){return go=a,L=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,j.H=e===null||e.memoizedState===null?Gs:Ks,bo=!1,a=n(r,i),bo=!1,yo&&(a=ko(t,n,r,i)),Oo(e),a}function Oo(e){j.H=Ws;var t=R!==null&&R.next!==null;if(go=0,_o=R=L=null,vo=!1,So=0,Co=null,t)throw Error(i(300));e===null||lc||(e=e.dependencies,e!==null&&na(e)&&(lc=!0))}function ko(e,t,n,r){L=e;var a=0;do{if(yo&&(Co=null),So=0,yo=!1,25<=a)throw Error(i(301));if(a+=1,_o=R=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}j.H=qs,o=t(n,r)}while(yo);return o}function Ao(){var e=j.H,t=e.useState()[0];return t=typeof t.then==`function`?Lo(t):t,e=e.useState()[0],(R===null?null:R.memoizedState)!==e&&(L.flags|=1024),t}function jo(){var e=xo!==0;return xo=0,e}function Mo(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function No(e){if(vo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}vo=!1}go=0,_o=R=L=null,yo=!1,So=xo=0,Co=null}function Po(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return _o===null?L.memoizedState=_o=e:_o=_o.next=e,_o}function Fo(){if(R===null){var e=L.alternate;e=e===null?null:e.memoizedState}else e=R.next;var t=_o===null?L.memoizedState:_o.next;if(t!==null)_o=t,R=e;else{if(e===null)throw L.alternate===null?Error(i(467)):Error(i(310));R=e,e={memoizedState:R.memoizedState,baseState:R.baseState,baseQueue:R.baseQueue,queue:R.queue,next:null},_o===null?L.memoizedState=_o=e:_o=_o.next=e}return _o}function Io(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Lo(e){var t=So;return So+=1,Co===null&&(Co=[]),e=Aa(Co,e,t),t=L,(_o===null?t.memoizedState:_o.next)===null&&(t=t.alternate,j.H=t===null||t.memoizedState===null?Gs:Ks),e}function Ro(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return Lo(e);if(e.$$typeof===C)return ia(e)}throw Error(i(438,String(e)))}function zo(e){var t=null,n=L.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=L.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=Io(),L.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=k;return t.index++,n}function Bo(e,t){return typeof t==`function`?t(e):t}function Vo(e){return Ho(Fo(),R,e)}function Ho(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(go&f)===f:(H&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===ha&&(d=!0);else if((go&p)===p){u=u.next,p===ha&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,L.lanes|=p,Ql|=p;f=u.action,bo&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,L.lanes|=f,Ql|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Tr(o,e.memoizedState)&&(lc=!0,d&&(n=ga,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function Uo(e){var t=Fo(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);Tr(o,t.memoizedState)||(lc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Wo(e,t,n){var r=L,a=Fo(),o=I;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!Tr((R||a).memoizedState,n);if(s&&(a.memoizedState=n,lc=!0),a=a.queue,gs(qo.bind(null,r,a,e),[e]),a.getSnapshot!==t||s||_o!==null&&_o.memoizedState.tag&1){if(r.flags|=2048,ds(9,{destroy:void 0},Ko.bind(null,r,a,n,t),null),B===null)throw Error(i(349));o||go&127||Go(r,t,n)}return n}function Go(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=L.updateQueue,t===null?(t=Io(),L.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Ko(e,t,n,r){t.value=n,t.getSnapshot=r,Jo(t)&&Yo(e)}function qo(e,t,n){return n(function(){Jo(t)&&Yo(e)})}function Jo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Tr(e,n)}catch{return!0}}function Yo(e){var t=oi(e,2);t!==null&&xu(t,e,2)}function Xo(e){var t=Po();if(typeof e==`function`){var n=e;if(e=n(),bo){He(!0);try{n()}finally{He(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Bo,lastRenderedState:e},t}function Zo(e,t,n,r){return e.baseState=n,Ho(e,R,typeof r==`function`?r:Bo)}function Qo(e,t,n,r,a){if(Vs(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};j.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,$o(t,o)):(o.next=n.next,t.pending=n.next=o)}}function $o(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=j.T,o={};j.T=o;try{var s=n(i,r),c=j.S;c!==null&&c(o,s),es(e,t,s)}catch(n){ns(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),j.T=a}}else try{a=n(i,r),es(e,t,a)}catch(n){ns(e,t,n)}}function es(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){ts(e,t,n)},function(n){return ns(e,t,n)}):ts(e,t,n)}function ts(e,t,n){t.status=`fulfilled`,t.value=n,rs(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,$o(e,n)))}function ns(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,rs(t),t=t.next;while(t!==r)}e.action=null}function rs(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function is(e,t){return t}function as(e,t){if(I){var n=B.formState;if(n!==null){a:{var r=L;if(I){if(Li){b:{for(var i=Li,a=zi;i.nodeType!==8;){if(!a){i=null;break b}if(i=hf(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){Li=hf(i.nextSibling),r=i.data===`F!`;break a}}Vi(r)}r=!1}r&&(t=n[0])}}return n=Po(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:is,lastRenderedState:t},n.queue=r,n=Rs.bind(null,L,r),r.dispatch=n,r=Xo(!1),a=Bs.bind(null,L,!1,r.queue),r=Po(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Qo.bind(null,L,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function ss(e){return cs(Fo(),R,e)}function cs(e,t,n){if(t=Ho(e,t,is)[0],e=Vo(Bo)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=Lo(t)}catch(e){throw e===Ta?Da:e}else r=t;t=Fo();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(L.flags|=2048,ds(9,{destroy:void 0},ls.bind(null,i,n),null)),[r,a,e]}function ls(e,t){e.action=t}function us(e){var t=Fo(),n=R;if(n!==null)return cs(t,n,e);Fo(),t=t.memoizedState,n=Fo();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function ds(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=L.updateQueue,t===null&&(t=Io(),L.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function fs(){return Fo().memoizedState}function ps(e,t,n,r){var i=Po();L.flags|=e,i.memoizedState=ds(1|t,{destroy:void 0},n,r===void 0?null:r)}function ms(e,t,n,r){var i=Fo();r=r===void 0?null:r;var a=i.memoizedState.inst;R!==null&&r!==null&&Eo(r,R.memoizedState.deps)?i.memoizedState=ds(t,a,n,r):(L.flags|=e,i.memoizedState=ds(1|t,a,n,r))}function hs(e,t){ps(8390656,8,e,t)}function gs(e,t){ms(2048,8,e,t)}function _s(e){L.flags|=4;var t=L.updateQueue;if(t===null)t=Io(),L.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function vs(e){var t=Fo().memoizedState;return _s({ref:t,nextImpl:e}),function(){if(z&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function ys(e,t){return ms(4,2,e,t)}function bs(e,t){return ms(4,4,e,t)}function xs(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Ss(e,t,n){n=n==null?null:n.concat([e]),ms(4,4,xs.bind(null,t,e),n)}function Cs(){}function ws(e,t){var n=Fo();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&Eo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Ts(e,t){var n=Fo();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&Eo(t,r[1]))return r[0];if(r=e(),bo){He(!0);try{e()}finally{He(!1)}}return n.memoizedState=[r,t],r}function Es(e,t,n){return n===void 0||go&1073741824&&!(H&261930)?e.memoizedState=t:(e.memoizedState=n,e=bu(),L.lanes|=e,Ql|=e,n)}function Ds(e,t,n,r){return Tr(n,t)?n:to.current===null?!(go&42)||go&1073741824&&!(H&261930)?(lc=!0,e.memoizedState=n):(e=bu(),L.lanes|=e,Ql|=e,t):(e=Es(e,n,r),Tr(e,t)||(lc=!0),e)}function Os(e,t,n,r,i){var a=M.p;M.p=a!==0&&8>a?a:8;var o=j.T,s={};j.T=s,Bs(e,!1,t,n);try{var c=i(),l=j.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?zs(e,t,ya(c,r),yu(e)):zs(e,t,r,yu(e))}catch(n){zs(e,t,{then:function(){},status:`rejected`,reason:n},yu())}finally{M.p=a,o!==null&&s.types!==null&&(o.types=s.types),j.T=o}}function ks(){}function As(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=js(e).queue;Os(e,a,t,ae,n===null?ks:function(){return Ms(e),n(r)})}function js(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ae,baseState:ae,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Bo,lastRenderedState:ae},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Bo,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Ms(e){var t=js(e);t.next===null&&(t=e.alternate.memoizedState),zs(e,t.next.queue,{},yu())}function Ns(){return ia(ap)}function Ps(){return Fo().memoizedState}function Fs(){return Fo().memoizedState}function Is(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=yu();e=Ka(n);var r=qa(t,e,n);r!==null&&(xu(r,t,n),Ja(r,t,n)),t={cache:da()},e.payload=t;return}t=t.return}}function Ls(e,t,n){var r=yu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Vs(e)?Hs(t,n):(n=ai(e,t,n,r),n!==null&&(xu(n,e,r),Us(n,t,r)))}function Rs(e,t,n){zs(e,t,n,yu())}function zs(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Vs(e))Hs(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Tr(s,o))return ii(e,t,i,0),B===null&&ri(),!1}catch{}if(n=ai(e,t,i,r),n!==null)return xu(n,e,r),Us(n,t,r),!0}return!1}function Bs(e,t,n,r){if(r={lane:2,revertLane:vd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Vs(e)){if(t)throw Error(i(479))}else t=ai(e,n,r,2),t!==null&&xu(t,e,2)}function Vs(e){var t=e.alternate;return e===L||t!==null&&t===L}function Hs(e,t){yo=vo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Us(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,at(e,n)}}var Ws={readContext:ia,use:Ro,useCallback:To,useContext:To,useEffect:To,useImperativeHandle:To,useLayoutEffect:To,useInsertionEffect:To,useMemo:To,useReducer:To,useRef:To,useState:To,useDebugValue:To,useDeferredValue:To,useTransition:To,useSyncExternalStore:To,useId:To,useHostTransitionStatus:To,useFormState:To,useActionState:To,useOptimistic:To,useMemoCache:To,useCacheRefresh:To};Ws.useEffectEvent=To;var Gs={readContext:ia,use:Ro,useCallback:function(e,t){return Po().memoizedState=[e,t===void 0?null:t],e},useContext:ia,useEffect:hs,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),ps(4194308,4,xs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ps(4194308,4,e,t)},useInsertionEffect:function(e,t){ps(4,2,e,t)},useMemo:function(e,t){var n=Po();t=t===void 0?null:t;var r=e();if(bo){He(!0);try{e()}finally{He(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Po();if(n!==void 0){var i=n(t);if(bo){He(!0);try{n(t)}finally{He(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=Ls.bind(null,L,e),[r.memoizedState,e]},useRef:function(e){var t=Po();return e={current:e},t.memoizedState=e},useState:function(e){e=Xo(e);var t=e.queue,n=Rs.bind(null,L,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Cs,useDeferredValue:function(e,t){return Es(Po(),e,t)},useTransition:function(){var e=Xo(!1);return e=Os.bind(null,L,e.queue,!0,!1),Po().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=L,a=Po();if(I){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),B===null)throw Error(i(349));H&127||Go(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,hs(qo.bind(null,r,o,e),[e]),r.flags|=2048,ds(9,{destroy:void 0},Ko.bind(null,r,o,n,t),null),n},useId:function(){var e=Po(),t=B.identifierPrefix;if(I){var n=Ai,r=ki;n=(r&~(1<<32-Ue(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=xo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=wo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:Ns,useFormState:as,useActionState:as,useOptimistic:function(e){var t=Po();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Bs.bind(null,L,!0,n),n.dispatch=t,[e,t]},useMemoCache:zo,useCacheRefresh:function(){return Po().memoizedState=Is.bind(null,L)},useEffectEvent:function(e){var t=Po(),n={impl:e};return t.memoizedState=n,function(){if(z&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},Ks={readContext:ia,use:Ro,useCallback:ws,useContext:ia,useEffect:gs,useImperativeHandle:Ss,useInsertionEffect:ys,useLayoutEffect:bs,useMemo:Ts,useReducer:Vo,useRef:fs,useState:function(){return Vo(Bo)},useDebugValue:Cs,useDeferredValue:function(e,t){return Ds(Fo(),R.memoizedState,e,t)},useTransition:function(){var e=Vo(Bo)[0],t=Fo().memoizedState;return[typeof e==`boolean`?e:Lo(e),t]},useSyncExternalStore:Wo,useId:Ps,useHostTransitionStatus:Ns,useFormState:ss,useActionState:ss,useOptimistic:function(e,t){return Zo(Fo(),R,e,t)},useMemoCache:zo,useCacheRefresh:Fs};Ks.useEffectEvent=vs;var qs={readContext:ia,use:Ro,useCallback:ws,useContext:ia,useEffect:gs,useImperativeHandle:Ss,useInsertionEffect:ys,useLayoutEffect:bs,useMemo:Ts,useReducer:Uo,useRef:fs,useState:function(){return Uo(Bo)},useDebugValue:Cs,useDeferredValue:function(e,t){var n=Fo();return R===null?Es(n,e,t):Ds(n,R.memoizedState,e,t)},useTransition:function(){var e=Uo(Bo)[0],t=Fo().memoizedState;return[typeof e==`boolean`?e:Lo(e),t]},useSyncExternalStore:Wo,useId:Ps,useHostTransitionStatus:Ns,useFormState:us,useActionState:us,useOptimistic:function(e,t){var n=Fo();return R===null?(n.baseState=e,[e,n.queue.dispatch]):Zo(n,R,e,t)},useMemoCache:zo,useCacheRefresh:Fs};qs.useEffectEvent=vs;function Js(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:h({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Ys={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=yu(),i=Ka(r);i.payload=t,n!=null&&(i.callback=n),t=qa(e,i,r),t!==null&&(xu(t,e,r),Ja(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=yu(),i=Ka(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=qa(e,i,r),t!==null&&(xu(t,e,r),Ja(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=yu(),r=Ka(n);r.tag=2,t!=null&&(r.callback=t),t=qa(e,r,n),t!==null&&(xu(t,e,n),Ja(t,e,n))}};function Xs(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!Er(n,r)||!Er(i,a):!0}function Zs(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Ys.enqueueReplaceState(t,t.state,null)}function Qs(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=h({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function $s(e){$r(e)}function ec(e){console.error(e)}function tc(e){$r(e)}function nc(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function rc(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function ic(e,t,n){return n=Ka(n),n.tag=3,n.payload={element:null},n.callback=function(){nc(e,t)},n}function ac(e){return e=Ka(e),e.tag=3,e}function oc(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){rc(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){rc(t,n,r),typeof i!=`function`&&(lu===null?lu=new Set([this]):lu.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function sc(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&ta(t,n,a,!0),n=oo.current,n!==null){switch(n.tag){case 31:case 13:return so===null?Nu():n.alternate===null&&Zl===0&&(Zl=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===Oa?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),Qu(e,r,a)),!1;case 22:return n.flags|=65536,r===Oa?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),Qu(e,r,a)),!1}throw Error(i(435,n.tag))}return Qu(e,r,a),Nu(),!1}if(I)return t=oo.current,t===null?(r!==Bi&&(t=Error(i(423),{cause:r}),qi(xi(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=xi(r,n),a=ic(e.stateNode,r,a),Ya(e,a),Zl!==4&&(Zl=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==Bi&&(e=Error(i(422),{cause:r}),qi(xi(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=xi(o,n),nu===null?nu=[o]:nu.push(o),Zl!==4&&(Zl=2),t===null)return!0;r=xi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=ic(n.stateNode,r,e),Ya(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(lu===null||!lu.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=ac(a),oc(a,e,n,r),Ya(n,a),!1}n=n.return}while(n!==null);return!1}var cc=Error(i(461)),lc=!1;function uc(e,t,n,r){t.child=e===null?Ha(t,null,n,r):Va(t,e.child,n,r)}function dc(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return ra(t),r=Do(e,t,n,o,a,i),s=jo(),e!==null&&!lc?(Mo(e,t,i),Fc(e,t,i)):(I&&s&&Ni(t),t.flags|=1,uc(e,t,r,i),t.child)}function fc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!fi(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,pc(e,t,a,r,i)):(e=hi(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!Ic(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Er:n,n(o,r)&&e.ref===t.ref)return Fc(e,t,i)}return t.flags|=1,e=pi(a,r),e.ref=t.ref,e.return=t,t.child=e}function pc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Er(a,r)&&e.ref===t.ref)if(lc=!1,t.pendingProps=r=a,Ic(e,i))e.flags&131072&&(lc=!0);else return t.lanes=e.lanes,Fc(e,t,i)}return xc(e,t,n,r,i)}function mc(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return gc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ca(t,a===null?null:a.cachePool),a===null?io():ro(t,a),uo(t);else return r=t.lanes=536870912,gc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&Ca(t,null),io(),fo(t)):(Ca(t,a.cachePool),ro(t,a),fo(t),t.memoizedState=null);return uc(e,t,i,n),t.child}function hc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function gc(e,t,n,r,i){var a=Sa();return a=a===null?null:{parent:ua._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&Ca(t,null),io(),uo(t),e!==null&&ta(e,t,r,!0),t.childLanes=i,null}function _c(e,t){return t=Ac({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function vc(e,t,n){return Va(t,e.child,null,n),e=_c(t,t.pendingProps),e.flags|=2,po(t),t.memoizedState=null,e}function yc(e,t,n){var r=t.pendingProps,a=(t.flags&128)!=0;if(t.flags&=-129,e===null){if(I){if(r.mode===`hidden`)return e=_c(t,r),t.lanes=536870912,hc(null,e);if(lo(t),(e=Li)?(e=df(e,zi),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Oi===null?null:{id:ki,overflow:Ai},retryLane:536870912,hydrationErrors:null},n=vi(e),n.return=t,t.child=n,Ii=t,Li=null)):e=null,e===null)throw Vi(t);return t.lanes=536870912,null}return _c(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(lo(t),a)if(t.flags&256)t.flags&=-257,t=vc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558));else if(lc||ta(e,t,n,!1),a=(n&e.childLanes)!==0,lc||a){if(r=B,r!==null&&(s=ot(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,oi(e,s),xu(r,e,s),cc;Nu(),t=vc(e,t,n)}else e=o.treeContext,Li=hf(s.nextSibling),Ii=t,I=!0,Ri=null,zi=!1,e!==null&&Fi(t,e),t=_c(t,r),t.flags|=4096;return t}return e=pi(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function bc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function xc(e,t,n,r,i){return ra(t),n=Do(e,t,n,r,void 0,i),r=jo(),e!==null&&!lc?(Mo(e,t,i),Fc(e,t,i)):(I&&r&&Ni(t),t.flags|=1,uc(e,t,n,i),t.child)}function Sc(e,t,n,r,i,a){return ra(t),t.updateQueue=null,n=ko(t,r,n,i),Oo(e),r=jo(),e!==null&&!lc?(Mo(e,t,a),Fc(e,t,a)):(I&&r&&Ni(t),t.flags|=1,uc(e,t,n,a),t.child)}function Cc(e,t,n,r,i){if(ra(t),t.stateNode===null){var a=li,o=n.contextType;typeof o==`object`&&o&&(a=ia(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Ys,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},Wa(t),o=n.contextType,a.context=typeof o==`object`&&o?ia(o):li,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Js(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&Ys.enqueueReplaceState(a,a.state,null),Qa(t,r,a,i),Za(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=Qs(n,s);a.props=c;var l=a.context,u=n.contextType;o=li,typeof u==`object`&&u&&(o=ia(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&Zs(t,a,r,o),Ua=!1;var f=t.memoizedState;a.state=f,Qa(t,r,a,i),Za(),l=t.memoizedState,s||f!==l||Ua?(typeof d==`function`&&(Js(t,n,d,r),l=t.memoizedState),(c=Ua||Xs(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Ga(e,t),o=t.memoizedProps,u=Qs(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=li,typeof l==`object`&&l&&(c=ia(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&Zs(t,a,r,c),Ua=!1,f=t.memoizedState,a.state=f,Qa(t,r,a,i),Za();var p=t.memoizedState;o!==d||f!==p||Ua||e!==null&&e.dependencies!==null&&na(e.dependencies)?(typeof s==`function`&&(Js(t,n,s,r),p=t.memoizedState),(u=Ua||Xs(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&na(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,bc(e,t),r=(t.flags&128)!=0,a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=Va(t,e.child,null,i),t.child=Va(t,null,n,i)):uc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=Fc(e,t,i),e}function wc(e,t,n,r){return Gi(),t.flags|=256,uc(e,t,n,r),t.child}var Tc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Ec(e){return{baseLanes:e,cachePool:wa()}}function Dc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=eu),e}function Oc(e,t,n){var r=t.pendingProps,a=!1,o=(t.flags&128)!=0,s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:(mo.current&2)!=0),s&&(a=!0,t.flags&=-129),s=(t.flags&32)!=0,t.flags&=-33,e===null){if(I){if(a?co(t):fo(t),(e=Li)?(e=df(e,zi),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Oi===null?null:{id:ki,overflow:Ai},retryLane:536870912,hydrationErrors:null},n=vi(e),n.return=t,t.child=n,Ii=t,Li=null)):e=null,e===null)throw Vi(t);return pf(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,a?(fo(t),a=t.mode,c=Ac({mode:`hidden`,children:c},a),r=gi(r,a,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=Ec(n),r.childLanes=Dc(e,s,n),t.memoizedState=Tc,hc(null,r)):(co(t),kc(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?(co(t),t.flags&=-257,t=jc(e,t,n)):t.memoizedState===null?(fo(t),c=r.fallback,a=t.mode,r=Ac({mode:`visible`,children:r.children},a),c=gi(c,a,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,Va(t,e.child,null,n),r=t.child,r.memoizedState=Ec(n),r.childLanes=Dc(e,s,n),t.memoizedState=Tc,t=hc(null,r)):(fo(t),t.child=e.child,t.flags|=128,t=null);else if(co(t),pf(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(i(419)),r.stack=``,r.digest=s,qi({value:r,source:null,stack:null}),t=jc(e,t,n)}else if(lc||ta(e,t,n,!1),s=(n&e.childLanes)!==0,lc||s){if(s=B,s!==null&&(r=ot(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,oi(e,r),xu(s,e,r),cc;ff(c)||Nu(),t=jc(e,t,n)}else ff(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,Li=hf(c.nextSibling),Ii=t,I=!0,Ri=null,zi=!1,e!==null&&Fi(t,e),t=kc(t,r.children),t.flags|=4096);return t}return a?(fo(t),c=r.fallback,a=t.mode,l=e.child,u=l.sibling,r=pi(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=gi(c,a,n,null),c.flags|=2):c=pi(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,hc(null,r),r=t.child,c=e.child.memoizedState,c===null?c=Ec(n):(a=c.cachePool,a===null?a=wa():(l=ua._currentValue,a=a.parent===l?a:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:a}),r.memoizedState=c,r.childLanes=Dc(e,s,n),t.memoizedState=Tc,hc(e.child,r)):(co(t),n=e.child,e=n.sibling,n=pi(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=n,t.memoizedState=null,n)}function kc(e,t){return t=Ac({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function Ac(e,t){return e=di(22,e,null,t),e.lanes=0,e}function jc(e,t,n){return Va(t,e.child,null,n),e=kc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Mc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),$i(e.return,t,n)}function Nc(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function Pc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=mo.current,s=(o&2)!=0;if(s?(o=o&1|2,t.flags|=128):o&=1,ue(mo,o),uc(e,t,r,n),r=I?Ti:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Mc(e,n,t);else if(e.tag===19)Mc(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&ho(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Nc(t,!1,i,n,a,r);break;case`backwards`:case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&ho(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Nc(t,!0,n,null,a,r);break;case`together`:Nc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Fc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Ql|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(ta(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=pi(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=pi(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Ic(e,t){return(e.lanes&t)===0?(e=e.dependencies,!!(e!==null&&na(e))):!0}function Lc(e,t,n){switch(t.tag){case 3:he(t,t.stateNode.containerInfo),Zi(t,ua,e.memoizedState.cache),Gi();break;case 27:case 5:_e(t);break;case 4:he(t,t.stateNode.containerInfo);break;case 10:Zi(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,lo(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(co(t),e=Fc(e,t,n),e===null?null:e.sibling):Oc(e,t,n):(co(t),t.flags|=128,null);co(t);break;case 19:var i=(e.flags&128)!=0;if(r=(n&t.childLanes)!==0,r||=(ta(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return Pc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),ue(mo,mo.current),r)break;return null;case 22:return t.lanes=0,mc(e,t,n,t.pendingProps);case 24:Zi(t,ua,e.memoizedState.cache)}return Fc(e,t,n)}function Rc(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)lc=!0;else{if(!Ic(e,n)&&!(t.flags&128))return lc=!1,Lc(e,t,n);lc=!!(e.flags&131072)}else lc=!1,I&&t.flags&1048576&&Mi(t,Ti,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=ja(t.elementType),t.type=e,typeof e==`function`)fi(e)?(r=Qs(e,r),t.tag=1,t=Cc(null,t,e,r,n)):(t.tag=0,t=xc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===w){t.tag=11,t=dc(null,t,e,r,n);break a}else if(a===ee){t.tag=14,t=fc(null,t,e,r,n);break a}}throw t=re(e)||e,Error(i(306,t,``))}}return t;case 0:return xc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Qs(r,t.pendingProps),Cc(e,t,r,a,n);case 3:a:{if(he(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,Ga(e,t),Qa(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Zi(t,ua,r),r!==o.cache&&ea(t,[ua],n,!0),Za(),r=s.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=wc(e,t,r,n);break a}else if(r!==a){a=xi(Error(i(424)),t),qi(a),t=wc(e,t,r,n);break a}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(Li=hf(e.firstChild),Ii=t,I=!0,Ri=null,zi=!0,n=Ha(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Gi(),r===a){t=Fc(e,t,n);break a}uc(e,t,r,n)}t=t.child}return t;case 26:return bc(e,t),e===null?(n=If(t.type,null,t.pendingProps,null))?t.memoizedState=n:I||(n=t.type,e=t.pendingProps,r=qd(pe.current).createElement(n),r[ft]=t,r[pt]=e,Vd(r,n,e),Tt(r),t.stateNode=r):t.memoizedState=If(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return _e(t),e===null&&I&&(r=t.stateNode=yf(t.type,t.pendingProps,pe.current),Ii=t,zi=!0,a=Li,af(t.type)?(gf=a,Li=hf(r.firstChild)):Li=a),uc(e,t,t.pendingProps.children,n),bc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&I&&((a=r=Li)&&(r=lf(r,t.type,t.pendingProps,zi),r===null?a=!1:(t.stateNode=r,Ii=t,Li=hf(r.firstChild),zi=!1,a=!0)),a||Vi(t)),_e(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,Xd(a,o)?r=null:s!==null&&Xd(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=Do(e,t,Ao,null,null,n),ap._currentValue=a),bc(e,t),uc(e,t,r,n),t.child;case 6:return e===null&&I&&((e=n=Li)&&(n=uf(n,t.pendingProps,zi),n===null?e=!1:(t.stateNode=n,Ii=t,Li=null,e=!0)),e||Vi(t)),null;case 13:return Oc(e,t,n);case 4:return he(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Va(t,null,r,n):uc(e,t,r,n),t.child;case 11:return dc(e,t,t.type,t.pendingProps,n);case 7:return uc(e,t,t.pendingProps,n),t.child;case 8:return uc(e,t,t.pendingProps.children,n),t.child;case 12:return uc(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Zi(t,t.type,r.value),uc(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,ra(t),a=ia(a),r=r(a),t.flags|=1,uc(e,t,r,n),t.child;case 14:return fc(e,t,t.type,t.pendingProps,n);case 15:return pc(e,t,t.type,t.pendingProps,n);case 19:return Pc(e,t,n);case 31:return yc(e,t,n);case 22:return mc(e,t,n,t.pendingProps);case 24:return ra(t),r=ia(ua),e===null?(a=Sa(),a===null&&(a=B,o=da(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},Wa(t),Zi(t,ua,a)):((e.lanes&n)!==0&&(Ga(e,t),Qa(t,null,null,n),Za()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,Zi(t,ua,r),r!==a.cache&&ea(t,[ua],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),Zi(t,ua,r))),uc(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function zc(e){e.flags|=4}function Bc(e,t,n,r,i){if((t=(e.mode&32)!=0)&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i)if(e.stateNode.complete)e.flags|=8192;else if(Au())e.flags|=8192;else throw Ma=Oa,Ea}else e.flags&=-16777217}function Vc(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Zf(t))if(Au())e.flags|=8192;else throw Ma=Oa,Ea}function Hc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:et(),e.lanes|=t,tu|=t)}function Uc(e,t){if(!I)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Wc(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&65011712,r|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Gc(e,t,n){var r=t.pendingProps;switch(Pi(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Wc(t),null;case 1:return Wc(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Qi(ua),ge(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Wi(t)?zc(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Ki())),Wc(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(zc(t),o===null?(Wc(t),Bc(t,a,null,r,n)):(Wc(t),Vc(t,o))):o?o===e.memoizedState?(Wc(t),t.flags&=-16777217):(zc(t),Wc(t),Vc(t,o)):(e=e.memoizedProps,e!==r&&zc(t),Wc(t),Bc(t,a,e,r,n)),null;case 27:if(ve(t),n=pe.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&zc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Wc(t),null}e=de.current,Wi(t)?Hi(t,e):(e=yf(a,r,n),t.stateNode=e,zc(t))}return Wc(t),null;case 5:if(ve(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&zc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Wc(t),null}if(o=de.current,Wi(t))Hi(t,o);else{var s=qd(pe.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[ft]=t,o[pt]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(Vd(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&zc(t)}}return Wc(t),Bc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&zc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=pe.current,Wi(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Ii,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[ft]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Rd(e.nodeValue,n)),e||Vi(t,!0)}else e=qd(e).createTextNode(r),e[ft]=t,t.stateNode=e}return Wc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Wi(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[ft]=t}else Gi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Wc(t),e=!1}else n=Ki(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(po(t),t):(po(t),null);if(t.flags&128)throw Error(i(558))}return Wc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Wi(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[ft]=t}else Gi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Wc(t),a=!1}else a=Ki(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(po(t),t):(po(t),null)}return po(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Hc(t,t.updateQueue),Wc(t),null);case 4:return ge(),e===null&&kd(t.stateNode.containerInfo),Wc(t),null;case 10:return Qi(t.type),Wc(t),null;case 19:if(le(mo),r=t.memoizedState,r===null)return Wc(t),null;if(a=(t.flags&128)!=0,o=r.rendering,o===null)if(a)Uc(r,!1);else{if(Zl!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=ho(e),o!==null){for(t.flags|=128,Uc(r,!1),e=o.updateQueue,t.updateQueue=e,Hc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)mi(n,e),n=n.sibling;return ue(mo,mo.current&1|2),I&&ji(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&je()>su&&(t.flags|=128,a=!0,Uc(r,!1),t.lanes=4194304)}else{if(!a)if(e=ho(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Hc(t,e),Uc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!I)return Wc(t),null}else 2*je()-r.renderingStartTime>su&&n!==536870912&&(t.flags|=128,a=!0,Uc(r,!1),t.lanes=4194304);r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}return r.tail===null?(Wc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=je(),e.sibling=null,n=mo.current,ue(mo,a?n&1|2:n&1),I&&ji(t,r.treeForkCount),e);case 22:case 23:return po(t),ao(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Wc(t),t.subtreeFlags&6&&(t.flags|=8192)):Wc(t),n=t.updateQueue,n!==null&&Hc(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&le(xa),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Qi(ua),Wc(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Kc(e,t){switch(Pi(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Qi(ua),ge(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ve(t),null;case 31:if(t.memoizedState!==null){if(po(t),t.alternate===null)throw Error(i(340));Gi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(po(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Gi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return le(mo),null;case 4:return ge(),null;case 10:return Qi(t.type),null;case 22:case 23:return po(t),ao(),e!==null&&le(xa),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Qi(ua),null;case 25:return null;default:return null}}function qc(e,t){switch(Pi(t),t.tag){case 3:Qi(ua),ge();break;case 26:case 27:case 5:ve(t);break;case 4:ge();break;case 31:t.memoizedState!==null&&po(t);break;case 13:po(t);break;case 19:le(mo);break;case 10:Qi(t.type);break;case 22:case 23:po(t),ao(),e!==null&&le(xa);break;case 24:Qi(ua)}}function Jc(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){Zu(t,t.return,e)}}function Yc(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){Zu(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Zu(t,t.return,e)}}function Xc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{eo(t,n)}catch(t){Zu(e,e.return,t)}}}function Zc(e,t,n){n.props=Qs(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Zu(e,t,n)}}function Qc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Zu(e,t,n)}}function $c(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r==`function`)try{r()}catch(n){Zu(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){Zu(e,t,n)}else n.current=null}function el(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){Zu(e,e.return,t)}}function tl(e,t,n){try{var r=e.stateNode;Hd(r,e.type,n,t),r[pt]=t}catch(t){Zu(e,e.return,t)}}function nl(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&af(e.type)||e.tag===4}function rl(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||nl(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&af(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function il(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=on));else if(r!==4&&(r===27&&af(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(il(e,t,n),e=e.sibling;e!==null;)il(e,t,n),e=e.sibling}function al(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&af(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(al(e,t,n),e=e.sibling;e!==null;)al(e,t,n),e=e.sibling}function ol(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Vd(t,r,n),t[ft]=e,t[pt]=n}catch(t){Zu(e,e.return,t)}}var sl=!1,cl=!1,ll=!1,ul=typeof WeakSet==`function`?WeakSet:Set,dl=null;function fl(e,t){if(e=e.containerInfo,Gd=fp,e=Ar(e),jr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(Kd={focusedElem:e,selectionRange:n},fp=!1,dl=t;dl!==null;)if(t=dl,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,dl=e;else for(;dl!==null;){switch(t=dl,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n<e.length;n++)a=e[n],a.ref.impl=a.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&o!==null){e=void 0,n=t,a=o.memoizedProps,o=o.memoizedState,r=n.stateNode;try{var h=Qs(n.type,a);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){Zu(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)cf(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:cf(e);break;default:e.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(i(163))}if(e=t.sibling,e!==null){e.return=t.return,dl=e;break}dl=t.return}}function pl(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Ol(e,n),r&4&&Jc(5,n);break;case 1:if(Ol(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Zu(n,n.return,e)}else{var i=Qs(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Zu(n,n.return,e)}}r&64&&Xc(n),r&512&&Qc(n,n.return);break;case 3:if(Ol(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{eo(e,t)}catch(e){Zu(n,n.return,e)}}break;case 27:t===null&&r&4&&ol(n);case 26:case 5:Ol(e,n),t===null&&r&4&&el(n),r&512&&Qc(n,n.return);break;case 12:Ol(e,n);break;case 31:Ol(e,n),r&4&&yl(e,n);break;case 13:Ol(e,n),r&4&&bl(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=td.bind(null,n),mf(e,n))));break;case 22:if(r=n.memoizedState!==null||sl,!r){t=t!==null&&t.memoizedState!==null||cl,i=sl;var a=cl;sl=r,(cl=t)&&!a?Al(e,n,(n.subtreeFlags&8772)!=0):Ol(e,n),sl=i,cl=a}break;case 30:break;default:Ol(e,n)}}function ml(e){var t=e.alternate;t!==null&&(e.alternate=null,ml(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&bt(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var hl=null,gl=!1;function _l(e,t,n){for(n=n.child;n!==null;)vl(e,t,n),n=n.sibling}function vl(e,t,n){if(Ve&&typeof Ve.onCommitFiberUnmount==`function`)try{Ve.onCommitFiberUnmount(Be,n)}catch{}switch(n.tag){case 26:cl||$c(n,t),_l(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:cl||$c(n,t);var r=hl,i=gl;af(n.type)&&(hl=n.stateNode,gl=!1),_l(e,t,n),bf(n.stateNode),hl=r,gl=i;break;case 5:cl||$c(n,t);case 6:if(r=hl,i=gl,hl=null,_l(e,t,n),hl=r,gl=i,hl!==null)if(gl)try{(hl.nodeType===9?hl.body:hl.nodeName===`HTML`?hl.ownerDocument.body:hl).removeChild(n.stateNode)}catch(e){Zu(n,t,e)}else try{hl.removeChild(n.stateNode)}catch(e){Zu(n,t,e)}break;case 18:hl!==null&&(gl?(e=hl,of(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Rp(e)):of(hl,n.stateNode));break;case 4:r=hl,i=gl,hl=n.stateNode.containerInfo,gl=!0,_l(e,t,n),hl=r,gl=i;break;case 0:case 11:case 14:case 15:Yc(2,n,t),cl||Yc(4,n,t),_l(e,t,n);break;case 1:cl||($c(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Zc(n,t,r)),_l(e,t,n);break;case 21:_l(e,t,n);break;case 22:cl=(r=cl)||n.memoizedState!==null,_l(e,t,n),cl=r;break;default:_l(e,t,n)}}function yl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Rp(e)}catch(e){Zu(t,t.return,e)}}}function bl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Rp(e)}catch(e){Zu(t,t.return,e)}}function xl(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new ul),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new ul),t;default:throw Error(i(435,e.tag))}}function Sl(e,t){var n=xl(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=nd.bind(null,e,t);t.then(r,r)}})}function Cl(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var a=n[r],o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 27:if(af(c.type)){hl=c.stateNode,gl=!1;break a}break;case 5:hl=c.stateNode,gl=!1;break a;case 3:case 4:hl=c.stateNode.containerInfo,gl=!0;break a}c=c.return}if(hl===null)throw Error(i(160));vl(o,s,a),hl=null,gl=!1,o=a.alternate,o!==null&&(o.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Tl(t,e),t=t.sibling}var wl=null;function Tl(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Cl(t,e),El(e),r&4&&(Yc(3,e,e.return),Jc(3,e),Yc(5,e,e.return));break;case 1:Cl(t,e),El(e),r&512&&(cl||n===null||$c(n,n.return)),r&64&&sl&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var a=wl;if(Cl(t,e),El(e),r&512&&(cl||n===null||$c(n,n.return)),r&4){var o=n===null?null:n.memoizedState;if(r=e.memoizedState,n===null)if(r===null)if(e.stateNode===null){a:{r=e.type,n=e.memoizedProps,a=a.ownerDocument||a;b:switch(r){case`title`:o=a.getElementsByTagName(`title`)[0],(!o||o[yt]||o[ft]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=a.createElement(r),a.head.insertBefore(o,a.querySelector(`head > title`))),Vd(o,r,n),o[ft]=e,Tt(o),r=o;break a;case`link`:var s=Jf(`link`,`href`,a).get(r+(n.href||``));if(s){for(var c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&o.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&o.getAttribute(`title`)===(n.title==null?null:n.title)&&o.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(c,1);break b}}o=a.createElement(r),Vd(o,r,n),a.head.appendChild(o);break;case`meta`:if(s=Jf(`meta`,`content`,a).get(r+(n.content||``))){for(c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`content`)===(n.content==null?null:``+n.content)&&o.getAttribute(`name`)===(n.name==null?null:n.name)&&o.getAttribute(`property`)===(n.property==null?null:n.property)&&o.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&o.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){s.splice(c,1);break b}}o=a.createElement(r),Vd(o,r,n),a.head.appendChild(o);break;default:throw Error(i(468,r))}o[ft]=e,Tt(o),r=o}e.stateNode=r}else Yf(a,e.type,e.stateNode);else e.stateNode=Uf(a,r,e.memoizedProps);else o===r?r===null&&e.stateNode!==null&&tl(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?Yf(a,e.type,e.stateNode):Uf(a,r,e.memoizedProps))}break;case 27:Cl(t,e),El(e),r&512&&(cl||n===null||$c(n,n.return)),n!==null&&r&4&&tl(e,e.memoizedProps,n.memoizedProps);break;case 5:if(Cl(t,e),El(e),r&512&&(cl||n===null||$c(n,n.return)),e.flags&32){a=e.stateNode;try{Zt(a,``)}catch(t){Zu(e,e.return,t)}}r&4&&e.stateNode!=null&&(a=e.memoizedProps,tl(e,a,n===null?a:n.memoizedProps)),r&1024&&(ll=!0);break;case 6:if(Cl(t,e),El(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){Zu(e,e.return,t)}}break;case 3:if(qf=null,a=wl,wl=Cf(t.containerInfo),Cl(t,e),wl=a,El(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Rp(t.containerInfo)}catch(t){Zu(e,e.return,t)}ll&&(ll=!1,Dl(e));break;case 4:r=wl,wl=Cf(e.stateNode.containerInfo),Cl(t,e),El(e),wl=r;break;case 12:Cl(t,e),El(e);break;case 31:Cl(t,e),El(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Sl(e,r)));break;case 13:Cl(t,e),El(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(au=je()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Sl(e,r)));break;case 22:a=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=sl,d=cl;if(sl=u||a,cl=d||l,Cl(t,e),cl=d,sl=u,El(e),r&8192)a:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||l||sl||cl||kl(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(o=l.stateNode,a)s=o.style,typeof s.setProperty==`function`?s.setProperty(`display`,`none`,`important`):s.display=`none`;else{c=l.stateNode;var f=l.memoizedProps.style,p=f!=null&&f.hasOwnProperty(`display`)?f.display:null;c.style.display=p==null||typeof p==`boolean`?``:(``+p).trim()}}catch(e){Zu(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=a?``:l.memoizedProps}catch(e){Zu(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;a?sf(m,!0):sf(l.stateNode,!1)}catch(e){Zu(l,l.return,e)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break a;for(;t.sibling===null;){if(t.return===null||t.return===e)break a;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,Sl(e,n))));break;case 19:Cl(t,e),El(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Sl(e,r)));break;case 30:break;case 21:break;default:Cl(t,e),El(e)}}function El(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(nl(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var a=n.stateNode;al(e,rl(e),a);break;case 5:var o=n.stateNode;n.flags&32&&(Zt(o,``),n.flags&=-33),al(e,rl(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;il(e,rl(e),s);break;default:throw Error(i(161))}}catch(t){Zu(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Dl(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Dl(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Ol(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)pl(e,t.alternate,t),t=t.sibling}function kl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Yc(4,t,t.return),kl(t);break;case 1:$c(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&Zc(t,t.return,n),kl(t);break;case 27:bf(t.stateNode);case 26:case 5:$c(t,t.return),kl(t);break;case 22:t.memoizedState===null&&kl(t);break;case 30:kl(t);break;default:kl(t)}e=e.sibling}}function Al(e,t,n){for(n&&=(t.subtreeFlags&8772)!=0,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:Al(i,a,n),Jc(4,a);break;case 1:if(Al(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){Zu(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var s=r.stateNode;try{var c=i.shared.hiddenCallbacks;if(c!==null)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)$a(c[i],s)}catch(e){Zu(r,r.return,e)}}n&&o&64&&Xc(a),Qc(a,a.return);break;case 27:ol(a);case 26:case 5:Al(i,a,n),n&&r===null&&o&4&&el(a),Qc(a,a.return);break;case 12:Al(i,a,n);break;case 31:Al(i,a,n),n&&o&4&&yl(i,a);break;case 13:Al(i,a,n),n&&o&4&&bl(i,a);break;case 22:a.memoizedState===null&&Al(i,a,n),Qc(a,a.return);break;case 30:break;default:Al(i,a,n)}t=t.sibling}}function jl(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&fa(n))}function Ml(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&fa(e))}function Nl(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Pl(e,t,n,r),t=t.sibling}function Pl(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:Nl(e,t,n,r),i&2048&&Jc(9,t);break;case 1:Nl(e,t,n,r);break;case 3:Nl(e,t,n,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&fa(e)));break;case 12:if(i&2048){Nl(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,s=a.onPostCommit;typeof s==`function`&&s(o,t.alternate===null?`mount`:`update`,e.passiveEffectDuration,-0)}catch(e){Zu(t,t.return,e)}}else Nl(e,t,n,r);break;case 31:Nl(e,t,n,r);break;case 13:Nl(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?Nl(e,t,n,r):(a._visibility|=2,Fl(e,t,n,r,(t.subtreeFlags&10256)!=0||!1)):a._visibility&2?Nl(e,t,n,r):Il(e,t),i&2048&&jl(o,t);break;case 24:Nl(e,t,n,r),i&2048&&Ml(t.alternate,t);break;default:Nl(e,t,n,r)}}function Fl(e,t,n,r,i){for(i&&=(t.subtreeFlags&10256)!=0||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Fl(a,o,s,c,i),Jc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Fl(a,o,s,c,i)):u._visibility&2?Fl(a,o,s,c,i):Il(a,o),i&&l&2048&&jl(o.alternate,o);break;case 24:Fl(a,o,s,c,i),i&&l&2048&&Ml(o.alternate,o);break;default:Fl(a,o,s,c,i)}t=t.sibling}}function Il(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:Il(n,r),i&2048&&jl(r.alternate,r);break;case 24:Il(n,r),i&2048&&Ml(r.alternate,r);break;default:Il(n,r)}t=t.sibling}}var Ll=8192;function Rl(e,t,n){if(e.subtreeFlags&Ll)for(e=e.child;e!==null;)zl(e,t,n),e=e.sibling}function zl(e,t,n){switch(e.tag){case 26:Rl(e,t,n),e.flags&Ll&&e.memoizedState!==null&&Qf(n,wl,e.memoizedState,e.memoizedProps);break;case 5:Rl(e,t,n);break;case 3:case 4:var r=wl;wl=Cf(e.stateNode.containerInfo),Rl(e,t,n),wl=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Ll,Ll=16777216,Rl(e,t,n),Ll=r):Rl(e,t,n));break;default:Rl(e,t,n)}}function Bl(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Vl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];dl=r,Wl(r,e)}Bl(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Hl(e),e=e.sibling}function Hl(e){switch(e.tag){case 0:case 11:case 15:Vl(e),e.flags&2048&&Yc(9,e,e.return);break;case 3:Vl(e);break;case 12:Vl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Ul(e)):Vl(e);break;default:Vl(e)}}function Ul(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];dl=r,Wl(r,e)}Bl(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Yc(8,t,t.return),Ul(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Ul(t));break;default:Ul(t)}e=e.sibling}}function Wl(e,t){for(;dl!==null;){var n=dl;switch(n.tag){case 0:case 11:case 15:Yc(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:fa(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,dl=r;else a:for(n=e;dl!==null;){r=dl;var i=r.sibling,a=r.return;if(ml(r),r===n){dl=null;break a}if(i!==null){i.return=a,dl=i;break a}dl=a}}}var Gl={getCacheForType:function(e){var t=ia(ua),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return ia(ua).controller.signal}},Kl=typeof WeakMap==`function`?WeakMap:Map,z=0,B=null,V=null,H=0,U=0,ql=null,W=!1,Jl=!1,Yl=!1,Xl=0,Zl=0,Ql=0,G=0,$l=0,eu=0,tu=0,nu=null,ru=null,iu=!1,au=0,ou=0,su=1/0,cu=null,lu=null,uu=0,du=null,fu=null,pu=0,mu=0,hu=null,gu=null,_u=0,vu=null;function yu(){return z&2&&H!==0?H&-H:j.T===null?lt():vd()}function bu(){if(eu===0)if(!(H&536870912)||I){var e=Je;Je<<=1,!(Je&3932160)&&(Je=262144),eu=e}else eu=536870912;return e=oo.current,e!==null&&(e.flags|=32),eu}function xu(e,t,n){(e===B&&(U===2||U===9)||e.cancelPendingCommit!==null)&&(Ou(e,0),Tu(e,H,eu,!1)),nt(e,n),(!(z&2)||e!==B)&&(e===B&&(!(z&2)&&(G|=n),Zl===4&&Tu(e,H,eu,!1)),ud(e))}function Su(e,t,n){if(z&6)throw Error(i(327));var r=!n&&(t&127)==0&&(t&e.expiredLanes)===0||Qe(e,t),a=r?Iu(e,t):Pu(e,t,!0),o=r;do{if(a===0){Jl&&!r&&Tu(e,t,0,!1);break}else{if(n=e.current.alternate,o&&!wu(n)){a=Pu(e,t,!1),o=!1;continue}if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=nu;var l=c.current.memoizedState.isDehydrated;if(l&&(Ou(c,s).flags|=256),s=Pu(c,s,!1),s!==2){if(Yl&&!l){c.errorRecoveryDisabledLanes|=o,G|=o,a=4;break a}o=ru,ru=a,o!==null&&(ru===null?ru=o:ru.push.apply(ru,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Ou(e,0),Tu(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t)break;case 6:Tu(r,t,eu,!W);break a;case 2:ru=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=au+300-je(),10<a)){if(Tu(r,t,eu,!W),Ze(r,0,!0)!==0)break a;pu=t,r.timeoutHandle=$d(Cu.bind(null,r,n,ru,cu,iu,t,eu,G,tu,W,o,`Throttled`,-0,0),a);break a}Cu(r,n,ru,cu,iu,t,eu,G,tu,W,o,null,-0,0)}}break}while(1);ud(e)}function Cu(e,t,n,r,i,a,o,s,c,l,u,d,f,p){if(e.timeoutHandle=-1,d=t.subtreeFlags,d&8192||(d&16785408)==16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:on},zl(t,a,d);var m=(a&62914560)===a?au-je():(a&4194048)===a?ou-je():0;if(m=ep(d,m),m!==null){pu=a,e.cancelPendingCommit=m(Uu.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),Tu(e,a,o,!l);return}}Uu(e,t,a,n,r,i,o,s,c)}function wu(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!Tr(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Tu(e,t,n,r){t&=~$l,t&=~G,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Ue(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&it(e,n,t)}function Eu(){return z&6?!0:(dd(0,!1),!1)}function Du(){if(V!==null){if(U===0)var e=V.return;else e=V,Xi=Yi=null,No(e),Fa=null,Ia=0,e=V;for(;e!==null;)qc(e.alternate,e),e=e.return;V=null}}function Ou(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,ef(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),pu=0,Du(),B=e,V=n=pi(e.current,null),H=t,U=0,ql=null,W=!1,Jl=Qe(e,t),Yl=!1,tu=eu=$l=G=Ql=Zl=0,ru=nu=null,iu=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-Ue(r),a=1<<i;t|=e[i],r&=~a}return Xl=t,ri(),n}function ku(e,t){L=null,j.H=Ws,t===Ta||t===Da?(t=Na(),U=3):t===Ea?(t=Na(),U=4):U=t===cc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,ql=t,V===null&&(Zl=1,nc(e,xi(t,e.current)))}function Au(){var e=oo.current;return e===null?!0:(H&4194048)===H?so===null:(H&62914560)===H||H&536870912?e===so:!1}function ju(){var e=j.H;return j.H=Ws,e===null?Ws:e}function Mu(){var e=j.A;return j.A=Gl,e}function Nu(){Zl=4,W||(H&4194048)!==H&&oo.current!==null||(Jl=!0),!(Ql&134217727)&&!(G&134217727)||B===null||Tu(B,H,eu,!1)}function Pu(e,t,n){var r=z;z|=2;var i=ju(),a=Mu();(B!==e||H!==t)&&(cu=null,Ou(e,t)),t=!1;var o=Zl;a:do try{if(U!==0&&V!==null){var s=V,c=ql;switch(U){case 8:Du(),o=6;break a;case 3:case 2:case 9:case 6:oo.current===null&&(t=!0);var l=U;if(U=0,ql=null,Bu(e,s,c,l),n&&Jl){o=0;break a}break;default:l=U,U=0,ql=null,Bu(e,s,c,l)}}Fu(),o=Zl;break}catch(t){ku(e,t)}while(1);return t&&e.shellSuspendCounter++,Xi=Yi=null,z=r,j.H=i,j.A=a,V===null&&(B=null,H=0,ri()),o}function Fu(){for(;V!==null;)Ru(V)}function Iu(e,t){var n=z;z|=2;var r=ju(),a=Mu();B!==e||H!==t?(cu=null,su=je()+500,Ou(e,t)):Jl=Qe(e,t);a:do try{if(U!==0&&V!==null){t=V;var o=ql;b:switch(U){case 1:U=0,ql=null,Bu(e,t,o,1);break;case 2:case 9:if(ka(o)){U=0,ql=null,zu(t);break}t=function(){U!==2&&U!==9||B!==e||(U=7),ud(e)},o.then(t,t);break a;case 3:U=7;break a;case 4:U=5;break a;case 7:ka(o)?(U=0,ql=null,zu(t)):(U=0,ql=null,Bu(e,t,o,7));break;case 5:var s=null;switch(V.tag){case 26:s=V.memoizedState;case 5:case 27:var c=V;if(s?Zf(s):c.stateNode.complete){U=0,ql=null;var l=c.sibling;if(l!==null)V=l;else{var u=c.return;u===null?V=null:(V=u,Vu(u))}break b}}U=0,ql=null,Bu(e,t,o,5);break;case 6:U=0,ql=null,Bu(e,t,o,6);break;case 8:Du(),Zl=6;break a;default:throw Error(i(462))}}Lu();break}catch(t){ku(e,t)}while(1);return Xi=Yi=null,j.H=r,j.A=a,z=n,V===null?(B=null,H=0,ri(),Zl):0}function Lu(){for(;V!==null&&!ke();)Ru(V)}function Ru(e){var t=Rc(e.alternate,e,Xl);e.memoizedProps=e.pendingProps,t===null?Vu(e):V=t}function zu(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Sc(n,t,t.pendingProps,t.type,void 0,H);break;case 11:t=Sc(n,t,t.pendingProps,t.type.render,t.ref,H);break;case 5:No(t);default:qc(n,t),t=V=mi(t,Xl),t=Rc(n,t,Xl)}e.memoizedProps=e.pendingProps,t===null?Vu(e):V=t}function Bu(e,t,n,r){Xi=Yi=null,No(t),Fa=null,Ia=0;var i=t.return;try{if(sc(e,i,t,n,H)){Zl=1,nc(e,xi(n,e.current)),V=null;return}}catch(t){if(i!==null)throw V=i,t;Zl=1,nc(e,xi(n,e.current)),V=null;return}t.flags&32768?(I||r===1?e=!0:Jl||H&536870912?e=!1:(W=e=!0,(r===2||r===9||r===3||r===6)&&(r=oo.current,r!==null&&r.tag===13&&(r.flags|=16384))),Hu(t,e)):Vu(t)}function Vu(e){var t=e;do{if(t.flags&32768){Hu(t,W);return}e=t.return;var n=Gc(t.alternate,t,Xl);if(n!==null){V=n;return}if(t=t.sibling,t!==null){V=t;return}V=t=e}while(t!==null);Zl===0&&(Zl=5)}function Hu(e,t){do{var n=Kc(e.alternate,e);if(n!==null){n.flags&=32767,V=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){V=e;return}V=e=n}while(e!==null);Zl=6,V=null}function Uu(e,t,n,r,a,o,s,c,l){e.cancelPendingCommit=null;do Ju();while(uu!==0);if(z&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(o=t.lanes|t.childLanes,o|=ni,rt(e,n,o,s,c,l),e===B&&(V=B=null,H=0),fu=t,du=e,pu=n,mu=o,hu=a,gu=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,rd(Fe,function(){return Yu(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!=0,t.subtreeFlags&13878||r){r=j.T,j.T=null,a=M.p,M.p=2,s=z,z|=4;try{fl(e,t,n)}finally{z=s,M.p=a,j.T=r}}uu=1,Wu(),Gu(),Ku()}}function Wu(){if(uu===1){uu=0;var e=du,t=fu,n=(t.flags&13878)!=0;if(t.subtreeFlags&13878||n){n=j.T,j.T=null;var r=M.p;M.p=2;var i=z;z|=4;try{Tl(t,e);var a=Kd,o=Ar(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&kr(s.ownerDocument.documentElement,s)){if(c!==null&&jr(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=Or(s,h),v=Or(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}fp=!!Gd,Kd=Gd=null}finally{z=i,M.p=r,j.T=n}}e.current=t,uu=2}}function Gu(){if(uu===2){uu=0;var e=du,t=fu,n=(t.flags&8772)!=0;if(t.subtreeFlags&8772||n){n=j.T,j.T=null;var r=M.p;M.p=2;var i=z;z|=4;try{pl(e,t.alternate,t)}finally{z=i,M.p=r,j.T=n}}uu=3}}function Ku(){if(uu===4||uu===3){uu=0,Ae();var e=du,t=fu,n=pu,r=gu;t.subtreeFlags&10256||t.flags&10256?uu=5:(uu=0,fu=du=null,qu(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(lu=null),ct(n),t=t.stateNode,Ve&&typeof Ve.onCommitFiberRoot==`function`)try{Ve.onCommitFiberRoot(Be,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=j.T,i=M.p,M.p=2,j.T=null;try{for(var a=e.onRecoverableError,o=0;o<r.length;o++){var s=r[o];a(s.value,{componentStack:s.stack})}}finally{j.T=t,M.p=i}}pu&3&&Ju(),ud(e),i=e.pendingLanes,n&261930&&i&42?e===vu?_u++:(_u=0,vu=e):_u=0,dd(0,!1)}}function qu(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,fa(t)))}function Ju(){return Wu(),Gu(),Ku(),Yu()}function Yu(){if(uu!==5)return!1;var e=du,t=mu;mu=0;var n=ct(pu),r=j.T,a=M.p;try{M.p=32>n?32:n,j.T=null,n=hu,hu=null;var o=du,s=pu;if(uu=0,fu=du=null,pu=0,z&6)throw Error(i(331));var c=z;if(z|=4,Hl(o.current),Pl(o,o.current,s,n),z=c,dd(0,!1),Ve&&typeof Ve.onPostCommitFiberRoot==`function`)try{Ve.onPostCommitFiberRoot(Be,o)}catch{}return!0}finally{M.p=a,j.T=r,qu(e,t)}}function Xu(e,t,n){t=xi(n,t),t=ic(e.stateNode,t,2),e=qa(e,t,2),e!==null&&(nt(e,2),ud(e))}function Zu(e,t,n){if(e.tag===3)Xu(e,e,n);else for(;t!==null;){if(t.tag===3){Xu(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(lu===null||!lu.has(r))){e=xi(n,e),n=ac(2),r=qa(t,n,2),r!==null&&(oc(n,r,t,e),nt(r,2),ud(r));break}}t=t.return}}function Qu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Kl;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(Yl=!0,i.add(n),e=$u.bind(null,e,t,n),t.then(e,e))}function $u(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,B===e&&(H&n)===n&&(Zl===4||Zl===3&&(H&62914560)===H&&300>je()-au?!(z&2)&&Ou(e,0):$l|=n,tu===H&&(tu=0)),ud(e)}function ed(e,t){t===0&&(t=et()),e=oi(e,t),e!==null&&(nt(e,t),ud(e))}function td(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),ed(e,n)}function nd(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),ed(e,n)}function rd(e,t){return De(e,t)}var id=null,ad=null,od=!1,sd=!1,cd=!1,ld=0;function ud(e){e!==ad&&e.next===null&&(ad===null?id=ad=e:ad=ad.next=e),sd=!0,od||(od=!0,_d())}function dd(e,t){if(!cd&&sd){cd=!0;do for(var n=!1,r=id;r!==null;){if(!t)if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-Ue(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,gd(r,a))}else a=H,a=Ze(r,r===B?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||Qe(r,a)||(n=!0,gd(r,a));r=r.next}while(n);cd=!1}}function fd(){pd()}function pd(){sd=od=!1;var e=0;ld!==0&&Qd()&&(e=ld);for(var t=je(),n=null,r=id;r!==null;){var i=r.next,a=md(r,t);a===0?(r.next=null,n===null?id=i:n.next=i,i===null&&(ad=n)):(n=r,(e!==0||a&3)&&(sd=!0)),r=i}uu!==0&&uu!==5||dd(e,!1),ld!==0&&(ld=0)}function md(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Ue(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=$e(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=B,n=H,n=Ze(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(U===2||U===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Oe(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||Qe(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Oe(r),ct(n)){case 2:case 8:n=Pe;break;case 32:n=Fe;break;case 268435456:n=Le;break;default:n=Fe}return r=hd.bind(null,e),n=De(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Oe(r),e.callbackPriority=2,e.callbackNode=null,2}function hd(e,t){if(uu!==0&&uu!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Ju()&&e.callbackNode!==n)return null;var r=H;return r=Ze(e,e===B?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Su(e,r,t),md(e,je()),e.callbackNode!=null&&e.callbackNode===n?hd.bind(null,e):null)}function gd(e,t){if(Ju())return null;Su(e,t,!0)}function _d(){nf(function(){z&6?De(Ne,fd):pd()})}function vd(){if(ld===0){var e=ha;e===0&&(e=qe,qe<<=1,!(qe&261888)&&(qe=256)),ld=e}return ld}function yd(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:an(``+e)}function bd(e,t){var n=t.ownerDocument.createElement(`input`);return n.name=t.name,n.value=t.value,e.id&&n.setAttribute(`form`,e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function xd(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=yd((i[pt]||null).action),o=r.submitter;o&&(t=(t=o[pt]||null)?yd(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new Dn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(ld!==0){var e=o?bd(i,o):new FormData(i);As(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?bd(i,o):new FormData(i),As(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var Sd=0;Sd<Zr.length;Sd++){var Cd=Zr[Sd];Qr(Cd.toLowerCase(),`on`+(Cd[0].toUpperCase()+Cd.slice(1)))}Qr(Ur,`onAnimationEnd`),Qr(Wr,`onAnimationIteration`),Qr(Gr,`onAnimationStart`),Qr(`dblclick`,`onDoubleClick`),Qr(`focusin`,`onFocus`),Qr(`focusout`,`onBlur`),Qr(Kr,`onTransitionRun`),Qr(qr,`onTransitionStart`),Qr(Jr,`onTransitionCancel`),Qr(Yr,`onTransitionEnd`),kt(`onMouseEnter`,[`mouseout`,`mouseover`]),kt(`onMouseLeave`,[`mouseout`,`mouseover`]),kt(`onPointerEnter`,[`pointerout`,`pointerover`]),kt(`onPointerLeave`,[`pointerout`,`pointerover`]),Ot(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Ot(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Ot(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Ot(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Ot(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Ot(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var wd=`abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting`.split(` `),Td=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(wd));function Ed(e,t){t=(t&4)!=0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){$r(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){$r(e)}i.currentTarget=null,a=c}}}}function K(e,t){var n=t[ht];n===void 0&&(n=t[ht]=new Set);var r=e+`__bubble`;n.has(r)||(Ad(t,e,2,!1),n.add(r))}function Dd(e,t,n){var r=0;t&&(r|=4),Ad(n,e,r,t)}var Od=`_reactListening`+Math.random().toString(36).slice(2);function kd(e){if(!e[Od]){e[Od]=!0,Et.forEach(function(t){t!==`selectionchange`&&(Td.has(t)||Dd(t,!1,e),Dd(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Od]||(t[Od]=!0,Dd(`selectionchange`,!1,t))}}function Ad(e,t,n,r){switch(yp(t)){case 2:var i=pp;break;case 8:i=mp;break;default:i=hp}n=i.bind(null,t,n,e),i=void 0,!gn||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function jd(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var c=r.stateNode.containerInfo;if(c===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===i)return;s=s.return}for(;c!==null;){if(s=xt(c),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){r=a=s;continue a}c=c.parentNode}}r=r.return}pn(function(){var r=a,i=cn(n),s=[];a:{var c=Xr.get(e);if(c!==void 0){var l=Dn,u=e;switch(e){case`keypress`:if(Sn(n)===0)break a;case`keydown`:case`keyup`:l=Hn;break;case`focusin`:u=`focus`,l=Nn;break;case`focusout`:u=`blur`,l=Nn;break;case`beforeblur`:case`afterblur`:l=Nn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=Mn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=F;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=Wn;break;case Ur:case Wr:case Gr:l=Pn;break;case Yr:l=Gn;break;case`scroll`:case`scrollend`:l=N;break;case`wheel`:l=Kn;break;case`copy`:case`cut`:case`paste`:l=Fn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=Un;break;case`toggle`:case`beforetoggle`:l=qn}var d=(t&4)!=0,f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=mn(m,p),g!=null&&d.push(Md(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),s.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(c=e===`mouseover`||e===`pointerover`,l=e===`mouseout`||e===`pointerout`,c&&n!==sn&&(u=n.relatedTarget||n.fromElement)&&(xt(u)||u[mt]))break a;if((l||c)&&(c=i.window===i?i:(c=i.ownerDocument)?c.defaultView||c.parentWindow:window,l?(u=n.relatedTarget||n.toElement,l=r,u=u?xt(u):null,u!==null&&(f=o(u),d=u.tag,u!==f||d!==5&&d!==27&&d!==6)&&(u=null)):(l=null,u=r),l!==u)){if(d=Mn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=Un,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?c:Ct(l),h=u==null?c:Ct(u),c=new d(g,m+`leave`,l,n,i),c.target=f,c.relatedTarget=h,g=null,xt(i)===r&&(d=new d(p,m+`enter`,u,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,l&&u)b:{for(d=Pd,p=l,m=u,h=0,g=p;g;g=d(g))h++;g=0;for(var _=m;_;_=d(_))g++;for(;0<h-g;)p=d(p),h--;for(;0<g-h;)m=d(m),g--;for(;h--;){if(p===m||m!==null&&p===m.alternate){d=p;break b}p=d(p),m=d(m)}d=null}else d=null;l!==null&&Fd(s,c,l,d,!1),u!==null&&f!==null&&Fd(s,f,u,d,!0)}}a:{if(c=r?Ct(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var v=pr;else if(sr(c))if(mr)v=Cr;else{v=xr;var y=br}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&tn(r.elementType)&&(v=pr):v=Sr;if(v&&=v(e,r)){cr(s,v,n,i);break a}y&&y(e,c,r),e===`focusout`&&r&&c.type===`number`&&r.memoizedProps.value!=null&&qt(c,`number`,c.value)}switch(y=r?Ct(r):window,e){case`focusin`:(sr(y)||y.contentEditable===`true`)&&(Nr=y,Pr=r,Fr=null);break;case`focusout`:Fr=Pr=Nr=null;break;case`mousedown`:Ir=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Ir=!1,Lr(s,n,i);break;case`selectionchange`:if(Mr)break;case`keydown`:case`keyup`:Lr(s,n,i)}var b;if(Yn)b:{switch(e){case`compositionstart`:var x=`onCompositionStart`;break b;case`compositionend`:x=`onCompositionEnd`;break b;case`compositionupdate`:x=`onCompositionUpdate`;break b}x=void 0}else rr?tr(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(Qn&&n.locale!==`ko`&&(rr||x!==`onCompositionStart`?x===`onCompositionEnd`&&rr&&(b=xn()):(vn=i,yn=`value`in vn?vn.value:vn.textContent,rr=!0)),y=Nd(r,x),0<y.length&&(x=new In(x,e,null,n,i),s.push({event:x,listeners:y}),b?x.data=b:(b=nr(n),b!==null&&(x.data=b)))),(b=Zn?ir(e,n):ar(e,n))&&(x=Nd(r,`onBeforeInput`),0<x.length&&(y=new In(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:y,listeners:x}),y.data=b)),xd(s,e,r,n,i)}Ed(s,t)})}function Md(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Nd(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=mn(e,n),i!=null&&r.unshift(Md(e,i,a)),i=mn(e,t),i!=null&&r.push(Md(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Pd(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Fd(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=mn(n,a),l!=null&&o.unshift(Md(n,l,c))):i||(l=mn(n,a),l!=null&&o.push(Md(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var q=/\r\n?/g,Id=/\u0000|\uFFFD/g;function Ld(e){return(typeof e==`string`?e:``+e).replace(q,`
|
|
28
|
+
`).replace(Id,``)}function Rd(e,t){return t=Ld(t),Ld(e)===t}function zd(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||Zt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Zt(e,``+r);break;case`className`:Ft(e,`class`,r);break;case`tabIndex`:Ft(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Ft(e,n,r);break;case`style`:en(e,r,o);break;case`data`:if(t!==`object`){Ft(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=an(``+r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}else typeof o==`function`&&(n===`formAction`?(t!==`input`&&zd(e,t,`name`,a.name,a,null),zd(e,t,`formEncType`,a.formEncType,a,null),zd(e,t,`formMethod`,a.formMethod,a,null),zd(e,t,`formTarget`,a.formTarget,a,null)):(zd(e,t,`encType`,a.encType,a,null),zd(e,t,`method`,a.method,a,null),zd(e,t,`target`,a.target,a,null)));if(r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=an(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=on);break;case`onScroll`:r!=null&&K(`scroll`,e);break;case`onScrollEnd`:r!=null&&K(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=an(``+r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``+r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:K(`beforetoggle`,e),K(`toggle`,e),Pt(e,`popover`,r);break;case`xlinkActuate`:It(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:It(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:It(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:It(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:It(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:It(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:It(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:It(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:It(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Pt(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)&&(n=nn.get(n)||n,Pt(e,n,r))}}function Bd(e,t,n,r,a,o){switch(n){case`style`:en(e,r,o);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?Zt(e,r):(typeof r==`number`||typeof r==`bigint`)&&Zt(e,``+r);break;case`onScroll`:r!=null&&K(`scroll`,e);break;case`onScrollEnd`:r!=null&&K(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=on);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!Dt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),t=n.slice(2,a?n.length-7:void 0),o=e[pt]||null,o=o==null?null:o[n],typeof o==`function`&&e.removeEventListener(t,o,a),typeof r==`function`)){typeof o!=`function`&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,a);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):Pt(e,n,r)}}}function Vd(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:K(`error`,e),K(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:zd(e,t,o,s,n,null)}}a&&zd(e,t,`srcSet`,n.srcSet,n,null),r&&zd(e,t,`src`,n.src,n,null);return;case`input`:K(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:zd(e,t,r,d,n,null)}}Kt(e,o,c,l,u,s,a,!1);return;case`select`:for(a in K(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:zd(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&Jt(e,!!r,n,!0):Jt(e,!!r,t,!1);return;case`textarea`:for(s in K(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:zd(e,t,s,c,n,null)}Xt(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:zd(e,t,l,r,n,null)}return;case`dialog`:K(`beforetoggle`,e),K(`toggle`,e),K(`cancel`,e),K(`close`,e);break;case`iframe`:case`object`:K(`load`,e);break;case`video`:case`audio`:for(r=0;r<wd.length;r++)K(wd[r],e);break;case`image`:K(`error`,e),K(`load`,e);break;case`details`:K(`toggle`,e);break;case`embed`:case`source`:case`link`:K(`error`,e),K(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:zd(e,t,u,r,n,null)}return;default:if(tn(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Bd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&zd(e,t,c,r,n,null))}function Hd(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||zd(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:o=m;break;case`name`:a=m;break;case`checked`:u=m;break;case`defaultChecked`:d=m;break;case`value`:s=m;break;case`defaultValue`:c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&zd(e,t,p,m,r,f)}}Gt(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||zd(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:p=o;break;case`defaultValue`:c=o;break;case`multiple`:s=o;default:o!==l&&zd(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Jt(e,!!n,n?[]:``,!1):Jt(e,!!n,t,!0)):Jt(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:zd(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:p=a;break;case`defaultValue`:m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&zd(e,t,s,a,r,o)}Yt(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:zd(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:zd(e,t,l,p,r,m)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&zd(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:zd(e,t,u,p,r,m)}return;default:if(tn(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Bd(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||Bd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&zd(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||zd(e,t,f,p,r,m)}function Ud(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Wd(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&Ud(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&Ud(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var Gd=null,Kd=null;function qd(e){return e.nodeType===9?e:e.ownerDocument}function Jd(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function Yd(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function Xd(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Zd=null;function Qd(){var e=window.event;return e&&e.type===`popstate`?e===Zd?!1:(Zd=e,!0):(Zd=null,!1)}var $d=typeof setTimeout==`function`?setTimeout:void 0,ef=typeof clearTimeout==`function`?clearTimeout:void 0,tf=typeof Promise==`function`?Promise:void 0,nf=typeof queueMicrotask==`function`?queueMicrotask:tf===void 0?$d:function(e){return tf.resolve(null).then(e).catch(rf)};function rf(e){setTimeout(function(){throw e})}function af(e){return e===`head`}function of(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Rp(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)bf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,bf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[yt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&bf(e.ownerDocument.body);n=i}while(n);Rp(t)}function sf(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8)if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++;n=r}while(n)}function cf(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:cf(n),bt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function lf(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r)if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e;else if(!e[yt])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=hf(e.nextSibling),e===null)break}return null}function uf(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=hf(e.nextSibling),e===null))return null;return e}function df(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=hf(e.nextSibling),e===null))return null;return e}function ff(e){return e.data===`$?`||e.data===`$~`}function pf(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function mf(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function hf(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var gf=null;function _f(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return hf(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function vf(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function yf(e,t,n){switch(t=qd(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function bf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);bt(e)}var xf=new Map,Sf=new Set;function Cf(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var wf=M.d;M.d={f:Tf,r:Ef,D:kf,C:Af,L:jf,m:Mf,X:Pf,S:Nf,M:Ff};function Tf(){var e=wf.f(),t=Eu();return e||t}function Ef(e){var t=St(e);t!==null&&t.tag===5&&t.type===`form`?Ms(t):wf.r(e)}var Df=typeof document>`u`?null:document;function Of(e,t,n){var r=Df;if(r&&typeof t==`string`&&t){var i=Wt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),Sf.has(i)||(Sf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Vd(t,`link`,e),Tt(t),r.head.appendChild(t)))}}function kf(e){wf.D(e),Of(`dns-prefetch`,e,null)}function Af(e,t){wf.C(e,t),Of(`preconnect`,e,t)}function jf(e,t,n){wf.L(e,t,n);var r=Df;if(r&&e&&t){var i=`link[rel="preload"][as="`+Wt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Wt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Wt(n.imageSizes)+`"]`)):i+=`[href="`+Wt(e)+`"]`;var a=i;switch(t){case`style`:a=Lf(e);break;case`script`:a=Vf(e)}xf.has(a)||(e=h({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),xf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Rf(a))||t===`script`&&r.querySelector(Hf(a))||(t=r.createElement(`link`),Vd(t,`link`,e),Tt(t),r.head.appendChild(t)))}}function Mf(e,t){wf.m(e,t);var n=Df;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Wt(r)+`"][href="`+Wt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Vf(e)}if(!xf.has(a)&&(e=h({rel:`modulepreload`,href:e},t),xf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Hf(a)))return}r=n.createElement(`link`),Vd(r,`link`,e),Tt(r),n.head.appendChild(r)}}}function Nf(e,t,n){wf.S(e,t,n);var r=Df;if(r&&e){var i=wt(r).hoistableStyles,a=Lf(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Rf(a)))s.loading=5;else{e=h({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=xf.get(a))&&Gf(e,n);var c=o=r.createElement(`link`);Tt(c),Vd(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Wf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Pf(e,t){wf.X(e,t);var n=Df;if(n&&e){var r=wt(n).hoistableScripts,i=Vf(e),a=r.get(i);a||(a=n.querySelector(Hf(i)),a||(e=h({src:e,async:!0},t),(t=xf.get(i))&&Kf(e,t),a=n.createElement(`script`),Tt(a),Vd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Ff(e,t){wf.M(e,t);var n=Df;if(n&&e){var r=wt(n).hoistableScripts,i=Vf(e),a=r.get(i);a||(a=n.querySelector(Hf(i)),a||(e=h({src:e,async:!0,type:`module`},t),(t=xf.get(i))&&Kf(e,t),a=n.createElement(`script`),Tt(a),Vd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function If(e,t,n,r){var a=(a=pe.current)?Cf(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Lf(n.href),n=wt(a).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Lf(n.href);var o=wt(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Rf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),xf.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},xf.set(e,n),o||Bf(a,e,n,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Vf(n),n=wt(a).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Lf(e){return`href="`+Wt(e)+`"`}function Rf(e){return`link[rel="stylesheet"][`+e+`]`}function zf(e){return h({},e,{"data-precedence":e.precedence,precedence:null})}function Bf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Vd(t,`link`,n),Tt(t),e.head.appendChild(t))}function Vf(e){return`[src="`+Wt(e)+`"]`}function Hf(e){return`script[async]`+e}function Uf(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Wt(n.href)+`"]`);if(r)return t.instance=r,Tt(r),r;var a=h({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),Tt(r),Vd(r,`style`,a),Wf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Lf(n.href);var o=e.querySelector(Rf(a));if(o)return t.state.loading|=4,t.instance=o,Tt(o),o;r=zf(n),(a=xf.get(a))&&Gf(r,a),o=(e.ownerDocument||e).createElement(`link`),Tt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Vd(o,`link`,r),t.state.loading|=4,Wf(o,n.precedence,e),t.instance=o;case`script`:return o=Vf(n.src),(a=e.querySelector(Hf(o)))?(t.instance=a,Tt(a),a):(r=n,(a=xf.get(o))&&(r=h({},n),Kf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),Tt(a),Vd(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Wf(r,n.precedence,e));return t.instance}function Wf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Gf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Kf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var qf=null;function Jf(e,t,n){if(qf===null){var r=new Map,i=qf=new Map;i.set(n,r)}else i=qf,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[yt]||a[ft]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function Yf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Xf(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Zf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Qf(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Lf(r.href),a=t.querySelector(Rf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=tp.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Tt(a);return}a=t.ownerDocument||t,r=zf(r),(i=xf.get(i))&&Gf(r,i),a=a.createElement(`link`),Tt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Vd(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=tp.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var $f=0;function ep(e,t){return e.stylesheets&&e.count===0&&rp(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&rp(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&$f===0&&($f=62500*Wd());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&rp(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>$f?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function tp(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)rp(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var np=null;function rp(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,np=new Map,t.forEach(ip,e),np=null,tp.call(e))}function ip(e,t){if(!(t.state.loading&4)){var n=np.get(e);if(n)var r=n.get(null);else{n=new Map,np.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=tp.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var ap={$$typeof:C,Provider:null,Consumer:null,_currentValue:ae,_currentValue2:ae,_threadCount:0};function J(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=tt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=tt(0),this.hiddenUpdates=tt(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function op(e,t,n,r,i,a,o,s,c,l,u,d){return e=new J(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=di(3,null,null,t),e.current=a,a.stateNode=e,t=da(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Wa(a),e}function sp(e){return e?(e=li,e):li}function Y(e,t,n,r,i,a){i=sp(i),r.context===null?r.context=i:r.pendingContext=i,r=Ka(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=qa(e,r,t),n!==null&&(xu(n,e,t),Ja(n,e,t))}function cp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function lp(e,t){cp(e,t),(e=e.alternate)&&cp(e,t)}function up(e){if(e.tag===13||e.tag===31){var t=oi(e,67108864);t!==null&&xu(t,e,67108864),lp(e,67108864)}}function dp(e){if(e.tag===13||e.tag===31){var t=yu();t=st(t);var n=oi(e,t);n!==null&&xu(n,e,t),lp(e,t)}}var fp=!0;function pp(e,t,n,r){var i=j.T;j.T=null;var a=M.p;try{M.p=2,hp(e,t,n,r)}finally{M.p=a,j.T=i}}function mp(e,t,n,r){var i=j.T;j.T=null;var a=M.p;try{M.p=8,hp(e,t,n,r)}finally{M.p=a,j.T=i}}function hp(e,t,n,r){if(fp){var i=gp(r);if(i===null)jd(e,t,r,_p,n),Op(e,r);else if(Ap(i,e,t,n,r))r.stopPropagation();else if(Op(e,r),t&4&&-1<Dp.indexOf(e)){for(;i!==null;){var a=St(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=Xe(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Ue(o);s.entanglements[1]|=c,o&=~c}ud(a),!(z&6)&&(su=je()+500,dd(0,!1))}}break;case 31:case 13:s=oi(a,2),s!==null&&xu(s,a,2),Eu(),lp(a,2)}if(a=gp(r),a===null&&jd(e,t,r,_p,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else jd(e,t,r,null,n)}}function gp(e){return e=cn(e),vp(e)}var _p=null;function vp(e){if(_p=null,e=xt(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return _p=e,null}function yp(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`resize`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(Me()){case Ne:return 2;case Pe:return 8;case Fe:case Ie:return 32;case Le:return 268435456;default:return 32}default:return 32}}var bp=!1,xp=null,Sp=null,Cp=null,wp=new Map,Tp=new Map,Ep=[],Dp=`mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset`.split(` `);function Op(e,t){switch(e){case`focusin`:case`focusout`:xp=null;break;case`dragenter`:case`dragleave`:Sp=null;break;case`mouseover`:case`mouseout`:Cp=null;break;case`pointerover`:case`pointerout`:wp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Tp.delete(t.pointerId)}}function kp(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=St(t),t!==null&&up(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Ap(e,t,n,r,i){switch(t){case`focusin`:return xp=kp(xp,e,t,n,r,i),!0;case`dragenter`:return Sp=kp(Sp,e,t,n,r,i),!0;case`mouseover`:return Cp=kp(Cp,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return wp.set(a,kp(wp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Tp.set(a,kp(Tp.get(a)||null,e,t,n,r,i)),!0}return!1}function jp(e){var t=xt(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,ut(e.priority,function(){dp(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,ut(e.priority,function(){dp(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Mp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=gp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);sn=r,n.target.dispatchEvent(r),sn=null}else return t=St(n),t!==null&&up(t),e.blockedOn=n,!1;t.shift()}return!0}function Np(e,t,n){Mp(e)&&n.delete(t)}function Pp(){bp=!1,xp!==null&&Mp(xp)&&(xp=null),Sp!==null&&Mp(Sp)&&(Sp=null),Cp!==null&&Mp(Cp)&&(Cp=null),wp.forEach(Np),Tp.forEach(Np)}function Fp(e,n){e.blockedOn===n&&(e.blockedOn=null,bp||(bp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Pp)))}var Ip=null;function Lp(e){Ip!==e&&(Ip=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Ip===e&&(Ip=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(vp(r||n)===null)continue;break}var a=St(n);a!==null&&(e.splice(t,3),t-=3,As(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Rp(e){function t(t){return Fp(t,e)}xp!==null&&Fp(xp,e),Sp!==null&&Fp(Sp,e),Cp!==null&&Fp(Cp,e),wp.forEach(t),Tp.forEach(t);for(var n=0;n<Ep.length;n++){var r=Ep[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Ep.length&&(n=Ep[0],n.blockedOn===null);)jp(n),n.blockedOn===null&&Ep.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[pt]||null;if(typeof a==`function`)o||Lp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[pt]||null)s=o.formAction;else if(vp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Lp(n)}}}function zp(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Bp(e){this._internalRoot=e}Vp.prototype.render=Bp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;Y(n,yu(),e,t,null,null)},Vp.prototype.unmount=Bp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Y(e.current,2,null,e,null,null),Eu(),t[mt]=null}};function Vp(e){this._internalRoot=e}Vp.prototype.unstable_scheduleHydration=function(e){if(e){var t=lt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ep.length&&t!==0&&t<Ep[n].priority;n++);Ep.splice(n,0,e),n===0&&jp(e)}};var Hp=n.version;if(Hp!==`19.2.7`)throw Error(i(527,Hp,`19.2.7`));M.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=d(t),e=e===null?null:p(e),e=e===null?null:e.stateNode,e};var Up={bundleType:0,version:`19.2.7`,rendererPackageName:`react-dom`,currentDispatcherRef:j,reconcilerVersion:`19.2.7`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Wp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Wp.isDisabled&&Wp.supportsFiber)try{Be=Wp.inject(Up),Ve=Wp}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=$s,s=ec,c=tc;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=op(e,1,!1,null,null,n,r,null,o,s,c,zp),e[mt]=t.current,kd(e),new Bp(t)}})),g=o(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=h()})),_=o((e=>{var t=u();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function d(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?d:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),v=o(((e,t)=>{t.exports=_()})),y=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),b=o(((e,t)=>{t.exports=y()}));function x(e){this.content=e}x.prototype={constructor:x,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return t==-1?void 0:this.content[t+1]},update:function(e,t,n){var r=n&&n!=e?this.remove(n):this,i=r.find(e),a=r.content.slice();return i==-1?a.push(n||e,t):(a[i+1]=t,n&&(a[i]=n)),new x(a)},remove:function(e){var t=this.find(e);if(t==-1)return this;var n=this.content.slice();return n.splice(t,2),new x(n)},addToStart:function(e,t){return new x([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new x(n)},addBefore:function(e,t,n){var r=this.remove(t),i=r.content.slice(),a=r.find(e);return i.splice(a==-1?i.length:a,0,t,n),new x(i)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return e=x.from(e),e.size?new x(e.content.concat(this.subtract(e).content)):this},append:function(e){return e=x.from(e),e.size?new x(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=x.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},toObject:function(){var e={};return this.forEach(function(t,n){e[t]=n}),e},get size(){return this.content.length>>1}},x.from=function(e){if(e instanceof x)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new x(t)};function S(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let i=e.child(r),a=t.child(r);if(i==a){n+=i.nodeSize;continue}if(!i.sameMarkup(a))return n;if(i.isText&&i.text!=a.text){let e=i.text,t=a.text,r=0;for(;e[r]==t[r];r++)n++;return r&&r<e.length&&r<t.length&&T(e.charCodeAt(r-1))&&w(e.charCodeAt(r))&&n--,n}if(i.content.size||a.content.size){let e=S(i.content,a.content,n+1);if(e!=null)return e}n+=i.nodeSize}}function C(e,t,n,r){for(let i=e.childCount,a=t.childCount;;){if(i==0||a==0)return i==a?null:{a:n,b:r};let o=e.child(--i),s=t.child(--a),c=o.nodeSize;if(o==s){n-=c,r-=c;continue}if(!o.sameMarkup(s))return{a:n,b:r};if(o.isText&&o.text!=s.text){let e=o.text,t=s.text,i=e.length,a=t.length;for(;i>0&&a>0&&e[i-1]==t[a-1];)i--,a--,n--,r--;return i&&a&&i<e.length&&T(e.charCodeAt(i-1))&&w(e.charCodeAt(i))&&(n++,r++),{a:n,b:r}}if(o.content.size||s.content.size){let e=C(o.content,s.content,n-1,r-1);if(e)return e}n-=c,r-=c}}function w(e){return e>=56320&&e<57344}function T(e){return e>=55296&&e<56320}var E=class e{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let t=0;t<e.length;t++)this.size+=e[t].nodeSize}nodesBetween(e,t,n,r=0,i){for(let a=0,o=0;o<t;a++){let s=this.content[a],c=o+s.nodeSize;if(c>e&&n(s,r+o,i||null,a)!==!1&&s.content.size){let i=o+1;s.nodesBetween(Math.max(0,e-i),Math.min(s.content.size,t-i),n,r+i)}o=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,r){let i=``,a=!0;return this.nodesBetween(e,t,(o,s)=>{let c=o.isText?o.text.slice(Math.max(e,s)-s,t-s):o.isLeaf?r?typeof r==`function`?r(o):r:o.type.spec.leafText?o.type.spec.leafText(o):``:``;o.isBlock&&(o.isLeaf&&c||o.isTextblock)&&n&&(a?a=!1:i+=n),i+=c},0),i}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,r=t.firstChild,i=this.content.slice(),a=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),a=1);a<t.content.length;a++)i.push(t.content[a]);return new e(i,this.size+t.size)}cut(t,n=this.size){if(t==0&&n==this.size)return this;let r=[],i=0;if(n>t)for(let e=0,a=0;a<n;e++){let o=this.content[e],s=a+o.nodeSize;s>t&&((a<t||s>n)&&(o=o.isText?o.cut(Math.max(0,t-a),Math.min(o.text.length,n-a)):o.cut(Math.max(0,t-a-1),Math.min(o.content.size,n-a-1))),r.push(o),i+=o.nodeSize),a=s}return new e(r,i)}cutByIndex(t,n){return t==n?e.empty:t==0&&n==this.content.length?this:new e(this.content.slice(t,n))}replaceChild(t,n){let r=this.content[t];if(r==n)return this;let i=this.content.slice(),a=this.size+n.nodeSize-r.nodeSize;return i[t]=n,new e(i,a)}addToStart(t){return new e([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new e(this.content.concat(t),this.size+t.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw RangeError(`Index `+e+` out of range for `+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,n=0;t<this.content.length;t++){let r=this.content[t];e(r,n,t),n+=r.nodeSize}}findDiffStart(e,t=0){return S(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return C(this,e,t,n)}findIndex(e){if(e==0)return D(0,e);if(e==this.size)return D(this.content.length,e);if(e>this.size||e<0)throw RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,n=0;;t++){let r=this.child(t),i=n+r.nodeSize;if(i>=e)return i==e?D(t+1,i):D(t,n);n=i}}toString(){return`<`+this.toStringInner()+`>`}toStringInner(){return this.content.join(`, `)}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(t,n){if(!n)return e.empty;if(!Array.isArray(n))throw RangeError(`Invalid input for Fragment.fromJSON`);return e.fromArray(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return e.empty;let n,r=0;for(let e=0;e<t.length;e++){let i=t[e];r+=i.nodeSize,e&&i.isText&&t[e-1].sameMarkup(i)?(n||=t.slice(0,e),n[n.length-1]=i.withText(n[n.length-1].text+i.text)):n&&n.push(i)}return new e(n||t,r)}static from(t){if(!t)return e.empty;if(t instanceof e)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new e([t],t.nodeSize);throw RangeError(`Can not convert `+t+` to a Fragment`+(t.nodesBetween?` (looks like multiple versions of prosemirror-model were loaded)`:``))}};E.empty=new E([],0);var ee={index:0,offset:0};function D(e,t){return ee.index=e,ee.offset=t,ee}function O(e,t){if(e===t)return!0;if(!(e&&typeof e==`object`)||!(t&&typeof t==`object`))return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!O(e[n],t[n]))return!1}else{for(let n in e)if(!(n in t)||!O(e[n],t[n]))return!1;for(let n in t)if(!(n in e))return!1}return!0}var k=class e{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(this.eq(i))return e;if(this.type.excludes(i.type))t||=e.slice(0,r);else if(i.type.excludes(this.type))return e;else!n&&i.type.rank>this.type.rank&&(t||=e.slice(0,r),t.push(this),n=!0),t&&t.push(i)}return t||=e.slice(),n||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&O(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw RangeError(`Invalid input for Mark.fromJSON`);let n=e.marks[t.type];if(!n)throw RangeError(`There is no mark type ${t.type} in this schema`);let r=n.create(t.attrs);return n.checkAttrs(r.attrs),r}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&t.length==0)return e.none;if(t instanceof e)return[t];let n=t.slice();return n.sort((e,t)=>e.type.rank-t.type.rank),n}};k.none=[];var te=class extends Error{},A=class e{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let r=re(this.content,t+this.openStart,n,this.openStart+1,this.openEnd+1);return r&&new e(r,this.openStart,this.openEnd)}removeBetween(t,n){return new e(ne(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+`(`+this.openStart+`,`+this.openEnd+`)`}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(t,n){if(!n)return e.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!=`number`||typeof i!=`number`)throw RangeError(`Invalid input for Slice.fromJSON`);return new e(E.fromJSON(t,n.content),r,i)}static maxOpen(t,n=!0){let r=0,i=0;for(let e=t.firstChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.firstChild)r++;for(let e=t.lastChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.lastChild)i++;return new e(t,r,i)}};A.empty=new A(E.empty,0,0);function ne(e,t,n){let{index:r,offset:i}=e.findIndex(t),a=e.maybeChild(r),{index:o,offset:s}=e.findIndex(n);if(i==t||a.isText){if(s!=n&&!e.child(o).isText)throw RangeError(`Removing non-flat range`);return e.cut(0,t).append(e.cut(n))}if(r!=o)throw RangeError(`Removing non-flat range`);return e.replaceChild(r,a.copy(ne(a.content,t-i-1,n-i-1)))}function re(e,t,n,r,i,a){let{index:o,offset:s}=e.findIndex(t),c=e.maybeChild(o);if(s==t||c.isText)return a&&r<=0&&i<=0&&!a.canReplace(o,o,n)?null:e.cut(0,t).append(n).append(e.cut(t));let l=re(c.content,t-s-1,n,o==0?r-1:0,o==e.childCount-1?i-1:0,c);return l&&e.replaceChild(o,c.copy(l))}function ie(e,t,n){if(n.openStart>e.depth)throw new te(`Inserted content deeper than insertion position`);if(e.depth-n.openStart!=t.depth-n.openEnd)throw new te(`Inconsistent open depths`);return j(e,t,n,0)}function j(e,t,n,r){let i=e.index(r),a=e.node(r);if(i==t.index(r)&&r<e.depth-n.openStart){let o=j(e,t,n,r+1);return a.copy(a.content.replaceChild(i,o))}else if(!n.content.size)return ce(a,ue(e,t,r));else if(!n.openStart&&!n.openEnd&&e.depth==r&&t.depth==r){let r=e.parent,i=r.content;return ce(r,i.cut(0,e.parentOffset).append(n.content).append(i.cut(t.parentOffset)))}else{let{start:i,end:o}=de(n,e);return ce(a,le(e,i,o,t,r))}}function M(e,t){if(!t.type.compatibleContent(e.type))throw new te(`Cannot join `+t.type.name+` onto `+e.type.name)}function ae(e,t,n){let r=e.node(n);return M(r,t.node(n)),r}function oe(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function se(e,t,n,r){let i=(t||e).node(n),a=0,o=t?t.index(n):i.childCount;e&&(a=e.index(n),e.depth>n?a++:e.textOffset&&(oe(e.nodeAfter,r),a++));for(let e=a;e<o;e++)oe(i.child(e),r);t&&t.depth==n&&t.textOffset&&oe(t.nodeBefore,r)}function ce(e,t){if(!e.type.validContent(t))throw new te(`Invalid content for node `+e.type.name);return e.copy(t)}function le(e,t,n,r,i){let a=e.depth>i&&ae(e,t,i+1),o=r.depth>i&&ae(n,r,i+1),s=[];return se(null,e,i,s),a&&o&&t.index(i)==n.index(i)?(M(a,o),oe(ce(a,le(e,t,n,r,i+1)),s)):(a&&oe(ce(a,ue(e,t,i+1)),s),se(t,n,i,s),o&&oe(ce(o,ue(n,r,i+1)),s)),se(r,null,i,s),new E(s)}function ue(e,t,n){let r=[];return se(null,e,n,r),e.depth>n&&oe(ce(ae(e,t,n+1),ue(e,t,n+1)),r),se(t,null,n,r),new E(r)}function de(e,t){let n=t.depth-e.openStart,r=t.node(n).copy(e.content);for(let e=n-1;e>=0;e--)r=t.node(e).copy(E.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}var fe=class e{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw RangeError(`There is no position before the top-level node`);return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw RangeError(`There is no position after the top-level node`);return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=e.child(t);return n?e.child(t).cut(n):r}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[t*3],r=t==0?0:this.path[t*3-1]+1;for(let t=0;t<e;t++)r+=n.child(t).nodeSize;return r}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return k.none;if(this.textOffset)return e.child(t).marks;let n=e.maybeChild(t-1),r=e.maybeChild(t);if(!n){let e=n;n=r,r=e}let i=n.marks;for(var a=0;a<i.length;a++)i[a].type.spec.inclusive===!1&&(!r||!i[a].isInSet(r.marks))&&(i=i[a--].removeFromSet(i));return i}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let n=t.marks,r=e.parent.maybeChild(e.index());for(var i=0;i<n.length;i++)n[i].type.spec.inclusive===!1&&(!r||!n[i].isInSet(r.marks))&&(n=n[i--].removeFromSet(n));return n}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new ge(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e=``;for(let t=1;t<=this.depth;t++)e+=(e?`/`:``)+this.node(t).type.name+`_`+this.index(t-1);return e+`:`+this.parentOffset}static resolve(t,n){if(!(n>=0&&n<=t.content.size))throw RangeError(`Position `+n+` out of range`);let r=[],i=0,a=n;for(let e=t;;){let{index:t,offset:n}=e.content.findIndex(a),o=a-n;if(r.push(e,t,i+n),!o||(e=e.child(t),e.isText))break;a=o-1,i+=n+1}return new e(n,r,a)}static resolveCached(t,n){let r=he.get(t);if(r)for(let e=0;e<r.elts.length;e++){let t=r.elts[e];if(t.pos==n)return t}else he.set(t,r=new pe);let i=r.elts[r.i]=e.resolve(t,n);return r.i=(r.i+1)%me,i}},pe=class{constructor(){this.elts=[],this.i=0}},me=12,he=new WeakMap,ge=class{constructor(e,t,n){this.$from=e,this.$to=t,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}},_e=Object.create(null),ve=class e{constructor(e,t,n,r=k.none){this.type=e,this.attrs=t,this.marks=r,this.content=n||E.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,n,r=0){this.content.nodesBetween(e,t,n,r,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,``)}textBetween(e,t,n,r){return this.content.textBetween(e,t,n,r)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,n){return this.type==e&&O(this.attrs,t||e.defaultAttrs||_e)&&k.sameSet(this.marks,n||k.none)}copy(t=null){return t==this.content?this:new e(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.content,t)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,n=!1){if(e==t)return A.empty;let r=this.resolve(e),i=this.resolve(t),a=n?0:r.sharedDepth(t),o=r.start(a);return new A(r.node(a).content.cut(r.pos-o,i.pos-o),r.depth-a,i.depth-a)}replace(e,t,n){return ie(this.resolve(e),this.resolve(t),n)}nodeAt(e){for(let t=this;;){let{index:n,offset:r}=t.content.findIndex(e);if(t=t.maybeChild(n),!t)return null;if(r==e||t.isText)return t;e-=r+1}}childAfter(e){let{index:t,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:n}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(t),index:t,offset:n};let r=this.content.child(t-1);return{node:r,index:t-1,offset:n-r.nodeSize}}resolve(e){return fe.resolveCached(this,e)}resolveNoCache(e){return fe.resolve(this,e)}rangeHasMark(e,t,n){let r=!1;return t>e&&this.nodesBetween(e,t,e=>(n.isInSet(e.marks)&&(r=!0),!r)),r}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+=`(`+this.content.toStringInner()+`)`),be(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw Error(`Called contentMatchAt on a node with invalid content`);return t}canReplace(e,t,n=E.empty,r=0,i=n.childCount){let a=this.contentMatchAt(e).matchFragment(n,r,i),o=a&&a.matchFragment(this.content,t);if(!o||!o.validEnd)return!1;for(let e=r;e<i;e++)if(!this.type.allowsMarks(n.child(e).marks))return!1;return!0}canReplaceWith(e,t,n,r){if(r&&!this.type.allowsMarks(r))return!1;let i=this.contentMatchAt(e).matchType(n),a=i&&i.matchFragment(this.content,t);return a?a.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=k.none;for(let t=0;t<this.marks.length;t++){let n=this.marks[t];n.type.checkAttrs(n.attrs),e=n.addToSet(e)}if(!k.sameSet(e,this.marks))throw RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(e=>e.type.name)}`);this.content.forEach(e=>e.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(e=>e.toJSON())),e}static fromJSON(e,t){if(!t)throw RangeError(`Invalid input for Node.fromJSON`);let n;if(t.marks){if(!Array.isArray(t.marks))throw RangeError(`Invalid mark data for Node.fromJSON`);n=t.marks.map(e.markFromJSON)}if(t.type==`text`){if(typeof t.text!=`string`)throw RangeError(`Invalid text node in JSON`);return e.text(t.text,n)}let r=E.fromJSON(e,t.content),i=e.nodeType(t.type).create(t.attrs,r,n);return i.type.checkAttrs(i.attrs),i}};ve.prototype.text=void 0;var ye=class e extends ve{constructor(e,t,n,r){if(super(e,t,null,r),!n)throw RangeError(`Empty text nodes are not allowed`);this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):be(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new e(this.type,this.attrs,t,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}};function be(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+`(`+t+`)`;return t}var xe=class e{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new Se(t,n);if(r.next==null)return e.empty;let i=Ce(r);r.next&&r.err(`Unexpected trailing text`);let a=Ne(Ae(i));return Pe(a,r),a}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,n=e.childCount){let r=this;for(let i=t;r&&i<n;i++)r=r.matchType(e.child(i).type);return r}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1}fillBefore(e,t=!1,n=0){let r=[this];function i(a,o){let s=a.matchFragment(e,n);if(s&&(!t||s.validEnd))return E.from(o.map(e=>e.createAndFill()));for(let e=0;e<a.next.length;e++){let{type:t,next:n}=a.next[e];if(!(t.isText||t.hasRequiredAttrs())&&r.indexOf(n)==-1){r.push(n);let e=i(n,o.concat(t));if(e)return e}}return null}return i(this,[])}findWrapping(e){for(let t=0;t<this.wrapCache.length;t+=2)if(this.wrapCache[t]==e)return this.wrapCache[t+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let r=n.shift(),i=r.match;if(i.matchType(e)){let e=[];for(let t=r;t.type;t=t.via)e.push(t.type);return e.reverse()}for(let e=0;e<i.next.length;e++){let{type:a,next:o}=i.next[e];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in t)&&(!r.type||o.validEnd)&&(n.push({match:a.contentMatch,type:a,via:r}),t[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(n){e.push(n);for(let r=0;r<n.next.length;r++)e.indexOf(n.next[r].next)==-1&&t(n.next[r].next)}return t(this),e.map((t,n)=>{let r=n+(t.validEnd?`*`:` `)+` `;for(let n=0;n<t.next.length;n++)r+=(n?`, `:``)+t.next[n].type.name+`->`+e.indexOf(t.next[n].next);return r}).join(`
|
|
29
|
+
`)}};xe.empty=new xe(!0);var Se=class{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==``&&this.tokens.pop(),this.tokens[0]==``&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw SyntaxError(e+` (in content expression '`+this.string+`')`)}};function Ce(e){let t=[];do t.push(we(e));while(e.eat(`|`));return t.length==1?t[0]:{type:`choice`,exprs:t}}function we(e){let t=[];do t.push(Te(e));while(e.next&&e.next!=`)`&&e.next!=`|`);return t.length==1?t[0]:{type:`seq`,exprs:t}}function Te(e){let t=ke(e);for(;;)if(e.eat(`+`))t={type:`plus`,expr:t};else if(e.eat(`*`))t={type:`star`,expr:t};else if(e.eat(`?`))t={type:`opt`,expr:t};else if(e.eat(`{`))t=De(e,t);else break;return t}function Ee(e){/\D/.test(e.next)&&e.err(`Expected number, got '`+e.next+`'`);let t=Number(e.next);return e.pos++,t}function De(e,t){let n=Ee(e),r=n;return e.eat(`,`)&&(r=e.next==`}`?-1:Ee(e)),e.eat(`}`)||e.err(`Unclosed braced range`),{type:`range`,min:n,max:r,expr:t}}function Oe(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let i=[];for(let e in n){let r=n[e];r.isInGroup(t)&&i.push(r)}return i.length==0&&e.err(`No node type or group '`+t+`' found`),i}function ke(e){if(e.eat(`(`)){let t=Ce(e);return e.eat(`)`)||e.err(`Missing closing paren`),t}else if(/\W/.test(e.next))e.err(`Unexpected token '`+e.next+`'`);else{let t=Oe(e,e.next).map(t=>(e.inline==null?e.inline=t.isInline:e.inline!=t.isInline&&e.err(`Mixing inline and block content`),{type:`name`,value:t}));return e.pos++,t.length==1?t[0]:{type:`choice`,exprs:t}}}function Ae(e){let t=[[]];return i(a(e,0),n()),t;function n(){return t.push([])-1}function r(e,n,r){let i={term:r,to:n};return t[e].push(i),i}function i(e,t){e.forEach(e=>e.to=t)}function a(e,t){if(e.type==`choice`)return e.exprs.reduce((e,n)=>e.concat(a(n,t)),[]);if(e.type==`seq`)for(let r=0;;r++){let o=a(e.exprs[r],t);if(r==e.exprs.length-1)return o;i(o,t=n())}else if(e.type==`star`){let o=n();return r(t,o),i(a(e.expr,o),o),[r(o)]}else if(e.type==`plus`){let o=n();return i(a(e.expr,t),o),i(a(e.expr,o),o),[r(o)]}else if(e.type==`opt`)return[r(t)].concat(a(e.expr,t));else if(e.type==`range`){let o=t;for(let t=0;t<e.min;t++){let t=n();i(a(e.expr,o),t),o=t}if(e.max==-1)i(a(e.expr,o),o);else for(let t=e.min;t<e.max;t++){let t=n();r(o,t),i(a(e.expr,o),t),o=t}return[r(o)]}else if(e.type==`name`)return[r(t,void 0,e.value)];else throw Error(`Unknown expr type`)}}function je(e,t){return t-e}function Me(e,t){let n=[];return r(t),n.sort(je);function r(t){let i=e[t];if(i.length==1&&!i[0].term)return r(i[0].to);n.push(t);for(let e=0;e<i.length;e++){let{term:t,to:a}=i[e];!t&&n.indexOf(a)==-1&&r(a)}}}function Ne(e){let t=Object.create(null);return n(Me(e,0));function n(r){let i=[];r.forEach(t=>{e[t].forEach(({term:t,to:n})=>{if(!t)return;let r;for(let e=0;e<i.length;e++)i[e][0]==t&&(r=i[e][1]);Me(e,n).forEach(e=>{r||i.push([t,r=[]]),r.indexOf(e)==-1&&r.push(e)})})});let a=t[r.join(`,`)]=new xe(r.indexOf(e.length-1)>-1);for(let e=0;e<i.length;e++){let r=i[e][1].sort(je);a.next.push({type:i[e][0],next:t[r.join(`,`)]||n(r)})}return a}}function Pe(e,t){for(let n=0,r=[e];n<r.length;n++){let e=r[n],i=!e.validEnd,a=[];for(let t=0;t<e.next.length;t++){let{type:n,next:o}=e.next[t];a.push(n.name),i&&!(n.isText||n.hasRequiredAttrs())&&(i=!1),r.indexOf(o)==-1&&r.push(o)}i&&t.err(`Only non-generatable nodes (`+a.join(`, `)+`) in a required position (see https://prosemirror.net/docs/guide/#generatable)`)}}function Fe(e){let t=Object.create(null);for(let n in e){let r=e[n];if(!r.hasDefault)return null;t[n]=r.default}return t}function Ie(e,t){let n=Object.create(null);for(let r in e){let i=t&&t[r];if(i===void 0){let t=e[r];if(t.hasDefault)i=t.default;else throw RangeError(`No value supplied for attribute `+r)}n[r]=i}return n}function Le(e,t,n,r){for(let i in t)if(!(i in e))throw RangeError(`Unsupported attribute ${i} for ${n} of type ${r}`);for(let n in e)e[n].validate&&e[n].validate(t[n])}function Re(e,t){let n=Object.create(null);if(t)for(let r in t)n[r]=new Ve(e,r,t[r]);return n}var ze=class e{constructor(e,t,n){this.name=e,this.schema=t,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(` `):[],this.attrs=Re(e,n.attrs),this.defaultAttrs=Fe(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||e==`text`),this.isText=e==`text`}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==xe.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?`pre`:`normal`)}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:Ie(this.attrs,e)}create(e=null,t,n){if(this.isText)throw Error(`NodeType.create can't construct text nodes`);return new ve(this,this.computeAttrs(e),E.from(t),k.setFrom(n))}createChecked(e=null,t,n){return t=E.from(t),this.checkContent(t),new ve(this,this.computeAttrs(e),t,k.setFrom(n))}createAndFill(e=null,t,n){if(e=this.computeAttrs(e),t=E.from(t),t.size){let e=this.contentMatch.fillBefore(t);if(!e)return null;t=e.append(t)}let r=this.contentMatch.matchFragment(t),i=r&&r.fillBefore(E.empty,!0);return i?new ve(this,e,t.append(i),k.setFrom(n)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let t=0;t<e.childCount;t++)if(!this.allowsMarks(e.child(t).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){Le(this.attrs,e,`node`,this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let t;for(let n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?t&&t.push(e[n]):t||=e.slice(0,n);return t?t.length?t:k.none:e}static compile(t,n){let r=Object.create(null);t.forEach((t,i)=>r[t]=new e(t,n,i));let i=n.spec.topNode||`doc`;if(!r[i])throw RangeError(`Schema is missing its top node type ('`+i+`')`);if(!r.text)throw RangeError(`Every schema needs a 'text' type`);for(let e in r.text.attrs)throw RangeError(`The text node type should not have attributes`);return r}};function Be(e,t,n){let r=n.split(`|`);return n=>{let i=n===null?`null`:typeof n;if(r.indexOf(i)<0)throw RangeError(`Expected value of type ${r} for attribute ${t} on type ${e}, got ${i}`)}}var Ve=class{constructor(e,t,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,`default`),this.default=n.default,this.validate=typeof n.validate==`string`?Be(e,t,n.validate):n.validate}get isRequired(){return!this.hasDefault}},He=class e{constructor(e,t,n,r){this.name=e,this.rank=t,this.schema=n,this.spec=r,this.attrs=Re(e,r.attrs),this.excluded=null;let i=Fe(this.attrs);this.instance=i?new k(this,i):null}create(e=null){return!e&&this.instance?this.instance:new k(this,Ie(this.attrs,e))}static compile(t,n){let r=Object.create(null),i=0;return t.forEach((t,a)=>r[t]=new e(t,i++,n,a)),r}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}checkAttrs(e){Le(this.attrs,e,`mark`,this.name)}excludes(e){return this.excluded.indexOf(e)>-1}},Ue=class{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let n in e)t[n]=e[n];t.nodes=x.from(e.nodes),t.marks=x.from(e.marks||{}),this.nodes=ze.compile(this.spec.nodes,this),this.marks=He.compile(this.spec.marks,this);let n=Object.create(null);for(let e in this.nodes){if(e in this.marks)throw RangeError(e+` can not be both a node and a mark`);let t=this.nodes[e],r=t.spec.content||``,i=t.spec.marks;if(t.contentMatch=n[r]||(n[r]=xe.parse(r,this.nodes)),t.inlineContent=t.contentMatch.inlineContent,t.spec.linebreakReplacement){if(this.linebreakReplacement)throw RangeError(`Multiple linebreak nodes defined`);if(!t.isInline||!t.isLeaf)throw RangeError(`Linebreak replacement nodes must be inline leaf nodes`);this.linebreakReplacement=t}t.markSet=i==`_`?null:i?We(this,i.split(` `)):i==``||!t.inlineContent?[]:null}for(let e in this.marks){let t=this.marks[e],n=t.spec.excludes;t.excluded=n==null?[t]:n==``?[]:We(this,n.split(` `))}this.nodeFromJSON=e=>ve.fromJSON(this,e),this.markFromJSON=e=>k.fromJSON(this,e),this.topNodeType=this.nodes[this.spec.topNode||`doc`],this.cached.wrappings=Object.create(null)}node(e,t=null,n,r){if(typeof e==`string`)e=this.nodeType(e);else if(!(e instanceof ze))throw RangeError(`Invalid node type: `+e);else if(e.schema!=this)throw RangeError(`Node type from different schema used (`+e.name+`)`);return e.createChecked(t,n,r)}text(e,t){let n=this.nodes.text;return new ye(n,n.defaultAttrs,e,k.setFrom(t))}mark(e,t){return typeof e==`string`&&(e=this.marks[e]),e.create(t)}nodeType(e){let t=this.nodes[e];if(!t)throw RangeError(`Unknown node type: `+e);return t}};function We(e,t){let n=[];for(let r=0;r<t.length;r++){let i=t[r],a=e.marks[i],o=a;if(a)n.push(a);else for(let t in e.marks){let r=e.marks[t];(i==`_`||r.spec.group&&r.spec.group.split(` `).indexOf(i)>-1)&&n.push(o=r)}if(!o)throw SyntaxError(`Unknown mark type: '`+t[r]+`'`)}return n}function Ge(e){return e.tag!=null}function Ke(e){return e.style!=null}var qe=class e{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let n=this.matchedStyles=[];t.forEach(e=>{if(Ge(e))this.tags.push(e);else if(Ke(e)){let t=/[^=]*/.exec(e.style)[0];n.indexOf(t)<0&&n.push(t),this.styles.push(e)}}),this.normalizeLists=!this.tags.some(t=>{if(!/^(ul|ol)\b/.test(t.tag)||!t.node)return!1;let n=e.nodes[t.node];return n.contentMatch.matchType(n)})}parse(e,t={}){let n=new nt(this,t,!1);return n.addAll(e,k.none,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new nt(this,t,!0);return n.addAll(e,k.none,t.from,t.to),A.maxOpen(n.finish())}matchTag(e,t,n){for(let r=n?this.tags.indexOf(n)+1:0;r<this.tags.length;r++){let n=this.tags[r];if(it(e,n.tag)&&(n.namespace===void 0||e.namespaceURI==n.namespace)&&(!n.context||t.matchesContext(n.context))){if(n.getAttrs){let t=n.getAttrs(e);if(t===!1)continue;n.attrs=t||void 0}return n}}}matchStyle(e,t,n,r){for(let i=r?this.styles.indexOf(r)+1:0;i<this.styles.length;i++){let r=this.styles[i],a=r.style;if(!(a.indexOf(e)!=0||r.context&&!n.matchesContext(r.context)||a.length>e.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=t))){if(r.getAttrs){let e=r.getAttrs(t);if(e===!1)continue;r.attrs=e||void 0}return r}}}static schemaRules(e){let t=[];function n(e){let n=e.priority==null?50:e.priority,r=0;for(;r<t.length;r++){let e=t[r];if((e.priority==null?50:e.priority)<n)break}t.splice(r,0,e)}for(let t in e.marks){let r=e.marks[t].spec.parseDOM;r&&r.forEach(e=>{n(e=at(e)),e.mark||e.ignore||e.clearMark||(e.mark=t)})}for(let t in e.nodes){let r=e.nodes[t].spec.parseDOM;r&&r.forEach(e=>{n(e=at(e)),e.node||e.ignore||e.mark||(e.node=t)})}return t}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new e(t,e.schemaRules(t)))}},Je={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},Ye={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Xe={ol:!0,ul:!0},Ze=1,Qe=2,$e=4;function et(e,t,n){return t==null?e&&e.whitespace==`pre`?3:n&-5:(t?Ze:0)|(t===`full`?Qe:0)}var tt=class{constructor(e,t,n,r,i,a){this.type=e,this.attrs=t,this.marks=n,this.solid=r,this.options=a,this.content=[],this.activeMarks=k.none,this.match=i||(a&$e?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(E.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let t=this.type.contentMatch,n;return(n=t.findWrapping(e.type))?(this.match=t,n):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&Ze)){let e=this.content[this.content.length-1],t;if(e&&e.isText&&(t=/[ \t\r\n\u000c]+$/.exec(e.text))){let n=e;e.text.length==t[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-t[0].length))}}let t=E.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(E.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!Je.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}},nt=class{constructor(e,t,n){this.parser=e,this.options=t,this.isOpen=n,this.open=0,this.localPreserveWS=!1;let r=t.topNode,i,a=et(null,t.preserveWhitespace,0)|(n?$e:0);i=r?new tt(r.type,r.attrs,k.none,!0,t.topMatch||r.type.contentMatch,a):n?new tt(null,null,k.none,!0,null,a):new tt(e.schema.topNodeType,null,k.none,!0,null,a),this.nodes=[i],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){e.nodeType==3?this.addTextNode(e,t):e.nodeType==1&&this.addElement(e,t)}addTextNode(e,t){let n=e.nodeValue,r=this.top,i=r.options&Qe?`full`:this.localPreserveWS||(r.options&Ze)>0,{schema:a}=this.parser;if(i===`full`||r.inlineContext(e)||/[^ \t\r\n\u000c]/.test(n)){if(!i){if(n=n.replace(/[ \t\r\n\u000c]+/g,` `),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let t=r.content[r.content.length-1],i=e.previousSibling;(!t||i&&i.nodeName==`BR`||t.isText&&/[ \t\r\n\u000c]$/.test(t.text))&&(n=n.slice(1))}}else if(i===`full`)n=n.replace(/\r\n?/g,`
|
|
30
|
+
`);else if(a.linebreakReplacement&&/[\r\n]/.test(n)&&this.top.findWrapping(a.linebreakReplacement.create())){let e=n.split(/\r?\n|\r/);for(let n=0;n<e.length;n++)n&&this.insertNode(a.linebreakReplacement.create(),t,!0),e[n]&&this.insertNode(a.text(e[n]),t,!/\S/.test(e[n]));n=``}else n=n.replace(/\r?\n|\r/g,` `);n&&this.insertNode(a.text(n),t,!/\S/.test(n)),this.findInText(e)}else this.findInside(e)}addElement(e,t,n){let r=this.localPreserveWS,i=this.top;(e.tagName==`PRE`||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let a=e.nodeName.toLowerCase(),o;Xe.hasOwnProperty(a)&&this.parser.normalizeLists&&rt(e);let s=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(o=this.parser.matchTag(e,this,n));out:if(s?s.ignore:Ye.hasOwnProperty(a))this.findInside(e),this.ignoreFallback(e,t);else if(!s||s.skip||s.closeParent){s&&s.closeParent?this.open=Math.max(0,this.open-1):s&&s.skip.nodeType&&(e=s.skip);let n,r=this.needsBlock;if(Je.hasOwnProperty(a))i.content.length&&i.content[0].isInline&&this.open&&(this.open--,i=this.top),n=!0,i.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,t);break out}let o=s&&s.skip?t:this.readStyles(e,t);o&&this.addAll(e,o),n&&this.sync(i),this.needsBlock=r}else{let n=this.readStyles(e,t);n&&this.addElementByRule(e,s,n,s.consuming===!1?o:void 0)}this.localPreserveWS=r}leafFallback(e,t){e.nodeName==`BR`&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
|
|
31
|
+
`),t)}ignoreFallback(e,t){e.nodeName==`BR`&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text(`-`),t,!0)}readStyles(e,t){let n=e.style;if(n&&n.length)for(let e=0;e<this.parser.matchedStyles.length;e++){let r=this.parser.matchedStyles[e],i=n.getPropertyValue(r);if(i)for(let e;;){let n=this.parser.matchStyle(r,i,this,e);if(!n)break;if(n.ignore)return null;if(t=n.clearMark?t.filter(e=>!n.clearMark(e)):t.concat(this.parser.schema.marks[n.mark].create(n.attrs)),n.consuming===!1)e=n;else break}}return t}addElementByRule(e,t,n,r){let i,a;if(t.node)if(a=this.parser.schema.nodes[t.node],a.isLeaf)this.insertNode(a.create(t.attrs),n,e.nodeName==`BR`)||this.leafFallback(e,n);else{let e=this.enter(a,t.attrs||null,n,t.preserveWhitespace);e&&(i=!0,n=e)}else{let e=this.parser.schema.marks[t.mark];n=n.concat(e.create(t.attrs))}let o=this.top;if(a&&a.isLeaf)this.findInside(e);else if(r)this.addElement(e,n,r);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(e=>this.insertNode(e,n,!1));else{let r=e;typeof t.contentElement==`string`?r=e.querySelector(t.contentElement):typeof t.contentElement==`function`?r=t.contentElement(e):t.contentElement&&(r=t.contentElement),this.findAround(e,r,!0),this.addAll(r,n),this.findAround(e,r,!1)}i&&this.sync(o)&&this.open--}addAll(e,t,n,r){let i=n||0;for(let a=n?e.childNodes[n]:e.firstChild,o=r==null?null:e.childNodes[r];a!=o;a=a.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(a,t);this.findAtPoint(e,i)}findPlace(e,t,n){let r,i;for(let t=this.open,a=0;t>=0;t--){let o=this.nodes[t],s=o.findWrapping(e);if(s&&(!r||r.length>s.length+a)&&(r=s,i=o,!s.length))break;if(o.solid){if(n)break;a+=2}}if(!r)return null;this.sync(i);for(let e=0;e<r.length;e++)t=this.enterInner(r[e],null,t,!1);return t}insertNode(e,t,n){if(e.isInline&&this.needsBlock&&!this.top.type){let e=this.textblockFromContext();e&&(t=this.enterInner(e,null,t))}let r=this.findPlace(e,t,n);if(r){this.closeExtra();let t=this.top;t.match&&=t.match.matchType(e.type);let n=k.none;for(let i of r.concat(e.marks))(t.type?t.type.allowsMarkType(i.type):ot(i.type,e.type))&&(n=i.addToSet(n));return t.content.push(e.mark(n)),!0}return!1}enter(e,t,n,r){let i=this.findPlace(e.create(t),n,!1);return i&&=this.enterInner(e,t,n,!0,r),i}enterInner(e,t,n,r=!1,i){this.closeExtra();let a=this.top;a.match=a.match&&a.match.matchType(e);let o=et(e,i,a.options);a.options&$e&&a.content.length==0&&(o|=$e);let s=k.none;return n=n.filter(t=>(a.type?a.type.allowsMarkType(t.type):ot(t.type,e))?(s=t.addToSet(s),!1):!0),this.nodes.push(new tt(e,t,s,r,null,o)),this.open++,n}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let t=this.open;t>=0;t--)if(this.nodes[t]==e)return this.open=t,!0;else this.localPreserveWS&&(this.nodes[t].options|=Ze);return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let n=this.nodes[t].content;for(let t=n.length-1;t>=0;t--)e+=n[t].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==t&&(this.find[n].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].pos==null&&e.nodeType==1&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,n){if(e!=t&&this.find)for(let r=0;r<this.find.length;r++)this.find[r].pos==null&&e.nodeType==1&&e.contains(this.find[r].node)&&t.compareDocumentPosition(this.find[r].node)&(n?2:4)&&(this.find[r].pos=this.currentPos)}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf(`|`)>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split(`/`),n=this.options.context,r=!this.isOpen&&(!n||n.parent.type==this.nodes[0].type),i=-(n?n.depth+1:0)+ +!r,a=(e,o)=>{for(;e>=0;e--){let s=t[e];if(s==``){if(e==t.length-1||e==0)continue;for(;o>=i;o--)if(a(e-1,o))return!0;return!1}else{let e=o>0||o==0&&r?this.nodes[o].type:n&&o>=i?n.node(o-i).type:null;if(!e||e.name!=s&&!e.isInGroup(s))return!1;o--}}return!0};return a(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let e in this.parser.schema.nodes){let t=this.parser.schema.nodes[e];if(t.isTextblock&&t.defaultAttrs)return t}}};function rt(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let e=t.nodeType==1?t.nodeName.toLowerCase():null;e&&Xe.hasOwnProperty(e)&&n?(n.appendChild(t),t=n):e==`li`?n=t:e&&(n=null)}}function it(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function at(e){let t={};for(let n in e)t[n]=e[n];return t}function ot(e,t){let n=t.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(e))continue;let a=[],o=e=>{a.push(e);for(let n=0;n<e.edgeCount;n++){let{type:r,next:i}=e.edge(n);if(r==t||a.indexOf(i)<0&&o(i))return!0}};if(o(i.contentMatch))return!0}}var st=class e{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},n){n||=lt(t).createDocumentFragment();let r=n,i=[];return e.forEach(e=>{if(i.length||e.marks.length){let n=0,a=0;for(;n<i.length&&a<e.marks.length;){let t=e.marks[a];if(!this.marks[t.type.name]){a++;continue}if(!t.eq(i[n][0])||t.type.spec.spanning===!1)break;n++,a++}for(;n<i.length;)r=i.pop()[1];for(;a<e.marks.length;){let n=e.marks[a++],o=this.serializeMark(n,e.isInline,t);o&&(i.push([n,r]),r.appendChild(o.dom),r=o.contentDOM||o.dom)}}r.appendChild(this.serializeNodeInner(e,t))}),n}serializeNodeInner(e,t){if(e.isText)return lt(t).createTextNode(e.text);let{dom:n,contentDOM:r}=pt(lt(t),this.nodes[e.type.name](e),null,e.attrs);if(r){if(e.isLeaf)throw RangeError(`Content hole not allowed in a leaf node spec`);this.serializeFragment(e.content,t,r)}return n}serializeNode(e,t={}){let n=this.serializeNodeInner(e,t);for(let r=e.marks.length-1;r>=0;r--){let i=this.serializeMark(e.marks[r],e.isInline,t);i&&((i.contentDOM||i.dom).appendChild(n),n=i.dom)}return n}serializeMark(e,t,n={}){let r=this.marks[e.type.name];return r&&pt(lt(n),r(e,t),null,e.attrs)}static renderSpec(e,t,n=null,r){return typeof t==`string`?{dom:e.createTextNode(t)}:pt(e,t,n,r)}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new e(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(e){let t=ct(e.nodes);return t.text||=e=>e.text,t}static marksFromSchema(e){return ct(e.marks)}};function ct(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function lt(e){return e.document||window.document}var ut=new WeakMap;function dt(e){let t=ut.get(e);return t===void 0&&ut.set(e,t=ft(e)),t}function ft(e){let t=null;function n(e){if(e&&typeof e==`object`)if(Array.isArray(e))if(typeof e[0]==`string`)t||=[],t.push(e);else for(let t=0;t<e.length;t++)n(e[t]);else for(let t in e)n(e[t])}return n(e),t}function pt(e,t,n,r){if(t.nodeType==1)return{dom:t};if(t.dom&&t.dom.nodeType==1)return t;let i=t[0],a;if(typeof i!=`string`)throw RangeError(`Invalid array passed to renderSpec`);if(r&&(a=dt(r))&&a.indexOf(t)>-1)throw RangeError(`Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.`);let o=i.indexOf(` `);o>0&&(n=i.slice(0,o),i=i.slice(o+1));let s,c=n?e.createElementNS(n,i):e.createElement(i),l=t[1],u=1;if(l&&typeof l==`object`&&l.nodeType==null&&!Array.isArray(l)){u=2;for(let e in l)if(l[e]!=null){let t=e.indexOf(` `);t>0?c.setAttributeNS(e.slice(0,t),e.slice(t+1),l[e]):e==`style`&&c.style?c.style.cssText=l[e]:c.setAttribute(e,l[e])}}for(let i=u;i<t.length;i++){let a=t[i];if(a===0){if(i<t.length-1||i>u)throw RangeError(`Content hole must be the only child of its parent node`);return{dom:c,contentDOM:c}}else if(typeof a==`string`)c.appendChild(e.createTextNode(a));else{let{dom:t,contentDOM:i}=pt(e,a,n,r);if(c.appendChild(t),i){if(s)throw RangeError(`Multiple content holes`);s=i}}}return{dom:c,contentDOM:s}}var mt=65535,ht=2**16;function gt(e,t){return e+t*ht}function _t(e){return e&mt}function vt(e){return(e-(e&mt))/ht}var yt=1,bt=2,xt=4,St=8,Ct=class{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(this.delInfo&St)>0}get deletedBefore(){return(this.delInfo&5)>0}get deletedAfter(){return(this.delInfo&6)>0}get deletedAcross(){return(this.delInfo&xt)>0}},wt=class e{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&e.empty)return e.empty}recover(e){let t=0,n=_t(e);if(!this.inverted)for(let e=0;e<n;e++)t+=this.ranges[e*3+2]-this.ranges[e*3+1];return this.ranges[n*3]+t+vt(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,n){let r=0,i=this.inverted?2:1,a=this.inverted?1:2;for(let o=0;o<this.ranges.length;o+=3){let s=this.ranges[o]-(this.inverted?r:0);if(s>e)break;let c=this.ranges[o+i],l=this.ranges[o+a],u=s+c;if(e<=u){let i=c?e==s?-1:e==u?1:t:t,a=s+r+(i<0?0:l);if(n)return a;let d=e==(t<0?s:u)?null:gt(o/3,e-s),f=e==s?bt:e==u?yt:xt;return(t<0?e!=s:e!=u)&&(f|=St),new Ct(a,f,d)}r+=l-c}return n?e+r:new Ct(e+r,0,null)}touches(e,t){let n=0,r=_t(t),i=this.inverted?2:1,a=this.inverted?1:2;for(let t=0;t<this.ranges.length;t+=3){let o=this.ranges[t]-(this.inverted?n:0);if(o>e)break;let s=this.ranges[t+i];if(e<=o+s&&t==r*3)return!0;n+=this.ranges[t+a]-s}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,i=0;r<this.ranges.length;r+=3){let a=this.ranges[r],o=a-(this.inverted?i:0),s=a+(this.inverted?0:i),c=this.ranges[r+t],l=this.ranges[r+n];e(o,o+c,s,s+l),i+=l-c}}invert(){return new e(this.ranges,!this.inverted)}toString(){return(this.inverted?`-`:``)+JSON.stringify(this.ranges)}static offset(t){return t==0?e.empty:new e(t<0?[0,-t,0]:[0,0,t])}};wt.empty=new wt([]);var Tt=class e{constructor(e,t,n=0,r=e?e.length:0){this.mirror=t,this.from=n,this.to=r,this._maps=e||[],this.ownData=!(e||t)}get maps(){return this._maps}slice(t=0,n=this.maps.length){return new e(this._maps,this.mirror,t,n)}appendMap(e,t){this.ownData||=(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),!0),this.to=this._maps.push(e),t!=null&&this.setMirror(this._maps.length-1,t)}appendMapping(e){for(let t=0,n=this._maps.length;t<e._maps.length;t++){let r=e.getMirror(t);this.appendMap(e._maps[t],r!=null&&r<t?n+r:void 0)}}getMirror(e){if(this.mirror){for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}}setMirror(e,t){this.mirror||=[],this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,n=this._maps.length+e._maps.length;t>=0;t--){let r=e.getMirror(t);this.appendMap(e._maps[t].invert(),r!=null&&r>t?n-r-1:void 0)}}invert(){let t=new e;return t.appendMappingInverted(this),t}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let n=this.from;n<this.to;n++)e=this._maps[n].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,n){let r=0;for(let n=this.from;n<this.to;n++){let i=this._maps[n].mapResult(e,t);if(i.recover!=null){let t=this.getMirror(n);if(t!=null&&t>n&&t<this.to){n=t,e=this._maps[t].recover(i.recover);continue}}r|=i.delInfo,e=i.pos}return n?e:new Ct(e,r,null)}},Et=Object.create(null),Dt=class{getMap(){return wt.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw RangeError(`Invalid input for Step.fromJSON`);let n=Et[t.stepType];if(!n)throw RangeError(`No step type ${t.stepType} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in Et)throw RangeError(`Duplicate use of step JSON ID `+e);return Et[e]=t,t.prototype.jsonID=e,t}},Ot=class e{constructor(e,t){this.doc=e,this.failed=t}static ok(t){return new e(t,null)}static fail(t){return new e(null,t)}static fromReplace(t,n,r,i){try{return e.ok(t.replace(n,r,i))}catch(t){if(t instanceof te)return e.fail(t.message);throw t}}};function kt(e,t,n){let r=[];for(let i=0;i<e.childCount;i++){let a=e.child(i);a.content.size&&(a=a.copy(kt(a.content,t,a))),a.isInline&&(a=t(a,n,i)),r.push(a)}return E.fromArray(r)}var At=class e extends Dt{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=e.resolve(this.from),r=n.node(n.sharedDepth(this.to)),i=new A(kt(t.content,(e,t)=>!e.isAtom||!t.type.allowsMarkType(this.mark.type)?e:e.mark(this.mark.addToSet(e.marks)),r),t.openStart,t.openEnd);return Ot.fromReplace(e,this.from,this.to,i)}invert(){return new jt(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)}merge(t){return t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:`addMark`,mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for AddMarkStep.fromJSON`);return new e(n.from,n.to,t.markFromJSON(n.mark))}};Dt.jsonID(`addMark`,At);var jt=class e extends Dt{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=new A(kt(t.content,e=>e.mark(this.mark.removeFromSet(e.marks)),e),t.openStart,t.openEnd);return Ot.fromReplace(e,this.from,this.to,n)}invert(){return new At(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)}merge(t){return t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:`removeMark`,mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for RemoveMarkStep.fromJSON`);return new e(n.from,n.to,t.markFromJSON(n.mark))}};Dt.jsonID(`removeMark`,jt);var Mt=class e extends Dt{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Ot.fail(`No node at mark step's position`);let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return Ot.fromReplace(e,this.pos,this.pos+1,new A(E.from(n),0,+!t.isLeaf))}invert(t){let n=t.nodeAt(this.pos);if(n){let t=this.mark.addToSet(n.marks);if(t.length==n.marks.length){for(let r=0;r<n.marks.length;r++)if(!n.marks[r].isInSet(t))return new e(this.pos,n.marks[r]);return new e(this.pos,this.mark)}}return new Nt(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.mark)}toJSON(){return{stepType:`addNodeMark`,pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!=`number`)throw RangeError(`Invalid input for AddNodeMarkStep.fromJSON`);return new e(n.pos,t.markFromJSON(n.mark))}};Dt.jsonID(`addNodeMark`,Mt);var Nt=class e extends Dt{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Ot.fail(`No node at mark step's position`);let n=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return Ot.fromReplace(e,this.pos,this.pos+1,new A(E.from(n),0,+!t.isLeaf))}invert(e){let t=e.nodeAt(this.pos);return!t||!this.mark.isInSet(t.marks)?this:new Mt(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.mark)}toJSON(){return{stepType:`removeNodeMark`,pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!=`number`)throw RangeError(`Invalid input for RemoveNodeMarkStep.fromJSON`);return new e(n.pos,t.markFromJSON(n.mark))}};Dt.jsonID(`removeNodeMark`,Nt);var Pt=class e extends Dt{constructor(e,t,n,r=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=r}apply(e){return this.structure&&It(e,this.from,this.to)?Ot.fail(`Structure replace would overwrite content`):Ot.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new wt([this.from,this.to-this.from,this.slice.size])}invert(t){return new e(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let n=t.mapResult(this.to,-1),r=this.from==this.to&&e.MAP_BIAS<0?n:t.mapResult(this.from,1);return r.deletedAcross&&n.deletedAcross?null:new e(r.pos,Math.max(r.pos,n.pos),this.slice,this.structure)}merge(t){if(!(t instanceof e)||t.structure||this.structure)return null;if(this.from+this.slice.size==t.from&&!this.slice.openEnd&&!t.slice.openStart){let n=this.slice.size+t.slice.size==0?A.empty:new A(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new e(this.from,this.to+(t.to-t.from),n,this.structure)}else if(t.to==this.from&&!this.slice.openStart&&!t.slice.openEnd){let n=this.slice.size+t.slice.size==0?A.empty:new A(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new e(t.from,this.to,n,this.structure)}else return null}toJSON(){let e={stepType:`replace`,from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for ReplaceStep.fromJSON`);return new e(n.from,n.to,A.fromJSON(t,n.slice),!!n.structure)}};Pt.MAP_BIAS=1,Dt.jsonID(`replace`,Pt);var Ft=class e extends Dt{constructor(e,t,n,r,i,a,o=!1){super(),this.from=e,this.to=t,this.gapFrom=n,this.gapTo=r,this.slice=i,this.insert=a,this.structure=o}apply(e){if(this.structure&&(It(e,this.from,this.gapFrom)||It(e,this.gapTo,this.to)))return Ot.fail(`Structure gap-replace would overwrite content`);let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return Ot.fail(`Gap is not a flat range`);let n=this.slice.insertAt(this.insert,t.content);return n?Ot.fromReplace(e,this.from,this.to,n):Ot.fail(`Content does not fit in gap`)}getMap(){return new wt([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(t){let n=this.gapTo-this.gapFrom;return new e(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1),i=this.from==this.gapFrom?n.pos:t.map(this.gapFrom,-1),a=this.to==this.gapTo?r.pos:t.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||i<n.pos||a>r.pos?null:new e(n.pos,r.pos,i,a,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:`replaceAround`,from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`||typeof n.gapFrom!=`number`||typeof n.gapTo!=`number`||typeof n.insert!=`number`)throw RangeError(`Invalid input for ReplaceAroundStep.fromJSON`);return new e(n.from,n.to,n.gapFrom,n.gapTo,A.fromJSON(t,n.slice),n.insert,!!n.structure)}};Dt.jsonID(`replaceAround`,Ft);function It(e,t,n){let r=e.resolve(t),i=n-t,a=r.depth;for(;i>0&&a>0&&r.indexAfter(a)==r.node(a).childCount;)a--,i--;if(i>0){let e=r.node(a).maybeChild(r.indexAfter(a));for(;i>0;){if(!e||e.isLeaf)return!0;e=e.firstChild,i--}}return!1}function Lt(e,t,n,r){let i=[],a=[],o,s;e.doc.nodesBetween(t,n,(e,c,l)=>{if(!e.isInline)return;let u=e.marks;if(!r.isInSet(u)&&l.type.allowsMarkType(r.type)){let l=Math.max(c,t),d=Math.min(c+e.nodeSize,n),f=r.addToSet(u);for(let e=0;e<u.length;e++)u[e].isInSet(f)||(o&&o.to==l&&o.mark.eq(u[e])?o.to=d:i.push(o=new jt(l,d,u[e])));s&&s.to==l?s.to=d:a.push(s=new At(l,d,r))}}),i.forEach(t=>e.step(t)),a.forEach(t=>e.step(t))}function Rt(e,t,n,r){let i=[],a=0;e.doc.nodesBetween(t,n,(e,o)=>{if(!e.isInline)return;a++;let s=null;if(r instanceof He){let t=e.marks,n;for(;n=r.isInSet(t);)(s||=[]).push(n),t=n.removeFromSet(t)}else r?r.isInSet(e.marks)&&(s=[r]):s=e.marks;if(s&&s.length){let r=Math.min(o+e.nodeSize,n);for(let e=0;e<s.length;e++){let n=s[e],c;for(let e=0;e<i.length;e++){let t=i[e];t.step==a-1&&n.eq(i[e].style)&&(c=t)}c?(c.to=r,c.step=a):i.push({style:n,from:Math.max(o,t),to:r,step:a})}}}),i.forEach(t=>e.step(new jt(t.from,t.to,t.style)))}function zt(e,t,n,r=n.contentMatch,i=!0){let a=e.doc.nodeAt(t),o=[],s=t+1;for(let t=0;t<a.childCount;t++){let c=a.child(t),l=s+c.nodeSize,u=r.matchType(c.type);if(!u)o.push(new Pt(s,l,A.empty));else{r=u;for(let t=0;t<c.marks.length;t++)n.allowsMarkType(c.marks[t].type)||e.step(new jt(s,l,c.marks[t]));if(i&&c.isText&&n.whitespace!=`pre`){let e,t=/\r?\n|\r/g,r;for(;e=t.exec(c.text);)r||=new A(E.from(n.schema.text(` `,n.allowedMarks(c.marks))),0,0),o.push(new Pt(s+e.index,s+e.index+e[0].length,r))}}s=l}if(!r.validEnd){let t=r.fillBefore(E.empty,!0);e.replace(s,s,new A(t,0,0))}for(let t=o.length-1;t>=0;t--)e.step(o[t])}function Bt(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function Vt(e){let t=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let n=e.depth,r=0,i=0;;--n){let a=e.$from.node(n),o=e.$from.index(n)+r,s=e.$to.indexAfter(n)-i;if(n<e.depth&&a.canReplace(o,s,t))return n;if(n==0||a.type.spec.isolating||!Bt(a,o,s))break;o&&(r=1),s<a.childCount&&(i=1)}return null}function Ht(e,t,n){let{$from:r,$to:i,depth:a}=t,o=r.before(a+1),s=i.after(a+1),c=o,l=s,u=E.empty,d=0;for(let e=a,t=!1;e>n;e--)t||r.index(e)>0?(t=!0,u=E.from(r.node(e).copy(u)),d++):c--;let f=E.empty,p=0;for(let e=a,t=!1;e>n;e--)t||i.after(e+1)<i.end(e)?(t=!0,f=E.from(i.node(e).copy(f)),p++):l++;e.step(new Ft(c,l,o,s,new A(u.append(f),d,p),u.size-d,!0))}function Ut(e,t,n=null,r=e){let i=Gt(e,t),a=i&&Kt(r,t);return a?i.map(Wt).concat({type:t,attrs:n}).concat(a.map(Wt)):null}function Wt(e){return{type:e,attrs:null}}function Gt(e,t){let{parent:n,startIndex:r,endIndex:i}=e,a=n.contentMatchAt(r).findWrapping(t);if(!a)return null;let o=a.length?a[0]:t;return n.canReplaceWith(r,i,o)?a:null}function Kt(e,t){let{parent:n,startIndex:r,endIndex:i}=e,a=n.child(r),o=t.contentMatch.findWrapping(a.type);if(!o)return null;let s=(o.length?o[o.length-1]:t).contentMatch;for(let e=r;s&&e<i;e++)s=s.matchType(n.child(e).type);return!s||!s.validEnd?null:o}function qt(e,t,n){let r=E.empty;for(let e=n.length-1;e>=0;e--){if(r.size){let t=n[e].type.contentMatch.matchFragment(r);if(!t||!t.validEnd)throw RangeError(`Wrapper type given to Transform.wrap does not form valid content of its parent wrapper`)}r=E.from(n[e].type.create(n[e].attrs,r))}let i=t.start,a=t.end;e.step(new Ft(i,a,i,a,new A(r,0,0),n.length,!0))}function Jt(e,t,n,r,i){if(!r.isTextblock)throw RangeError(`Type given to setBlockType should be a textblock`);let a=e.steps.length;e.doc.nodesBetween(t,n,(t,n)=>{let o=typeof i==`function`?i(t):i;if(t.isTextblock&&!t.hasMarkup(r,o)&&Zt(e.doc,e.mapping.slice(a).map(n),r)){let i=null;if(r.schema.linebreakReplacement){let e=r.whitespace==`pre`,t=!!r.contentMatch.matchType(r.schema.linebreakReplacement);e&&!t?i=!1:!e&&t&&(i=!0)}i===!1&&Xt(e,t,n,a),zt(e,e.mapping.slice(a).map(n,1),r,void 0,i===null);let s=e.mapping.slice(a),c=s.map(n,1),l=s.map(n+t.nodeSize,1);return e.step(new Ft(c,l,c+1,l-1,new A(E.from(r.create(o,null,t.marks)),0,0),1,!0)),i===!0&&Yt(e,t,n,a),!1}})}function Yt(e,t,n,r){t.forEach((i,a)=>{if(i.isText){let o,s=/\r?\n|\r/g;for(;o=s.exec(i.text);){let i=e.mapping.slice(r).map(n+1+a+o.index);e.replaceWith(i,i+1,t.type.schema.linebreakReplacement.create())}}})}function Xt(e,t,n,r){t.forEach((i,a)=>{if(i.type==i.type.schema.linebreakReplacement){let i=e.mapping.slice(r).map(n+1+a);e.replaceWith(i,i+1,t.type.schema.text(`
|
|
32
|
+
`))}})}function Zt(e,t,n){let r=e.resolve(t),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function Qt(e,t,n,r,i){let a=e.doc.nodeAt(t);if(!a)throw RangeError(`No node at given position`);n||=a.type;let o=n.create(r,null,i||a.marks);if(a.isLeaf)return e.replaceWith(t,t+a.nodeSize,o);if(!n.validContent(a.content))throw RangeError(`Invalid content for node type `+n.name);e.step(new Ft(t,t+a.nodeSize,t+1,t+a.nodeSize-1,new A(E.from(o),0,0),1,!0))}function $t(e,t,n=1,r){let i=e.resolve(t),a=i.depth-n,o=r&&r[r.length-1]||i.parent;if(a<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!o.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let e=i.depth-1,t=n-2;e>a;e--,t--){let n=i.node(e),a=i.index(e);if(n.type.spec.isolating)return!1;let o=n.content.cutByIndex(a,n.childCount),s=r&&r[t+1];s&&(o=o.replaceChild(0,s.type.create(s.attrs)));let c=r&&r[t]||n;if(!n.canReplace(a+1,n.childCount)||!c.type.validContent(o))return!1}let s=i.indexAfter(a),c=r&&r[0];return i.node(a).canReplaceWith(s,s,c?c.type:i.node(a+1).type)}function en(e,t,n=1,r){let i=e.doc.resolve(t),a=E.empty,o=E.empty;for(let e=i.depth,t=i.depth-n,s=n-1;e>t;e--,s--){a=E.from(i.node(e).copy(a));let t=r&&r[s];o=E.from(t?t.type.create(t.attrs,o):i.node(e).copy(o))}e.step(new Pt(t,t,new A(a.append(o),n,n),!0))}function tn(e,t){let n=e.resolve(t),r=n.index();return rn(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function nn(e,t){t.content.size||e.type.compatibleContent(t.type);let n=e.contentMatchAt(e.childCount),{linebreakReplacement:r}=e.type.schema;for(let i=0;i<t.childCount;i++){let a=t.child(i),o=a.type==r?e.type.schema.nodes.text:a.type;if(n=n.matchType(o),!n||!e.type.allowsMarks(a.marks))return!1}return n.validEnd}function rn(e,t){return!!(e&&t&&!e.isLeaf&&nn(e,t))}function an(e,t,n=-1){let r=e.resolve(t);for(let e=r.depth;;e--){let i,a,o=r.index(e);if(e==r.depth?(i=r.nodeBefore,a=r.nodeAfter):n>0?(i=r.node(e+1),o++,a=r.node(e).maybeChild(o)):(i=r.node(e).maybeChild(o-1),a=r.node(e+1)),i&&!i.isTextblock&&rn(i,a)&&r.node(e).canReplace(o,o+1))return t;if(e==0)break;t=n<0?r.before(e):r.after(e)}}function on(e,t,n){let r=null,{linebreakReplacement:i}=e.doc.type.schema,a=e.doc.resolve(t-n),o=a.node().type;if(i&&o.inlineContent){let e=o.whitespace==`pre`,t=!!o.contentMatch.matchType(i);e&&!t?r=!1:!e&&t&&(r=!0)}let s=e.steps.length;if(r===!1){let r=e.doc.resolve(t+n);Xt(e,r.node(),r.before(),s)}o.inlineContent&&zt(e,t+n-1,o,a.node().contentMatchAt(a.index()),r==null);let c=e.mapping.slice(s),l=c.map(t-n);if(e.step(new Pt(l,c.map(t+n,-1),A.empty,!0)),r===!0){let t=e.doc.resolve(l);Yt(e,t.node(),t.before(),e.steps.length)}return e}function sn(e,t,n){let r=e.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),n))return t;if(r.parentOffset==0)for(let e=r.depth-1;e>=0;e--){let t=r.index(e);if(r.node(e).canReplaceWith(t,t,n))return r.before(e+1);if(t>0)return null}if(r.parentOffset==r.parent.content.size)for(let e=r.depth-1;e>=0;e--){let t=r.indexAfter(e);if(r.node(e).canReplaceWith(t,t,n))return r.after(e+1);if(t<r.node(e).childCount)return null}return null}function cn(e,t,n){let r=e.resolve(t);if(!n.content.size)return t;let i=n.content;for(let e=0;e<n.openStart;e++)i=i.firstChild.content;for(let e=1;e<=(n.openStart==0&&n.size?2:1);e++)for(let t=r.depth;t>=0;t--){let n=t==r.depth?0:r.pos<=(r.start(t+1)+r.end(t+1))/2?-1:1,a=r.index(t)+ +(n>0),o=r.node(t),s=!1;if(e==1)s=o.canReplace(a,a,i);else{let e=o.contentMatchAt(a).findWrapping(i.firstChild.type);s=e&&o.canReplaceWith(a,a,e[0])}if(s)return n==0?r.pos:n<0?r.before(t+1):r.after(t+1)}return null}function ln(e,t,n=t,r=A.empty){if(t==n&&!r.size)return null;let i=e.resolve(t),a=e.resolve(n);return un(i,a,r)?new Pt(t,n,r):new dn(i,a,r).fit()}function un(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}var dn=class{constructor(e,t,n){this.$from=e,this.$to=t,this.unplaced=n,this.frontier=[],this.placed=E.empty;for(let t=0;t<=e.depth;t++){let n=e.node(t);this.frontier.push({type:n.type,match:n.contentMatchAt(e.indexAfter(t))})}for(let t=e.depth;t>0;t--)this.placed=E.from(e.node(t).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let e=this.findFittable();e?this.placeNodes(e):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,n=this.$from,r=this.close(e<0?this.$to:n.doc.resolve(e));if(!r)return null;let i=this.placed,a=n.depth,o=r.depth;for(;a&&o&&i.childCount==1;)i=i.firstChild.content,a--,o--;let s=new A(i,a,o);return e>-1?new Ft(n.pos,e,this.$to.pos,this.$to.end(),s,t):s.size||n.pos!=this.$to.pos?new Pt(n.pos,r.pos,s):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,n=0,r=this.unplaced.openEnd;n<e;n++){let i=t.firstChild;if(t.childCount>1&&(r=0),i.type.spec.isolating&&r<=n){e=n;break}t=i.content}for(let t=1;t<=2;t++)for(let n=t==1?e:this.unplaced.openStart;n>=0;n--){let e,r=null;n?(r=mn(this.unplaced.content,n-1).firstChild,e=r.content):e=this.unplaced.content;let i=e.firstChild;for(let e=this.depth;e>=0;e--){let{type:a,match:o}=this.frontier[e],s,c=null;if(t==1&&(i?o.matchType(i.type)||(c=o.fillBefore(E.from(i),!1)):r&&a.compatibleContent(r.type)))return{sliceDepth:n,frontierDepth:e,parent:r,inject:c};if(t==2&&i&&(s=o.findWrapping(i.type)))return{sliceDepth:n,frontierDepth:e,parent:r,wrap:s};if(r&&o.matchType(r.type))break}}}openMore(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=mn(e,t);return!r.childCount||r.firstChild.isLeaf?!1:(this.unplaced=new A(e,t+1,Math.max(n,r.size+t>=e.size-n?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=mn(e,t);if(r.childCount<=1&&t>0){let i=e.size-t<=t+r.size;this.unplaced=new A(fn(e,t-1,1),t-1,i?t-1:n)}else this.unplaced=new A(fn(e,t,1),t,n)}placeNodes({sliceDepth:e,frontierDepth:t,parent:n,inject:r,wrap:i}){for(;this.depth>t;)this.closeFrontierNode();if(i)for(let e=0;e<i.length;e++)this.openFrontierNode(i[e]);let a=this.unplaced,o=n?n.content:a.content,s=a.openStart-e,c=0,l=[],{match:u,type:d}=this.frontier[t];if(r){for(let e=0;e<r.childCount;e++)l.push(r.child(e));u=u.matchFragment(r)}let f=o.size+e-(a.content.size-a.openEnd);for(;c<o.childCount;){let e=o.child(c),t=u.matchType(e.type);if(!t)break;c++,(c>1||s==0||e.content.size)&&(u=t,l.push(hn(e.mark(d.allowedMarks(e.marks)),c==1?s:0,c==o.childCount?f:-1)))}let p=c==o.childCount;p||(f=-1),this.placed=pn(this.placed,t,E.from(l)),this.frontier[t].match=u,p&&f<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let e=0,t=o;e<f;e++){let e=t.lastChild;this.frontier.push({type:e.type,match:e.contentMatchAt(e.childCount)}),t=e.content}this.unplaced=p?e==0?A.empty:new A(fn(a.content,e-1,1),e-1,f<0?a.openEnd:e-1):new A(fn(a.content,e,c),a.openStart,a.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],t;if(!e.type.isTextblock||!gn(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(t=this.findCloseLevel(this.$to))&&t.depth==this.depth)return-1;let{depth:n}=this.$to,r=this.$to.after(n);for(;n>1&&r==this.$to.end(--n);)++r;return r}findCloseLevel(e){scan:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:n,type:r}=this.frontier[t],i=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),a=gn(e,t,r,n,i);if(a){for(let n=t-1;n>=0;n--){let{match:t,type:r}=this.frontier[n],i=gn(e,n,r,t,!0);if(!i||i.childCount)continue scan}return{depth:t,fit:a,move:i?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=pn(this.placed,t.depth,t.fit)),e=t.move;for(let n=t.depth+1;n<=e.depth;n++){let t=e.node(n),r=t.type.contentMatch.fillBefore(t.content,!0,e.index(n));this.openFrontierNode(t.type,t.attrs,r)}return e}openFrontierNode(e,t=null,n){let r=this.frontier[this.depth];r.match=r.match.matchType(e),this.placed=pn(this.placed,this.depth,E.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(E.empty,!0);e.childCount&&(this.placed=pn(this.placed,this.frontier.length,e))}};function fn(e,t,n){return t==0?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(fn(e.firstChild.content,t-1,n)))}function pn(e,t,n){return t==0?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(pn(e.lastChild.content,t-1,n)))}function mn(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function hn(e,t,n){if(t<=0)return e;let r=e.content;return t>1&&(r=r.replaceChild(0,hn(r.firstChild,t-1,r.childCount==1?n-1:0))),t>0&&(r=e.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(e.type.contentMatch.matchFragment(r).fillBefore(E.empty,!0)))),e.copy(r)}function gn(e,t,n,r,i){let a=e.node(t),o=i?e.indexAfter(t):e.index(t);if(o==a.childCount&&!n.compatibleContent(a.type))return null;let s=r.fillBefore(a.content,!0,o);return s&&!_n(n,a.content,o)?s:null}function _n(e,t,n){for(let r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1}function vn(e){return e.spec.defining||e.spec.definingForContent}function yn(e,t,n,r){if(!r.size)return e.deleteRange(t,n);let i=e.doc.resolve(t),a=e.doc.resolve(n);if(un(i,a,r))return e.step(new Pt(t,n,r));let o=Cn(i,a);o[o.length-1]==0&&o.pop();let s=-(i.depth+1);o.unshift(s);for(let e=i.depth,t=i.pos-1;e>0;e--,t--){let n=i.node(e).type.spec;if(n.defining||n.definingAsContext||n.isolating)break;o.indexOf(e)>-1?s=e:i.before(e)==t&&o.splice(1,0,-e)}let c=o.indexOf(s),l=[],u=r.openStart;for(let e=r.content,t=0;;t++){let n=e.firstChild;if(l.push(n),t==r.openStart)break;e=n.content}for(let e=u-1;e>=0;e--){let t=l[e],n=vn(t.type);if(n&&!t.sameMarkup(i.node(Math.abs(s)-1)))u=e;else if(n||!t.type.isTextblock)break}for(let t=r.openStart;t>=0;t--){let s=(t+u+1)%(r.openStart+1),d=l[s];if(d)for(let t=0;t<o.length;t++){let l=o[(t+c)%o.length],u=!0;l<0&&(u=!1,l=-l);let f=i.node(l-1),p=i.index(l-1);if(f.canReplaceWith(p,p,d.type,d.marks))return e.replace(i.before(l),u?a.after(l):n,new A(bn(r.content,0,r.openStart,s),s,r.openEnd))}}let d=e.steps.length;for(let s=o.length-1;s>=0&&(e.replace(t,n,r),!(e.steps.length>d));s--){let e=o[s];e<0||(t=i.before(e),n=a.after(e))}}function bn(e,t,n,r,i){if(t<n){let i=e.firstChild;e=e.replaceChild(0,i.copy(bn(i.content,t+1,n,r,i)))}if(t>r){let t=i.contentMatchAt(0),n=t.fillBefore(e).append(e);e=n.append(t.matchFragment(n).fillBefore(E.empty,!0))}return e}function xn(e,t,n,r){if(!r.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let i=sn(e.doc,t,r.type);i!=null&&(t=n=i)}e.replaceRange(t,n,new A(E.from(r),0,0))}function Sn(e,t,n){let r=e.doc.resolve(t),i=e.doc.resolve(n);if(r.parent.isTextblock&&i.parent.isTextblock&&r.start()!=i.start()&&r.parentOffset==0&&i.parentOffset==0){let a=r.sharedDepth(n),o=!1;for(let e=r.depth;e>a;e--)r.node(e).type.spec.isolating&&(o=!0);for(let e=i.depth;e>a;e--)i.node(e).type.spec.isolating&&(o=!0);if(!o){for(let e=r.depth;e>0&&t==r.start(e);e--)t=r.before(e);for(let e=i.depth;e>0&&n==i.start(e);e--)n=i.before(e);r=e.doc.resolve(t),i=e.doc.resolve(n)}}let a=Cn(r,i);for(let t=0;t<a.length;t++){let n=a[t],o=t==a.length-1;if(o&&n==0||r.node(n).type.contentMatch.validEnd)return e.delete(r.start(n),i.end(n));if(n>0&&(o||r.node(n-1).canReplace(r.index(n-1),i.indexAfter(n-1))))return e.delete(r.before(n),i.after(n))}for(let a=1;a<=r.depth&&a<=i.depth;a++)if(t-r.start(a)==r.depth-a&&n>r.end(a)&&i.end(a)-n!=i.depth-a&&r.start(a-1)==i.start(a-1)&&r.node(a-1).canReplace(r.index(a-1),i.index(a-1)))return e.delete(r.before(a),n);e.delete(t,n)}function Cn(e,t){let n=[],r=Math.min(e.depth,t.depth);for(let i=r;i>=0;i--){let r=e.start(i);if(r<e.pos-(e.depth-i)||t.end(i)>t.pos+(t.depth-i)||e.node(i).type.spec.isolating||t.node(i).type.spec.isolating)break;(r==t.start(i)||i==e.depth&&i==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&i&&t.start(i-1)==r-1)&&n.push(i)}return n}var wn=class e extends Dt{constructor(e,t,n){super(),this.pos=e,this.attr=t,this.value=n}apply(e){let t=e.nodeAt(this.pos);if(!t)return Ot.fail(`No node at attribute step's position`);let n=Object.create(null);for(let e in t.attrs)n[e]=t.attrs[e];n[this.attr]=this.value;let r=t.type.create(n,null,t.marks);return Ot.fromReplace(e,this.pos,this.pos+1,new A(E.from(r),0,+!t.isLeaf))}getMap(){return wt.empty}invert(t){return new e(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.attr,this.value)}toJSON(){return{stepType:`attr`,pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.pos!=`number`||typeof n.attr!=`string`)throw RangeError(`Invalid input for AttrStep.fromJSON`);return new e(n.pos,n.attr,n.value)}};Dt.jsonID(`attr`,wn);var Tn=class e extends Dt{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let n in e.attrs)t[n]=e.attrs[n];t[this.attr]=this.value;let n=e.type.create(t,e.content,e.marks);return Ot.ok(n)}getMap(){return wt.empty}invert(t){return new e(this.attr,t.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:`docAttr`,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.attr!=`string`)throw RangeError(`Invalid input for DocAttrStep.fromJSON`);return new e(n.attr,n.value)}};Dt.jsonID(`docAttr`,Tn);var En=class extends Error{};En=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n},En.prototype=Object.create(Error.prototype),En.prototype.constructor=En,En.prototype.name=`TransformError`;var Dn=class{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new Tt}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new En(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}changedRange(){let e=1e9,t=-1e9;for(let n=0;n<this.mapping.maps.length;n++){let r=this.mapping.maps[n];n&&(e=r.map(e,1),t=r.map(t,-1)),r.forEach((n,r,i,a)=>{e=Math.min(e,i),t=Math.max(t,a)})}return e==1e9?null:{from:e,to:t}}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,n=A.empty){let r=ln(this.doc,e,t,n);return r&&this.step(r),this}replaceWith(e,t,n){return this.replace(e,t,new A(E.from(n),0,0))}delete(e,t){return this.replace(e,t,A.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,n){return yn(this,e,t,n),this}replaceRangeWith(e,t,n){return xn(this,e,t,n),this}deleteRange(e,t){return Sn(this,e,t),this}lift(e,t){return Ht(this,e,t),this}join(e,t=1){return on(this,e,t),this}wrap(e,t){return qt(this,e,t),this}setBlockType(e,t=e,n,r=null){return Jt(this,e,t,n,r),this}setNodeMarkup(e,t,n=null,r){return Qt(this,e,t,n,r),this}setNodeAttribute(e,t,n){return this.step(new wn(e,t,n)),this}setDocAttribute(e,t){return this.step(new Tn(e,t)),this}addNodeMark(e,t){return this.step(new Mt(e,t)),this}removeNodeMark(e,t){let n=this.doc.nodeAt(e);if(!n)throw RangeError(`No node at position `+e);if(t instanceof k)t.isInSet(n.marks)&&this.step(new Nt(e,t));else{let r=n.marks,i,a=[];for(;i=t.isInSet(r);)a.push(new Nt(e,i)),r=i.removeFromSet(r);for(let e=a.length-1;e>=0;e--)this.step(a[e])}return this}split(e,t=1,n){return en(this,e,t,n),this}addMark(e,t,n){return Lt(this,e,t,n),this}removeMark(e,t,n){return Rt(this,e,t,n),this}clearIncompatible(e,t,n){return zt(this,e,t,n),this}},On=Object.create(null),N=class{constructor(e,t,n){this.$anchor=e,this.$head=t,this.ranges=n||[new kn(e.min(t),e.max(t))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,t=A.empty){let n=t.content.lastChild,r=null;for(let e=0;e<t.openEnd;e++)r=n,n=n.lastChild;let i=e.steps.length,a=this.ranges;for(let o=0;o<a.length;o++){let{$from:s,$to:c}=a[o],l=e.mapping.slice(i);e.replaceRange(l.map(s.pos),l.map(c.pos),o?A.empty:t),o==0&&Ln(e,i,(n?n.isInline:r&&r.isTextblock)?-1:1)}}replaceWith(e,t){let n=e.steps.length,r=this.ranges;for(let i=0;i<r.length;i++){let{$from:a,$to:o}=r[i],s=e.mapping.slice(n),c=s.map(a.pos),l=s.map(o.pos);i?e.deleteRange(c,l):(e.replaceRangeWith(c,l,t),Ln(e,n,t.isInline?-1:1))}}static findFrom(e,t,n=!1){let r=e.parent.inlineContent?new P(e):In(e.node(0),e.parent,e.pos,e.index(),t,n);if(r)return r;for(let r=e.depth-1;r>=0;r--){let i=t<0?In(e.node(0),e.node(r),e.before(r+1),e.index(r),t,n):In(e.node(0),e.node(r),e.after(r+1),e.index(r)+1,t,n);if(i)return i}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new Pn(e.node(0))}static atStart(e){return In(e,e,0,0,1)||new Pn(e)}static atEnd(e){return In(e,e,e.content.size,e.childCount,-1)||new Pn(e)}static fromJSON(e,t){if(!t||!t.type)throw RangeError(`Invalid input for Selection.fromJSON`);let n=On[t.type];if(!n)throw RangeError(`No selection type ${t.type} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in On)throw RangeError(`Duplicate use of selection JSON ID `+e);return On[e]=t,t.prototype.jsonID=e,t}getBookmark(){return P.between(this.$anchor,this.$head).getBookmark()}};N.prototype.visible=!0;var kn=class{constructor(e,t){this.$from=e,this.$to=t}},An=!1;function jn(e){!An&&!e.parent.inlineContent&&(An=!0,console.warn(`TextSelection endpoint not pointing into a node with inline content (`+e.parent.type.name+`)`))}var P=class e extends N{constructor(e,t=e){jn(e),jn(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,n){let r=t.resolve(n.map(this.head));if(!r.parent.inlineContent)return N.near(r);let i=t.resolve(n.map(this.anchor));return new e(i.parent.inlineContent?i:r,r)}replace(e,t=A.empty){if(super.replace(e,t),t==A.empty){let t=this.$from.marksAcross(this.$to);t&&e.ensureMarks(t)}}eq(t){return t instanceof e&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new Mn(this.anchor,this.head)}toJSON(){return{type:`text`,anchor:this.anchor,head:this.head}}static fromJSON(t,n){if(typeof n.anchor!=`number`||typeof n.head!=`number`)throw RangeError(`Invalid input for TextSelection.fromJSON`);return new e(t.resolve(n.anchor),t.resolve(n.head))}static create(e,t,n=t){let r=e.resolve(t);return new this(r,n==t?r:e.resolve(n))}static between(t,n,r){let i=t.pos-n.pos;if((!r||i)&&(r=i>=0?1:-1),!n.parent.inlineContent){let e=N.findFrom(n,r,!0)||N.findFrom(n,-r,!0);if(e)n=e.$head;else return N.near(n,r)}return t.parent.inlineContent||(i==0?t=n:(t=(N.findFrom(t,-r,!0)||N.findFrom(t,r,!0)).$anchor,t.pos<n.pos!=i<0&&(t=n))),new e(t,n)}};N.jsonID(`text`,P);var Mn=class e{constructor(e,t){this.anchor=e,this.head=t}map(t){return new e(t.map(this.anchor),t.map(this.head))}resolve(e){return P.between(e.resolve(this.anchor),e.resolve(this.head))}},F=class e extends N{constructor(e){let t=e.nodeAfter,n=e.node(0).resolve(e.pos+t.nodeSize);super(e,n),this.node=t}map(t,n){let{deleted:r,pos:i}=n.mapResult(this.anchor),a=t.resolve(i);return r?N.near(a):new e(a)}content(){return new A(E.from(this.node),0,0)}eq(t){return t instanceof e&&t.anchor==this.anchor}toJSON(){return{type:`node`,anchor:this.anchor}}getBookmark(){return new Nn(this.anchor)}static fromJSON(t,n){if(typeof n.anchor!=`number`)throw RangeError(`Invalid input for NodeSelection.fromJSON`);return new e(t.resolve(n.anchor))}static create(t,n){return new e(t.resolve(n))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}};F.prototype.visible=!1,N.jsonID(`node`,F);var Nn=class e{constructor(e){this.anchor=e}map(t){let{deleted:n,pos:r}=t.mapResult(this.anchor);return n?new Mn(r,r):new e(r)}resolve(e){let t=e.resolve(this.anchor),n=t.nodeAfter;return n&&F.isSelectable(n)?new F(t):N.near(t)}},Pn=class e extends N{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=A.empty){if(t==A.empty){e.delete(0,e.doc.content.size);let t=N.atStart(e.doc);t.eq(e.selection)||e.setSelection(t)}else super.replace(e,t)}toJSON(){return{type:`all`}}static fromJSON(t){return new e(t)}map(t){return new e(t)}eq(t){return t instanceof e}getBookmark(){return Fn}};N.jsonID(`all`,Pn);var Fn={map(){return this},resolve(e){return new Pn(e)}};function In(e,t,n,r,i,a=!1){if(t.inlineContent)return P.create(e,n);for(let o=r-(i>0?0:1);i>0?o<t.childCount:o>=0;o+=i){let r=t.child(o);if(!r.isAtom){let t=In(e,r,n+i,i<0?r.childCount:0,i,a);if(t)return t}else if(!a&&F.isSelectable(r))return F.create(e,n-(i<0?r.nodeSize:0));n+=r.nodeSize*i}return null}function Ln(e,t,n){let r=e.steps.length-1;if(r<t)return;let i=e.steps[r];if(!(i instanceof Pt||i instanceof Ft))return;let a=e.mapping.maps[r],o;a.forEach((e,t,n,r)=>{o??=r}),e.setSelection(N.near(e.doc.resolve(o),n))}var Rn=1,zn=2,Bn=4,Vn=class extends Dn{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw RangeError(`Selection passed to setSelection must point at the current document`);return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(this.updated|Rn)&-3,this.storedMarks=null,this}get selectionSet(){return(this.updated&Rn)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=zn,this}ensureMarks(e){return k.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&zn)>0}addStep(e,t){super.addStep(e,t),this.updated&=-3,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,t=!0){let n=this.selection;return t&&(e=e.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||k.none))),n.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,n){let r=this.doc.type.schema;if(t==null)return e?this.replaceSelectionWith(r.text(e),!0):this.deleteSelection();{if(n??=t,!e)return this.deleteRange(t,n);let i=this.storedMarks;if(!i){let e=this.doc.resolve(t);i=n==t?e.marks():e.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(t,n,r.text(e,i)),!this.selection.empty&&this.selection.to==t+e.length&&this.setSelection(N.near(this.selection.$to)),this}}setMeta(e,t){return this.meta[typeof e==`string`?e:e.key]=t,this}getMeta(e){return this.meta[typeof e==`string`?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=Bn,this}get scrolledIntoView(){return(this.updated&Bn)>0}};function Hn(e,t){return!t||!e?e:e.bind(t)}var Un=class{constructor(e,t,n){this.name=e,this.init=Hn(t.init,n),this.apply=Hn(t.apply,n)}},Wn=[new Un(`doc`,{init(e){return e.doc||e.schema.topNodeType.createAndFill()},apply(e){return e.doc}}),new Un(`selection`,{init(e,t){return e.selection||N.atStart(t.doc)},apply(e){return e.selection}}),new Un(`storedMarks`,{init(e){return e.storedMarks||null},apply(e,t,n,r){return r.selection.$cursor?e.storedMarks:null}}),new Un(`scrollToSelection`,{init(){return 0},apply(e,t){return e.scrolledIntoView?t+1:t}})],Gn=class{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=Wn.slice(),t&&t.forEach(e=>{if(this.pluginsByKey[e.key])throw RangeError(`Adding different instances of a keyed plugin (`+e.key+`)`);this.plugins.push(e),this.pluginsByKey[e.key]=e,e.spec.state&&this.fields.push(new Un(e.key,e.spec.state,e))})}},Kn=class e{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,t=-1){for(let n=0;n<this.config.plugins.length;n++)if(n!=t){let t=this.config.plugins[n];if(t.spec.filterTransaction&&!t.spec.filterTransaction.call(t,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let t=[e],n=this.applyInner(e),r=null;for(;;){let i=!1;for(let a=0;a<this.config.plugins.length;a++){let o=this.config.plugins[a];if(o.spec.appendTransaction){let s=r?r[a].n:0,c=r?r[a].state:this,l=s<t.length&&o.spec.appendTransaction.call(o,s?t.slice(s):t,c,n);if(l&&n.filterTransaction(l,a)){if(l.setMeta(`appendedTransaction`,e),!r){r=[];for(let e=0;e<this.config.plugins.length;e++)r.push(e<a?{state:n,n:t.length}:{state:this,n:0})}t.push(l),n=n.applyInner(l),i=!0}r&&(r[a]={state:n,n:t.length})}}if(!i)return{state:n,transactions:t}}}applyInner(t){if(!t.before.eq(this.doc))throw RangeError(`Applying a mismatched transaction`);let n=new e(this.config),r=this.config.fields;for(let e=0;e<r.length;e++){let i=r[e];n[i.name]=i.apply(t,this[i.name],this,n)}return n}get tr(){return new Vn(this)}static create(t){let n=new Gn(t.doc?t.doc.type.schema:t.schema,t.plugins),r=new e(n);for(let e=0;e<n.fields.length;e++)r[n.fields[e].name]=n.fields[e].init(t,r);return r}reconfigure(t){let n=new Gn(this.schema,t.plugins),r=n.fields,i=new e(n);for(let e=0;e<r.length;e++){let n=r[e].name;i[n]=this.hasOwnProperty(n)?this[n]:r[e].init(t,i)}return i}toJSON(e){let t={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(t.storedMarks=this.storedMarks.map(e=>e.toJSON())),e&&typeof e==`object`)for(let n in e){if(n==`doc`||n==`selection`)throw RangeError("The JSON fields `doc` and `selection` are reserved");let r=e[n],i=r.spec.state;i&&i.toJSON&&(t[n]=i.toJSON.call(r,this[r.key]))}return t}static fromJSON(t,n,r){if(!n)throw RangeError(`Invalid input for EditorState.fromJSON`);if(!t.schema)throw RangeError(`Required config field 'schema' missing`);let i=new Gn(t.schema,t.plugins),a=new e(i);return i.fields.forEach(e=>{if(e.name==`doc`)a.doc=ve.fromJSON(t.schema,n.doc);else if(e.name==`selection`)a.selection=N.fromJSON(a.doc,n.selection);else if(e.name==`storedMarks`)n.storedMarks&&(a.storedMarks=n.storedMarks.map(t.schema.markFromJSON));else{if(r)for(let i in r){let o=r[i],s=o.spec.state;if(o.key==e.name&&s&&s.fromJSON&&Object.prototype.hasOwnProperty.call(n,i)){a[e.name]=s.fromJSON.call(o,t,n[i],a);return}}a[e.name]=e.init(t,a)}}),a}};function qn(e,t,n){for(let r in e){let i=e[r];i instanceof Function?i=i.bind(t):r==`handleDOMEvents`&&(i=qn(i,t,{})),n[r]=i}return n}var Jn=class{constructor(e){this.spec=e,this.props={},e.props&&qn(e.props,this,this.props),this.key=e.key?e.key.key:Xn(`plugin`)}getState(e){return e[this.key]}},Yn=Object.create(null);function Xn(e){return e in Yn?e+`$`+ ++Yn[e]:(Yn[e]=0,e+`$`)}var Zn=class{constructor(e=`key`){this.key=Xn(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}},Qn=(e,t)=>e.selection.empty?!1:(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function $n(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock(`backward`,e):n.parentOffset>0)?null:n}var er=(e,t,n)=>{let r=$n(e,n);if(!r)return!1;let i=or(r);if(!i){let n=r.blockRange(),i=n&&Vt(n);return i==null?!1:(t&&t(e.tr.lift(n,i).scrollIntoView()),!0)}let a=i.nodeBefore;if(wr(e,i,t,-1))return!0;if(r.parent.content.size==0&&(ir(a,`end`)||F.isSelectable(a)))for(let n=r.depth;;n--){let o=ln(e.doc,r.before(n),r.after(n),A.empty);if(o&&o.slice.size<o.to-o.from){if(t){let n=e.tr.step(o);n.setSelection(ir(a,`end`)?N.findFrom(n.doc.resolve(n.mapping.map(i.pos,-1)),-1):F.create(n.doc,i.pos-a.nodeSize)),t(n.scrollIntoView())}return!0}if(n==1||r.node(n-1).childCount>1)break}return a.isAtom&&i.depth==r.depth-1?(t&&t(e.tr.delete(i.pos-a.nodeSize,i.pos).scrollIntoView()),!0):!1},tr=(e,t,n)=>{let r=$n(e,n);if(!r)return!1;let i=or(r);return i?rr(e,i,t):!1},nr=(e,t,n)=>{let r=sr(e,n);if(!r)return!1;let i=ur(r);return i?rr(e,i,t):!1};function rr(e,t,n){let r=t.nodeBefore,i=t.pos-1;for(;!r.isTextblock;i--){if(r.type.spec.isolating)return!1;let e=r.lastChild;if(!e)return!1;r=e}let a=t.nodeAfter,o=t.pos+1;for(;!a.isTextblock;o++){if(a.type.spec.isolating)return!1;let e=a.firstChild;if(!e)return!1;a=e}let s=ln(e.doc,i,o,A.empty);if(!s||s.from!=i||s instanceof Pt&&s.slice.size>=o-i)return!1;if(n){let t=e.tr.step(s);t.setSelection(P.create(t.doc,i)),n(t.scrollIntoView())}return!0}function ir(e,t,n=!1){for(let r=e;r;r=t==`start`?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}var ar=(e,t,n)=>{let{$head:r,empty:i}=e.selection,a=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock(`backward`,e):r.parentOffset>0)return!1;a=or(r)}let o=a&&a.nodeBefore;return!o||!F.isSelectable(o)?!1:(t&&t(e.tr.setSelection(F.create(e.doc,a.pos-o.nodeSize)).scrollIntoView()),!0)};function or(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function sr(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock(`forward`,e):n.parentOffset<n.parent.content.size)?null:n}var cr=(e,t,n)=>{let r=sr(e,n);if(!r)return!1;let i=ur(r);if(!i)return!1;let a=i.nodeAfter;if(wr(e,i,t,1))return!0;if(r.parent.content.size==0&&(ir(a,`start`)||F.isSelectable(a))){let n=ln(e.doc,r.before(),r.after(),A.empty);if(n&&n.slice.size<n.to-n.from){if(t){let r=e.tr.step(n);r.setSelection(ir(a,`start`)?N.findFrom(r.doc.resolve(r.mapping.map(i.pos)),1):F.create(r.doc,r.mapping.map(i.pos))),t(r.scrollIntoView())}return!0}}return a.isAtom&&i.depth==r.depth-1?(t&&t(e.tr.delete(i.pos,i.pos+a.nodeSize).scrollIntoView()),!0):!1},lr=(e,t,n)=>{let{$head:r,empty:i}=e.selection,a=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock(`forward`,e):r.parentOffset<r.parent.content.size)return!1;a=ur(r)}let o=a&&a.nodeAfter;return!o||!F.isSelectable(o)?!1:(t&&t(e.tr.setSelection(F.create(e.doc,a.pos)).scrollIntoView()),!0)};function ur(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){let n=e.node(t);if(e.index(t)+1<n.childCount)return e.doc.resolve(e.after(t+1));if(n.type.spec.isolating)break}return null}var dr=(e,t)=>{let n=e.selection,r=n instanceof F,i;if(r){if(n.node.isTextblock||!tn(e.doc,n.from))return!1;i=n.from}else if(i=an(e.doc,n.from,-1),i==null)return!1;if(t){let n=e.tr.join(i);r&&n.setSelection(F.create(n.doc,i-e.doc.resolve(i).nodeBefore.nodeSize)),t(n.scrollIntoView())}return!0},fr=(e,t)=>{let n=e.selection,r;if(n instanceof F){if(n.node.isTextblock||!tn(e.doc,n.to))return!1;r=n.to}else if(r=an(e.doc,n.to,1),r==null)return!1;return t&&t(e.tr.join(r).scrollIntoView()),!0},pr=(e,t)=>{let{$from:n,$to:r}=e.selection,i=n.blockRange(r),a=i&&Vt(i);return a==null?!1:(t&&t(e.tr.lift(i,a).scrollIntoView()),!0)},mr=(e,t)=>{let{$head:n,$anchor:r}=e.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(t&&t(e.tr.insertText(`
|
|
33
|
+
`).scrollIntoView()),!0)};function hr(e){for(let t=0;t<e.edgeCount;t++){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}var gr=(e,t)=>{let{$head:n,$anchor:r}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),a=n.indexAfter(-1),o=hr(i.contentMatchAt(a));if(!o||!i.canReplaceWith(a,a,o))return!1;if(t){let r=n.after(),i=e.tr.replaceWith(r,r,o.createAndFill());i.setSelection(N.near(i.doc.resolve(r),1)),t(i.scrollIntoView())}return!0},_r=(e,t)=>{let n=e.selection,{$from:r,$to:i}=n;if(n instanceof Pn||r.parent.inlineContent||i.parent.inlineContent)return!1;let a=hr(i.parent.contentMatchAt(i.indexAfter()));if(!a||!a.isTextblock)return!1;if(t){let n=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,o=e.tr.insert(n,a.createAndFill());o.setSelection(P.create(o.doc,n+1)),t(o.scrollIntoView())}return!0},vr=(e,t)=>{let{$cursor:n}=e.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let r=n.before();if($t(e.doc,r))return t&&t(e.tr.split(r).scrollIntoView()),!0}let r=n.blockRange(),i=r&&Vt(r);return i==null?!1:(t&&t(e.tr.lift(r,i).scrollIntoView()),!0)};function yr(e){return(t,n)=>{let{$from:r,$to:i}=t.selection;if(t.selection instanceof F&&t.selection.node.isBlock)return!r.parentOffset||!$t(t.doc,r.pos)?!1:(n&&n(t.tr.split(r.pos).scrollIntoView()),!0);if(!r.depth)return!1;let a=[],o,s,c=!1,l=!1;for(let t=r.depth;;t--)if(r.node(t).isBlock){c=r.end(t)==r.pos+(r.depth-t),l=r.start(t)==r.pos-(r.depth-t),s=hr(r.node(t-1).contentMatchAt(r.indexAfter(t-1)));let n=e&&e(i.parent,c,r);a.unshift(n||(c&&s?{type:s}:null)),o=t;break}else{if(t==1)return!1;a.unshift(null)}let u=t.tr;(t.selection instanceof P||t.selection instanceof Pn)&&u.deleteSelection();let d=u.mapping.map(r.pos),f=$t(u.doc,d,a.length,a);if(f||=(a[0]=s?{type:s}:null,$t(u.doc,d,a.length,a)),!f)return!1;if(u.split(d,a.length,a),!c&&l&&r.node(o).type!=s){let e=u.mapping.map(r.before(o)),t=u.doc.resolve(e);s&&r.node(o-1).canReplaceWith(t.index(),t.index()+1,s)&&u.setNodeMarkup(u.mapping.map(r.before(o)),s)}return n&&n(u.scrollIntoView()),!0}}var br=yr(),xr=(e,t)=>{let{$from:n,to:r}=e.selection,i,a=n.sharedDepth(r);return a==0?!1:(i=n.before(a),t&&t(e.tr.setSelection(F.create(e.doc,i))),!0)},Sr=(e,t)=>(t&&t(e.tr.setSelection(new Pn(e.doc))),!0);function Cr(e,t,n){let r=t.nodeBefore,i=t.nodeAfter,a=t.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&t.parent.canReplace(a-1,a)?(n&&n(e.tr.delete(t.pos-r.nodeSize,t.pos).scrollIntoView()),!0):!t.parent.canReplace(a,a+1)||!(i.isTextblock||tn(e.doc,t.pos))?!1:(n&&n(e.tr.join(t.pos).scrollIntoView()),!0)}function wr(e,t,n,r){let i=t.nodeBefore,a=t.nodeAfter,o,s,c=i.type.spec.isolating||a.type.spec.isolating;if(!c&&Cr(e,t,n))return!0;let l=!c&&t.parent.canReplace(t.index(),t.index()+1);if(l&&(o=(s=i.contentMatchAt(i.childCount)).findWrapping(a.type))&&s.matchType(o[0]||a.type).validEnd){if(n){let r=t.pos+a.nodeSize,s=E.empty;for(let e=o.length-1;e>=0;e--)s=E.from(o[e].create(null,s));s=E.from(i.copy(s));let c=e.tr.step(new Ft(t.pos-1,r,t.pos,r,new A(s,1,0),o.length,!0)),l=c.doc.resolve(r+2*o.length);l.nodeAfter&&l.nodeAfter.type==i.type&&tn(c.doc,l.pos)&&c.join(l.pos),n(c.scrollIntoView())}return!0}let u=a.type.spec.isolating||r>0&&c?null:N.findFrom(t,1),d=u&&u.$from.blockRange(u.$to),f=d&&Vt(d);if(f!=null&&f>=t.depth)return n&&n(e.tr.lift(d,f).scrollIntoView()),!0;if(l&&ir(a,`start`,!0)&&ir(i,`end`)){let r=i,o=[];for(;o.push(r),!r.isTextblock;)r=r.lastChild;let s=a,c=1;for(;!s.isTextblock;s=s.firstChild)c++;if(r.canReplace(r.childCount,r.childCount,s.content)){if(n){let r=E.empty;for(let e=o.length-1;e>=0;e--)r=E.from(o[e].copy(r));n(e.tr.step(new Ft(t.pos-o.length,t.pos+a.nodeSize,t.pos+c,t.pos+a.nodeSize-c,new A(r,o.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function Tr(e){return function(t,n){let r=t.selection,i=e<0?r.$from:r.$to,a=i.depth;for(;i.node(a).isInline;){if(!a)return!1;a--}return i.node(a).isTextblock?(n&&n(t.tr.setSelection(P.create(t.doc,e<0?i.start(a):i.end(a)))),!0):!1}}var Er=Tr(-1),Dr=Tr(1);function Or(e,t=null){return function(n,r){let{$from:i,$to:a}=n.selection,o=i.blockRange(a),s=o&&Ut(o,e,t);return s?(r&&r(n.tr.wrap(o,s).scrollIntoView()),!0):!1}}function kr(e,t=null){return function(n,r){let i=!1;for(let r=0;r<n.selection.ranges.length&&!i;r++){let{$from:{pos:a},$to:{pos:o}}=n.selection.ranges[r];n.doc.nodesBetween(a,o,(r,a)=>{if(i)return!1;if(!(!r.isTextblock||r.hasMarkup(e,t)))if(r.type==e)i=!0;else{let t=n.doc.resolve(a),r=t.index();i=t.parent.canReplaceWith(r,r+1,e)}})}if(!i)return!1;if(r){let i=n.tr;for(let r=0;r<n.selection.ranges.length;r++){let{$from:{pos:a},$to:{pos:o}}=n.selection.ranges[r];i.setBlockType(a,o,e,t)}r(i.scrollIntoView())}return!0}}function Ar(...e){return function(t,n,r){for(let i=0;i<e.length;i++)if(e[i](t,n,r))return!0;return!1}}var jr=Ar(Qn,er,ar),Mr=Ar(Qn,cr,lr),Nr={Enter:Ar(mr,_r,vr,br),"Mod-Enter":gr,Backspace:jr,"Mod-Backspace":jr,"Shift-Backspace":jr,Delete:Mr,"Mod-Delete":Mr,"Mod-a":Sr},Pr={"Ctrl-h":Nr.Backspace,"Alt-Backspace":Nr[`Mod-Backspace`],"Ctrl-d":Nr.Delete,"Ctrl-Alt-Backspace":Nr[`Mod-Delete`],"Alt-Delete":Nr[`Mod-Delete`],"Alt-d":Nr[`Mod-Delete`],"Ctrl-a":Er,"Ctrl-e":Dr};for(let e in Nr)Pr[e]=Nr[e];typeof navigator<`u`?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<`u`&&os.platform&&os.platform();function Fr(e,t=null){return function(n,r){let{$from:i,$to:a}=n.selection,o=i.blockRange(a);if(!o)return!1;let s=r?n.tr:null;return Ir(s,o,e,t)?(r&&r(s.scrollIntoView()),!0):!1}}function Ir(e,t,n,r=null){let i=!1,a=t,o=t.$from.doc;if(t.depth>=2&&t.$from.node(t.depth-1).type.compatibleContent(n)&&t.startIndex==0){if(t.$from.index(t.depth-1)==0)return!1;let e=o.resolve(t.start-2);a=new ge(e,e,t.depth),t.endIndex<t.parent.childCount&&(t=new ge(t.$from,o.resolve(t.$to.end(t.depth)),t.depth)),i=!0}let s=Ut(a,n,r,t);return s?(e&&Lr(e,t,s,i,n),!0):!1}function Lr(e,t,n,r,i){let a=E.empty;for(let e=n.length-1;e>=0;e--)a=E.from(n[e].type.create(n[e].attrs,a));e.step(new Ft(t.start-(r?2:0),t.end,t.start,t.end,new A(a,0,0),n.length,!0));let o=0;for(let e=0;e<n.length;e++)n[e].type==i&&(o=e+1);let s=n.length-o,c=t.start+n.length-(r?2:0),l=t.parent;for(let n=t.startIndex,r=t.endIndex,i=!0;n<r;n++,i=!1)!i&&$t(e.doc,c,s)&&(e.split(c,s),c+=2*s),c+=l.child(n).nodeSize;return e}function Rr(e){return function(t,n){let{$from:r,$to:i}=t.selection,a=r.blockRange(i,t=>t.childCount>0&&t.firstChild.type==e);return a?n?r.node(a.depth-1).type==e?zr(t,n,e,a):Br(t,n,a):!0:!1}}function zr(e,t,n,r){let i=e.tr,a=r.end,o=r.$to.end(r.depth);a<o&&(i.step(new Ft(a-1,o,a,o,new A(E.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new ge(i.doc.resolve(r.$from.pos),i.doc.resolve(o),r.depth));let s=Vt(r);if(s==null)return!1;i.lift(r,s);let c=i.doc.resolve(i.mapping.map(a,-1)-1);return tn(i.doc,c.pos)&&c.nodeBefore.type==c.nodeAfter.type&&i.join(c.pos),t(i.scrollIntoView()),!0}function Br(e,t,n){let r=e.tr,i=n.parent;for(let e=n.end,t=n.endIndex-1,a=n.startIndex;t>a;t--)e-=i.child(t).nodeSize,r.delete(e-1,e+1);let a=r.doc.resolve(n.start),o=a.nodeAfter;if(r.mapping.map(n.end)!=n.start+a.nodeAfter.nodeSize)return!1;let s=n.startIndex==0,c=n.endIndex==i.childCount,l=a.node(-1),u=a.index(-1);if(!l.canReplace(u+ +!s,u+1,o.content.append(c?E.empty:E.from(i))))return!1;let d=a.pos,f=d+o.nodeSize;return r.step(new Ft(d-+!!s,f+ +!!c,d+1,f-1,new A((s?E.empty:E.from(i.copy(E.empty))).append(c?E.empty:E.from(i.copy(E.empty))),+!s,+!c),+!s)),t(r.scrollIntoView()),!0}function Vr(e){return function(t,n){let{$from:r,$to:i}=t.selection,a=r.blockRange(i,t=>t.childCount>0&&t.firstChild.type==e);if(!a)return!1;let o=a.startIndex;if(o==0)return!1;let s=a.parent,c=s.child(o-1);if(c.type!=e)return!1;if(n){let r=c.lastChild&&c.lastChild.type==s.type,i=E.from(r?e.create():null),o=new A(E.from(e.create(null,E.from(s.type.create(null,i)))),r?3:1,0),l=a.start,u=a.end;n(t.tr.step(new Ft(l-(r?3:1),u,l,u,o,1,!0)).scrollIntoView())}return!0}}var Hr=function(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t},Ur=function(e){let t=e.assignedSlot||e.parentNode;return t&&t.nodeType==11?t.host:t},Wr=null,Gr=function(e,t,n){let r=Wr||=document.createRange();return r.setEnd(e,n??e.nodeValue.length),r.setStart(e,t||0),r},Kr=function(){Wr=null},qr=function(e,t,n,r){return n&&(Yr(e,t,n,r,-1)||Yr(e,t,n,r,1))},Jr=/^(img|br|input|textarea|hr)$/i;function Yr(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:Xr(e))){let n=e.parentNode;if(!n||n.nodeType!=1||ei(e)||Jr.test(e.nodeName)||e.contentEditable==`false`)return!1;t=Hr(e)+(i<0?0:1),e=n}else if(e.nodeType==1){let n=e.childNodes[t+(i<0?-1:0)];if(n.nodeType==1&&n.contentEditable==`false`)if(n.pmViewDesc?.ignoreForSelection)t+=i;else return!1;else e=n,t=i<0?Xr(e):0}else return!1}}function Xr(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function Zr(e,t){for(;;){if(e.nodeType==3&&t)return e;if(e.nodeType==1&&t>0){if(e.contentEditable==`false`)return null;e=e.childNodes[t-1],t=Xr(e)}else if(e.parentNode&&!ei(e))t=Hr(e),e=e.parentNode;else return null}}function Qr(e,t){for(;;){if(e.nodeType==3&&t<e.nodeValue.length)return e;if(e.nodeType==1&&t<e.childNodes.length){if(e.contentEditable==`false`)return null;e=e.childNodes[t],t=0}else if(e.parentNode&&!ei(e))t=Hr(e)+1,e=e.parentNode;else return null}}function $r(e,t,n){for(let r=t==0,i=t==Xr(e);r||i;){if(e==n)return!0;let t=Hr(e);if(e=e.parentNode,!e)return!1;r&&=t==0,i&&=t==Xr(e)}}function ei(e){let t;for(let n=e;n&&!(t=n.pmViewDesc);n=n.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}var ti=function(e){return e.focusNode&&qr(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function ni(e,t){let n=document.createEvent(`Event`);return n.initEvent(`keydown`,!0,!0),n.keyCode=e,n.key=n.code=t,n}function ri(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}function ii(e,t,n){if(e.caretPositionFromPoint)try{let r=e.caretPositionFromPoint(t,n);if(r)return{node:r.offsetNode,offset:Math.min(Xr(r.offsetNode),r.offset)}}catch{}if(e.caretRangeFromPoint){let r=e.caretRangeFromPoint(t,n);if(r)return{node:r.startContainer,offset:Math.min(Xr(r.startContainer),r.startOffset)}}}var ai=typeof navigator<`u`?navigator:null,oi=typeof document<`u`?document:null,si=ai&&ai.userAgent||``,ci=/Edge\/(\d+)/.exec(si),li=/MSIE \d/.exec(si),ui=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(si),di=!!(li||ui||ci),fi=li?document.documentMode:ui?+ui[1]:ci?+ci[1]:0,pi=!di&&/gecko\/(\d+)/i.test(si);pi&&+(/Firefox\/(\d+)/.exec(si)||[0,0])[1];var mi=!di&&/Chrome\/(\d+)/.exec(si),hi=!!mi,gi=mi?+mi[1]:0,_i=!di&&!!ai&&/Apple Computer/.test(ai.vendor),vi=_i&&(/Mobile\/\w+/.test(si)||!!ai&&ai.maxTouchPoints>2),yi=vi||(ai?/Mac/.test(ai.platform):!1),bi=ai?/Win/.test(ai.platform):!1,xi=/Android \d/.test(si),Si=!!oi&&`webkitFontSmoothing`in oi.documentElement.style,Ci=Si?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function wi(e){let t=e.defaultView&&e.defaultView.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function Ti(e,t){return typeof e==`number`?e:e[t]}function Ei(e){let t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,r=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*n,top:t.top,bottom:t.top+e.clientHeight*r}}function Di(e,t,n){let r=e.someProp(`scrollThreshold`)||0,i=e.someProp(`scrollMargin`)||5,a=e.dom.ownerDocument;for(let o=n||e.dom;o;){if(o.nodeType!=1){o=Ur(o);continue}let e=o,n=e==a.body,s=n?wi(a):Ei(e),c=0,l=0;if(t.top<s.top+Ti(r,`top`)?l=-(s.top-t.top+Ti(i,`top`)):t.bottom>s.bottom-Ti(r,`bottom`)&&(l=t.bottom-t.top>s.bottom-s.top?t.top+Ti(i,`top`)-s.top:t.bottom-s.bottom+Ti(i,`bottom`)),t.left<s.left+Ti(r,`left`)?c=-(s.left-t.left+Ti(i,`left`)):t.right>s.right-Ti(r,`right`)&&(c=t.right-s.right+Ti(i,`right`)),c||l)if(n)a.defaultView.scrollBy(c,l);else{let n=e.scrollLeft,r=e.scrollTop;l&&(e.scrollTop+=l),c&&(e.scrollLeft+=c);let i=e.scrollLeft-n,a=e.scrollTop-r;t={left:t.left-i,top:t.top-a,right:t.right-i,bottom:t.bottom-a}}let u=n?`fixed`:getComputedStyle(o).position;if(/^(fixed|sticky)$/.test(u))break;o=u==`absolute`?o.offsetParent:Ur(o)}}function Oi(e){let t=e.dom.getBoundingClientRect(),n=Math.max(0,t.top),r,i;for(let a=(t.left+t.right)/2,o=n+1;o<Math.min(innerHeight,t.bottom);o+=5){let t=e.root.elementFromPoint(a,o);if(!t||t==e.dom||!e.dom.contains(t))continue;let s=t.getBoundingClientRect();if(s.top>=n-20){r=t,i=s.top;break}}return{refDOM:r,refTop:i,stack:ki(e.dom)}}function ki(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=Ur(r));return t}function Ai({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;ji(n,r==0?0:r-t)}function ji(e,t){for(let n=0;n<e.length;n++){let{dom:r,top:i,left:a}=e[n];r.scrollTop!=i+t&&(r.scrollTop=i+t),r.scrollLeft!=a&&(r.scrollLeft=a)}}var Mi=null;function Ni(e){if(e.setActive)return e.setActive();if(Mi)return e.focus(Mi);let t=ki(e);e.focus(Mi==null?{get preventScroll(){return Mi={preventScroll:!0},!0}}:void 0),Mi||(Mi=!1,ji(t,0))}function Pi(e,t){let n,r=2e8,i,a=0,o=t.top,s=t.top,c,l;for(let u=e.firstChild,d=0;u;u=u.nextSibling,d++){let e;if(u.nodeType==1)e=u.getClientRects();else if(u.nodeType==3)e=Gr(u).getClientRects();else continue;for(let f=0;f<e.length;f++){let p=e[f];if(p.top<=o&&p.bottom>=s){o=Math.max(p.bottom,o),s=Math.min(p.top,s);let e=p.left>t.left?p.left-t.left:p.right<t.left?t.left-p.right:0;if(e<r){n=u,r=e,i=e&&n.nodeType==3?{left:p.right<t.left?p.right:p.left,top:t.top}:t,u.nodeType==1&&e&&(a=d+ +(t.left>=(p.left+p.right)/2));continue}}else p.top>t.top&&!c&&p.left<=t.left&&p.right>=t.left&&(c=u,l={left:Math.max(p.left,Math.min(p.right,t.left)),top:p.top});!n&&(t.left>=p.right&&t.top>=p.top||t.left>=p.left&&t.top>=p.bottom)&&(a=d+1)}}return!n&&c&&(n=c,i=l,r=0),n&&n.nodeType==3?Fi(n,i):!n||r&&n.nodeType==1?{node:e,offset:a}:Pi(n,i)}function Fi(e,t){let n=e.nodeValue.length,r=document.createRange(),i;for(let a=0;a<n;a++){r.setEnd(e,a+1),r.setStart(e,a);let n=Hi(r,1);if(n.top!=n.bottom&&Ii(t,n)){i={node:e,offset:a+ +(t.left>=(n.left+n.right)/2)};break}}return r.detach(),i||{node:e,offset:0}}function Ii(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function Li(e,t){let n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left<e.getBoundingClientRect().left?n:e}function I(e,t,n){let{node:r,offset:i}=Pi(t,n),a=-1;if(r.nodeType==1&&!r.firstChild){let e=r.getBoundingClientRect();a=e.left!=e.right&&n.left>(e.left+e.right)/2?1:-1}return e.docView.posFromDOM(r,i,a)}function Ri(e,t,n,r){let i=-1;for(let n=t,a=!1;n!=e.dom;){let t=e.docView.nearestDesc(n,!0),o;if(!t)return null;if(t.dom.nodeType==1&&(t.node.isBlock&&t.parent||!t.contentDOM)&&((o=t.dom.getBoundingClientRect()).width||o.height)&&(t.node.isBlock&&t.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(t.dom.nodeName)&&(!a&&o.left>r.left||o.top>r.top?i=t.posBefore:(!a&&o.right<r.left||o.bottom<r.top)&&(i=t.posAfter),a=!0),!t.contentDOM&&i<0&&!t.node.isText))return(t.node.isBlock?r.top<(o.top+o.bottom)/2:r.left<(o.left+o.right)/2)?t.posBefore:t.posAfter;n=t.dom.parentNode}return i>-1?i:e.docView.posFromDOM(t,n,-1)}function zi(e,t,n){let r=e.childNodes.length;if(r&&n.top<n.bottom)for(let i=Math.max(0,Math.min(r-1,Math.floor(r*(t.top-n.top)/(n.bottom-n.top))-2)),a=i;;){let n=e.childNodes[a];if(n.nodeType==1){let e=n.getClientRects();for(let r=0;r<e.length;r++){let i=e[r];if(Ii(t,i))return zi(n,t,i)}}if((a=(a+1)%r)==i)break}return e}function Bi(e,t){let n=e.dom.ownerDocument,r,i=0,a=ii(n,t.left,t.top);a&&({node:r,offset:i}=a);let o=(e.root.elementFromPoint?e.root:n).elementFromPoint(t.left,t.top),s;if(!o||!e.dom.contains(o.nodeType==1?o:o.parentNode)){let n=e.dom.getBoundingClientRect();if(!Ii(t,n)||(o=zi(e.dom,t,n),!o))return null}if(_i)for(let e=o;r&&e;e=Ur(e))e.draggable&&(r=void 0);if(o=Li(o,t),r){if(pi&&r.nodeType==1&&(i=Math.min(i,r.childNodes.length),i<r.childNodes.length)){let e=r.childNodes[i],n;e.nodeName==`IMG`&&(n=e.getBoundingClientRect()).right<=t.left&&n.bottom>t.top&&i++}let n;Si&&i&&r.nodeType==1&&(n=r.childNodes[i-1]).nodeType==1&&n.contentEditable==`false`&&n.getBoundingClientRect().top>=t.top&&i--,r==e.dom&&i==r.childNodes.length-1&&r.lastChild.nodeType==1&&t.top>r.lastChild.getBoundingClientRect().bottom?s=e.state.doc.content.size:(i==0||r.nodeType!=1||r.childNodes[i-1].nodeName!=`BR`)&&(s=Ri(e,r,i,t))}s??=I(e,o,t);let c=e.docView.nearestDesc(o,!0);return{pos:s,inside:c?c.posAtStart-c.border:-1}}function Vi(e){return e.top<e.bottom||e.left<e.right}function Hi(e,t){let n=e.getClientRects();if(n.length){let e=n[t<0?0:n.length-1];if(Vi(e))return e}return Array.prototype.find.call(n,Vi)||e.getBoundingClientRect()}var Ui=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function Wi(e,t,n){let{node:r,offset:i,atom:a}=e.docView.domFromPos(t,n<0?-1:1),o=Si||pi;if(r.nodeType==3)if(o&&(Ui.test(r.nodeValue)||(n<0?!i:i==r.nodeValue.length))){let e=Hi(Gr(r,i,i),n);if(pi&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let t=Hi(Gr(r,i-1,i-1),-1);if(t.top==e.top){let n=Hi(Gr(r,i,i+1),-1);if(n.top!=e.top)return Gi(n,n.left<t.left)}}return e}else{let e=i,t=i,a=n<0?1:-1;return n<0&&!i?(t++,a=-1):n>=0&&i==r.nodeValue.length?(e--,a=1):n<0?e--:t++,Gi(Hi(Gr(r,e,t),a),a<0)}if(!e.state.doc.resolve(t-(a||0)).parent.inlineContent){if(a==null&&i&&(n<0||i==Xr(r))){let e=r.childNodes[i-1];if(e.nodeType==1)return Ki(e.getBoundingClientRect(),!1)}if(a==null&&i<Xr(r)){let e=r.childNodes[i];if(e.nodeType==1)return Ki(e.getBoundingClientRect(),!0)}return Ki(r.getBoundingClientRect(),n>=0)}if(a==null&&i&&(n<0||i==Xr(r))){let e=r.childNodes[i-1],t=e.nodeType==3?Gr(e,Xr(e)-+!o):e.nodeType==1&&(e.nodeName!=`BR`||!e.nextSibling)?e:null;if(t)return Gi(Hi(t,1),!1)}if(a==null&&i<Xr(r)){let e=r.childNodes[i];for(;e.pmViewDesc&&e.pmViewDesc.ignoreForCoords;)e=e.nextSibling;let t=e?e.nodeType==3?Gr(e,0,+!o):e.nodeType==1?e:null:null;if(t)return Gi(Hi(t,-1),!0)}return Gi(Hi(r.nodeType==3?Gr(r):r,-n),n>=0)}function Gi(e,t){if(e.width==0)return e;let n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n}}function Ki(e,t){if(e.height==0)return e;let n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right}}function qi(e,t,n){let r=e.state,i=e.root.activeElement;r!=t&&e.updateState(t),i!=e.dom&&e.focus();try{return n()}finally{r!=t&&e.updateState(r),i!=e.dom&&i&&i.focus()}}function Ji(e,t,n){let r=t.selection,i=n==`up`?r.$from:r.$to;return qi(e,t,()=>{let{node:t}=e.docView.domFromPos(i.pos,n==`up`?-1:1);for(;;){let n=e.docView.nearestDesc(t,!0);if(!n)break;if(n.node.isBlock){t=n.contentDOM||n.dom;break}t=n.dom.parentNode}let r=Wi(e,i.pos,1);for(let e=t.firstChild;e;e=e.nextSibling){let t;if(e.nodeType==1)t=e.getClientRects();else if(e.nodeType==3)t=Gr(e,0,e.nodeValue.length).getClientRects();else continue;for(let e=0;e<t.length;e++){let i=t[e];if(i.bottom>i.top+1&&(n==`up`?r.top-i.top>(i.bottom-r.top)*2:i.bottom-r.bottom>(r.bottom-i.top)*2))return!1}}return!0})}var Yi=/[\u0590-\u08ac]/;function Xi(e,t,n){let{$head:r}=t.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,a=!i,o=i==r.parent.content.size,s=e.domSelection();return s?!Yi.test(r.parent.textContent)||!s.modify?n==`left`||n==`backward`?a:o:qi(e,t,()=>{let{focusNode:t,focusOffset:i,anchorNode:a,anchorOffset:o}=e.domSelectionRange(),c=s.caretBidiLevel;s.modify(`move`,n,`character`);let l=r.depth?e.docView.domAfterPos(r.before()):e.dom,{focusNode:u,focusOffset:d}=e.domSelectionRange(),f=u&&!l.contains(u.nodeType==1?u:u.parentNode)||t==u&&i==d;try{s.collapse(a,o),t&&(t!=a||i!=o)&&s.extend&&s.extend(t,i)}catch{}return c!=null&&(s.caretBidiLevel=c),f}):r.pos==r.start()||r.pos==r.end()}var Zi=null,Qi=null,$i=!1;function ea(e,t,n){return Zi==t&&Qi==n?$i:(Zi=t,Qi=n,$i=n==`up`||n==`down`?Ji(e,t,n):Xi(e,t,n))}var ta=0,na=1,ra=2,ia=3,aa=class{constructor(e,t,n,r){this.parent=e,this.children=t,this.dom=n,this.contentDOM=r,this.dirty=ta,n.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,n){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let t=0;t<this.children.length;t++)e+=this.children[t].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let t=0,n=this.posAtStart;;t++){let r=this.children[t];if(r==e)return n;n+=r.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,t,n){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode))if(n<0){let n,r;if(e==this.contentDOM)n=e.childNodes[t-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.previousSibling}for(;n&&!((r=n.pmViewDesc)&&r.parent==this);)n=n.previousSibling;return n?this.posBeforeChild(r)+r.size:this.posAtStart}else{let n,r;if(e==this.contentDOM)n=e.childNodes[t];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.nextSibling}for(;n&&!((r=n.pmViewDesc)&&r.parent==this);)n=n.nextSibling;return n?this.posBeforeChild(r):this.posAtEnd}let r;if(e==this.dom&&this.contentDOM)r=t>Hr(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))r=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(t==0)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!1;break}if(t.previousSibling)break}if(r==null&&t==e.childNodes.length)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!0;break}if(t.nextSibling)break}}return r??n>0?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let n=!0,r=e;r;r=r.parentNode){let i=this.getDesc(r),a;if(i&&(!t||i.node))if(n&&(a=i.nodeDOM)&&!(a.nodeType==1?a.contains(e.nodeType==1?e:e.parentNode):a==e))n=!1;else return i}}getDesc(e){let t=e.pmViewDesc;for(let e=t;e;e=e.parent)if(e==this)return t}posFromDOM(e,t,n){for(let r=e;r;r=r.parentNode){let i=this.getDesc(r);if(i)return i.localPosFromDOM(e,t,n)}return-1}descAt(e){for(let t=0,n=0;t<this.children.length;t++){let r=this.children[t],i=n+r.size;if(n==e&&i!=n){for(;!r.border&&r.children.length;)for(let e=0;e<r.children.length;e++){let t=r.children[e];if(t.size){r=t;break}}return r}if(e<i)return r.descAt(e-n-r.border);n=i}}domFromPos(e,t){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let n=0,r=0;for(let t=0;n<this.children.length;n++){let i=this.children[n],a=t+i.size;if(a>e||i instanceof fa){r=e-t;break}t=a}if(r)return this.children[n].domFromPos(r-this.children[n].border,t);for(let e;n&&!(e=this.children[n-1]).size&&e instanceof oa&&e.side>=0;n--);if(t<=0){let e,r=!0;for(;e=n?this.children[n-1]:null,!(!e||e.dom.parentNode==this.contentDOM);n--,r=!1);return e&&t&&r&&!e.border&&!e.domAtom?e.domFromPos(e.size,t):{node:this.contentDOM,offset:e?Hr(e.dom)+1:0}}else{let e,r=!0;for(;e=n<this.children.length?this.children[n]:null,!(!e||e.dom.parentNode==this.contentDOM);n++,r=!1);return e&&r&&!e.border&&!e.domAtom?e.domFromPos(0,t):{node:this.contentDOM,offset:e?Hr(e.dom):this.contentDOM.childNodes.length}}}parseRange(e,t,n=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:t,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let r=-1,i=-1;for(let a=n,o=0;;o++){let n=this.children[o],s=a+n.size;if(r==-1&&e<=s){let i=a+n.border;if(e>=i&&t<=s-n.border&&n.node&&n.contentDOM&&this.contentDOM.contains(n.contentDOM))return n.parseRange(e,t,i);e=a;for(let t=o;t>0;t--){let n=this.children[t-1];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(1)){r=Hr(n.dom)+1;break}e-=n.size}r==-1&&(r=0)}if(r>-1&&(s>t||o==this.children.length-1)){t=s;for(let e=o+1;e<this.children.length;e++){let n=this.children[e];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(-1)){i=Hr(n.dom);break}t+=n.size}i==-1&&(i=this.contentDOM.childNodes.length);break}a=s}return{node:this.contentDOM,from:e,to:t,fromOffset:r,toOffset:i}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let t=this.children[e<0?0:this.children.length-1];return t.size==0||t.emptyChildAt(e)}domAfterPos(e){let{node:t,offset:n}=this.domFromPos(e,0);if(t.nodeType!=1||n==t.childNodes.length)throw RangeError(`No node after pos `+e);return t.childNodes[n]}setSelection(e,t,n,r=!1){let i=Math.min(e,t),a=Math.max(e,t);for(let o=0,s=0;o<this.children.length;o++){let c=this.children[o],l=s+c.size;if(i>s&&a<l)return c.setSelection(e-s-c.border,t-s-c.border,n,r);s=l}let o=this.domFromPos(e,e?-1:1),s=t==e?o:this.domFromPos(t,t?-1:1),c=n.root.getSelection(),l=n.domSelectionRange(),u=!1;if((pi||_i)&&e==t){let{node:e,offset:t}=o;if(e.nodeType==3){if(u=!!(t&&e.nodeValue[t-1]==`
|
|
34
|
+
`),u&&t==e.nodeValue.length)for(let t=e,n;t;t=t.parentNode){if(n=t.nextSibling){n.nodeName==`BR`&&(o=s={node:n.parentNode,offset:Hr(n)+1});break}let e=t.pmViewDesc;if(e&&e.node&&e.node.isBlock)break}}else{let n=e.childNodes[t-1];u=n&&(n.nodeName==`BR`||n.contentEditable==`false`)}}if(pi&&l.focusNode&&l.focusNode!=s.node&&l.focusNode.nodeType==1){let e=l.focusNode.childNodes[l.focusOffset];e&&e.contentEditable==`false`&&(r=!0)}if(!(r||u&&_i)&&qr(o.node,o.offset,l.anchorNode,l.anchorOffset)&&qr(s.node,s.offset,l.focusNode,l.focusOffset))return;let d=!1;if((c.extend||e==t)&&!(u&&pi)){c.collapse(o.node,o.offset);try{e!=t&&c.extend(s.node,s.offset),d=!0}catch{}}if(!d){if(e>t){let e=o;o=s,s=e}let n=document.createRange();n.setEnd(s.node,s.offset),n.setStart(o.node,o.offset),c.removeAllRanges(),c.addRange(n)}}ignoreMutation(e){return!this.contentDOM&&e.type!=`selection`}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,t){for(let n=0,r=0;r<this.children.length;r++){let i=this.children[r],a=n+i.size;if(n==a?e<=a&&t>=n:e<a&&t>n){let r=n+i.border,o=a-i.border;if(e>=r&&t<=o){this.dirty=e==n||t==a?ra:na,e==r&&t==o&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=ia:i.markDirty(e-r,t-r);return}else i.dirty=i.dom==i.contentDOM&&i.dom.parentNode==this.contentDOM&&!i.children.length?ra:ia}n=a}this.dirty=ra}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let n=e==1?ra:na;t.dirty<n&&(t.dirty=n)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}},oa=class extends aa{constructor(e,t,n,r){let i,a=t.type.toDOM;if(typeof a==`function`&&(a=a(n,()=>{if(!i)return r;if(i.parent)return i.parent.posBeforeChild(i)})),!t.type.spec.raw){if(a.nodeType!=1){let e=document.createElement(`span`);e.appendChild(a),a=e}a.contentEditable=`false`,a.classList.add(`ProseMirror-widget`)}super(e,[],a,null),this.widget=t,this.widget=t,i=this}matchesWidget(e){return this.dirty==ta&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let t=this.widget.spec.stopEvent;return t?t(e):!1}ignoreMutation(e){return e.type!=`selection`||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}},sa=class extends aa{constructor(e,t,n,r){super(e,[],t,null),this.textDOM=n,this.text=r}get size(){return this.text.length}localPosFromDOM(e,t){return e==this.textDOM?this.posAtStart+t:this.posAtStart+(t?this.size:0)}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type===`characterData`&&e.target.nodeValue==e.oldValue}},ca=class e extends aa{constructor(e,t,n,r,i){super(e,[],n,r),this.mark=t,this.spec=i}static create(t,n,r,i){let a=i.nodeViews[n.type.name],o=a&&a(n,i,r);return(!o||!o.dom)&&(o=st.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new e(t,n,o.dom,o.contentDOM||o.dom,o)}parseRule(){return this.dirty&ia||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=ia&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),this.dirty!=ta){let e=this.parent;for(;!e.node;)e=e.parent;e.dirty<this.dirty&&(e.dirty=this.dirty),this.dirty=ta}}slice(t,n,r){let i=e.create(this.parent,this.mark,!0,r),a=this.children,o=this.size;n<o&&(a=ka(a,n,o,r)),t>0&&(a=ka(a,0,t,r));for(let e=0;e<a.length;e++)a[e].parent=i;return i.children=a,i}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}},la=class e extends aa{constructor(e,t,n,r,i,a,o,s,c){super(e,[],i,a),this.node=t,this.outerDeco=n,this.innerDeco=r,this.nodeDOM=o}static create(t,n,r,i,a,o){let s=a.nodeViews[n.type.name],c,l=s&&s(n,a,()=>{if(!c)return o;if(c.parent)return c.parent.posBeforeChild(c)},r,i),u=l&&l.dom,d=l&&l.contentDOM;if(n.isText){if(!u)u=document.createTextNode(n.text);else if(u.nodeType!=3)throw RangeError(`Text must be rendered as a DOM text node`)}else if(!u){let e=st.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs);({dom:u,contentDOM:d}=e)}!d&&!n.isText&&u.nodeName!=`BR`&&(u.hasAttribute(`contenteditable`)||(u.contentEditable=`false`),n.type.spec.draggable&&(u.draggable=!0));let f=u;return u=ba(u,r,n),l?c=new pa(t,n,r,i,u,d||null,f,l,a,o+1):n.isText?new da(t,n,r,i,u,f,a):new e(t,n,r,i,u,d||null,f,a,o+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace==`pre`&&(e.preserveWhitespace=`full`),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let t=this.children.length-1;t>=0;t--){let n=this.children[t];if(this.dom.contains(n.dom.parentNode)){e.contentElement=n.dom.parentNode;break}}e.contentElement||(e.getContent=()=>E.empty)}return e}matchesNode(e,t,n){return this.dirty==ta&&e.eq(this.node)&&xa(t,this.outerDeco)&&n.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return+!this.node.isLeaf}updateChildren(e,t){let n=this.node.inlineContent,r=t,i=e.composing?this.localCompositionInfo(e,t):null,a=i&&i.pos>-1?i:null,o=i&&i.pos<0,s=new Ca(this,a&&a.node,e);Ea(this.node,this.innerDeco,(t,i,a)=>{t.spec.marks?s.syncToMarks(t.spec.marks,n,e,i):t.type.side>=0&&!a&&s.syncToMarks(i==this.node.childCount?k.none:this.node.child(i).marks,n,e,i),s.placeWidget(t,e,r)},(t,a,c,l)=>{s.syncToMarks(t.marks,n,e,l);let u;s.findNodeMatch(t,a,c,l)||o&&e.state.selection.from>r&&e.state.selection.to<r+t.nodeSize&&(u=s.findIndexWithChild(i.node))>-1&&s.updateNodeAt(t,a,c,u,e)||s.updateNextNode(t,a,c,e,l,r)||s.addNode(t,a,c,e,r),r+=t.nodeSize}),s.syncToMarks([],n,e,0),this.node.isTextblock&&s.addTextblockHacks(),s.destroyRest(),(s.changed||this.dirty==ra)&&(a&&this.protectLocalComposition(e,a),ma(this.contentDOM,this.children,e),vi&&Da(this.dom))}localCompositionInfo(e,t){let{from:n,to:r}=e.state.selection;if(!(e.state.selection instanceof P)||n<t||r>t+this.node.content.size)return null;let i=e.input.compositionNode;if(!i||!this.dom.contains(i.parentNode))return null;if(this.node.inlineContent){let e=i.nodeValue,a=Oa(this.node.content,e,n-t,r-t);return a<0?null:{node:i,pos:a,text:e}}else return{node:i,pos:-1,text:``}}protectLocalComposition(e,{node:t,pos:n,text:r}){if(this.getDesc(t))return;let i=t;for(;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&=void 0}let a=new sa(this,i,t,r);e.input.compositionNodes.push(a),this.children=ka(this.children,n,n+r.length,e,a)}update(e,t,n,r){return this.dirty==ia||!e.sameMarkup(this.node)?!1:(this.updateInner(e,t,n,r),!0)}updateInner(e,t,n,r){this.updateOuterDeco(t),this.node=e,this.innerDeco=n,this.contentDOM&&this.updateChildren(r,this.posAtStart),this.dirty=ta}updateOuterDeco(e){if(xa(e,this.outerDeco))return;let t=this.nodeDOM.nodeType!=1,n=this.dom;this.dom=va(this.dom,this.nodeDOM,_a(this.outerDeco,this.node,t),_a(e,this.node,t)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.add(`ProseMirror-selectednode`),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove(`ProseMirror-selectednode`),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute(`draggable`))}get domAtom(){return this.node.isAtom}};function ua(e,t,n,r,i){ba(r,t,e);let a=new la(void 0,e,t,n,r,r,r,i,0);return a.contentDOM&&a.updateChildren(i,0),a}var da=class e extends la{constructor(e,t,n,r,i,a,o){super(e,t,n,r,i,null,a,o,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,t,n,r){return this.dirty==ia||this.dirty!=ta&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(t),(this.dirty!=ta||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,r.trackWrites==this.nodeDOM&&(r.trackWrites=null)),this.node=e,this.dirty=ta,!0)}inParent(){let e=this.parent.contentDOM;for(let t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,t,n){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):super.localPosFromDOM(e,t,n)}ignoreMutation(e){return e.type!=`characterData`&&e.type!=`selection`}slice(t,n,r){let i=this.node.cut(t,n),a=document.createTextNode(i.text);return new e(this.parent,i,this.outerDeco,this.innerDeco,a,a,r)}markDirty(e,t){super.markDirty(e,t),this.dom!=this.nodeDOM&&(e==0||t==this.nodeDOM.nodeValue.length)&&(this.dirty=ia)}get domAtom(){return!1}isText(e){return this.node.text==e}},fa=class extends aa{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==ta&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName==`IMG`}},pa=class extends la{constructor(e,t,n,r,i,a,o,s,c,l){super(e,t,n,r,i,a,o,c,l),this.spec=s}update(e,t,n,r){if(this.dirty==ia)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let i=this.spec.update(e,t,n);return i&&this.updateInner(e,t,n,r),i}else if(!this.contentDOM&&!e.isLeaf)return!1;else return super.update(e,t,n,r)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,t,n,r){this.spec.setSelection?this.spec.setSelection(e,t,n.root):super.setSelection(e,t,n,r)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}};function ma(e,t,n){let r=e.firstChild,i=!1;for(let a=0;a<t.length;a++){let o=t[a],s=o.dom;if(s.parentNode==e){for(;s!=r;)r=Sa(r),i=!0;r=r.nextSibling}else i=!0,e.insertBefore(s,r);if(o instanceof ca){let t=r?r.previousSibling:e.lastChild;ma(o.contentDOM,o.children,n),r=t?t.nextSibling:e.firstChild}}for(;r;)r=Sa(r),i=!0;i&&n.trackWrites==e&&(n.trackWrites=null)}var ha=function(e){e&&(this.nodeName=e)};ha.prototype=Object.create(null);var ga=[new ha];function _a(e,t,n){if(e.length==0)return ga;let r=n?ga[0]:new ha,i=[r];for(let a=0;a<e.length;a++){let o=e[a].type.attrs;if(o){o.nodeName&&i.push(r=new ha(o.nodeName));for(let e in o){let a=o[e];a!=null&&(n&&i.length==1&&i.push(r=new ha(t.isInline?`span`:`div`)),e==`class`?r.class=(r.class?r.class+` `:``)+a:e==`style`?r.style=(r.style?r.style+`;`:``)+a:e!=`nodeName`&&(r[e]=a))}}}return i}function va(e,t,n,r){if(n==ga&&r==ga)return t;let i=t;for(let t=0;t<r.length;t++){let a=r[t],o=n[t];if(t){let t;o&&o.nodeName==a.nodeName&&i!=e&&(t=i.parentNode)&&t.nodeName.toLowerCase()==a.nodeName?i=t:(t=document.createElement(a.nodeName),t.pmIsDeco=!0,t.appendChild(i),o=ga[0],i=t)}ya(i,o||ga[0],a)}return i}function ya(e,t,n){for(let r in t)r!=`class`&&r!=`style`&&r!=`nodeName`&&!(r in n)&&e.removeAttribute(r);for(let r in n)r!=`class`&&r!=`style`&&r!=`nodeName`&&n[r]!=t[r]&&e.setAttribute(r,n[r]);if(t.class!=n.class){let r=t.class?t.class.split(` `).filter(Boolean):[],i=n.class?n.class.split(` `).filter(Boolean):[];for(let t=0;t<r.length;t++)i.indexOf(r[t])==-1&&e.classList.remove(r[t]);for(let t=0;t<i.length;t++)r.indexOf(i[t])==-1&&e.classList.add(i[t]);e.classList.length==0&&e.removeAttribute(`class`)}if(t.style!=n.style){if(t.style){let n=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,r;for(;r=n.exec(t.style);)e.style.removeProperty(r[1])}n.style&&(e.style.cssText+=n.style)}}function ba(e,t,n){return va(e,e,ga,_a(t,n,e.nodeType!=1))}function xa(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].type.eq(t[n].type))return!1;return!0}function Sa(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}var Ca=class{constructor(e,t,n){this.lock=t,this.view=n,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=wa(e.node.content,e)}destroyBetween(e,t){if(e!=t){for(let n=e;n<t;n++)this.top.children[n].destroy();this.top.children.splice(e,t-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,t,n,r){let i=0,a=this.stack.length>>1,o=Math.min(a,e.length);for(;i<o&&(i==a-1?this.top:this.stack[i+1<<1]).matchesMark(e[i])&&e[i].type.spec.spanning!==!1;)i++;for(;i<a;)this.destroyRest(),this.top.dirty=ta,this.index=this.stack.pop(),this.top=this.stack.pop(),a--;for(;a<e.length;){this.stack.push(this.top,this.index+1);let i=-1,o=this.top.children.length;r<this.preMatch.index&&(o=Math.min(this.index+3,o));for(let t=this.index;t<o;t++){let n=this.top.children[t];if(n.matchesMark(e[a])&&!this.isLocked(n.dom)){i=t;break}}if(i>-1)i>this.index&&(this.changed=!0,this.destroyBetween(this.index,i)),this.top=this.top.children[this.index];else{let r=ca.create(this.top,e[a],t,n);this.top.children.splice(this.index,0,r),this.top=r,this.changed=!0}this.index=0,a++}}findNodeMatch(e,t,n,r){let i=-1,a;if(r>=this.preMatch.index&&(a=this.preMatch.matches[r-this.preMatch.index]).parent==this.top&&a.matchesNode(e,t,n))i=this.top.children.indexOf(a,this.index);else for(let r=this.index,a=Math.min(this.top.children.length,r+5);r<a;r++){let a=this.top.children[r];if(a.matchesNode(e,t,n)&&!this.preMatch.matched.has(a)){i=r;break}}return i<0?!1:(this.destroyBetween(this.index,i),this.index++,!0)}updateNodeAt(e,t,n,r,i){let a=this.top.children[r];return a.dirty==ia&&a.dom==a.contentDOM&&(a.dirty=ra),a.update(e,t,n,i)?(this.destroyBetween(this.index,r),this.index++,!0):!1}findIndexWithChild(e){for(;;){let t=e.parentNode;if(!t)return-1;if(t==this.top.contentDOM){let t=e.pmViewDesc;if(t){for(let e=this.index;e<this.top.children.length;e++)if(this.top.children[e]==t)return e}return-1}e=t}}updateNextNode(e,t,n,r,i,a){for(let o=this.index;o<this.top.children.length;o++){let s=this.top.children[o];if(s instanceof la){let c=this.preMatch.matched.get(s);if(c!=null&&c!=i)return!1;let l=s.dom,u,d=this.isLocked(l)&&!(e.isText&&s.node&&s.node.isText&&s.nodeDOM.nodeValue==e.text&&s.dirty!=ia&&xa(t,s.outerDeco));if(!d&&s.update(e,t,n,r))return this.destroyBetween(this.index,o),s.dom!=l&&(this.changed=!0),this.index++,!0;if(!d&&(u=this.recreateWrapper(s,e,t,n,r,a)))return this.destroyBetween(this.index,o),this.top.children[this.index]=u,u.contentDOM&&(u.dirty=ra,u.updateChildren(r,a+1),u.dirty=ta),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,t,n,r,i,a){if(e.dirty||t.isAtom||!e.children.length||!e.node.content.eq(t.content)||!xa(n,e.outerDeco)||!r.eq(e.innerDeco))return null;let o=la.create(this.top,t,n,r,i,a);if(o.contentDOM){o.children=e.children,e.children=[];for(let e of o.children)e.parent=o}return e.destroy(),o}addNode(e,t,n,r,i){let a=la.create(this.top,e,t,n,r,i);a.contentDOM&&a.updateChildren(r,i+1),this.top.children.splice(this.index++,0,a),this.changed=!0}placeWidget(e,t,n){let r=this.index<this.top.children.length?this.top.children[this.index]:null;if(r&&r.matchesWidget(e)&&(e==r.widget||!r.widget.type.toDOM.parentNode))this.index++;else{let r=new oa(this.top,e,t,n);this.top.children.splice(this.index++,0,r),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],t=this.top;for(;e instanceof ca;)t=e,e=t.children[t.children.length-1];(!e||!(e instanceof da)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((_i||hi)&&e&&e.dom.contentEditable==`false`&&this.addHackNode(`IMG`,t),this.addHackNode(`BR`,this.top))}addHackNode(e,t){if(t==this.top&&this.index<t.children.length&&t.children[this.index].matchesHack(e))this.index++;else{let n=document.createElement(e);e==`IMG`&&(n.className=`ProseMirror-separator`,n.alt=``),e==`BR`&&(n.className=`ProseMirror-trailingBreak`);let r=new fa(this.top,[],n,null);t==this.top?t.children.splice(this.index++,0,r):t.children.push(r),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||e.nodeType==1&&e.contains(this.lock.parentNode))}};function wa(e,t){let n=t,r=n.children.length,i=e.childCount,a=new Map,o=[];outer:for(;i>0;){let s;for(;;)if(r){let e=n.children[r-1];if(e instanceof ca)n=e,r=e.children.length;else{s=e,r--;break}}else if(n==t)break outer;else r=n.parent.children.indexOf(n),n=n.parent;let c=s.node;if(c){if(c!=e.child(i-1))break;--i,a.set(s,i),o.push(s)}}return{index:i,matched:a,matches:o.reverse()}}function Ta(e,t){return e.type.side-t.type.side}function Ea(e,t,n,r){let i=t.locals(e),a=0;if(i.length==0){for(let n=0;n<e.childCount;n++){let o=e.child(n);r(o,i,t.forChild(a,o),n),a+=o.nodeSize}return}let o=0,s=[],c=null;for(let l=0;;){let u,d;for(;o<i.length&&i[o].to==a;){let e=i[o++];e.widget&&(u?(d||=[u]).push(e):u=e)}if(u)if(d){d.sort(Ta);for(let e=0;e<d.length;e++)n(d[e],l,!!c)}else n(u,l,!!c);let f,p;if(c)p=-1,f=c,c=null;else if(l<e.childCount)p=l,f=e.child(l++);else break;for(let e=0;e<s.length;e++)s[e].to<=a&&s.splice(e--,1);for(;o<i.length&&i[o].from<=a&&i[o].to>a;)s.push(i[o++]);let m=a+f.nodeSize;if(f.isText){let e=m;o<i.length&&i[o].from<e&&(e=i[o].from);for(let t=0;t<s.length;t++)s[t].to<e&&(e=s[t].to);e<m&&(c=f.cut(e-a),f=f.cut(0,e-a),m=e,p=-1)}else for(;o<i.length&&i[o].to<m;)o++;let h=f.isInline&&!f.isLeaf?s.filter(e=>!e.inline):s.slice();r(f,h,t.forChild(a,f),p),a=m}}function Da(e){if(e.nodeName==`UL`||e.nodeName==`OL`){let t=e.style.cssText;e.style.cssText=t+`; list-style: square !important`,window.getComputedStyle(e).listStyle,e.style.cssText=t}}function Oa(e,t,n,r){for(let i=0,a=0;i<e.childCount&&a<=r;){let o=e.child(i++),s=a;if(a+=o.nodeSize,!o.isText)continue;let c=o.text;for(;i<e.childCount;){let t=e.child(i++);if(a+=t.nodeSize,!t.isText)break;c+=t.text}if(a>=n){if(a>=r&&c.slice(r-t.length-s,r-s)==t)return r-t.length;let e=s<r?c.lastIndexOf(t,r-s-1):-1;if(e>=0&&e+t.length+s>=n)return s+e;if(n==r&&c.length>=r+t.length-s&&c.slice(r-s,r-s+t.length)==t)return r}}return-1}function ka(e,t,n,r,i){let a=[];for(let o=0,s=0;o<e.length;o++){let c=e[o],l=s,u=s+=c.size;l>=n||u<=t?a.push(c):(l<t&&a.push(c.slice(0,t-l,r)),i&&=(a.push(i),void 0),u>n&&a.push(c.slice(n-l,c.size,r)))}return a}function Aa(e,t=null){let n=e.domSelectionRange(),r=e.state.doc;if(!n.focusNode)return null;let i=e.docView.nearestDesc(n.focusNode),a=i&&i.size==0,o=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(o<0)return null;let s=r.resolve(o),c,l;if(ti(n)){for(c=o;i&&!i.node;)i=i.parent;let e=i.node;if(i&&e.isAtom&&F.isSelectable(e)&&i.parent&&!(e.isInline&&$r(n.focusNode,n.focusOffset,i.dom))){let e=i.posBefore;l=new F(o==e?s:r.resolve(e))}}else{if(n instanceof e.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let t=o,i=o;for(let r=0;r<n.rangeCount;r++){let a=n.getRangeAt(r);t=Math.min(t,e.docView.posFromDOM(a.startContainer,a.startOffset,1)),i=Math.max(i,e.docView.posFromDOM(a.endContainer,a.endOffset,-1))}if(t<0)return null;[c,o]=i==e.state.selection.anchor?[i,t]:[t,i],s=r.resolve(o)}else c=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(c<0)return null}let u=r.resolve(c);if(!l){let n=t==`pointer`||e.state.selection.head<s.pos&&!a?1:-1;l=Va(e,u,s,n)}return l}function ja(e){return e.editable?e.hasFocus():Ua(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function Ma(e,t=!1){let n=e.state.selection;if(za(e,n),!ja(e))return;let r=e.input.mouseDown;if(!t&&hi&&r){let t=e.domSelectionRange(),n=e.domObserver.currentSelection;if(t.anchorNode&&n.anchorNode&&qr(t.anchorNode,t.anchorOffset,n.anchorNode,n.anchorOffset)&&r.delaySelUpdate()){e.domObserver.setCurSelection();return}}if(e.domObserver.disconnectSelection(),e.cursorWrapper)Ra(e);else{let{anchor:r,head:i}=n,a,o;Na&&!(n instanceof P)&&(n.$from.parent.inlineContent||(a=Pa(e,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(o=Pa(e,n.to))),e.docView.setSelection(r,i,e,t),Na&&(a&&Ia(a),o&&Ia(o)),n.visible?e.dom.classList.remove(`ProseMirror-hideselection`):(e.dom.classList.add(`ProseMirror-hideselection`),`onselectionchange`in document&&La(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}var Na=_i||hi&&gi<63;function Pa(e,t){let{node:n,offset:r}=e.docView.domFromPos(t,0),i=r<n.childNodes.length?n.childNodes[r]:null,a=r?n.childNodes[r-1]:null;if(_i&&i&&i.contentEditable==`false`)return Fa(i);if((!i||i.contentEditable==`false`)&&(!a||a.contentEditable==`false`)){if(i)return Fa(i);if(a)return Fa(a)}}function Fa(e){return e.contentEditable=`true`,_i&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function Ia(e){e.contentEditable=`false`,e.wasDraggable&&=(e.draggable=!0,null)}function La(e){let t=e.dom.ownerDocument;t.removeEventListener(`selectionchange`,e.input.hideSelectionGuard);let n=e.domSelectionRange(),r=n.anchorNode,i=n.anchorOffset;t.addEventListener(`selectionchange`,e.input.hideSelectionGuard=()=>{(n.anchorNode!=r||n.anchorOffset!=i)&&(t.removeEventListener(`selectionchange`,e.input.hideSelectionGuard),setTimeout(()=>{(!ja(e)||e.state.selection.visible)&&e.dom.classList.remove(`ProseMirror-hideselection`)},20))})}function Ra(e){let t=e.domSelection();if(!t)return;let n=e.cursorWrapper.dom,r=n.nodeName==`IMG`;r?t.collapse(n.parentNode,Hr(n)+1):t.collapse(n,0),!r&&!e.state.selection.visible&&di&&fi<=11&&(n.disabled=!0,n.disabled=!1)}function za(e,t){if(t instanceof F){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(Ba(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else Ba(e)}function Ba(e){e.lastSelectedViewDesc&&=(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),void 0)}function Va(e,t,n,r){return e.someProp(`createSelectionBetween`,r=>r(e,t,n))||P.between(t,n,r)}function Ha(e){return e.editable&&!e.hasFocus()?!1:Ua(e)}function Ua(e){let t=e.domSelectionRange();if(!t.anchorNode)return!1;try{return e.dom.contains(t.anchorNode.nodeType==3?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(t.focusNode.nodeType==3?t.focusNode.parentNode:t.focusNode))}catch{return!1}}function Wa(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),n=e.domSelectionRange();return qr(t.node,t.offset,n.anchorNode,n.anchorOffset)}function Ga(e,t){let{$anchor:n,$head:r}=e.selection,i=t>0?n.max(r):n.min(r),a=i.parent.inlineContent?i.depth?e.doc.resolve(t>0?i.after():i.before()):null:i;return a&&N.findFrom(a,t)}function Ka(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function qa(e,t,n){let r=e.state.selection;if(r instanceof P){if(n.indexOf(`s`)>-1){let{$head:n}=r,i=n.textOffset?null:t<0?n.nodeBefore:n.nodeAfter;if(!i||i.isText||!i.isLeaf)return!1;let a=e.state.doc.resolve(n.pos+i.nodeSize*(t<0?-1:1));return Ka(e,new P(r.$anchor,a))}else if(!r.empty)return!1;else if(e.endOfTextblock(t>0?`forward`:`backward`)){let n=Ga(e.state,t);return n&&n instanceof F?Ka(e,n):!1}else if(!(yi&&n.indexOf(`m`)>-1)){let n=r.$head,i=n.textOffset?null:t<0?n.nodeBefore:n.nodeAfter,a;if(!i||i.isText)return!1;let o=t<0?n.pos-i.nodeSize:n.pos;return i.isAtom||(a=e.docView.descAt(o))&&!a.contentDOM?F.isSelectable(i)?Ka(e,new F(t<0?e.state.doc.resolve(n.pos-i.nodeSize):n)):Si?Ka(e,new P(e.state.doc.resolve(t<0?o:o+i.nodeSize))):!1:!1}}else if(r instanceof F&&r.node.isInline)return Ka(e,new P(t>0?r.$to:r.$from));else{let n=Ga(e.state,t);return n?Ka(e,n):!1}}function Ja(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function Ya(e,t){let n=e.pmViewDesc;return n&&n.size==0&&(t<0||e.nextSibling||e.nodeName!=`BR`)}function Xa(e,t){return t<0?Za(e):Qa(e)}function Za(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,a,o=!1;for(pi&&n.nodeType==1&&r<Ja(n)&&Ya(n.childNodes[r],-1)&&(o=!0);;)if(r>0){if(n.nodeType!=1)break;{let e=n.childNodes[r-1];if(Ya(e,-1))i=n,a=--r;else if(e.nodeType==3)n=e,r=n.nodeValue.length;else break}}else if($a(n))break;else{let t=n.previousSibling;for(;t&&Ya(t,-1);)i=n.parentNode,a=Hr(t),t=t.previousSibling;if(t)n=t,r=Ja(n);else{if(n=n.parentNode,n==e.dom)break;r=0}}o?no(e,n,r):i&&no(e,i,a)}function Qa(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i=Ja(n),a,o;for(;;)if(r<i){if(n.nodeType!=1)break;let e=n.childNodes[r];if(Ya(e,1))a=n,o=++r;else break}else if($a(n))break;else{let t=n.nextSibling;for(;t&&Ya(t,1);)a=t.parentNode,o=Hr(t)+1,t=t.nextSibling;if(t)n=t,r=0,i=Ja(n);else{if(n=n.parentNode,n==e.dom)break;r=i=0}}a&&no(e,a,o)}function $a(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function eo(e,t){for(;e&&t==e.childNodes.length&&!ei(e);)t=Hr(e)+1,e=e.parentNode;for(;e&&t<e.childNodes.length;){let n=e.childNodes[t];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable==`false`)break;e=n,t=0}}function to(e,t){for(;e&&!t&&!ei(e);)t=Hr(e),e=e.parentNode;for(;e&&t;){let n=e.childNodes[t-1];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable==`false`)break;e=n,t=e.childNodes.length}}function no(e,t,n){if(t.nodeType!=3){let e,r;(r=eo(t,n))?(t=r,n=0):(e=to(t,n))&&(t=e,n=e.nodeValue.length)}let r=e.domSelection();if(!r)return;if(ti(r)){let e=document.createRange();e.setEnd(t,n),e.setStart(t,n),r.removeAllRanges(),r.addRange(e)}else r.extend&&r.extend(t,n);e.domObserver.setCurSelection();let{state:i}=e;setTimeout(()=>{e.state==i&&Ma(e)},50)}function ro(e,t){let n=e.state.doc.resolve(t);if(!(hi||bi)&&n.parent.inlineContent){let r=e.coordsAtPos(t);if(t>n.start()){let n=e.coordsAtPos(t-1),i=(n.top+n.bottom)/2;if(i>r.top&&i<r.bottom&&Math.abs(n.left-r.left)>1)return n.left<r.left?`ltr`:`rtl`}if(t<n.end()){let n=e.coordsAtPos(t+1),i=(n.top+n.bottom)/2;if(i>r.top&&i<r.bottom&&Math.abs(n.left-r.left)>1)return n.left>r.left?`ltr`:`rtl`}}return getComputedStyle(e.dom).direction==`rtl`?`rtl`:`ltr`}function io(e,t,n){let r=e.state.selection;if(r instanceof P&&!r.empty||n.indexOf(`s`)>-1||yi&&n.indexOf(`m`)>-1)return!1;let{$from:i,$to:a}=r;if(!i.parent.inlineContent||e.endOfTextblock(t<0?`up`:`down`)){let n=Ga(e.state,t);if(n&&n instanceof F)return Ka(e,n)}if(!i.parent.inlineContent){let n=t<0?i:a,o=r instanceof Pn?N.near(n,t):N.findFrom(n,t);return o?Ka(e,o):!1}return!1}function ao(e,t){if(!(e.state.selection instanceof P))return!0;let{$head:n,$anchor:r,empty:i}=e.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(e.endOfTextblock(t>0?`forward`:`backward`))return!0;let a=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(a&&!a.isText){let r=e.state.tr;return t<0?r.delete(n.pos-a.nodeSize,n.pos):r.delete(n.pos,n.pos+a.nodeSize),e.dispatch(r),!0}return!1}function oo(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function so(e){if(!_i||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(t&&t.nodeType==1&&n==0&&t.firstChild&&t.firstChild.contentEditable==`false`){let n=t.firstChild;oo(e,n,`true`),setTimeout(()=>oo(e,n,`false`),20)}return!1}function co(e){let t=``;return e.ctrlKey&&(t+=`c`),e.metaKey&&(t+=`m`),e.altKey&&(t+=`a`),e.shiftKey&&(t+=`s`),t}function lo(e,t){let n=t.keyCode,r=co(t);if(n==8||yi&&n==72&&r==`c`)return ao(e,-1)||Xa(e,-1);if(n==46&&!t.shiftKey||yi&&n==68&&r==`c`)return ao(e,1)||Xa(e,1);if(n==13||n==27)return!0;if(n==37||yi&&n==66&&r==`c`){let t=n==37?ro(e,e.state.selection.from)==`ltr`?-1:1:-1;return qa(e,t,r)||Xa(e,t)}else if(n==39||yi&&n==70&&r==`c`){let t=n==39?ro(e,e.state.selection.from)==`ltr`?1:-1:1;return qa(e,t,r)||Xa(e,t)}else if(n==38||yi&&n==80&&r==`c`)return io(e,-1,r)||Xa(e,-1);else if(n==40||yi&&n==78&&r==`c`)return so(e)||io(e,1,r)||Xa(e,1);else if(r==(yi?`m`:`c`)&&(n==66||n==73||n==89||n==90))return!0;return!1}function uo(e,t){e.someProp(`transformCopied`,n=>{t=n(t,e)});let n=[],{content:r,openStart:i,openEnd:a}=t;for(;i>1&&a>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,a--;let e=r.firstChild;n.push(e.type.name,e.attrs==e.type.defaultAttrs?null:e.attrs),r=e.content}let o=e.someProp(`clipboardSerializer`)||st.fromSchema(e.state.schema),s=bo(),c=s.createElement(`div`);c.appendChild(o.serializeFragment(r,{document:s}));let l=c.firstChild,u,d=0;for(;l&&l.nodeType==1&&(u=vo[l.nodeName.toLowerCase()]);){for(let e=u.length-1;e>=0;e--){let t=s.createElement(u[e]);for(;c.firstChild;)t.appendChild(c.firstChild);c.appendChild(t),d++}l=c.firstChild}return l&&l.nodeType==1&&l.setAttribute(`data-pm-slice`,`${i} ${a}${d?` -${d}`:``} ${JSON.stringify(n)}`),{dom:c,text:e.someProp(`clipboardTextSerializer`,n=>n(t,e))||t.content.textBetween(0,t.content.size,`
|
|
35
|
+
|
|
36
|
+
`),slice:t}}function fo(e,t,n,r,i){let a=i.parent.type.spec.code,o,s;if(!n&&!t)return null;let c=!!t&&(r||a||!n);if(c){if(e.someProp(`transformPastedText`,n=>{t=n(t,a||r,e)}),a)return s=new A(E.from(e.state.schema.text(t.replace(/\r\n?/g,`
|
|
37
|
+
`))),0,0),e.someProp(`transformPasted`,t=>{s=t(s,e,!0)}),s;let n=e.someProp(`clipboardTextParser`,n=>n(t,i,r,e));if(n)s=n;else{let n=i.marks(),{schema:r}=e.state,a=st.fromSchema(r);o=document.createElement(`div`),t.split(/(?:\r\n?|\n)+/).forEach(e=>{let t=o.appendChild(document.createElement(`p`));e&&t.appendChild(a.serializeNode(r.text(e,n)))})}}else e.someProp(`transformPastedHTML`,t=>{n=t(n,e)}),o=Co(n),Si&&wo(o);let l=o&&o.querySelector(`[data-pm-slice]`),u=l&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(l.getAttribute(`data-pm-slice`)||``);if(u&&u[3])for(let e=+u[3];e>0;e--){let e=o.firstChild;for(;e&&e.nodeType!=1;)e=e.nextSibling;if(!e)break;o=e}if(s||=(e.someProp(`clipboardParser`)||e.someProp(`domParser`)||qe.fromSchema(e.state.schema)).parseSlice(o,{preserveWhitespace:!!(c||u),context:i,ruleFromNode(e){return e.nodeName==`BR`&&!e.nextSibling&&e.parentNode&&!po.test(e.parentNode.nodeName)?{ignore:!0}:null}}),u)s=To(_o(s,+u[1],+u[2]),u[4]);else if(s=A.maxOpen(mo(s.content,i),!0),s.openStart||s.openEnd){let e=0,t=0;for(let t=s.content.firstChild;e<s.openStart&&!t.type.spec.isolating;e++,t=t.firstChild);for(let e=s.content.lastChild;t<s.openEnd&&!e.type.spec.isolating;t++,e=e.lastChild);s=_o(s,e,t)}return e.someProp(`transformPasted`,t=>{s=t(s,e,c)}),s}var po=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function mo(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let r=t.node(n).contentMatchAt(t.index(n)),i,a=[];if(e.forEach(e=>{if(!a)return;let t=r.findWrapping(e.type),n;if(!t)return a=null;if(n=a.length&&i.length&&go(t,i,e,a[a.length-1],0))a[a.length-1]=n;else{a.length&&(a[a.length-1]=L(a[a.length-1],i.length));let n=ho(e,t);a.push(n),r=r.matchType(n.type),i=t}}),a)return E.from(a)}return e}function ho(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,E.from(e));return e}function go(e,t,n,r,i){if(i<e.length&&i<t.length&&e[i]==t[i]){let a=go(e,t,n,r.lastChild,i+1);if(a)return r.copy(r.content.replaceChild(r.childCount-1,a));if(r.contentMatchAt(r.childCount).matchType(i==e.length-1?n.type:e[i+1]))return r.copy(r.content.append(E.from(ho(n,e,i+1))))}}function L(e,t){if(t==0)return e;let n=e.content.replaceChild(e.childCount-1,L(e.lastChild,t-1)),r=e.contentMatchAt(e.childCount).fillBefore(E.empty,!0);return e.copy(n.append(r))}function R(e,t,n,r,i,a){let o=t<0?e.firstChild:e.lastChild,s=o.content;return e.childCount>1&&(a=0),i<r-1&&(s=R(s,t,n,r,i+1,a)),i>=n&&(s=t<0?o.contentMatchAt(0).fillBefore(s,a<=i).append(s):s.append(o.contentMatchAt(o.childCount).fillBefore(E.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,o.copy(s))}function _o(e,t,n){return t<e.openStart&&(e=new A(R(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new A(R(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}var vo={thead:[`table`],tbody:[`table`],tfoot:[`table`],caption:[`table`],colgroup:[`table`],col:[`table`,`colgroup`],tr:[`table`,`tbody`],td:[`table`,`tbody`,`tr`],th:[`table`,`tbody`,`tr`]},yo=null;function bo(){return yo||=document.implementation.createHTMLDocument(`title`)}var xo=null;function So(e){let t=window.trustedTypes;return t?(xo||=t.defaultPolicy||t.createPolicy(`ProseMirrorClipboard`,{createHTML:e=>e}),xo.createHTML(e)):e}function Co(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n=bo().createElement(`div`),r=/<([a-z][^>\s]+)/i.exec(e),i;if((i=r&&vo[r[1].toLowerCase()])&&(e=i.map(e=>`<`+e+`>`).join(``)+e+i.map(e=>`</`+e+`>`).reverse().join(``)),n.innerHTML=So(e),i)for(let e=0;e<i.length;e++)n=n.querySelector(i[e])||n;return n}function wo(e){let t=e.querySelectorAll(hi?`span:not([class]):not([style])`:`span.Apple-converted-space`);for(let n=0;n<t.length;n++){let r=t[n];r.childNodes.length==1&&r.textContent==`\xA0`&&r.parentNode&&r.parentNode.replaceChild(e.ownerDocument.createTextNode(` `),r)}}function To(e,t){if(!e.size)return e;let n=e.content.firstChild.type.schema,r;try{r=JSON.parse(t)}catch{return e}let{content:i,openStart:a,openEnd:o}=e;for(let e=r.length-2;e>=0;e-=2){let t=n.nodes[r[e]];if(!t||t.hasRequiredAttrs())break;i=E.from(t.create(r[e+1],i)),a++,o++}return new A(i,a,o)}var Eo={},Do={},Oo={touchstart:!0,touchmove:!0},ko=class{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:``,button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.badSafariComposition=!1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}};function Ao(e){for(let t in Eo){let n=Eo[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=t=>{Fo(e,t)&&!Po(e,t)&&(e.editable||!(t.type in Do))&&n(e,t)},Oo[t]?{passive:!0}:void 0)}_i&&e.dom.addEventListener(`input`,()=>null),No(e)}function jo(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function Mo(e){e.input.mouseDown&&e.input.mouseDown.done(),e.domObserver.stop();for(let t in e.input.eventHandlers)e.dom.removeEventListener(t,e.input.eventHandlers[t]);clearTimeout(e.input.composingTimeout),clearTimeout(e.input.lastIOSEnterFallbackTimeout)}function No(e){e.someProp(`handleDOMEvents`,t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=t=>Po(e,t))})}function Po(e,t){return e.someProp(`handleDOMEvents`,n=>{let r=n[t.type];return r?r(e,t)||t.defaultPrevented:!1})}function Fo(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target;n!=e.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(t))return!1;return!0}function Io(e,t){!Po(e,t)&&Eo[t.type]&&(e.editable||!(t.type in Do))&&Eo[t.type](e,t)}Do.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=n.keyCode==16||n.shiftKey,!$o(e)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!(xi&&hi&&n.keyCode==13)))if(n.keyCode!=229&&e.domObserver.forceFlush(),vi&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let t=Date.now();e.input.lastIOSEnter=t,e.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{e.input.lastIOSEnter==t&&(e.someProp(`handleKeyDown`,t=>t(e,ni(13,`Enter`))),e.input.lastIOSEnter=0)},200)}else e.someProp(`handleKeyDown`,t=>t(e,n))||lo(e,n)?n.preventDefault():jo(e,`key`)},Do.keyup=(e,t)=>{t.keyCode==16&&(e.input.shiftKey=!1)},Do.keypress=(e,t)=>{let n=t;if($o(e)||!n.charCode||n.ctrlKey&&!n.altKey||yi&&n.metaKey)return;if(e.someProp(`handleKeyPress`,t=>t(e,n))){n.preventDefault();return}let r=e.state.selection;if(!(r instanceof P)||!r.$from.sameParent(r.$to)){let t=String.fromCharCode(n.charCode),i=()=>e.state.tr.insertText(t).scrollIntoView();!/[\r\n]/.test(t)&&!e.someProp(`handleTextInput`,n=>n(e,r.$from.pos,r.$to.pos,t,i))&&e.dispatch(i()),n.preventDefault()}};function Lo(e){return{left:e.clientX,top:e.clientY}}function Ro(e,t){let n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}function zo(e,t,n,r,i){if(r==-1)return!1;let a=e.state.doc.resolve(r);for(let r=a.depth+1;r>0;r--)if(e.someProp(t,t=>r>a.depth?t(e,n,a.nodeAfter,a.before(r),i,!0):t(e,n,a.node(r),a.before(r),i,!1)))return!0;return!1}function Bo(e,t,n){if(e.focused||e.focus(),e.state.selection.eq(t))return;let r=e.state.tr.setSelection(t);n==`pointer`&&r.setMeta(`pointer`,!0),e.dispatch(r)}function Vo(e,t){if(t==-1)return!1;let n=e.state.doc.resolve(t),r=n.nodeAfter;return r&&r.isAtom&&F.isSelectable(r)?(Bo(e,new F(n),`pointer`),!0):!1}function Ho(e,t){if(t==-1)return!1;let n=e.state.selection,r,i;n instanceof F&&(r=n.node);let a=e.state.doc.resolve(t);for(let e=a.depth+1;e>0;e--){let t=e>a.depth?a.nodeAfter:a.node(e);if(F.isSelectable(t)){i=r&&n.$from.depth>0&&e>=n.$from.depth&&a.before(n.$from.depth+1)==n.$from.pos?a.before(n.$from.depth):a.before(e);break}}return i==null?!1:(Bo(e,F.create(e.state.doc,i),`pointer`),!0)}function Uo(e,t,n,r,i){return zo(e,`handleClickOn`,t,n,r)||e.someProp(`handleClick`,n=>n(e,t,r))||(i?Ho(e,n):Vo(e,n))}function Wo(e,t,n,r){return zo(e,`handleDoubleClickOn`,t,n,r)||e.someProp(`handleDoubleClick`,n=>n(e,t,r))}function Go(e,t,n,r){return zo(e,`handleTripleClickOn`,t,n,r)||e.someProp(`handleTripleClick`,n=>n(e,t,r))||Ko(e,n,r)}function Ko(e,t,n){if(n.button!=0)return!1;let r=qo(e,t,!0),i=e.state.doc;return r?(Bo(e,r,`pointer`),r instanceof P&&i.eq(e.state.doc)&&(e.input.mouseDown=new Qo(e,r)),!0):!1}function qo(e,t,n){let r=e.state.doc;if(t==-1)return r.inlineContent?P.create(r,0,r.content.size):null;let i=r.resolve(t);for(let e=i.depth+1;e>0;e--){let t=e>i.depth?i.nodeAfter:i.node(e),a=i.before(e);if(t.inlineContent)return P.create(r,a+1,a+1+t.content.size);if(n&&F.isSelectable(t))return F.create(r,a)}return null}function Jo(e){return as(e)}var Yo=yi?`metaKey`:`ctrlKey`;Eo.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let r=Jo(e),i=Date.now(),a=`singleClick`;i-e.input.lastClick.time<500&&Ro(n,e.input.lastClick)&&!n[Yo]&&e.input.lastClick.button==n.button&&(e.input.lastClick.type==`singleClick`?a=`doubleClick`:e.input.lastClick.type==`doubleClick`&&(a=`tripleClick`)),e.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:a,button:n.button},e.input.mouseDown&&e.input.mouseDown.done();let o=e.posAtCoords(Lo(n));o&&(a==`singleClick`?e.input.mouseDown=new Zo(e,o,n,!!r):(a==`doubleClick`?Wo:Go)(e,o.pos,o.inside,n)?n.preventDefault():jo(e,`pointer`))};var Xo=class{constructor(e){this.view=e,this.mightDrag=null,e.root.addEventListener(`mouseup`,this.up=this.up.bind(this)),e.root.addEventListener(`mousemove`,this.move=this.move.bind(this))}up(e){this.done()}move(e){e.buttons==0&&this.done()}done(){this.view.root.removeEventListener(`mouseup`,this.up),this.view.root.removeEventListener(`mousemove`,this.move),this.view.input.mouseDown==this&&(this.view.input.mouseDown=null)}delaySelUpdate(){return!1}},Zo=class extends Xo{constructor(e,t,n,r){super(e),this.pos=t,this.event=n,this.flushed=r,this.delayedSelectionSync=!1,this.startDoc=e.state.doc,this.selectNode=!!n[Yo],this.allowDefault=n.shiftKey;let i,a;if(t.inside>-1)i=e.state.doc.nodeAt(t.inside),a=t.inside;else{let n=e.state.doc.resolve(t.pos);i=n.parent,a=n.depth?n.before():0}let o=r?null:n.target,s=o?e.docView.nearestDesc(o,!0):null;this.target=s&&s.nodeDOM.nodeType==1?s.nodeDOM:null;let{selection:c}=e.state;n.button==0&&(i.type.spec.draggable&&i.type.spec.selectable!==!1||c instanceof F&&c.from<=a&&c.to>a)&&(this.mightDrag={node:i,pos:a,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&pi&&!this.target.hasAttribute(`contentEditable`))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute(`contentEditable`,`false`)},20),this.view.domObserver.start()),jo(e,`pointer`)}done(){super.done(),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute(`draggable`),this.mightDrag.setUneditable&&this.target.removeAttribute(`contentEditable`),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>{this.view.isDestroyed||Ma(this.view)})}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(Lo(e))),this.updateAllowDefault(e),this.allowDefault||!t?jo(this.view,`pointer`):Uo(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||_i&&this.mightDrag&&!this.mightDrag.node.isAtom||hi&&!this.view.state.selection.visible&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(Bo(this.view,N.near(this.view.state.doc.resolve(t.pos)),`pointer`),e.preventDefault()):jo(this.view,`pointer`)}move(e){this.updateAllowDefault(e),jo(this.view,`pointer`),super.move(e)}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}delaySelUpdate(){return this.allowDefault?(this.delayedSelectionSync=!0,!0):!1}},Qo=class extends Xo{constructor(e,t){super(e),this.startSelection=t,this.startDoc=e.state.doc}move(e){if(e.buttons==0||this.view.isDestroyed||!this.view.state.doc.eq(this.startDoc)){this.done();return}e.preventDefault(),jo(this.view,`pointer`);let t=this.view.posAtCoords(Lo(e)),n=t&&qo(this.view,t.inside,!1);if(!n)return;let{doc:r}=this.view.state,i=this.startSelection,[a,o]=n.from<i.from?[i.to,n.from]:[i.from,n.to];Bo(this.view,P.create(r,a,o),`pointer`)}};Eo.touchstart=e=>{e.input.lastTouch=Date.now(),Jo(e),jo(e,`pointer`)},Eo.touchmove=e=>{e.input.lastTouch=Date.now(),jo(e,`pointer`)},Eo.contextmenu=e=>Jo(e);function $o(e,t){return e.composing?!0:_i&&Math.abs(Date.now()-e.input.compositionEndedAt)<500?(e.input.compositionEndedAt=-2e8,!0):!1}var es=xi?5e3:-1;Do.compositionstart=Do.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$to;if(t.selection instanceof P&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(e=>e.type.spec.inclusive===!1)||hi&&bi&&ts(e)))e.markCursor=e.state.storedMarks||n.marks(),as(e,!0),e.markCursor=null;else if(as(e,!t.selection.empty),pi&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let t=e.domSelectionRange();for(let n=t.focusNode,r=t.focusOffset;n&&n.nodeType==1&&r!=0;){let t=r<0?n.lastChild:n.childNodes[r-1];if(!t)break;if(t.nodeType==3){let n=e.domSelection();n&&n.collapse(t,t.nodeValue.length);break}else n=t,r=-1}}e.input.composing=!0}ns(e,es)};function ts(e){let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(!t||t.nodeType!=1||n>=t.childNodes.length)return!1;let r=t.childNodes[n];return r.nodeType==1&&r.contentEditable==`false`}Do.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=Date.now(),e.input.compositionPendingChanges=e.domObserver.pendingRecords().length?e.input.compositionID:0,e.input.compositionNode=null,e.input.badSafariComposition?e.domObserver.forceFlush():e.input.compositionPendingChanges&&Promise.resolve().then(()=>e.domObserver.flush()),e.input.compositionID++,ns(e,20))};function ns(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>as(e),t))}function rs(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=Date.now());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function is(e){let t=e.domSelectionRange();if(!t.focusNode)return null;let n=Zr(t.focusNode,t.focusOffset),r=Qr(t.focusNode,t.focusOffset);if(n&&r&&n!=r){let t=r.pmViewDesc,i=e.domObserver.lastChangedTextNode;if(n==i||r==i)return i;if(!t||!t.isText(r.nodeValue))return r;if(e.input.compositionNode==r){let e=n.pmViewDesc;if(!(!e||!e.isText(n.nodeValue)))return r}}return n||r}function as(e,t=!1){if(!(xi&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),rs(e),t||e.docView&&e.docView.dirty){let n=Aa(e),r=e.state.selection;return n&&!n.eq(r)?e.dispatch(e.state.tr.setSelection(n)):(e.markCursor||t)&&!r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?e.dispatch(e.state.tr.deleteSelection()):e.updateState(e.state),!0}return!1}}function ss(e,t){if(!e.dom.parentNode)return;let n=e.dom.parentNode.appendChild(document.createElement(`div`));n.appendChild(t),n.style.cssText=`position: fixed; left: -10000px; top: 10px`;let r=getSelection(),i=document.createRange();i.selectNodeContents(t),e.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()},50)}var cs=di&&fi<15||vi&&Ci<604;Eo.copy=Do.cut=(e,t)=>{let n=t,r=e.state.selection,i=n.type==`cut`;if(r.empty)return;let a=cs?null:n.clipboardData,{dom:o,text:s}=uo(e,r.content());a?(n.preventDefault(),a.clearData(),a.setData(`text/html`,o.innerHTML),a.setData(`text/plain`,s)):ss(e,o),i&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta(`uiEvent`,`cut`))};function ls(e){return e.openStart==0&&e.openEnd==0&&e.content.childCount==1?e.content.firstChild:null}function us(e,t){if(!e.dom.parentNode)return;let n=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,r=e.dom.parentNode.appendChild(document.createElement(n?`textarea`:`div`));n||(r.contentEditable=`true`),r.style.cssText=`position: fixed; left: -10000px; top: 10px`,r.focus();let i=e.input.shiftKey&&e.input.lastKeyCode!=45;setTimeout(()=>{e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?ds(e,r.value,null,i,t):ds(e,r.textContent,r.innerHTML,i,t)},50)}function ds(e,t,n,r,i){let a=fo(e,t,n,r,e.state.selection.$from);if(e.someProp(`handlePaste`,t=>t(e,i,a||A.empty)))return!0;if(!a)return!1;let o=ls(a),s=o?e.state.tr.replaceSelectionWith(o,r):e.state.tr.replaceSelection(a);return e.dispatch(s.scrollIntoView().setMeta(`paste`,!0).setMeta(`uiEvent`,`paste`)),!0}function fs(e){let t=e.getData(`text/plain`)||e.getData(`Text`);if(t)return t;let n=e.getData(`text/uri-list`);return n?n.replace(/\r?\n/g,` `):``}Do.paste=(e,t)=>{let n=t;if(e.composing&&!xi)return;let r=cs?null:n.clipboardData,i=e.input.shiftKey&&e.input.lastKeyCode!=45;r&&ds(e,fs(r),r.getData(`text/html`),i,n)?n.preventDefault():us(e,n)};var ps=class{constructor(e,t,n){this.slice=e,this.move=t,this.node=n}},ms=yi?`altKey`:`ctrlKey`;function hs(e,t){let n;return e.someProp(`dragCopies`,e=>{n||=e(t)}),n==null?!t[ms]:!n}Eo.dragstart=(e,t)=>{let n=t,r=e.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i=e.state.selection,a=i.empty?null:e.posAtCoords(Lo(n)),o;if(!(a&&a.pos>=i.from&&a.pos<=(i instanceof F?i.to-1:i.to))){if(r&&r.mightDrag)o=F.create(e.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let t=e.docView.nearestDesc(n.target,!0);t&&t.node.type.spec.draggable&&t!=e.docView&&(o=F.create(e.state.doc,t.posBefore))}}let{dom:s,text:c,slice:l}=uo(e,(o||e.state.selection).content());(!n.dataTransfer.files.length||!hi||gi>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(cs?`Text`:`text/html`,s.innerHTML),n.dataTransfer.effectAllowed=`copyMove`,cs||n.dataTransfer.setData(`text/plain`,c),e.dragging=new ps(l,hs(e,n),o)},Eo.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)},Do.dragover=Do.dragenter=(e,t)=>t.preventDefault(),Do.drop=(e,t)=>{try{gs(e,t,e.dragging)}finally{e.dragging=null}};function gs(e,t,n){if(!t.dataTransfer)return;let r=e.posAtCoords(Lo(t));if(!r)return;let i=e.state.doc.resolve(r.pos),a=n&&n.slice;a?e.someProp(`transformPasted`,t=>{a=t(a,e,!1)}):a=fo(e,fs(t.dataTransfer),cs?null:t.dataTransfer.getData(`text/html`),!1,i);let o=!!(n&&hs(e,t));if(e.someProp(`handleDrop`,n=>n(e,t,a||A.empty,o))){t.preventDefault();return}if(!a)return;t.preventDefault();let s=a?cn(e.state.doc,i.pos,a):i.pos;s??=i.pos;let c=e.state.tr;if(o){let{node:e}=n;e?e.replace(c):c.deleteSelection()}let l=c.mapping.map(s),u=a.openStart==0&&a.openEnd==0&&a.content.childCount==1,d=c.doc;if(u?c.replaceRangeWith(l,l,a.content.firstChild):c.replaceRange(l,l,a),c.doc.eq(d))return;let f=c.doc.resolve(l);if(u&&F.isSelectable(a.content.firstChild)&&f.nodeAfter&&f.nodeAfter.sameMarkup(a.content.firstChild))c.setSelection(new F(f));else{let t=c.mapping.map(s);c.mapping.maps[c.mapping.maps.length-1].forEach((e,n,r,i)=>t=i),c.setSelection(Va(e,f,c.doc.resolve(t)))}e.focus(),e.dispatch(c.setMeta(`uiEvent`,`drop`))}Eo.focus=e=>{e.input.lastFocus=Date.now(),e.focused||(e.domObserver.stop(),e.dom.classList.add(`ProseMirror-focused`),e.domObserver.start(),e.focused=!0,setTimeout(()=>{e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelectionRange())&&Ma(e)},20))},Eo.blur=(e,t)=>{let n=t;e.focused&&=(e.domObserver.stop(),e.dom.classList.remove(`ProseMirror-focused`),e.domObserver.start(),n.relatedTarget&&e.dom.contains(n.relatedTarget)&&e.domObserver.currentSelection.clear(),!1)},Eo.beforeinput=(e,t)=>{if(hi&&xi&&t.inputType==`deleteContentBackward`){e.domObserver.flushSoon();let{domChangeCount:t}=e.input;setTimeout(()=>{if(e.input.domChangeCount!=t||(e.dom.blur(),e.focus(),e.someProp(`handleKeyDown`,t=>t(e,ni(8,`Backspace`)))))return;let{$cursor:n}=e.state.selection;n&&n.pos>0&&e.dispatch(e.state.tr.delete(n.pos-1,n.pos).scrollIntoView())},50)}};for(let e in Do)Eo[e]=Do[e];function _s(e,t){if(e==t)return!0;for(let n in e)if(e[n]!==t[n])return!1;for(let n in t)if(!(n in e))return!1;return!0}var vs=class e{constructor(e,t){this.toDOM=e,this.spec=t||Cs,this.side=this.spec.side||0}map(e,t,n,r){let{pos:i,deleted:a}=e.mapResult(t.from+r,this.side<0?-1:1);return a?null:new xs(i-n,i-n,this)}valid(){return!0}eq(t){return this==t||t instanceof e&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&_s(this.spec,t.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}},ys=class e{constructor(e,t){this.attrs=e,this.spec=t||Cs}map(e,t,n,r){let i=e.map(t.from+r,this.spec.inclusiveStart?-1:1)-n,a=e.map(t.to+r,this.spec.inclusiveEnd?1:-1)-n;return i>=a?null:new xs(i,a,this)}valid(e,t){return t.from<t.to}eq(t){return this==t||t instanceof e&&_s(this.attrs,t.attrs)&&_s(this.spec,t.spec)}static is(t){return t.type instanceof e}destroy(){}},bs=class e{constructor(e,t){this.attrs=e,this.spec=t||Cs}map(e,t,n,r){let i=e.mapResult(t.from+r,1);if(i.deleted)return null;let a=e.mapResult(t.to+r,-1);return a.deleted||a.pos<=i.pos?null:new xs(i.pos-n,a.pos-n,this)}valid(e,t){let{index:n,offset:r}=e.content.findIndex(t.from),i;return r==t.from&&!(i=e.child(n)).isText&&r+i.nodeSize==t.to}eq(t){return this==t||t instanceof e&&_s(this.attrs,t.attrs)&&_s(this.spec,t.spec)}destroy(){}},xs=class e{constructor(e,t,n){this.from=e,this.to=t,this.type=n}copy(t,n){return new e(t,n,this.type)}eq(e,t=0){return this.type.eq(e.type)&&this.from+t==e.from&&this.to+t==e.to}map(e,t,n){return this.type.map(e,this,t,n)}static widget(t,n,r){return new e(t,t,new vs(n,r))}static inline(t,n,r,i){return new e(t,n,new ys(r,i))}static node(t,n,r,i){return new e(t,n,new bs(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof ys}get widget(){return this.type instanceof vs}},Ss=[],Cs={},ws=class e{constructor(e,t){this.local=e.length?e:Ss,this.children=t.length?t:Ss}static create(e,t){return t.length?Ms(t,e,0,Cs):Ts}find(e,t,n){let r=[];return this.findInner(e??0,t??1e9,r,0,n),r}findInner(e,t,n,r,i){for(let a=0;a<this.local.length;a++){let o=this.local[a];o.from<=t&&o.to>=e&&(!i||i(o.spec))&&n.push(o.copy(o.from+r,o.to+r))}for(let a=0;a<this.children.length;a+=3)if(this.children[a]<t&&this.children[a+1]>e){let o=this.children[a]+1;this.children[a+2].findInner(e-o,t-o,n,r+o,i)}}map(e,t,n){return this==Ts||e.maps.length==0?this:this.mapInner(e,t,0,0,n||Cs)}mapInner(t,n,r,i,a){let o;for(let e=0;e<this.local.length;e++){let s=this.local[e].map(t,r,i);s&&s.type.valid(n,s)?(o||=[]).push(s):a.onRemove&&a.onRemove(this.local[e].spec)}return this.children.length?Ds(this.children,o||[],t,n,r,i,a):o?new e(o.sort(Ns),Ss):Ts}add(t,n){return n.length?this==Ts?e.create(t,n):this.addInner(t,n,0):this}addInner(t,n,r){let i,a=0;t.forEach((e,t)=>{let o=t+r,s;if(s=As(n,e,o)){for(i||=this.children.slice();a<i.length&&i[a]<t;)a+=3;i[a]==t?i[a+2]=i[a+2].addInner(e,s,o+1):i.splice(a,0,t,t+e.nodeSize,Ms(s,e,o+1,Cs)),a+=3}});let o=Os(a?js(n):n,-r);for(let e=0;e<o.length;e++)o[e].type.valid(t,o[e])||o.splice(e--,1);return new e(o.length?this.local.concat(o).sort(Ns):this.local,i||this.children)}remove(e){return e.length==0||this==Ts?this:this.removeInner(e,0)}removeInner(t,n){let r=this.children,i=this.local;for(let e=0;e<r.length;e+=3){let i,a=r[e]+n,o=r[e+1]+n;for(let e=0,n;e<t.length;e++)(n=t[e])&&n.from>a&&n.to<o&&(t[e]=null,(i||=[]).push(n));if(!i)continue;r==this.children&&(r=this.children.slice());let s=r[e+2].removeInner(i,a+1);s==Ts?(r.splice(e,3),e-=3):r[e+2]=s}if(i.length){for(let e=0,r;e<t.length;e++)if(r=t[e])for(let e=0;e<i.length;e++)i[e].eq(r,n)&&(i==this.local&&(i=this.local.slice()),i.splice(e--,1))}return r==this.children&&i==this.local?this:i.length||r.length?new e(i,r):Ts}forChild(t,n){if(this==Ts)return this;if(n.isLeaf)return e.empty;let r,i;for(let e=0;e<this.children.length;e+=3)if(this.children[e]>=t){this.children[e]==t&&(r=this.children[e+2]);break}let a=t+1,o=a+n.content.size;for(let e=0;e<this.local.length;e++){let t=this.local[e];if(t.from<o&&t.to>a&&t.type instanceof ys){let e=Math.max(a,t.from)-a,n=Math.min(o,t.to)-a;e<n&&(i||=[]).push(t.copy(e,n))}}if(i){let t=new e(i.sort(Ns),Ss);return r?new Es([t,r]):t}return r||Ts}eq(t){if(this==t)return!0;if(!(t instanceof e)||this.local.length!=t.local.length||this.children.length!=t.children.length)return!1;for(let e=0;e<this.local.length;e++)if(!this.local[e].eq(t.local[e]))return!1;for(let e=0;e<this.children.length;e+=3)if(this.children[e]!=t.children[e]||this.children[e+1]!=t.children[e+1]||!this.children[e+2].eq(t.children[e+2]))return!1;return!0}locals(e){return Ps(this.localsInner(e))}localsInner(e){if(this==Ts)return Ss;if(e.inlineContent||!this.local.some(ys.is))return this.local;let t=[];for(let e=0;e<this.local.length;e++)this.local[e].type instanceof ys||t.push(this.local[e]);return t}forEachSet(e){e(this)}};ws.empty=new ws([],[]),ws.removeOverlap=Ps;var Ts=ws.empty,Es=class e{constructor(e){this.members=e}map(t,n){let r=this.members.map(e=>e.map(t,n,Cs));return e.from(r)}forChild(t,n){if(n.isLeaf)return ws.empty;let r=[];for(let i=0;i<this.members.length;i++){let a=this.members[i].forChild(t,n);a!=Ts&&(a instanceof e?r=r.concat(a.members):r.push(a))}return e.from(r)}eq(t){if(!(t instanceof e)||t.members.length!=this.members.length)return!1;for(let e=0;e<this.members.length;e++)if(!this.members[e].eq(t.members[e]))return!1;return!0}locals(e){let t,n=!0;for(let r=0;r<this.members.length;r++){let i=this.members[r].localsInner(e);if(i.length)if(!t)t=i;else{n&&=(t=t.slice(),!1);for(let e=0;e<i.length;e++)t.push(i[e])}}return t?Ps(n?t:t.sort(Ns)):Ss}static from(t){switch(t.length){case 0:return Ts;case 1:return t[0];default:return new e(t.every(e=>e instanceof ws)?t:t.reduce((e,t)=>e.concat(t instanceof ws?t:t.members),[]))}}forEachSet(e){for(let t=0;t<this.members.length;t++)this.members[t].forEachSet(e)}};function Ds(e,t,n,r,i,a,o){let s=e.slice();for(let e=0,t=a;e<n.maps.length;e++){let r=0;n.maps[e].forEach((e,n,i,a)=>{let o=a-i-(n-e);for(let i=0;i<s.length;i+=3){let a=s[i+1];if(a<0||e>a+t-r)continue;let c=s[i]+t-r;n>=c?s[i+1]=e<=c?-2:-1:e>=t&&o&&(s[i]+=o,s[i+1]+=o)}r+=o}),t=n.maps[e].map(t,-1)}let c=!1;for(let t=0;t<s.length;t+=3)if(s[t+1]<0){if(s[t+1]==-2){c=!0,s[t+1]=-1;continue}let l=n.map(e[t]+a),u=l-i;if(u<0||u>=r.content.size){c=!0;continue}let d=n.map(e[t+1]+a,-1)-i,{index:f,offset:p}=r.content.findIndex(u),m=r.maybeChild(f);if(m&&p==u&&p+m.nodeSize==d){let r=s[t+2].mapInner(n,m,l+1,e[t]+a+1,o);r==Ts?(s[t+1]=-2,c=!0):(s[t]=u,s[t+1]=d,s[t+2]=r)}else c=!0}if(c){let c=Ms(ks(s,e,t,n,i,a,o),r,0,o);t=c.local;for(let e=0;e<s.length;e+=3)s[e+1]<0&&(s.splice(e,3),e-=3);for(let e=0,t=0;e<c.children.length;e+=3){let n=c.children[e];for(;t<s.length&&s[t]<n;)t+=3;s.splice(t,0,c.children[e],c.children[e+1],c.children[e+2])}}return new ws(t.sort(Ns),s)}function Os(e,t){if(!t||!e.length)return e;let n=[];for(let r=0;r<e.length;r++){let i=e[r];n.push(new xs(i.from+t,i.to+t,i.type))}return n}function ks(e,t,n,r,i,a,o){function s(e,t){for(let a=0;a<e.local.length;a++){let s=e.local[a].map(r,i,t);s?n.push(s):o.onRemove&&o.onRemove(e.local[a].spec)}for(let n=0;n<e.children.length;n+=3)s(e.children[n+2],e.children[n]+t+1)}for(let n=0;n<e.length;n+=3)e[n+1]==-1&&s(e[n+2],t[n]+a+1);return n}function As(e,t,n){if(t.isLeaf)return null;let r=n+t.nodeSize,i=null;for(let t=0,a;t<e.length;t++)(a=e[t])&&a.from>n&&a.to<r&&((i||=[]).push(a),e[t]=null);return i}function js(e){let t=[];for(let n=0;n<e.length;n++)e[n]!=null&&t.push(e[n]);return t}function Ms(e,t,n,r){let i=[],a=!1;t.forEach((t,o)=>{let s=As(e,t,o+n);if(s){a=!0;let e=Ms(s,t,n+o+1,r);e!=Ts&&i.push(o,o+t.nodeSize,e)}});let o=Os(a?js(e):e,-n).sort(Ns);for(let e=0;e<o.length;e++)o[e].type.valid(t,o[e])||(r.onRemove&&r.onRemove(o[e].spec),o.splice(e--,1));return o.length||i.length?new ws(o,i):Ts}function Ns(e,t){return e.from-t.from||e.to-t.to}function Ps(e){let t=e;for(let n=0;n<t.length-1;n++){let r=t[n];if(r.from!=r.to)for(let i=n+1;i<t.length;i++){let a=t[i];if(a.from==r.from){a.to!=r.to&&(t==e&&(t=e.slice()),t[i]=a.copy(a.from,r.to),Fs(t,i+1,a.copy(r.to,a.to)));continue}else{a.from<r.to&&(t==e&&(t=e.slice()),t[n]=r.copy(r.from,a.from),Fs(t,i,r.copy(a.from,r.to)));break}}}return t}function Fs(e,t,n){for(;t<e.length&&Ns(n,e[t])>0;)t++;e.splice(t,0,n)}function Is(e){let t=[];return e.someProp(`decorations`,n=>{let r=n(e.state);r&&r!=Ts&&t.push(r)}),e.cursorWrapper&&t.push(ws.create(e.state.doc,[e.cursorWrapper.deco])),Es.from(t)}var Ls={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},Rs=di&&fi<=11,zs=class{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}},Bs=class{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new zs,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(t=>{for(let e=0;e<t.length;e++)this.queue.push(t[e]);di&&fi<=11&&t.some(e=>e.type==`childList`&&e.removedNodes.length||e.type==`characterData`&&e.oldValue.length>e.target.nodeValue.length)?this.flushSoon():_i&&e.composing&&t.some(e=>e.type==`childList`&&e.target.nodeName==`TR`)?(e.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),Rs&&(this.onCharData=e=>{this.queue.push({target:e.target,type:`characterData`,oldValue:e.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,Ls)),this.onCharData&&this.view.dom.addEventListener(`DOMCharacterDataModified`,this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let t=0;t<e.length;t++)this.queue.push(e[t]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener(`DOMCharacterDataModified`,this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener(`selectionchange`,this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener(`selectionchange`,this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(Ha(this.view)){if(this.suppressingSelectionUpdates)return Ma(this.view);if(di&&fi<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&qr(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let t=new Set,n;for(let n=e.focusNode;n;n=Ur(n))t.add(n);for(let r=e.anchorNode;r;r=Ur(r))if(t.has(r)){n=r;break}let r=n&&this.view.docView.nearestDesc(n);if(r&&r.ignoreMutation({type:`selection`,target:n.nodeType==3?n.parentNode:n}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let t=this.pendingRecords();t.length&&(this.queue=[]);let n=e.domSelectionRange(),r=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(n)&&Ha(e)&&!this.ignoreSelectionChange(n),i=-1,a=-1,o=!1,s=[];if(e.editable)for(let e=0;e<t.length;e++){let n=this.registerMutation(t[e],s);n&&(i=i<0?n.from:Math.min(n.from,i),a=a<0?n.to:Math.max(n.to,a),n.typeOver&&(o=!0))}if(s.some(e=>e.nodeName==`BR`)&&(e.input.lastKeyCode==8||e.input.lastKeyCode==46||hi&&(e.composing||e.input.compositionEndedAt>Date.now()-50)&&t.some(e=>e.type==`childList`&&e.removedNodes.length))){for(let e of s)if(e.nodeName==`BR`&&e.parentNode){let t=e.nextSibling;for(;t&&t.nodeType==1;){if(t.contentEditable==`false`){e.parentNode.removeChild(e);break}t=t.firstChild}}}else if(pi&&s.length){let t=s.filter(e=>e.nodeName==`BR`);if(t.length==2){let[e,n]=t;e.parentNode&&e.parentNode.parentNode==n.parentNode?n.remove():e.remove()}else{let{focusNode:n}=this.currentSelection;for(let r of t){let t=r.parentNode;t&&t.nodeName==`LI`&&(!n||Ks(e,n)!=t)&&r.remove()}}}let c=null;i<0&&r&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&ti(n)&&(c=Aa(e))&&c.eq(N.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,Ma(e),this.currentSelection.set(n),e.scrollToSelection()):(i>-1||r)&&(i>-1&&(e.docView.markDirty(i,a),Us(e)),e.input.badSafariComposition&&(e.input.badSafariComposition=!1,qs(e,s)),this.handleDOMChange(i,a,o,s),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(n)||Ma(e),this.currentSelection.set(n))}registerMutation(e,t){if(t.indexOf(e.target)>-1)return null;let n=this.view.docView.nearestDesc(e.target);if(e.type==`attributes`&&(n==this.view.docView||e.attributeName==`contenteditable`||e.attributeName==`style`&&!e.oldValue&&!e.target.getAttribute(`style`))||!n||n.ignoreMutation(e))return null;if(e.type==`childList`){for(let n=0;n<e.addedNodes.length;n++){let r=e.addedNodes[n];t.push(r),r.nodeType==3&&(this.lastChangedTextNode=r)}if(n.contentDOM&&n.contentDOM!=n.dom&&!n.contentDOM.contains(e.target))return{from:n.posBefore,to:n.posAfter};let r=e.previousSibling,i=e.nextSibling;if(di&&fi<=11&&e.addedNodes.length)for(let t=0;t<e.addedNodes.length;t++){let{previousSibling:n,nextSibling:a}=e.addedNodes[t];(!n||Array.prototype.indexOf.call(e.addedNodes,n)<0)&&(r=n),(!a||Array.prototype.indexOf.call(e.addedNodes,a)<0)&&(i=a)}let a=r&&r.parentNode==e.target?Hr(r)+1:0,o=n.localPosFromDOM(e.target,a,-1),s=i&&i.parentNode==e.target?Hr(i):e.target.childNodes.length;return{from:o,to:n.localPosFromDOM(e.target,s,1)}}else if(e.type==`attributes`)return{from:n.posAtStart-n.border,to:n.posAtEnd+n.border};else return this.lastChangedTextNode=e.target,{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}}},Vs=new WeakMap,Hs=!1;function Us(e){if(!Vs.has(e)&&(Vs.set(e,null),[`normal`,`nowrap`,`pre-line`].indexOf(getComputedStyle(e.dom).whiteSpace)!==-1)){if(e.requiresGeckoHackNode=pi,Hs)return;console.warn(`ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package.`),Hs=!0}}function Ws(e,t){let n=t.startContainer,r=t.startOffset,i=t.endContainer,a=t.endOffset,o=e.domAtPos(e.state.selection.anchor);return qr(o.node,o.offset,i,a)&&([n,r,i,a]=[i,a,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:a}}function Gs(e,t){if(t.getComposedRanges){let n=t.getComposedRanges(e.root)[0];if(n)return Ws(e,n)}let n;function r(e){e.preventDefault(),e.stopImmediatePropagation(),n=e.getTargetRanges()[0]}return e.dom.addEventListener(`beforeinput`,r,!0),document.execCommand(`indent`),e.dom.removeEventListener(`beforeinput`,r,!0),n?Ws(e,n):null}function Ks(e,t){for(let n=t.parentNode;n&&n!=e.dom;n=n.parentNode){let t=e.docView.nearestDesc(n,!0);if(t&&t.node.isBlock)return n}return null}function qs(e,t){let{focusNode:n,focusOffset:r}=e.domSelectionRange();for(let i of t)if(i.parentNode?.nodeName==`TR`){let t=i.nextSibling;for(;t&&t.nodeName!=`TD`&&t.nodeName!=`TH`;)t=t.nextSibling;if(t){let a=t;for(;;){let e=a.firstChild;if(!e||e.nodeType!=1||e.contentEditable==`false`||/^(BR|IMG)$/.test(e.nodeName))break;a=e}a.insertBefore(i,a.firstChild),n==i&&e.domSelection().collapse(i,r)}else i.parentNode.removeChild(i)}}function Js(e,t,n){let{node:r,fromOffset:i,toOffset:a,from:o,to:s}=e.docView.parseRange(t,n),c=e.domSelectionRange(),l,u=c.anchorNode;if(u&&e.dom.contains(u.nodeType==1?u:u.parentNode)&&(l=[{node:u,offset:c.anchorOffset}],ti(c)||l.push({node:c.focusNode,offset:c.focusOffset})),hi&&e.input.lastKeyCode===8)for(let e=a;e>i;e--){let t=r.childNodes[e-1],n=t.pmViewDesc;if(t.nodeName==`BR`&&!n){a=e;break}if(!n||n.size)break}let d=e.state.doc,f=e.someProp(`domParser`)||qe.fromSchema(e.state.schema),p=d.resolve(o),m=null,h=f.parse(r,{topNode:p.parent,topMatch:p.parent.contentMatchAt(p.index()),topOpen:!0,from:i,to:a,preserveWhitespace:p.parent.type.whitespace==`pre`?`full`:!0,findPositions:l,ruleFromNode:Ys,context:p});if(l&&l[0].pos!=null){let e=l[0].pos,t=l[1]&&l[1].pos;t??=e,m={anchor:e+o,head:t+o}}return{doc:h,sel:m,from:o,to:s}}function Ys(e){let t=e.pmViewDesc;if(t)return t.parseRule();if(e.nodeName==`BR`&&e.parentNode){if(_i&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){let e=document.createElement(`div`);return e.appendChild(document.createElement(`li`)),{skip:e}}else if(e.parentNode.lastChild==e||_i&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if(e.nodeName==`IMG`&&e.getAttribute(`mark-placeholder`))return{ignore:!0};return null}var Xs=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function Zs(e,t,n,r,i){let a=e.input.compositionPendingChanges||(e.composing?e.input.compositionID:0);if(e.input.compositionPendingChanges=0,t<0){let t=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,n=Aa(e,t);if(n&&!e.state.selection.eq(n)){if(hi&&xi&&e.input.lastKeyCode===13&&Date.now()-100<e.input.lastKeyCodeTime&&e.someProp(`handleKeyDown`,t=>t(e,ni(13,`Enter`))))return;let r=e.state.tr.setSelection(n);t==`pointer`?r.setMeta(`pointer`,!0):t==`key`&&r.scrollIntoView(),a&&r.setMeta(`composition`,a),e.dispatch(r)}return}let o=e.state.doc.resolve(t),s=o.sharedDepth(n);t=o.before(s+1),n=e.state.doc.resolve(n).after(s+1);let c=e.state.selection,l=Js(e,t,n),u=e.state.doc,d=u.slice(l.from,l.to),f,p;e.input.lastKeyCode===8&&Date.now()-100<e.input.lastKeyCodeTime?(f=e.state.selection.to,p=`end`):(f=e.state.selection.from,p=`start`),e.input.lastKeyCode=null;let m=nc(d.content,l.doc.content,l.from,f,p);if(m&&e.input.domChangeCount++,(vi&&e.input.lastIOSEnter>Date.now()-225||xi)&&i.some(e=>e.nodeType==1&&!Xs.test(e.nodeName))&&(!m||m.endA>=m.endB)&&e.someProp(`handleKeyDown`,t=>t(e,ni(13,`Enter`)))){e.input.lastIOSEnter=0;return}if(!m)if(r&&c instanceof P&&!c.empty&&c.$head.sameParent(c.$anchor)&&!e.composing&&!(l.sel&&l.sel.anchor!=l.sel.head))m={start:c.from,endA:c.to,endB:c.to};else{if(l.sel){let t=Qs(e,e.state.doc,l.sel);if(t&&!t.eq(e.state.selection)){let n=e.state.tr.setSelection(t);a&&n.setMeta(`composition`,a),e.dispatch(n)}}return}e.state.selection.from<e.state.selection.to&&m.start==m.endB&&e.state.selection instanceof P&&(m.start>e.state.selection.from&&m.start<=e.state.selection.from+2&&e.state.selection.from>=l.from?m.start=e.state.selection.from:m.endA<e.state.selection.to&&m.endA>=e.state.selection.to-2&&e.state.selection.to<=l.to&&(m.endB+=e.state.selection.to-m.endA,m.endA=e.state.selection.to)),di&&fi<=11&&m.endB==m.start+1&&m.endA==m.start&&m.start>l.from&&l.doc.textBetween(m.start-l.from-1,m.start-l.from+1)==` \xA0`&&(m.start--,m.endA--,m.endB--);let h=l.doc.resolveNoCache(m.start-l.from),g=l.doc.resolveNoCache(m.endB-l.from),_=u.resolve(m.start),v=h.sameParent(g)&&h.parent.inlineContent&&_.end()>=m.endA;if((vi&&e.input.lastIOSEnter>Date.now()-225&&(!v||i.some(e=>e.nodeName==`DIV`||e.nodeName==`P`))||!v&&h.pos<l.doc.content.size&&(!h.sameParent(g)||!h.parent.inlineContent)&&h.pos<g.pos&&!/\S/.test(l.doc.textBetween(h.pos,g.pos,``,``)))&&e.someProp(`handleKeyDown`,t=>t(e,ni(13,`Enter`)))){e.input.lastIOSEnter=0;return}if(e.state.selection.anchor>m.start&&ec(u,m.start,m.endA,h,g)&&e.someProp(`handleKeyDown`,t=>t(e,ni(8,`Backspace`)))){xi&&hi&&e.domObserver.suppressSelectionUpdates();return}hi&&m.endB==m.start&&(e.input.lastChromeDelete=Date.now()),xi&&!v&&h.start()!=g.start()&&g.parentOffset==0&&h.depth==g.depth&&l.sel&&l.sel.anchor==l.sel.head&&l.sel.head==m.endA&&(m.endB-=2,g=l.doc.resolveNoCache(m.endB-l.from),setTimeout(()=>{e.someProp(`handleKeyDown`,function(t){return t(e,ni(13,`Enter`))})},20));let y=m.start,b=m.endA,x=t=>{let n=t||e.state.tr.replace(y,b,l.doc.slice(m.start-l.from,m.endB-l.from));if(l.sel){let t=Qs(e,n.doc,l.sel);t&&!(hi&&e.composing&&t.empty&&(m.start!=m.endB||e.input.lastChromeDelete<Date.now()-100)&&(t.head==y||t.head==n.mapping.map(b)-1)||di&&t.empty&&t.head==y)&&n.setSelection(t)}return a&&n.setMeta(`composition`,a),n.scrollIntoView()},S;if(v)if(h.pos==g.pos){di&&fi<=11&&h.parentOffset==0&&(e.domObserver.suppressSelectionUpdates(),setTimeout(()=>Ma(e),20));let t=x(e.state.tr.delete(y,b)),n=u.resolve(m.start).marksAcross(u.resolve(m.endA));n&&t.ensureMarks(n),e.dispatch(t)}else if(m.endA==m.endB&&(S=$s(h.parent.content.cut(h.parentOffset,g.parentOffset),_.parent.content.cut(_.parentOffset,m.endA-_.start())))){let t=x(e.state.tr);S.type==`add`?t.addMark(y,b,S.mark):t.removeMark(y,b,S.mark),e.dispatch(t)}else if(h.parent.child(h.index()).isText&&h.index()==g.index()-+!g.textOffset){let t=h.parent.textBetween(h.parentOffset,g.parentOffset),n=()=>x(e.state.tr.insertText(t,y,b));e.someProp(`handleTextInput`,r=>r(e,y,b,t,n))||e.dispatch(n())}else e.dispatch(x());else e.dispatch(x())}function Qs(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:Va(e,t.resolve(n.anchor),t.resolve(n.head))}function $s(e,t){let n=e.firstChild.marks,r=t.firstChild.marks,i=n,a=r,o,s,c;for(let e=0;e<r.length;e++)i=r[e].removeFromSet(i);for(let e=0;e<n.length;e++)a=n[e].removeFromSet(a);if(i.length==1&&a.length==0)s=i[0],o=`add`,c=e=>e.mark(s.addToSet(e.marks));else if(i.length==0&&a.length==1)s=a[0],o=`remove`,c=e=>e.mark(s.removeFromSet(e.marks));else return null;let l=[];for(let e=0;e<t.childCount;e++)l.push(c(t.child(e)));if(E.from(l).eq(e))return{mark:s,type:o}}function ec(e,t,n,r,i){if(n-t<=i.pos-r.pos||tc(r,!0,!1)<i.pos)return!1;let a=e.resolve(t);if(!r.parent.isTextblock){let e=a.nodeAfter;return e!=null&&n==t+e.nodeSize}if(a.parentOffset<a.parent.content.size||!a.parent.isTextblock)return!1;let o=e.resolve(tc(a,!0,!0));return!o.parent.isTextblock||o.pos>n||tc(o,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(o.parent.content)}function tc(e,t,n){let r=e.depth,i=t?e.end():e.pos;for(;r>0&&(t||e.indexAfter(r)==e.node(r).childCount);)r--,i++,t=!1;if(n){let t=e.node(r).maybeChild(e.indexAfter(r));for(;t&&!t.isLeaf;)t=t.firstChild,i++}return i}function nc(e,t,n,r,i){let a=e.findDiffStart(t,n),o=n+e.size,s=n+t.size;if(a==null)return null;let{a:c,b:l}=e.findDiffEnd(t,o,s);if(i==`end`){let e=Math.max(0,a-Math.min(c,l));r-=c+e-a}if(c<a&&o<s){let e=r<=a&&r>=c?a-r:0;a-=e,l=a+(l-c),c=a}else if(l<a){let e=r<=a&&r>=l?a-r:0;a-=e,c=a+(c-l),l=a}return{start:a,endA:c,endB:l}}var rc=class{constructor(e,t){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new ko,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(uc),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement(`div`),e&&(e.appendChild?e.appendChild(this.dom):typeof e==`function`?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=oc(this),ac(this),this.nodeViews=cc(this),this.docView=ua(this.state.doc,ic(this),Is(this),this.dom,this),this.domObserver=new Bs(this,(e,t,n,r)=>Zs(this,e,t,n,r)),this.domObserver.start(),Ao(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let t in e)this._props[t]=e[t];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&No(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(uc),this.directPlugins=e.plugins),this.updateStateInner(e.state,t)}setProps(e){let t={};for(let e in this._props)t[e]=this._props[e];t.state=this.state;for(let n in e)t[n]=e[n];this.update(t)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,t){let n=this.state,r=!1,i=!1;e.storedMarks&&this.composing&&(rs(this),i=!0),this.state=e;let a=n.plugins!=e.plugins||this._props.plugins!=t.plugins;if(a||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let e=cc(this);lc(e,this.nodeViews)&&(this.nodeViews=e,r=!0)}(a||t.handleDOMEvents!=this._props.handleDOMEvents)&&No(this),this.editable=oc(this),ac(this);let o=Is(this),s=ic(this),c=n.plugins!=e.plugins&&!n.doc.eq(e.doc)?`reset`:e.scrollToSelection>n.scrollToSelection?`to selection`:`preserve`,l=r||!this.docView.matchesNode(e.doc,s,o);(l||!e.selection.eq(n.selection))&&(i=!0);let u=c==`preserve`&&i&&this.dom.style.overflowAnchor==null&&Oi(this);if(i){this.domObserver.stop();let t=l&&(di||hi)&&!this.composing&&!n.selection.empty&&!e.selection.empty&&sc(n.selection,e.selection);if(l){let n=hi?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=is(this)),(r||!this.docView.update(e.doc,s,o,this))&&(this.docView.updateOuterDeco(s),this.docView.destroy(),this.docView=ua(e.doc,s,o,this.dom,this)),n&&(!this.trackWrites||!this.dom.contains(this.trackWrites))&&(t=!0)}let i=this.input.mouseDown;t||!(i&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&Wa(this)&&i.delaySelUpdate())?Ma(this,t):(za(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(n),this.dragging?.node&&!n.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,n),c==`reset`?this.dom.scrollTop=0:c==`to selection`?this.scrollToSelection():u&&Ai(u)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!(!e||!this.dom.contains(e.nodeType==1?e:e.parentNode))&&!this.someProp(`handleScrollToSelection`,e=>e(this)))if(this.state.selection instanceof F){let t=this.docView.domAfterPos(this.state.selection.from);t.nodeType==1&&Di(this,t.getBoundingClientRect(),e)}else Di(this,this.coordsAtPos(this.state.selection.head,1),e)}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let e=0;e<this.directPlugins.length;e++){let t=this.directPlugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}for(let e=0;e<this.state.plugins.length;e++){let t=this.state.plugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}}else for(let t=0;t<this.pluginViews.length;t++){let n=this.pluginViews[t];n.update&&n.update(this,e)}}updateDraggedNode(e,t){let n=e.node,r=-1;if(n.from<this.state.doc.content.size&&this.state.doc.nodeAt(n.from)==n.node)r=n.from;else{let e=n.from+(this.state.doc.content.size-t.doc.content.size);(e>0&&e<this.state.doc.content.size&&this.state.doc.nodeAt(e))==n.node&&(r=e)}this.dragging=new ps(e.slice,e.move,r<0?void 0:F.create(this.state.doc,r))}someProp(e,t){let n=this._props&&this._props[e],r;if(n!=null&&(r=t?t(n):n))return r;for(let n=0;n<this.directPlugins.length;n++){let i=this.directPlugins[n].props[e];if(i!=null&&(r=t?t(i):i))return r}let i=this.state.plugins;if(i)for(let n=0;n<i.length;n++){let a=i[n].props[e];if(a!=null&&(r=t?t(a):a))return r}}hasFocus(){if(di){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if(e.contentEditable==`false`)return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&Ni(this.dom),Ma(this),this.domObserver.start()}get root(){let e=this._root;if(e==null){for(let e=this.dom.parentNode;e;e=e.parentNode)if(e.nodeType==9||e.nodeType==11&&e.host)return e.getSelection||(Object.getPrototypeOf(e).getSelection=()=>e.ownerDocument.getSelection()),this._root=e}return e||document}updateRoot(){this._root=null}posAtCoords(e){return Bi(this,e)}coordsAtPos(e,t=1){return Wi(this,e,t)}domAtPos(e,t=0){return this.docView.domFromPos(e,t)}nodeDOM(e){let t=this.docView.descAt(e);return t?t.nodeDOM:null}posAtDOM(e,t,n=-1){let r=this.docView.posFromDOM(e,t,n);if(r==null)throw RangeError(`DOM position not inside the editor`);return r}endOfTextblock(e,t){return ea(this,t||this.state,e)}pasteHTML(e,t){return ds(this,``,e,!1,t||new ClipboardEvent(`paste`))}pasteText(e,t){return ds(this,e,null,!0,t||new ClipboardEvent(`paste`))}serializeForClipboard(e){return uo(this,e)}destroy(){this.docView&&(Mo(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Is(this),this),this.dom.textContent=``):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,Kr())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return Io(this,e)}domSelectionRange(){let e=this.domSelection();return e?_i&&this.root.nodeType===11&&ri(this.dom.ownerDocument)==this.dom&&Gs(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}};rc.prototype.dispatch=function(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))};function ic(e){let t=Object.create(null);return t.class=`ProseMirror`,t.contenteditable=String(e.editable),e.someProp(`attributes`,n=>{if(typeof n==`function`&&(n=n(e.state)),n)for(let e in n)e==`class`?t.class+=` `+n[e]:e==`style`?t.style=(t.style?t.style+`;`:``)+n[e]:!t[e]&&e!=`contenteditable`&&e!=`nodeName`&&(t[e]=String(n[e]))}),t.translate||=`no`,[xs.node(0,e.state.doc.content.size,t)]}function ac(e){if(e.markCursor){let t=document.createElement(`img`);t.className=`ProseMirror-separator`,t.setAttribute(`mark-placeholder`,`true`),t.setAttribute(`alt`,``),e.cursorWrapper={dom:t,deco:xs.widget(e.state.selection.from,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function oc(e){return!e.someProp(`editable`,t=>t(e.state)===!1)}function sc(e,t){let n=Math.min(e.$anchor.sharedDepth(e.head),t.$anchor.sharedDepth(t.head));return e.$anchor.start(n)!=t.$anchor.start(n)}function cc(e){let t=Object.create(null);function n(e){for(let n in e)Object.prototype.hasOwnProperty.call(t,n)||(t[n]=e[n])}return e.someProp(`nodeViews`,n),e.someProp(`markViews`,n),t}function lc(e,t){let n=0,r=0;for(let r in e){if(e[r]!=t[r])return!0;n++}for(let e in t)r++;return n!=r}function uc(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw RangeError(`Plugins passed directly to the view must not have a state component`)}for(var dc={8:`Backspace`,9:`Tab`,10:`Enter`,12:`NumLock`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,44:`PrintScreen`,45:`Insert`,46:`Delete`,59:`;`,61:`=`,91:`Meta`,92:`Meta`,106:`*`,107:`+`,108:`,`,109:`-`,110:`.`,111:`/`,144:`NumLock`,145:`ScrollLock`,160:`Shift`,161:`Shift`,162:`Control`,163:`Control`,164:`Alt`,165:`Alt`,173:`-`,186:`;`,187:`=`,188:`,`,189:`-`,190:`.`,191:`/`,192:"`",219:`[`,220:`\\`,221:`]`,222:`'`},fc={48:`)`,49:`!`,50:`@`,51:`#`,52:`$`,53:`%`,54:`^`,55:`&`,56:`*`,57:`(`,59:`:`,61:`+`,173:`_`,186:`:`,187:`+`,188:`<`,189:`_`,190:`>`,191:`?`,192:`~`,219:`{`,220:`|`,221:`}`,222:`"`},pc=typeof navigator<`u`&&/Mac/.test(navigator.platform),mc=typeof navigator<`u`&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),hc=0;hc<10;hc++)dc[48+hc]=dc[96+hc]=String(hc);for(var hc=1;hc<=24;hc++)dc[hc+111]=`F`+hc;for(var hc=65;hc<=90;hc++)dc[hc]=String.fromCharCode(hc+32),fc[hc]=String.fromCharCode(hc);for(var gc in dc)fc.hasOwnProperty(gc)||(fc[gc]=dc[gc]);function _c(e){var t=!(pc&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||mc&&e.shiftKey&&e.key&&e.key.length==1||e.key==`Unidentified`)&&e.key||(e.shiftKey?fc:dc)[e.keyCode]||e.key||`Unidentified`;return t==`Esc`&&(t=`Escape`),t==`Del`&&(t=`Delete`),t==`Left`&&(t=`ArrowLeft`),t==`Up`&&(t=`ArrowUp`),t==`Right`&&(t=`ArrowRight`),t==`Down`&&(t=`ArrowDown`),t}var vc=typeof navigator<`u`&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),yc=typeof navigator<`u`&&/Win/.test(navigator.platform);function bc(e){let t=e.split(/-(?!$)/),n=t[t.length-1];n==`Space`&&(n=` `);let r,i,a,o;for(let e=0;e<t.length-1;e++){let n=t[e];if(/^(cmd|meta|m)$/i.test(n))o=!0;else if(/^a(lt)?$/i.test(n))r=!0;else if(/^(c|ctrl|control)$/i.test(n))i=!0;else if(/^s(hift)?$/i.test(n))a=!0;else if(/^mod$/i.test(n))vc?o=!0:i=!0;else throw Error(`Unrecognized modifier name: `+n)}return r&&(n=`Alt-`+n),i&&(n=`Ctrl-`+n),o&&(n=`Meta-`+n),a&&(n=`Shift-`+n),n}function xc(e){let t=Object.create(null);for(let n in e)t[bc(n)]=e[n];return t}function Sc(e,t,n=!0){return t.altKey&&(e=`Alt-`+e),t.ctrlKey&&(e=`Ctrl-`+e),t.metaKey&&(e=`Meta-`+e),n&&t.shiftKey&&(e=`Shift-`+e),e}function Cc(e){return new Jn({props:{handleKeyDown:wc(e)}})}function wc(e){let t=xc(e);return function(e,n){let r=_c(n),i,a=t[Sc(r,n)];if(a&&a(e.state,e.dispatch,e))return!0;if(r.length==1&&r!=` `){if(n.shiftKey){let i=t[Sc(r,n,!1)];if(i&&i(e.state,e.dispatch,e))return!0}if((n.altKey||n.metaKey||n.ctrlKey)&&!(yc&&n.ctrlKey&&n.altKey)&&(i=dc[n.keyCode])&&i!=r){let r=t[Sc(i,n)];if(r&&r(e.state,e.dispatch,e))return!0}}return!1}}var Tc=Object.defineProperty,Ec=(e,t)=>{for(var n in t)Tc(e,n,{get:t[n],enumerable:!0})};function Dc(e){let{state:t,transaction:n}=e,{selection:r}=n,{doc:i}=n,{storedMarks:a}=n;return{...t,apply:t.apply.bind(t),applyTransaction:t.applyTransaction.bind(t),plugins:t.plugins,schema:t.schema,reconfigure:t.reconfigure.bind(t),toJSON:t.toJSON.bind(t),get storedMarks(){return a},get selection(){return r},get doc(){return i},get tr(){return r=n.selection,i=n.doc,a=n.storedMarks,n}}}var Oc=class{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){let{rawCommands:e,editor:t,state:n}=this,{view:r}=t,{tr:i}=n,a=this.buildProps(i);return Object.fromEntries(Object.entries(e).map(([e,t])=>[e,(...e)=>{let n=t(...e)(a);return!i.getMeta(`preventDispatch`)&&!this.hasCustomState&&r.dispatch(i),n}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){let{rawCommands:n,editor:r,state:i}=this,{view:a}=r,o=[],s=!!e,c=e||i.tr,l=()=>(!s&&t&&!c.getMeta(`preventDispatch`)&&!this.hasCustomState&&a.dispatch(c),o.every(e=>e===!0)),u={...Object.fromEntries(Object.entries(n).map(([e,n])=>[e,(...e)=>{let r=this.buildProps(c,t),i=n(...e)(r);return o.push(i),u}])),run:l};return u}createCan(e){let{rawCommands:t,state:n}=this,r=e||n.tr,i=this.buildProps(r,!1);return{...Object.fromEntries(Object.entries(t).map(([e,t])=>[e,(...e)=>t(...e)({...i,dispatch:void 0})])),chain:()=>this.createChain(r,!1)}}buildProps(e,t=!0){let{rawCommands:n,editor:r,state:i}=this,{view:a}=r,o={tr:e,editor:r,view:a,state:Dc({state:i,transaction:e}),dispatch:t?()=>void 0:void 0,chain:()=>this.createChain(e,t),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(n).map(([e,t])=>[e,(...e)=>t(...e)(o)]))}};return o}},kc={};Ec(kc,{blur:()=>Ac,clearContent:()=>jc,clearNodes:()=>Mc,command:()=>Nc,createParagraphNear:()=>Pc,cut:()=>Fc,deleteCurrentNode:()=>Ic,deleteNode:()=>Rc,deleteRange:()=>zc,deleteSelection:()=>Uc,enter:()=>Wc,exitCode:()=>Gc,extendMarkRange:()=>Qc,first:()=>$c,focus:()=>ol,forEach:()=>sl,insertContent:()=>cl,insertContentAt:()=>ml,joinBackward:()=>_l,joinDown:()=>gl,joinForward:()=>vl,joinItemBackward:()=>yl,joinItemForward:()=>bl,joinTextblockBackward:()=>xl,joinTextblockForward:()=>Sl,joinUp:()=>hl,keyboardShortcut:()=>Tl,lift:()=>Dl,liftEmptyBlock:()=>Ol,liftListItem:()=>kl,newlineInCode:()=>Al,resetAttributes:()=>Nl,scrollIntoView:()=>Pl,selectAll:()=>Fl,selectNodeBackward:()=>Il,selectNodeForward:()=>Ll,selectParentNode:()=>Rl,selectTextblockEnd:()=>zl,selectTextblockStart:()=>Bl,setContent:()=>Hl,setMark:()=>Pu,setMeta:()=>Fu,setNode:()=>Iu,setNodeSelection:()=>Lu,setTextDirection:()=>Ru,setTextSelection:()=>zu,sinkListItem:()=>Bu,splitBlock:()=>Hu,splitListItem:()=>Uu,toggleList:()=>Yu,toggleMark:()=>Xu,toggleNode:()=>Zu,toggleWrap:()=>Qu,undoInputRule:()=>$u,unsetAllMarks:()=>ed,unsetMark:()=>td,unsetTextDirection:()=>nd,updateAttributes:()=>rd,wrapIn:()=>id,wrapInList:()=>ad});var Ac=()=>({editor:e,view:t})=>(requestAnimationFrame(()=>{var n;e.isDestroyed||(t.dom.blur(),(n=window==null?void 0:window.getSelection())==null||n.removeAllRanges())}),!0),jc=(e=!0)=>({commands:t})=>t.setContent(``,{emitUpdate:e}),Mc=()=>({state:e,tr:t,dispatch:n})=>{let{selection:r}=t,{ranges:i}=r;return n&&i.forEach(({$from:n,$to:r})=>{e.doc.nodesBetween(n.pos,r.pos,(e,n)=>{if(e.type.isText)return;let{doc:r,mapping:i}=t,a=r.resolve(i.map(n)),o=r.resolve(i.map(n+e.nodeSize)),s=a.blockRange(o);if(!s)return;let c=Vt(s);if(e.type.isTextblock){let{defaultType:e}=a.parent.contentMatchAt(a.index());t.setNodeMarkup(s.start,e)}(c||c===0)&&t.lift(s,c)})}),!0},Nc=e=>t=>e(t),Pc=()=>({state:e,dispatch:t})=>_r(e,t),Fc=(e,t)=>({editor:n,tr:r})=>{let{state:i}=n,a=i.doc.slice(e.from,e.to);r.deleteRange(e.from,e.to);let o=r.mapping.map(t);return r.insert(o,a.content),r.setSelection(new P(r.doc.resolve(Math.max(o-1,0)))),!0},Ic=()=>({tr:e,dispatch:t})=>{let{selection:n}=e,r=n.$anchor.node();if(r.content.size>0)return!1;let i=e.selection.$anchor;for(let n=i.depth;n>0;--n)if(i.node(n).type===r.type){if(t){let t=i.before(n),r=i.after(n);e.delete(t,r).scrollIntoView()}return!0}return!1};function Lc(e,t){if(typeof e==`string`){if(!t.nodes[e])throw Error(`There is no node type named '${e}'. Maybe you forgot to add the extension?`);return t.nodes[e]}return e}var Rc=e=>({tr:t,state:n,dispatch:r})=>{let i=Lc(e,n.schema),a=t.selection.$anchor;for(let e=a.depth;e>0;--e)if(a.node(e).type===i){if(r){let n=a.before(e),r=a.after(e);t.delete(n,r).scrollIntoView()}return!0}return!1},zc=e=>({tr:t,dispatch:n})=>{let{from:r,to:i}=e;return n&&t.delete(r,i),!0},Bc=e=>e.content?/^text(\*|\+)/.test(e.content):!1,Vc=(e,t,n)=>{if(!e.parent.isInline||n===`left`&&e.pos>e.start()||n===`right`&&e.pos<e.end())return e.pos;let r=t.nodes[e.parent.type.name].spec;return Bc(r)?n===`left`?e.start()-1:e.end()+1:e.pos},Hc=(e,t,n)=>({from:Vc(e,n,`left`),to:Vc(t,n,`right`)}),Uc=()=>({state:e,dispatch:t})=>{let{$from:n,$to:r}=e.selection;if(e.selection.empty)return!1;let{from:i,to:a}=Hc(n,r,e.schema);return t&&(e.tr.deleteRange(i,a).scrollIntoView(),t(e.tr)),!0},Wc=()=>({commands:e})=>e.keyboardShortcut(`Enter`),Gc=()=>({state:e,dispatch:t})=>gr(e,t);function Kc(e){return Object.prototype.toString.call(e)===`[object RegExp]`}function qc(e,t,n={strict:!0}){let r=Object.keys(t);return r.length?r.every(r=>n.strict?t[r]===e[r]:Kc(t[r])?t[r].test(e[r]):t[r]===e[r]):!0}function Jc(e,t,n={}){return e.find(e=>e.type===t&&qc(Object.fromEntries(Object.keys(n).map(t=>[t,e.attrs[t]])),n))}function Yc(e,t,n={}){return!!Jc(e,t,n)}function Xc(e,t,n){if(!e||!t)return;let r=e.parent.childAfter(e.parentOffset);if((!r.node||!r.node.marks.some(e=>e.type===t))&&(r=e.parent.childBefore(e.parentOffset)),!r.node||!r.node.marks.some(e=>e.type===t))return;if(!n){let e=r.node.marks.find(e=>e.type===t);e&&(n=e.attrs)}if(!Jc([...r.node.marks],t,n))return;let i=r.index,a=e.start()+r.offset,o=i+1,s=a+r.node.nodeSize;for(;i>0&&Yc([...e.parent.child(i-1).marks],t,n);)--i,a-=e.parent.child(i).nodeSize;for(;o<e.parent.childCount&&Yc([...e.parent.child(o).marks],t,n);)s+=e.parent.child(o).nodeSize,o+=1;return{from:a,to:s}}function Zc(e,t){if(typeof e==`string`){if(!t.marks[e])throw Error(`There is no mark type named '${e}'. Maybe you forgot to add the extension?`);return t.marks[e]}return e}var Qc=(e,t)=>({tr:n,state:r,dispatch:i})=>{let a=Zc(e,r.schema),{doc:o,selection:s}=n,{$from:c,from:l,to:u}=s;if(i){let e=Xc(c,a,t);if(e&&e.from<=l&&e.to>=u){let t=P.create(o,e.from,e.to);n.setSelection(t)}}return!0},$c=e=>t=>{let n=typeof e==`function`?e(t):e;for(let e=0;e<n.length;e+=1)if(n[e](t))return!0;return!1};function el(e){return e instanceof P}function tl(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function nl(e,t=null){if(!t)return null;let n=N.atStart(e),r=N.atEnd(e);if(t===`start`||t===!0)return n;if(t===`end`)return r;let i=n.from,a=r.to;return t===`all`?P.create(e,tl(0,i,a),tl(e.content.size,i,a)):P.create(e,tl(t,i,a),tl(t,i,a))}function rl(){return navigator.platform===`Android`||/android/i.test(navigator.userAgent)}function il(){return[`iPad Simulator`,`iPhone Simulator`,`iPod Simulator`,`iPad`,`iPhone`,`iPod`].includes(navigator.platform)||navigator.userAgent.includes(`Mac`)&&`ontouchend`in document}function al(){return typeof navigator<`u`?/^((?!chrome|android).)*safari/i.test(navigator.userAgent):!1}var ol=(e=null,t={})=>({editor:n,view:r,tr:i,dispatch:a})=>{t={scrollIntoView:!0,...t};let o=()=>{(il()||rl())&&r.dom.focus(),al()&&!il()&&!rl()&&r.dom.focus({preventScroll:!0}),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),t?.scrollIntoView&&n.commands.scrollIntoView())})};try{if(r.hasFocus()&&e===null||e===!1)return!0}catch{return!1}if(a&&e===null&&!el(n.state.selection))return o(),!0;let s=nl(i.doc,e)||n.state.selection,c=n.state.selection.eq(s);return a&&(c||i.setSelection(s),c&&i.storedMarks&&i.setStoredMarks(i.storedMarks),o()),!0},sl=(e,t)=>n=>e.every((e,r)=>t(e,{...n,index:r})),cl=(e,t)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},e,t),ll=e=>{let t=e.childNodes;for(let n=t.length-1;n>=0;--n){let r=t[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?e.removeChild(r):r.nodeType===1&&ll(r)}return e};function ul(e){if(typeof window>`u`)throw Error(`[tiptap error]: there is no window object available, so this function cannot be used`);let t=`<body>${e}</body>`,n=new window.DOMParser().parseFromString(t,`text/html`).body;return ll(n)}function dl(e,t,n){if(e instanceof ve||e instanceof E)return e;n={slice:!0,parseOptions:{},...n};let r=typeof e==`object`&&!!e,i=typeof e==`string`;if(r)try{if(Array.isArray(e)&&e.length>0)return E.fromArray(e.map(e=>t.nodeFromJSON(e)));let r=t.nodeFromJSON(e);return n.errorOnInvalidContent&&r.check(),r}catch(r){if(n.errorOnInvalidContent)throw Error(`[tiptap error]: Invalid JSON content`,{cause:r});return console.warn(`[tiptap warn]: Invalid content.`,`Passed value:`,e,`Error:`,r),dl(``,t,n)}if(i){if(n.errorOnInvalidContent){let r=!1,i=``,a=new Ue({topNode:t.spec.topNode,marks:t.spec.marks,nodes:t.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:`inline*`,group:`block`,parseDOM:[{tag:`*`,getAttrs:e=>(r=!0,i=typeof e==`string`?e:e.outerHTML,null)}]}})});if(n.slice?qe.fromSchema(a).parseSlice(ul(e),n.parseOptions):qe.fromSchema(a).parse(ul(e),n.parseOptions),n.errorOnInvalidContent&&r)throw Error(`[tiptap error]: Invalid HTML content`,{cause:Error(`Invalid element found: ${i}`)})}let r=qe.fromSchema(t);return n.slice?r.parseSlice(ul(e),n.parseOptions).content:r.parse(ul(e),n.parseOptions)}return dl(``,t,n)}function fl(e,t,n){let r=e.steps.length-1;if(r<t)return;let i=e.steps[r];if(!(i instanceof Pt||i instanceof Ft))return;let a=e.mapping.maps[r],o=0;a.forEach((e,t,n,r)=>{o===0&&(o=r)}),e.setSelection(N.near(e.doc.resolve(o),n))}var pl=e=>!(`type`in e),ml=(e,t,n)=>({tr:r,dispatch:i,editor:a})=>{if(i){n={parseOptions:a.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let i,o=e=>{a.emit(`contentError`,{editor:a,error:e,disableCollaboration:()=>{`collaboration`in a.storage&&typeof a.storage.collaboration==`object`&&a.storage.collaboration&&(a.storage.collaboration.isDisabled=!0)}})},s={preserveWhitespace:`full`,...n.parseOptions};if(!n.errorOnInvalidContent&&!a.options.enableContentCheck&&a.options.emitContentError)try{dl(t,a.schema,{parseOptions:s,errorOnInvalidContent:!0})}catch(e){o(e)}try{i=dl(t,a.schema,{parseOptions:s,errorOnInvalidContent:n.errorOnInvalidContent??a.options.enableContentCheck})}catch(e){return o(e),!1}let{from:c,to:l}=typeof e==`number`?{from:e,to:e}:{from:e.from,to:e.to},u=!0,d=!0;if((pl(i)?i:[i]).forEach(e=>{e.check(),u=u?e.isText&&e.marks.length===0:!1,d=d?e.isBlock:!1}),c===l&&d){let{parent:e}=r.doc.resolve(c);e.isTextblock&&!e.type.spec.code&&!e.childCount&&(--c,l+=1)}let f;if(u){if(Array.isArray(t))f=t.map(e=>e.text||``).join(``);else if(t instanceof E){let e=``;t.forEach(t=>{t.text&&(e+=t.text)}),f=e}else f=typeof t==`object`&&t&&t.text?t.text:t;r.insertText(f,c,l)}else{f=i;let e=r.doc.resolve(c),t=e.node(),n=e.parentOffset===0,a=t.isText||t.isTextblock,o=t.content.size>0;n&&a&&o&&d&&(c=Math.max(0,c-1)),r.replaceWith(c,l,f)}n.updateSelection&&fl(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta(`applyInputRules`,{from:c,text:f}),n.applyPasteRules&&r.setMeta(`applyPasteRules`,{from:c,text:f})}return!0},hl=()=>({state:e,dispatch:t})=>dr(e,t),gl=()=>({state:e,dispatch:t})=>fr(e,t),_l=()=>({state:e,dispatch:t})=>er(e,t),vl=()=>({state:e,dispatch:t})=>cr(e,t),yl=()=>({state:e,dispatch:t,tr:n})=>{try{let r=an(e.doc,e.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),t&&t(n),!0)}catch{return!1}},bl=()=>({state:e,dispatch:t,tr:n})=>{try{let r=an(e.doc,e.selection.$from.pos,1);return r==null?!1:(n.join(r,2),t&&t(n),!0)}catch{return!1}},xl=()=>({state:e,dispatch:t})=>tr(e,t),Sl=()=>({state:e,dispatch:t})=>nr(e,t);function Cl(){return typeof navigator<`u`?/Mac/.test(navigator.platform):!1}function wl(e){let t=e.split(/-(?!$)/),n=t[t.length-1];n===`Space`&&(n=` `);let r,i,a,o;for(let e=0;e<t.length-1;e+=1){let n=t[e];if(/^(cmd|meta|m)$/i.test(n))o=!0;else if(/^a(lt)?$/i.test(n))r=!0;else if(/^(c|ctrl|control)$/i.test(n))i=!0;else if(/^s(hift)?$/i.test(n))a=!0;else if(/^mod$/i.test(n))il()||Cl()?o=!0:i=!0;else throw Error(`Unrecognized modifier name: ${n}`)}return r&&(n=`Alt-${n}`),i&&(n=`Ctrl-${n}`),o&&(n=`Meta-${n}`),a&&(n=`Shift-${n}`),n}var Tl=e=>({editor:t,view:n,tr:r,dispatch:i})=>{let a=wl(e).split(/-(?!$)/),o=a.find(e=>![`Alt`,`Ctrl`,`Meta`,`Shift`].includes(e)),s=new KeyboardEvent(`keydown`,{key:o===`Space`?` `:o,altKey:a.includes(`Alt`),ctrlKey:a.includes(`Ctrl`),metaKey:a.includes(`Meta`),shiftKey:a.includes(`Shift`),bubbles:!0,cancelable:!0});return t.captureTransaction(()=>{n.someProp(`handleKeyDown`,e=>e(n,s))})?.steps.forEach(e=>{let t=e.map(r.mapping);t&&i&&r.maybeStep(t)}),!0};function El(e,t,n={}){let{from:r,to:i,empty:a}=e.selection,o=t?Lc(t,e.schema):null,s=[];e.doc.nodesBetween(r,i,(e,t)=>{if(e.isText)return;let n=Math.max(r,t),a=Math.min(i,t+e.nodeSize);s.push({node:e,from:n,to:a})});let c=i-r,l=s.filter(e=>o?o.name===e.node.type.name:!0).filter(e=>qc(e.node.attrs,n,{strict:!1}));return a?!!l.length:l.reduce((e,t)=>e+t.to-t.from,0)>=c}var Dl=(e,t={})=>({state:n,dispatch:r})=>El(n,Lc(e,n.schema),t)?pr(n,r):!1,Ol=()=>({state:e,dispatch:t})=>vr(e,t),kl=e=>({state:t,dispatch:n})=>Rr(Lc(e,t.schema))(t,n),Al=()=>({state:e,dispatch:t})=>mr(e,t);function jl(e,t){return t.nodes[e]?`node`:t.marks[e]?`mark`:null}function Ml(e,t){let n=typeof t==`string`?[t]:t;return Object.keys(e).reduce((t,r)=>(n.includes(r)||(t[r]=e[r]),t),{})}var Nl=(e,t)=>({tr:n,state:r,dispatch:i})=>{let a=null,o=null,s=jl(typeof e==`string`?e:e.name,r.schema);if(!s)return!1;s===`node`&&(a=Lc(e,r.schema)),s===`mark`&&(o=Zc(e,r.schema));let c=!1;return n.selection.ranges.forEach(e=>{r.doc.nodesBetween(e.$from.pos,e.$to.pos,(e,r)=>{a&&a===e.type&&(c=!0,i&&n.setNodeMarkup(r,void 0,Ml(e.attrs,t))),o&&e.marks.length&&e.marks.forEach(a=>{o===a.type&&(c=!0,i&&n.addMark(r,r+e.nodeSize,o.create(Ml(a.attrs,t))))})})}),c},Pl=()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),Fl=()=>({tr:e,dispatch:t})=>{if(t){let t=new Pn(e.doc);e.setSelection(t)}return!0},Il=()=>({state:e,dispatch:t})=>ar(e,t),Ll=()=>({state:e,dispatch:t})=>lr(e,t),Rl=()=>({state:e,dispatch:t})=>xr(e,t),zl=()=>({state:e,dispatch:t})=>Dr(e,t),Bl=()=>({state:e,dispatch:t})=>Er(e,t);function Vl(e,t,n={},r={}){return dl(e,t,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}var Hl=(e,{errorOnInvalidContent:t,emitUpdate:n=!0,parseOptions:r={}}={})=>({editor:i,tr:a,dispatch:o,commands:s})=>{let{doc:c}=a;if(r.preserveWhitespace!==`full`){let s=Vl(e,i.schema,r,{errorOnInvalidContent:t??i.options.enableContentCheck});return o&&a.replaceWith(0,c.content.size,s).setMeta(`preventUpdate`,!n),!0}return o&&a.setMeta(`preventUpdate`,!n),s.insertContentAt({from:0,to:c.content.size},e,{parseOptions:r,errorOnInvalidContent:t??i.options.enableContentCheck})};function Ul(e,t){let n=Zc(t,e.schema),{from:r,to:i,empty:a}=e.selection,o=[];a?(e.storedMarks&&o.push(...e.storedMarks),o.push(...e.selection.$head.marks())):e.doc.nodesBetween(r,i,e=>{o.push(...e.marks)});let s=o.find(e=>e.type.name===n.name);return s?{...s.attrs}:{}}function Wl(e,t){let n=new Dn(e);return t.forEach(e=>{e.steps.forEach(e=>{n.step(e)})}),n}function Gl(e){for(let t=0;t<e.edgeCount;t+=1){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function Kl(e,t,n){let r=[];return e.nodesBetween(t.from,t.to,(e,t)=>{n(e)&&r.push({node:e,pos:t})}),r}function z(e,t){for(let n=e.depth;n>0;--n){let r=e.node(n);if(t(r))return{pos:n>0?e.before(n):0,start:e.start(n),depth:n,node:r}}}function B(e){return t=>z(t.$from,e)}function V(e,t,n){return e.config[t]===void 0&&e.parent?V(e.parent,t,n):typeof e.config[t]==`function`?e.config[t].bind({...n,parent:e.parent?V(e.parent,t,n):null}):e.config[t]}function H(e){return e.map(e=>{let t=V(e,`addExtensions`,{name:e.name,options:e.options,storage:e.storage});return t?[e,...H(t())]:e}).flat(10)}function U(e,t){let n=st.fromSchema(t).serializeFragment(e),r=document.implementation.createHTMLDocument().createElement(`div`);return r.appendChild(n),r.innerHTML}function ql(e){return typeof e==`function`}function W(e,t=void 0,...n){return ql(e)?t?e.bind(t)(...n):e(...n):e}function Jl(e={}){return Object.keys(e).length===0&&e.constructor===Object}function Yl(e){return{baseExtensions:e.filter(e=>e.type===`extension`),nodeExtensions:e.filter(e=>e.type===`node`),markExtensions:e.filter(e=>e.type===`mark`)}}function Xl(e){let t=[],{nodeExtensions:n,markExtensions:r}=Yl(e),i=[...n,...r],a={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1},o=n.filter(e=>e.name!==`text`).map(e=>e.name),s=r.map(e=>e.name),c=[...o,...s];return e.forEach(e=>{let n=V(e,`addGlobalAttributes`,{name:e.name,options:e.options,storage:e.storage,extensions:i});n&&n().forEach(e=>{let n;n=Array.isArray(e.types)?e.types:e.types===`*`?c:e.types===`nodes`?o:e.types===`marks`?s:[],n.forEach(n=>{Object.entries(e.attributes).forEach(([e,r])=>{t.push({type:n,name:e,attribute:{...a,...r}})})})})}),i.forEach(e=>{let n=V(e,`addAttributes`,{name:e.name,options:e.options,storage:e.storage});if(!n)return;let r=n();Object.entries(r).forEach(([n,r])=>{let i={...a,...r};typeof i?.default==`function`&&(i.default=i.default()),i?.isRequired&&i?.default===void 0&&delete i.default,t.push({type:e.name,name:n,attribute:i})})}),t}function Zl(e){let t=[],n=``,r=!1,i=!1,a=0,o=e.length;for(let s=0;s<o;s+=1){let o=e[s];if(o===`'`&&!i){r=!r,n+=o;continue}if(o===`"`&&!r){i=!i,n+=o;continue}if(!r&&!i){if(o===`(`){a+=1,n+=o;continue}if(o===`)`&&a>0){--a,n+=o;continue}if(o===`;`&&a===0){t.push(n),n=``;continue}}n+=o}return n&&t.push(n),t}function Ql(e){let t=[],n=Zl(e||``),r=n.length;for(let e=0;e<r;e+=1){let r=n[e],i=r.indexOf(`:`);if(i===-1)continue;let a=r.slice(0,i).trim(),o=r.slice(i+1).trim();a&&o&&t.push([a,o])}return t}function G(...e){return e.filter(e=>!!e).reduce((e,t)=>{let n={...e};return Object.entries(t).forEach(([e,t])=>{if(!n[e]){n[e]=t;return}if(e===`class`){let r=t?String(t).split(` `):[],i=n[e]?n[e].split(` `):[],a=r.filter(e=>!i.includes(e));n[e]=[...i,...a].join(` `)}else if(e===`style`){let r=new Map([...Ql(n[e]),...Ql(t)]);n[e]=Array.from(r.entries()).map(([e,t])=>`${e}: ${t}`).join(`; `)}else n[e]=t}),n},{})}function $l(e,t){return t.filter(t=>t.type===e.type.name).filter(e=>e.attribute.rendered).map(t=>t.attribute.renderHTML?t.attribute.renderHTML(e.attrs)||{}:{[t.name]:e.attrs[t.name]}).reduce((e,t)=>G(e,t),{})}function eu(e){return typeof e==`string`?e.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(e):e===`true`?!0:e===`false`?!1:e:e}function tu(e,t){return`style`in e?e:{...e,getAttrs:n=>{let r=e.getAttrs?e.getAttrs(n):e.attrs;if(r===!1)return!1;let i=t.reduce((e,t)=>{let r=t.attribute.parseHTML?t.attribute.parseHTML(n):eu(n.getAttribute(t.name));return r==null?e:{...e,[t.name]:r}},{});return{...r,...i}}}}function nu(e){return Object.fromEntries(Object.entries(e).filter(([e,t])=>e===`attrs`&&Jl(t)?!1:t!=null))}function ru(e){let t={};return!e?.attribute?.isRequired&&`default`in(e?.attribute||{})&&(t.default=e.attribute.default),e?.attribute?.validate!==void 0&&(t.validate=e.attribute.validate),[e.name,t]}function iu(e,t){let n=Xl(e),{nodeExtensions:r,markExtensions:i}=Yl(e);return new Ue({topNode:r.find(e=>V(e,`topNode`))?.name,nodes:Object.fromEntries(r.map(r=>{let i=n.filter(e=>e.type===r.name),a={name:r.name,options:r.options,storage:r.storage,editor:t},o=nu({...e.reduce((e,t)=>{let n=V(t,`extendNodeSchema`,a);return{...e,...n?n(r):{}}},{}),content:W(V(r,`content`,a)),marks:W(V(r,`marks`,a)),group:W(V(r,`group`,a)),inline:W(V(r,`inline`,a)),atom:W(V(r,`atom`,a)),selectable:W(V(r,`selectable`,a)),draggable:W(V(r,`draggable`,a)),code:W(V(r,`code`,a)),whitespace:W(V(r,`whitespace`,a)),linebreakReplacement:W(V(r,`linebreakReplacement`,a)),defining:W(V(r,`defining`,a)),isolating:W(V(r,`isolating`,a)),attrs:Object.fromEntries(i.map(ru))}),s=W(V(r,`parseHTML`,a));s&&(o.parseDOM=s.map(e=>tu(e,i)));let c=V(r,`renderHTML`,a);c&&(o.toDOM=e=>c({node:e,HTMLAttributes:$l(e,i)}));let l=V(r,`renderText`,a);return l&&(o.toText=l),[r.name,o]})),marks:Object.fromEntries(i.map(r=>{let i=n.filter(e=>e.type===r.name),a={name:r.name,options:r.options,storage:r.storage,editor:t},o=nu({...e.reduce((e,t)=>{let n=V(t,`extendMarkSchema`,a);return{...e,...n?n(r):{}}},{}),inclusive:W(V(r,`inclusive`,a)),excludes:W(V(r,`excludes`,a)),group:W(V(r,`group`,a)),spanning:W(V(r,`spanning`,a)),code:W(V(r,`code`,a)),attrs:Object.fromEntries(i.map(ru))}),s=W(V(r,`parseHTML`,a));s&&(o.parseDOM=s.map(e=>tu(e,i)));let c=V(r,`renderHTML`,a);return c&&(o.toDOM=e=>c({mark:e,HTMLAttributes:$l(e,i)})),[r.name,o]}))})}function au(e){let t=e.filter((t,n)=>e.indexOf(t)!==n);return Array.from(new Set(t))}function ou(e){return e.sort((e,t)=>{let n=V(e,`priority`)||100,r=V(t,`priority`)||100;return n>r?-1:+(n<r)})}function su(e){let t=ou(H(e)),n=au(t.map(e=>e.name));return n.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map(e=>`'${e}'`).join(`, `)}]. This can lead to issues.`),t}function cu(e,t,n){let{from:r,to:i}=t,{blockSeparator:a=`
|
|
38
|
+
|
|
39
|
+
`,textSerializers:o={}}=n||{},s=``;return e.nodesBetween(r,i,(e,n,c,l)=>{e.isBlock&&n>r&&(s+=a);let u=o?.[e.type.name];if(u)return c&&(s+=u({node:e,pos:n,parent:c,index:l,range:t})),!1;e.isText&&(s+=(e?.text)?.slice(Math.max(r,n)-n,i-n))}),s}function lu(e,t){return cu(e,{from:0,to:e.content.size},t)}function uu(e){return Object.fromEntries(Object.entries(e.nodes).filter(([,e])=>e.spec.toText).map(([e,t])=>[e,t.spec.toText]))}function du(e,t){let n=Lc(t,e.schema),{from:r,to:i}=e.selection,a=[];e.doc.nodesBetween(r,i,e=>{a.push(e)});let o=a.reverse().find(e=>e.type.name===n.name);return o?{...o.attrs}:{}}function fu(e,t){let n=jl(typeof t==`string`?t:t.name,e.schema);return n===`node`?du(e,t):n===`mark`?Ul(e,t):{}}function pu(e,t=JSON.stringify){let n={};return e.filter(e=>{let r=t(e);return Object.prototype.hasOwnProperty.call(n,r)?!1:n[r]=!0})}function mu(e){let t=pu(e);return t.length===1?t:t.filter((e,n)=>!t.filter((e,t)=>t!==n).some(t=>e.oldRange.from>=t.oldRange.from&&e.oldRange.to<=t.oldRange.to&&e.newRange.from>=t.newRange.from&&e.newRange.to<=t.newRange.to))}function hu(e){let{mapping:t,steps:n}=e,r=[];return t.maps.forEach((e,i)=>{let a=[];if(e.ranges.length)e.forEach((e,t)=>{a.push({from:e,to:t})});else{let{from:e,to:t}=n[i];if(e===void 0||t===void 0)return;a.push({from:e,to:t})}a.forEach(({from:e,to:n})=>{let a=t.slice(i).map(e,-1),o=t.slice(i).map(n),s=t.invert().map(a,-1),c=t.invert().map(o);r.push({oldRange:{from:s,to:c},newRange:{from:a,to:o}})})}),mu(r)}function gu(e,t,n){let r=[];return e===t?n.resolve(e).marks().forEach(t=>{let i=Xc(n.resolve(e),t.type);i&&r.push({mark:t,...i})}):n.nodesBetween(e,t,(e,t)=>{!e||e?.nodeSize===void 0||r.push(...e.marks.map(n=>({from:t,to:t+e.nodeSize,mark:n})))}),r}var _u=(e,t,n,r=20)=>{let i=e.doc.resolve(n),a=r,o=null;for(;a>0&&o===null;){let e=i.node(a);e?.type.name===t?o=e:--a}return[o,a]};function vu(e,t){return t.nodes[e]||t.marks[e]||null}function yu(e,t,n){return Object.fromEntries(Object.entries(n).filter(([n])=>{let r=e.find(e=>e.type===t&&e.name===n);return r?r.attribute.keepOnSplit:!1}))}var bu=(e,t=500)=>{let n=``,r=e.parentOffset;return e.parent.nodesBetween(Math.max(0,r-t),r,(e,t,i,a)=>{var o;let s=(o=e.type.spec).toText?.call(o,{node:e,pos:t,parent:i,index:a})||e.textContent||`%leaf%`;n+=e.isAtom&&!e.isText?s:s.slice(0,Math.max(0,r-t))}),n};function xu(e,t,n={}){let{empty:r,ranges:i}=e.selection,a=t?Zc(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter(e=>a?a.name===e.type.name:!0).find(e=>qc(e.attrs,n,{strict:!1}));let o=0,s=[];if(i.forEach(({$from:t,$to:n})=>{let r=t.pos,i=n.pos;e.doc.nodesBetween(r,i,(e,t)=>{if(a&&e.inlineContent&&!e.type.allowsMarkType(a))return!1;if(!e.isText&&!e.marks.length)return;let n=Math.max(r,t),c=Math.min(i,t+e.nodeSize),l=c-n;o+=l,s.push(...e.marks.map(e=>({mark:e,from:n,to:c})))})}),o===0)return!1;let c=s.filter(e=>a?a.name===e.mark.type.name:!0).filter(e=>qc(e.mark.attrs,n,{strict:!1})).reduce((e,t)=>e+t.to-t.from,0),l=s.filter(e=>a?e.mark.type!==a&&e.mark.type.excludes(a):!0).reduce((e,t)=>e+t.to-t.from,0);return(c>0?c+l:c)>=o}function Su(e,t,n={}){if(!t)return El(e,null,n)||xu(e,null,n);let r=jl(t,e.schema);return r===`node`?El(e,t,n):r===`mark`?xu(e,t,n):!1}var Cu=(e,t)=>{let{$from:n,$to:r,$anchor:i}=e.selection;if(t){let n=B(e=>e.type.name===t)(e.selection);if(!n)return!1;let r=e.doc.resolve(n.pos+1);return i.pos+1===r.end()}return!(r.parentOffset<r.parent.nodeSize-2||n.pos!==r.pos)},wu=e=>{let{$from:t,$to:n}=e.selection;return!(t.parentOffset>0||t.pos!==n.pos)};function Tu(e,t){return Array.isArray(t)?t.some(t=>(typeof t==`string`?t:t.name)===e.name):t}function Eu(e,t){let{nodeExtensions:n}=Yl(t),r=n.find(t=>t.name===e);if(!r)return!1;let i=W(V(r,`group`,{name:r.name,options:r.options,storage:r.storage}));return typeof i==`string`?i.split(` `).includes(`list`):!1}function Du(e,{checkChildren:t=!0,ignoreWhitespace:n=!1}={}){if(n){if(e.type.name===`hardBreak`)return!0;if(e.isText)return!/\S/.test(e.text??``)}if(e.isText)return!e.text;if(e.isAtom||e.isLeaf)return!1;if(e.content.childCount===0)return!0;if(t){let r=!0;return e.content.forEach(e=>{r!==!1&&(Du(e,{ignoreWhitespace:n,checkChildren:t})||(r=!1))}),r}return!1}function Ou(e){return e instanceof F}function ku({selection:e,pos:t,nodeSize:n,selectedOnTextSelection:r=!1}){let{from:i,to:a}=e;return!!(i<=t&&a>=t+n||r&&el(e)&&i>t&&a<t+n)}var Au=class e{constructor(e){this.position=e}static fromJSON(t){return new e(t.position)}toJSON(){return{position:this.position}}};function ju(e,t){let n=t.mapping.mapResult(e.position);return{position:new Au(n.pos),mapResult:n}}function Mu(e){return new Au(e)}function Nu(e,t,n){let{selection:r}=t,i=null;if(el(r)&&(i=r.$cursor),i){let t=e.storedMarks??i.marks();return i.parent.type.allowsMarkType(n)&&(!!n.isInSet(t)||!t.some(e=>e.type.excludes(n)))}let{ranges:a}=r;return a.some(({$from:t,$to:r})=>{let i=t.depth===0?e.doc.inlineContent&&e.doc.type.allowsMarkType(n):!1;return e.doc.nodesBetween(t.pos,r.pos,(e,t,r)=>{if(i)return!1;if(e.isInline){let t=!r||r.type.allowsMarkType(n),a=!!n.isInSet(e.marks)||!e.marks.some(e=>e.type.excludes(n));i=t&&a}return!i}),i})}var Pu=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let{selection:a}=n,{empty:o,ranges:s}=a,c=Zc(e,r.schema);if(i)if(o){let e=Ul(r,c);n.addStoredMark(c.create({...e,...t}))}else s.forEach(e=>{let i=e.$from.pos,a=e.$to.pos;r.doc.nodesBetween(i,a,(e,r)=>{let o=Math.max(r,i),s=Math.min(r+e.nodeSize,a);e.marks.find(e=>e.type===c)?e.marks.forEach(e=>{c===e.type&&n.addMark(o,s,c.create({...e.attrs,...t}))}):n.addMark(o,s,c.create(t))})});return Nu(r,n,c)},Fu=(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),Iu=(e,t={})=>({state:n,dispatch:r,chain:i})=>{let a=Lc(e,n.schema),o;return n.selection.$anchor.sameParent(n.selection.$head)&&(o=n.selection.$anchor.parent.attrs),a.isTextblock?i().command(({commands:e})=>kr(a,{...o,...t})(n)?!0:e.clearNodes()).command(({state:e})=>kr(a,{...o,...t})(e,r)).run():(console.warn(`[tiptap warn]: Currently "setNode()" only supports text block nodes.`),!1)},Lu=e=>({tr:t,dispatch:n})=>{if(n){let{doc:n}=t,r=tl(e,0,n.content.size),i=F.create(n,r);t.setSelection(i)}return!0},Ru=(e,t)=>({tr:n,state:r,dispatch:i})=>{let{selection:a}=r,o,s;return typeof t==`number`?(o=t,s=t):t&&`from`in t&&`to`in t?(o=t.from,s=t.to):(o=a.from,s=a.to),i&&n.doc.nodesBetween(o,s,(t,r)=>{t.isText||n.setNodeMarkup(r,void 0,{...t.attrs,dir:e})}),!0},zu=e=>({tr:t,dispatch:n})=>{if(n){let{doc:n}=t,{from:r,to:i}=typeof e==`number`?{from:e,to:e}:e,a=P.atStart(n).from,o=P.atEnd(n).to,s=tl(r,a,o),c=tl(i,a,o),l=P.create(n,s,c);t.setSelection(l)}return!0},Bu=e=>({state:t,dispatch:n})=>Vr(Lc(e,t.schema))(t,n);function Vu(e,t){let n=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();if(n){let r=n.filter(e=>t?.includes(e.type.name));e.tr.ensureMarks(r)}}var Hu=({keepMarks:e=!0}={})=>({tr:t,state:n,dispatch:r,editor:i})=>{let{selection:a,doc:o}=t,{$from:s,$to:c}=a,l=i.extensionManager.attributes,u=yu(l,s.node().type.name,s.node().attrs);if(a instanceof F&&a.node.isBlock)return!s.parentOffset||!$t(o,s.pos)?!1:(r&&(e&&Vu(n,i.extensionManager.splittableMarks),t.split(s.pos).scrollIntoView()),!0);if(!s.parent.isBlock)return!1;let d=c.parentOffset===c.parent.content.size,f=s.depth===0?void 0:Gl(s.node(-1).contentMatchAt(s.indexAfter(-1))),p=d&&f?[{type:f,attrs:u}]:void 0,m=$t(t.doc,t.mapping.map(s.pos),1,p);if(!p&&!m&&$t(t.doc,t.mapping.map(s.pos),1,f?[{type:f}]:void 0)&&(m=!0,p=f?[{type:f,attrs:u}]:void 0),r){if(m&&(a instanceof P&&t.deleteSelection(),t.split(t.mapping.map(s.pos),1,p),f&&!d&&!s.parentOffset&&s.parent.type!==f)){let e=t.mapping.map(s.before()),n=t.doc.resolve(e);s.node(-1).canReplaceWith(n.index(),n.index()+1,f)&&t.setNodeMarkup(t.mapping.map(s.before()),f)}e&&Vu(n,i.extensionManager.splittableMarks),t.scrollIntoView()}return m},Uu=(e,t={})=>({tr:n,state:r,dispatch:i,editor:a})=>{let o=Lc(e,r.schema),{$from:s,$to:c}=r.selection,l=r.selection.node;if(l&&l.isBlock||s.depth<2||!s.sameParent(c))return!1;let u=s.node(-1);if(u.type!==o)return!1;let d=a.extensionManager.attributes;if(s.parent.content.size===0&&s.node(-1).childCount===s.indexAfter(-1)){if(s.depth===2||s.node(-3).type!==o||s.index(-2)!==s.node(-2).childCount-1)return!1;if(i){let e=E.empty,r=s.index(-1)?1:s.index(-2)?2:3;for(let t=s.depth-r;t>=s.depth-3;--t)e=E.from(s.node(t).copy(e));let i=s.indexAfter(-1)<s.node(-2).childCount?1:s.indexAfter(-2)<s.node(-3).childCount?2:3,a={...yu(d,s.node().type.name,s.node().attrs),...t},c=o.contentMatch.defaultType?.createAndFill(a)||void 0;e=e.append(E.from(o.createAndFill(null,c)||void 0));let l=s.before(s.depth-(r-1));n.replace(l,s.after(-i),new A(e,4-r,0));let u=-1;n.doc.nodesBetween(l,n.doc.content.size,(e,t)=>{if(u>-1)return!1;e.isTextblock&&e.content.size===0&&(u=t+1)}),u>-1&&n.setSelection(P.near(n.doc.resolve(u))),n.scrollIntoView()}return!0}let f=c.pos===s.end()?u.contentMatchAt(0).defaultType:null,p={...yu(d,u.type.name,u.attrs),...t},m={...yu(d,s.node().type.name,s.node().attrs),...t};n.delete(s.pos,c.pos);let h=f?[{type:o,attrs:p},{type:f,attrs:m}]:[{type:o,attrs:p}];if(!$t(n.doc,s.pos,2))return!1;if(i){let{selection:e,storedMarks:t}=r,{splittableMarks:o}=a.extensionManager,c=t||e.$to.parentOffset&&e.$from.marks();if(n.split(s.pos,2,h).scrollIntoView(),!c||!i)return!0;let l=c.filter(e=>o.includes(e.type.name));n.ensureMarks(l)}return!0};function Wu(e){return!e||e===`1`?null:e}function Gu(e,t){return Wu(e)===Wu(t)}var Ku=(e,t)=>{let n=B(e=>e.type===t)(e.selection);if(!n)return!0;let r=e.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;let i=e.doc.nodeAt(r);return!(n.node.type===i?.type&&tn(e.doc,n.pos))||!Gu(n.node.attrs.type,i?.attrs.type)||e.join(n.pos),!0},qu=(e,t)=>{let n=B(e=>e.type===t)(e.selection);if(!n)return!0;let r=e.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;let i=e.doc.nodeAt(r);return!(n.node.type===i?.type&&tn(e.doc,r))||!Gu(n.node.attrs.type,i?.attrs.type)||e.join(r),!0};function Ju(e){let t=e.doc,n=t.firstChild;if(!n)return null;let r=t.resolve(1),i=t.resolve(n.nodeSize-1);return P.between(r,i)}var Yu=(e,t,n,r={})=>({editor:i,tr:a,state:o,dispatch:s,chain:c,commands:l,can:u})=>{let{extensions:d,splittableMarks:f}=i.extensionManager,p=Lc(e,o.schema),m=Lc(t,o.schema),{selection:h,storedMarks:g}=o,{$from:_,$to:v}=h,y=_.blockRange(v),b=g||h.$to.parentOffset&&h.$from.marks();if(!y)return!1;let x=B(e=>Eu(e.type.name,d))(h),S=h.from===0&&h.to===o.doc.content.size,C=o.doc.content.content,w=C.length===1?C[0]:null,T=S&&w&&Eu(w.type.name,d)?{node:w,pos:0,depth:0}:null,E=x??T,ee=!!x&&y.depth>=1&&y.depth-x.depth<=1,D=!!T;if((ee||D)&&E){if(E.node.type===p)return S&&D?c().command(({tr:e,dispatch:t})=>{let n=Ju(e);return n?(e.setSelection(n),t&&t(e),!0):!1}).liftListItem(m).run():l.liftListItem(m);if(Eu(E.node.type.name,d)&&p.validContent(E.node.content))return c().command(()=>(a.setNodeMarkup(E.pos,p),!0)).command(()=>Ku(a,p)).command(()=>qu(a,p)).run()}return!n||!b||!s?c().command(()=>u().wrapInList(p,r)?!0:l.clearNodes()).wrapInList(p,r).command(()=>Ku(a,p)).command(()=>qu(a,p)).run():c().command(()=>{let e=u().wrapInList(p,r),t=b.filter(e=>f.includes(e.type.name));return a.ensureMarks(t),e?!0:l.clearNodes()}).wrapInList(p,r).command(()=>Ku(a,p)).command(()=>qu(a,p)).run()},Xu=(e,t={},n={})=>({state:r,commands:i})=>{let{extendEmptyMarkRange:a=!1}=n,o=Zc(e,r.schema);return xu(r,o,t)?i.unsetMark(o,{extendEmptyMarkRange:a}):i.setMark(o,t)},Zu=(e,t,n={})=>({state:r,commands:i})=>{let a=Lc(e,r.schema),o=Lc(t,r.schema),s=El(r,a,n),c;return r.selection.$anchor.sameParent(r.selection.$head)&&(c=r.selection.$anchor.parent.attrs),s?i.setNode(o,c):i.setNode(a,{...c,...n})},Qu=(e,t={})=>({state:n,commands:r})=>{let i=Lc(e,n.schema);return El(n,i,t)?r.lift(i):r.wrapIn(i,t)},$u=()=>({state:e,dispatch:t})=>{let n=e.plugins;for(let r=0;r<n.length;r+=1){let i=n[r],a;if(i.spec.isInputRules&&(a=i.getState(e))){if(t){let t=e.tr,n=a.transform;for(let e=n.steps.length-1;e>=0;--e)t.step(n.steps[e].invert(n.docs[e]));if(a.text){let n=t.doc.resolve(a.from).marks();t.replaceWith(a.from,a.to,e.schema.text(a.text,n))}else t.delete(a.from,a.to)}return!0}}return!1},ed=(e={})=>({tr:t,dispatch:n,editor:r})=>{let{ignoreClearable:i=!1}=e,{selection:a}=t,{empty:o,ranges:s}=a;if(o)return!0;let{nonClearableMarks:c}=r.extensionManager;if(n){let e=Object.values(r.schema.marks).filter(e=>i||!c.includes(e.name));s.forEach(n=>{for(let r of e)t.removeMark(n.$from.pos,n.$to.pos,r)})}return!0},td=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let{extendEmptyMarkRange:a=!1}=t,{selection:o}=n,s=Zc(e,r.schema),{$from:c,empty:l,ranges:u}=o;if(!i)return!0;if(l&&a){let{from:e,to:t}=o,r=Xc(c,s,c.marks().find(e=>e.type===s)?.attrs);r&&(e=r.from,t=r.to),n.removeMark(e,t,s)}else u.forEach(e=>{n.removeMark(e.$from.pos,e.$to.pos,s)});return n.removeStoredMark(s),!0},nd=e=>({tr:t,state:n,dispatch:r})=>{let{selection:i}=n,a,o;return typeof e==`number`?(a=e,o=e):e&&`from`in e&&`to`in e?(a=e.from,o=e.to):(a=i.from,o=i.to),r&&t.doc.nodesBetween(a,o,(e,n)=>{if(e.isText)return;let r={...e.attrs};delete r.dir,t.setNodeMarkup(n,void 0,r)}),!0},rd=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let a=null,o=null,s=jl(typeof e==`string`?e:e.name,r.schema);if(!s)return!1;s===`node`&&(a=Lc(e,r.schema)),s===`mark`&&(o=Zc(e,r.schema));let c=!1;return n.selection.ranges.forEach(e=>{let s=e.$from.pos,l=e.$to.pos,u,d,f,p;n.selection.empty?r.doc.nodesBetween(s,l,(e,t)=>{a&&a===e.type&&(c=!0,f=Math.max(t,s),p=Math.min(t+e.nodeSize,l),u=t,d=e)}):r.doc.nodesBetween(s,l,(e,r)=>{r<s&&a&&a===e.type&&(c=!0,f=Math.max(r,s),p=Math.min(r+e.nodeSize,l),u=r,d=e),r>=s&&r<=l&&(a&&a===e.type&&(c=!0,i&&n.setNodeMarkup(r,void 0,{...e.attrs,...t})),o&&e.marks.length&&e.marks.forEach(a=>{if(o===a.type&&(c=!0,i)){let i=Math.max(r,s),c=Math.min(r+e.nodeSize,l);n.addMark(i,c,o.create({...a.attrs,...t}))}}))}),d&&(u!==void 0&&i&&n.setNodeMarkup(u,void 0,{...d.attrs,...t}),o&&d.marks.length&&d.marks.forEach(e=>{o===e.type&&i&&n.addMark(f,p,o.create({...e.attrs,...t}))}))}),c},id=(e,t={})=>({state:n,dispatch:r})=>Or(Lc(e,n.schema),t)(n,r),ad=(e,t={})=>({state:n,dispatch:r})=>Fr(Lc(e,n.schema),t)(n,r),od=class{constructor(){this.callbacks={}}on(e,t){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),this}emit(e,...t){let n=this.callbacks[e];return n&&n.forEach(e=>e.apply(this,t)),this}off(e,t){let n=this.callbacks[e];return n&&(t?this.callbacks[e]=n.filter(e=>e!==t):delete this.callbacks[e]),this}once(e,t){let n=(...r)=>{this.off(e,n),t.apply(this,r)};return this.on(e,n)}removeAllListeners(){this.callbacks={}}};function sd(e,t){let{selection:n}=e,{$from:r}=n;if(n instanceof F){let e=r.index();return r.parent.canReplaceWith(e,e+1,t)}let i=r.depth;for(;i>=0;){let e=r.index(i);if(r.node(i).contentMatchAt(e).matchType(t))return!0;--i}return!1}function cd(e,t,n){let r=document.querySelector(`style[data-tiptap-style${n?`-${n}`:``}]`);if(r!==null)return r;let i=document.createElement(`style`);return t&&i.setAttribute(`nonce`,t),i.setAttribute(`data-tiptap-style${n?`-${n}`:``}`,``),i.innerHTML=e,document.getElementsByTagName(`head`)[0].appendChild(i),i}function ld(e,t){let n=e.getAttribute(`style`);if(!n)return null;let r=n.split(`;`).map(e=>e.trim()).filter(Boolean),i=t.toLowerCase();for(let e=r.length-1;e>=0;--e){let t=r[e],n=t.indexOf(`:`);if(n!==-1&&t.slice(0,n).trim().toLowerCase()===i)return t.slice(n+1).trim()}return null}function ud(e){return typeof e==`number`}function dd(e){return Object.prototype.toString.call(e).slice(8,-1)}function fd(e){return dd(e)===`Object`?e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype:!1}Ec({},{createAtomBlockMarkdownSpec:()=>hd,createBlockMarkdownSpec:()=>gd,createInlineMarkdownSpec:()=>yd,parseAttributes:()=>pd,parseIndentedBlocks:()=>bd,renderNestedMarkdownContent:()=>xd,serializeAttributes:()=>md});function pd(e){if(!e?.trim())return{};let t={},n=[],r=e.replace(/["']([^"']*)["']/g,e=>(n.push(e),`__QUOTED_${n.length-1}__`)),i=r.match(/(?:^|\s)\.([\w-]+)/g);i&&(t.class=i.map(e=>e.trim().slice(1)).join(` `));let a=r.match(/(?:^|\s)#([\w-]+)/);a&&(t.id=a[1]),Array.from(r.matchAll(/([a-zA-Z][\w-]*)\s*=\s*(__QUOTED_\d+__)/g)).forEach(([,e,r])=>{let i=n[parseInt(r.match(/__QUOTED_(\d+)__/)?.[1]||`0`,10)];i&&(t[e]=i.slice(1,-1))});let o=r.replace(/(?:^|\s)\.([\w-]+)/g,``).replace(/(?:^|\s)#([\w-]+)/g,``).replace(/([a-zA-Z][\w-]*)\s*=\s*__QUOTED_\d+__/g,``).trim();return o&&o.split(/\s+/).filter(Boolean).forEach(e=>{e.match(/^[a-zA-Z][\w-]*$/)&&(t[e]=!0)}),t}function md(e){if(!e||Object.keys(e).length===0)return``;let t=[];return e.class&&String(e.class).split(/\s+/).filter(Boolean).forEach(e=>t.push(`.${e}`)),e.id&&t.push(`#${e.id}`),Object.entries(e).forEach(([e,n])=>{e===`class`||e===`id`||(n===!0?t.push(e):n!==!1&&n!=null&&t.push(`${e}="${String(n)}"`))}),t.join(` `)}function hd(e){let{nodeName:t,name:n,parseAttributes:r=pd,serializeAttributes:i=md,defaultAttributes:a={},requiredAttributes:o=[],allowedAttributes:s}=e,c=n||t,l=e=>{if(!s)return e;let t={};return s.forEach(n=>{n in e&&(t[n]=e[n])}),t};return{parseMarkdown:(e,n)=>{let r={...a,...e.attributes};return n.createNode(t,r,[])},markdownTokenizer:{name:t,level:`block`,start(e){let t=RegExp(`^:::${c}(?:\\s|$)`,`m`),n=e.match(t)?.index;return n===void 0?-1:n},tokenize(e,n,i){let a=RegExp(`^:::${c}(?:\\s+\\{([^}]*)\\})?\\s*:::(?:\\n|$)`),s=e.match(a);if(!s)return;let l=r(s[1]||``);if(!o.find(e=>!(e in l)))return{type:t,raw:s[0],attributes:l}}},renderMarkdown:e=>{let t=i(l(e.attrs||{}));return`:::${c}${t?` {${t}}`:``} :::`}}}function gd(e){let{nodeName:t,name:n,getContent:r,parseAttributes:i=pd,serializeAttributes:a=md,defaultAttributes:o={},content:s=`block`,allowedAttributes:c}=e,l=n||t,u=e=>{if(!c)return e;let t={};return c.forEach(n=>{n in e&&(t[n]=e[n])}),t};return{parseMarkdown:(e,n)=>{let i;if(r){let t=r(e);i=typeof t==`string`?[{type:`text`,text:t}]:t}else i=s===`block`?n.parseChildren(e.tokens||[]):n.parseInline(e.tokens||[]);let a={...o,...e.attributes};return n.createNode(t,a,i)},markdownTokenizer:{name:t,level:`block`,start(e){let t=RegExp(`^:::${l}`,`m`),n=e.match(t)?.index;return n===void 0?-1:n},tokenize(e,n,r){let a=RegExp(`^:::${l}(?:\\s+\\{([^}]*)\\})?\\s*\\n`),o=e.match(a);if(!o)return;let[c,u=``]=o,d=i(u),f=1,p=c.length,m=``,h=/^:::([\w-]*)(\s.*)?/gm,g=e.slice(p);for(h.lastIndex=0;;){let n=h.exec(g);if(n===null)break;let i=n.index,a=n[1];if(!n[2]?.endsWith(`:::`)){if(a)f+=1;else if(--f,f===0){let a=g.slice(0,i);m=a.trim();let o=e.slice(0,p+i+n[0].length),c=[];if(m)if(s===`block`)for(c=r.blockTokens(a),c.forEach(e=>{e.text&&(!e.tokens||e.tokens.length===0)&&(e.tokens=r.inlineTokens(e.text))});c.length>0;){let e=c[c.length-1];if(e.type===`paragraph`&&(!e.text||e.text.trim()===``))c.pop();else break}else c=r.inlineTokens(m);return{type:t,raw:o,attributes:d,content:m,tokens:c}}}}}},renderMarkdown:(e,t)=>{let n=a(u(e.attrs||{}));return`:::${l}${n?` {${n}}`:``}
|
|
40
|
+
|
|
41
|
+
${t.renderChildren(e.content||[],`
|
|
42
|
+
|
|
43
|
+
`)}
|
|
44
|
+
|
|
45
|
+
:::`}}}function _d(e){if(!e.trim())return{};let t={},n=/(\w+)=(?:"([^"]*)"|'([^']*)')/g,r=n.exec(e);for(;r!==null;){let[,i,a,o]=r;t[i]=a||o,r=n.exec(e)}return t}function vd(e){return Object.entries(e).filter(([,e])=>e!=null).map(([e,t])=>`${e}="${t}"`).join(` `)}function yd(e){let{nodeName:t,name:n,getContent:r,parseAttributes:i=_d,serializeAttributes:a=vd,defaultAttributes:o={},selfClosing:s=!1,allowedAttributes:c}=e,l=n||t,u=e=>{if(!c)return e;let t={};return c.forEach(n=>{let r=typeof n==`string`?n:n.name,i=typeof n==`string`?void 0:n.skipIfDefault;if(r in e){let n=e[r];if(i!==void 0&&n===i)return;t[r]=n}}),t},d=l.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);return{parseMarkdown:(e,n)=>{let i={...o,...e.attributes};if(s)return n.createNode(t,i);let a=r?r(e):e.content||``;return a?n.createNode(t,i,[n.createTextNode(a)]):n.createNode(t,i,[])},markdownTokenizer:{name:t,level:`inline`,start(e){let t=RegExp(s?`\\[${d}\\s*[^\\]]*\\]`:`\\[${d}\\s*[^\\]]*\\][\\s\\S]*?\\[\\/${d}\\]`),n=e.match(t)?.index;return n===void 0?-1:n},tokenize(e,n,r){let a=RegExp(s?`^\\[${d}\\s*([^\\]]*)\\]`:`^\\[${d}\\s*([^\\]]*)\\]([\\s\\S]*?)\\[\\/${d}\\]`),o=e.match(a);if(!o)return;let c=``,l=``;if(s){let[,e]=o;l=e}else{let[,e,t]=o;l=e,c=t||``}let u=i(l.trim());return{type:t,raw:o[0],content:c.trim(),attributes:u}}},renderMarkdown:e=>{let t=``;r?t=r(e):e.content&&e.content.length>0&&(t=e.content.filter(e=>e.type===`text`).map(e=>e.text).join(``));let n=a(u(e.attrs||{})),i=n?` ${n}`:``;return s?`[${l}${i}]`:`[${l}${i}]${t}[/${l}]`}}}function bd(e,t,n){let r=e.split(`
|
|
46
|
+
`),i=[],a=``,o=0,s=t.baseIndentSize||2;for(;o<r.length;){let e=r[o],c=e.match(t.itemPattern);if(!c){if(i.length>0)break;if(e.trim()===``){o+=1,a=`${a}${e}
|
|
47
|
+
`;continue}else return}let l=t.extractItemData(c),{indentLevel:u,mainContent:d}=l;a=`${a}${e}
|
|
48
|
+
`;let f=[d];for(o+=1;o<r.length;){let e=r[o];if(e.trim()===``){let t=r.slice(o+1).findIndex(e=>e.trim()!==``);if(t===-1)break;if((r[o+1+t].match(/^(\s*)/)?.[1]?.length||0)>u){f.push(e),a=`${a}${e}
|
|
49
|
+
`,o+=1;continue}else break}if((e.match(/^(\s*)/)?.[1]?.length||0)>u)f.push(e),a=`${a}${e}
|
|
50
|
+
`,o+=1;else break}let p,m=f.slice(1);if(m.length>0){let e=m.map(e=>e.slice(u+s)).join(`
|
|
51
|
+
`);e.trim()&&(p=t.customNestedParser?t.customNestedParser(e):n.blockTokens(e))}let h=t.createToken(l,p);i.push(h)}if(i.length!==0)return{items:i,raw:a}}function xd(e,t,n,r){if(!e||!Array.isArray(e.content))return``;let i=typeof n==`function`?n(r):n,[a,...o]=e.content,s=`${i}${t.renderChildren([a])}`;return o&&o.length>0&&o.forEach((e,n)=>{let r=t.renderChild?.call(t,e,n+1)??t.renderChildren([e]);if(r!=null){let n=r.split(`
|
|
52
|
+
`).map(e=>e?t.indent(e):t.indent(``)).join(`
|
|
53
|
+
`);s+=e.type===`paragraph`?`
|
|
54
|
+
|
|
55
|
+
${n}`:`
|
|
56
|
+
${n}`}}),s}function Sd(e,t){let n={...e};return fd(e)&&fd(t)&&Object.keys(t).forEach(r=>{fd(t[r])&&fd(e[r])?n[r]=Sd(e[r],t[r]):n[r]=t[r]}),n}function Cd(e,t,n={}){let{state:r}=t,{doc:i,tr:a}=r,o=e;i.descendants((t,r)=>{let i=a.mapping.map(r),s=a.mapping.map(r)+t.nodeSize,c=null;if(t.marks.forEach(e=>{if(e!==o)return!1;c=e}),!c)return;let l=!1;if(Object.keys(n).forEach(e=>{n[e]!==c.attrs[e]&&(l=!0)}),l){let t=e.type.create({...e.attrs,...n});a.removeMark(i,s,e.type),a.addMark(i,s,t)}}),a.docChanged&&t.view.dispatch(a)}var wd=class{constructor(e){this.find=e.find,this.handler=e.handler,this.undoable=e.undoable??!0}},Td=(e,t)=>{if(Kc(t))return t.exec(e);let n=t(e);if(!n)return null;let r=[n.text];return r.index=n.index,r.input=e,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn(`[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".`),r.push(n.replaceWith)),r};function Ed(e){let{editor:t,from:n,to:r,text:i,rules:a,plugin:o}=e,{view:s}=t;if(s.composing)return!1;let c=s.state.doc.resolve(n);if(c.parent.type.spec.code||(c.nodeBefore||c.nodeAfter)?.marks.find(e=>e.type.spec.code))return!1;let l=!1,u=bu(c)+i;return a.forEach(e=>{if(l)return;let a=Td(u,e.find);if(!a)return;let c=s.state.tr,d=Dc({state:s.state,transaction:c}),f={from:n-(a[0].length-i.length),to:r},{commands:p,chain:m,can:h}=new Oc({editor:t,state:d});e.handler({state:d,range:f,match:a,commands:p,chain:m,can:h})===null||!c.steps.length||(e.undoable&&c.setMeta(o,{transform:c,from:n,to:r,text:i}),s.dispatch(c),l=!0)}),l}function K(e){let{editor:t,rules:n}=e,r=new Jn({state:{init(){return null},apply(e,i,a){let o=e.getMeta(r);if(o)return o;let s=e.getMeta(`applyInputRules`);return s&&setTimeout(()=>{let{text:e}=s;e=typeof e==`string`?e:U(E.from(e),a.schema);let{from:i}=s;Ed({editor:t,from:i,to:i+e.length,text:e,rules:n,plugin:r})}),e.selectionSet||e.docChanged?null:i}},props:{handleTextInput(e,i,a,o){return Ed({editor:t,from:i,to:a,text:o,rules:n,plugin:r})},handleDOMEvents:{compositionend:e=>(setTimeout(()=>{let{$cursor:i}=e.state.selection;i&&Ed({editor:t,from:i.pos,to:i.pos,text:``,rules:n,plugin:r})}),!1)},handleKeyDown(e,i){if(i.key!==`Enter`)return!1;let{$cursor:a}=e.state.selection;return a?Ed({editor:t,from:a.pos,to:a.pos,text:`
|
|
57
|
+
`,rules:n,plugin:r}):!1}},isInputRules:!0});return r}var Dd=class{constructor(e={}){this.type=`extendable`,this.parent=null,this.child=null,this.name=``,this.config={name:this.name},this.config={...this.config,...e},this.name=this.config.name}get options(){return{...W(V(this,`addOptions`,{name:this.name}))}}get storage(){return{...W(V(this,`addStorage`,{name:this.name,options:this.options}))}}configure(e={}){let t=this.extend({...this.config,addOptions:()=>Sd(this.options,e)});return t.name=this.name,t.parent=this.parent,this.child=null,t}extend(e={}){let t=new this.constructor({...this.config,...e});return t.parent=this,this.child=t,t.name=`name`in e?e.name:t.parent.name,t}},Od=class e extends Dd{constructor(){super(...arguments),this.type=`mark`}static create(t={}){return new e(typeof t==`function`?t():t)}static handleExit({editor:e,mark:t}){let{tr:n}=e.state,r=e.state.selection.$from;if(r.pos===r.end()){let i=r.marks();if(!i.find(e=>e?.type.name===t.name))return!1;let a=i.find(e=>e?.type.name===t.name);return a&&n.removeStoredMark(a),n.insertText(` `,r.pos),e.view.dispatch(n),!0}return!1}configure(e){return super.configure(e)}extend(e){let t=typeof e==`function`?e():e;return super.extend(t)}},kd=class{constructor(e){this.find=e.find,this.handler=e.handler}},Ad=(e,t,n)=>{if(Kc(t))return[...e.matchAll(t)];let r=t(e,n);return r?r.map(t=>{let n=[t.text];return n.index=t.index,n.input=e,n.data=t.data,t.replaceWith&&(t.text.includes(t.replaceWith)||console.warn(`[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".`),n.push(t.replaceWith)),n}):[]};function jd(e){let{editor:t,state:n,from:r,to:i,rule:a,pasteEvent:o,dropEvent:s}=e,{commands:c,chain:l,can:u}=new Oc({editor:t,state:n}),d=[];return n.doc.nodesBetween(r,i,(e,t)=>{if(e.type?.spec?.code||!(e.isText||e.isTextblock||e.isInline))return;let f=e.content?.size??e.nodeSize??0,p=Math.max(r,t),m=Math.min(i,t+f);p>=m||Ad(e.isText?e.text||``:e.textBetween(p-t,m-t,void 0,``),a.find,o).forEach(e=>{if(e.index===void 0)return;let t=p+e.index+1,r=t+e[0].length,i={from:n.tr.mapping.map(t),to:n.tr.mapping.map(r)},f=a.handler({state:n,range:i,match:e,commands:c,chain:l,can:u,pasteEvent:o,dropEvent:s});d.push(f)})}),d.every(e=>e!==null)}var Md=null,Nd=e=>{var t;let n=new ClipboardEvent(`paste`,{clipboardData:new DataTransfer});return(t=n.clipboardData)==null||t.setData(`text/html`,e),n};function Pd(e){let{editor:t,rules:n}=e,r=null,i=!1,a=!1,o=typeof ClipboardEvent<`u`?new ClipboardEvent(`paste`):null,s;try{s=typeof DragEvent<`u`?new DragEvent(`drop`):null}catch{s=null}let c=({state:e,from:n,to:r,rule:i,pasteEvt:a})=>{let c=e.tr;if(!(!jd({editor:t,state:Dc({state:e,transaction:c}),from:Math.max(n-1,0),to:r.b-1,rule:i,pasteEvent:a,dropEvent:s})||!c.steps.length)){try{s=typeof DragEvent<`u`?new DragEvent(`drop`):null}catch{s=null}return o=typeof ClipboardEvent<`u`?new ClipboardEvent(`paste`):null,c}};return n.map(e=>new Jn({view(e){let n=n=>{r=e.dom.parentElement?.contains(n.target)?e.dom.parentElement:null,r&&(Md=t)},i=()=>{Md&&=null};return window.addEventListener(`dragstart`,n),window.addEventListener(`dragend`,i),{destroy(){window.removeEventListener(`dragstart`,n),window.removeEventListener(`dragend`,i)}}},props:{handleDOMEvents:{drop:(e,t)=>{if(a=r===e.dom.parentElement,s=t,!a){let e=Md;e?.isEditable&&setTimeout(()=>{let t=e.state.selection;t&&e.commands.deleteRange({from:t.from,to:t.to})},10)}return!1},paste:(e,t)=>{let n=t.clipboardData?.getData(`text/html`);return o=t,i=!!n?.includes(`data-pm-slice`),!1}}},appendTransaction:(t,n,r)=>{let s=t[0],l=s.getMeta(`uiEvent`)===`paste`&&!i,u=s.getMeta(`uiEvent`)===`drop`&&!a,d=s.getMeta(`applyPasteRules`),f=!!d;if(!l&&!u&&!f)return;if(f){let{text:t}=d;t=typeof t==`string`?t:U(E.from(t),r.schema);let{from:n}=d,i=n+t.length,a=Nd(t);return c({rule:e,state:r,from:n,to:{b:i},pasteEvt:a})}let p=n.doc.content.findDiffStart(r.doc.content),m=n.doc.content.findDiffEnd(r.doc.content);if(!(!ud(p)||!m||p===m.b))return c({rule:e,state:r,from:p,to:m,pasteEvt:o})}}))}var Fd=class{constructor(e,t){this.splittableMarks=[],this.nonClearableMarks=[],this.editor=t,this.baseExtensions=e,this.extensions=su(e),this.schema=iu(this.extensions,t),this.setupExtensions()}get commands(){return this.extensions.reduce((e,t)=>{let n=V(t,`addCommands`,{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:this.editor,type:vu(t.name,this.schema)});return n?{...e,...n()}:e},{})}get plugins(){let{editor:e}=this;return ou([...this.extensions].reverse()).flatMap(t=>{let n={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:vu(t.name,this.schema)},r=[],i=V(t,`addKeyboardShortcuts`,n),a={};if(t.type===`mark`&&V(t,`exitable`,n)&&(a.ArrowRight=()=>Od.handleExit({editor:e,mark:t})),i){let t=Object.fromEntries(Object.entries(i()).map(([t,n])=>[t,()=>n({editor:e})]));a={...a,...t}}let o=Cc(a);r.push(o);let s=V(t,`addInputRules`,n);if(Tu(t,e.options.enableInputRules)&&s){let t=s();if(t&&t.length){let n=K({editor:e,rules:t}),i=Array.isArray(n)?n:[n];r.push(...i)}}let c=V(t,`addPasteRules`,n);if(Tu(t,e.options.enablePasteRules)&&c){let t=c();if(t&&t.length){let n=Pd({editor:e,rules:t});r.push(...n)}}let l=V(t,`addProseMirrorPlugins`,n);if(l){let e=l();r.push(...e)}return r})}get attributes(){return Xl(this.extensions)}get nodeViews(){let{editor:e}=this,{nodeExtensions:t}=Yl(this.extensions);return Object.fromEntries(t.filter(e=>!!V(e,`addNodeView`)).map(t=>{let n=this.attributes.filter(e=>e.type===t.name),r=V(t,`addNodeView`,{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:Lc(t.name,this.schema)});if(!r)return[];let i=r();return i?[t.name,(r,a,o,s,c)=>i({node:r,view:a,getPos:o,decorations:s,innerDecorations:c,editor:e,extension:t,HTMLAttributes:$l(r,n)})]:[]}))}dispatchTransaction(e){let{editor:t}=this;return ou([...this.extensions].reverse()).reduceRight((e,n)=>{let r={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:vu(n.name,this.schema)},i=V(n,`dispatchTransaction`,r);return i?t=>{i.call(r,{transaction:t,next:e})}:e},e)}transformPastedHTML(e){let{editor:t}=this;return ou([...this.extensions]).reduce((e,n)=>{let r={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:vu(n.name,this.schema)},i=V(n,`transformPastedHTML`,r);return i?(t,n)=>{let a=e(t,n);return i.call(r,a)}:e},e||(e=>e))}get markViews(){let{editor:e}=this,{markExtensions:t}=Yl(this.extensions);return Object.fromEntries(t.filter(e=>!!V(e,`addMarkView`)).map(t=>{let n=this.attributes.filter(e=>e.type===t.name),r=V(t,`addMarkView`,{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:Zc(t.name,this.schema)});return r?[t.name,(i,a,o)=>{let s=$l(i,n);return r()({mark:i,view:a,inline:o,editor:e,extension:t,HTMLAttributes:s,updateAttributes:t=>{Cd(i,e,t)}})}]:[]}))}destroy(){this.extensions.forEach(e=>{let t=e;for(;t.parent;){let e=t.parent;e.child===t&&(e.child=null),t=e}}),this.extensions=[],this.baseExtensions=[],this.schema=null,this.editor=null}setupExtensions(){let e=this.extensions;this.editor.extensionStorage=Object.fromEntries(e.map(e=>[e.name,e.storage])),e.forEach(e=>{let t={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:vu(e.name,this.schema)};e.type===`mark`&&((W(V(e,`keepOnSplit`,t))??!0)&&this.splittableMarks.push(e.name),(W(V(e,`clearable`,t))??!0)||this.nonClearableMarks.push(e.name));let n=V(e,`onBeforeCreate`,t),r=V(e,`onCreate`,t),i=V(e,`onUpdate`,t),a=V(e,`onSelectionUpdate`,t),o=V(e,`onTransaction`,t),s=V(e,`onFocus`,t),c=V(e,`onBlur`,t),l=V(e,`onDestroy`,t);n&&this.editor.on(`beforeCreate`,n),r&&this.editor.on(`create`,r),i&&this.editor.on(`update`,i),a&&this.editor.on(`selectionUpdate`,a),o&&this.editor.on(`transaction`,o),s&&this.editor.on(`focus`,s),c&&this.editor.on(`blur`,c),l&&this.editor.on(`destroy`,l)})}};Fd.resolve=su,Fd.sort=ou,Fd.flatten=H,Ec({},{ClipboardTextSerializer:()=>Id,Commands:()=>Ld,Delete:()=>Rd,Drop:()=>zd,Editable:()=>Bd,FocusEvents:()=>Hd,Keymap:()=>Ud,Paste:()=>Wd,Tabindex:()=>Gd,TextDirection:()=>Kd,focusEventsPluginKey:()=>Vd});var q=class e extends Dd{constructor(){super(...arguments),this.type=`extension`}static create(t={}){return new e(typeof t==`function`?t():t)}configure(e){return super.configure(e)}extend(e){let t=typeof e==`function`?e():e;return super.extend(t)}},Id=q.create({name:`clipboardTextSerializer`,addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new Jn({key:new Zn(`clipboardTextSerializer`),props:{clipboardTextSerializer:()=>{let{editor:e}=this,{state:t,schema:n}=e,{doc:r,selection:i}=t,a=uu(n),{blockSeparator:o}=this.options,s={...o===void 0?{}:{blockSeparator:o},textSerializers:a};return[...i.ranges].sort((e,t)=>e.$from.pos-t.$from.pos).map(({$from:e,$to:t})=>cu(r,{from:e.pos,to:t.pos},s)).join(o??`
|
|
58
|
+
|
|
59
|
+
`)}}})]}}),Ld=q.create({name:`commands`,addCommands(){return{...kc}}}),Rd=q.create({name:`delete`,onUpdate({transaction:e,appendedTransactions:t}){let n=()=>{var n;if(((n=this.editor.options.coreExtensionOptions?.delete)?.filterTransaction)?.call(n,e)??e.getMeta(`y-sync$`))return;let r=Wl(e.before,[e,...t]);hu(r).forEach(t=>{r.mapping.mapResult(t.oldRange.from).deletedAfter&&r.mapping.mapResult(t.oldRange.to).deletedBefore&&r.before.nodesBetween(t.oldRange.from,t.oldRange.to,(n,i)=>{let a=i+n.nodeSize-2,o=t.oldRange.from<=i&&a<=t.oldRange.to;this.editor.emit(`delete`,{type:`node`,node:n,from:i,to:a,newFrom:r.mapping.map(i),newTo:r.mapping.map(a),deletedRange:t.oldRange,newRange:t.newRange,partial:!o,editor:this.editor,transaction:e,combinedTransform:r})})});let i=r.mapping;r.steps.forEach((t,n)=>{if(t instanceof jt){let a=i.slice(n).map(t.from,-1),o=i.slice(n).map(t.to),s=i.invert().map(a,-1),c=i.invert().map(o),l=a>0?r.doc.nodeAt(a-1)?.marks.some(e=>e.eq(t.mark)):!1,u=r.doc.nodeAt(o)?.marks.some(e=>e.eq(t.mark));this.editor.emit(`delete`,{type:`mark`,mark:t.mark,from:t.from,to:t.to,deletedRange:{from:s,to:c},newRange:{from:a,to:o},partial:!!(u||l),editor:this.editor,transaction:e,combinedTransform:r})}})};this.editor.options.coreExtensionOptions?.delete?.async??!0?setTimeout(n,0):n()}}),zd=q.create({name:`drop`,addProseMirrorPlugins(){return[new Jn({key:new Zn(`tiptapDrop`),props:{handleDrop:(e,t,n,r)=>{this.editor.emit(`drop`,{editor:this.editor,event:t,slice:n,moved:r})}}})]}}),Bd=q.create({name:`editable`,addProseMirrorPlugins(){return[new Jn({key:new Zn(`editable`),props:{editable:()=>this.editor.options.editable}})]}}),Vd=new Zn(`focusEvents`),Hd=q.create({name:`focusEvents`,addProseMirrorPlugins(){let{editor:e}=this;return[new Jn({key:Vd,props:{handleDOMEvents:{focus:(t,n)=>{e.isFocused=!0;let r=e.state.tr.setMeta(`focus`,{event:n}).setMeta(`addToHistory`,!1);return t.dispatch(r),!1},blur:(t,n)=>{e.isFocused=!1;let r=e.state.tr.setMeta(`blur`,{event:n}).setMeta(`addToHistory`,!1);return t.dispatch(r),!1}}}})]}}),Ud=q.create({name:`keymap`,addKeyboardShortcuts(){let e=()=>this.editor.commands.first(({commands:e})=>[()=>e.undoInputRule(),()=>e.command(({tr:t})=>{let{selection:n,doc:r}=t,{empty:i,$anchor:a}=n,{pos:o,parent:s}=a,c=a.parent.isTextblock&&o>0?t.doc.resolve(o-1):a,l=c.parent.type.spec.isolating,u=a.pos-a.parentOffset,d=l&&c.parent.childCount===1?u===a.pos:N.atStart(r).from===o;return!i||!s.type.isTextblock||s.textContent.length||!d||d&&a.parent.type.name===`paragraph`?!1:e.clearNodes()}),()=>e.deleteSelection(),()=>e.joinBackward(),()=>e.selectNodeBackward()]),t=()=>this.editor.commands.first(({commands:e})=>[()=>e.deleteSelection(),()=>e.deleteCurrentNode(),()=>e.joinForward(),()=>e.selectNodeForward()]),n={Enter:()=>this.editor.commands.first(({commands:e})=>[()=>e.newlineInCode(),()=>e.createParagraphNear(),()=>e.liftEmptyBlock(),()=>e.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:e,"Mod-Backspace":e,"Shift-Backspace":e,Delete:t,"Mod-Delete":t,"Mod-a":()=>this.editor.commands.selectAll()},r={...n},i={...n,"Ctrl-h":e,"Alt-Backspace":e,"Ctrl-d":t,"Ctrl-Alt-Backspace":t,"Alt-Delete":t,"Alt-d":t,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return il()||Cl()?i:r},addProseMirrorPlugins(){return[new Jn({key:new Zn(`clearDocument`),appendTransaction:(e,t,n)=>{if(e.some(e=>e.getMeta(`composition`)))return;let r=e.some(e=>e.docChanged)&&!t.doc.eq(n.doc),i=e.some(e=>e.getMeta(`preventClearDocument`));if(!r||i)return;let{empty:a,from:o,to:s}=t.selection,c=N.atStart(t.doc).from,l=N.atEnd(t.doc).to;if(a||!(o===c&&s===l)||!Du(n.doc))return;let u=n.tr,d=Dc({state:n,transaction:u}),{commands:f}=new Oc({editor:this.editor,state:d});if(f.clearNodes(),u.steps.length)return u}})]}}),Wd=q.create({name:`paste`,addProseMirrorPlugins(){return[new Jn({key:new Zn(`tiptapPaste`),props:{handlePaste:(e,t,n)=>{this.editor.emit(`paste`,{editor:this.editor,event:t,slice:n})}}})]}}),Gd=q.create({name:`tabindex`,addOptions(){return{value:void 0}},addProseMirrorPlugins(){return[new Jn({key:new Zn(`tabindex`),props:{attributes:()=>!this.editor.isEditable&&this.options.value===void 0?{}:{tabindex:this.options.value??`0`}}})]}}),Kd=q.create({name:`textDirection`,addOptions(){return{direction:void 0}},addGlobalAttributes(){if(!this.options.direction)return[];let{nodeExtensions:e}=Yl(this.extensions);return[{types:e.filter(e=>e.name!==`text`).map(e=>e.name),attributes:{dir:{default:this.options.direction,parseHTML:e=>{let t=e.getAttribute(`dir`);return t&&(t===`ltr`||t===`rtl`||t===`auto`)?t:this.options.direction},renderHTML:e=>e.dir?{dir:e.dir}:{}}}}]},addProseMirrorPlugins(){return[new Jn({key:new Zn(`textDirection`),props:{attributes:()=>{let e=this.options.direction;return e?{dir:e}:{}}}})]}}),qd=class e{constructor(e,t,n=!1,r=null){this.currentNode=null,this.actualDepth=null,this.isBlock=n,this.resolvedPos=e,this.editor=t,this.currentNode=r}get name(){return this.node.type.name}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){return this.actualDepth??this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let t=this.from,n=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can\u2019t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}t=this.from+1,n=this.to-1}this.editor.commands.insertContentAt({from:t,to:n},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+ +!this.node.isText}get parent(){if(this.depth===0)return null;let t=this.resolvedPos.start(this.resolvedPos.depth-1);return new e(this.resolvedPos.doc.resolve(t),this.editor)}get before(){let t=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.from-3)),new e(t,this.editor)}get after(){let t=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.to+3)),new e(t,this.editor)}get children(){let t=[];return this.node.content.forEach((n,r)=>{let i=n.isBlock&&!n.isTextblock,a=n.isAtom&&!n.isText,o=n.isInline,s=this.pos+r+ +!a;if(s<0||s>this.resolvedPos.doc.nodeSize-2)return;let c=this.resolvedPos.doc.resolve(s);if(!i&&!o&&c.depth<=this.depth)return;let l=new e(c,this.editor,i,i||o?n:null);i&&(l.actualDepth=this.depth+1),t.push(l)}),t}get firstChild(){return this.children[0]||null}get lastChild(){let e=this.children;return e[e.length-1]||null}closest(e,t={}){let n=null,r=this.parent;for(;r&&!n;){if(r.node.type.name===e)if(Object.keys(t).length>0){let e=r.node.attrs,n=Object.keys(t);for(let r=0;r<n.length;r+=1){let i=n[r];if(e[i]!==t[i])break}}else n=r;r=r.parent}return n}querySelector(e,t={}){return this.querySelectorAll(e,t,!0)[0]||null}querySelectorAll(e,t={},n=!1){let r=[];if(!this.children||this.children.length===0)return r;let i=Object.keys(t);return this.children.forEach(a=>{n&&r.length>0||(a.node.type.name===e&&i.every(e=>t[e]===a.node.attrs[e])&&r.push(a),!(n&&r.length>0)&&(r=r.concat(a.querySelectorAll(e,t,n))))}),r}setAttribute(e){let{tr:t}=this.editor.state;t.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(t)}},Jd=`.ProseMirror {
|
|
60
|
+
position: relative;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.ProseMirror {
|
|
64
|
+
word-wrap: break-word;
|
|
65
|
+
white-space: pre-wrap;
|
|
66
|
+
white-space: break-spaces;
|
|
67
|
+
-webkit-font-variant-ligatures: none;
|
|
68
|
+
font-variant-ligatures: none;
|
|
69
|
+
font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.ProseMirror [contenteditable="false"] {
|
|
73
|
+
white-space: normal;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.ProseMirror [contenteditable="false"] [contenteditable="true"] {
|
|
77
|
+
white-space: pre-wrap;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.ProseMirror pre {
|
|
81
|
+
white-space: pre-wrap;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
img.ProseMirror-separator {
|
|
85
|
+
display: inline !important;
|
|
86
|
+
border: none !important;
|
|
87
|
+
margin: 0 !important;
|
|
88
|
+
width: 0 !important;
|
|
89
|
+
height: 0 !important;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.ProseMirror-gapcursor {
|
|
93
|
+
display: none;
|
|
94
|
+
pointer-events: none;
|
|
95
|
+
position: absolute;
|
|
96
|
+
margin: 0;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.ProseMirror-gapcursor:after {
|
|
100
|
+
content: "";
|
|
101
|
+
display: block;
|
|
102
|
+
position: absolute;
|
|
103
|
+
top: -2px;
|
|
104
|
+
width: 20px;
|
|
105
|
+
border-top: 1px solid black;
|
|
106
|
+
animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
@keyframes ProseMirror-cursor-blink {
|
|
110
|
+
to {
|
|
111
|
+
visibility: hidden;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.ProseMirror-hideselection *::selection {
|
|
116
|
+
background: transparent;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.ProseMirror-hideselection *::-moz-selection {
|
|
120
|
+
background: transparent;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.ProseMirror-hideselection * {
|
|
124
|
+
caret-color: transparent;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.ProseMirror-focused .ProseMirror-gapcursor {
|
|
128
|
+
display: block;
|
|
129
|
+
}`,Yd=class extends od{constructor(e={}){super(),this.css=null,this.className=`tiptap`,this.editorView=null,this.isFocused=!1,this.destroyed=!1,this.isInitialized=!1,this.extensionStorage={},this.instanceId=Math.random().toString(36).slice(2,9),this.options={element:typeof document<`u`?document.createElement(`div`):null,content:``,injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,textDirection:void 0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onMount:()=>null,onUnmount:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:e})=>{throw e},onPaste:()=>null,onDrop:()=>null,onDelete:()=>null,enableExtensionDispatchTransaction:!0},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.utils={getUpdatedPosition:ju,createMappablePosition:Mu},this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on(`beforeCreate`,this.options.onBeforeCreate),this.emit(`beforeCreate`,{editor:this}),this.on(`mount`,this.options.onMount),this.on(`unmount`,this.options.onUnmount),this.on(`contentError`,this.options.onContentError),this.on(`create`,this.options.onCreate),this.on(`update`,this.options.onUpdate),this.on(`selectionUpdate`,this.options.onSelectionUpdate),this.on(`transaction`,this.options.onTransaction),this.on(`focus`,this.options.onFocus),this.on(`blur`,this.options.onBlur),this.on(`destroy`,this.options.onDestroy),this.on(`drop`,({event:e,slice:t,moved:n})=>this.options.onDrop(e,t,n)),this.on(`paste`,({event:e,slice:t})=>this.options.onPaste(e,t)),this.on(`delete`,this.options.onDelete);let t=this.createDoc(),n=nl(t,this.options.autofocus);this.editorState=Kn.create({doc:t,schema:this.schema,selection:n||void 0}),this.options.element&&this.mount(this.options.element)}mount(e){if(typeof document>`u`)throw Error(`[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.`);this.createView(e),this.emit(`mount`,{editor:this}),this.css&&!document.head.contains(this.css)&&document.head.appendChild(this.css),window.setTimeout(()=>{this.isDestroyed||(this.options.autofocus!==!1&&this.options.autofocus!==null&&this.commands.focus(this.options.autofocus),this.emit(`create`,{editor:this}),this.isInitialized=!0)},0)}unmount(){if(this.editorView){let e=this.editorView.dom;e?.editor&&delete e.editor,this.editorView.destroy()}if(this.editorView=null,this.isInitialized=!1,this.css&&!document.querySelectorAll(`.${this.className}`).length)try{typeof this.css.remove==`function`?this.css.remove():this.css.parentNode&&this.css.parentNode.removeChild(this.css)}catch(e){console.warn(`Failed to remove CSS element:`,e)}this.css=null,this.emit(`unmount`,{editor:this})}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&typeof document<`u`&&(this.css=cd(Jd,this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},!(!this.editorView||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(e,t=!0){this.setOptions({editable:e}),t&&this.emit(`update`,{editor:this,transaction:this.state.tr,appendedTransactions:[]})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get view(){return this.editorView?this.editorView:new Proxy({state:this.editorState,updateState:e=>{this.editorState=e},dispatch:e=>{this.dispatchTransaction(e)},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:(e,t)=>{if(this.editorView)return this.editorView[t];if(t===`state`)return this.editorState;if(t in e)return Reflect.get(e,t);throw Error(`[tiptap error]: The editor view is not available. Cannot access view['${t}']. The editor may not be mounted yet.`)}})}get state(){return this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(e,t){let n=ql(t)?t(e,[...this.state.plugins]):[...this.state.plugins,e],r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}unregisterPlugin(e){if(this.isDestroyed)return;let t=this.state.plugins,n=t;if([].concat(e).forEach(e=>{let t=typeof e==`string`?`${e}$`:e.key;n=n.filter(e=>!e.key.startsWith(t))}),t.length===n.length)return;let r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}createExtensionManager(){let e=[...this.options.enableCoreExtensions?[Bd,Id.configure({blockSeparator:this.options.coreExtensionOptions?.clipboardTextSerializer?.blockSeparator}),Ld,Hd,Ud,Gd.configure({value:this.options.coreExtensionOptions?.tabindex?.value}),zd,Wd,Rd,Kd.configure({direction:this.options.textDirection})].filter(e=>typeof this.options.enableCoreExtensions==`object`?this.options.enableCoreExtensions[e.name]!==!1:!0):[],...this.options.extensions].filter(e=>[`extension`,`node`,`mark`].includes(e?.type));this.extensionManager=new Fd(e,this)}createCommandManager(){this.commandManager=new Oc({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let e;try{e=Vl(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(t){if(!(t instanceof Error)||![`[tiptap error]: Invalid JSON content`,`[tiptap error]: Invalid HTML content`].includes(t.message))throw t;this.emit(`contentError`,{editor:this,error:t,disableCollaboration:()=>{`collaboration`in this.storage&&typeof this.storage.collaboration==`object`&&this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(e=>e.name!==`collaboration`),this.createExtensionManager()}}),e=Vl(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}return e}createView(e){let{editorProps:t,enableExtensionDispatchTransaction:n}=this.options,r=t.dispatchTransaction||this.dispatchTransaction.bind(this),i=n?this.extensionManager.dispatchTransaction(r):r,a=t.transformPastedHTML,o=this.extensionManager.transformPastedHTML(a);this.editorView=new rc(e,{...t,attributes:{role:`textbox`,...t?.attributes},dispatchTransaction:i,transformPastedHTML:o,state:this.editorState,markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews});let s=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(s),this.prependClass(),this.injectCSS();let c=this.view.dom;c.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`${this.className} ${this.view.dom.className}`}captureTransaction(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;let t=this.capturedTransaction;return this.capturedTransaction=null,t}dispatchTransaction(e){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=e;return}e.steps.forEach(e=>this.capturedTransaction?.step(e));return}let{state:t,transactions:n}=this.state.applyTransaction(e),r=!this.state.selection.eq(t.selection),i=n.includes(e),a=this.state;if(this.emit(`beforeTransaction`,{editor:this,transaction:e,nextState:t}),!i)return;this.view.updateState(t),this.emit(`transaction`,{editor:this,transaction:e,appendedTransactions:n.slice(1)}),r&&this.emit(`selectionUpdate`,{editor:this,transaction:e});let o=n.findLast(e=>e.getMeta(`focus`)||e.getMeta(`blur`)),s=o?.getMeta(`focus`),c=o?.getMeta(`blur`);s&&this.emit(`focus`,{editor:this,event:s.event,transaction:o}),c&&this.emit(`blur`,{editor:this,event:c.event,transaction:o}),!(e.getMeta(`preventUpdate`)||!n.some(e=>e.docChanged)||a.doc.eq(t.doc))&&this.emit(`update`,{editor:this,transaction:e,appendedTransactions:n.slice(1)})}getAttributes(e){return fu(this.state,e)}isActive(e,t){let n=typeof e==`string`?e:null,r=typeof e==`string`?t:e;return Su(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return U(this.state.doc.content,this.schema)}getText(e){let{blockSeparator:t=`
|
|
130
|
+
|
|
131
|
+
`,textSerializers:n={}}=e||{};return lu(this.state.doc,{blockSeparator:t,textSerializers:{...uu(this.schema),...n}})}get isEmpty(){return Du(this.state.doc)}destroy(){this.destroyed||(this.destroyed=!0,this.emit(`destroy`),this.unmount(),this.removeAllListeners(),this.extensionManager.destroy(),this.extensionManager=null,this.schema=null,this.commandManager=null,this.extensionStorage={})}get isDestroyed(){return this.editorView?.isDestroyed??!0}$node(e,t){return this.$doc?.querySelector(e,t)||null}$nodes(e,t){return this.$doc?.querySelectorAll(e,t)||null}$pos(e){let t=this.state.doc.resolve(e),n=e>0&&t.nodeAfter&&!t.nodeAfter.isText?t.nodeAfter:null;return new qd(t,this,!1,n)}get $doc(){return this.$pos(0)}};function Xd(e){return new wd({find:e.find,handler:({state:t,range:n,match:r})=>{let i=W(e.getAttributes,void 0,r);if(i===!1||i===null)return null;let{tr:a}=t,o=r[r.length-1],s=r[0];if(o){let r=s.search(/\S/),c=n.from+s.indexOf(o),l=c+o.length;if(gu(n.from,n.to,t.doc).filter(t=>t.mark.type.excluded.find(n=>n===e.type&&n!==t.mark.type)).filter(e=>e.to>c).length)return null;l<n.to&&a.delete(l,n.to),c>n.from&&a.delete(n.from+r,c);let u=n.from+r+o.length;a.addMark(n.from+r,u,e.type.create(i||{})),a.removeStoredMark(e.type)}},undoable:e.undoable})}function Zd(e){return new wd({find:e.find,handler:({state:t,range:n,match:r})=>{let i=W(e.getAttributes,void 0,r)||{},{tr:a}=t,o=n.from,s=n.to,c=e.type.create(i);if(r[1]){let e=o+r[0].lastIndexOf(r[1]);e>s?e=s:s=e+r[1].length;let t=r[0][r[0].length-1];a.insertText(t,o+r[0].length-1),a.replaceWith(e,s,c)}else if(r[0]){let t=e.type.isInline?o:o-1;a.insert(t,e.type.create(i)).delete(a.mapping.map(o),a.mapping.map(s))}a.scrollIntoView()},undoable:e.undoable})}function Qd(e){return new wd({find:e.find,handler:({state:t,range:n,match:r})=>{let i=t.doc.resolve(n.from),a=W(e.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),e.type))return null;t.tr.delete(n.from,n.to).setBlockType(n.from,n.from,e.type,a)},undoable:e.undoable})}function $d(e){return new wd({find:e.find,handler:({state:t,range:n,match:r})=>{let i=e.replace,a=n.from,o=n.to;if(r[1]){let e=r[0].lastIndexOf(r[1]);i+=r[0].slice(e+r[1].length),a+=e;let t=a-o;t>0&&(i=r[0].slice(e-t,e)+i,a=o)}t.tr.insertText(i,a,o)},undoable:e.undoable})}function ef(e){return new wd({find:e.find,handler:({state:t,range:n,match:r,chain:i})=>{let a=W(e.getAttributes,void 0,r)||{},o=t.tr.delete(n.from,n.to),s=o.doc.resolve(n.from).blockRange(),c=s&&Ut(s,e.type,a);if(!c)return null;if(o.wrap(s,c),e.keepMarks&&e.editor){let{selection:n,storedMarks:r}=t,{splittableMarks:i}=e.editor.extensionManager,a=r||n.$to.parentOffset&&n.$from.marks();if(a){let e=a.filter(e=>i.includes(e.type.name));o.ensureMarks(e)}}if(e.keepAttributes){let t=e.type.name===`bulletList`||e.type.name===`orderedList`?`listItem`:`taskList`;i().updateAttributes(t,a).run()}let l=o.doc.resolve(n.from-1).nodeBefore;l&&l.type===e.type&&tn(o.doc,n.from-1)&&(!e.joinPredicate||e.joinPredicate(r,l))&&o.join(n.from-1)},undoable:e.undoable})}var tf=e=>`touches`in e,nf=class{constructor(e){this.directions=[`bottom-left`,`bottom-right`,`top-left`,`top-right`],this.minSize={height:8,width:8},this.preserveAspectRatio=!1,this.classNames={container:``,wrapper:``,handle:``,resizing:``},this.initialWidth=0,this.initialHeight=0,this.aspectRatio=1,this.isResizing=!1,this.activeHandle=null,this.startX=0,this.startY=0,this.startWidth=0,this.startHeight=0,this.isShiftKeyPressed=!1,this.lastEditableState=void 0,this.handleMap=new Map,this.handleMouseMove=e=>{if(!this.isResizing||!this.activeHandle)return;let t=e.clientX-this.startX,n=e.clientY-this.startY;this.handleResize(t,n)},this.handleTouchMove=e=>{if(!this.isResizing||!this.activeHandle)return;let t=e.touches[0];if(!t)return;let n=t.clientX-this.startX,r=t.clientY-this.startY;this.handleResize(n,r)},this.handleMouseUp=()=>{if(!this.isResizing)return;let e=this.element.offsetWidth,t=this.element.offsetHeight;this.onCommit(e,t),this.isResizing=!1,this.activeHandle=null,this.container.dataset.resizeState=`false`,this.classNames.resizing&&this.container.classList.remove(this.classNames.resizing),document.removeEventListener(`mousemove`,this.handleMouseMove),document.removeEventListener(`mouseup`,this.handleMouseUp),document.removeEventListener(`keydown`,this.handleKeyDown),document.removeEventListener(`keyup`,this.handleKeyUp)},this.handleKeyDown=e=>{e.key===`Shift`&&(this.isShiftKeyPressed=!0)},this.handleKeyUp=e=>{e.key===`Shift`&&(this.isShiftKeyPressed=!1)},this.node=e.node,this.editor=e.editor,this.element=e.element,this.element.draggable=!1,this.contentElement=e.contentElement,this.getPos=e.getPos,this.onResize=e.onResize,this.onCommit=e.onCommit,this.onUpdate=e.onUpdate,e.options?.min&&(this.minSize={...this.minSize,...e.options.min}),e.options?.max&&(this.maxSize=e.options.max),e?.options?.directions&&(this.directions=e.options.directions),e.options?.preserveAspectRatio&&(this.preserveAspectRatio=e.options.preserveAspectRatio),e.options?.className&&(this.classNames={container:e.options.className.container||``,wrapper:e.options.className.wrapper||``,handle:e.options.className.handle||``,resizing:e.options.className.resizing||``}),e.options?.createCustomHandle&&(this.createCustomHandle=e.options.createCustomHandle),this.wrapper=this.createWrapper(),this.container=this.createContainer(),this.applyInitialSize(),this.attachHandles(),this.editor.on(`update`,this.handleEditorUpdate.bind(this))}get dom(){return this.container}get contentDOM(){return this.contentElement??null}handleEditorUpdate(){let e=this.editor.isEditable;e!==this.lastEditableState&&(this.lastEditableState=e,e?e&&this.handleMap.size===0&&this.attachHandles():this.removeHandles())}update(e,t,n){return e.type===this.node.type?(this.node=e,this.onUpdate?this.onUpdate(e,t,n):!0):!1}destroy(){this.isResizing&&(this.container.dataset.resizeState=`false`,this.classNames.resizing&&this.container.classList.remove(this.classNames.resizing),document.removeEventListener(`mousemove`,this.handleMouseMove),document.removeEventListener(`mouseup`,this.handleMouseUp),document.removeEventListener(`keydown`,this.handleKeyDown),document.removeEventListener(`keyup`,this.handleKeyUp),this.isResizing=!1,this.activeHandle=null),this.editor.off(`update`,this.handleEditorUpdate.bind(this)),this.container.remove()}createContainer(){let e=document.createElement(`div`);return e.dataset.resizeContainer=``,e.dataset.node=this.node.type.name,e.style.display=this.node.type.isInline?`inline-flex`:`flex`,this.classNames.container&&(e.className=this.classNames.container),e.appendChild(this.wrapper),e}createWrapper(){let e=document.createElement(`div`);return e.style.position=`relative`,e.style.display=`block`,e.dataset.resizeWrapper=``,this.classNames.wrapper&&(e.className=this.classNames.wrapper),e.appendChild(this.element),e}createHandle(e){let t=document.createElement(`div`);return t.dataset.resizeHandle=e,t.style.position=`absolute`,this.classNames.handle&&(t.className=this.classNames.handle),t}positionHandle(e,t){let n=t.includes(`top`),r=t.includes(`bottom`),i=t.includes(`left`),a=t.includes(`right`);n&&(e.style.top=`0`),r&&(e.style.bottom=`0`),i&&(e.style.left=`0`),a&&(e.style.right=`0`),(t===`top`||t===`bottom`)&&(e.style.left=`0`,e.style.right=`0`),(t===`left`||t===`right`)&&(e.style.top=`0`,e.style.bottom=`0`)}attachHandles(){this.directions.forEach(e=>{let t;t=this.createCustomHandle?this.createCustomHandle(e):this.createHandle(e),t instanceof HTMLElement||(console.warn(`[ResizableNodeView] createCustomHandle("${e}") did not return an HTMLElement. Falling back to default handle.`),t=this.createHandle(e)),this.createCustomHandle||this.positionHandle(t,e),t.addEventListener(`mousedown`,t=>this.handleResizeStart(t,e)),t.addEventListener(`touchstart`,t=>this.handleResizeStart(t,e)),this.handleMap.set(e,t),this.wrapper.appendChild(t)})}removeHandles(){this.handleMap.forEach(e=>e.remove()),this.handleMap.clear()}applyInitialSize(){let e=this.node.attrs.width,t=this.node.attrs.height;e?(this.element.style.width=`${e}px`,this.initialWidth=e):this.initialWidth=this.element.offsetWidth,t?(this.element.style.height=`${t}px`,this.initialHeight=t):this.initialHeight=this.element.offsetHeight,this.initialWidth>0&&this.initialHeight>0&&(this.aspectRatio=this.initialWidth/this.initialHeight)}handleResizeStart(e,t){e.preventDefault(),e.stopPropagation(),this.isResizing=!0,this.activeHandle=t,tf(e)?(this.startX=e.touches[0].clientX,this.startY=e.touches[0].clientY):(this.startX=e.clientX,this.startY=e.clientY),this.startWidth=this.element.offsetWidth,this.startHeight=this.element.offsetHeight,this.startWidth>0&&this.startHeight>0&&(this.aspectRatio=this.startWidth/this.startHeight),this.getPos(),this.container.dataset.resizeState=`true`,this.classNames.resizing&&this.container.classList.add(this.classNames.resizing),document.addEventListener(`mousemove`,this.handleMouseMove),document.addEventListener(`touchmove`,this.handleTouchMove),document.addEventListener(`mouseup`,this.handleMouseUp),document.addEventListener(`keydown`,this.handleKeyDown),document.addEventListener(`keyup`,this.handleKeyUp)}handleResize(e,t){if(!this.activeHandle)return;let n=this.preserveAspectRatio||this.isShiftKeyPressed,{width:r,height:i}=this.calculateNewDimensions(this.activeHandle,e,t),a=this.applyConstraints(r,i,n);this.element.style.width=`${a.width}px`,this.element.style.height=`${a.height}px`,this.onResize&&this.onResize(a.width,a.height)}calculateNewDimensions(e,t,n){let r=this.startWidth,i=this.startHeight,a=e.includes(`right`),o=e.includes(`left`),s=e.includes(`bottom`),c=e.includes(`top`);return a?r=this.startWidth+t:o&&(r=this.startWidth-t),s?i=this.startHeight+n:c&&(i=this.startHeight-n),(e===`right`||e===`left`)&&(r=this.startWidth+(a?t:-t)),(e===`top`||e===`bottom`)&&(i=this.startHeight+(s?n:-n)),this.preserveAspectRatio||this.isShiftKeyPressed?this.applyAspectRatio(r,i,e):{width:r,height:i}}applyConstraints(e,t,n){if(!n){let n=Math.max(this.minSize.width,e),r=Math.max(this.minSize.height,t);return this.maxSize?.width&&(n=Math.min(this.maxSize.width,n)),this.maxSize?.height&&(r=Math.min(this.maxSize.height,r)),{width:n,height:r}}let r=e,i=t;return r<this.minSize.width&&(r=this.minSize.width,i=r/this.aspectRatio),i<this.minSize.height&&(i=this.minSize.height,r=i*this.aspectRatio),this.maxSize?.width&&r>this.maxSize.width&&(r=this.maxSize.width,i=r/this.aspectRatio),this.maxSize?.height&&i>this.maxSize.height&&(i=this.maxSize.height,r=i*this.aspectRatio),{width:r,height:i}}applyAspectRatio(e,t,n){return n===`left`||n===`right`?{width:e,height:e/this.aspectRatio}:n===`top`||n===`bottom`?{width:t*this.aspectRatio,height:t}:{width:e,height:e/this.aspectRatio}}},rf=class e extends Dd{constructor(){super(...arguments),this.type=`node`}static create(t={}){return new e(typeof t==`function`?t():t)}configure(e){return super.configure(e)}extend(e){let t=typeof e==`function`?e():e;return super.extend(t)}},af=class{constructor(e,t,n){this.isDragging=!1,this.component=e,this.editor=t.editor,this.options={stopEvent:null,ignoreMutation:null,...n},this.extension=t.extension,this.node=t.node,this.decorations=t.decorations,this.innerDecorations=t.innerDecorations,this.view=t.view,this.HTMLAttributes=t.HTMLAttributes,this.getPos=t.getPos,this.mount()}mount(){}get dom(){return this.editor.view.dom}get contentDOM(){return null}onDragStart(e){var t;let{view:n}=this.editor,r=e.target,i=r.nodeType===3?r.parentElement?.closest(`[data-drag-handle]`):r.closest(`[data-drag-handle]`);if(!this.dom||this.contentDOM?.contains(r)||!i)return;let a=0,o=0;if(this.dom!==i){let t=this.dom.getBoundingClientRect(),n=i.getBoundingClientRect(),r=e.offsetX??e.nativeEvent?.offsetX,s=e.offsetY??e.nativeEvent?.offsetY;a=n.x-t.x+r,o=n.y-t.y+s}let s=this.dom.cloneNode(!0);try{let e=this.dom.getBoundingClientRect();s.style.width=`${Math.round(e.width)}px`,s.style.height=`${Math.round(e.height)}px`,s.style.boxSizing=`border-box`,s.style.pointerEvents=`none`}catch{}let c=null;try{c=document.createElement(`div`),c.style.position=`absolute`,c.style.top=`-9999px`,c.style.left=`-9999px`,c.style.pointerEvents=`none`,c.appendChild(s),document.body.appendChild(c),(t=e.dataTransfer)==null||t.setDragImage(s,a,o)}finally{c&&setTimeout(()=>{try{c?.remove()}catch{}},0)}let l=this.getPos();if(typeof l!=`number`)return;let u=F.create(n.state.doc,l),d=n.state.tr.setSelection(u);n.dispatch(d)}stopEvent(e){if(!this.dom)return!1;if(typeof this.options.stopEvent==`function`)return this.options.stopEvent({event:e});let t=e.target;if(!(this.dom.contains(t)&&!this.contentDOM?.contains(t)))return!1;let n=e.type.startsWith(`drag`),r=e.type===`dragover`||e.type===`dragenter`,i=e.type===`drop`;if(([`INPUT`,`BUTTON`,`SELECT`,`TEXTAREA`].includes(t.tagName)||t.isContentEditable)&&!i&&!n)return!0;let{isEditable:a}=this.editor,{isDragging:o}=this,s=!!this.node.type.spec.draggable,c=F.isSelectable(this.node),l=e.type===`copy`,u=e.type===`paste`,d=e.type===`cut`,f=e.type===`mousedown`;if(!s&&c&&n&&e.target===this.dom&&e.preventDefault(),s&&n&&!o&&e.target===this.dom)return e.preventDefault(),!1;if(s&&a&&!o&&f){let e=t.closest(`[data-drag-handle]`);e&&(this.dom===e||this.dom.contains(e))&&(this.isDragging=!0,document.addEventListener(`dragend`,()=>{this.isDragging=!1},{once:!0}),document.addEventListener(`drop`,()=>{this.isDragging=!1},{once:!0}),document.addEventListener(`mouseup`,()=>{this.isDragging=!1},{once:!0}))}return!(o||r||i||l||u||d||f&&c)}ignoreMutation(e){return!this.dom||!this.contentDOM?!0:typeof this.options.ignoreMutation==`function`?this.options.ignoreMutation({mutation:e}):this.node.isLeaf||this.node.isAtom?!0:e.type===`selection`||this.dom.contains(e.target)&&e.type===`childList`&&(il()||rl())&&this.editor.isFocused&&[...Array.from(e.addedNodes),...Array.from(e.removedNodes)].every(e=>e.isContentEditable)?!1:this.contentDOM===e.target&&e.type===`attributes`?!0:!this.contentDOM.contains(e.target)}updateAttributes(e){this.editor.commands.command(({tr:t})=>{let n=this.getPos();return typeof n==`number`?(t.setNodeMarkup(n,void 0,{...this.node.attrs,...e}),!0):!1})}deleteNode(){let e=this.getPos();if(typeof e!=`number`)return;let t=e+this.node.nodeSize;this.editor.commands.deleteRange({from:e,to:t})}};function of(e){return new kd({find:e.find,handler:({state:t,range:n,match:r,pasteEvent:i})=>{let a=W(e.getAttributes,void 0,r,i);if(a===!1||a===null)return null;let{tr:o}=t,s=r[r.length-1],c=r[0],l=n.to;if(s){let i=c.search(/\S/),u=n.from+c.indexOf(s),d=u+s.length;if(gu(n.from,n.to,t.doc).filter(t=>t.mark.type.excluded.find(n=>n===e.type&&n!==t.mark.type)).filter(e=>e.to>u).length)return null;d<n.to&&o.delete(d,n.to),u>n.from&&o.delete(n.from+i,u),l=n.from+i+s.length,o.addMark(n.from+i,l,e.type.create(a||{})),r.index!==void 0&&r.input!==void 0&&r.index+r[0].length>=r.input.length||o.removeStoredMark(e.type)}}})}var{getOwnPropertyNames:sf,getOwnPropertySymbols:cf}=Object,{hasOwnProperty:lf}=Object.prototype;function uf(e,t){return function(n,r,i){return e(n,r,i)&&t(n,r,i)}}function df(e){return function(t,n,r){if(!t||!n||typeof t!=`object`||typeof n!=`object`)return e(t,n,r);let{cache:i}=r,a=i.get(t),o=i.get(n);if(a&&o)return a===n&&o===t;i.set(t,n),i.set(n,t);let s=e(t,n,r);return i.delete(t),i.delete(n),s}}function ff(e){return e?.[Symbol.toStringTag]}function pf(e){return sf(e).concat(cf(e))}var mf=Object.hasOwn||((e,t)=>lf.call(e,t));function hf(e,t){return e===t||!e&&!t&&e!==e&&t!==t}var gf=`__v`,_f=`__o`,vf=`_owner`,{getOwnPropertyDescriptor:yf,keys:bf}=Object;function xf(e,t){return e.byteLength===t.byteLength&&Pf(new Uint8Array(e),new Uint8Array(t))}function Sf(e,t,n){let r=e.length;if(t.length!==r)return!1;for(;r-->0;)if(!n.equals(e[r],t[r],r,r,e,t,n))return!1;return!0}function Cf(e,t){return e.byteLength===t.byteLength&&Pf(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function wf(e,t){return hf(e.getTime(),t.getTime())}function Tf(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function Ef(e,t){return e===t}function Df(e,t,n){let r=e.size;if(r!==t.size)return!1;if(!r)return!0;let i=Array(r),a=e.entries(),o,s,c=0;for(;(o=a.next())&&!o.done;){let r=t.entries(),a=!1,l=0;for(;(s=r.next())&&!s.done;){if(i[l]){l++;continue}let r=o.value,u=s.value;if(n.equals(r[0],u[0],c,l,e,t,n)&&n.equals(r[1],u[1],r[0],u[0],e,t,n)){a=i[l]=!0;break}l++}if(!a)return!1;c++}return!0}var Of=hf;function kf(e,t,n){let r=bf(e),i=r.length;if(bf(t).length!==i)return!1;for(;i-->0;)if(!If(e,t,n,r[i]))return!1;return!0}function Af(e,t,n){let r=pf(e),i=r.length;if(pf(t).length!==i)return!1;let a,o,s;for(;i-->0;)if(a=r[i],!If(e,t,n,a)||(o=yf(e,a),s=yf(t,a),(o||s)&&(!o||!s||o.configurable!==s.configurable||o.enumerable!==s.enumerable||o.writable!==s.writable)))return!1;return!0}function jf(e,t){return hf(e.valueOf(),t.valueOf())}function Mf(e,t){return e.source===t.source&&e.flags===t.flags}function Nf(e,t,n){let r=e.size;if(r!==t.size)return!1;if(!r)return!0;let i=Array(r),a=e.values(),o,s;for(;(o=a.next())&&!o.done;){let r=t.values(),a=!1,c=0;for(;(s=r.next())&&!s.done;){if(!i[c]&&n.equals(o.value,s.value,o.value,s.value,e,t,n)){a=i[c]=!0;break}c++}if(!a)return!1}return!0}function Pf(e,t){let n=e.byteLength;if(t.byteLength!==n||e.byteOffset!==t.byteOffset)return!1;for(;n-->0;)if(e[n]!==t[n])return!1;return!0}function Ff(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function If(e,t,n,r){return(r===vf||r===_f||r===gf)&&(e.$$typeof||t.$$typeof)?!0:mf(t,r)&&n.equals(e[r],t[r],r,r,e,t,n)}var Lf=`[object ArrayBuffer]`,Rf=`[object Arguments]`,zf=`[object Boolean]`,Bf=`[object DataView]`,Vf=`[object Date]`,Hf=`[object Error]`,Uf=`[object Map]`,Wf=`[object Number]`,Gf=`[object Object]`,Kf=`[object RegExp]`,qf=`[object Set]`,Jf=`[object String]`,Yf={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},Xf=`[object URL]`,Zf=Object.prototype.toString;function Qf({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:n,areDatesEqual:r,areErrorsEqual:i,areFunctionsEqual:a,areMapsEqual:o,areNumbersEqual:s,areObjectsEqual:c,arePrimitiveWrappersEqual:l,areRegExpsEqual:u,areSetsEqual:d,areTypedArraysEqual:f,areUrlsEqual:p,unknownTagComparators:m}){return function(h,g,_){if(h===g)return!0;if(h==null||g==null)return!1;let v=typeof h;if(v!==typeof g)return!1;if(v!==`object`)return v===`number`?s(h,g,_):v===`function`?a(h,g,_):!1;let y=h.constructor;if(y!==g.constructor)return!1;if(y===Object)return c(h,g,_);if(Array.isArray(h))return t(h,g,_);if(y===Date)return r(h,g,_);if(y===RegExp)return u(h,g,_);if(y===Map)return o(h,g,_);if(y===Set)return d(h,g,_);let b=Zf.call(h);if(b===Vf)return r(h,g,_);if(b===Kf)return u(h,g,_);if(b===Uf)return o(h,g,_);if(b===qf)return d(h,g,_);if(b===Gf)return typeof h.then!=`function`&&typeof g.then!=`function`&&c(h,g,_);if(b===Xf)return p(h,g,_);if(b===Hf)return i(h,g,_);if(b===Rf)return c(h,g,_);if(Yf[b])return f(h,g,_);if(b===Lf)return e(h,g,_);if(b===Bf)return n(h,g,_);if(b===zf||b===Wf||b===Jf)return l(h,g,_);if(m){let e=m[b];if(!e){let t=ff(h);t&&(e=m[t])}if(e)return e(h,g,_)}return!1}}function $f({circular:e,createCustomConfig:t,strict:n}){let r={areArrayBuffersEqual:xf,areArraysEqual:n?Af:Sf,areDataViewsEqual:Cf,areDatesEqual:wf,areErrorsEqual:Tf,areFunctionsEqual:Ef,areMapsEqual:n?uf(Df,Af):Df,areNumbersEqual:Of,areObjectsEqual:n?Af:kf,arePrimitiveWrappersEqual:jf,areRegExpsEqual:Mf,areSetsEqual:n?uf(Nf,Af):Nf,areTypedArraysEqual:n?uf(Pf,Af):Pf,areUrlsEqual:Ff,unknownTagComparators:void 0};if(t&&(r=Object.assign({},r,t(r))),e){let e=df(r.areArraysEqual),t=df(r.areMapsEqual),n=df(r.areObjectsEqual),i=df(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:e,areMapsEqual:t,areObjectsEqual:n,areSetsEqual:i})}return r}function ep(e){return function(t,n,r,i,a,o,s){return e(t,n,s)}}function tp({circular:e,comparator:t,createState:n,equals:r,strict:i}){if(n)return function(a,o){let{cache:s=e?new WeakMap:void 0,meta:c}=n();return t(a,o,{cache:s,equals:r,meta:c,strict:i})};if(e)return function(e,n){return t(e,n,{cache:new WeakMap,equals:r,meta:void 0,strict:i})};let a={cache:void 0,equals:r,meta:void 0,strict:i};return function(e,n){return t(e,n,a)}}var np=rp();rp({strict:!0}),rp({circular:!0}),rp({circular:!0,strict:!0}),rp({createInternalComparator:()=>hf}),rp({strict:!0,createInternalComparator:()=>hf}),rp({circular:!0,createInternalComparator:()=>hf}),rp({circular:!0,createInternalComparator:()=>hf,strict:!0});function rp(e={}){let{circular:t=!1,createInternalComparator:n,createState:r,strict:i=!1}=e,a=Qf($f(e));return tp({circular:t,comparator:a,createState:r,equals:n?n(a):ep(a),strict:i})}var ip=o((e=>{var t=u(),n=v();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),ap=o(((e,t)=>{t.exports=ip()})),J=c(u(),1),op=c(m(),1),sp=v(),Y=b(),cp=ap(),lp=(...e)=>t=>{e.forEach(e=>{typeof e==`function`?e(t):e&&(e.current=t)})},up=({contentComponent:e})=>{let t=(0,sp.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getServerSnapshot);return(0,Y.jsx)(Y.Fragment,{children:Object.values(t)})};function dp(){let e=new Set,t={};return{subscribe(t){return e.add(t),()=>{e.delete(t)}},getSnapshot(){return t},getServerSnapshot(){return t},setRenderer(n,r){t={...t,[n]:op.createPortal(r.reactElement,r.element,n)},e.forEach(e=>e())},removeRenderer(n){let r={...t};delete r[n],t=r,e.forEach(e=>e())}}}var fp=class extends J.Component{constructor(e){super(e),this.editorContentRef=J.createRef()}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){let e=this.props.editor;if(e&&!e.isDestroyed&&e.view.dom?.parentNode){if(e.contentComponent)return;let t=this.editorContentRef.current;t.append(...e.view.dom.parentNode.childNodes),e.setOptions({element:t}),e.contentComponent=dp(),e.createNodeViews(),e.isEditorContentInitialized=!0,this.forceUpdate()}}componentWillUnmount(){let e=this.props.editor;if(e){e.isEditorContentInitialized=!1,e.isDestroyed||e.view.setProps({nodeViews:{}}),e.contentComponent=null;try{if(!e.view.dom?.parentNode)return;let t=document.createElement(`div`);t.append(...e.view.dom.parentNode.childNodes),e.setOptions({element:t})}catch{}}}render(){let{editor:e,innerRef:t,...n}=this.props;return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`div`,{ref:lp(t,this.editorContentRef),...n}),e?.contentComponent&&(0,Y.jsx)(up,{contentComponent:e.contentComponent})]})}},pp=(0,J.forwardRef)((e,t)=>{let n=J.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[e.editor]);return J.createElement(fp,{key:n,innerRef:t,...e})}),mp=J.memo(pp),hp=typeof window<`u`?J.useLayoutEffect:J.useEffect,gp=class{constructor(e){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=e,this.lastSnapshot={editor:e,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber?this.lastSnapshot:(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber},this.lastSnapshot)}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}watch(e){if(this.editor=e,this.editor){let e=()=>{this.transactionNumber+=1,this.subscribers.forEach(e=>e())},t=this.editor;return t.on(`transaction`,e),()=>{t.off(`transaction`,e)}}}};function _p(e){let[t]=(0,J.useState)(()=>new gp(e.editor)),n=(0,cp.useSyncExternalStoreWithSelector)(t.subscribe,t.getSnapshot,t.getServerSnapshot,e.selector,e.equalityFn??np);return hp(()=>t.watch(e.editor),[e.editor,t]),(0,J.useDebugValue)(n),n}var vp=!1,yp=typeof window>`u`,bp=yp||!!(typeof window<`u`&&window.next),xp=class e{constructor(e){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId=``,this.options=e,this.subscriptions=new Set,this.setEditor(this.getInitialEditor()),this.scheduleDestroy(),this.getEditor=this.getEditor.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.subscribe=this.subscribe.bind(this),this.refreshEditorInstance=this.refreshEditorInstance.bind(this),this.scheduleDestroy=this.scheduleDestroy.bind(this),this.onRender=this.onRender.bind(this),this.createEditor=this.createEditor.bind(this)}setEditor(e){this.editor=e,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach(e=>e())}getInitialEditor(){let e=this.options.current.immediatelyRender,t=e??!0;return yp?(t&&vp&&console.warn("SSR detected. `immediatelyRender` has been set to false to avoid hydration mismatches"),t=!1):bp&&e===void 0&&(t=!1,vp&&console.warn("Next.js detected. `immediatelyRender` defaults to false to avoid hydration mismatches. Pass `immediatelyRender: true` explicitly if you are rendering the editor only on the client.")),t?this.createEditor():null}createEditor(){return new Yd({...this.options.current,onBeforeCreate:(...e)=>{var t;return(t=this.options.current).onBeforeCreate?.call(t,...e)},onBlur:(...e)=>{var t;return(t=this.options.current).onBlur?.call(t,...e)},onCreate:(...e)=>{var t;return(t=this.options.current).onCreate?.call(t,...e)},onDestroy:(...e)=>{var t;return(t=this.options.current).onDestroy?.call(t,...e)},onFocus:(...e)=>{var t;return(t=this.options.current).onFocus?.call(t,...e)},onSelectionUpdate:(...e)=>{var t;return(t=this.options.current).onSelectionUpdate?.call(t,...e)},onTransaction:(...e)=>{var t;return(t=this.options.current).onTransaction?.call(t,...e)},onUpdate:(...e)=>{var t;return(t=this.options.current).onUpdate?.call(t,...e)},onContentError:(...e)=>{var t;return(t=this.options.current).onContentError?.call(t,...e)},onDrop:(...e)=>{var t;return(t=this.options.current).onDrop?.call(t,...e)},onPaste:(...e)=>{var t;return(t=this.options.current).onPaste?.call(t,...e)},onDelete:(...e)=>{var t;return(t=this.options.current).onDelete?.call(t,...e)}})}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(e){return this.subscriptions.add(e),()=>{this.subscriptions.delete(e)}}static compareOptions(e,t){return Object.keys(e).every(n=>[`onCreate`,`onBeforeCreate`,`onDestroy`,`onUpdate`,`onTransaction`,`onFocus`,`onBlur`,`onSelectionUpdate`,`onContentError`,`onDrop`,`onPaste`].includes(n)?!0:n===`extensions`&&e.extensions&&t.extensions?e.extensions.length===t.extensions.length?e.extensions.every((e,n)=>e===t.extensions?.[n]):!1:e[n]===t[n])}onRender(t){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&t.length===0?e.compareOptions(this.options.current,this.editor.options)||this.editor.setOptions({...this.options.current,editable:this.editor.isEditable}):this.refreshEditorInstance(t),()=>{this.isComponentMounted=!1,this.scheduleDestroy()})}refreshEditorInstance(e){if(this.editor&&!this.editor.isDestroyed){if(this.previousDeps===null){this.previousDeps=e;return}if(this.previousDeps.length===e.length&&this.previousDeps.every((t,n)=>t===e[n]))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=e}scheduleDestroy(){let e=this.instanceId,t=this.editor;this.scheduledDestructionTimeout=setTimeout(()=>{if(this.isComponentMounted&&this.instanceId===e){t&&t.setOptions(this.options.current);return}t&&!t.isDestroyed&&(t.destroy(),this.instanceId===e&&this.setEditor(null))},1)}};function Sp(e={},t=[]){let n=(0,J.useRef)(e);n.current=e;let[r]=(0,J.useState)(()=>new xp(n)),i=(0,sp.useSyncExternalStore)(r.subscribe,r.getEditor,r.getServerSnapshot);return(0,J.useDebugValue)(i),(0,J.useEffect)(r.onRender(t)),_p({editor:i,selector:({transactionNumber:t})=>e.shouldRerenderOnTransaction===!1||e.shouldRerenderOnTransaction===void 0?null:e.immediatelyRender&&t===0?0:t+1}),i}var Cp=(0,J.createContext)({editor:null});Cp.Consumer;var wp=()=>(0,J.useContext)(Cp),Tp=(0,J.createContext)({onDragStart:()=>{},nodeViewContentChildren:void 0,nodeViewContentRef:()=>{}}),Ep=()=>(0,J.useContext)(Tp),Dp=J.forwardRef((e,t)=>{let{onDragStart:n}=Ep();return(0,Y.jsx)(e.as||`div`,{...e,ref:t,"data-node-view-wrapper":``,onDragStart:n,style:{whiteSpace:`normal`,...e.style}})});function Op(e){return!!(typeof e==`function`&&e.prototype&&e.prototype.isReactComponent)}function kp(e){return!!(typeof e==`object`&&e.$$typeof&&(e.$$typeof.toString()===`Symbol(react.forward_ref)`||e.$$typeof.description===`react.forward_ref`))}function Ap(e){return!!(typeof e==`object`&&e.$$typeof&&(e.$$typeof.toString()===`Symbol(react.memo)`||e.$$typeof.description===`react.memo`))}function jp(e){if(Op(e)||kp(e))return!0;if(Ap(e)){let t=e.type;if(t)return Op(t)||kp(t)}return!1}function Mp(){try{if(J.version)return parseInt(J.version.split(`.`)[0],10)>=19}catch{}return!1}var Np=class{constructor(e,{editor:t,props:n={},as:r=`div`,className:i=``}){this.ref=null,this.destroyed=!1,this.id=Math.floor(Math.random()*4294967295).toString(),this.component=e,this.editor=t,this.props=n,this.element=document.createElement(r),this.element.classList.add(`react-renderer`),i&&this.element.classList.add(...i.split(` `)),this.editor.isEditorContentInitialized?(0,op.flushSync)(()=>{this.render()}):queueMicrotask(()=>{this.destroyed||this.render()})}render(){var e;if(this.destroyed)return;let t=this.component,n=this.props,r=this.editor,i=Mp(),a=jp(t),o={...n};o.ref&&!(i||a)&&delete o.ref,!o.ref&&(i||a)&&(o.ref=e=>{this.ref=e}),this.reactElement=(0,Y.jsx)(t,{...o}),(e=r?.contentComponent)==null||e.setRenderer(this.id,this)}updateProps(e={}){if(this.destroyed)return;let t=!1,n=Object.keys(e);for(let r=0;r<n.length;r+=1){let i=n[r];if(e[i]!==this.props[i]){t=!0;break}}t&&(this.props={...this.props,...e},this.render())}destroy(){var e;this.destroyed=!0,(e=this.editor?.contentComponent)==null||e.removeRenderer(this.id);try{this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element)}catch{}}updateAttributes(e){Object.keys(e).forEach(t=>{this.element.setAttribute(t,e[t])})}};J.createContext({markViewContentRef:()=>{}});var Pp=class extends af{constructor(e,t,n){if(super(e,t,n),this.selectionRafId=null,this.handlePositionUpdate=()=>{let e=this.getPos();typeof e!=`number`||e===this.currentPos||(this.currentPos=e,this.renderer.updateProps({getPos:()=>this.getPos()}),typeof this.options.attrs==`function`&&this.updateElementAttributes())},this.cachedExtensionWithSyncedStorage=null,!this.node.isLeaf){this.options.contentDOMElementTag?this.contentDOMElement=document.createElement(this.options.contentDOMElementTag):this.contentDOMElement=document.createElement(this.node.isInline?`span`:`div`),this.contentDOMElement.dataset.nodeViewContentReact=``,this.contentDOMElement.dataset.nodeViewWrapper=``,this.contentDOMElement.style.whiteSpace=`inherit`;let e=this.dom.querySelector(`[data-node-view-content]`);if(!e)return;e.appendChild(this.contentDOMElement)}this.options.trackNodeViewPosition&&this.editor.on(`update`,this.handlePositionUpdate)}get extensionWithSyncedStorage(){if(!this.cachedExtensionWithSyncedStorage){let e=this.editor,t=this.extension;this.cachedExtensionWithSyncedStorage=new Proxy(t,{get(n,r,i){return r===`storage`?e.storage[t.name]??{}:Reflect.get(n,r,i)}})}return this.cachedExtensionWithSyncedStorage}mount(){let e={editor:this.editor,node:this.node,decorations:this.decorations,innerDecorations:this.innerDecorations,view:this.view,selected:!1,extension:this.extensionWithSyncedStorage,HTMLAttributes:this.HTMLAttributes,getPos:()=>this.getPos(),updateAttributes:(e={})=>this.updateAttributes(e),deleteNode:()=>this.deleteNode(),ref:(0,J.createRef)()};if(!this.component.displayName){let e=e=>e.charAt(0).toUpperCase()+e.substring(1);this.component.displayName=e(this.extension.name)}let t={onDragStart:this.onDragStart.bind(this),nodeViewContentRef:e=>{e&&this.contentDOMElement&&e.firstChild!==this.contentDOMElement&&(e.hasAttribute(`data-node-view-wrapper`)&&e.removeAttribute(`data-node-view-wrapper`),e.appendChild(this.contentDOMElement))}},n=this.component,r=(0,J.memo)(e=>(0,Y.jsx)(Tp.Provider,{value:t,children:(0,J.createElement)(n,e)}));r.displayName=`ReactNodeView`;let i=this.node.isInline?`span`:`div`;this.options.as&&(i=this.options.as);let{className:a=``}=this.options;this.handleSelectionUpdate=this.handleSelectionUpdate.bind(this),this.renderer=new Np(r,{editor:this.editor,props:e,as:i,className:`node-${this.node.type.name} ${a}`.trim()}),this.editor.on(`selectionUpdate`,this.handleSelectionUpdate),this.updateElementAttributes(),this.currentPos=this.getPos()}get dom(){if(this.renderer.element.firstElementChild&&!this.renderer.element.firstElementChild?.hasAttribute(`data-node-view-wrapper`))throw Error(`Please use the NodeViewWrapper component for your node view.`);return this.renderer.element}get contentDOM(){return this.node.isLeaf?null:this.contentDOMElement}handleSelectionUpdate(){this.selectionRafId&&=(cancelAnimationFrame(this.selectionRafId),null),this.selectionRafId=requestAnimationFrame(()=>{this.selectionRafId=null;let e=this.currentPos;if(typeof e==`number`)if(ku({selection:this.editor.state.selection,pos:e,nodeSize:this.node.nodeSize,selectedOnTextSelection:this.options.selectedOnTextSelection})){if(this.renderer.props.selected)return;this.selectNode()}else{if(!this.renderer.props.selected)return;this.deselectNode()}})}update(e,t,n){let r=e=>{this.renderer.updateProps(e),typeof this.options.attrs==`function`&&this.updateElementAttributes()};if(e.type!==this.node.type)return!1;if(typeof this.options.update==`function`){let i=this.node,a=this.decorations,o=this.innerDecorations;return this.node=e,this.decorations=t,this.innerDecorations=n,this.currentPos=this.getPos(),this.options.update({oldNode:i,oldDecorations:a,newNode:e,newDecorations:t,oldInnerDecorations:o,innerDecorations:n,updateProps:()=>r({node:e,decorations:t,innerDecorations:n,extension:this.extensionWithSyncedStorage})})}if(e===this.node)return this.node=e,this.decorations=t,this.innerDecorations=n,!0;let i=this.getPos();this.node=e,this.decorations=t,this.innerDecorations=n,this.currentPos=i;let a={node:e,decorations:t,innerDecorations:n,extension:this.extensionWithSyncedStorage};return this.options.trackNodeViewPosition&&(a.getPos=()=>this.getPos()),r(a),!0}selectNode(){this.renderer.updateProps({selected:!0}),this.renderer.element.classList.add(`ProseMirror-selectednode`)}deselectNode(){this.renderer.updateProps({selected:!1}),this.renderer.element.classList.remove(`ProseMirror-selectednode`)}destroy(){this.renderer.destroy(),this.editor.off(`selectionUpdate`,this.handleSelectionUpdate),this.options.trackNodeViewPosition&&this.editor.off(`update`,this.handlePositionUpdate),this.contentDOMElement=null,this.selectionRafId&&=(cancelAnimationFrame(this.selectionRafId),null)}updateElementAttributes(){if(this.options.attrs){let e={};if(typeof this.options.attrs==`function`){let t=this.editor.extensionManager.attributes,n=$l(this.node,t);e=this.options.attrs({node:this.node,HTMLAttributes:n})}else e=this.options.attrs;this.renderer.updateAttributes(e)}}};function Fp(e,t){return n=>n.editor.contentComponent?new Pp(e,n,t):{}}var Ip=(0,J.createContext)({get editor(){throw Error(`useTiptap must be used within a <Tiptap> provider`)}});Ip.displayName=`TiptapContext`;var Lp=()=>(0,J.useContext)(Ip);function Rp({editor:e,instance:t,children:n}){let r=e??t;if(!r)throw Error("Tiptap: An editor instance is required. Pass a non-null `editor` prop.");let i=(0,J.useMemo)(()=>({editor:r}),[r]),a=(0,J.useMemo)(()=>({editor:r}),[r]);return(0,Y.jsx)(Cp.Provider,{value:a,children:(0,Y.jsx)(Ip.Provider,{value:i,children:n})})}Rp.displayName=`Tiptap`;function zp({...e}){let{editor:t}=Lp();return(0,Y.jsx)(mp,{editor:t,...e})}zp.displayName=`Tiptap.Content`,Object.assign(Rp,{Content:zp});var Bp=(e,t)=>{if(e===`slot`)return 0;if(e instanceof Function)return e(t);let{children:n,...r}=t??{};if(e===`svg`)throw Error(`SVG elements are not supported in the JSX syntax, use the array syntax instead`);return[e,r,n]};function Vp(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let i=e.child(r),a=t.child(r);if(i==a){n+=i.nodeSize;continue}if(!i.sameMarkup(a))return n;if(i.isText&&i.text!=a.text){for(let e=0;i.text[e]==a.text[e];e++)n++;return n}if(i.content.size||a.content.size){let e=Vp(i.content,a.content,n+1);if(e!=null)return e}n+=i.nodeSize}}function Hp(e,t,n,r){for(let i=e.childCount,a=t.childCount;;){if(i==0||a==0)return i==a?null:{a:n,b:r};let o=e.child(--i),s=t.child(--a),c=o.nodeSize;if(o==s){n-=c,r-=c;continue}if(!o.sameMarkup(s))return{a:n,b:r};if(o.isText&&o.text!=s.text){let e=0,t=Math.min(o.text.length,s.text.length);for(;e<t&&o.text[o.text.length-e-1]==s.text[s.text.length-e-1];)e++,n--,r--;return{a:n,b:r}}if(o.content.size||s.content.size){let e=Hp(o.content,s.content,n-1,r-1);if(e)return e}n-=c,r-=c}}var Up=class e{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let t=0;t<e.length;t++)this.size+=e[t].nodeSize}nodesBetween(e,t,n,r=0,i){for(let a=0,o=0;o<t;a++){let s=this.content[a],c=o+s.nodeSize;if(c>e&&n(s,r+o,i||null,a)!==!1&&s.content.size){let i=o+1;s.nodesBetween(Math.max(0,e-i),Math.min(s.content.size,t-i),n,r+i)}o=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,r){let i=``,a=!0;return this.nodesBetween(e,t,(o,s)=>{let c=o.isText?o.text.slice(Math.max(e,s)-s,t-s):o.isLeaf?r?typeof r==`function`?r(o):r:o.type.spec.leafText?o.type.spec.leafText(o):``:``;o.isBlock&&(o.isLeaf&&c||o.isTextblock)&&n&&(a?a=!1:i+=n),i+=c},0),i}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,r=t.firstChild,i=this.content.slice(),a=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),a=1);a<t.content.length;a++)i.push(t.content[a]);return new e(i,this.size+t.size)}cut(t,n=this.size){if(t==0&&n==this.size)return this;let r=[],i=0;if(n>t)for(let e=0,a=0;a<n;e++){let o=this.content[e],s=a+o.nodeSize;s>t&&((a<t||s>n)&&(o=o.isText?o.cut(Math.max(0,t-a),Math.min(o.text.length,n-a)):o.cut(Math.max(0,t-a-1),Math.min(o.content.size,n-a-1))),r.push(o),i+=o.nodeSize),a=s}return new e(r,i)}cutByIndex(t,n){return t==n?e.empty:t==0&&n==this.content.length?this:new e(this.content.slice(t,n))}replaceChild(t,n){let r=this.content[t];if(r==n)return this;let i=this.content.slice(),a=this.size+n.nodeSize-r.nodeSize;return i[t]=n,new e(i,a)}addToStart(t){return new e([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new e(this.content.concat(t),this.size+t.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw RangeError(`Index `+e+` out of range for `+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,n=0;t<this.content.length;t++){let r=this.content[t];e(r,n,t),n+=r.nodeSize}}findDiffStart(e,t=0){return Vp(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return Hp(this,e,t,n)}findIndex(e){if(e==0)return Gp(0,e);if(e==this.size)return Gp(this.content.length,e);if(e>this.size||e<0)throw RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,n=0;;t++){let r=this.child(t),i=n+r.nodeSize;if(i>=e)return i==e?Gp(t+1,i):Gp(t,n);n=i}}toString(){return`<`+this.toStringInner()+`>`}toStringInner(){return this.content.join(`, `)}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(t,n){if(!n)return e.empty;if(!Array.isArray(n))throw RangeError(`Invalid input for Fragment.fromJSON`);return e.fromArray(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return e.empty;let n,r=0;for(let e=0;e<t.length;e++){let i=t[e];r+=i.nodeSize,e&&i.isText&&t[e-1].sameMarkup(i)?(n||=t.slice(0,e),n[n.length-1]=i.withText(n[n.length-1].text+i.text)):n&&n.push(i)}return new e(n||t,r)}static from(t){if(!t)return e.empty;if(t instanceof e)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new e([t],t.nodeSize);throw RangeError(`Can not convert `+t+` to a Fragment`+(t.nodesBetween?` (looks like multiple versions of prosemirror-model were loaded)`:``))}};Up.empty=new Up([],0);var Wp={index:0,offset:0};function Gp(e,t){return Wp.index=e,Wp.offset=t,Wp}function Kp(e,t){if(e===t)return!0;if(!(e&&typeof e==`object`)||!(t&&typeof t==`object`))return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!Kp(e[n],t[n]))return!1}else{for(let n in e)if(!(n in t)||!Kp(e[n],t[n]))return!1;for(let n in t)if(!(n in e))return!1}return!0}var qp=class e{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(this.eq(i))return e;if(this.type.excludes(i.type))t||=e.slice(0,r);else if(i.type.excludes(this.type))return e;else!n&&i.type.rank>this.type.rank&&(t||=e.slice(0,r),t.push(this),n=!0),t&&t.push(i)}return t||=e.slice(),n||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&Kp(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw RangeError(`Invalid input for Mark.fromJSON`);let n=e.marks[t.type];if(!n)throw RangeError(`There is no mark type ${t.type} in this schema`);let r=n.create(t.attrs);return n.checkAttrs(r.attrs),r}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&t.length==0)return e.none;if(t instanceof e)return[t];let n=t.slice();return n.sort((e,t)=>e.type.rank-t.type.rank),n}};qp.none=[];var Jp=class extends Error{},Yp=class e{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let r=Zp(this.content,t+this.openStart,n,this.openStart+1,this.openEnd+1);return r&&new e(r,this.openStart,this.openEnd)}removeBetween(t,n){return new e(Xp(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+`(`+this.openStart+`,`+this.openEnd+`)`}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(t,n){if(!n)return e.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!=`number`||typeof i!=`number`)throw RangeError(`Invalid input for Slice.fromJSON`);return new e(Up.fromJSON(t,n.content),r,i)}static maxOpen(t,n=!0){let r=0,i=0;for(let e=t.firstChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.firstChild)r++;for(let e=t.lastChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.lastChild)i++;return new e(t,r,i)}};Yp.empty=new Yp(Up.empty,0,0);function Xp(e,t,n){let{index:r,offset:i}=e.findIndex(t),a=e.maybeChild(r),{index:o,offset:s}=e.findIndex(n);if(i==t||a.isText){if(s!=n&&!e.child(o).isText)throw RangeError(`Removing non-flat range`);return e.cut(0,t).append(e.cut(n))}if(r!=o)throw RangeError(`Removing non-flat range`);return e.replaceChild(r,a.copy(Xp(a.content,t-i-1,n-i-1)))}function Zp(e,t,n,r,i,a){let{index:o,offset:s}=e.findIndex(t),c=e.maybeChild(o);if(s==t||c.isText)return a&&r<=0&&i<=0&&!a.canReplace(o,o,n)?null:e.cut(0,t).append(n).append(e.cut(t));let l=Zp(c.content,t-s-1,n,o==0?r-1:0,o==e.childCount-1?i-1:0,c);return l&&e.replaceChild(o,c.copy(l))}function Qp(e,t,n){if(n.openStart>e.depth)throw new Jp(`Inserted content deeper than insertion position`);if(e.depth-n.openStart!=t.depth-n.openEnd)throw new Jp(`Inconsistent open depths`);return $p(e,t,n,0)}function $p(e,t,n,r){let i=e.index(r),a=e.node(r);if(i==t.index(r)&&r<e.depth-n.openStart){let o=$p(e,t,n,r+1);return a.copy(a.content.replaceChild(i,o))}else if(!n.content.size)return im(a,om(e,t,r));else if(!n.openStart&&!n.openEnd&&e.depth==r&&t.depth==r){let r=e.parent,i=r.content;return im(r,i.cut(0,e.parentOffset).append(n.content).append(i.cut(t.parentOffset)))}else{let{start:i,end:o}=sm(n,e);return im(a,am(e,i,o,t,r))}}function em(e,t){if(!t.type.compatibleContent(e.type))throw new Jp(`Cannot join `+t.type.name+` onto `+e.type.name)}function tm(e,t,n){let r=e.node(n);return em(r,t.node(n)),r}function nm(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function rm(e,t,n,r){let i=(t||e).node(n),a=0,o=t?t.index(n):i.childCount;e&&(a=e.index(n),e.depth>n?a++:e.textOffset&&(nm(e.nodeAfter,r),a++));for(let e=a;e<o;e++)nm(i.child(e),r);t&&t.depth==n&&t.textOffset&&nm(t.nodeBefore,r)}function im(e,t){return e.type.checkContent(t),e.copy(t)}function am(e,t,n,r,i){let a=e.depth>i&&tm(e,t,i+1),o=r.depth>i&&tm(n,r,i+1),s=[];return rm(null,e,i,s),a&&o&&t.index(i)==n.index(i)?(em(a,o),nm(im(a,am(e,t,n,r,i+1)),s)):(a&&nm(im(a,om(e,t,i+1)),s),rm(t,n,i,s),o&&nm(im(o,om(n,r,i+1)),s)),rm(r,null,i,s),new Up(s)}function om(e,t,n){let r=[];return rm(null,e,n,r),e.depth>n&&nm(im(tm(e,t,n+1),om(e,t,n+1)),r),rm(t,null,n,r),new Up(r)}function sm(e,t){let n=t.depth-e.openStart,r=t.node(n).copy(e.content);for(let e=n-1;e>=0;e--)r=t.node(e).copy(Up.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}var cm=class e{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw RangeError(`There is no position before the top-level node`);return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw RangeError(`There is no position after the top-level node`);return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=e.child(t);return n?e.child(t).cut(n):r}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[t*3],r=t==0?0:this.path[t*3-1]+1;for(let t=0;t<e;t++)r+=n.child(t).nodeSize;return r}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return qp.none;if(this.textOffset)return e.child(t).marks;let n=e.maybeChild(t-1),r=e.maybeChild(t);if(!n){let e=n;n=r,r=e}let i=n.marks;for(var a=0;a<i.length;a++)i[a].type.spec.inclusive===!1&&(!r||!i[a].isInSet(r.marks))&&(i=i[a--].removeFromSet(i));return i}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let n=t.marks,r=e.parent.maybeChild(e.index());for(var i=0;i<n.length;i++)n[i].type.spec.inclusive===!1&&(!r||!n[i].isInSet(r.marks))&&(n=n[i--].removeFromSet(n));return n}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new fm(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e=``;for(let t=1;t<=this.depth;t++)e+=(e?`/`:``)+this.node(t).type.name+`_`+this.index(t-1);return e+`:`+this.parentOffset}static resolve(t,n){if(!(n>=0&&n<=t.content.size))throw RangeError(`Position `+n+` out of range`);let r=[],i=0,a=n;for(let e=t;;){let{index:t,offset:n}=e.content.findIndex(a),o=a-n;if(r.push(e,t,i+n),!o||(e=e.child(t),e.isText))break;a=o-1,i+=n+1}return new e(n,r,a)}static resolveCached(t,n){let r=dm.get(t);if(r)for(let e=0;e<r.elts.length;e++){let t=r.elts[e];if(t.pos==n)return t}else dm.set(t,r=new lm);let i=r.elts[r.i]=e.resolve(t,n);return r.i=(r.i+1)%um,i}},lm=class{constructor(){this.elts=[],this.i=0}},um=12,dm=new WeakMap,fm=class{constructor(e,t,n){this.$from=e,this.$to=t,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}},pm=Object.create(null),mm=class e{constructor(e,t,n,r=qp.none){this.type=e,this.attrs=t,this.marks=r,this.content=n||Up.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,n,r=0){this.content.nodesBetween(e,t,n,r,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,``)}textBetween(e,t,n,r){return this.content.textBetween(e,t,n,r)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,n){return this.type==e&&Kp(this.attrs,t||e.defaultAttrs||pm)&&qp.sameSet(this.marks,n||qp.none)}copy(t=null){return t==this.content?this:new e(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.content,t)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,n=!1){if(e==t)return Yp.empty;let r=this.resolve(e),i=this.resolve(t),a=n?0:r.sharedDepth(t),o=r.start(a);return new Yp(r.node(a).content.cut(r.pos-o,i.pos-o),r.depth-a,i.depth-a)}replace(e,t,n){return Qp(this.resolve(e),this.resolve(t),n)}nodeAt(e){for(let t=this;;){let{index:n,offset:r}=t.content.findIndex(e);if(t=t.maybeChild(n),!t)return null;if(r==e||t.isText)return t;e-=r+1}}childAfter(e){let{index:t,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:n}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(t),index:t,offset:n};let r=this.content.child(t-1);return{node:r,index:t-1,offset:n-r.nodeSize}}resolve(e){return cm.resolveCached(this,e)}resolveNoCache(e){return cm.resolve(this,e)}rangeHasMark(e,t,n){let r=!1;return t>e&&this.nodesBetween(e,t,e=>(n.isInSet(e.marks)&&(r=!0),!r)),r}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+=`(`+this.content.toStringInner()+`)`),hm(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw Error(`Called contentMatchAt on a node with invalid content`);return t}canReplace(e,t,n=Up.empty,r=0,i=n.childCount){let a=this.contentMatchAt(e).matchFragment(n,r,i),o=a&&a.matchFragment(this.content,t);if(!o||!o.validEnd)return!1;for(let e=r;e<i;e++)if(!this.type.allowsMarks(n.child(e).marks))return!1;return!0}canReplaceWith(e,t,n,r){if(r&&!this.type.allowsMarks(r))return!1;let i=this.contentMatchAt(e).matchType(n),a=i&&i.matchFragment(this.content,t);return a?a.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=qp.none;for(let t=0;t<this.marks.length;t++){let n=this.marks[t];n.type.checkAttrs(n.attrs),e=n.addToSet(e)}if(!qp.sameSet(e,this.marks))throw RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(e=>e.type.name)}`);this.content.forEach(e=>e.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(e=>e.toJSON())),e}static fromJSON(e,t){if(!t)throw RangeError(`Invalid input for Node.fromJSON`);let n;if(t.marks){if(!Array.isArray(t.marks))throw RangeError(`Invalid mark data for Node.fromJSON`);n=t.marks.map(e.markFromJSON)}if(t.type==`text`){if(typeof t.text!=`string`)throw RangeError(`Invalid text node in JSON`);return e.text(t.text,n)}let r=Up.fromJSON(e,t.content),i=e.nodeType(t.type).create(t.attrs,r,n);return i.type.checkAttrs(i.attrs),i}};mm.prototype.text=void 0;function hm(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+`(`+t+`)`;return t}var gm=class e{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new _m(t,n);if(r.next==null)return e.empty;let i=vm(r);r.next&&r.err(`Unexpected trailing text`);let a=Om(Tm(i));return km(a,r),a}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,n=e.childCount){let r=this;for(let i=t;r&&i<n;i++)r=r.matchType(e.child(i).type);return r}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1}fillBefore(e,t=!1,n=0){let r=[this];function i(a,o){let s=a.matchFragment(e,n);if(s&&(!t||s.validEnd))return Up.from(o.map(e=>e.createAndFill()));for(let e=0;e<a.next.length;e++){let{type:t,next:n}=a.next[e];if(!(t.isText||t.hasRequiredAttrs())&&r.indexOf(n)==-1){r.push(n);let e=i(n,o.concat(t));if(e)return e}}return null}return i(this,[])}findWrapping(e){for(let t=0;t<this.wrapCache.length;t+=2)if(this.wrapCache[t]==e)return this.wrapCache[t+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let r=n.shift(),i=r.match;if(i.matchType(e)){let e=[];for(let t=r;t.type;t=t.via)e.push(t.type);return e.reverse()}for(let e=0;e<i.next.length;e++){let{type:a,next:o}=i.next[e];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in t)&&(!r.type||o.validEnd)&&(n.push({match:a.contentMatch,type:a,via:r}),t[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(n){e.push(n);for(let r=0;r<n.next.length;r++)e.indexOf(n.next[r].next)==-1&&t(n.next[r].next)}return t(this),e.map((t,n)=>{let r=n+(t.validEnd?`*`:` `)+` `;for(let n=0;n<t.next.length;n++)r+=(n?`, `:``)+t.next[n].type.name+`->`+e.indexOf(t.next[n].next);return r}).join(`
|
|
132
|
+
`)}};gm.empty=new gm(!0);var _m=class{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==``&&this.tokens.pop(),this.tokens[0]==``&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw SyntaxError(e+` (in content expression '`+this.string+`')`)}};function vm(e){let t=[];do t.push(ym(e));while(e.eat(`|`));return t.length==1?t[0]:{type:`choice`,exprs:t}}function ym(e){let t=[];do t.push(bm(e));while(e.next&&e.next!=`)`&&e.next!=`|`);return t.length==1?t[0]:{type:`seq`,exprs:t}}function bm(e){let t=wm(e);for(;;)if(e.eat(`+`))t={type:`plus`,expr:t};else if(e.eat(`*`))t={type:`star`,expr:t};else if(e.eat(`?`))t={type:`opt`,expr:t};else if(e.eat(`{`))t=Sm(e,t);else break;return t}function xm(e){/\D/.test(e.next)&&e.err(`Expected number, got '`+e.next+`'`);let t=Number(e.next);return e.pos++,t}function Sm(e,t){let n=xm(e),r=n;return e.eat(`,`)&&(r=e.next==`}`?-1:xm(e)),e.eat(`}`)||e.err(`Unclosed braced range`),{type:`range`,min:n,max:r,expr:t}}function Cm(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let i=[];for(let e in n){let r=n[e];r.isInGroup(t)&&i.push(r)}return i.length==0&&e.err(`No node type or group '`+t+`' found`),i}function wm(e){if(e.eat(`(`)){let t=vm(e);return e.eat(`)`)||e.err(`Missing closing paren`),t}else if(/\W/.test(e.next))e.err(`Unexpected token '`+e.next+`'`);else{let t=Cm(e,e.next).map(t=>(e.inline==null?e.inline=t.isInline:e.inline!=t.isInline&&e.err(`Mixing inline and block content`),{type:`name`,value:t}));return e.pos++,t.length==1?t[0]:{type:`choice`,exprs:t}}}function Tm(e){let t=[[]];return i(a(e,0),n()),t;function n(){return t.push([])-1}function r(e,n,r){let i={term:r,to:n};return t[e].push(i),i}function i(e,t){e.forEach(e=>e.to=t)}function a(e,t){if(e.type==`choice`)return e.exprs.reduce((e,n)=>e.concat(a(n,t)),[]);if(e.type==`seq`)for(let r=0;;r++){let o=a(e.exprs[r],t);if(r==e.exprs.length-1)return o;i(o,t=n())}else if(e.type==`star`){let o=n();return r(t,o),i(a(e.expr,o),o),[r(o)]}else if(e.type==`plus`){let o=n();return i(a(e.expr,t),o),i(a(e.expr,o),o),[r(o)]}else if(e.type==`opt`)return[r(t)].concat(a(e.expr,t));else if(e.type==`range`){let o=t;for(let t=0;t<e.min;t++){let t=n();i(a(e.expr,o),t),o=t}if(e.max==-1)i(a(e.expr,o),o);else for(let t=e.min;t<e.max;t++){let t=n();r(o,t),i(a(e.expr,o),t),o=t}return[r(o)]}else if(e.type==`name`)return[r(t,void 0,e.value)];else throw Error(`Unknown expr type`)}}function Em(e,t){return t-e}function Dm(e,t){let n=[];return r(t),n.sort(Em);function r(t){let i=e[t];if(i.length==1&&!i[0].term)return r(i[0].to);n.push(t);for(let e=0;e<i.length;e++){let{term:t,to:a}=i[e];!t&&n.indexOf(a)==-1&&r(a)}}}function Om(e){let t=Object.create(null);return n(Dm(e,0));function n(r){let i=[];r.forEach(t=>{e[t].forEach(({term:t,to:n})=>{if(!t)return;let r;for(let e=0;e<i.length;e++)i[e][0]==t&&(r=i[e][1]);Dm(e,n).forEach(e=>{r||i.push([t,r=[]]),r.indexOf(e)==-1&&r.push(e)})})});let a=t[r.join(`,`)]=new gm(r.indexOf(e.length-1)>-1);for(let e=0;e<i.length;e++){let r=i[e][1].sort(Em);a.next.push({type:i[e][0],next:t[r.join(`,`)]||n(r)})}return a}}function km(e,t){for(let n=0,r=[e];n<r.length;n++){let e=r[n],i=!e.validEnd,a=[];for(let t=0;t<e.next.length;t++){let{type:n,next:o}=e.next[t];a.push(n.name),i&&!(n.isText||n.hasRequiredAttrs())&&(i=!1),r.indexOf(o)==-1&&r.push(o)}i&&t.err(`Only non-generatable nodes (`+a.join(`, `)+`) in a required position (see https://prosemirror.net/docs/guide/#generatable)`)}}var Am=65535,jm=2**16;function Mm(e,t){return e+t*jm}function Nm(e){return e&Am}function Pm(e){return(e-(e&Am))/jm}var Fm=1,Im=2,Lm=4,Rm=8,zm=class{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(this.delInfo&Rm)>0}get deletedBefore(){return(this.delInfo&(Fm|Lm))>0}get deletedAfter(){return(this.delInfo&(Im|Lm))>0}get deletedAcross(){return(this.delInfo&Lm)>0}},Bm=class e{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&e.empty)return e.empty}recover(e){let t=0,n=Nm(e);if(!this.inverted)for(let e=0;e<n;e++)t+=this.ranges[e*3+2]-this.ranges[e*3+1];return this.ranges[n*3]+t+Pm(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,n){let r=0,i=this.inverted?2:1,a=this.inverted?1:2;for(let o=0;o<this.ranges.length;o+=3){let s=this.ranges[o]-(this.inverted?r:0);if(s>e)break;let c=this.ranges[o+i],l=this.ranges[o+a],u=s+c;if(e<=u){let i=c?e==s?-1:e==u?1:t:t,a=s+r+(i<0?0:l);if(n)return a;let d=e==(t<0?s:u)?null:Mm(o/3,e-s),f=e==s?Im:e==u?Fm:Lm;return(t<0?e!=s:e!=u)&&(f|=Rm),new zm(a,f,d)}r+=l-c}return n?e+r:new zm(e+r,0,null)}touches(e,t){let n=0,r=Nm(t),i=this.inverted?2:1,a=this.inverted?1:2;for(let t=0;t<this.ranges.length;t+=3){let o=this.ranges[t]-(this.inverted?n:0);if(o>e)break;let s=this.ranges[t+i];if(e<=o+s&&t==r*3)return!0;n+=this.ranges[t+a]-s}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,i=0;r<this.ranges.length;r+=3){let a=this.ranges[r],o=a-(this.inverted?i:0),s=a+(this.inverted?0:i),c=this.ranges[r+t],l=this.ranges[r+n];e(o,o+c,s,s+l),i+=l-c}}invert(){return new e(this.ranges,!this.inverted)}toString(){return(this.inverted?`-`:``)+JSON.stringify(this.ranges)}static offset(t){return t==0?e.empty:new e(t<0?[0,-t,0]:[0,0,t])}};Bm.empty=new Bm([]);var Vm=Object.create(null),Hm=class{getMap(){return Bm.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw RangeError(`Invalid input for Step.fromJSON`);let n=Vm[t.stepType];if(!n)throw RangeError(`No step type ${t.stepType} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in Vm)throw RangeError(`Duplicate use of step JSON ID `+e);return Vm[e]=t,t.prototype.jsonID=e,t}},Um=class e{constructor(e,t){this.doc=e,this.failed=t}static ok(t){return new e(t,null)}static fail(t){return new e(null,t)}static fromReplace(t,n,r,i){try{return e.ok(t.replace(n,r,i))}catch(t){if(t instanceof Jp)return e.fail(t.message);throw t}}};function Wm(e,t,n){let r=[];for(let i=0;i<e.childCount;i++){let a=e.child(i);a.content.size&&(a=a.copy(Wm(a.content,t,a))),a.isInline&&(a=t(a,n,i)),r.push(a)}return Up.fromArray(r)}var Gm=class e extends Hm{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=e.resolve(this.from),r=n.node(n.sharedDepth(this.to)),i=new Yp(Wm(t.content,(e,t)=>!e.isAtom||!t.type.allowsMarkType(this.mark.type)?e:e.mark(this.mark.addToSet(e.marks)),r),t.openStart,t.openEnd);return Um.fromReplace(e,this.from,this.to,i)}invert(){return new Km(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)}merge(t){return t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:`addMark`,mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for AddMarkStep.fromJSON`);return new e(n.from,n.to,t.markFromJSON(n.mark))}};Hm.jsonID(`addMark`,Gm);var Km=class e extends Hm{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=new Yp(Wm(t.content,e=>e.mark(this.mark.removeFromSet(e.marks)),e),t.openStart,t.openEnd);return Um.fromReplace(e,this.from,this.to,n)}invert(){return new Gm(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)}merge(t){return t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:`removeMark`,mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for RemoveMarkStep.fromJSON`);return new e(n.from,n.to,t.markFromJSON(n.mark))}};Hm.jsonID(`removeMark`,Km);var qm=class e extends Hm{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Um.fail(`No node at mark step's position`);let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return Um.fromReplace(e,this.pos,this.pos+1,new Yp(Up.from(n),0,+!t.isLeaf))}invert(t){let n=t.nodeAt(this.pos);if(n){let t=this.mark.addToSet(n.marks);if(t.length==n.marks.length){for(let r=0;r<n.marks.length;r++)if(!n.marks[r].isInSet(t))return new e(this.pos,n.marks[r]);return new e(this.pos,this.mark)}}return new Jm(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.mark)}toJSON(){return{stepType:`addNodeMark`,pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!=`number`)throw RangeError(`Invalid input for AddNodeMarkStep.fromJSON`);return new e(n.pos,t.markFromJSON(n.mark))}};Hm.jsonID(`addNodeMark`,qm);var Jm=class e extends Hm{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Um.fail(`No node at mark step's position`);let n=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return Um.fromReplace(e,this.pos,this.pos+1,new Yp(Up.from(n),0,+!t.isLeaf))}invert(e){let t=e.nodeAt(this.pos);return!t||!this.mark.isInSet(t.marks)?this:new qm(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.mark)}toJSON(){return{stepType:`removeNodeMark`,pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!=`number`)throw RangeError(`Invalid input for RemoveNodeMarkStep.fromJSON`);return new e(n.pos,t.markFromJSON(n.mark))}};Hm.jsonID(`removeNodeMark`,Jm);var Ym=class e extends Hm{constructor(e,t,n,r=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=r}apply(e){return this.structure&&Zm(e,this.from,this.to)?Um.fail(`Structure replace would overwrite content`):Um.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Bm([this.from,this.to-this.from,this.slice.size])}invert(t){return new e(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let n=t.mapResult(this.to,-1),r=this.from==this.to&&e.MAP_BIAS<0?n:t.mapResult(this.from,1);return r.deletedAcross&&n.deletedAcross?null:new e(r.pos,Math.max(r.pos,n.pos),this.slice,this.structure)}merge(t){if(!(t instanceof e)||t.structure||this.structure)return null;if(this.from+this.slice.size==t.from&&!this.slice.openEnd&&!t.slice.openStart){let n=this.slice.size+t.slice.size==0?Yp.empty:new Yp(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new e(this.from,this.to+(t.to-t.from),n,this.structure)}else if(t.to==this.from&&!this.slice.openStart&&!t.slice.openEnd){let n=this.slice.size+t.slice.size==0?Yp.empty:new Yp(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new e(t.from,this.to,n,this.structure)}else return null}toJSON(){let e={stepType:`replace`,from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for ReplaceStep.fromJSON`);return new e(n.from,n.to,Yp.fromJSON(t,n.slice),!!n.structure)}};Ym.MAP_BIAS=1,Hm.jsonID(`replace`,Ym);var Xm=class e extends Hm{constructor(e,t,n,r,i,a,o=!1){super(),this.from=e,this.to=t,this.gapFrom=n,this.gapTo=r,this.slice=i,this.insert=a,this.structure=o}apply(e){if(this.structure&&(Zm(e,this.from,this.gapFrom)||Zm(e,this.gapTo,this.to)))return Um.fail(`Structure gap-replace would overwrite content`);let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return Um.fail(`Gap is not a flat range`);let n=this.slice.insertAt(this.insert,t.content);return n?Um.fromReplace(e,this.from,this.to,n):Um.fail(`Content does not fit in gap`)}getMap(){return new Bm([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(t){let n=this.gapTo-this.gapFrom;return new e(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1),i=this.from==this.gapFrom?n.pos:t.map(this.gapFrom,-1),a=this.to==this.gapTo?r.pos:t.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||i<n.pos||a>r.pos?null:new e(n.pos,r.pos,i,a,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:`replaceAround`,from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`||typeof n.gapFrom!=`number`||typeof n.gapTo!=`number`||typeof n.insert!=`number`)throw RangeError(`Invalid input for ReplaceAroundStep.fromJSON`);return new e(n.from,n.to,n.gapFrom,n.gapTo,Yp.fromJSON(t,n.slice),n.insert,!!n.structure)}};Hm.jsonID(`replaceAround`,Xm);function Zm(e,t,n){let r=e.resolve(t),i=n-t,a=r.depth;for(;i>0&&a>0&&r.indexAfter(a)==r.node(a).childCount;)a--,i--;if(i>0){let e=r.node(a).maybeChild(r.indexAfter(a));for(;i>0;){if(!e||e.isLeaf)return!0;e=e.firstChild,i--}}return!1}var Qm=class e extends Hm{constructor(e,t,n){super(),this.pos=e,this.attr=t,this.value=n}apply(e){let t=e.nodeAt(this.pos);if(!t)return Um.fail(`No node at attribute step's position`);let n=Object.create(null);for(let e in t.attrs)n[e]=t.attrs[e];n[this.attr]=this.value;let r=t.type.create(n,null,t.marks);return Um.fromReplace(e,this.pos,this.pos+1,new Yp(Up.from(r),0,+!t.isLeaf))}getMap(){return Bm.empty}invert(t){return new e(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.attr,this.value)}toJSON(){return{stepType:`attr`,pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.pos!=`number`||typeof n.attr!=`string`)throw RangeError(`Invalid input for AttrStep.fromJSON`);return new e(n.pos,n.attr,n.value)}};Hm.jsonID(`attr`,Qm);var $m=class e extends Hm{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let n in e.attrs)t[n]=e.attrs[n];t[this.attr]=this.value;let n=e.type.create(t,e.content,e.marks);return Um.ok(n)}getMap(){return Bm.empty}invert(t){return new e(this.attr,t.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:`docAttr`,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.attr!=`string`)throw RangeError(`Invalid input for DocAttrStep.fromJSON`);return new e(n.attr,n.value)}};Hm.jsonID(`docAttr`,$m);var eh=class extends Error{};eh=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n},eh.prototype=Object.create(Error.prototype),eh.prototype.constructor=eh,eh.prototype.name=`TransformError`;var th=Object.create(null),nh=class{constructor(e,t,n){this.$anchor=e,this.$head=t,this.ranges=n||[new rh(e.min(t),e.max(t))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,t=Yp.empty){let n=t.content.lastChild,r=null;for(let e=0;e<t.openEnd;e++)r=n,n=n.lastChild;let i=e.steps.length,a=this.ranges;for(let o=0;o<a.length;o++){let{$from:s,$to:c}=a[o],l=e.mapping.slice(i);e.replaceRange(l.map(s.pos),l.map(c.pos),o?Yp.empty:t),o==0&&ph(e,i,(n?n.isInline:r&&r.isTextblock)?-1:1)}}replaceWith(e,t){let n=e.steps.length,r=this.ranges;for(let i=0;i<r.length;i++){let{$from:a,$to:o}=r[i],s=e.mapping.slice(n),c=s.map(a.pos),l=s.map(o.pos);i?e.deleteRange(c,l):(e.replaceRangeWith(c,l,t),ph(e,n,t.isInline?-1:1))}}static findFrom(e,t,n=!1){let r=e.parent.inlineContent?new oh(e):fh(e.node(0),e.parent,e.pos,e.index(),t,n);if(r)return r;for(let r=e.depth-1;r>=0;r--){let i=t<0?fh(e.node(0),e.node(r),e.before(r+1),e.index(r),t,n):fh(e.node(0),e.node(r),e.after(r+1),e.index(r)+1,t,n);if(i)return i}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new uh(e.node(0))}static atStart(e){return fh(e,e,0,0,1)||new uh(e)}static atEnd(e){return fh(e,e,e.content.size,e.childCount,-1)||new uh(e)}static fromJSON(e,t){if(!t||!t.type)throw RangeError(`Invalid input for Selection.fromJSON`);let n=th[t.type];if(!n)throw RangeError(`No selection type ${t.type} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in th)throw RangeError(`Duplicate use of selection JSON ID `+e);return th[e]=t,t.prototype.jsonID=e,t}getBookmark(){return oh.between(this.$anchor,this.$head).getBookmark()}};nh.prototype.visible=!0;var rh=class{constructor(e,t){this.$from=e,this.$to=t}},ih=!1;function ah(e){!ih&&!e.parent.inlineContent&&(ih=!0,console.warn(`TextSelection endpoint not pointing into a node with inline content (`+e.parent.type.name+`)`))}var oh=class e extends nh{constructor(e,t=e){ah(e),ah(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,n){let r=t.resolve(n.map(this.head));if(!r.parent.inlineContent)return nh.near(r);let i=t.resolve(n.map(this.anchor));return new e(i.parent.inlineContent?i:r,r)}replace(e,t=Yp.empty){if(super.replace(e,t),t==Yp.empty){let t=this.$from.marksAcross(this.$to);t&&e.ensureMarks(t)}}eq(t){return t instanceof e&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new sh(this.anchor,this.head)}toJSON(){return{type:`text`,anchor:this.anchor,head:this.head}}static fromJSON(t,n){if(typeof n.anchor!=`number`||typeof n.head!=`number`)throw RangeError(`Invalid input for TextSelection.fromJSON`);return new e(t.resolve(n.anchor),t.resolve(n.head))}static create(e,t,n=t){let r=e.resolve(t);return new this(r,n==t?r:e.resolve(n))}static between(t,n,r){let i=t.pos-n.pos;if((!r||i)&&(r=i>=0?1:-1),!n.parent.inlineContent){let e=nh.findFrom(n,r,!0)||nh.findFrom(n,-r,!0);if(e)n=e.$head;else return nh.near(n,r)}return t.parent.inlineContent||(i==0?t=n:(t=(nh.findFrom(t,-r,!0)||nh.findFrom(t,r,!0)).$anchor,t.pos<n.pos!=i<0&&(t=n))),new e(t,n)}};nh.jsonID(`text`,oh);var sh=class e{constructor(e,t){this.anchor=e,this.head=t}map(t){return new e(t.map(this.anchor),t.map(this.head))}resolve(e){return oh.between(e.resolve(this.anchor),e.resolve(this.head))}},ch=class e extends nh{constructor(e){let t=e.nodeAfter,n=e.node(0).resolve(e.pos+t.nodeSize);super(e,n),this.node=t}map(t,n){let{deleted:r,pos:i}=n.mapResult(this.anchor),a=t.resolve(i);return r?nh.near(a):new e(a)}content(){return new Yp(Up.from(this.node),0,0)}eq(t){return t instanceof e&&t.anchor==this.anchor}toJSON(){return{type:`node`,anchor:this.anchor}}getBookmark(){return new lh(this.anchor)}static fromJSON(t,n){if(typeof n.anchor!=`number`)throw RangeError(`Invalid input for NodeSelection.fromJSON`);return new e(t.resolve(n.anchor))}static create(t,n){return new e(t.resolve(n))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}};ch.prototype.visible=!1,nh.jsonID(`node`,ch);var lh=class e{constructor(e){this.anchor=e}map(t){let{deleted:n,pos:r}=t.mapResult(this.anchor);return n?new sh(r,r):new e(r)}resolve(e){let t=e.resolve(this.anchor),n=t.nodeAfter;return n&&ch.isSelectable(n)?new ch(t):nh.near(t)}},uh=class e extends nh{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=Yp.empty){if(t==Yp.empty){e.delete(0,e.doc.content.size);let t=nh.atStart(e.doc);t.eq(e.selection)||e.setSelection(t)}else super.replace(e,t)}toJSON(){return{type:`all`}}static fromJSON(t){return new e(t)}map(t){return new e(t)}eq(t){return t instanceof e}getBookmark(){return dh}};nh.jsonID(`all`,uh);var dh={map(){return this},resolve(e){return new uh(e)}};function fh(e,t,n,r,i,a=!1){if(t.inlineContent)return oh.create(e,n);for(let o=r-(i>0?0:1);i>0?o<t.childCount:o>=0;o+=i){let r=t.child(o);if(!r.isAtom){let t=fh(e,r,n+i,i<0?r.childCount:0,i,a);if(t)return t}else if(!a&&ch.isSelectable(r))return ch.create(e,n-(i<0?r.nodeSize:0));n+=r.nodeSize*i}return null}function ph(e,t,n){let r=e.steps.length-1;if(r<t)return;let i=e.steps[r];if(!(i instanceof Ym||i instanceof Xm))return;let a=e.mapping.maps[r],o;a.forEach((e,t,n,r)=>{o??=r}),e.setSelection(nh.near(e.doc.resolve(o),n))}function mh(e,t){return!t||!e?e:e.bind(t)}var hh=class{constructor(e,t,n){this.name=e,this.init=mh(t.init,n),this.apply=mh(t.apply,n)}};new hh(`doc`,{init(e){return e.doc||e.schema.topNodeType.createAndFill()},apply(e){return e.doc}}),new hh(`selection`,{init(e,t){return e.selection||nh.atStart(t.doc)},apply(e){return e.selection}}),new hh(`storedMarks`,{init(e){return e.storedMarks||null},apply(e,t,n,r){return r.selection.$cursor?e.storedMarks:null}}),new hh(`scrollToSelection`,{init(){return 0},apply(e,t){return e.scrolledIntoView?t+1:t}});var gh=(e,t)=>{let{state:n,view:r}=e,{selection:i}=n;if(!i.empty)return!1;let{$from:a}=i;if(a.parentOffset!==0)return!1;let o=a.depth-1,s=a.node(o),c=a.index(o);if(c===0)return!1;if(s.type===t)return e.commands.lift(t.name);let l=s.child(c-1);if(l.type!==t||!l.lastChild?.isTextblock)return!1;let u=a.before(),d=u-1-1,{tr:f}=n;return f.delete(u,a.after()).insert(d,a.parent.content),f.setSelection(oh.create(f.doc,d)),r.dispatch(f.scrollIntoView()),!0},_h=/^\s*>\s$/,vh=rf.create({name:`blockquote`,addOptions(){return{HTMLAttributes:{}}},content:`block+`,group:`block`,defining:!0,parseHTML(){return[{tag:`blockquote`}]},renderHTML({HTMLAttributes:e}){return Bp(`blockquote`,{...G(this.options.HTMLAttributes,e),children:Bp(`slot`,{})})},parseMarkdown:(e,t)=>{let n=t.parseBlockChildren??t.parseChildren;return t.createNode(`blockquote`,void 0,n(e.tokens||[]))},renderMarkdown:(e,t)=>{if(!e.content)return``;let n=[];return e.content.forEach((e,r)=>{let i=(t.renderChild?.call(t,e,r)??t.renderChildren([e])).split(`
|
|
133
|
+
`).map(e=>e.trim()===``?`>`:`> ${e}`);n.push(i.join(`
|
|
134
|
+
`))}),n.join(`
|
|
135
|
+
>
|
|
136
|
+
`)},addCommands(){return{setBlockquote:()=>({commands:e})=>e.wrapIn(this.name),toggleBlockquote:()=>({commands:e})=>e.toggleWrap(this.name),unsetBlockquote:()=>({commands:e})=>e.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote(),Backspace:()=>gh(this.editor,this.type)}},addInputRules(){return[ef({find:_h,type:this.type})]}}),yh=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,bh=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,xh=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,Sh=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,Ch=Od.create({name:`bold`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`strong`},{tag:`b`,getAttrs:e=>e.style.fontWeight!==`normal`&&null},{style:`font-weight=400`,clearMark:e=>e.type.name===this.name},{style:`font-weight`,getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}]},renderHTML({HTMLAttributes:e}){return Bp(`strong`,{...G(this.options.HTMLAttributes,e),children:Bp(`slot`,{})})},markdownTokenName:`strong`,parseMarkdown:(e,t)=>t.applyMark(`bold`,t.parseInline(e.tokens||[])),markdownOptions:{htmlReopen:{open:`<strong>`,close:`</strong>`}},renderMarkdown:(e,t)=>`**${t.renderChildren(e)}**`,addCommands(){return{setBold:()=>({commands:e})=>e.setMark(this.name),toggleBold:()=>({commands:e})=>e.toggleMark(this.name),unsetBold:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[Xd({find:yh,type:this.type}),Xd({find:xh,type:this.type})]},addPasteRules(){return[of({find:bh,type:this.type}),of({find:Sh,type:this.type})]}}),wh=e=>{let t=/`([^`]+)`(?!`)$/.exec(e);return!t||t.index>0&&e[t.index-1]==="`"?null:{index:t.index,text:t[0],replaceWith:t[1]}},Th=e=>{let t=/`([^`]+)`(?!`)/g,n=[],r;for(;(r=t.exec(e))!==null;)r.index>0&&e[r.index-1]==="`"||n.push({index:r.index,text:r[0],replaceWith:r[1]});return n},Eh=Od.create({name:`code`,addOptions(){return{HTMLAttributes:{}}},excludes:`_`,code:!0,exitable:!0,parseHTML(){return[{tag:`code`}]},renderHTML({HTMLAttributes:e}){return[`code`,G(this.options.HTMLAttributes,e),0]},markdownTokenName:`codespan`,parseMarkdown:(e,t)=>t.applyMark(`code`,[{type:`text`,text:e.text||``}]),renderMarkdown:(e,t)=>e.content?`\`${t.renderChildren(e.content)}\``:``,addCommands(){return{setCode:()=>({commands:e})=>e.setMark(this.name),toggleCode:()=>({commands:e})=>e.toggleMark(this.name),unsetCode:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[Xd({find:wh,type:this.type})]},addPasteRules(){return[of({find:Th,type:this.type})]}}),Dh=4,Oh=/^```([a-z]+)?[\s\n]$/,kh=/^~~~([a-z]+)?[\s\n]$/,Ah=rf.create({name:`codeBlock`,addOptions(){return{languageClassPrefix:`language-`,exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:Dh,HTMLAttributes:{}}},content:`text*`,marks:``,group:`block`,code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:e=>{let{languageClassPrefix:t}=this.options;return t&&[...e.firstElementChild?.classList||[]].filter(e=>e.startsWith(t)).map(e=>e.replace(t,``))[0]||null},rendered:!1}}},parseHTML(){return[{tag:`pre`,preserveWhitespace:`full`}]},renderHTML({node:e,HTMLAttributes:t}){return[`pre`,G(this.options.HTMLAttributes,t),[`code`,{class:e.attrs.language?this.options.languageClassPrefix+e.attrs.language:null},0]]},markdownTokenName:`code`,parseMarkdown:(e,t)=>e.raw?.startsWith("```")===!1&&e.raw?.startsWith(`~~~`)===!1&&e.codeBlockStyle!==`indented`?[]:t.createNode(`codeBlock`,{language:e.lang||null},e.text?[t.createTextNode(e.text)]:[]),renderMarkdown:(e,t)=>{let n=``,r=e.attrs?.language||``;return n=e.content?[`\`\`\`${r}`,t.renderChildren(e.content),"```"].join(`
|
|
137
|
+
`):`\`\`\`${r}
|
|
138
|
+
|
|
139
|
+
\`\`\``,n},addCommands(){return{setCodeBlock:e=>({commands:t})=>t.setNode(this.name,e),toggleCodeBlock:e=>({commands:t})=>t.toggleNode(this.name,`paragraph`,e)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{let{empty:e,$anchor:t}=this.editor.state.selection,n=t.pos===1;return!e||t.parent.type.name!==this.name?!1:n||!t.parent.textContent.length?this.editor.commands.clearNodes():!1},Tab:({editor:e})=>{if(!this.options.enableTabIndentation)return!1;let t=this.options.tabSize??Dh,{state:n}=e,{selection:r}=n,{$from:i,empty:a}=r;if(i.parent.type!==this.type)return!1;let o=` `.repeat(t);return a?e.commands.insertContent(o):e.commands.command(({tr:e})=>{let{from:t,to:i}=r,a=n.doc.textBetween(t,i,`
|
|
140
|
+
`,`
|
|
141
|
+
`).split(`
|
|
142
|
+
`).map(e=>o+e).join(`
|
|
143
|
+
`);return e.replaceWith(t,i,n.schema.text(a)),!0})},"Shift-Tab":({editor:e})=>{if(!this.options.enableTabIndentation)return!1;let t=this.options.tabSize??Dh,{state:n}=e,{selection:r}=n,{$from:i,empty:a}=r;return i.parent.type===this.type?a?e.commands.command(({tr:e})=>{let{pos:r}=i,a=i.start(),o=i.end(),s=n.doc.textBetween(a,o,`
|
|
144
|
+
`,`
|
|
145
|
+
`).split(`
|
|
146
|
+
`),c=0,l=0,u=r-a;for(let e=0;e<s.length;e+=1){if(l+s[e].length>=u){c=e;break}l+=s[e].length+1}let d=s[c].match(/^ */)?.[0]||``,f=Math.min(d.length,t);if(f===0)return!0;let p=a;for(let e=0;e<c;e+=1)p+=s[e].length+1;return e.delete(p,p+f),r-p<=f&&e.setSelection(P.create(e.doc,p)),!0}):e.commands.command(({tr:e})=>{let{from:i,to:a}=r,o=n.doc.textBetween(i,a,`
|
|
147
|
+
`,`
|
|
148
|
+
`).split(`
|
|
149
|
+
`).map(e=>{let n=e.match(/^ */)?.[0]||``,r=Math.min(n.length,t);return e.slice(r)}).join(`
|
|
150
|
+
`);return e.replaceWith(i,a,n.schema.text(o)),!0}):!1},Enter:({editor:e})=>{if(!this.options.exitOnTripleEnter)return!1;let{state:t}=e,{selection:n}=t,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type)return!1;let a=r.parentOffset===r.parent.nodeSize-2,o=r.parent.textContent.endsWith(`
|
|
151
|
+
|
|
152
|
+
`);return!a||!o?!1:e.chain().command(({tr:e})=>(e.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:e})=>{if(!this.options.exitOnArrowDown)return!1;let{state:t}=e,{selection:n,doc:r}=t,{$from:i,empty:a}=n;if(!a||i.parent.type!==this.type||i.parentOffset!==i.parent.nodeSize-2)return!1;let o=i.after();return o===void 0?!1:r.nodeAt(o)?e.commands.command(({tr:e})=>(e.setSelection(N.near(r.resolve(o))),!0)):e.commands.exitCode()}}},addInputRules(){return[Qd({find:Oh,type:this.type,getAttributes:e=>({language:e[1]})}),Qd({find:kh,type:this.type,getAttributes:e=>({language:e[1]})})]},addProseMirrorPlugins(){return[new Jn({key:new Zn(`codeBlockVSCodeHandler`),props:{handlePaste:(e,t)=>{if(!t.clipboardData||this.editor.isActive(this.type.name))return!1;let n=t.clipboardData.getData(`text/plain`),r=t.clipboardData.getData(`vscode-editor-data`),i=(r?JSON.parse(r):void 0)?.mode;if(!n||!i)return!1;let{tr:a,schema:o}=e.state,s=o.text(n.replace(/\r\n?/g,`
|
|
153
|
+
`));return a.replaceSelectionWith(this.type.create({language:i},s)),a.selection.$from.parent.type!==this.type&&a.setSelection(P.near(a.doc.resolve(Math.max(0,a.selection.from-2)))),a.setMeta(`paste`,!0),e.dispatch(a),!0}}})]}}),jh=rf.create({name:`doc`,topNode:!0,content:`block+`,renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
|
|
154
|
+
|
|
155
|
+
`):``}),Mh=rf.create({name:`hardBreak`,markdownTokenName:`br`,addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:`inline`,selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:`br`}]},renderHTML({HTMLAttributes:e}){return[`br`,G(this.options.HTMLAttributes,e)]},renderText(){return`
|
|
156
|
+
`},renderMarkdown:()=>`
|
|
157
|
+
`,parseMarkdown:()=>({type:`hardBreak`}),addCommands(){return{setHardBreak:()=>({commands:e,chain:t,state:n,editor:r})=>e.first([()=>e.exitCode(),()=>e.command(()=>{let{selection:e,storedMarks:i}=n;if(e.$from.parent.type.spec.isolating)return!1;let{keepMarks:a}=this.options,{splittableMarks:o}=r.extensionManager,s=i||e.$to.parentOffset&&e.$from.marks();return t().insertContent({type:this.name}).command(({tr:e,dispatch:t})=>{if(t&&s&&a){let t=s.filter(e=>o.includes(e.type.name));e.ensureMarks(t)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),Nh=rf.create({name:`heading`,addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:`inline*`,group:`block`,defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(e=>({tag:`h${e}`,attrs:{level:e}}))},renderHTML({node:e,HTMLAttributes:t}){return[`h${this.options.levels.includes(e.attrs.level)?e.attrs.level:this.options.levels[0]}`,G(this.options.HTMLAttributes,t),0]},parseMarkdown:(e,t)=>t.createNode(`heading`,{level:e.depth||1},t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>{let n=e.attrs?.level?parseInt(e.attrs.level,10):1,r=`#`.repeat(n);return e.content?`${r} ${t.renderChildren(e.content)}`:``},addCommands(){return{setHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.setNode(this.name,e):!1,toggleHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.toggleNode(this.name,`paragraph`,e):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((e,t)=>({...e,[`Mod-Alt-${t}`]:()=>this.editor.commands.toggleHeading({level:t})}),{})},addInputRules(){return this.options.levels.map(e=>Qd({find:RegExp(`^(#{${Math.min(...this.options.levels)},${e}})\\s$`),type:this.type,getAttributes:{level:e}}))}}),Ph=rf.create({name:`horizontalRule`,addOptions(){return{HTMLAttributes:{},nextNodeType:`paragraph`}},group:`block`,parseHTML(){return[{tag:`hr`}]},renderHTML({HTMLAttributes:e}){return[`hr`,G(this.options.HTMLAttributes,e)]},markdownTokenName:`hr`,parseMarkdown:(e,t)=>t.createNode(`horizontalRule`),renderMarkdown:()=>`---`,addCommands(){return{setHorizontalRule:()=>({chain:e,state:t})=>{if(!sd(t,t.schema.nodes[this.name]))return!1;let{selection:n}=t,{$to:r}=n,i=e();return Ou(n)?i.insertContentAt(r.pos,{type:this.name}):i.insertContent({type:this.name}),i.command(({state:e,tr:t,dispatch:n})=>{if(n){let{$to:n}=t.selection,r=n.end();if(n.nodeAfter)n.nodeAfter.isTextblock?t.setSelection(P.create(t.doc,n.pos+1)):n.nodeAfter.isBlock?t.setSelection(F.create(t.doc,n.pos)):t.setSelection(P.create(t.doc,n.pos));else{let i=(e.schema.nodes[this.options.nextNodeType]||n.parent.type.contentMatch.defaultType)?.create();i&&(t.insert(r,i),t.setSelection(P.create(t.doc,r+1)))}t.scrollIntoView()}return!0}).run()}}},addInputRules(){return[Zd({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),Fh=Ph,Ih=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,Lh=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,Rh=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,zh=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,Bh=Od.create({name:`italic`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`em`},{tag:`i`,getAttrs:e=>e.style.fontStyle!==`normal`&&null},{style:`font-style=normal`,clearMark:e=>e.type.name===this.name},{style:`font-style=italic`}]},renderHTML({HTMLAttributes:e}){return[`em`,G(this.options.HTMLAttributes,e),0]},addCommands(){return{setItalic:()=>({commands:e})=>e.setMark(this.name),toggleItalic:()=>({commands:e})=>e.toggleMark(this.name),unsetItalic:()=>({commands:e})=>e.unsetMark(this.name)}},markdownTokenName:`em`,parseMarkdown:(e,t)=>t.applyMark(`italic`,t.parseInline(e.tokens||[])),markdownOptions:{htmlReopen:{open:`<em>`,close:`</em>`}},renderMarkdown:(e,t)=>`*${t.renderChildren(e)}*`,addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[Xd({find:Ih,type:this.type}),Xd({find:Rh,type:this.type})]},addPasteRules(){return[of({find:Lh,type:this.type}),of({find:zh,type:this.type})]}}),Vh=`aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2odyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rck0msd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2oodside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2`,Hh=`ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2`,Uh=`numeric`,Wh=`ascii`,Gh=`alpha`,Kh=`asciinumeric`,qh=`alphanumeric`,Jh=`domain`,Yh=`emoji`,Xh=`scheme`,Zh=`slashscheme`,Qh=`whitespace`;function $h(e,t){return e in t||(t[e]=[]),t[e]}function eg(e,t,n){t[Uh]&&(t[Kh]=!0,t[qh]=!0),t[Wh]&&(t[Kh]=!0,t[Gh]=!0),t[Kh]&&(t[qh]=!0),t[Gh]&&(t[qh]=!0),t[qh]&&(t[Jh]=!0),t[Yh]&&(t[Jh]=!0);for(let r in t){let t=$h(r,n);t.indexOf(e)<0&&t.push(e)}}function tg(e,t){let n={};for(let r in t)t[r].indexOf(e)>=0&&(n[r]=!0);return n}function ng(e=null){this.j={},this.jr=[],this.jd=null,this.t=e}ng.groups={},ng.prototype={accepts(){return!!this.t},go(e){let t=this,n=t.j[e];if(n)return n;for(let n=0;n<t.jr.length;n++){let r=t.jr[n][0],i=t.jr[n][1];if(i&&r.test(e))return i}return t.jd},has(e,t=!1){return t?e in this.j:!!this.go(e)},ta(e,t,n,r){for(let i=0;i<e.length;i++)this.tt(e[i],t,n,r)},tr(e,t,n,r){r||=ng.groups;let i;return t&&t.j?i=t:(i=new ng(t),n&&r&&eg(t,n,r)),this.jr.push([e,i]),i},ts(e,t,n,r){let i=this,a=e.length;if(!a)return i;for(let t=0;t<a-1;t++)i=i.tt(e[t]);return i.tt(e[a-1],t,n,r)},tt(e,t,n,r){r||=ng.groups;let i=this;if(t&&t.j)return i.j[e]=t,t;let a=t,o,s=i.go(e);return s?(o=new ng,Object.assign(o.j,s.j),o.jr.push.apply(o.jr,s.jr),o.jd=s.jd,o.t=s.t):o=new ng,a&&(r&&(o.t&&typeof o.t==`string`?eg(a,Object.assign(tg(o.t,r),n),r):n&&eg(a,n,r)),o.t=a),i.j[e]=o,o}};var X=(e,t,n,r,i)=>e.ta(t,n,r,i),rg=(e,t,n,r,i)=>e.tr(t,n,r,i),ig=(e,t,n,r,i)=>e.ts(t,n,r,i),Z=(e,t,n,r,i)=>e.tt(t,n,r,i),ag=`WORD`,og=`UWORD`,sg=`ASCIINUMERICAL`,cg=`ALPHANUMERICAL`,lg=`LOCALHOST`,ug=`TLD`,dg=`UTLD`,fg=`SCHEME`,pg=`SLASH_SCHEME`,mg=`NUM`,hg=`WS`,gg=`NL`,_g=`OPENBRACE`,vg=`CLOSEBRACE`,yg=`OPENBRACKET`,bg=`CLOSEBRACKET`,xg=`OPENPAREN`,Sg=`CLOSEPAREN`,Cg=`OPENANGLEBRACKET`,wg=`CLOSEANGLEBRACKET`,Tg=`FULLWIDTHLEFTPAREN`,Eg=`FULLWIDTHRIGHTPAREN`,Dg=`LEFTCORNERBRACKET`,Og=`RIGHTCORNERBRACKET`,kg=`LEFTWHITECORNERBRACKET`,Ag=`RIGHTWHITECORNERBRACKET`,jg=`FULLWIDTHLESSTHAN`,Mg=`FULLWIDTHGREATERTHAN`,Ng=`AMPERSAND`,Pg=`APOSTROPHE`,Fg=`ASTERISK`,Ig=`AT`,Lg=`BACKSLASH`,Rg=`BACKTICK`,zg=`CARET`,Bg=`COLON`,Vg=`COMMA`,Hg=`DOLLAR`,Ug=`DOT`,Wg=`EQUALS`,Gg=`EXCLAMATION`,Kg=`HYPHEN`,qg=`PERCENT`,Jg=`PIPE`,Yg=`PLUS`,Xg=`POUND`,Zg=`QUERY`,Qg=`QUOTE`,$g=`FULLWIDTHMIDDLEDOT`,e_=`SEMI`,t_=`SLASH`,n_=`TILDE`,r_=`UNDERSCORE`,i_=`EMOJI`,a_=`SYM`,o_=Object.freeze({__proto__:null,ALPHANUMERICAL:cg,AMPERSAND:Ng,APOSTROPHE:Pg,ASCIINUMERICAL:sg,ASTERISK:Fg,AT:Ig,BACKSLASH:Lg,BACKTICK:Rg,CARET:zg,CLOSEANGLEBRACKET:wg,CLOSEBRACE:vg,CLOSEBRACKET:bg,CLOSEPAREN:Sg,COLON:Bg,COMMA:Vg,DOLLAR:Hg,DOT:Ug,EMOJI:i_,EQUALS:Wg,EXCLAMATION:Gg,FULLWIDTHGREATERTHAN:Mg,FULLWIDTHLEFTPAREN:Tg,FULLWIDTHLESSTHAN:jg,FULLWIDTHMIDDLEDOT:$g,FULLWIDTHRIGHTPAREN:Eg,HYPHEN:Kg,LEFTCORNERBRACKET:Dg,LEFTWHITECORNERBRACKET:kg,LOCALHOST:lg,NL:gg,NUM:mg,OPENANGLEBRACKET:Cg,OPENBRACE:_g,OPENBRACKET:yg,OPENPAREN:xg,PERCENT:qg,PIPE:Jg,PLUS:Yg,POUND:Xg,QUERY:Zg,QUOTE:Qg,RIGHTCORNERBRACKET:Og,RIGHTWHITECORNERBRACKET:Ag,SCHEME:fg,SEMI:e_,SLASH:t_,SLASH_SCHEME:pg,SYM:a_,TILDE:n_,TLD:ug,UNDERSCORE:r_,UTLD:dg,UWORD:og,WORD:ag,WS:hg}),s_=/[a-z]/,c_=/\p{L}/u,l_=/\p{Emoji}/u,u_=/\d/,d_=/\s/,f_=`\r`,p_=`
|
|
158
|
+
`,m_=`️`,h_=``,g_=``,__=null,v_=null;function y_(e=[]){let t={};ng.groups=t;let n=new ng;__??=C_(Vh),v_??=C_(Hh),Z(n,`'`,Pg),Z(n,`{`,_g),Z(n,`}`,vg),Z(n,`[`,yg),Z(n,`]`,bg),Z(n,`(`,xg),Z(n,`)`,Sg),Z(n,`<`,Cg),Z(n,`>`,wg),Z(n,`(`,Tg),Z(n,`)`,Eg),Z(n,`「`,Dg),Z(n,`」`,Og),Z(n,`『`,kg),Z(n,`』`,Ag),Z(n,`<`,jg),Z(n,`>`,Mg),Z(n,`&`,Ng),Z(n,`*`,Fg),Z(n,`@`,Ig),Z(n,"`",Rg),Z(n,`^`,zg),Z(n,`:`,Bg),Z(n,`,`,Vg),Z(n,`$`,Hg),Z(n,`.`,Ug),Z(n,`=`,Wg),Z(n,`!`,Gg),Z(n,`-`,Kg),Z(n,`%`,qg),Z(n,`|`,Jg),Z(n,`+`,Yg),Z(n,`#`,Xg),Z(n,`?`,Zg),Z(n,`"`,Qg),Z(n,`/`,t_),Z(n,`;`,e_),Z(n,`~`,n_),Z(n,`_`,r_),Z(n,`\\`,Lg),Z(n,`・`,$g);let r=rg(n,u_,mg,{[Uh]:!0});rg(r,u_,r);let i=rg(r,s_,sg,{[Kh]:!0}),a=rg(r,c_,cg,{[qh]:!0}),o=rg(n,s_,ag,{[Wh]:!0});rg(o,u_,i),rg(o,s_,o),rg(i,u_,i),rg(i,s_,i);let s=rg(n,c_,og,{[Gh]:!0});rg(s,s_),rg(s,u_,a),rg(s,c_,s),rg(a,u_,a),rg(a,s_),rg(a,c_,a);let c=Z(n,p_,gg,{[Qh]:!0}),l=Z(n,f_,hg,{[Qh]:!0}),u=rg(n,d_,hg,{[Qh]:!0});Z(n,g_,u),Z(l,p_,c),Z(l,g_,u),rg(l,d_,u),Z(u,f_),Z(u,p_),rg(u,d_,u),Z(u,g_,u);let d=rg(n,l_,i_,{[Yh]:!0});Z(d,`#`),rg(d,l_,d),Z(d,m_,d);let f=Z(d,h_);Z(f,`#`),rg(f,l_,d);let p=[[s_,o],[u_,i]],m=[[s_,null],[c_,s],[u_,a]];for(let e=0;e<__.length;e++)S_(n,__[e],ug,ag,p);for(let e=0;e<v_.length;e++)S_(n,v_[e],dg,og,m);eg(ug,{tld:!0,ascii:!0},t),eg(dg,{utld:!0,alpha:!0},t),S_(n,`file`,fg,ag,p),S_(n,`mailto`,fg,ag,p),S_(n,`http`,pg,ag,p),S_(n,`https`,pg,ag,p),S_(n,`ftp`,pg,ag,p),S_(n,`ftps`,pg,ag,p),eg(fg,{scheme:!0,ascii:!0},t),eg(pg,{slashscheme:!0,ascii:!0},t),e=e.sort((e,t)=>e[0]>t[0]?1:-1);for(let t=0;t<e.length;t++){let r=e[t][0],i=e[t][1]?{[Xh]:!0}:{[Zh]:!0};r.indexOf(`-`)>=0?i[Jh]=!0:s_.test(r)?u_.test(r)?i[Kh]=!0:i[Wh]=!0:i[Uh]=!0,ig(n,r,r,i)}return ig(n,`localhost`,lg,{ascii:!0}),n.jd=new ng(a_),{start:n,tokens:Object.assign({groups:t},o_)}}function b_(e,t){let n=x_(t.replace(/[A-Z]/g,e=>e.toLowerCase())),r=n.length,i=[],a=0,o=0;for(;o<r;){let s=e,c=null,l=0,u=null,d=-1,f=-1;for(;o<r&&(c=s.go(n[o]));)s=c,s.accepts()?(d=0,f=0,u=s):d>=0&&(d+=n[o].length,f++),l+=n[o].length,a+=n[o].length,o++;a-=d,o-=f,l-=d,i.push({t:u.t,v:t.slice(a-l,a),s:a-l,e:a})}return i}function x_(e){let t=[],n=e.length,r=0;for(;r<n;){let i=e.charCodeAt(r),a,o=i<55296||i>56319||r+1===n||(a=e.charCodeAt(r+1))<56320||a>57343?e[r]:e.slice(r,r+2);t.push(o),r+=o.length}return t}function S_(e,t,n,r,i){let a,o=t.length;for(let n=0;n<o-1;n++){let o=t[n];e.j[o]?a=e.j[o]:(a=new ng(r),a.jr=i.slice(),e.j[o]=a),e=a}return a=new ng(n),a.jr=i.slice(),e.j[t[o-1]]=a,a}function C_(e){let t=[],n=[],r=0;for(;r<e.length;){let i=0;for(;`0123456789`.indexOf(e[r+i])>=0;)i++;if(i>0){t.push(n.join(``));for(let t=parseInt(e.substring(r,r+i),10);t>0;t--)n.pop();r+=i}else n.push(e[r]),r++}return t}var w_={defaultProtocol:`http`,events:null,format:E_,formatHref:E_,nl2br:!1,tagName:`a`,target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function T_(e,t=null){let n=Object.assign({},w_);e&&(n=Object.assign(n,e instanceof T_?e.o:e));let r=n.ignoreTags,i=[];for(let e=0;e<r.length;e++)i.push(r[e].toUpperCase());this.o=n,t&&(this.defaultRender=t),this.ignoreTags=i}T_.prototype={o:w_,ignoreTags:[],defaultRender(e){return e},check(e){return this.get(`validate`,e.toString(),e)},get(e,t,n){let r=t!=null,i=this.o[e];return i&&(typeof i==`object`?(i=n.t in i?i[n.t]:w_[e],typeof i==`function`&&r&&(i=i(t,n))):typeof i==`function`&&r&&(i=i(t,n.t,n)),i)},getObj(e,t,n){let r=this.o[e];return typeof r==`function`&&t!=null&&(r=r(t,n.t,n)),r},render(e){let t=e.render(this);return(this.get(`render`,null,e)||this.defaultRender)(t,e.t,e)}};function E_(e){return e}function D_(e,t){this.t=`token`,this.v=e,this.tk=t}D_.prototype={isLink:!1,toString(){return this.v},toHref(e){return this.toString()},toFormattedString(e){let t=this.toString(),n=e.get(`truncate`,t,this),r=e.get(`format`,t,this);return n&&r.length>n?r.substring(0,n)+`…`:r},toFormattedHref(e){return e.get(`formatHref`,this.toHref(e.get(`defaultProtocol`)),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(e=w_.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(e),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(e){return{type:this.t,value:this.toFormattedString(e),isLink:this.isLink,href:this.toFormattedHref(e),start:this.startIndex(),end:this.endIndex()}},validate(e){return e.get(`validate`,this.toString(),this)},render(e){let t=this,n=this.toHref(e.get(`defaultProtocol`)),r=e.get(`formatHref`,n,this),i=e.get(`tagName`,n,t),a=this.toFormattedString(e),o={},s=e.get(`className`,n,t),c=e.get(`target`,n,t),l=e.get(`rel`,n,t),u=e.getObj(`attributes`,n,t),d=e.getObj(`events`,n,t);return o.href=r,s&&(o.class=s),c&&(o.target=c),l&&(o.rel=l),u&&Object.assign(o,u),{tagName:i,attributes:o,content:a,eventListeners:d}}};function O_(e,t){class n extends D_{constructor(t,n){super(t,n),this.t=e}}for(let e in t)n.prototype[e]=t[e];return n.t=e,n}var k_=O_(`email`,{isLink:!0,toHref(){return`mailto:`+this.toString()}}),A_=O_(`text`),j_=O_(`nl`),M_=O_(`url`,{isLink:!0,toHref(e=w_.defaultProtocol){return this.hasProtocol()?this.v:`${e}://${this.v}`},hasProtocol(){let e=this.tk;return e.length>=2&&e[0].t!==lg&&e[1].t===Bg}}),N_=e=>new ng(e);function P_({groups:e}){let t=e.domain.concat([Ng,Fg,Ig,Lg,Rg,zg,Hg,Wg,Kg,mg,qg,Jg,Yg,Xg,t_,a_,n_,r_]),n=[Pg,Bg,Vg,Ug,Gg,qg,Zg,Qg,e_,Cg,wg,_g,vg,bg,yg,xg,Sg,Tg,Eg,Dg,Og,kg,Ag,jg,Mg],r=[Ng,Pg,Fg,Lg,Rg,zg,Hg,Wg,Kg,_g,vg,qg,Jg,Yg,Xg,Zg,t_,a_,n_,r_],i=N_(),a=Z(i,n_);X(a,r,a),X(a,e.domain,a);let o=N_(),s=N_(),c=N_();X(i,e.domain,o),X(i,e.scheme,s),X(i,e.slashscheme,c),X(o,r,a),X(o,e.domain,o);let l=Z(o,Ig);Z(a,Ig,l),Z(s,Ig,l),Z(c,Ig,l);let u=Z(a,Ug);X(u,r,a),X(u,e.domain,a);let d=N_();X(l,e.domain,d),X(d,e.domain,d);let f=Z(d,Ug);X(f,e.domain,d);let p=N_(k_);X(f,e.tld,p),X(f,e.utld,p),Z(l,lg,p);let m=Z(d,Kg);Z(m,Kg,m),X(m,e.domain,d),X(p,e.domain,d),Z(p,Ug,f),Z(p,Kg,m);let h=Z(o,Kg),g=Z(o,Ug);Z(h,Kg,h),X(h,e.domain,o),X(g,r,a),X(g,e.domain,o);let _=N_(M_);X(g,e.tld,_),X(g,e.utld,_),X(_,e.domain,o),X(_,r,a),Z(_,Ug,g),Z(_,Kg,h),Z(_,Ig,l);let v=Z(_,Bg),y=N_(M_);X(v,e.numeric,y);let b=N_(M_),x=N_();X(b,t,b),X(b,n,x),X(x,t,b),X(x,n,x),Z(_,t_,b),Z(y,t_,b);let S=Z(s,Bg),C=Z(Z(Z(c,Bg),t_),t_);X(s,e.domain,o),Z(s,Ug,g),Z(s,Kg,h),X(c,e.domain,o),Z(c,Ug,g),Z(c,Kg,h),X(S,e.domain,b),Z(S,t_,b),Z(S,Zg,b),X(C,e.domain,b),X(C,t,b),Z(C,t_,b);let w=[[_g,vg],[yg,bg],[xg,Sg],[Cg,wg],[Tg,Eg],[Dg,Og],[kg,Ag],[jg,Mg]];for(let e=0;e<w.length;e++){let[r,i]=w[e],a=Z(b,r);Z(x,r,a);let o=N_(M_);X(a,t,o);let s=N_();X(a,n,s),Z(a,i,b),X(o,t,o),X(o,n,s),X(s,t,o),X(s,n,s),Z(o,i,b),Z(s,i,b)}return Z(i,lg,_),Z(i,gg,j_),{start:i,tokens:o_}}function F_(e,t,n){let r=n.length,i=0,a=[],o=[];for(;i<r;){let s=e,c=null,l=null,u=0,d=null,f=-1;for(;i<r&&!(c=s.go(n[i].t));)o.push(n[i++]);for(;i<r&&(l=c||s.go(n[i].t));)c=null,s=l,s.accepts()?(f=0,d=s):f>=0&&f++,i++,u++;if(f<0)i-=u,i<r&&(o.push(n[i]),i++);else{o.length>0&&(a.push(I_(A_,t,o)),o=[]),i-=f,u-=f;let e=d.t,r=n.slice(i-u,i);a.push(I_(e,t,r))}}return o.length>0&&a.push(I_(A_,t,o)),a}function I_(e,t,n){let r=n[0].s,i=n[n.length-1].e;return new e(t.slice(r,i),n)}var L_=typeof console<`u`&&console&&console.warn||(()=>{}),R_=`until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.`,z_={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function B_(){return ng.groups={},z_.scanner=null,z_.parser=null,z_.tokenQueue=[],z_.pluginQueue=[],z_.customSchemes=[],z_.initialized=!1,z_}function V_(e,t=!1){if(z_.initialized&&L_(`linkifyjs: already initialized - will not register custom scheme "${e}" ${R_}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(e))throw Error(`linkifyjs: incorrect scheme format.
|
|
159
|
+
1. Must only contain digits, lowercase ASCII letters or "-"
|
|
160
|
+
2. Cannot start or end with "-"
|
|
161
|
+
3. "-" cannot repeat`);z_.customSchemes.push([e,t])}function H_(){z_.scanner=y_(z_.customSchemes);for(let e=0;e<z_.tokenQueue.length;e++)z_.tokenQueue[e][1]({scanner:z_.scanner});z_.parser=P_(z_.scanner.tokens);for(let e=0;e<z_.pluginQueue.length;e++)z_.pluginQueue[e][1]({scanner:z_.scanner,parser:z_.parser});return z_.initialized=!0,z_}function U_(e){return z_.initialized||H_(),F_(z_.parser.start,e,b_(z_.scanner.start,e))}U_.scan=b_;function W_(e,t=null,n=null){if(t&&typeof t==`object`){if(n)throw Error(`linkifyjs: Invalid link type ${t}; must be a string`);n=t,t=null}let r=new T_(n),i=U_(e),a=[];for(let e=0;e<i.length;e++){let n=i[e];n.isLink&&(!t||n.t===t)&&r.check(n)&&a.push(n.toFormattedObject(r))}return a}var G_=`[\0- \xA0 -\u2029 ]`,K_=new RegExp(G_),q_=RegExp(`${G_}$`),J_=new RegExp(G_,`g`);function Y_(e){return e.length===1?e[0].isLink:e.length===3&&e[1].isLink?[`()`,`[]`].includes(e[0].value+e[2].value):!1}function X_(e){return new Jn({key:new Zn(`autolink`),appendTransaction:(t,n,r)=>{let i=t.some(e=>e.docChanged)&&!n.doc.eq(r.doc),a=t.some(e=>e.getMeta(`preventAutolink`));if(!i||a)return;let{tr:o}=r;if(hu(Wl(n.doc,[...t])).forEach(({newRange:t})=>{let n=Kl(r.doc,t,e=>e.isTextblock),i,a;if(n.length>1)i=n[0],a=r.doc.textBetween(i.pos,i.pos+i.node.nodeSize,void 0,` `);else if(n.length){let e=r.doc.textBetween(t.from,t.to,` `,` `);if(!q_.test(e))return;i=n[0],a=r.doc.textBetween(i.pos,t.to,void 0,` `)}if(i&&a){let t=a.split(K_).filter(Boolean);if(t.length<=0)return!1;let n=t[t.length-1],s=i.pos+a.lastIndexOf(n);if(!n)return!1;let c=U_(n).map(t=>t.toObject(e.defaultProtocol));if(!Y_(c))return!1;c.filter(e=>e.isLink).map(e=>({...e,from:s+e.start+1,to:s+e.end+1})).filter(e=>r.schema.marks.code?!r.doc.rangeHasMark(e.from,e.to,r.schema.marks.code):!0).filter(t=>e.validate(t.value)).filter(t=>e.shouldAutoLink(t.value)).forEach(t=>{gu(t.from,t.to,r.doc).some(t=>t.mark.type===e.type)||o.addMark(t.from,t.to,e.type.create({href:t.href}))})}}),o.steps.length)return o}})}function Z_(e){return new Jn({key:new Zn(`handleClickLink`),props:{handleClick:(t,n,r)=>{if(r.button!==0||!t.editable)return!1;let i=null;if(r.target instanceof HTMLAnchorElement)i=r.target;else{let t=r.target;if(!t)return!1;let n=e.editor.view.dom;i=t.closest(`a`),i&&!n.contains(i)&&(i=null)}if(!i)return!1;let a=!1;if(e.enableClickSelection&&(a=e.editor.commands.extendMarkRange(e.type.name)),e.openOnClick){let n=fu(t.state,e.type.name),r=i.href??n.href,o=i.target??n.target;r&&(window.open(r,o),a=!0)}return a}}})}function Q_(e){return new Jn({key:new Zn(`handlePasteLink`),props:{handlePaste:(t,n,r)=>{let{shouldAutoLink:i}=e,{state:a}=t,{selection:o}=a,{empty:s}=o;if(s)return!1;let c=``;r.content.forEach(e=>{c+=e.textContent});let l=W_(c,{defaultProtocol:e.defaultProtocol}).find(e=>e.isLink&&e.value===c);return!c||!l||i!==void 0&&!i(l.value)?!1:e.editor.commands.setMark(e.type,{href:l.href})}}})}function $_(e,t){let n=[`http`,`https`,`ftp`,`ftps`,`mailto`,`tel`,`callto`,`sms`,`cid`,`xmpp`];return t&&t.forEach(e=>{let t=typeof e==`string`?e:e.scheme;t&&n.push(t)}),!e||e.replace(J_,``).match(RegExp(`^(?:(?:${n.map(e=>e.replace(/[-/\\^$*+?.()|[\]{}]/g,`\\$&`)).join(`|`)}):|[^a-z]|[a-z0-9+.\\-]+(?:[^a-z+.\\-:]|$))`,`i`))}var ev=Od.create({name:`link`,priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(e=>{if(typeof e==`string`){V_(e);return}V_(e.scheme,e.optionalSlashes)})},onDestroy(){B_()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:`http`,HTMLAttributes:{target:`_blank`,rel:`noopener noreferrer nofollow`,class:null},isAllowedUri:(e,t)=>!!$_(e,t.protocols),validate:e=>!!e,shouldAutoLink:e=>{let t=/^[a-z][a-z0-9+.-]*:\/\//i.test(e),n=/^[a-z][a-z0-9+.-]*:/i.test(e);if(t||n&&!e.includes(`@`))return!0;let r=(e.includes(`@`)?e.split(`@`).pop():e).split(/[/?#:]/)[0];return!(/^\d{1,3}(\.\d{1,3}){3}$/.test(r)||!/\./.test(r))}}},addAttributes(){return{href:{default:null,parseHTML(e){return e.getAttribute(`href`)}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class},title:{default:null}}},parseHTML(){return[{tag:`a[href]`,getAttrs:e=>{let t=e.getAttribute(`href`);return!t||!this.options.isAllowedUri(t,{defaultValidate:e=>!!$_(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:e}){return this.options.isAllowedUri(e.href,{defaultValidate:e=>!!$_(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?[`a`,G(this.options.HTMLAttributes,e),0]:[`a`,G(this.options.HTMLAttributes,{...e,href:``}),0]},markdownTokenName:`link`,parseMarkdown:(e,t)=>t.applyMark(`link`,t.parseInline(e.tokens||[]),{href:e.href,title:e.title||null}),renderMarkdown:(e,t)=>{let n=e.attrs?.href??``,r=e.attrs?.title??``,i=t.renderChildren(e);return r?`[${i}](${n} "${r}")`:`[${i}](${n})`},addCommands(){return{setLink:e=>({chain:t})=>{let{href:n}=e;return this.options.isAllowedUri(n,{defaultValidate:e=>!!$_(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?t().setMark(this.name,e).setMeta(`preventAutolink`,!0).run():!1},toggleLink:e=>({chain:t})=>{let{href:n}=e||{};return n&&!this.options.isAllowedUri(n,{defaultValidate:e=>!!$_(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:t().toggleMark(this.name,e,{extendEmptyMarkRange:!0}).setMeta(`preventAutolink`,!0).run()},unsetLink:()=>({chain:e})=>e().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta(`preventAutolink`,!0).run()}},addPasteRules(){return[of({find:e=>{let t=[];if(e){let{protocols:n,defaultProtocol:r}=this.options,i=W_(e).filter(e=>e.isLink&&this.options.isAllowedUri(e.value,{defaultValidate:e=>!!$_(e,n),protocols:n,defaultProtocol:r}));i.length&&i.forEach(e=>{this.options.shouldAutoLink(e.value)&&t.push({text:e.value,data:{href:e.href},index:e.start})})}return t},type:this.type,getAttributes:e=>({href:e.data?.href})})]},addProseMirrorPlugins(){let e=[],{protocols:t,defaultProtocol:n}=this.options;return this.options.autolink&&e.push(X_({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:e=>this.options.isAllowedUri(e,{defaultValidate:e=>!!$_(e,t),protocols:t,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),e.push(Z_({type:this.type,editor:this.editor,openOnClick:this.options.openOnClick===`whenNotEditable`?!0:this.options.openOnClick,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&e.push(Q_({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),e}}),tv=Object.defineProperty,nv=(e,t)=>{for(var n in t)tv(e,n,{get:t[n],enumerable:!0})},rv=`listItem`,iv=`textStyle`,av=/^\s*([-+*])\s$/,ov=rf.create({name:`bulletList`,addOptions(){return{itemTypeName:`listItem`,HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:`block list`,content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul`}]},renderHTML({HTMLAttributes:e}){return[`ul`,G(this.options.HTMLAttributes,e),0]},markdownTokenName:`list`,parseMarkdown:(e,t)=>e.type!==`list`||e.ordered?[]:{type:`bulletList`,content:e.items?t.parseChildren(e.items):[]},renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
|
|
162
|
+
`):``,markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(rv,this.editor.getAttributes(iv)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let e=ef({find:av,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(e=ef({find:av,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(iv),editor:this.editor})),[e]}}),sv=(e,t,n)=>{let{selection:r}=e;if(!r.empty)return null;let{$from:i}=r;if(!i.parent.isTextblock||i.parentOffset!==i.parent.content.size)return null;let a=-1;for(let e=i.depth;e>0;--e)if(i.node(e).type.name===t){a=e;break}if(a<0)return null;let o=i.node(a),s=i.index(a);if(s+1>=o.childCount)return null;let c=o.child(s+1);if(!n.includes(c.type.name))return null;let l=e.schema.nodes[t],u=!1;if(c.forEach(e=>{e.type===l&&e.childCount>1&&(u=!0)}),!u)return null;let d=e.doc.resolve(i.after()).nodeAfter;if(!d||!n.includes(d.type.name))return null;let f=[];return d.forEach(e=>{f.push(e)}),f.length===0?null:{listItemDepth:a,nestedList:d,nestedListPos:i.after(),insertPos:i.after(a),items:f}},cv=(e,t,n,r)=>{let i=sv(e,n,r);if(!i)return!1;let{selection:a}=e,{nestedList:o,nestedListPos:s,insertPos:c,items:l}=i,u=e.tr;u.delete(s,s+o.nodeSize);let d=u.mapping.map(c);return u.insert(d,E.from(l)),u.setSelection(a.map(u.doc,u.mapping)),t&&t(u),!0},lv=(e,t,n)=>cv(e.state,e.view.dispatch,t,n),uv=(e,t)=>q.create({name:`${e}BranchingDeleteKeymap`,priority:101,addKeyboardShortcuts(){let n=()=>lv(this.editor,e,t);return{Delete:n,"Mod-Delete":n}}}),dv=[[1e3,`m`],[900,`cm`],[500,`d`],[400,`cd`],[100,`c`],[90,`xc`],[50,`l`],[40,`xl`],[10,`x`],[9,`ix`],[5,`v`],[4,`iv`],[1,`i`]],fv=`abcdefghijklmnopqrstuvwxyz`,pv=String.raw`\d+|[ivxlcdmIVXLCDM]+|${`[a-zA-Z]{1,2}`}`;function mv(e){let t=e,n=``;for(let[e,r]of dv)for(;t>=e;)n+=r,t-=e;return n}function hv(e){return mv(e).toUpperCase()}function gv(e){let t=e.toLowerCase(),n=0,r=0;for(;n<t.length;){let e=!1;for(let[i,a]of dv)if(t.startsWith(a,n)){r+=i,n+=a.length,e=!0;break}if(!e)return 0}return r}function _v(e){if(!/^[ivxlcdmIVXLCDM]+$/.test(e))return!1;let t=gv(e);return t<=0?!1:(e===e.toLowerCase()?mv(t):hv(t))===e}function vv(e){let t=e.toLowerCase();if(t.length===1)return t.charCodeAt(0)-97+1;if(t.length===2){let e=t.charCodeAt(0)-97,n=t.charCodeAt(1)-97;return(e+1)*26+n+1}return 0}function yv(e){if(e<=26)return fv[e-1];let t=Math.floor((e-1)/26)-1,n=(e-1)%26;return t<0?fv[n]:fv[t]+fv[n]}function bv(e){if(!(!e||/^\d+$/.test(e))){if(_v(e))return e===e.toLowerCase()?`i`:`I`;if(/^[a-z]{1,2}$/.test(e))return`a`;if(/^[A-Z]{1,2}$/.test(e))return`A`}}function xv(e){if(/^\d+$/.test(e))return parseInt(e,10);let t=bv(e);if(t===`i`||t===`I`)return gv(e);if(t===`a`||t===`A`){let t=vv(e);return t>0?t:1}let n=parseInt(e,10);return Number.isNaN(n)?1:n}function Sv(e,t){if(e===`numeric`)return String(t);switch(e){case`a`:return yv(t);case`A`:return yv(t).toUpperCase();case`i`:return mv(t);case`I`:return hv(t);default:return String(t)}}function Cv(e){if(e.length===0)return!1;let t=bv(e[0])??`numeric`,n=xv(e[0]);if(n<1)return!1;for(let r=0;r<e.length;r++){let i=Sv(t,n+r);if(e[r]!==i)return!1}return!0}function wv(e){return{type:bv(e),start:xv(e)}}function Tv(e){let{type:t,start:n}=wv(e),r={};return t&&(r.type=t),n!==1&&(r.start=n),r}function Ev(e,t,n=`. `){let r=t+1;if(!e||e===`1`)return`${r}${n}`;switch(e){case`a`:return`${yv(r)}${n}`;case`A`:return`${yv(r).toUpperCase()}${n}`;case`i`:return`${mv(r)}${n}`;case`I`:return`${hv(r)}${n}`;default:return`${r}${n}`}}function Dv(e){let t=e.tokens?.[0];return!!(e.text&&e.tokens?.length===1&&t?.type===`list`&&t.ordered&&t.raw===e.text)}function Ov(e,t){return t.tokenizeInline?t.parseInline(t.tokenizeInline(e)):t.parseInline([{type:`text`,raw:e,text:e}])}var kv=rf.create({name:`listItem`,addOptions(){return{HTMLAttributes:{},bulletListTypeName:`bulletList`,orderedListTypeName:`orderedList`}},content:`paragraph block*`,defining:!0,parseHTML(){return[{tag:`li`}]},renderHTML({HTMLAttributes:e}){return[`li`,G(this.options.HTMLAttributes,e),0]},markdownTokenName:`list_item`,parseMarkdown:(e,t)=>{if(e.type!==`list_item`)return[];let n=t.parseBlockChildren??t.parseChildren,r=[];if(e.tokens&&e.tokens.length>0){if(Dv(e))return{type:`listItem`,content:[{type:`paragraph`,content:Ov(e.text||``,t)}]};if(e.tokens.some(e=>e.type===`paragraph`))r=n(e.tokens);else{let i=e.tokens[0];if(i&&i.type===`text`&&i.tokens&&i.tokens.length>0){if(r=[{type:`paragraph`,content:t.parseInline(i.tokens)}],e.tokens.length>1){let t=n(e.tokens.slice(1));r.push(...t)}}else r=n(e.tokens)}}return r.length===0&&(r=[{type:`paragraph`,content:[]}]),{type:`listItem`,content:r}},renderMarkdown:(e,t,n)=>xd(e,t,e=>{if(e.parentType===`bulletList`)return`- `;if(e.parentType===`orderedList`){let t=e.meta?.parentAttrs?.start||1;return Ev(e.meta?.parentAttrs?.type,t-1+(e.index||0),`. `)}return`- `},n),addExtensions(){return[uv(this.name,[this.options.bulletListTypeName,this.options.orderedListTypeName])]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}});nv({},{findListItemPos:()=>Av,getNextListDepth:()=>jv,handleBackspace:()=>Nv,handleDelete:()=>Iv,hasListBefore:()=>Mv,hasListItemAfter:()=>Lv,hasListItemBefore:()=>Rv,listItemHasSubList:()=>zv,nextListIsDeeper:()=>Pv,nextListIsHigher:()=>Fv});var Av=(e,t)=>{let{$from:n}=t.selection,r=Lc(e,t.schema),i=null,a=n.depth,o=n.pos,s=null;for(;a>0&&s===null;)i=n.node(a),i.type===r?s=a:(--a,--o);return s===null?null:{$pos:t.doc.resolve(o),depth:s}},jv=(e,t)=>{let n=Av(e,t);if(!n)return!1;let[,r]=_u(t,e,n.$pos.pos+4);return r},Mv=(e,t,n)=>{let{$anchor:r}=e.selection,i=Math.max(0,r.pos-2),a=e.doc.resolve(i).node();return!(!a||!n.includes(a.type.name))},Nv=(e,t,n)=>{if(e.commands.undoInputRule())return!0;if(e.state.selection.from!==e.state.selection.to)return!1;if(!El(e.state,t)&&Mv(e.state,t,n)){let{$anchor:n}=e.state.selection,r=e.state.doc.resolve(n.before()-1),i=[];r.node().descendants((e,n)=>{e.type.name===t&&i.push({node:e,pos:n})});let a=i.at(-1);if(!a)return!1;let o=e.state.doc.resolve(r.start()+a.pos+1);return e.chain().cut({from:n.start()-1,to:n.end()+1},o.end()).joinForward().run()}return!El(e.state,t)||!wu(e.state)?!1:e.chain().liftListItem(t).run()},Pv=(e,t)=>{let n=jv(e,t),r=Av(e,t);return!r||!n?!1:n>r.depth},Fv=(e,t)=>{let n=jv(e,t),r=Av(e,t);return!r||!n?!1:n<r.depth},Iv=(e,t)=>{if(!El(e.state,t)||!Cu(e.state,t))return!1;let{selection:n}=e.state,{$from:r,$to:i}=n;return!n.empty&&r.sameParent(i)?!1:Pv(t,e.state)?e.chain().focus(e.state.selection.from+4).lift(t).joinBackward().run():Fv(t,e.state)?e.chain().joinForward().joinBackward().run():e.commands.joinItemForward()},Lv=(e,t)=>{let{$anchor:n}=t.selection,r=t.doc.resolve(n.pos-n.parentOffset-2);return!(r.index()===r.parent.childCount-1||r.nodeAfter?.type.name!==e)},Rv=(e,t)=>{let{$anchor:n}=t.selection,r=t.doc.resolve(n.pos-2);return!(r.index()===0||r.nodeBefore?.type.name!==e)},zv=(e,t,n)=>{if(!n)return!1;let r=Lc(e,t.schema),i=!1;return n.descendants(e=>{e.type===r&&(i=!0)}),i},Bv=q.create({name:`listKeymap`,addOptions(){return{listTypes:[{itemName:`listItem`,wrapperNames:[`bulletList`,`orderedList`]},{itemName:`taskItem`,wrapperNames:[`taskList`]}]}},addKeyboardShortcuts(){return{Delete:({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n})=>{e.state.schema.nodes[n]!==void 0&&Iv(e,n)&&(t=!0)}),t},"Mod-Delete":({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n})=>{e.state.schema.nodes[n]!==void 0&&Iv(e,n)&&(t=!0)}),t},Backspace:({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{e.state.schema.nodes[n]!==void 0&&Nv(e,n,r)&&(t=!0)}),t},"Mod-Backspace":({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{e.state.schema.nodes[n]!==void 0&&Nv(e,n,r)&&(t=!0)}),t}}}}),Vv=RegExp(`^(\\s*)(${pv})([.)])\\s+(.*)$`),Hv=RegExp(`^(\\s*)(${pv})([.)])\\s+`),Uv=/^\s/;function Wv(e){return Vv.test(e.trimStart())}function Gv(e){let t=e.trimStart();return/^[-+*]\s+/.test(t)||Wv(t)||/^>\s?/.test(t)||/^```/.test(t)||/^~~~/.test(t)}function Kv(e){let t=[],n=[],r=!1;return e.forEach(e=>{if(r){n.push(e);return}if(e.trim()===``){r=!0,n.push(e);return}if(t.length>0&&Gv(e)){r=!0,n.push(e);return}t.push(e)}),{paragraphLines:t,blockLines:n}}function qv(e){let t=[],n=0,r=0;for(;n<e.length;){let i=e[n],a=i.match(Vv);if(!a)break;let[,o,s,c,l]=a,u=o.length,d=parseInt(s,10),f=isNaN(d)?bv(s):void 0,p=isNaN(d)?xv(s):d,m=[l],h=n+1,g=[i],_=!1;for(;h<e.length;){let t=e[h];if(t.match(Vv))break;if(t.trim()===``)g.push(t),m.push(``),_=!0,h+=1;else if(t.match(Uv)){let e=t.length-t.trimStart().length,n=u+s.length+1;g.push(t),m.push(t.slice(Math.min(e,n))),h+=1}else{if(_)break;g.push(t),m.push(t),h+=1}}t.push({indent:u,number:p,type:f,content:m.join(`
|
|
163
|
+
`).trim(),contentLines:m,raw:g.join(`
|
|
164
|
+
`)}),r=h,n=h}return[t,r]}var Jv=RegExp(`^(${pv})([.)])\\s+(.+)$`);function Yv(e){let t=e.split(`
|
|
165
|
+
`).filter(e=>e.trim().length>0);if(t.length===0)return null;let n=[];for(let e of t){let t=e.trim().match(Jv);if(!t)return null;n.push({marker:t[1],content:t[3]})}return Cv(n.map(e=>e.marker))?{type:`orderedList`,attrs:Tv(n[0].marker),content:n.map(e=>({type:`listItem`,content:[{type:`paragraph`,content:[{type:`text`,text:e.content}]}]}))}:null}function Xv(e,t,n){let r=[],i=0;for(;i<e.length;){let a=e[i];if(a.indent===t){let{paragraphLines:o,blockLines:s}=Kv(a.contentLines),c=o.join(`
|
|
166
|
+
`).trim(),l=[];c&&l.push({type:`paragraph`,raw:c,tokens:n.inlineTokens(c)});let u=s.join(`
|
|
167
|
+
`).trim();if(u){let e=n.blockTokens(u);l.push(...e)}let d=i+1,f=[];for(;d<e.length&&e[d].indent>t;)f.push(e[d]),d+=1;if(f.length>0){let e=Xv(f,Math.min(...f.map(e=>e.indent)),n);l.push({type:`list`,ordered:!0,start:f[0].number,typeMarker:f[0].type,items:e,raw:f.map(e=>e.raw).join(`
|
|
168
|
+
`)})}r.push({type:`list_item`,raw:a.raw,tokens:l}),i=d}else i+=1}return r}function Zv(e,t){return e.map(e=>{if(e.type!==`list_item`)return t.parseChildren([e])[0];let n=[];return e.tokens&&e.tokens.length>0&&e.tokens.forEach(e=>{if(e.type===`paragraph`||e.type===`list`||e.type===`blockquote`||e.type===`code`)n.push(...t.parseChildren([e]));else if(e.type===`text`&&e.tokens){let r=t.parseChildren([e]);n.push({type:`paragraph`,content:r})}else{let r=t.parseChildren([e]);r.length>0&&n.push(...r)}}),{type:`listItem`,content:n}})}var Qv=`listItem`,$v=`textStyle`,ey=/^(\d+)\.\s$/;function ty(e){let t=e.match(/list-style-type\s*:\s*([^;]+)/i);if(!t)return null;switch(t[1].trim().toLowerCase()){case`upper-roman`:return`I`;case`lower-roman`:return`i`;case`upper-alpha`:case`upper-latin`:return`A`;case`lower-alpha`:case`lower-latin`:return`a`;default:return null}}var ny=rf.create({name:`orderedList`,addOptions(){return{itemTypeName:`listItem`,HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:`block list`,content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:e=>e.hasAttribute(`start`)?parseInt(e.getAttribute(`start`)||``,10):1},type:{default:null,parseHTML:e=>{let t=e.getAttribute(`type`);if(t)return t;let n=e.getAttribute(`style`);if(n){let e=ty(n);if(e)return e}let r=e.querySelector(`li`);if(r){let e=r.getAttribute(`style`);if(e){let t=ty(e);if(t)return t}}return null}}}},parseHTML(){return[{tag:`ol`}]},renderHTML({HTMLAttributes:e}){let{start:t,type:n,...r}=e,i=G(this.options.HTMLAttributes,r);return t!==1&&(i.start=t),n&&n!==`1`&&(i.type=n),[`ol`,i,0]},markdownTokenName:`list`,parseMarkdown:(e,t)=>{if(e.type!==`list`||!e.ordered)return[];let n=e.start||1,r=e.typeMarker,i=e.items?Zv(e.items,t):[],a={};return n!==1&&(a.start=n),r&&(a.type=r),Object.keys(a).length>0?{type:`orderedList`,attrs:a,content:i}:{type:`orderedList`,content:i}},renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
|
|
169
|
+
`):``,markdownTokenizer:{name:`orderedList`,level:`block`,start:e=>{let t=e.match(Hv)?.index;return t===void 0?-1:t},tokenize:(e,t,n)=>{let r=e.split(`
|
|
170
|
+
`),[i,a]=qv(r);if(i.length===0)return;let o=Xv(i,0,n);if(o.length!==0)return{type:`list`,ordered:!0,start:i[0]?.number||1,typeMarker:i[0]?.type,items:o,raw:r.slice(0,a).join(`
|
|
171
|
+
`)}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(Qv,this.editor.getAttributes($v)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addProseMirrorPlugins(){return[new Jn({props:{handlePaste:(e,t)=>{if((t.clipboardData?.getData(`text/html`))?.trim())return!1;let n=t.clipboardData?.getData(`text/plain`);if(!n)return!1;let r=Yv(n);if(!r)return!1;try{let t=e.state.schema.nodeFromJSON(r),n=e.state.tr.replaceSelectionWith(t);return e.dispatch(n),!0}catch{return!1}}}})]},addInputRules(){let e=(e,t)=>(!t.attrs.type||t.attrs.type===`1`)&&t.childCount+t.attrs.start===+e[1],t=ef({find:ey,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:e});return(this.options.keepMarks||this.options.keepAttributes)&&(t=ef({find:ey,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes($v)}),joinPredicate:e,editor:this.editor})),[t]}}),ry=/^\s*(\[([( |x])?\])\s$/,iy=rf.create({name:`taskItem`,addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:`taskList`,a11y:void 0}},content(){return this.options.nested?`paragraph block*`:`paragraph+`},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:e=>{let t=e.getAttribute(`data-checked`);return t===``||t===`true`},renderHTML:e=>({"data-checked":e.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:e,HTMLAttributes:t}){return[`li`,G(this.options.HTMLAttributes,t,{"data-type":this.name}),[`label`,[`input`,{type:`checkbox`,checked:e.attrs.checked?`checked`:null}],[`span`]],[`div`,0]]},parseMarkdown:(e,t)=>{let n=[];if(e.tokens&&e.tokens.length>0?n.push(t.createNode(`paragraph`,{},t.parseInline(e.tokens))):e.text?n.push(t.createNode(`paragraph`,{},[t.createNode(`text`,{text:e.text})])):n.push(t.createNode(`paragraph`,{},[])),e.nestedTokens&&e.nestedTokens.length>0){let r=t.parseChildren(e.nestedTokens);n.push(...r)}return t.createNode(`taskItem`,{checked:e.checked||!1},n)},renderMarkdown:(e,t)=>xd(e,t,`- [${e.attrs?.checked?`x`:` `}] `),addExtensions(){return this.options.nested?[uv(this.name,[this.options.taskListTypeName])]:[]},addKeyboardShortcuts(){let e={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...e,Tab:()=>this.editor.commands.sinkListItem(this.name)}:e},addNodeView(){return({node:e,HTMLAttributes:t,getPos:n,editor:r})=>{let i=document.createElement(`li`),a=document.createElement(`label`),o=document.createElement(`span`),s=document.createElement(`input`),c=document.createElement(`div`),l=e=>{var t;s.ariaLabel=((t=this.options.a11y)?.checkboxLabel)?.call(t,e,s.checked)||`Task item checkbox for ${e.textContent||`empty task item`}`};l(e),a.contentEditable=`false`,s.type=`checkbox`,s.addEventListener(`mousedown`,e=>e.preventDefault()),s.addEventListener(`change`,t=>{if(!r.isEditable&&!this.options.onReadOnlyChecked){s.checked=!s.checked;return}let{checked:i}=t.target;r.isEditable&&typeof n==`function`&&r.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:e})=>{let t=n();if(typeof t!=`number`)return!1;let r=e.doc.nodeAt(t);return e.setNodeMarkup(t,void 0,{...r?.attrs,checked:i}),!0}).run(),!r.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(e,i)||(s.checked=!s.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([e,t])=>{i.setAttribute(e,t)}),i.dataset.checked=e.attrs.checked,s.checked=e.attrs.checked,a.append(s,o),i.append(a,c),Object.entries(t).forEach(([e,t])=>{i.setAttribute(e,t)});let u=new Set(Object.keys(t));return{dom:i,contentDOM:c,update:e=>{if(e.type!==this.type)return!1;i.dataset.checked=e.attrs.checked,s.checked=e.attrs.checked,l(e);let t=r.extensionManager.attributes,n=$l(e,t),a=new Set(Object.keys(n)),o=this.options.HTMLAttributes;return u.forEach(e=>{a.has(e)||(e in o?i.setAttribute(e,o[e]):i.removeAttribute(e))}),Object.entries(n).forEach(([e,t])=>{t==null?e in o?i.setAttribute(e,o[e]):i.removeAttribute(e):i.setAttribute(e,t)}),u=a,!0}}}},addInputRules(){return[ef({find:ry,type:this.type,getAttributes:e=>({checked:e[e.length-1]===`x`})})]}}),ay=rf.create({name:`taskList`,addOptions(){return{itemTypeName:`taskItem`,HTMLAttributes:{}}},group:`block list`,content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:e}){return[`ul`,G(this.options.HTMLAttributes,e,{"data-type":this.name}),0]},parseMarkdown:(e,t)=>t.createNode(`taskList`,{},t.parseChildren(e.items||[])),renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
|
|
172
|
+
`):``,markdownTokenizer:{name:`taskList`,level:`block`,start(e){let t=e.match(/^\s*[-+*]\s+\[([ xX])\]\s+/)?.index;return t===void 0?-1:t},tokenize(e,t,n){let r=e=>{let t=bd(e,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:e=>({indentLevel:e[1].length,mainContent:e[4],checked:e[3].toLowerCase()===`x`}),createToken:(e,t)=>({type:`taskItem`,raw:``,mainContent:e.mainContent,indentLevel:e.indentLevel,checked:e.checked,text:e.mainContent,tokens:n.inlineTokens(e.mainContent),nestedTokens:t}),customNestedParser:r},n);return t?[{type:`taskList`,raw:t.raw,items:t.items}]:n.blockTokens(e)},i=bd(e,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:e=>({indentLevel:e[1].length,mainContent:e[4],checked:e[3].toLowerCase()===`x`}),createToken:(e,t)=>({type:`taskItem`,raw:``,mainContent:e.mainContent,indentLevel:e.indentLevel,checked:e.checked,text:e.mainContent,tokens:n.inlineTokens(e.mainContent),nestedTokens:t}),customNestedParser:r},n);if(i)return{type:`taskList`,raw:i.raw,items:i.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:()=>({commands:e})=>e.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});q.create({name:`listKit`,addExtensions(){let e=[];return this.options.bulletList!==!1&&e.push(ov.configure(this.options.bulletList)),this.options.listItem!==!1&&e.push(kv.configure(this.options.listItem)),this.options.listKeymap!==!1&&e.push(Bv.configure(this.options.listKeymap)),this.options.orderedList!==!1&&e.push(ny.configure(this.options.orderedList)),this.options.taskItem!==!1&&e.push(iy.configure(this.options.taskItem)),this.options.taskList!==!1&&e.push(ay.configure(this.options.taskList)),e}});var oy=` `,sy=`\xA0`,cy=rf.create({name:`paragraph`,priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:`block`,content:`inline*`,parseHTML(){return[{tag:`p`}]},renderHTML({HTMLAttributes:e}){return[`p`,G(this.options.HTMLAttributes,e),0]},parseMarkdown:(e,t)=>{let n=e.tokens||[];if(n.length===1&&n[0].type===`image`)return t.parseChildren([n[0]]);let r=t.parseInline(n);return n.length===1&&n[0].type===`text`&&(n[0].raw===oy||n[0].text===oy||n[0].raw===sy||n[0].text===sy)&&r.length===1&&r[0].type===`text`&&(r[0].text===oy||r[0].text===sy)?t.createNode(`paragraph`,void 0,[]):t.createNode(`paragraph`,void 0,r)},renderMarkdown:(e,t,n)=>{if(!e)return``;let r=Array.isArray(e.content)?e.content:[];if(r.length===0){let e=Array.isArray(n?.previousNode?.content)?n.previousNode.content:[];return n?.previousNode?.type===`paragraph`&&e.length===0?oy:``}return t.renderChildren(r)},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),ly=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,uy=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,dy=Od.create({name:`strike`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`s`},{tag:`del`},{tag:`strike`},{style:`text-decoration`,consuming:!1,getAttrs:e=>e.includes(`line-through`)?{}:!1}]},renderHTML({HTMLAttributes:e}){return[`s`,G(this.options.HTMLAttributes,e),0]},markdownTokenName:`del`,parseMarkdown:(e,t)=>t.applyMark(`strike`,t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>`~~${t.renderChildren(e)}~~`,addCommands(){return{setStrike:()=>({commands:e})=>e.setMark(this.name),toggleStrike:()=>({commands:e})=>e.toggleMark(this.name),unsetStrike:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[Xd({find:ly,type:this.type})]},addPasteRules(){return[of({find:uy,type:this.type})]}}),fy=rf.create({name:`text`,group:`inline`,parseMarkdown:e=>({type:`text`,text:e.text||``}),renderMarkdown:e=>e.text||``}),py=Od.create({name:`underline`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`u`},{style:`text-decoration`,consuming:!1,getAttrs:e=>e.includes(`underline`)?{}:!1}]},renderHTML({HTMLAttributes:e}){return[`u`,G(this.options.HTMLAttributes,e),0]},parseMarkdown(e,t){return t.applyMark(this.name||`underline`,t.parseInline(e.tokens||[]))},renderMarkdown(e,t){return`++${t.renderChildren(e)}++`},markdownTokenizer:{name:`underline`,level:`inline`,start(e){return e.indexOf(`++`)},tokenize(e,t,n){let r=/^(\+\+)([\s\S]+?)(\+\+)/.exec(e);if(!r)return;let i=r[2].trim();return{type:`underline`,raw:r[0],text:i,tokens:n.inlineTokens(i)}}},addCommands(){return{setUnderline:()=>({commands:e})=>e.setMark(this.name),toggleUnderline:()=>({commands:e})=>e.toggleMark(this.name),unsetUnderline:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}});function my(e={}){return new Jn({view(t){return new hy(t,e)}})}var hy=class{constructor(e,t){this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=t.width??1,this.color=t.color===!1?void 0:t.color||`black`,this.class=t.class,this.handlers=[`dragover`,`dragend`,`drop`,`dragleave`].map(t=>{let n=e=>{this[t](e)};return e.dom.addEventListener(t,n),{name:t,handler:n}})}destroy(){this.handlers.forEach(({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t))}update(e,t){this.cursorPos!=null&&t.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),t=!e.parent.inlineContent,n,r=this.editorView.dom,i=r.getBoundingClientRect(),a=i.width/r.offsetWidth,o=i.height/r.offsetHeight;if(t){let t=e.nodeBefore,r=e.nodeAfter;if(t||r){let e=this.editorView.nodeDOM(this.cursorPos-(t?t.nodeSize:0));if(e){let i=e.getBoundingClientRect(),a=t?i.bottom:i.top;t&&r&&(a=(a+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let s=this.width/2*o;n={left:i.left,right:i.right,top:a-s,bottom:a+s}}}}if(!n){let e=this.editorView.coordsAtPos(this.cursorPos),t=this.width/2*a;n={left:e.left-t,right:e.left+t,top:e.top,bottom:e.bottom}}let s=this.editorView.dom.offsetParent;this.element||(this.element=s.appendChild(document.createElement(`div`)),this.class&&(this.element.className=this.class),this.element.style.cssText=`position: absolute; z-index: 50; pointer-events: none;`,this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle(`prosemirror-dropcursor-block`,t),this.element.classList.toggle(`prosemirror-dropcursor-inline`,!t);let c,l;if(!s||s==document.body&&getComputedStyle(s).position==`static`)c=-pageXOffset,l=-pageYOffset;else{let e=s.getBoundingClientRect(),t=e.width/s.offsetWidth,n=e.height/s.offsetHeight;c=e.left-s.scrollLeft*t,l=e.top-s.scrollTop*n}this.element.style.left=(n.left-c)/a+`px`,this.element.style.top=(n.top-l)/o+`px`,this.element.style.width=(n.right-n.left)/a+`px`,this.element.style.height=(n.bottom-n.top)/o+`px`}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),n=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),r=n&&n.type.spec.disableDropCursor,i=typeof r==`function`?r(this.editorView,t,e):r;if(t&&!i){let e=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let t=cn(this.editorView.state.doc,e,this.editorView.dragging.slice);t!=null&&(e=t)}this.setCursor(e),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}},gy=class e extends N{constructor(e){super(e,e)}map(t,n){let r=t.resolve(n.map(this.head));return e.valid(r)?new e(r):N.near(r)}content(){return A.empty}eq(t){return t instanceof e&&t.head==this.head}toJSON(){return{type:`gapcursor`,pos:this.head}}static fromJSON(t,n){if(typeof n.pos!=`number`)throw RangeError(`Invalid input for GapCursor.fromJSON`);return new e(t.resolve(n.pos))}getBookmark(){return new _y(this.anchor)}static valid(e){let t=e.parent;if(t.inlineContent||!yy(e)||!by(e))return!1;let n=t.type.spec.allowGapCursor;if(n!=null)return n;let r=t.contentMatchAt(e.index()).defaultType;return r&&r.isTextblock}static findGapCursorFrom(t,n,r=!1){search:for(;;){if(!r&&e.valid(t))return t;let i=t.pos,a=null;for(let r=t.depth;;r--){let o=t.node(r);if(n>0?t.indexAfter(r)<o.childCount:t.index(r)>0){a=o.child(n>0?t.indexAfter(r):t.index(r)-1);break}else if(r==0)return null;i+=n;let s=t.doc.resolve(i);if(e.valid(s))return s}for(;;){let o=n>0?a.firstChild:a.lastChild;if(!o){if(a.isAtom&&!a.isText&&!F.isSelectable(a)){t=t.doc.resolve(i+a.nodeSize*n),r=!1;continue search}break}a=o,i+=n;let s=t.doc.resolve(i);if(e.valid(s))return s}return null}}};gy.prototype.visible=!1,gy.findFrom=gy.findGapCursorFrom,N.jsonID(`gapcursor`,gy);var _y=class e{constructor(e){this.pos=e}map(t){return new e(t.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return gy.valid(t)?new gy(t):N.near(t)}};function vy(e){return e.isAtom||e.spec.isolating||e.spec.createGapCursor}function yy(e){for(let t=e.depth;t>=0;t--){let n=e.index(t),r=e.node(t);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let e=r.child(n-1);;e=e.lastChild){if(e.childCount==0&&!e.inlineContent||vy(e.type))return!0;if(e.inlineContent)return!1}}return!0}function by(e){for(let t=e.depth;t>=0;t--){let n=e.indexAfter(t),r=e.node(t);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let e=r.child(n);;e=e.firstChild){if(e.childCount==0&&!e.inlineContent||vy(e.type))return!0;if(e.inlineContent)return!1}}return!0}function xy(){return new Jn({props:{decorations:Ey,createSelectionBetween(e,t,n){return t.pos==n.pos&&gy.valid(n)?new gy(n):null},handleClick:wy,handleKeyDown:Sy,handleDOMEvents:{beforeinput:Ty}}})}var Sy=wc({ArrowLeft:Cy(`horiz`,-1),ArrowRight:Cy(`horiz`,1),ArrowUp:Cy(`vert`,-1),ArrowDown:Cy(`vert`,1)});function Cy(e,t){let n=e==`vert`?t>0?`down`:`up`:t>0?`right`:`left`;return function(e,r,i){let a=e.selection,o=t>0?a.$to:a.$from,s=a.empty;if(a instanceof P){if(!i.endOfTextblock(n)||o.depth==0)return!1;s=!1,o=e.doc.resolve(t>0?o.after():o.before())}let c=gy.findGapCursorFrom(o,t,s);return c?(r&&r(e.tr.setSelection(new gy(c))),!0):!1}}function wy(e,t,n){if(!e||!e.editable)return!1;let r=e.state.doc.resolve(t);if(!gy.valid(r))return!1;let i=e.posAtCoords({left:n.clientX,top:n.clientY});return i&&i.inside>-1&&F.isSelectable(e.state.doc.nodeAt(i.inside))?!1:(e.dispatch(e.state.tr.setSelection(new gy(r))),!0)}function Ty(e,t){if(t.inputType!=`insertCompositionText`||!(e.state.selection instanceof gy))return!1;let{$from:n}=e.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(e.state.schema.nodes.text);if(!r)return!1;let i=E.empty;for(let e=r.length-1;e>=0;e--)i=E.from(r[e].createAndFill(null,i));let a=e.state.tr.replace(n.pos,n.pos,new A(i,0,0));return a.setSelection(P.near(a.doc.resolve(n.pos+1))),e.dispatch(a),!1}function Ey(e){if(!(e.selection instanceof gy))return null;let t=document.createElement(`div`);return t.className=`ProseMirror-gapcursor`,ws.create(e.doc,[xs.widget(e.selection.head,t,{key:`gapcursor`})])}var Dy=200,Oy=function(){};Oy.prototype.append=function(e){return e.length?(e=Oy.from(e),!this.length&&e||e.length<Dy&&this.leafAppend(e)||this.length<Dy&&e.leafPrepend(this)||this.appendInner(e)):this},Oy.prototype.prepend=function(e){return e.length?Oy.from(e).append(this):this},Oy.prototype.appendInner=function(e){return new Ay(this,e)},Oy.prototype.slice=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.length),e>=t?Oy.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},Oy.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},Oy.prototype.forEach=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)},Oy.prototype.map=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=this.length);var r=[];return this.forEach(function(t,n){return r.push(e(t,n))},t,n),r},Oy.from=function(e){return e instanceof Oy?e:e&&e.length?new ky(e):Oy.empty};var ky=function(e){function t(t){e.call(this),this.values=t}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(e,n){return e==0&&n==this.length?this:new t(this.values.slice(e,n))},t.prototype.getInner=function(e){return this.values[e]},t.prototype.forEachInner=function(e,t,n,r){for(var i=t;i<n;i++)if(e(this.values[i],r+i)===!1)return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){for(var i=t-1;i>=n;i--)if(e(this.values[i],r+i)===!1)return!1},t.prototype.leafAppend=function(e){if(this.length+e.length<=Dy)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=Dy)return new t(e.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t}(Oy);Oy.empty=new ky([]);var Ay=function(e){function t(t,n){e.call(this),this.left=t,this.right=n,this.length=t.length+n.length,this.depth=Math.max(t.depth,n.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(e){return e<this.left.length?this.left.get(e):this.right.get(e-this.left.length)},t.prototype.forEachInner=function(e,t,n,r){var i=this.left.length;if(t<i&&this.left.forEachInner(e,t,Math.min(n,i),r)===!1||n>i&&this.right.forEachInner(e,Math.max(t-i,0),Math.min(this.length,n)-i,r+i)===!1)return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){var i=this.left.length;if(t>i&&this.right.forEachInvertedInner(e,t-i,Math.max(n,i)-i,r+i)===!1||n<i&&this.left.forEachInvertedInner(e,Math.min(t,i),n,r)===!1)return!1},t.prototype.sliceInner=function(e,t){if(e==0&&t==this.length)return this;var n=this.left.length;return t<=n?this.left.slice(e,t):e>=n?this.right.slice(e-n,t-n):this.left.slice(e,n).append(this.right.slice(0,t-n))},t.prototype.leafAppend=function(e){var n=this.right.leafAppend(e);if(n)return new t(this.left,n)},t.prototype.leafPrepend=function(e){var n=this.left.leafPrepend(e);if(n)return new t(n,this.right)},t.prototype.appendInner=function(e){return this.left.depth>=Math.max(this.right.depth,e.depth)+1?new t(this.left,new t(this.right,e)):new t(this,e)},t}(Oy),jy=500,My=class e{constructor(e,t){this.items=e,this.eventCount=t}popEvent(t,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,a;n&&(i=this.remapping(r,this.items.length),a=i.maps.length);let o=t.tr,s,c,l=[],u=[];return this.items.forEach((t,n)=>{if(!t.step){i||(i=this.remapping(r,n+1),a=i.maps.length),a--,u.push(t);return}if(i){u.push(new Py(t.map));let e=t.step.map(i.slice(a)),n;e&&o.maybeStep(e).doc&&(n=o.mapping.maps[o.mapping.maps.length-1],l.push(new Py(n,void 0,void 0,l.length+u.length))),a--,n&&i.appendMap(n,a)}else o.maybeStep(t.step);if(t.selection)return s=i?t.selection.map(i.slice(a)):t.selection,c=new e(this.items.slice(0,r).append(u.reverse().concat(l)),this.eventCount-1),!1},this.items.length,0),{remaining:c,transform:o,selection:s}}addTransform(t,n,r,i){let a=[],o=this.eventCount,s=this.items,c=!i&&s.length?s.get(s.length-1):null;for(let e=0;e<t.steps.length;e++){let r=t.steps[e].invert(t.docs[e]),l=new Py(t.mapping.maps[e],r,n),u;(u=c&&c.merge(l))&&(l=u,e?a.pop():s=s.slice(0,s.length-1)),a.push(l),n&&=(o++,void 0),i||(c=l)}let l=o-r.depth;return l>Iy&&(s=Ny(s,l),o-=l),new e(s.append(a),o)}remapping(e,t){let n=new Tt;return this.items.forEach((t,r)=>{let i=t.mirrorOffset!=null&&r-t.mirrorOffset>=e?n.maps.length-t.mirrorOffset:void 0;n.appendMap(t.map,i)},e,t),n}addMaps(t){return this.eventCount==0?this:new e(this.items.append(t.map(e=>new Py(e))),this.eventCount)}rebased(t,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),a=t.mapping,o=t.steps.length,s=this.eventCount;this.items.forEach(e=>{e.selection&&s--},i);let c=n;this.items.forEach(e=>{let n=a.getMirror(--c);if(n==null)return;o=Math.min(o,n);let i=a.maps[n];if(e.step){let o=t.steps[n].invert(t.docs[n]),l=e.selection&&e.selection.map(a.slice(c+1,n));l&&s++,r.push(new Py(i,o,l))}else r.push(new Py(i))},i);let l=[];for(let e=n;e<o;e++)l.push(new Py(a.maps[e]));let u=new e(this.items.slice(0,i).append(l).append(r),s);return u.emptyItemCount()>jy&&(u=u.compress(this.items.length-r.length)),u}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(t=this.items.length){let n=this.remapping(0,t),r=n.maps.length,i=[],a=0;return this.items.forEach((e,o)=>{if(o>=t)i.push(e),e.selection&&a++;else if(e.step){let t=e.step.map(n.slice(r)),o=t&&t.getMap();if(r--,o&&n.appendMap(o,r),t){let s=e.selection&&e.selection.map(n.slice(r));s&&a++;let c=new Py(o.invert(),t,s),l,u=i.length-1;(l=i.length&&i[u].merge(c))?i[u]=l:i.push(c)}}else e.map&&r--},this.items.length,0),new e(Oy.from(i.reverse()),a)}};My.empty=new My(Oy.empty,0);function Ny(e,t){let n;return e.forEach((e,r)=>{if(e.selection&&t--==0)return n=r,!1}),e.slice(n)}var Py=class e{constructor(e,t,n,r){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=r}merge(t){if(this.step&&t.step&&!t.selection){let n=t.step.merge(this.step);if(n)return new e(n.getMap().invert(),n,this.selection)}}},Fy=class{constructor(e,t,n,r,i){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=r,this.prevComposition=i}},Iy=20;function Ly(e,t,n,r){let i=n.getMeta(Gy),a;if(i)return i.historyState;n.getMeta(Ky)&&(e=new Fy(e.done,e.undone,null,0,-1));let o=n.getMeta(`appendedTransaction`);if(n.steps.length==0)return e;if(o&&o.getMeta(Gy))return o.getMeta(Gy).redo?new Fy(e.done.addTransform(n,void 0,r,Wy(t)),e.undone,zy(n.mapping.maps),e.prevTime,e.prevComposition):new Fy(e.done,e.undone.addTransform(n,void 0,r,Wy(t)),null,e.prevTime,e.prevComposition);if(n.getMeta(`addToHistory`)!==!1&&!(o&&o.getMeta(`addToHistory`)===!1)){let i=n.getMeta(`composition`),a=e.prevTime==0||!o&&e.prevComposition!=i&&(e.prevTime<(n.time||0)-r.newGroupDelay||!Ry(n,e.prevRanges)),s=o?By(e.prevRanges,n.mapping):zy(n.mapping.maps);return new Fy(e.done.addTransform(n,a?t.selection.getBookmark():void 0,r,Wy(t)),My.empty,s,n.time,i??e.prevComposition)}else if(a=n.getMeta(`rebased`))return new Fy(e.done.rebased(n,a),e.undone.rebased(n,a),By(e.prevRanges,n.mapping),e.prevTime,e.prevComposition);else return new Fy(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),By(e.prevRanges,n.mapping),e.prevTime,e.prevComposition)}function Ry(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach((e,r)=>{for(let i=0;i<t.length;i+=2)e<=t[i+1]&&r>=t[i]&&(n=!0)}),n}function zy(e){let t=[];for(let n=e.length-1;n>=0&&t.length==0;n--)e[n].forEach((e,n,r,i)=>t.push(r,i));return t}function By(e,t){if(!e)return null;let n=[];for(let r=0;r<e.length;r+=2){let i=t.map(e[r],1),a=t.map(e[r+1],-1);i<=a&&n.push(i,a)}return n}function Vy(e,t,n){let r=Wy(t),i=Gy.get(t).spec.config,a=(n?e.undone:e.done).popEvent(t,r);if(!a)return null;let o=a.selection.resolve(a.transform.doc),s=(n?e.done:e.undone).addTransform(a.transform,t.selection.getBookmark(),i,r),c=new Fy(n?s:a.remaining,n?a.remaining:s,null,0,-1);return a.transform.setSelection(o).setMeta(Gy,{redo:n,historyState:c})}var Hy=!1,Uy=null;function Wy(e){let t=e.plugins;if(Uy!=t){Hy=!1,Uy=t;for(let e=0;e<t.length;e++)if(t[e].spec.historyPreserveItems){Hy=!0;break}}return Hy}var Gy=new Zn(`history`),Ky=new Zn(`closeHistory`);function qy(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new Jn({key:Gy,state:{init(){return new Fy(My.empty,My.empty,null,0,-1)},apply(t,n,r){return Ly(n,r,t,e)}},config:e,props:{handleDOMEvents:{beforeinput(e,t){let n=t.inputType,r=n==`historyUndo`?Yy:n==`historyRedo`?Xy:null;return!r||!e.editable?!1:(t.preventDefault(),r(e.state,e.dispatch))}}}})}function Jy(e,t){return(n,r)=>{let i=Gy.getState(n);if(!i||(e?i.undone:i.done).eventCount==0)return!1;if(r){let a=Vy(i,n,e);a&&r(t?a.scrollIntoView():a)}return!0}}var Yy=Jy(!1,!0),Xy=Jy(!0,!0);q.create({name:`characterCount`,addOptions(){return{limit:null,autoTrim:!0,mode:`textSize`,textCounter:e=>e.length,wordCounter:e=>e.split(` `).filter(e=>e!==``).length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=e=>{let t=e?.node||this.editor.state.doc;if((e?.mode||this.options.mode)===`textSize`){let e=t.textBetween(0,t.content.size,void 0,` `);return this.options.textCounter(e)}return t.nodeSize},this.storage.words=e=>{let t=e?.node||this.editor.state.doc,n=t.textBetween(0,t.content.size,` `,` `);return this.options.wordCounter(n)}},addProseMirrorPlugins(){let e=!1;return[new Jn({key:new Zn(`characterCount`),appendTransaction:(t,n,r)=>{if(e)return;let i=this.options.limit,a=this.options.autoTrim;if(i==null||i===0||a===!1){e=!0;return}let o=this.storage.characters({node:r.doc});if(o>i){let t=o-i;console.warn(`[CharacterCount] Initial content exceeded limit of ${i} characters. Content was automatically trimmed.`);let n=r.tr.deleteRange(0,t);return e=!0,n}e=!0},filterTransaction:(e,t)=>{let n=this.options.limit;if(!e.docChanged||n===0||n==null)return!0;let r=this.storage.characters({node:t.doc}),i=this.storage.characters({node:e.doc});if(i<=n||r>n&&i>n&&i<=r)return!0;if(r>n&&i>n&&i>r||!e.getMeta(`paste`))return!1;let a=e.selection.$head.pos,o=a-(i-n),s=a;return e.deleteRange(o,s),!(this.storage.characters({node:e.doc})>n)}})]}});var Zy=q.create({name:`dropCursor`,addOptions(){return{color:`currentColor`,width:1,class:void 0}},addProseMirrorPlugins(){return[my(this.options)]}});q.create({name:`focus`,addOptions(){return{className:`has-focus`,mode:`all`}},addProseMirrorPlugins(){return[new Jn({key:new Zn(`focus`),props:{decorations:({doc:e,selection:t})=>{let{isEditable:n,isFocused:r}=this.editor,{anchor:i}=t,a=[];if(!n||!r)return ws.create(e,[]);let o=0;this.options.mode===`deepest`&&e.descendants((e,t)=>{if(!e.isText){if(!(i>=t&&i<=t+e.nodeSize-1))return!1;o+=1}});let s=0;return e.descendants((e,t)=>{if(e.isText||!(i>=t&&i<=t+e.nodeSize-1))return!1;if(s+=1,this.options.mode===`deepest`&&o-s>0||this.options.mode===`shallowest`&&s>1)return this.options.mode===`deepest`;a.push(xs.node(t,t+e.nodeSize,{class:this.options.className}))}),ws.create(e,a)}}})]}});var Qy=q.create({name:`gapCursor`,addProseMirrorPlugins(){return[xy()]},extendNodeSchema(e){return{allowGapCursor:W(V(e,`allowGapCursor`,{name:e.name,options:e.options,storage:e.storage}))??null}}}),$y=`placeholder`,eb=new Zn(`tiptap__placeholder`),tb=200;function nb(e){let{editor:t,placeholder:n,dataAttribute:r,pos:i,node:a,isEmptyDoc:o,hasAnchor:s,classes:{emptyNode:c,emptyEditor:l}}=e,u=[c];return o&&u.push(l),xs.node(i,i+a.nodeSize,{class:u.join(` `),[r]:typeof n==`function`?n({editor:t,node:a,pos:i,hasAnchor:s}):n})}function rb(e,t){return typeof e==`function`?e(t):e}function ib({editor:e,options:t,dataAttribute:n,doc:r,selection:i}){if(!(e.isEditable||!t.showOnlyWhenEditable))return null;let{anchor:a}=i,o=[],s=e.isEmpty;if(t.showOnlyCurrent&&!t.includeChildren){let i=r.resolve(a),c=i.depth>0?i.node(1):i.nodeAfter,l=i.depth>0?i.before(1):a;if(c&&c.type.isTextblock&&Du(c)){let r=a>=l&&a<=l+c.nodeSize;o.push(nb({editor:e,isEmptyDoc:s,dataAttribute:n,hasAnchor:r,placeholder:t.placeholder,classes:{emptyEditor:t.emptyEditorClass,emptyNode:rb(t.emptyNodeClass,{editor:e,node:c,pos:l,hasAnchor:r})},node:c,pos:l}))}}else{let i=eb.getState(e.state),c=i?.topPos??0,l=i?.bottomPos??r.content.size;r.nodesBetween(c,l,(r,i)=>{let c=a>=i&&a<=i+r.nodeSize,l=!r.isLeaf&&Du(r);return r.type.isTextblock&&(c||!t.showOnlyCurrent)&&l&&o.push(nb({editor:e,isEmptyDoc:s,dataAttribute:n,hasAnchor:c,placeholder:t.placeholder,classes:{emptyEditor:t.emptyEditorClass,emptyNode:rb(t.emptyNodeClass,{editor:e,node:r,pos:i,hasAnchor:c})},node:r,pos:i})),t.includeChildren})}return ws.create(r,o)}function ab(e){return e.replace(/\s+/g,`-`).replace(/[^a-zA-Z0-9-]/g,``).replace(/^[0-9-]+/,``).replace(/^-+/,``).toLowerCase()}function ob(e){let t=getComputedStyle(e),n=`${t.overflow} ${t.overflowY} ${t.overflowX}`;return/auto|scroll|overlay/.test(n)}function sb(e){let t=e;for(;t;){if(ob(t))return t;let e=t.parentElement;if(!e){let e=t.getRootNode();if(e instanceof ShadowRoot){t=e.host;continue}return window}t=e}return window}function cb(e){return e===window?{top:0,bottom:window.innerHeight}:e.getBoundingClientRect()}function lb({view:e,scrollContainer:t}){let n=e.dom.getBoundingClientRect();if(n.width<=0||n.height<=0)return null;let r=t?cb(t):{top:0,bottom:window.innerHeight},i=Math.max(n.top,r.top)-tb,a=Math.min(n.bottom,r.bottom)+tb;if(i>=a)return null;let o=n.left+1,s=n.right-1;if(o>s)return null;let c=getComputedStyle(e.dom).direction===`rtl`?n.right-2:n.left+2,l=Math.min(Math.max(c,o),s),u=Math.max(i+2,n.top+1),d=Math.min(a-2,n.bottom-1);if(u>d)return null;let f=e.posAtCoords({left:l,top:u}),p=e.posAtCoords({left:l,top:d});return!f||!p?null:{top:f.pos,bottom:p.pos}}var ub={init(){return{topPos:null,bottomPos:null}},apply(e,t){let n=e.getMeta(eb);return n?.positions?{topPos:n.positions.top,bottomPos:n.positions.bottom}:e.docChanged?{topPos:t.topPos===null?null:e.mapping.map(t.topPos),bottomPos:t.bottomPos===null?null:e.mapping.map(t.bottomPos)}:t}};function db(e){let t=sb(e.dom),n=()=>{let n=lb({view:e,scrollContainer:t});if(n===null)return;let r=eb.getState(e.state);if(r?.topPos===n.top&&r?.bottomPos===n.bottom)return;let i=e.state.tr.setMeta(eb,{positions:n});e.dispatch(i)},r=null,i=0,a=()=>{r===null&&(r=requestAnimationFrame(()=>{r=null;let e=performance.now();e-i>=150?(i=e,n()):a()}))};t.addEventListener(`scroll`,a,{passive:!0});let o=typeof ResizeObserver<`u`?new ResizeObserver(a):null;o?.observe(e.dom);let s=typeof IntersectionObserver<`u`?new IntersectionObserver(a):null;return s?.observe(e.dom),e.dom.addEventListener(`focus`,a),n(),{update(t,n){e.state.doc.content.size!==n.doc.content.size&&a()},destroy:()=>{r!==null&&cancelAnimationFrame(r),t.removeEventListener(`scroll`,a),o?.disconnect(),s?.disconnect(),e.dom.removeEventListener(`focus`,a)}}}function fb({editor:e,options:t}){let n=t.dataAttribute?`data-${ab(t.dataAttribute)}`:`data-${$y}`;return new Jn({key:eb,state:ub,view:db,props:{decorations:({doc:r,selection:i})=>ib({editor:e,options:t,dataAttribute:n,doc:r,selection:i})}})}q.create({name:`placeholder`,addOptions(){return{emptyEditorClass:`is-editor-empty`,emptyNodeClass:`is-empty`,dataAttribute:$y,placeholder:`Write something …`,showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[fb({editor:this.editor,options:this.options})]}});var pb=`.ProseMirror:not(.ProseMirror-focused) *::selection {
|
|
173
|
+
background: transparent;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.ProseMirror:not(.ProseMirror-focused) *::-moz-selection {
|
|
177
|
+
background: transparent;
|
|
178
|
+
}`,mb=q.create({name:`selection`,addOptions(){return{className:`selection`}},addProseMirrorPlugins(){let{editor:e,options:t}=this;return e.options.injectCSS&&typeof document<`u`&&cd(pb,e.options.injectNonce,`selection`),[new Jn({key:new Zn(`selection`),props:{decorations(n){return n.selection.empty||e.isFocused||!e.isEditable||Ou(n.selection)||e.view.dragging?null:ws.create(n.doc,[xs.inline(n.selection.from,n.selection.to,{class:t.className})])}}})]}});function hb({types:e,node:t}){return t&&Array.isArray(e)&&e.includes(t.type)||t?.type===e}var gb=q.create({name:`trailingNode`,addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){let e=new Zn(this.name),t=this.options.node||this.editor.schema.topNodeType.contentMatch.defaultType?.name||`paragraph`,n=Object.entries(this.editor.schema.nodes).map(([,e])=>e).filter(e=>(this.options.notAfter||[]).concat(t).includes(e.name));return[new Jn({key:e,appendTransaction:(n,r,i)=>{let{doc:a,tr:o,schema:s}=i,c=e.getState(i),l=a.content.size,u=s.nodes[t];if(!n.some(e=>e.getMeta(`skipTrailingNode`))&&c)return o.insert(l,u.create())},state:{init:(e,t)=>{let r=t.tr.doc.lastChild;return!hb({node:r,types:n})},apply:(e,t)=>{if(!e.docChanged||e.getMeta(`__uniqueIDTransaction`))return t;let r=e.doc.lastChild;return!hb({node:r,types:n})}}})]}}),_b=q.create({name:`undoRedo`,addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:e,dispatch:t})=>Yy(e,t),redo:()=>({state:e,dispatch:t})=>Xy(e,t)}},addProseMirrorPlugins(){return[qy(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),vb=q.create({name:`starterKit`,addExtensions(){let e=[];return this.options.bold!==!1&&e.push(Ch.configure(this.options.bold)),this.options.blockquote!==!1&&e.push(vh.configure(this.options.blockquote)),this.options.bulletList!==!1&&e.push(ov.configure(this.options.bulletList)),this.options.code!==!1&&e.push(Eh.configure(this.options.code)),this.options.codeBlock!==!1&&e.push(Ah.configure(this.options.codeBlock)),this.options.document!==!1&&e.push(jh.configure(this.options.document)),this.options.dropcursor!==!1&&e.push(Zy.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&e.push(Qy.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&e.push(Mh.configure(this.options.hardBreak)),this.options.heading!==!1&&e.push(Nh.configure(this.options.heading)),this.options.undoRedo!==!1&&e.push(_b.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&e.push(Ph.configure(this.options.horizontalRule)),this.options.italic!==!1&&e.push(Bh.configure(this.options.italic)),this.options.listItem!==!1&&e.push(kv.configure(this.options.listItem)),this.options.listKeymap!==!1&&e.push(Bv.configure(this.options?.listKeymap)),this.options.link!==!1&&e.push(ev.configure(this.options?.link)),this.options.orderedList!==!1&&e.push(ny.configure(this.options.orderedList)),this.options.paragraph!==!1&&e.push(cy.configure(this.options.paragraph)),this.options.strike!==!1&&e.push(dy.configure(this.options.strike)),this.options.text!==!1&&e.push(fy.configure(this.options.text)),this.options.underline!==!1&&e.push(py.configure(this.options?.underline)),this.options.trailingNode!==!1&&e.push(gb.configure(this.options?.trailingNode)),e}}),yb=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,bb=rf.create({name:`image`,addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{},resize:!1}},inline(){return this.options.inline},group(){return this.options.inline?`inline`:`block`},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null},width:{default:null},height:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?`img[src]`:`img[src]:not([src^="data:"])`}]},renderHTML({HTMLAttributes:e}){return[`img`,G(this.options.HTMLAttributes,e)]},parseMarkdown:(e,t)=>t.createNode(`image`,{src:e.href,title:e.title,alt:e.text}),renderMarkdown:e=>{let t=e.attrs?.src??``,n=e.attrs?.alt??``,r=e.attrs?.title??``;return r?``:``},addNodeView(){if(!this.options.resize||!this.options.resize.enabled||typeof document>`u`)return null;let{directions:e,minWidth:t,minHeight:n,alwaysPreserveAspectRatio:r}=this.options.resize;return({node:i,getPos:a,HTMLAttributes:o,editor:s})=>{let c=document.createElement(`img`);c.draggable=!1;let l=G(this.options.HTMLAttributes,o);Object.entries(l).forEach(([e,t])=>{if(t!=null)switch(e){case`width`:case`height`:break;default:c.setAttribute(e,t);break}}),l.src!==null&&(c.src=l.src);let u=new nf({element:c,editor:s,node:i,getPos:a,onResize:(e,t)=>{c.style.width=`${e}px`,c.style.height=`${t}px`},onCommit:(e,t)=>{let n=a();n!==void 0&&this.editor.chain().setNodeSelection(n).updateAttributes(this.name,{width:e,height:t}).run()},onUpdate:(e,t,n)=>e.type===i.type,options:{directions:e,min:{width:t,height:n},preserveAspectRatio:r===!0}}),d=u.dom;return d.style.visibility=`hidden`,d.style.pointerEvents=`none`,c.onload=()=>{d.style.visibility=``,d.style.pointerEvents=``},u}},addCommands(){return{setImage:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e})}},addInputRules(){return[Zd({find:yb,type:this.type,getAttributes:e=>{let[,,t,n,r]=e;return{src:n,alt:t,title:r}}})]}}),xb=64;function Sb({node:e,updateAttributes:t,selected:n,editor:r}){let{src:i,alt:a,title:o,width:s,caption:c}=e.attrs,l=(0,J.useRef)(null),u=r.isEditable,d=e=>{e.preventDefault(),e.stopPropagation();let n=e.clientX,r=l.current?.offsetWidth??0,i=l.current?.parentElement?.parentElement?.offsetWidth??1/0,a=e=>{let t=Math.min(Math.max(xb,r+(e.clientX-n)),i);l.current&&(l.current.style.width=`${t}px`)},o=()=>{window.removeEventListener(`mousemove`,a),window.removeEventListener(`mouseup`,o);let e=l.current?.offsetWidth;e&&t({width:Math.round(e)})};window.addEventListener(`mousemove`,a),window.addEventListener(`mouseup`,o)},f=s?`${typeof s==`number`?`${s}px`:s}`:void 0;return(0,Y.jsxs)(Dp,{as:`figure`,className:`resizable-image${n?` is-selected`:``}`,"data-type":`image`,children:[(0,Y.jsxs)(`div`,{className:`resizable-image-frame`,style:{width:f??`fit-content`},children:[(0,Y.jsx)(`img`,{ref:l,src:i,alt:a??``,title:o??void 0,draggable:!1,style:{width:f}}),u&&(0,Y.jsx)(`span`,{className:`resizable-image-handle`,onMouseDown:d,role:`presentation`,"aria-hidden":`true`})]}),u?(0,Y.jsx)(`figcaption`,{children:(0,Y.jsx)(`input`,{className:`resizable-image-caption-input`,value:c??``,placeholder:`Add a caption…`,onChange:e=>t({caption:e.target.value}),onMouseDown:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation()})}):c?(0,Y.jsx)(`figcaption`,{children:c}):null]})}var Cb=bb.extend({addOptions(){return{...this.parent?.(),allowBase64:!0}},addAttributes(){return{...this.parent?.(),width:{default:null,parseHTML:e=>{let t=e.getAttribute(`width`);return t?parseInt(t,10):null},renderHTML:e=>e.width?{width:e.width}:{}},caption:{default:``,renderHTML:()=>({}),parseHTML:e=>e.getAttribute(`data-caption`)??e.parentElement?.querySelector(`figcaption`)?.textContent??``}}},parseHTML(){return[{tag:`figure[data-type='image']`,getAttrs:e=>{let t=e,n=t.querySelector(`img`);return n?{src:n.getAttribute(`src`),alt:n.getAttribute(`alt`),title:n.getAttribute(`title`),width:n.getAttribute(`width`)?parseInt(n.getAttribute(`width`),10):null,caption:t.querySelector(`figcaption`)?.textContent??``}:!1}},{tag:this.options.allowBase64?`img[src]`:`img[src]:not([src^="data:"])`}]},renderHTML({HTMLAttributes:e,node:t}){let n=[`img`,G(this.options.HTMLAttributes,e)];return t.attrs.caption?[`figure`,{"data-type":`image`},n,[`figcaption`,{},t.attrs.caption]]:n},addNodeView(){return Fp(Sb)}}),wb=q.create({name:`textAlign`,addOptions(){return{types:[],alignments:[`left`,`center`,`right`,`justify`],defaultAlignment:null}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:e=>{let t=e.style.textAlign;return this.options.alignments.includes(t)?t:this.options.defaultAlignment},renderHTML:e=>e.textAlign?{style:`text-align: ${e.textAlign}`}:{}}}}]},addCommands(){return{setTextAlign:e=>({commands:t})=>this.options.alignments.includes(e)?this.options.types.map(n=>t.updateAttributes(n,{textAlign:e})).some(e=>e):!1,unsetTextAlign:()=>({commands:e})=>this.options.types.map(t=>e.resetAttributes(t,`textAlign`)).some(e=>e),toggleTextAlign:e=>({editor:t,commands:n})=>this.options.alignments.includes(e)?t.isActive({textAlign:e})?n.unsetTextAlign():n.setTextAlign(e):!1}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign(`left`),"Mod-Shift-e":()=>this.editor.commands.setTextAlign(`center`),"Mod-Shift-r":()=>this.editor.commands.setTextAlign(`right`),"Mod-Shift-j":()=>this.editor.commands.setTextAlign(`justify`)}}}),Tb=e=>$d({find:/--$/,replace:e??`—`}),Eb=e=>$d({find:/\.\.\.$/,replace:e??`…`}),Db=e=>$d({find:/(?:^|[\s{[(<'"\u2018\u201C])(")$/,replace:e??`“`}),Ob=e=>$d({find:/"$/,replace:e??`”`}),kb=e=>$d({find:/(?:^|[\s{[(<'"\u2018\u201C])(')$/,replace:e??`‘`}),Ab=e=>$d({find:/'$/,replace:e??`’`}),jb=e=>$d({find:/<-$/,replace:e??`←`}),Mb=e=>$d({find:/->$/,replace:e??`→`}),Nb=e=>$d({find:/\(c\)$/,replace:e??`©`}),Pb=e=>$d({find:/\(tm\)$/,replace:e??`™`}),Fb=e=>$d({find:/\(sm\)$/,replace:e??`℠`}),Ib=e=>$d({find:/\(r\)$/,replace:e??`®`}),Lb=e=>$d({find:/(?:^|\s)(1\/2)\s$/,replace:e??`½`}),Rb=e=>$d({find:/\+\/-$/,replace:e??`±`}),zb=e=>$d({find:/!=$/,replace:e??`≠`}),Bb=e=>$d({find:/<<$/,replace:e??`«`}),Vb=e=>$d({find:/>>$/,replace:e??`»`}),Hb=e=>$d({find:/\d+\s?([*x])\s?\d+$/,replace:e??`×`}),Ub=e=>$d({find:/\^2$/,replace:e??`²`}),Wb=e=>$d({find:/\^3$/,replace:e??`³`}),Gb=e=>$d({find:/(?:^|\s)(1\/4)\s$/,replace:e??`¼`}),Kb=e=>$d({find:/(?:^|\s)(3\/4)\s$/,replace:e??`¾`}),qb=q.create({name:`typography`,addOptions(){return{closeDoubleQuote:`”`,closeSingleQuote:`’`,copyright:`©`,ellipsis:`…`,emDash:`—`,laquo:`«`,leftArrow:`←`,multiplication:`×`,notEqual:`≠`,oneHalf:`½`,oneQuarter:`¼`,openDoubleQuote:`“`,openSingleQuote:`‘`,plusMinus:`±`,raquo:`»`,registeredTrademark:`®`,rightArrow:`→`,servicemark:`℠`,superscriptThree:`³`,superscriptTwo:`²`,threeQuarters:`¾`,trademark:`™`}},addInputRules(){let e=[];this.options.emDash!==!1&&e.push(Tb(this.options.emDash)),this.options.ellipsis!==!1&&e.push(Eb(this.options.ellipsis));let t=this.editor.options.textDirection===`rtl`;if(this.options.doubleQuotes?.rtl){let{open:t,close:n}=this.options.doubleQuotes.rtl;e.push(Db(t)),e.push(Ob(n))}else t?(e.push(Db(`”`)),e.push(Ob(`“`))):(this.options.openDoubleQuote!==!1&&e.push(Db(this.options.openDoubleQuote)),this.options.closeDoubleQuote!==!1&&e.push(Ob(this.options.closeDoubleQuote)));if(this.options.singleQuotes?.rtl){let{open:t,close:n}=this.options.singleQuotes.rtl;e.push(kb(t)),e.push(Ab(n))}else t?(e.push(kb(`’`)),e.push(Ab(`‘`))):(this.options.openSingleQuote!==!1&&e.push(kb(this.options.openSingleQuote)),this.options.closeSingleQuote!==!1&&e.push(Ab(this.options.closeSingleQuote)));return this.options.leftArrow!==!1&&e.push(jb(this.options.leftArrow)),this.options.rightArrow!==!1&&e.push(Mb(this.options.rightArrow)),this.options.copyright!==!1&&e.push(Nb(this.options.copyright)),this.options.trademark!==!1&&e.push(Pb(this.options.trademark)),this.options.servicemark!==!1&&e.push(Fb(this.options.servicemark)),this.options.registeredTrademark!==!1&&e.push(Ib(this.options.registeredTrademark)),this.options.oneHalf!==!1&&e.push(Lb(this.options.oneHalf)),this.options.plusMinus!==!1&&e.push(Rb(this.options.plusMinus)),this.options.notEqual!==!1&&e.push(zb(this.options.notEqual)),this.options.laquo!==!1&&e.push(Bb(this.options.laquo)),this.options.raquo!==!1&&e.push(Vb(this.options.raquo)),this.options.multiplication!==!1&&e.push(Hb(this.options.multiplication)),this.options.superscriptTwo!==!1&&e.push(Ub(this.options.superscriptTwo)),this.options.superscriptThree!==!1&&e.push(Wb(this.options.superscriptThree)),this.options.oneQuarter!==!1&&e.push(Gb(this.options.oneQuarter)),this.options.threeQuarters!==!1&&e.push(Kb(this.options.threeQuarters)),e}}),Jb=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/,Yb=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g,Xb=Od.create({name:`highlight`,addOptions(){return{multicolor:!1,HTMLAttributes:{}}},addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:e=>e.getAttribute(`data-color`)||ld(e,`background-color`)||e.style.backgroundColor,renderHTML:e=>e.color?{"data-color":e.color,style:`background-color: ${e.color}; color: inherit`}:{}}}:{}},parseHTML(){return[{tag:`mark`}]},renderHTML({HTMLAttributes:e}){return[`mark`,G(this.options.HTMLAttributes,e),0]},renderMarkdown:(e,t)=>`==${t.renderChildren(e)}==`,parseMarkdown:(e,t)=>t.applyMark(`highlight`,t.parseInline(e.tokens||[])),markdownTokenizer:{name:`highlight`,level:`inline`,start:e=>e.indexOf(`==`),tokenize(e,t,n){let r=/^(==)([^=]+)(==)/.exec(e);if(r){let e=r[2].trim(),t=n.inlineTokens(e);return{type:`highlight`,raw:r[0],text:e,tokens:t}}}},addCommands(){return{setHighlight:e=>({commands:t})=>t.setMark(this.name,e),toggleHighlight:e=>({commands:t})=>t.toggleMark(this.name,e),unsetHighlight:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}},addInputRules(){return[Xd({find:Jb,type:this.type})]},addPasteRules(){return[of({find:Yb,type:this.type})]}}),Zb=Od.create({name:`subscript`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`sub`},{style:`vertical-align`,getAttrs(e){return e===`sub`?null:!1}}]},renderHTML({HTMLAttributes:e}){return[`sub`,G(this.options.HTMLAttributes,e),0]},addCommands(){return{setSubscript:()=>({commands:e})=>e.setMark(this.name),toggleSubscript:()=>({commands:e})=>e.toggleMark(this.name),unsetSubscript:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-,":()=>this.editor.commands.toggleSubscript()}}}),Qb=Od.create({name:`superscript`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`sup`},{style:`vertical-align`,getAttrs(e){return e===`super`?null:!1}}]},renderHTML({HTMLAttributes:e}){return[`sup`,G(this.options.HTMLAttributes,e),0]},addCommands(){return{setSuperscript:()=>({commands:e})=>e.setMark(this.name),toggleSuperscript:()=>({commands:e})=>e.toggleMark(this.name),unsetSuperscript:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-.":()=>this.editor.commands.toggleSuperscript()}}}),$b,ex;if(typeof WeakMap<`u`){let e=new WeakMap;$b=t=>e.get(t),ex=(t,n)=>(e.set(t,n),n)}else{let e=[],t=0;$b=t=>{for(let n=0;n<e.length;n+=2)if(e[n]==t)return e[n+1]},ex=(n,r)=>(t==10&&(t=0),e[t++]=n,e[t++]=r)}var tx=class{constructor(e,t,n,r){this.width=e,this.height=t,this.map=n,this.problems=r}findCell(e){for(let t=0;t<this.map.length;t++){let n=this.map[t];if(n!=e)continue;let r=t%this.width,i=t/this.width|0,a=r+1,o=i+1;for(let e=1;a<this.width&&this.map[t+e]==n;e++)a++;for(let e=1;o<this.height&&this.map[t+this.width*e]==n;e++)o++;return{left:r,top:i,right:a,bottom:o}}throw RangeError(`No cell with offset ${e} found`)}colCount(e){for(let t=0;t<this.map.length;t++)if(this.map[t]==e)return t%this.width;throw RangeError(`No cell with offset ${e} found`)}nextCell(e,t,n){let{left:r,right:i,top:a,bottom:o}=this.findCell(e);return t==`horiz`?(n<0?r==0:i==this.width)?null:this.map[a*this.width+(n<0?r-1:i)]:(n<0?a==0:o==this.height)?null:this.map[r+this.width*(n<0?a-1:o)]}rectBetween(e,t){let{left:n,right:r,top:i,bottom:a}=this.findCell(e),{left:o,right:s,top:c,bottom:l}=this.findCell(t);return{left:Math.min(n,o),top:Math.min(i,c),right:Math.max(r,s),bottom:Math.max(a,l)}}cellsInRect(e){let t=[],n={};for(let r=e.top;r<e.bottom;r++)for(let i=e.left;i<e.right;i++){let a=r*this.width+i,o=this.map[a];n[o]||(n[o]=!0,!(i==e.left&&i&&this.map[a-1]==o||r==e.top&&r&&this.map[a-this.width]==o)&&t.push(o))}return t}positionAt(e,t,n){for(let r=0,i=0;;r++){let a=i+n.child(r).nodeSize;if(r==e){let n=t+e*this.width,r=(e+1)*this.width;for(;n<r&&this.map[n]<i;)n++;return n==r?a-1:this.map[n]}i=a}}static get(e){return $b(e)||ex(e,nx(e))}};function nx(e){if(e.type.spec.tableRole!=`table`)throw RangeError(`Not a table node: `+e.type.name);let t=rx(e),n=e.childCount,r=[],i=0,a=null,o=[];for(let e=0,i=t*n;e<i;e++)r[e]=0;for(let s=0,c=0;s<n;s++){let l=e.child(s);c++;for(let e=0;;e++){for(;i<r.length&&r[i]!=0;)i++;if(e==l.childCount)break;let u=l.child(e),{colspan:d,rowspan:f,colwidth:p}=u.attrs;for(let e=0;e<f;e++){if(e+s>=n){(a||=[]).push({type:`overlong_rowspan`,pos:c,n:f-e});break}let l=i+e*t;for(let e=0;e<d;e++){r[l+e]==0?r[l+e]=c:(a||=[]).push({type:`collision`,row:s,pos:c,n:d-e});let n=p&&p[e];if(n){let r=(l+e)%t*2,i=o[r];i==null||i!=n&&o[r+1]==1?(o[r]=n,o[r+1]=1):i==n&&o[r+1]++}}}i+=d,c+=u.nodeSize}let u=(s+1)*t,d=0;for(;i<u;)r[i++]==0&&d++;d&&(a||=[]).push({type:`missing`,row:s,n:d}),c++}(t===0||n===0)&&(a||=[]).push({type:`zero_sized`});let s=new tx(t,n,r,a),c=!1;for(let e=0;!c&&e<o.length;e+=2)o[e]!=null&&o[e+1]<n&&(c=!0);return c&&ix(s,o,e),s}function rx(e){let t=-1,n=!1;for(let r=0;r<e.childCount;r++){let i=e.child(r),a=0;if(n)for(let t=0;t<r;t++){let n=e.child(t);for(let e=0;e<n.childCount;e++){let i=n.child(e);t+i.attrs.rowspan>r&&(a+=i.attrs.colspan)}}for(let e=0;e<i.childCount;e++){let t=i.child(e);a+=t.attrs.colspan,t.attrs.rowspan>1&&(n=!0)}t==-1?t=a:t!=a&&(t=Math.max(t,a))}return t}function ix(e,t,n){e.problems||=[];let r={};for(let i=0;i<e.map.length;i++){let a=e.map[i];if(r[a])continue;r[a]=!0;let o=n.nodeAt(a);if(!o)throw RangeError(`No cell with offset ${a} found`);let s=null,c=o.attrs;for(let n=0;n<c.colspan;n++){let r=t[(i+n)%e.width*2];r!=null&&(!c.colwidth||c.colwidth[n]!=r)&&((s||=ax(c))[n]=r)}s&&e.problems.unshift({type:`colwidth mismatch`,pos:a,colwidth:s})}}function ax(e){if(e.colwidth)return e.colwidth.slice();let t=[];for(let n=0;n<e.colspan;n++)t.push(0);return t}function ox(e){let t=e.cached.tableNodeTypes;if(!t){t=e.cached.tableNodeTypes={};for(let n in e.nodes){let r=e.nodes[n],i=r.spec.tableRole;i&&(t[i]=r)}}return t}var sx=new Zn(`selectingCells`);function cx(e){for(let t=e.depth-1;t>0;t--)if(e.node(t).type.spec.tableRole==`row`)return e.node(0).resolve(e.before(t+1));return null}function lx(e){for(let t=e.depth;t>0;t--){let n=e.node(t).type.spec.tableRole;if(n===`cell`||n===`header_cell`)return e.node(t)}return null}function ux(e){let t=e.selection.$head;for(let e=t.depth;e>0;e--)if(t.node(e).type.spec.tableRole==`row`)return!0;return!1}function dx(e){let t=e.selection;if(`$anchorCell`in t&&t.$anchorCell)return t.$anchorCell.pos>t.$headCell.pos?t.$anchorCell:t.$headCell;if(`node`in t&&t.node&&t.node.type.spec.tableRole==`cell`)return t.$anchor;let n=cx(t.$head)||fx(t.$head);if(n)return n;throw RangeError(`No cell found around position ${t.head}`)}function fx(e){for(let t=e.nodeAfter,n=e.pos;t;t=t.firstChild,n++){let r=t.type.spec.tableRole;if(r==`cell`||r==`header_cell`)return e.doc.resolve(n)}for(let t=e.nodeBefore,n=e.pos;t;t=t.lastChild,n--){let r=t.type.spec.tableRole;if(r==`cell`||r==`header_cell`)return e.doc.resolve(n-t.nodeSize)}}function px(e){return e.parent.type.spec.tableRole==`row`&&!!e.nodeAfter}function mx(e){return e.node(0).resolve(e.pos+e.nodeAfter.nodeSize)}function hx(e,t){return e.depth==t.depth&&e.pos>=t.start(-1)&&e.pos<=t.end(-1)}function gx(e,t,n){let r=e.node(-1),i=tx.get(r),a=e.start(-1),o=i.nextCell(e.pos-a,t,n);return o==null?null:e.node(0).resolve(a+o)}function _x(e,t,n=1){let r={...e,colspan:e.colspan-n};return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(t,n),r.colwidth.some(e=>e>0)||(r.colwidth=null)),r}function vx(e,t,n=1){let r={...e,colspan:e.colspan+n};if(r.colwidth){r.colwidth=r.colwidth.slice();for(let e=0;e<n;e++)r.colwidth.splice(t,0,0)}return r}function yx(e,t,n){let r=ox(t.type.schema).header_cell;for(let i=0;i<e.height;i++)if(t.nodeAt(e.map[n+i*e.width]).type!=r)return!1;return!0}var bx=class e extends N{constructor(e,t=e){let n=e.node(-1),r=tx.get(n),i=e.start(-1),a=r.rectBetween(e.pos-i,t.pos-i),o=e.node(0),s=r.cellsInRect(a).filter(e=>e!=t.pos-i);s.unshift(t.pos-i);let c=s.map(e=>{let t=n.nodeAt(e);if(!t)throw RangeError(`No cell with offset ${e} found`);let r=i+e+1;return new kn(o.resolve(r),o.resolve(r+t.content.size))});super(c[0].$from,c[0].$to,c),this.$anchorCell=e,this.$headCell=t}map(t,n){let r=t.resolve(n.map(this.$anchorCell.pos)),i=t.resolve(n.map(this.$headCell.pos));if(px(r)&&px(i)&&hx(r,i)){let t=this.$anchorCell.node(-1)!=r.node(-1);return t&&this.isRowSelection()?e.rowSelection(r,i):t&&this.isColSelection()?e.colSelection(r,i):new e(r,i)}return P.between(r,i)}content(){let e=this.$anchorCell.node(-1),t=tx.get(e),n=this.$anchorCell.start(-1),r=t.rectBetween(this.$anchorCell.pos-n,this.$headCell.pos-n),i={},a=[];for(let n=r.top;n<r.bottom;n++){let o=[];for(let a=n*t.width+r.left,s=r.left;s<r.right;s++,a++){let n=t.map[a];if(i[n])continue;i[n]=!0;let s=t.findCell(n),c=e.nodeAt(n);if(!c)throw RangeError(`No cell with offset ${n} found`);let l=r.left-s.left,u=s.right-r.right;if(l>0||u>0){let e=c.attrs;if(l>0&&(e=_x(e,0,l)),u>0&&(e=_x(e,e.colspan-u,u)),s.left<r.left){if(c=c.type.createAndFill(e),!c)throw RangeError(`Could not create cell with attrs ${JSON.stringify(e)}`)}else c=c.type.create(e,c.content)}if(s.top<r.top||s.bottom>r.bottom){let e={...c.attrs,rowspan:Math.min(s.bottom,r.bottom)-Math.max(s.top,r.top)};c=s.top<r.top?c.type.createAndFill(e):c.type.create(e,c.content)}o.push(c)}a.push(e.child(n).copy(E.from(o)))}let o=this.isColSelection()&&this.isRowSelection()?e:a;return new A(E.from(o),1,1)}replace(e,t=A.empty){let n=e.steps.length,r=this.ranges;for(let i=0;i<r.length;i++){let{$from:a,$to:o}=r[i],s=e.mapping.slice(n);e.replace(s.map(a.pos),s.map(o.pos),i?A.empty:t)}let i=N.findFrom(e.doc.resolve(e.mapping.slice(n).map(this.to)),-1);i&&e.setSelection(i)}replaceWith(e,t){this.replace(e,new A(E.from(t),0,0))}forEachCell(e){let t=this.$anchorCell.node(-1),n=tx.get(t),r=this.$anchorCell.start(-1),i=n.cellsInRect(n.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r));for(let n=0;n<i.length;n++)e(t.nodeAt(i[n]),r+i[n])}isColSelection(){let e=this.$anchorCell.index(-1),t=this.$headCell.index(-1);if(Math.min(e,t)>0)return!1;let n=e+this.$anchorCell.nodeAfter.attrs.rowspan,r=t+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(n,r)==this.$headCell.node(-1).childCount}static colSelection(t,n=t){let r=t.node(-1),i=tx.get(r),a=t.start(-1),o=i.findCell(t.pos-a),s=i.findCell(n.pos-a),c=t.node(0);return o.top<=s.top?(o.top>0&&(t=c.resolve(a+i.map[o.left])),s.bottom<i.height&&(n=c.resolve(a+i.map[i.width*(i.height-1)+s.right-1]))):(s.top>0&&(n=c.resolve(a+i.map[s.left])),o.bottom<i.height&&(t=c.resolve(a+i.map[i.width*(i.height-1)+o.right-1]))),new e(t,n)}isRowSelection(){let e=this.$anchorCell.node(-1),t=tx.get(e),n=this.$anchorCell.start(-1),r=t.colCount(this.$anchorCell.pos-n),i=t.colCount(this.$headCell.pos-n);if(Math.min(r,i)>0)return!1;let a=r+this.$anchorCell.nodeAfter.attrs.colspan,o=i+this.$headCell.nodeAfter.attrs.colspan;return Math.max(a,o)==t.width}eq(t){return t instanceof e&&t.$anchorCell.pos==this.$anchorCell.pos&&t.$headCell.pos==this.$headCell.pos}static rowSelection(t,n=t){let r=t.node(-1),i=tx.get(r),a=t.start(-1),o=i.findCell(t.pos-a),s=i.findCell(n.pos-a),c=t.node(0);return o.left<=s.left?(o.left>0&&(t=c.resolve(a+i.map[o.top*i.width])),s.right<i.width&&(n=c.resolve(a+i.map[i.width*(s.top+1)-1]))):(s.left>0&&(n=c.resolve(a+i.map[s.top*i.width])),o.right<i.width&&(t=c.resolve(a+i.map[i.width*(o.top+1)-1]))),new e(t,n)}toJSON(){return{type:`cell`,anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(t,n){return new e(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,r=n){return new e(t.resolve(n),t.resolve(r))}getBookmark(){return new xx(this.$anchorCell.pos,this.$headCell.pos)}};bx.prototype.visible=!1,N.jsonID(`cell`,bx);var xx=class e{constructor(e,t){this.anchor=e,this.head=t}map(t){return new e(t.map(this.anchor),t.map(this.head))}resolve(e){let t=e.resolve(this.anchor),n=e.resolve(this.head);return t.parent.type.spec.tableRole==`row`&&n.parent.type.spec.tableRole==`row`&&t.index()<t.parent.childCount&&n.index()<n.parent.childCount&&hx(t,n)?new bx(t,n):N.near(n,1)}};function Sx(e){if(!(e.selection instanceof bx))return null;let t=[];return e.selection.forEachCell((e,n)=>{t.push(xs.node(n,n+e.nodeSize,{class:`selectedCell`}))}),ws.create(e.doc,t)}function Cx({$from:e,$to:t}){if(e.pos==t.pos||e.pos<t.pos-6)return!1;let n=e.pos,r=t.pos,i=e.depth;for(;i>=0&&!(e.after(i+1)<e.end(i));i--,n++);for(let e=t.depth;e>=0&&!(t.before(e+1)>t.start(e));e--,r--);return n==r&&/row|table/.test(e.node(i).type.spec.tableRole)}function wx({$from:e,$to:t}){let n,r;for(let t=e.depth;t>0;t--){let r=e.node(t);if(r.type.spec.tableRole===`cell`||r.type.spec.tableRole===`header_cell`){n=r;break}}for(let e=t.depth;e>0;e--){let n=t.node(e);if(n.type.spec.tableRole===`cell`||n.type.spec.tableRole===`header_cell`){r=n;break}}return n!==r&&t.parentOffset===0}function Tx(e,t,n){let r=(t||e).selection,i=(t||e).doc,a,o;if(r instanceof F&&(o=r.node.type.spec.tableRole)){if(o==`cell`||o==`header_cell`)a=bx.create(i,r.from);else if(o==`row`){let e=i.resolve(r.from+1);a=bx.rowSelection(e,e)}else if(!n){let e=tx.get(r.node),t=r.from+1,n=t+e.map[e.width*e.height-1];a=bx.create(i,t+1,n)}}else r instanceof P&&Cx(r)?a=P.create(i,r.from):r instanceof P&&wx(r)&&(a=P.create(i,r.$from.start(),r.$from.end()));return a&&(t||=e.tr).setSelection(a),t}var Ex=new Zn(`fix-tables`);function Dx(e,t,n,r){let i=e.childCount,a=t.childCount;outer:for(let o=0,s=0;o<a;o++){let a=t.child(o);for(let t=s,r=Math.min(i,o+3);t<r;t++)if(e.child(t)==a){s=t+1,n+=a.nodeSize;continue outer}r(a,n),s<i&&e.child(s).sameMarkup(a)?Dx(e.child(s),a,n+1,r):a.nodesBetween(0,a.content.size,r,n+1),n+=a.nodeSize}}function Ox(e,t){let n,r=(t,r)=>{t.type.spec.tableRole==`table`&&(n=kx(e,t,r,n))};return t?t.doc!=e.doc&&Dx(t.doc,e.doc,0,r):e.doc.descendants(r),n}function kx(e,t,n,r){let i=tx.get(t);if(!i.problems)return r;r||=e.tr;let a=[];for(let e=0;e<i.height;e++)a.push(0);for(let e=0;e<i.problems.length;e++){let o=i.problems[e];if(o.type==`collision`){let e=t.nodeAt(o.pos);if(!e)continue;let i=e.attrs;for(let e=0;e<i.rowspan;e++)a[o.row+e]+=o.n;r.setNodeMarkup(r.mapping.map(n+1+o.pos),null,_x(i,i.colspan-o.n,o.n))}else if(o.type==`missing`)a[o.row]+=o.n;else if(o.type==`overlong_rowspan`){let e=t.nodeAt(o.pos);if(!e)continue;r.setNodeMarkup(r.mapping.map(n+1+o.pos),null,{...e.attrs,rowspan:e.attrs.rowspan-o.n})}else if(o.type==`colwidth mismatch`){let e=t.nodeAt(o.pos);if(!e)continue;r.setNodeMarkup(r.mapping.map(n+1+o.pos),null,{...e.attrs,colwidth:o.colwidth})}else if(o.type==`zero_sized`){let e=r.mapping.map(n);r.delete(e,e+t.nodeSize)}}let o,s;for(let e=0;e<a.length;e++)a[e]&&(o??=e,s=e);for(let c=0,l=n+1;c<i.height;c++){let n=t.child(c),i=l+n.nodeSize,u=a[c];if(u>0){let t=`cell`;n.firstChild&&(t=n.firstChild.type.spec.tableRole);let a=[];for(let n=0;n<u;n++){let n=ox(e.schema)[t].createAndFill();n&&a.push(n)}let d=(c==0||o==c-1)&&s==c?l+1:i-1;r.insert(r.mapping.map(d),a)}l=i}return r.setMeta(Ex,{fixTables:!0})}function Ax(e){let t=e.selection,n=dx(e),r=n.node(-1),i=n.start(-1),a=tx.get(r);return{...t instanceof bx?a.rectBetween(t.$anchorCell.pos-i,t.$headCell.pos-i):a.findCell(n.pos-i),tableStart:i,map:a,table:r}}function jx(e,{map:t,tableStart:n,table:r},i){let a=i>0?-1:0;yx(t,r,i+a)&&(a=i==0||i==t.width?null:0);for(let o=0;o<t.height;o++){let s=o*t.width+i;if(i>0&&i<t.width&&t.map[s-1]==t.map[s]){let a=t.map[s],c=r.nodeAt(a);e.setNodeMarkup(e.mapping.map(n+a),null,vx(c.attrs,i-t.colCount(a))),o+=c.attrs.rowspan-1}else{let c=a==null?ox(r.type.schema).cell:r.nodeAt(t.map[s+a]).type,l=t.positionAt(o,i,r);e.insert(e.mapping.map(n+l),c.createAndFill())}}return e}function Mx(e,t){if(!ux(e))return!1;if(t){let n=Ax(e);t(jx(e.tr,n,n.left))}return!0}function Nx(e,t){if(!ux(e))return!1;if(t){let n=Ax(e);t(jx(e.tr,n,n.right))}return!0}function Px(e,{map:t,table:n,tableStart:r},i){let a=e.mapping.maps.length;for(let o=0;o<t.height;){let s=o*t.width+i,c=t.map[s],l=n.nodeAt(c),u=l.attrs;if(i>0&&t.map[s-1]==c||i<t.width-1&&t.map[s+1]==c)e.setNodeMarkup(e.mapping.slice(a).map(r+c),null,_x(u,i-t.colCount(c)));else{let t=e.mapping.slice(a).map(r+c);e.delete(t,t+l.nodeSize)}o+=u.rowspan}}function Fx(e,t){if(!ux(e))return!1;if(t){let n=Ax(e),r=e.tr;if(n.left==0&&n.right==n.map.width)return!1;for(let e=n.right-1;Px(r,n,e),e!=n.left;e--){let e=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!e)throw RangeError(`No table found`);n.table=e,n.map=tx.get(e)}t(r)}return!0}function Ix(e,t,n){let r=ox(t.type.schema).header_cell;for(let i=0;i<e.width;i++)if(t.nodeAt(e.map[i+n*e.width])?.type!=r)return!1;return!0}function Lx(e,{map:t,tableStart:n,table:r},i){let a=n;for(let e=0;e<i;e++)a+=r.child(e).nodeSize;let o=[],s=i>0?-1:0;Ix(t,r,i+s)&&(s=i==0||i==t.height?null:0);for(let a=0,c=t.width*i;a<t.width;a++,c++)if(i>0&&i<t.height&&t.map[c]==t.map[c-t.width]){let i=t.map[c],o=r.nodeAt(i).attrs;e.setNodeMarkup(n+i,null,{...o,rowspan:o.rowspan+1}),a+=o.colspan-1}else{let e=(s==null?ox(r.type.schema).cell:r.nodeAt(t.map[c+s*t.width])?.type)?.createAndFill();e&&o.push(e)}return e.insert(a,ox(r.type.schema).row.create(null,o)),e}function Rx(e,t){if(!ux(e))return!1;if(t){let n=Ax(e);t(Lx(e.tr,n,n.top))}return!0}function zx(e,t){if(!ux(e))return!1;if(t){let n=Ax(e);t(Lx(e.tr,n,n.bottom))}return!0}function Bx(e,{map:t,table:n,tableStart:r},i){let a=0;for(let e=0;e<i;e++)a+=n.child(e).nodeSize;let o=a+n.child(i).nodeSize,s=e.mapping.maps.length;e.delete(a+r,o+r);let c=new Set;for(let a=0,o=i*t.width;a<t.width;a++,o++){let l=t.map[o];if(!c.has(l)){if(c.add(l),i>0&&l==t.map[o-t.width]){let t=n.nodeAt(l).attrs;e.setNodeMarkup(e.mapping.slice(s).map(l+r),null,{...t,rowspan:t.rowspan-1}),a+=t.colspan-1}else if(i<t.height&&l==t.map[o+t.width]){let o=n.nodeAt(l),c=o.attrs,u=o.type.create({...c,rowspan:o.attrs.rowspan-1},o.content),d=t.positionAt(i+1,a,n);e.insert(e.mapping.slice(s).map(r+d),u),a+=c.colspan-1}}}}function Vx(e,t){if(!ux(e))return!1;if(t){let n=Ax(e),r=e.tr;if(n.top==0&&n.bottom==n.map.height)return!1;for(let e=n.bottom-1;Bx(r,n,e),e!=n.top;e--){let e=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!e)throw RangeError(`No table found`);n.table=e,n.map=tx.get(n.table)}t(r)}return!0}function Hx(e){let t=e.content;return t.childCount==1&&t.child(0).isTextblock&&t.child(0).childCount==0}function Ux({width:e,height:t,map:n},r){let i=r.top*e+r.left,a=i,o=(r.bottom-1)*e+r.left,s=i+(r.right-r.left-1);for(let t=r.top;t<r.bottom;t++){if(r.left>0&&n[a]==n[a-1]||r.right<e&&n[s]==n[s+1])return!0;a+=e,s+=e}for(let a=r.left;a<r.right;a++){if(r.top>0&&n[i]==n[i-e]||r.bottom<t&&n[o]==n[o+e])return!0;i++,o++}return!1}function Wx(e,t){let n=e.selection;if(!(n instanceof bx)||n.$anchorCell.pos==n.$headCell.pos)return!1;let r=Ax(e),{map:i}=r;if(Ux(i,r))return!1;if(t){let n=e.tr,a={},o=E.empty,s,c;for(let e=r.top;e<r.bottom;e++)for(let t=r.left;t<r.right;t++){let l=i.map[e*i.width+t],u=r.table.nodeAt(l);if(!(a[l]||!u))if(a[l]=!0,s==null)s=l,c=u;else{Hx(u)||(o=o.append(u.content));let e=n.mapping.map(l+r.tableStart);n.delete(e,e+u.nodeSize)}}if(s==null||c==null)return!0;if(n.setNodeMarkup(s+r.tableStart,null,{...vx(c.attrs,c.attrs.colspan,r.right-r.left-c.attrs.colspan),rowspan:r.bottom-r.top}),o.size>0){let e=s+1+c.content.size,t=Hx(c)?s+1:e;n.replaceWith(t+r.tableStart,e+r.tableStart,o)}n.setSelection(new bx(n.doc.resolve(s+r.tableStart))),t(n)}return!0}function Gx(e,t){let n=ox(e.schema);return Kx(({node:e})=>n[e.type.spec.tableRole])(e,t)}function Kx(e){return(t,n)=>{let r=t.selection,i,a;if(r instanceof bx){if(r.$anchorCell.pos!=r.$headCell.pos)return!1;i=r.$anchorCell.nodeAfter,a=r.$anchorCell.pos}else{if(i=lx(r.$from),!i)return!1;a=cx(r.$from)?.pos}if(i==null||a==null||i.attrs.colspan==1&&i.attrs.rowspan==1)return!1;if(n){let o=i.attrs,s=[],c=o.colwidth;o.rowspan>1&&(o={...o,rowspan:1}),o.colspan>1&&(o={...o,colspan:1});let l=Ax(t),u=t.tr;for(let e=0;e<l.right-l.left;e++)s.push(c?{...o,colwidth:c&&c[e]?[c[e]]:null}:o);let d;for(let t=l.top;t<l.bottom;t++){let n=l.map.positionAt(t,l.left,l.table);t==l.top&&(n+=i.nodeSize);for(let r=l.left,a=0;r<l.right;r++,a++)r==l.left&&t==l.top||u.insert(d=u.mapping.map(n+l.tableStart,1),e({node:i,row:t,col:r}).createAndFill(s[a]))}u.setNodeMarkup(a,e({node:i,row:l.top,col:l.left}),s[0]),r instanceof bx&&u.setSelection(new bx(u.doc.resolve(r.$anchorCell.pos),d?u.doc.resolve(d):void 0)),n(u)}return!0}}function qx(e,t){return function(n,r){if(!ux(n))return!1;let i=dx(n);if(i.nodeAfter.attrs[e]===t)return!1;if(r){let a=n.tr;n.selection instanceof bx?n.selection.forEachCell((n,r)=>{n.attrs[e]!==t&&a.setNodeMarkup(r,null,{...n.attrs,[e]:t})}):a.setNodeMarkup(i.pos,null,{...i.nodeAfter.attrs,[e]:t}),r(a)}return!0}}function Jx(e){return function(t,n){if(!ux(t))return!1;if(n){let r=ox(t.schema),i=Ax(t),a=t.tr,o=i.map.cellsInRect(e==`column`?{left:i.left,top:0,right:i.right,bottom:i.map.height}:e==`row`?{left:0,top:i.top,right:i.map.width,bottom:i.bottom}:i),s=o.map(e=>i.table.nodeAt(e));for(let e=0;e<o.length;e++)s[e].type==r.header_cell&&a.setNodeMarkup(i.tableStart+o[e],r.cell,s[e].attrs);if(a.steps.length===0)for(let e=0;e<o.length;e++)a.setNodeMarkup(i.tableStart+o[e],r.header_cell,s[e].attrs);n(a)}return!0}}function Yx(e,t,n){let r=t.map.cellsInRect({left:0,top:0,right:e==`row`?t.map.width:1,bottom:e==`column`?t.map.height:1});for(let e=0;e<r.length;e++){let i=t.table.nodeAt(r[e]);if(i&&i.type!==n.header_cell)return!1}return!0}function Xx(e,t){return t||={useDeprecatedLogic:!1},t.useDeprecatedLogic?Jx(e):function(t,n){if(!ux(t))return!1;if(n){let r=ox(t.schema),i=Ax(t),a=t.tr,o=Yx(`row`,i,r),s=Yx(`column`,i,r),c=(e===`column`?o:e===`row`&&s)?1:0,l=e==`column`?{left:0,top:c,right:1,bottom:i.map.height}:e==`row`?{left:c,top:0,right:i.map.width,bottom:1}:i,u=e==`column`?s?r.cell:r.header_cell:e==`row`?o?r.cell:r.header_cell:r.cell;i.map.cellsInRect(l).forEach(e=>{let t=e+i.tableStart,n=a.doc.nodeAt(t);n&&a.setNodeMarkup(t,u,n.attrs)}),n(a)}return!0}}Xx(`row`,{useDeprecatedLogic:!0}),Xx(`column`,{useDeprecatedLogic:!0});var Zx=Xx(`cell`,{useDeprecatedLogic:!0});function Qx(e,t){if(t<0){let t=e.nodeBefore;if(t)return e.pos-t.nodeSize;for(let t=e.index(-1)-1,n=e.before();t>=0;t--){let r=e.node(-1).child(t),i=r.lastChild;if(i)return n-1-i.nodeSize;n-=r.nodeSize}}else{if(e.index()<e.parent.childCount-1)return e.pos+e.nodeAfter.nodeSize;let t=e.node(-1);for(let n=e.indexAfter(-1),r=e.after();n<t.childCount;n++){let e=t.child(n);if(e.childCount)return r+1;r+=e.nodeSize}}return null}function $x(e){return function(t,n){if(!ux(t))return!1;let r=Qx(dx(t),e);if(r==null)return!1;if(n){let e=t.doc.resolve(r);n(t.tr.setSelection(P.between(e,mx(e))).scrollIntoView())}return!0}}function eS(e,t){let n=e.selection.$anchor;for(let r=n.depth;r>0;r--)if(n.node(r).type.spec.tableRole==`table`)return t&&t(e.tr.delete(n.before(r),n.after(r)).scrollIntoView()),!0;return!1}function tS(e,t){let n=e.selection;if(!(n instanceof bx))return!1;if(t){let r=e.tr,i=ox(e.schema).cell.createAndFill().content;n.forEachCell((e,t)=>{e.content.eq(i)||r.replace(r.mapping.map(t+1),r.mapping.map(t+e.nodeSize-1),new A(i,0,0))}),r.docChanged&&t(r)}return!0}function nS(e){if(e.size===0)return null;let{content:t,openStart:n,openEnd:r}=e;for(;t.childCount==1&&(n>0&&r>0||t.child(0).type.spec.tableRole==`table`);)n--,r--,t=t.child(0).content;let i=t.child(0),a=i.type.spec.tableRole,o=i.type.schema,s=[];if(a==`row`)for(let e=0;e<t.childCount;e++){let i=t.child(e).content,a=e?0:Math.max(0,n-1),c=e<t.childCount-1?0:Math.max(0,r-1);(a||c)&&(i=iS(ox(o).row,new A(i,a,c)).content),s.push(i)}else if(a==`cell`||a==`header_cell`)s.push(n||r?iS(ox(o).row,new A(t,n,r)).content:t);else return null;return rS(o,s)}function rS(e,t){let n=[];for(let e=0;e<t.length;e++){let r=t[e];for(let t=r.childCount-1;t>=0;t--){let{rowspan:i,colspan:a}=r.child(t).attrs;for(let t=e;t<e+i;t++)n[t]=(n[t]||0)+a}}let r=0;for(let e=0;e<n.length;e++)r=Math.max(r,n[e]);for(let i=0;i<n.length;i++)if(i>=t.length&&t.push(E.empty),n[i]<r){let a=ox(e).cell.createAndFill(),o=[];for(let e=n[i];e<r;e++)o.push(a);t[i]=t[i].append(E.from(o))}return{height:t.length,width:r,rows:t}}function iS(e,t){let n=e.createAndFill();return new Dn(n).replace(0,n.content.size,t).doc}function aS({width:e,height:t,rows:n},r,i){if(e!=r){let t=[],i=[];for(let e=0;e<n.length;e++){let a=n[e],o=[];for(let n=t[e]||0,i=0;n<r;i++){let s=a.child(i%a.childCount);n+s.attrs.colspan>r&&(s=s.type.createChecked(_x(s.attrs,s.attrs.colspan,n+s.attrs.colspan-r),s.content)),o.push(s),n+=s.attrs.colspan;for(let n=1;n<s.attrs.rowspan;n++)t[e+n]=(t[e+n]||0)+s.attrs.colspan}i.push(E.from(o))}n=i,e=r}if(t!=i){let e=[];for(let r=0,a=0;r<i;r++,a++){let o=[],s=n[a%t];for(let e=0;e<s.childCount;e++){let t=s.child(e);r+t.attrs.rowspan>i&&(t=t.type.create({...t.attrs,rowspan:Math.max(1,i-t.attrs.rowspan)},t.content)),o.push(t)}e.push(E.from(o))}n=e,t=i}return{width:e,height:t,rows:n}}function oS(e,t,n,r,i,a,o){let s=e.doc.type.schema,c=ox(s),l,u;if(i>t.width)for(let a=0,s=0;a<t.height;a++){let d=n.child(a);s+=d.nodeSize;let f=[],p;p=d.lastChild==null||d.lastChild.type==c.cell?l||=c.cell.createAndFill():u||=c.header_cell.createAndFill();for(let e=t.width;e<i;e++)f.push(p);e.insert(e.mapping.slice(o).map(s-1+r),f)}if(a>t.height){let s=[];for(let e=0,r=(t.height-1)*t.width;e<Math.max(t.width,i);e++){let i=e>=t.width?!1:n.nodeAt(t.map[r+e]).type==c.header_cell;s.push(i?u||=c.header_cell.createAndFill():l||=c.cell.createAndFill())}let d=c.row.create(null,E.from(s)),f=[];for(let e=t.height;e<a;e++)f.push(d);e.insert(e.mapping.slice(o).map(r+n.nodeSize-2),f)}return!!(l||u)}function sS(e,t,n,r,i,a,o,s){if(o==0||o==t.height)return!1;let c=!1;for(let l=i;l<a;l++){let i=o*t.width+l,a=t.map[i];if(t.map[i-t.width]==a){c=!0;let i=n.nodeAt(a),{top:u,left:d}=t.findCell(a);e.setNodeMarkup(e.mapping.slice(s).map(a+r),null,{...i.attrs,rowspan:o-u}),e.insert(e.mapping.slice(s).map(t.positionAt(o,d,n)),i.type.createAndFill({...i.attrs,rowspan:u+i.attrs.rowspan-o})),l+=i.attrs.colspan-1}}return c}function cS(e,t,n,r,i,a,o,s){if(o==0||o==t.width)return!1;let c=!1;for(let l=i;l<a;l++){let i=l*t.width+o,a=t.map[i];if(t.map[i-1]==a){c=!0;let i=n.nodeAt(a),u=t.colCount(a),d=e.mapping.slice(s).map(a+r);e.setNodeMarkup(d,null,_x(i.attrs,o-u,i.attrs.colspan-(o-u))),e.insert(d+i.nodeSize,i.type.createAndFill(_x(i.attrs,0,o-u))),l+=i.attrs.rowspan-1}}return c}function lS(e,t,n,r,i){let a=n?e.doc.nodeAt(n-1):e.doc;if(!a)throw Error(`No table found`);let o=tx.get(a),{top:s,left:c}=r,l=c+i.width,u=s+i.height,d=e.tr,f=0;function p(){if(a=n?d.doc.nodeAt(n-1):d.doc,!a)throw Error(`No table found`);o=tx.get(a),f=d.mapping.maps.length}oS(d,o,a,n,l,u,f)&&p(),sS(d,o,a,n,c,l,s,f)&&p(),sS(d,o,a,n,c,l,u,f)&&p(),cS(d,o,a,n,s,u,c,f)&&p(),cS(d,o,a,n,s,u,l,f)&&p();for(let e=s;e<u;e++){let t=o.positionAt(e,c,a),r=o.positionAt(e,l,a);d.replace(d.mapping.slice(f).map(t+n),d.mapping.slice(f).map(r+n),new A(i.rows[e-s],0,0))}p(),d.setSelection(new bx(d.doc.resolve(n+o.positionAt(s,c,a)),d.doc.resolve(n+o.positionAt(u-1,l-1,a)))),t(d)}var uS=wc({ArrowLeft:fS(`horiz`,-1),ArrowRight:fS(`horiz`,1),ArrowUp:fS(`vert`,-1),ArrowDown:fS(`vert`,1),"Shift-ArrowLeft":pS(`horiz`,-1),"Shift-ArrowRight":pS(`horiz`,1),"Shift-ArrowUp":pS(`vert`,-1),"Shift-ArrowDown":pS(`vert`,1),Backspace:tS,"Mod-Backspace":tS,Delete:tS,"Mod-Delete":tS});function dS(e,t,n){return n.eq(e.selection)?!1:(t&&t(e.tr.setSelection(n).scrollIntoView()),!0)}function fS(e,t){return(n,r,i)=>{if(!i)return!1;let a=n.selection;if(a instanceof bx)return dS(n,r,N.near(a.$headCell,t));if(e!=`horiz`&&!a.empty)return!1;let o=_S(i,e,t);if(o==null)return!1;if(e==`horiz`)return dS(n,r,N.near(n.doc.resolve(a.head+t),t));{let i=n.doc.resolve(o),a=gx(i,e,t),s;return s=a?N.near(a,1):t<0?N.near(n.doc.resolve(i.before(-1)),-1):N.near(n.doc.resolve(i.after(-1)),1),dS(n,r,s)}}}function pS(e,t){return(n,r,i)=>{if(!i)return!1;let a=n.selection,o;if(a instanceof bx)o=a;else{let r=_S(i,e,t);if(r==null)return!1;o=new bx(n.doc.resolve(r))}let s=gx(o.$headCell,e,t);return s?dS(n,r,new bx(o.$anchorCell,s)):!1}}function mS(e,t){let n=e.state.doc,r=cx(n.resolve(t));return r?(e.dispatch(e.state.tr.setSelection(new bx(r))),!0):!1}function hS(e,t,n){if(!ux(e.state))return!1;let r=nS(n),i=e.state.selection;if(i instanceof bx){r||={width:1,height:1,rows:[E.from(iS(ox(e.state.schema).cell,n))]};let t=i.$anchorCell.node(-1),a=i.$anchorCell.start(-1),o=tx.get(t).rectBetween(i.$anchorCell.pos-a,i.$headCell.pos-a);return r=aS(r,o.right-o.left,o.bottom-o.top),lS(e.state,e.dispatch,a,o,r),!0}else if(r){let t=dx(e.state),n=t.start(-1);return lS(e.state,e.dispatch,n,tx.get(t.node(-1)).findCell(t.pos-n),r),!0}else return!1}function gS(e,t){if(t.button!=0||t.ctrlKey||t.metaKey)return;let n=vS(e,t.target),r;if(t.shiftKey&&e.state.selection instanceof bx)i(e.state.selection.$anchorCell,t),t.preventDefault();else if(t.shiftKey&&n&&(r=cx(e.state.selection.$anchor))!=null&&yS(e,t)?.pos!=r.pos)i(r,t),t.preventDefault();else if(!n)return;function i(t,n){let r=yS(e,n),i=sx.getState(e.state)==null;if(!r||!hx(t,r))if(i)r=t;else return;let a=new bx(t,r);if(i||!e.state.selection.eq(a)){let n=e.state.tr.setSelection(a);i&&n.setMeta(sx,t.pos),e.dispatch(n)}}function a(){e.root.removeEventListener(`mouseup`,a),e.root.removeEventListener(`dragstart`,a),e.root.removeEventListener(`mousemove`,o),sx.getState(e.state)!=null&&e.dispatch(e.state.tr.setMeta(sx,-1))}function o(r){let o=r,s=sx.getState(e.state),c;if(s!=null)c=e.state.doc.resolve(s);else if(vS(e,o.target)!=n&&(c=yS(e,t),!c))return a();c&&i(c,o)}e.root.addEventListener(`mouseup`,a),e.root.addEventListener(`dragstart`,a),e.root.addEventListener(`mousemove`,o)}function _S(e,t,n){if(!(e.state.selection instanceof P))return null;let{$head:r}=e.state.selection;for(let i=r.depth-1;i>=0;i--){let a=r.node(i);if((n<0?r.index(i):r.indexAfter(i))!=(n<0?0:a.childCount))return null;if(a.type.spec.tableRole==`cell`||a.type.spec.tableRole==`header_cell`){let a=r.before(i),o=t==`vert`?n>0?`down`:`up`:n>0?`right`:`left`;return e.endOfTextblock(o)?a:null}}return null}function vS(e,t){for(;t&&t!=e.dom;t=t.parentNode)if(t.nodeName==`TD`||t.nodeName==`TH`)return t;return null}function yS(e,t){let n=e.posAtCoords({left:t.clientX,top:t.clientY});if(!n)return null;let{inside:r,pos:i}=n;return r>=0&&cx(e.state.doc.resolve(r))||cx(e.state.doc.resolve(i))}var bS=class{constructor(e,t){this.node=e,this.defaultCellMinWidth=t,this.dom=document.createElement(`div`),this.dom.className=`tableWrapper`,this.table=this.dom.appendChild(document.createElement(`table`)),this.table.style.setProperty(`--default-cell-min-width`,`${t}px`),this.colgroup=this.table.appendChild(document.createElement(`colgroup`)),xS(e,this.colgroup,this.table,t),this.contentDOM=this.table.appendChild(document.createElement(`tbody`))}update(e){return e.type==this.node.type?(this.node=e,xS(e,this.colgroup,this.table,this.defaultCellMinWidth),!0):!1}ignoreMutation(e){return e.type==`attributes`&&(e.target==this.table||this.colgroup.contains(e.target))}};function xS(e,t,n,r,i,a){let o=0,s=!0,c=t.firstChild,l=e.firstChild;if(l){for(let e=0,n=0;e<l.childCount;e++){let{colspan:u,colwidth:d}=l.child(e).attrs;for(let e=0;e<u;e++,n++){let l=i==n?a:d&&d[e],u=l?l+`px`:``;if(o+=l||r,l||(s=!1),c)c.style.width!=u&&(c.style.width=u),c=c.nextSibling;else{let e=document.createElement(`col`);e.style.width=u,t.appendChild(e)}}}for(;c;){var u;let e=c.nextSibling;(u=c.parentNode)==null||u.removeChild(c),c=e}s?(n.style.width=o+`px`,n.style.minWidth=``):(n.style.width=``,n.style.minWidth=o+`px`)}}var SS=new Zn(`tableColumnResizing`);function CS({handleWidth:e=5,cellMinWidth:t=25,defaultCellMinWidth:n=100,View:r=bS,lastColumnResizable:i=!0}={}){let a=new Jn({key:SS,state:{init(e,t){var i;let o=(i=a.spec)==null||(i=i.props)==null?void 0:i.nodeViews,s=ox(t.schema).table.name;return r&&o&&(o[s]=(e,t)=>new r(e,n,t)),new wS(-1,!1)},apply(e,t){return t.apply(e)}},props:{attributes:e=>{let t=SS.getState(e);return t&&t.activeHandle>-1?{class:`resize-cursor`}:{}},handleDOMEvents:{mousemove:(t,n)=>{TS(t,n,e,i)},mouseleave:e=>{ES(e)},mousedown:(e,r)=>{DS(e,r,t,n)}},decorations:e=>{let t=SS.getState(e);if(t&&t.activeHandle>-1)return IS(e,t.activeHandle)},nodeViews:{}}});return a}var wS=class e{constructor(e,t){this.activeHandle=e,this.dragging=t}apply(t){let n=this,r=t.getMeta(SS);if(r&&r.setHandle!=null)return new e(r.setHandle,!1);if(r&&r.setDragging!==void 0)return new e(n.activeHandle,r.setDragging);if(n.activeHandle>-1&&t.docChanged){let r=t.mapping.map(n.activeHandle,-1);return px(t.doc.resolve(r))||(r=-1),new e(r,n.dragging)}return n}};function TS(e,t,n,r){if(!e.editable)return;let i=SS.getState(e.state);if(i&&!i.dragging){let a=kS(t.target),o=-1;if(a){let{left:r,right:i}=a.getBoundingClientRect();t.clientX-r<=n?o=AS(e,t,`left`,n):i-t.clientX<=n&&(o=AS(e,t,`right`,n))}if(o!=i.activeHandle){if(!r&&o!==-1){let t=e.state.doc.resolve(o),n=t.node(-1),r=tx.get(n),i=t.start(-1);if(r.colCount(t.pos-i)+t.nodeAfter.attrs.colspan-1==r.width-1)return}MS(e,o)}}}function ES(e){if(!e.editable)return;let t=SS.getState(e.state);t&&t.activeHandle>-1&&!t.dragging&&MS(e,-1)}function DS(e,t,n,r){if(!e.editable)return!1;let i=e.dom.ownerDocument.defaultView??window,a=SS.getState(e.state);if(!a||a.activeHandle==-1||a.dragging)return!1;let o=e.state.doc.nodeAt(a.activeHandle),s=OS(e,a.activeHandle,o.attrs);e.dispatch(e.state.tr.setMeta(SS,{setDragging:{startX:t.clientX,startWidth:s}}));function c(t){i.removeEventListener(`mouseup`,c),i.removeEventListener(`mousemove`,l);let r=SS.getState(e.state);r?.dragging&&(NS(e,r.activeHandle,jS(r.dragging,t,n)),e.dispatch(e.state.tr.setMeta(SS,{setDragging:null})))}function l(t){if(!t.which)return c(t);let i=SS.getState(e.state);if(i&&i.dragging){let a=jS(i.dragging,t,n);PS(e,i.activeHandle,a,r)}}return PS(e,a.activeHandle,s,r),i.addEventListener(`mouseup`,c),i.addEventListener(`mousemove`,l),t.preventDefault(),!0}function OS(e,t,{colspan:n,colwidth:r}){let i=r&&r[r.length-1];if(i)return i;let a=e.domAtPos(t),o=a.node.childNodes[a.offset].offsetWidth,s=n;if(r)for(let e=0;e<n;e++)r[e]&&(o-=r[e],s--);return o/s}function kS(e){for(;e&&e.nodeName!=`TD`&&e.nodeName!=`TH`;)e=e.classList&&e.classList.contains(`ProseMirror`)?null:e.parentNode;return e}function AS(e,t,n,r){let i=n==`right`?-r:r,a=e.posAtCoords({left:t.clientX+i,top:t.clientY});if(!a)return-1;let{pos:o}=a,s=cx(e.state.doc.resolve(o));if(!s)return-1;if(n==`right`)return s.pos;let c=tx.get(s.node(-1)),l=s.start(-1),u=c.map.indexOf(s.pos-l);return u%c.width==0?-1:l+c.map[u-1]}function jS(e,t,n){let r=t.clientX-e.startX;return Math.max(n,e.startWidth+r)}function MS(e,t){e.dispatch(e.state.tr.setMeta(SS,{setHandle:t}))}function NS(e,t,n){let r=e.state.doc.resolve(t),i=r.node(-1),a=tx.get(i),o=r.start(-1),s=a.colCount(r.pos-o)+r.nodeAfter.attrs.colspan-1,c=e.state.tr;for(let e=0;e<a.height;e++){let t=e*a.width+s;if(e&&a.map[t]==a.map[t-a.width])continue;let r=a.map[t],l=i.nodeAt(r).attrs,u=l.colspan==1?0:s-a.colCount(r);if(l.colwidth&&l.colwidth[u]==n)continue;let d=l.colwidth?l.colwidth.slice():FS(l.colspan);d[u]=n,c.setNodeMarkup(o+r,null,{...l,colwidth:d})}c.docChanged&&e.dispatch(c)}function PS(e,t,n,r){let i=e.state.doc.resolve(t),a=i.node(-1),o=i.start(-1),s=tx.get(a).colCount(i.pos-o)+i.nodeAfter.attrs.colspan-1,c=e.domAtPos(i.start(-1)).node;for(;c&&c.nodeName!=`TABLE`;)c=c.parentNode;c&&xS(a,c.firstChild,c,r,s,n)}function FS(e){return Array(e).fill(0)}function IS(e,t){let n=[],r=e.doc.resolve(t),i=r.node(-1);if(!i)return ws.empty;let a=tx.get(i),o=r.start(-1),s=a.colCount(r.pos-o)+r.nodeAfter.attrs.colspan-1;for(let t=0;t<a.height;t++){let r=s+t*a.width;if((s==a.width-1||a.map[r]!=a.map[r+1])&&(t==0||a.map[r]!=a.map[r-a.width])){let t=a.map[r],s=o+t+i.nodeAt(t).nodeSize-1,c=document.createElement(`div`);c.className=`column-resize-handle`,SS.getState(e)?.dragging&&n.push(xs.node(o+t,o+t+i.nodeAt(t).nodeSize,{class:`column-resize-dragging`})),n.push(xs.widget(s,c))}}return ws.create(e.doc,n)}function LS({allowTableNodeSelection:e=!1}={}){return new Jn({key:sx,state:{init(){return null},apply(e,t){let n=e.getMeta(sx);if(n!=null)return n==-1?null:n;if(t==null||!e.docChanged)return t;let{deleted:r,pos:i}=e.mapping.mapResult(t);return r?null:i}},props:{decorations:Sx,handleDOMEvents:{mousedown:gS},createSelectionBetween(e){return sx.getState(e.state)==null?null:e.state.selection},handleTripleClick:mS,handleKeyDown:uS,handlePaste:hS},appendTransaction(t,n,r){return Tx(r,Ox(r,n),e)}})}function RS(e){return e===`left`||e===`right`||e===`center`?e:null}function zS(e){let t=(e.style.textAlign||``).trim().toLowerCase(),n=(e.getAttribute(`align`)||``).trim().toLowerCase();return RS(t||n)}function BS(e){return RS(e?.align)}function VS(){return{default:null,parseHTML:e=>zS(e),renderHTML:e=>e.align?{style:`text-align: ${e.align}`}:{}}}var HS=rf.create({name:`tableCell`,addOptions(){return{HTMLAttributes:{}}},content:`block+`,addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:e=>{let t=e.getAttribute(`colwidth`),n=t?t.split(`,`).map(e=>parseInt(e,10)):null;if(!n){let t=e.closest(`table`)?.querySelectorAll(`colgroup > col`),n=Array.from(e.parentElement?.children||[]).indexOf(e);if(n&&n>-1&&t&&t[n]){let e=t[n].getAttribute(`width`);return e?[parseInt(e,10)]:null}}return n}},align:VS()}},tableRole:`cell`,isolating:!0,parseHTML(){return[{tag:`td`}]},renderHTML({HTMLAttributes:e}){return[`td`,G(this.options.HTMLAttributes,e),0]}}),US=rf.create({name:`tableHeader`,addOptions(){return{HTMLAttributes:{}}},content:`block+`,addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:e=>{let t=e.getAttribute(`colwidth`);return t?t.split(`,`).map(e=>parseInt(e,10)):null}},align:VS()}},tableRole:`header_cell`,isolating:!0,parseHTML(){return[{tag:`th`}]},renderHTML({HTMLAttributes:e}){return[`th`,G(this.options.HTMLAttributes,e),0]}}),WS=rf.create({name:`tableRow`,addOptions(){return{HTMLAttributes:{}}},content:`(tableCell | tableHeader)*`,tableRole:`row`,parseHTML(){return[{tag:`tr`}]},renderHTML({HTMLAttributes:e}){return[`tr`,G(this.options.HTMLAttributes,e),0]}});function GS(e,t){return t?[`width`,`${Math.max(t,e)}px`]:[`min-width`,`${e}px`]}function KS(e,t,n,r,i,a){var o;let s=0,c=!0,l=t.firstChild,u=e.firstChild;if(u!==null)for(let e=0,n=0;e<u.childCount;e+=1){let{colspan:o,colwidth:d}=u.child(e).attrs;for(let e=0;e<o;e+=1,n+=1){let o=i===n?a:d&&d[e],u=o?`${o}px`:``;if(s+=o||r,o||(c=!1),l){if(l.style.width!==u){let[e,t]=GS(r,o);l.style.setProperty(e,t)}l=l.nextSibling}else{let e=document.createElement(`col`),[n,i]=GS(r,o);e.style.setProperty(n,i),t.appendChild(e)}}}for(;l;){let e=l.nextSibling;(o=l.parentNode)==null||o.removeChild(l),l=e}let d=e.attrs.style&&typeof e.attrs.style==`string`&&/\bwidth\s*:/i.test(e.attrs.style);c&&!d?(n.style.width=`${s}px`,n.style.minWidth=``):(n.style.width=``,n.style.minWidth=`${s}px`)}var qS=class{constructor(e,t,n,r={}){this.node=e,this.cellMinWidth=t,this.dom=document.createElement(`div`),this.dom.className=`tableWrapper`,this.table=this.dom.appendChild(document.createElement(`table`));for(let[e,t]of Object.entries(r))t!=null&&(e===`style`?this.table.style.cssText=String(t):this.table.setAttribute(e,String(t)));e.attrs.style&&(this.table.style.cssText=e.attrs.style),this.colgroup=this.table.appendChild(document.createElement(`colgroup`)),KS(e,this.colgroup,this.table,t),this.contentDOM=this.table.appendChild(document.createElement(`tbody`))}update(e){return e.type===this.node.type?(this.node=e,KS(e,this.colgroup,this.table,this.cellMinWidth),!0):!1}ignoreMutation(e){let t=e.target,n=this.dom.contains(t),r=this.contentDOM.contains(t);return!!(n&&!r&&(e.type===`attributes`||e.type===`childList`||e.type===`characterData`))}};function JS(e,t,n,r){let i=0,a=!0,o=[],s=e.firstChild;if(!s)return{};for(let e=0,c=0;e<s.childCount;e+=1){let{colspan:l,colwidth:u}=s.child(e).attrs;for(let e=0;e<l;e+=1,c+=1){let s=n===c?r:u&&u[e];i+=s||t,s||(a=!1);let[l,d]=GS(t,s);o.push([`col`,{style:`${l}: ${d}`}])}}let c=a?`${i}px`:``,l=a?``:`${i}px`;return{colgroup:[`colgroup`,{},...o],tableWidth:c,tableMinWidth:l}}function YS(e,t){return t?e.createChecked(null,t):e.createAndFill()}function XS(e){if(e.cached.tableNodeTypes)return e.cached.tableNodeTypes;let t={};return Object.keys(e.nodes).forEach(n=>{let r=e.nodes[n];r.spec.tableRole&&(t[r.spec.tableRole]=r)}),e.cached.tableNodeTypes=t,t}function ZS(e,t,n,r,i){let a=XS(e),o=[],s=[];for(let e=0;e<n;e+=1){let e=YS(a.cell,i);if(e&&s.push(e),r){let e=YS(a.header_cell,i);e&&o.push(e)}}let c=[];for(let e=0;e<t;e+=1)c.push(a.row.createChecked(null,r&&e===0?o:s));return a.table.createChecked(null,c)}function QS(e){return e instanceof bx}var $S=({editor:e})=>{let{selection:t}=e.state;if(!QS(t))return!1;let n=0;return z(t.ranges[0].$from,e=>e.type.name===`table`)?.node.descendants(e=>{if(e.type.name===`table`)return!1;[`tableCell`,`tableHeader`].includes(e.type.name)&&(n+=1)}),n===t.ranges.length?(e.commands.deleteTable(),!0):!1};function eC(e){return(e||``).replace(/\s+/g,` `).trim()}function tC(e,t,n={}){let r=n.cellLineSeparator??``;if(!e||!e.content||e.content.length===0)return``;let i=[];e.content.forEach(e=>{let n=[];e.content&&e.content.forEach(e=>{let i=``;i=e.content&&Array.isArray(e.content)&&e.content.length>1?e.content.map(e=>t.renderChildren(e)).join(r):e.content?t.renderChildren(e.content):``;let a=eC(i),o=e.type===`tableHeader`,s=BS(e.attrs);n.push({text:a,isHeader:o,align:s})}),i.push(n)});let a=i.reduce((e,t)=>Math.max(e,t.length),0);if(a===0)return``;let o=Array.from({length:a}).fill(0);i.forEach(e=>{for(let t=0;t<a;t+=1){let n=(e[t]?.text||``).length;n>o[t]&&(o[t]=n),o[t]<3&&(o[t]=3)}});let s=(e,t)=>e+` `.repeat(Math.max(0,t-e.length)),c=i[0],l=c.some(e=>e.isHeader),u=Array.from({length:a}).fill(null);i.forEach(e=>{for(let t=0;t<a;t+=1)!u[t]&&e[t]?.align&&(u[t]=e[t].align)});let d=`
|
|
179
|
+
`,f=Array.from({length:a}).map((e,t)=>l&&c[t]&&c[t].text||``);return d+=`| ${f.map((e,t)=>s(e,o[t])).join(` | `)} |
|
|
180
|
+
`,d+=`| ${o.map((e,t)=>{let n=Math.max(3,e),r=u[t];return r===`left`?`:${`-`.repeat(n)}`:r===`right`?`${`-`.repeat(n)}:`:r===`center`?`:${`-`.repeat(n)}:`:`-`.repeat(n)}).join(` | `)} |
|
|
181
|
+
`,(l?i.slice(1):i).forEach(e=>{d+=`| ${Array.from({length:a}).fill(0).map((t,n)=>s(e[n]&&e[n].text||``,o[n])).join(` | `)} |
|
|
182
|
+
`}),d}var nC=tC,rC=rf.create({name:`table`,addOptions(){return{HTMLAttributes:{},resizable:!1,renderWrapper:!1,handleWidth:5,cellMinWidth:25,View:qS,lastColumnResizable:!0,allowTableNodeSelection:!1}},content:`tableRow+`,tableRole:`table`,isolating:!0,group:`block`,parseHTML(){return[{tag:`table`}]},renderHTML({node:e,HTMLAttributes:t}){let{colgroup:n,tableWidth:r,tableMinWidth:i}=JS(e,this.options.cellMinWidth),a=t.style;function o(){return a||(r?`width: ${r}`:`min-width: ${i}`)}let s=[`table`,G(this.options.HTMLAttributes,t,{style:o()}),n,[`tbody`,0]];return this.options.renderWrapper?[`div`,{class:`tableWrapper`},s]:s},parseMarkdown:(e,t)=>{let n=[],r=Array.isArray(e.align)?e.align:[];if(e.header){let i=[];e.header.forEach((e,n)=>{let a=RS(r[n]??e.align),o=a?{align:a}:{};i.push(t.createNode(`tableHeader`,o,[{type:`paragraph`,content:t.parseInline(e.tokens)}]))}),n.push(t.createNode(`tableRow`,{},i))}return e.rows&&e.rows.forEach(e=>{let i=[];e.forEach((e,n)=>{let a=RS(r[n]??e.align),o=a?{align:a}:{};i.push(t.createNode(`tableCell`,o,[{type:`paragraph`,content:t.parseInline(e.tokens)}]))}),n.push(t.createNode(`tableRow`,{},i))}),t.createNode(`table`,void 0,n)},renderMarkdown:(e,t)=>nC(e,t),addCommands(){return{insertTable:({rows:e=3,cols:t=3,withHeaderRow:n=!0}={})=>({tr:r,dispatch:i,editor:a})=>{let o=ZS(a.schema,e,t,n);if(i){let e=r.selection.from+1;r.replaceSelectionWith(o).scrollIntoView().setSelection(P.near(r.doc.resolve(e)))}return!0},addColumnBefore:()=>({state:e,dispatch:t})=>Mx(e,t),addColumnAfter:()=>({state:e,dispatch:t})=>Nx(e,t),deleteColumn:()=>({state:e,dispatch:t})=>Fx(e,t),addRowBefore:()=>({state:e,dispatch:t})=>Rx(e,t),addRowAfter:()=>({state:e,dispatch:t})=>zx(e,t),deleteRow:()=>({state:e,dispatch:t})=>Vx(e,t),deleteTable:()=>({state:e,dispatch:t})=>eS(e,t),mergeCells:()=>({state:e,dispatch:t})=>Wx(e,t),splitCell:()=>({state:e,dispatch:t})=>Gx(e,t),toggleHeaderColumn:()=>({state:e,dispatch:t})=>Xx(`column`)(e,t),toggleHeaderRow:()=>({state:e,dispatch:t})=>Xx(`row`)(e,t),toggleHeaderCell:()=>({state:e,dispatch:t})=>Zx(e,t),mergeOrSplit:()=>({state:e,dispatch:t})=>Wx(e,t)?!0:Gx(e,t),setCellAttribute:(e,t)=>({state:n,dispatch:r})=>qx(e,t)(n,r),goToNextCell:()=>({state:e,dispatch:t})=>$x(1)(e,t),goToPreviousCell:()=>({state:e,dispatch:t})=>$x(-1)(e,t),fixTables:()=>({state:e,dispatch:t})=>(t&&Ox(e),!0),setCellSelection:e=>({tr:t,dispatch:n})=>{if(n){let n=bx.create(t.doc,e.anchorCell,e.headCell);t.setSelection(n)}return!0}}},addKeyboardShortcuts(){return{Tab:()=>this.editor.commands.goToNextCell()?!0:this.editor.can().addRowAfter()?this.editor.chain().addRowAfter().goToNextCell().run():!1,"Shift-Tab":()=>this.editor.commands.goToPreviousCell(),Backspace:$S,"Mod-Backspace":$S,Delete:$S,"Mod-Delete":$S}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[CS({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,defaultCellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[],LS({allowTableNodeSelection:this.options.allowTableNodeSelection})]},addNodeView(){let e=this.options.resizable&&this.editor.isEditable,t=this.options.View;return e||!t?null:({node:e,view:n,HTMLAttributes:r})=>{let i=G(this.options.HTMLAttributes,r);return new t(e,this.options.cellMinWidth,n,i)}},extendNodeSchema(e){return{tableRole:W(V(e,`tableRole`,{name:e.name,options:e.options,storage:e.storage}))}}}),iC=q.create({name:`tableKit`,addExtensions(){let e=[];return this.options.table!==!1&&e.push(rC.configure(this.options.table)),this.options.tableCell!==!1&&e.push(HS.configure(this.options.tableCell)),this.options.tableHeader!==!1&&e.push(US.configure(this.options.tableHeader)),this.options.tableRow!==!1&&e.push(WS.configure(this.options.tableRow)),e}}),aC=20,oC=(e,t=0)=>{let n=[];return!e.children.length||t>aC||Array.from(e.children).forEach(e=>{e.tagName===`SPAN`?n.push(e):e.children.length&&n.push(...oC(e,t+1))}),n},sC=e=>{if(!e.children.length)return;let t=oC(e);t&&t.forEach(e=>{let t=e.getAttribute(`style`),n=(e.parentElement?.closest(`span`))?.getAttribute(`style`);e.setAttribute(`style`,`${n};${t}`)})},cC=Od.create({name:`textStyle`,priority:101,addOptions(){return{HTMLAttributes:{},mergeNestedSpanStyles:!0}},parseHTML(){return[{tag:`span`,consuming:!1,getAttrs:e=>e.hasAttribute(`style`)?(this.options.mergeNestedSpanStyles&&sC(e),{}):!1}]},renderHTML({HTMLAttributes:e}){return[`span`,G(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleTextStyle:e=>({commands:t})=>t.toggleMark(this.name,e),removeEmptyTextStyle:()=>({tr:e})=>{let{selection:t}=e;return e.doc.nodesBetween(t.from,t.to,(t,n)=>{if(t.isTextblock)return!0;t.marks.filter(e=>e.type===this.type).some(e=>Object.values(e.attrs).some(e=>!!e))||e.removeMark(n,n+t.nodeSize,this.type)}),!0}}}}),lC=q.create({name:`backgroundColor`,addOptions(){return{types:[`textStyle`]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{backgroundColor:{default:null,parseHTML:e=>(ld(e,`background-color`)??e.style.backgroundColor)?.replace(/['"]+/g,``),renderHTML:e=>e.backgroundColor?{style:`background-color: ${e.backgroundColor}`}:{}}}}]},addCommands(){return{setBackgroundColor:e=>({chain:t})=>t().setMark(`textStyle`,{backgroundColor:e}).run(),unsetBackgroundColor:()=>({chain:e})=>e().setMark(`textStyle`,{backgroundColor:null}).removeEmptyTextStyle().run()}}}),uC=q.create({name:`color`,addOptions(){return{types:[`textStyle`]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{color:{default:null,parseHTML:e=>(ld(e,`color`)??e.style.color)?.replace(/['"]+/g,``),renderHTML:e=>e.color?{style:`color: ${e.color}`}:{}}}}]},addCommands(){return{setColor:e=>({chain:t})=>t().setMark(`textStyle`,{color:e}).run(),unsetColor:()=>({chain:e})=>e().setMark(`textStyle`,{color:null}).removeEmptyTextStyle().run()}}}),dC=q.create({name:`fontFamily`,addOptions(){return{types:[`textStyle`]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{fontFamily:{default:null,parseHTML:e=>ld(e,`font-family`)??e.style.fontFamily,renderHTML:e=>e.fontFamily?{style:`font-family: ${e.fontFamily}`}:{}}}}]},addCommands(){return{setFontFamily:e=>({chain:t})=>t().setMark(`textStyle`,{fontFamily:e}).run(),unsetFontFamily:()=>({chain:e})=>e().setMark(`textStyle`,{fontFamily:null}).removeEmptyTextStyle().run()}}}),fC=q.create({name:`fontSize`,addOptions(){return{types:[`textStyle`]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{fontSize:{default:null,parseHTML:e=>ld(e,`font-size`)??e.style.fontSize,renderHTML:e=>e.fontSize?{style:`font-size: ${e.fontSize}`}:{}}}}]},addCommands(){return{setFontSize:e=>({chain:t})=>t().setMark(`textStyle`,{fontSize:e}).run(),unsetFontSize:()=>({chain:e})=>e().setMark(`textStyle`,{fontSize:null}).removeEmptyTextStyle().run()}}}),pC=q.create({name:`lineHeight`,addOptions(){return{types:[`textStyle`]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{lineHeight:{default:null,parseHTML:e=>ld(e,`line-height`)??e.style.lineHeight,renderHTML:e=>e.lineHeight?{style:`line-height: ${e.lineHeight}`}:{}}}}]},addCommands(){return{setLineHeight:e=>({chain:t})=>t().setMark(`textStyle`,{lineHeight:e}).run(),unsetLineHeight:()=>({chain:e})=>e().setMark(`textStyle`,{lineHeight:null}).removeEmptyTextStyle().run()}}});q.create({name:`textStyleKit`,addExtensions(){let e=[];return this.options.backgroundColor!==!1&&e.push(lC.configure(this.options.backgroundColor)),this.options.color!==!1&&e.push(uC.configure(this.options.color)),this.options.fontFamily!==!1&&e.push(dC.configure(this.options.fontFamily)),this.options.fontSize!==!1&&e.push(fC.configure(this.options.fontSize)),this.options.lineHeight!==!1&&e.push(pC.configure(this.options.lineHeight)),this.options.textStyle!==!1&&e.push(cC.configure(this.options.textStyle)),e}});function mC(){return typeof window<`u`}function hC(e){return vC(e)?(e.nodeName||``).toLowerCase():`#document`}function gC(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function _C(e){return((vC(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function vC(e){return mC()?e instanceof Node||e instanceof gC(e).Node:!1}function yC(e){return mC()?e instanceof Element||e instanceof gC(e).Element:!1}function bC(e){return mC()?e instanceof HTMLElement||e instanceof gC(e).HTMLElement:!1}function xC(e){return!mC()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof gC(e).ShadowRoot}function SC(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=NC(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function CC(e){return/^(table|td|th)$/.test(hC(e))}function wC(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var TC=/transform|translate|scale|rotate|perspective|filter/,EC=/paint|layout|strict|content/,DC=e=>!!e&&e!==`none`,OC;function kC(e){let t=yC(e)?NC(e):e;return DC(t.transform)||DC(t.translate)||DC(t.scale)||DC(t.rotate)||DC(t.perspective)||!jC()&&(DC(t.backdropFilter)||DC(t.filter))||TC.test(t.willChange||``)||EC.test(t.contain||``)}function AC(e){let t=FC(e);for(;bC(t)&&!MC(t);){if(kC(t))return t;if(wC(t))return null;t=FC(t)}return null}function jC(){return OC??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),OC}function MC(e){return/^(html|body|#document)$/.test(hC(e))}function NC(e){return gC(e).getComputedStyle(e)}function PC(e){return yC(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function FC(e){if(hC(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||xC(e)&&e.host||_C(e);return xC(t)?t.host:t}function IC(e){let t=FC(e);return MC(t)?e.ownerDocument?e.ownerDocument.body:e.body:bC(t)&&SC(t)?t:IC(t)}function LC(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=IC(e),i=r===e.ownerDocument?.body,a=gC(r);if(i){let e=RC(a);return t.concat(a,a.visualViewport||[],SC(r)?r:[],e&&n?LC(e):[])}else return t.concat(r,LC(r,[],n))}function RC(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}var zC=[`top`,`right`,`bottom`,`left`],BC=Math.min,VC=Math.max,HC=Math.round,UC=Math.floor,WC=e=>({x:e,y:e}),GC={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function KC(e,t,n){return VC(e,BC(t,n))}function qC(e,t){return typeof e==`function`?e(t):e}function JC(e){return e.split(`-`)[0]}function YC(e){return e.split(`-`)[1]}function XC(e){return e===`x`?`y`:`x`}function ZC(e){return e===`y`?`height`:`width`}function QC(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function $C(e){return XC(QC(e))}function ew(e,t,n){n===void 0&&(n=!1);let r=YC(e),i=$C(e),a=ZC(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=lw(o)),[o,lw(o)]}function tw(e){let t=lw(e);return[nw(e),t,nw(t)]}function nw(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var rw=[`left`,`right`],iw=[`right`,`left`],aw=[`top`,`bottom`],ow=[`bottom`,`top`];function sw(e,t,n){switch(e){case`top`:case`bottom`:return n?t?iw:rw:t?rw:iw;case`left`:case`right`:return t?aw:ow;default:return[]}}function cw(e,t,n,r){let i=YC(e),a=sw(JC(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(nw)))),a}function lw(e){let t=JC(e);return GC[t]+e.slice(t.length)}function uw(e){return{top:0,right:0,bottom:0,left:0,...e}}function dw(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:uw(e)}function fw(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}var pw=[`input:not([inert]):not([inert] *)`,`select:not([inert]):not([inert] *)`,`textarea:not([inert]):not([inert] *)`,`a[href]:not([inert]):not([inert] *)`,`area[href]:not([inert]):not([inert] *)`,`button:not([inert]):not([inert] *)`,`[tabindex]:not(slot):not([inert]):not([inert] *)`,`audio[controls]:not([inert]):not([inert] *)`,`video[controls]:not([inert]):not([inert] *)`,`[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)`,`details>summary:first-of-type:not([inert]):not([inert] *)`,`details:not([inert]):not([inert] *)`].join(`,`),mw=typeof Element>`u`,hw=mw?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,gw=!mw&&Element.prototype.getRootNode?function(e){return e?.getRootNode?.call(e)}:function(e){return e?.ownerDocument},_w=function(e,t){t===void 0&&(t=!0);var n=e?.getAttribute?.call(e,`inert`);return n===``||n===`true`||t&&e&&(typeof e.closest==`function`?e.closest(`[inert]`):_w(e.parentNode))},vw=function(e){var t=e?.getAttribute?.call(e,`contenteditable`);return t===``||t===`true`},yw=function(e,t,n){if(_w(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(pw));return t&&hw.call(e,pw)&&r.unshift(e),r=r.filter(n),r},bw=function(e,t,n){for(var r=[],i=Array.from(e);i.length;){var a=i.shift();if(!_w(a,!1))if(a.tagName===`SLOT`){var o=a.assignedElements(),s=bw(o.length?o:a.children,!0,n);n.flatten?r.push.apply(r,s):r.push({scopeParent:a,candidates:s})}else{hw.call(a,pw)&&n.filter(a)&&(t||!e.includes(a))&&r.push(a);var c=a.shadowRoot||typeof n.getShadowRoot==`function`&&n.getShadowRoot(a),l=!_w(c,!1)&&(!n.shadowRootFilter||n.shadowRootFilter(a));if(c&&l){var u=bw(c===!0?a.children:c.children,!0,n);n.flatten?r.push.apply(r,u):r.push({scopeParent:a,candidates:u})}else i.unshift.apply(i,a.children)}}return r},xw=function(e){return!isNaN(parseInt(e.getAttribute(`tabindex`),10))},Sw=function(e){if(!e)throw Error(`No node provided`);return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||vw(e))&&!xw(e)?0:e.tabIndex},Cw=function(e,t){var n=Sw(e);return n<0&&t&&!xw(e)?0:n},ww=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},Tw=function(e){return e.tagName===`INPUT`},Ew=function(e){return Tw(e)&&e.type===`hidden`},Dw=function(e){return e.tagName===`DETAILS`&&Array.prototype.slice.apply(e.children).some(function(e){return e.tagName===`SUMMARY`})},Ow=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]},kw=function(e){if(!e.name)return!0;var t=e.form||gw(e),n=function(e){return t.querySelectorAll(`input[type="radio"][name="`+e+`"]`)},r;if(typeof window<`u`&&window.CSS!==void 0&&typeof window.CSS.escape==`function`)r=n(window.CSS.escape(e.name));else try{r=n(e.name)}catch(e){return console.error(`Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s`,e.message),!1}var i=Ow(r,e.form);return!i||i===e},Aw=function(e){return Tw(e)&&e.type===`radio`},jw=function(e){return Aw(e)&&!kw(e)},Mw=function(e){var t=e&&gw(e),n=t?.host,r=!1;if(t&&t!==e){var i,a,o;for(r=!!((i=n)!=null&&(a=i.ownerDocument)!=null&&a.contains(n)||e!=null&&(o=e.ownerDocument)!=null&&o.contains(e));!r&&n;){var s,c;t=gw(n),n=t?.host,r=!!((s=n)!=null&&(c=s.ownerDocument)!=null&&c.contains(n))}}return r},Nw=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return n===0&&r===0},Pw=function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if(n===`full-native`&&`checkVisibility`in e)return!e.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});var i=getComputedStyle(e).visibility;if(i===`hidden`||i===`collapse`)return!0;var a=hw.call(e,`details>summary:first-of-type`)?e.parentElement:e;if(hw.call(a,`details:not([open]) *`))return!0;if(!n||n===`full`||n===`full-native`||n===`legacy-full`){if(typeof r==`function`){for(var o=e;e;){var s=e.parentElement,c=gw(e);if(s&&!s.shadowRoot&&r(s)===!0)return Nw(e);e=e.assignedSlot?e.assignedSlot:!s&&c!==e.ownerDocument?c.host:s}e=o}if(Mw(e))return!e.getClientRects().length;if(n!==`legacy-full`)return!0}else if(n===`non-zero-area`)return Nw(e);return!1},Fw=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if(t.tagName===`FIELDSET`&&t.disabled){for(var n=0;n<t.children.length;n++){var r=t.children.item(n);if(r.tagName===`LEGEND`)return hw.call(t,`fieldset[disabled] *`)?!0:!r.contains(e)}return!0}t=t.parentElement}return!1},Iw=function(e,t){return!(t.disabled||Ew(t)||Pw(t,e)||Dw(t)||Fw(t))},Lw=function(e,t){return!(jw(t)||Sw(t)<0||!Iw(e,t))},Rw=function(e){var t=parseInt(e.getAttribute(`tabindex`),10);return!!(isNaN(t)||t>=0)},zw=function(e){var t=[],n=[];return e.forEach(function(e,r){var i=!!e.scopeParent,a=i?e.scopeParent:e,o=Cw(a,i),s=i?zw(e.candidates):a;o===0?i?t.push.apply(t,s):t.push(a):n.push({documentOrder:r,tabIndex:o,item:e,isScope:i,content:s})}),n.sort(ww).reduce(function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e},[]).concat(t)},Bw=function(e,t){return t||={},zw(t.getShadowRoot?bw([e],t.includeContainer,{filter:Lw.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:Rw}):yw(e,t.includeContainer,Lw.bind(null,t)))};function Vw(){let e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function Hw(){let e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(e=>{let{brand:t,version:n}=e;return t+`/`+n}).join(` `):navigator.userAgent}function Uw(){return/apple/i.test(navigator.vendor)}function Ww(){return Vw().toLowerCase().startsWith(`mac`)&&!navigator.maxTouchPoints}function Gw(){return Hw().includes(`jsdom/`)}var Kw=`data-floating-ui-focusable`,qw=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`;function Jw(e){let t=e.activeElement;for(;((n=t)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;t=t.shadowRoot.activeElement}return t}function Yw(e,t){if(!e||!t)return!1;let n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&xC(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function Xw(e){return`composedPath`in e?e.composedPath()[0]:e.target}function Zw(e,t){if(t==null)return!1;if(`composedPath`in e)return e.composedPath().includes(t);let n=e;return n.target!=null&&t.contains(n.target)}function Qw(e){return e.matches(`html,body`)}function $w(e){return e?.ownerDocument||document}function eT(e){return bC(e)&&e.matches(qw)}function tT(e){if(!e||Gw())return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function nT(e){return e?e.hasAttribute(Kw)?e:e.querySelector(`[data-floating-ui-focusable]`)||e:null}function rT(e,t,n){return n===void 0&&(n=!0),e.filter(e=>e.parentId===t&&(!n||e.context?.open)).flatMap(t=>[t,...rT(e,t.id,n)])}function iT(e){return`nativeEvent`in e}function aT(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}var oT=typeof document<`u`?J.useLayoutEffect:function(){},sT={...J};function cT(e){let t=J.useRef(e);return oT(()=>{t.current=e}),t}var lT=sT.useInsertionEffect||(e=>e());function uT(e){let t=J.useRef(()=>{});return lT(()=>{t.current=e}),J.useCallback(function(){for(var e=arguments.length,n=Array(e),r=0;r<e;r++)n[r]=arguments[r];return t.current==null?void 0:t.current(...n)},[])}var dT=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver==`function`&&ResizeObserver.toString().includes(`[native code]`)?`full`:`none`});function fT(e,t){let n=Bw(e,dT()),r=n.length;if(r===0)return;let i=Jw($w(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function pT(e){return fT($w(e).body,1)||e}function mT(e){return fT($w(e).body,-1)||e}function hT(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!Yw(n,r)}function gT(e){Bw(e,dT()).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function _T(e){e.querySelectorAll(`[data-tabindex]`).forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)})}function vT(e,t,n){let{reference:r,floating:i}=e,a=QC(t),o=$C(t),s=ZC(o),c=JC(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(YC(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}async function yT(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=qC(t,e),p=dw(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=fw(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=fw(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var bT=50,xT=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:yT},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=vT(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<bT&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=vT(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},ST=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=qC(e,t)||{};if(l==null)return{};let d=dw(u),f={x:n,y:r},p=$C(i),m=ZC(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=BC(d[_],T),ee=BC(d[v],T),D=E,O=C-h[m]-ee,k=C/2-h[m]/2+w,te=KC(D,k,O),A=!c.arrow&&YC(i)!=null&&k!==te&&a.reference[m]/2-(k<D?E:ee)-h[m]/2<0,ne=A?k<D?k-D:k-O:0;return{[p]:f[p]+ne,data:{[p]:te,centerOffset:k-te-ne,...A&&{alignmentOffset:ne}},reset:A}}}),CT=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=qC(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=JC(r),_=QC(o),v=JC(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[lw(o)]:tw(o)),x=p!==`none`;!d&&x&&b.push(...cw(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=ew(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==QC(t))||T.every(e=>QC(e.placement)===_?e.overflows[0]>0:!0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=QC(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function wT(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function TT(e){return zC.some(t=>e[t]>=0)}var ET=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=qC(e,t);switch(i){case`referenceHidden`:{let e=wT(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:TT(e)}}}case`escaped`:{let e=wT(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:TT(e)}}}default:return{}}}}},DT=new Set([`left`,`top`]);async function OT(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=JC(n),s=YC(n),c=QC(n)===`y`,l=DT.has(o)?-1:1,u=a&&c?-1:1,d=qC(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var kT=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await OT(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},AT=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=qC(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=QC(JC(i)),p=XC(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=KC(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=KC(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}},jT=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=qC(e,t),u={x:n,y:r},d=QC(i),f=XC(d),p=u[f],m=u[d],h=qC(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=DT.has(JC(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},MT=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=qC(e,t),u=await o.detectOverflow(t,l),d=JC(i),f=YC(i),p=QC(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=BC(h-u[g],v),x=BC(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=VC(u.left,0),t=VC(u.right,0),n=VC(u.top,0),r=VC(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:VC(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:VC(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function NT(e){let t=NC(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=bC(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=HC(n)!==a||HC(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function PT(e){return yC(e)?e:e.contextElement}function FT(e){let t=PT(e);if(!bC(t))return WC(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=NT(t),o=(a?HC(n.width):n.width)/r,s=(a?HC(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var IT=WC(0);function LT(e){let t=gC(e);return!jC()||!t.visualViewport?IT:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function RT(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==gC(e)?!1:t}function zT(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=PT(e),o=WC(1);t&&(r?yC(r)&&(o=FT(r)):o=FT(e));let s=RT(a,n,r)?LT(a):WC(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=gC(a),t=r&&yC(r)?gC(r):r,n=e,i=RC(n);for(;i&&r&&t!==n;){let e=FT(i),t=i.getBoundingClientRect(),r=NC(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=gC(i),i=RC(n)}}return fw({width:u,height:d,x:c,y:l})}function BT(e,t){let n=PC(e).scrollLeft;return t?t.left+n:zT(_C(e)).left+n}function VT(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-BT(e,n),y:n.top+t.scrollTop}}function HT(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=_C(r),s=t?wC(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=WC(1),u=WC(0),d=bC(r);if((d||!d&&!a)&&((hC(r)!==`body`||SC(o))&&(c=PC(r)),d)){let e=zT(r);l=FT(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?VT(o,c):WC(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function UT(e){return Array.from(e.getClientRects())}function WT(e){let t=_C(e),n=PC(e),r=e.ownerDocument.body,i=VC(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=VC(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+BT(e),s=-n.scrollTop;return NC(r).direction===`rtl`&&(o+=VC(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var GT=25;function KT(e,t){let n=gC(e),r=_C(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=jC();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=BT(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=GT&&(a-=o)}else l<=GT&&(a+=l);return{width:a,height:o,x:s,y:c}}function qT(e,t){let n=zT(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=bC(e)?FT(e):WC(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function JT(e,t,n){let r;if(t===`viewport`)r=KT(e,n);else if(t===`document`)r=WT(_C(e));else if(yC(t))r=qT(t,n);else{let n=LT(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return fw(r)}function YT(e,t){let n=FC(e);return n===t||!yC(n)||MC(n)?!1:NC(n).position===`fixed`||YT(n,t)}function XT(e,t){let n=t.get(e);if(n)return n;let r=LC(e,[],!1).filter(e=>yC(e)&&hC(e)!==`body`),i=null,a=NC(e).position===`fixed`,o=a?FC(e):e;for(;yC(o)&&!MC(o);){let t=NC(o),n=kC(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||SC(o)&&!n&&YT(e,o))?r=r.filter(e=>e!==o):i=t,o=FC(o)}return t.set(e,r),r}function ZT(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?wC(t)?[]:XT(t,this._c):[].concat(n),r],o=JT(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=JT(t,a[e],i);s=VC(n.top,s),c=BC(n.right,c),l=BC(n.bottom,l),u=VC(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function QT(e){let{width:t,height:n}=NT(e);return{width:t,height:n}}function $T(e,t,n){let r=bC(t),i=_C(t),a=n===`fixed`,o=zT(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=WC(0);function l(){c.x=BT(i)}if(r||!r&&!a)if((hC(t)!==`body`||SC(i))&&(s=PC(t)),r){let e=zT(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?VT(i,s):WC(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function eE(e){return NC(e).position===`static`}function tE(e,t){if(!bC(e)||NC(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return _C(e)===n&&(n=n.ownerDocument.body),n}function nE(e,t){let n=gC(e);if(wC(e))return n;if(!bC(e)){let t=FC(e);for(;t&&!MC(t);){if(yC(t)&&!eE(t))return t;t=FC(t)}return n}let r=tE(e,t);for(;r&&CC(r)&&eE(r);)r=tE(r,t);return r&&MC(r)&&eE(r)&&!kC(r)?n:r||AC(e)||n}var rE=async function(e){let t=this.getOffsetParent||nE,n=this.getDimensions,r=await n(e.floating);return{reference:$T(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function iE(e){return NC(e).direction===`rtl`}var aE={convertOffsetParentRelativeRectToViewportRelativeRect:HT,getDocumentElement:_C,getClippingRect:ZT,getOffsetParent:nE,getElementRects:rE,getClientRects:UT,getDimensions:QT,getScale:FT,isElement:yC,isRTL:iE};function oE(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function sE(e,t){let n=null,r,i=_C(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=UC(d),h=UC(i.clientWidth-(u+f)),g=UC(i.clientHeight-(d+p)),_=UC(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:VC(0,BC(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!oE(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function cE(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=PT(e),u=i||a?[...l?LC(l):[],...t?LC(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?sE(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?zT(e):null;c&&g();function g(){let t=zT(e);h&&!oE(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var lE=kT,uE=AT,dE=CT,fE=MT,pE=ET,mE=ST,hE=jT,gE=(e,t,n)=>{let r=new Map,i={platform:aE,...n},a={...i.platform,_c:r};return xT(e,t,{...i,platform:a})},_E=typeof document<`u`?J.useLayoutEffect:function(){};function vE(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!vE(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!vE(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function yE(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function bE(e,t){let n=yE(e);return Math.round(t*n)/n}function xE(e){let t=J.useRef(e);return _E(()=>{t.current=e}),t}function SE(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=J.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=J.useState(r);vE(f,r)||p(r);let[m,h]=J.useState(null),[g,_]=J.useState(null),v=J.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=J.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=J.useRef(null),C=J.useRef(null),w=J.useRef(u),T=c!=null,E=xE(c),ee=xE(i),D=xE(l),O=J.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};ee.current&&(e.platform=ee.current),gE(S.current,C.current,e).then(e=>{let t={...e,isPositioned:D.current!==!1};k.current&&!vE(w.current,t)&&(w.current=t,op.flushSync(()=>{d(t)}))})},[f,t,n,ee,D]);_E(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let k=J.useRef(!1);_E(()=>(k.current=!0,()=>{k.current=!1}),[]),_E(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(E.current)return E.current(b,x,O);O()}},[b,x,O,E,T]);let te=J.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),A=J.useMemo(()=>({reference:b,floating:x}),[b,x]),ne=J.useMemo(()=>{let e={position:n,left:0,top:0};if(!A.floating)return e;let t=bE(A.floating,u.x),r=bE(A.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...yE(A.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,A.floating,u.x,u.y]);return J.useMemo(()=>({...u,update:O,refs:te,elements:A,floatingStyles:ne}),[u,O,te,A,ne])}var CE=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:mE({element:r.current,padding:i}).fn(n):r?mE({element:r,padding:i}).fn(n):{}}}},wE=(e,t)=>{let n=lE(e);return{name:n.name,fn:n.fn,options:[e,t]}},TE=(e,t)=>{let n=uE(e);return{name:n.name,fn:n.fn,options:[e,t]}},EE=(e,t)=>({fn:hE(e).fn,options:[e,t]}),DE=(e,t)=>{let n=dE(e);return{name:n.name,fn:n.fn,options:[e,t]}},OE=(e,t)=>{let n=fE(e);return{name:n.name,fn:n.fn,options:[e,t]}},kE=(e,t)=>{let n=pE(e);return{name:n.name,fn:n.fn,options:[e,t]}},AE=(e,t)=>{let n=CE(e);return{name:n.name,fn:n.fn,options:[e,t]}};function jE(e){let t=J.useRef(void 0),n=J.useCallback(t=>{let n=e.map(e=>{if(e!=null){if(typeof e==`function`){let n=e,r=n(t);return typeof r==`function`?r:()=>{n(null)}}return e.current=t,()=>{e.current=null}}});return()=>{n.forEach(e=>e?.())}},e);return J.useMemo(()=>e.every(e=>e==null)?null:e=>{t.current&&=(t.current(),void 0),e!=null&&(t.current=n(e))},e)}var ME=`data-floating-ui-focusable`,NE=`active`,PE=`selected`,FE=`ArrowLeft`,IE=`ArrowRight`,LE=`ArrowUp`,RE=`ArrowDown`,zE=[FE,IE],BE=[LE,RE];[...zE,...BE];var VE={...J},HE=!1,UE=0,WE=()=>`floating-ui-`+Math.random().toString(36).slice(2,6)+UE++;function GE(){let[e,t]=J.useState(()=>HE?WE():void 0);return oT(()=>{e??t(WE())},[]),J.useEffect(()=>{HE=!0},[]),e}var KE=VE.useId||GE;function qE(){let e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var r;(r=e.get(t))==null||r.delete(n)}}}var JE=J.createContext(null),YE=J.createContext(null),XE=()=>J.useContext(JE)?.id||null,ZE=()=>J.useContext(YE);function QE(e){return`data-floating-ui-`+e}function $E(e){e.current!==-1&&(clearTimeout(e.current),e.current=-1)}var eD=QE(`safe-polygon`);function tD(e,t,n){if(n&&!aT(n))return 0;if(typeof e==`number`)return e;if(typeof e==`function`){let n=e();return typeof n==`number`?n:n?.[t]}return e?.[t]}function nD(e){return typeof e==`function`?e():e}function rD(e,t){t===void 0&&(t={});let{open:n,onOpenChange:r,dataRef:i,events:a,elements:o}=e,{enabled:s=!0,delay:c=0,handleClose:l=null,mouseOnly:u=!1,restMs:d=0,move:f=!0}=t,p=ZE(),m=XE(),h=cT(l),g=cT(c),_=cT(n),v=cT(d),y=J.useRef(),b=J.useRef(-1),x=J.useRef(),S=J.useRef(-1),C=J.useRef(!0),w=J.useRef(!1),T=J.useRef(()=>{}),E=J.useRef(!1),ee=uT(()=>{let e=i.current.openEvent?.type;return e?.includes(`mouse`)&&e!==`mousedown`});J.useEffect(()=>{if(!s)return;function e(e){let{open:t}=e;t||($E(b),$E(S),C.current=!0,E.current=!1)}return a.on(`openchange`,e),()=>{a.off(`openchange`,e)}},[s,a]),J.useEffect(()=>{if(!s||!h.current||!n)return;function e(e){ee()&&r(!1,e,`hover`)}let t=$w(o.floating).documentElement;return t.addEventListener(`mouseleave`,e),()=>{t.removeEventListener(`mouseleave`,e)}},[o.floating,n,r,s,h,ee]);let D=J.useCallback(function(e,t,n){t===void 0&&(t=!0),n===void 0&&(n=`hover`);let i=tD(g.current,`close`,y.current);i&&!x.current?($E(b),b.current=window.setTimeout(()=>r(!1,e,n),i)):t&&($E(b),r(!1,e,n))},[g,r]),O=uT(()=>{T.current(),x.current=void 0}),k=uT(()=>{if(w.current){let e=$w(o.floating).body;e.style.pointerEvents=``,e.removeAttribute(eD),w.current=!1}}),te=uT(()=>i.current.openEvent?[`click`,`mousedown`].includes(i.current.openEvent.type):!1);J.useEffect(()=>{if(!s)return;function e(e){if($E(b),C.current=!1,u&&!aT(y.current)||nD(v.current)>0&&!tD(g.current,`open`))return;let t=tD(g.current,`open`,y.current);t?b.current=window.setTimeout(()=>{_.current||r(!0,e,`hover`)},t):n||r(!0,e,`hover`)}function t(e){if(te()){k();return}T.current();let t=$w(o.floating);if($E(S),E.current=!1,h.current&&i.current.floatingContext){n||$E(b),x.current=h.current({...i.current.floatingContext,tree:p,x:e.clientX,y:e.clientY,onClose(){k(),O(),te()||D(e,!0,`safe-polygon`)}});let r=x.current;t.addEventListener(`mousemove`,r),T.current=()=>{t.removeEventListener(`mousemove`,r)};return}(y.current!==`touch`||!Yw(o.floating,e.relatedTarget))&&D(e)}function a(e){te()||i.current.floatingContext&&(h.current==null||h.current({...i.current.floatingContext,tree:p,x:e.clientX,y:e.clientY,onClose(){k(),O(),te()||D(e)}})(e))}function c(){$E(b)}function l(e){te()||D(e,!1)}if(yC(o.domReference)){let r=o.domReference,i=o.floating;return n&&r.addEventListener(`mouseleave`,a),f&&r.addEventListener(`mousemove`,e,{once:!0}),r.addEventListener(`mouseenter`,e),r.addEventListener(`mouseleave`,t),i&&(i.addEventListener(`mouseleave`,a),i.addEventListener(`mouseenter`,c),i.addEventListener(`mouseleave`,l)),()=>{n&&r.removeEventListener(`mouseleave`,a),f&&r.removeEventListener(`mousemove`,e),r.removeEventListener(`mouseenter`,e),r.removeEventListener(`mouseleave`,t),i&&(i.removeEventListener(`mouseleave`,a),i.removeEventListener(`mouseenter`,c),i.removeEventListener(`mouseleave`,l))}}},[o,s,e,u,f,D,O,k,r,n,_,p,g,h,i,te,v]),oT(()=>{var e;if(s&&n&&(e=h.current)!=null&&(e=e.__options)!=null&&e.blockPointerEvents&&ee()){w.current=!0;let e=o.floating;if(yC(o.domReference)&&e){var t;let n=$w(o.floating).body;n.setAttribute(eD,``);let r=o.domReference,i=p==null||(t=p.nodesRef.current.find(e=>e.id===m))==null||(t=t.context)==null?void 0:t.elements.floating;return i&&(i.style.pointerEvents=``),n.style.pointerEvents=`none`,r.style.pointerEvents=`auto`,e.style.pointerEvents=`auto`,()=>{n.style.pointerEvents=``,r.style.pointerEvents=``,e.style.pointerEvents=``}}}},[s,n,m,o,p,h,ee]),oT(()=>{n||(y.current=void 0,E.current=!1,O(),k())},[n,O,k]),J.useEffect(()=>()=>{O(),$E(b),$E(S),k()},[s,o.domReference,O,k]);let A=J.useMemo(()=>{function e(e){y.current=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){let{nativeEvent:t}=e;function i(){!C.current&&!_.current&&r(!0,t,`hover`)}u&&!aT(y.current)||n||nD(v.current)===0||E.current&&e.movementX**2+e.movementY**2<2||($E(S),y.current===`touch`?i():(E.current=!0,S.current=window.setTimeout(i,nD(v.current))))}}},[u,r,n,_,v]);return J.useMemo(()=>s?{reference:A}:{},[s,A])}var iD=()=>{},aD=J.createContext({delay:0,initialDelay:0,timeoutMs:0,currentId:null,setCurrentId:iD,setState:iD,isInstantPhase:!1});function oD(e){let{children:t,delay:n,timeoutMs:r=0}=e,[i,a]=J.useReducer((e,t)=>({...e,...t}),{delay:n,timeoutMs:r,initialDelay:n,currentId:null,isInstantPhase:!1}),o=J.useRef(null),s=J.useCallback(e=>{a({currentId:e})},[]);return oT(()=>{i.currentId?o.current===null?o.current=i.currentId:i.isInstantPhase||a({isInstantPhase:!0}):(i.isInstantPhase&&a({isInstantPhase:!1}),o.current=null)},[i.currentId,i.isInstantPhase]),(0,Y.jsx)(aD.Provider,{value:J.useMemo(()=>({...i,setState:a,setCurrentId:s}),[i,s]),children:t})}var sD={border:0,clip:`rect(0 0 0 0)`,height:`1px`,margin:`-1px`,overflow:`hidden`,padding:0,position:`fixed`,whiteSpace:`nowrap`,width:`1px`,top:0,left:0},cD=J.forwardRef(function(e,t){let[n,r]=J.useState();oT(()=>{Uw()&&r(`button`)},[]);let i={ref:t,tabIndex:0,role:n,"aria-hidden":n?void 0:!0,[QE(`focus-guard`)]:``,style:sD};return(0,Y.jsx)(`span`,{...e,...i})}),lD={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0},uD=J.createContext(null),dD=QE(`portal`);function fD(e){e===void 0&&(e={});let{id:t,root:n}=e,r=KE(),i=mD(),[a,o]=J.useState(null),s=J.useRef(null);return oT(()=>()=>{a?.remove(),queueMicrotask(()=>{s.current=null})},[a]),oT(()=>{if(!r||s.current)return;let e=t?document.getElementById(t):null;if(!e)return;let n=document.createElement(`div`);n.id=r,n.setAttribute(dD,``),e.appendChild(n),s.current=n,o(n)},[t,r]),oT(()=>{if(n===null||!r||s.current)return;let e=n||i?.portalNode;e&&!vC(e)&&(e=e.current),e||=document.body;let a=null;t&&(a=document.createElement(`div`),a.id=t,e.appendChild(a));let c=document.createElement(`div`);c.id=r,c.setAttribute(dD,``),e=a||e,e.appendChild(c),s.current=c,o(c)},[t,n,r,i]),a}function pD(e){let{children:t,id:n,root:r,preserveTabOrder:i=!0}=e,a=fD({id:n,root:r}),[o,s]=J.useState(null),c=J.useRef(null),l=J.useRef(null),u=J.useRef(null),d=J.useRef(null),f=o?.modal,p=o?.open,m=!!o&&!o.modal&&o.open&&i&&!!(r||a);return J.useEffect(()=>{if(!a||!i||f)return;function e(e){a&&hT(e)&&(e.type===`focusin`?_T:gT)(a)}return a.addEventListener(`focusin`,e,!0),a.addEventListener(`focusout`,e,!0),()=>{a.removeEventListener(`focusin`,e,!0),a.removeEventListener(`focusout`,e,!0)}},[a,i,f]),J.useEffect(()=>{a&&(p||_T(a))},[p,a]),(0,Y.jsxs)(uD.Provider,{value:J.useMemo(()=>({preserveTabOrder:i,beforeOutsideRef:c,afterOutsideRef:l,beforeInsideRef:u,afterInsideRef:d,portalNode:a,setFocusManagerState:s}),[i,a]),children:[m&&a&&(0,Y.jsx)(cD,{"data-type":`outside`,ref:c,onFocus:e=>{if(hT(e,a)){var t;(t=u.current)==null||t.focus()}else mT(o?o.domReference:null)?.focus()}}),m&&a&&(0,Y.jsx)(`span`,{"aria-owns":a.id,style:lD}),a&&op.createPortal(t,a),m&&a&&(0,Y.jsx)(cD,{"data-type":`outside`,ref:l,onFocus:e=>{if(hT(e,a)){var t;(t=d.current)==null||t.focus()}else pT(o?o.domReference:null)?.focus(),o!=null&&o.closeOnFocusOut&&o?.onOpenChange(!1,e.nativeEvent,`focus-out`)}})]})}var mD=()=>J.useContext(uD),hD={pointerdown:`onPointerDown`,mousedown:`onMouseDown`,click:`onClick`},gD={pointerdown:`onPointerDownCapture`,mousedown:`onMouseDownCapture`,click:`onClickCapture`},_D=e=>({escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0});function vD(e,t){t===void 0&&(t={});let{open:n,onOpenChange:r,elements:i,dataRef:a}=e,{enabled:o=!0,escapeKey:s=!0,outsidePress:c=!0,outsidePressEvent:l=`pointerdown`,referencePress:u=!1,referencePressEvent:d=`pointerdown`,ancestorScroll:f=!1,bubbles:p,capture:m}=t,h=ZE(),g=uT(typeof c==`function`?c:()=>!1),_=typeof c==`function`?g:c,v=J.useRef(!1),{escapeKey:y,outsidePress:b}=_D(p),{escapeKey:x,outsidePress:S}=_D(m),C=J.useRef(!1),w=uT(e=>{if(!n||!o||!s||e.key!==`Escape`||C.current)return;let t=a.current.floatingContext?.nodeId,i=h?rT(h.nodesRef.current,t):[];if(!y&&(e.stopPropagation(),i.length>0)){let e=!0;if(i.forEach(t=>{var n;if((n=t.context)!=null&&n.open&&!t.context.dataRef.current.__escapeKeyBubbles){e=!1;return}}),!e)return}r(!1,iT(e)?e.nativeEvent:e,`escape-key`)}),T=uT(e=>{var t;let n=()=>{var t;w(e),(t=Xw(e))==null||t.removeEventListener(`keydown`,n)};(t=Xw(e))==null||t.addEventListener(`keydown`,n)}),E=uT(e=>{let t=a.current.insideReactTree;a.current.insideReactTree=!1;let n=v.current;if(v.current=!1,l===`click`&&n||t||typeof _==`function`&&!_(e))return;let o=Xw(e),s=`[`+QE(`inert`)+`]`,c=$w(i.floating).querySelectorAll(s),u=yC(o)?o:null;for(;u&&!MC(u);){let e=FC(u);if(MC(e)||!yC(e))break;u=e}if(c.length&&yC(o)&&!Qw(o)&&!Yw(o,i.floating)&&Array.from(c).every(e=>!Yw(u,e)))return;if(bC(o)&&O){let t=MC(o),n=NC(o),r=/auto|scroll/,i=t||r.test(n.overflowX),a=t||r.test(n.overflowY),s=i&&o.clientWidth>0&&o.scrollWidth>o.clientWidth,c=a&&o.clientHeight>0&&o.scrollHeight>o.clientHeight,l=n.direction===`rtl`,u=c&&(l?e.offsetX<=o.offsetWidth-o.clientWidth:e.offsetX>o.clientWidth),d=s&&e.offsetY>o.clientHeight;if(u||d)return}let d=a.current.floatingContext?.nodeId,f=h&&rT(h.nodesRef.current,d).some(t=>Zw(e,t.context?.elements.floating));if(Zw(e,i.floating)||Zw(e,i.domReference)||f)return;let p=h?rT(h.nodesRef.current,d):[];if(p.length>0){let e=!0;if(p.forEach(t=>{var n;if((n=t.context)!=null&&n.open&&!t.context.dataRef.current.__outsidePressBubbles){e=!1;return}}),!e)return}r(!1,e,`outside-press`)}),ee=uT(e=>{var t;let n=()=>{var t;E(e),(t=Xw(e))==null||t.removeEventListener(l,n)};(t=Xw(e))==null||t.addEventListener(l,n)});J.useEffect(()=>{if(!n||!o)return;a.current.__escapeKeyBubbles=y,a.current.__outsidePressBubbles=b;let e=-1;function t(e){r(!1,e,`ancestor-scroll`)}function c(){window.clearTimeout(e),C.current=!0}function u(){e=window.setTimeout(()=>{C.current=!1},jC()?5:0)}let d=$w(i.floating);s&&(d.addEventListener(`keydown`,x?T:w,x),d.addEventListener(`compositionstart`,c),d.addEventListener(`compositionend`,u)),_&&d.addEventListener(l,S?ee:E,S);let p=[];return f&&(yC(i.domReference)&&(p=LC(i.domReference)),yC(i.floating)&&(p=p.concat(LC(i.floating))),!yC(i.reference)&&i.reference&&i.reference.contextElement&&(p=p.concat(LC(i.reference.contextElement)))),p=p.filter(e=>e!==d.defaultView?.visualViewport),p.forEach(e=>{e.addEventListener(`scroll`,t,{passive:!0})}),()=>{s&&(d.removeEventListener(`keydown`,x?T:w,x),d.removeEventListener(`compositionstart`,c),d.removeEventListener(`compositionend`,u)),_&&d.removeEventListener(l,S?ee:E,S),p.forEach(e=>{e.removeEventListener(`scroll`,t)}),window.clearTimeout(e)}},[a,i,s,_,l,n,r,f,o,y,b,w,x,T,E,S,ee]),J.useEffect(()=>{a.current.insideReactTree=!1},[a,_,l]);let D=J.useMemo(()=>({onKeyDown:w,...u&&{[hD[d]]:e=>{r(!1,e.nativeEvent,`reference-press`)},...d!==`click`&&{onClick(e){r(!1,e.nativeEvent,`reference-press`)}}}}),[w,r,u,d]),O=J.useMemo(()=>{function e(e){e.button===0&&(v.current=!0)}return{onKeyDown:w,onMouseDown:e,onMouseUp:e,[gD[l]]:()=>{a.current.insideReactTree=!0}}},[w,l,a]);return J.useMemo(()=>o?{reference:D,floating:O}:{},[o,D,O])}function yD(e){let{open:t=!1,onOpenChange:n,elements:r}=e,i=KE(),a=J.useRef({}),[o]=J.useState(()=>qE()),s=XE()!=null,[c,l]=J.useState(r.reference),u=uT((e,t,r)=>{a.current.openEvent=e?t:void 0,o.emit(`openchange`,{open:e,event:t,reason:r,nested:s}),n?.(e,t,r)}),d=J.useMemo(()=>({setPositionReference:l}),[]),f=J.useMemo(()=>({reference:c||r.reference||null,floating:r.floating||null,domReference:r.reference}),[c,r.reference,r.floating]);return J.useMemo(()=>({dataRef:a,open:t,onOpenChange:u,elements:f,events:o,floatingId:i,refs:d}),[t,u,f,o,i,d])}function bD(e){e===void 0&&(e={});let{nodeId:t}=e,n=yD({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,i=r.elements,[a,o]=J.useState(null),[s,c]=J.useState(null),l=i?.domReference||a,u=J.useRef(null),d=ZE();oT(()=>{l&&(u.current=l)},[l]);let f=SE({...e,elements:{...i,...s&&{reference:s}}}),p=J.useCallback(e=>{let t=yC(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;c(t),f.refs.setReference(t)},[f.refs]),m=J.useCallback(e=>{(yC(e)||e===null)&&(u.current=e,o(e)),(yC(f.refs.reference.current)||f.refs.reference.current===null||e!==null&&!yC(e))&&f.refs.setReference(e)},[f.refs]),h=J.useMemo(()=>({...f.refs,setReference:m,setPositionReference:p,domReference:u}),[f.refs,m,p]),g=J.useMemo(()=>({...f.elements,domReference:l}),[f.elements,l]),_=J.useMemo(()=>({...f,...r,refs:h,elements:g,nodeId:t}),[f,h,g,t,r]);return oT(()=>{r.dataRef.current.floatingContext=_;let e=d?.nodesRef.current.find(e=>e.id===t);e&&(e.context=_)}),J.useMemo(()=>({...f,context:_,refs:h,elements:g}),[f,h,g,_])}function xD(){return Ww()&&Uw()}function SD(e,t){t===void 0&&(t={});let{open:n,onOpenChange:r,events:i,dataRef:a,elements:o}=e,{enabled:s=!0,visibleOnly:c=!0}=t,l=J.useRef(!1),u=J.useRef(-1),d=J.useRef(!0);J.useEffect(()=>{if(!s)return;let e=gC(o.domReference);function t(){!n&&bC(o.domReference)&&o.domReference===Jw($w(o.domReference))&&(l.current=!0)}function r(){d.current=!0}function i(){d.current=!1}return e.addEventListener(`blur`,t),xD()&&(e.addEventListener(`keydown`,r,!0),e.addEventListener(`pointerdown`,i,!0)),()=>{e.removeEventListener(`blur`,t),xD()&&(e.removeEventListener(`keydown`,r,!0),e.removeEventListener(`pointerdown`,i,!0))}},[o.domReference,n,s]),J.useEffect(()=>{if(!s)return;function e(e){let{reason:t}=e;(t===`reference-press`||t===`escape-key`)&&(l.current=!0)}return i.on(`openchange`,e),()=>{i.off(`openchange`,e)}},[i,s]),J.useEffect(()=>()=>{$E(u)},[]);let f=J.useMemo(()=>({onMouseLeave(){l.current=!1},onFocus(e){if(l.current)return;let t=Xw(e.nativeEvent);if(c&&yC(t)){if(xD()&&!e.relatedTarget){if(!d.current&&!eT(t))return}else if(!tT(t))return}r(!0,e.nativeEvent,`focus`)},onBlur(e){l.current=!1;let t=e.relatedTarget,n=e.nativeEvent,i=yC(t)&&t.hasAttribute(QE(`focus-guard`))&&t.getAttribute(`data-type`)===`outside`;u.current=window.setTimeout(()=>{let e=Jw(o.domReference?o.domReference.ownerDocument:document);!t&&e===o.domReference||Yw(a.current.floatingContext?.refs.floating.current,e)||Yw(o.domReference,e)||i||r(!1,n,`focus`)})}}),[a,o.domReference,r,c]);return J.useMemo(()=>s?{reference:f}:{},[s,f])}function CD(e,t,n){let r=new Map,i=n===`item`,a=e;if(i&&e){let{[NE]:t,[PE]:n,...r}=e;a=r}return{...n===`floating`&&{tabIndex:-1,[ME]:``},...a,...t.map(t=>{let r=t?t[n]:null;return typeof r==`function`?e?r(e):null:r}).concat(e).reduce((e,t)=>(t&&Object.entries(t).forEach(t=>{let[n,a]=t;if(!(i&&[NE,PE].includes(n)))if(n.indexOf(`on`)===0){if(r.has(n)||r.set(n,[]),typeof a==`function`){var o;(o=r.get(n))==null||o.push(a),e[n]=function(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];return r.get(n)?.map(e=>e(...t)).find(e=>e!==void 0)}}}else e[n]=a}),e),{})}}function wD(e){e===void 0&&(e=[]);let t=e.map(e=>e?.reference),n=e.map(e=>e?.floating),r=e.map(e=>e?.item),i=J.useCallback(t=>CD(t,e,`reference`),t),a=J.useCallback(t=>CD(t,e,`floating`),n),o=J.useCallback(t=>CD(t,e,`item`),r);return J.useMemo(()=>({getReferenceProps:i,getFloatingProps:a,getItemProps:o}),[i,a,o])}var TD=new Map([[`select`,`listbox`],[`combobox`,`listbox`],[`label`,!1]]);function ED(e,t){t===void 0&&(t={});let{open:n,elements:r,floatingId:i}=e,{enabled:a=!0,role:o=`dialog`}=t,s=KE(),c=r.domReference?.id||s,l=J.useMemo(()=>nT(r.floating)?.id||i,[r.floating,i]),u=TD.get(o)??o,d=XE()!=null,f=J.useMemo(()=>u===`tooltip`||o===`label`?{[`aria-`+(o===`label`?`labelledby`:`describedby`)]:n?l:void 0}:{"aria-expanded":n?`true`:`false`,"aria-haspopup":u===`alertdialog`?`dialog`:u,"aria-controls":n?l:void 0,...u===`listbox`&&{role:`combobox`},...u===`menu`&&{id:c},...u===`menu`&&d&&{role:`menuitem`},...o===`select`&&{"aria-autocomplete":`none`},...o===`combobox`&&{"aria-autocomplete":`list`}},[u,l,d,n,c,o]),p=J.useMemo(()=>{let e={id:l,...u&&{role:u}};return u===`tooltip`||o===`label`?e:{...e,...u===`menu`&&{"aria-labelledby":c}}},[u,l,c,o]),m=J.useCallback(e=>{let{active:t,selected:n}=e,r={role:`option`,...t&&{id:l+`-fui-option`}};switch(o){case`select`:case`combobox`:return{...r,"aria-selected":n}}return{}},[l,o]);return J.useMemo(()=>a?{reference:f,floating:p,item:m}:{},[a,f,p,m])}function DD({initialOpen:e=!1,placement:t=`top`,open:n,onOpenChange:r,delay:i=600,closeDelay:a=0}={}){let[o,s]=(0,J.useState)(e),c=n??o,l=r??s,u=bD({placement:t,open:c,onOpenChange:l,whileElementsMounted:cE,middleware:[wE(4),DE({crossAxis:t.includes(`-`),fallbackAxisSideDirection:`start`,padding:4}),TE({padding:4})]}),d=u.context,f=wD([rD(d,{mouseOnly:!0,move:!1,restMs:i,enabled:n==null,delay:{close:a}}),SD(d,{enabled:n==null}),vD(d),ED(d,{role:`tooltip`})]);return(0,J.useMemo)(()=>({open:c,setOpen:l,...f,...u}),[c,l,f,u])}var OD=(0,J.createContext)(null);function kD(){let e=(0,J.useContext)(OD);if(e==null)throw Error(`Tooltip components must be wrapped in <TooltipProvider />`);return e}function AD({children:e,...t}){let n=DD(t);return t.useDelayGroup?(0,Y.jsx)(oD,{delay:{open:t.delay??0,close:t.closeDelay??0},timeoutMs:t.timeout,children:(0,Y.jsx)(OD.Provider,{value:n,children:e})}):(0,Y.jsx)(OD.Provider,{value:n,children:e})}var jD=(0,J.forwardRef)(function({children:e,asChild:t=!1,...n},r){let i=kD(),a=(0,J.isValidElement)(e)?parseInt(J.version,10)>=19?e.props.ref:e.ref:void 0,o=jE([i.refs.setReference,r,a]);if(t&&(0,J.isValidElement)(e)){let t={"data-tooltip-state":i.open?`open`:`closed`};return(0,J.cloneElement)(e,i.getReferenceProps({ref:o,...n,...typeof e.props==`object`?e.props:{},...t}))}return(0,Y.jsx)(`button`,{ref:o,"data-tooltip-state":i.open?`open`:`closed`,...i.getReferenceProps(n),children:e})}),MD=(0,J.forwardRef)(function({style:e,children:t,portal:n=!0,portalProps:r={},...i},a){let o=kD(),s=jE([o.refs.setFloating,a]);if(!o.open)return null;let c=(0,Y.jsx)(`div`,{ref:s,style:{...o.floatingStyles,...e},...o.getFloatingProps(i),className:`planet-tooltip`,children:t});return n?(0,Y.jsx)(pD,{...r,children:c}):c});AD.displayName=`Tooltip`,jD.displayName=`TooltipTrigger`,MD.displayName=`TooltipContent`;function ND(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=ND(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function PD(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=ND(e))&&(r&&(r+=` `),r+=t);return r}var FD=5*1024*1024,ID={mod:`⌘`,command:`⌘`,meta:`⌘`,ctrl:`⌃`,control:`⌃`,alt:`⌥`,option:`⌥`,shift:`⇧`,backspace:`Del`,delete:`⌦`,enter:`⏎`,escape:`⎋`,capslock:`⇪`};function LD(...e){return PD(e)}function RD(){return typeof navigator<`u`&&navigator.platform.toLowerCase().includes(`mac`)}var zD=(e,t,n=!0)=>t?ID[e.toLowerCase()]||(n?e.toUpperCase():e):n?e.charAt(0).toUpperCase()+e.slice(1):e,BD=e=>{let{shortcutKeys:t,delimiter:n=`+`,capitalize:r=!0}=e;return t?t.split(n).map(e=>e.trim()).map(e=>zD(e,RD(),r)):[]},VD=(e,t)=>t?.schema?t.schema.spec.marks.get(e)!==void 0:!1,HD=(e,t)=>t?.schema?t.schema.spec.nodes.get(e)!==void 0:!1;function UD(e){let{state:t,view:n}=e,{doc:r,selection:i}=t,a=N.findFrom(i.$to,1,!0);if(a)return n.dispatch(t.tr.setSelection(a).scrollIntoView()),!0;let o=t.schema.nodes.paragraph;if(!o)return console.warn(`No paragraph node type found in schema.`),!1;let s=r.content.size,c=o.create(),l=t.tr.insert(s,c),u=l.doc.resolve(s+1);return l=l.setSelection(P.near(u)).scrollIntoView(),n.dispatch(l),!0}function WD(e){return typeof e==`number`&&e>=0}function GD(e,t){if(!e)return!1;let n=Array.isArray(t)?t:[t],r=n.some(t=>e.extensionManager.extensions.some(e=>e.name===t));return r||console.warn(`None of the extensions [${n.join(`, `)}] were found in the editor schema. Ensure they are included in the editor configuration.`),r}function KD(e,t){try{return e.state.doc.nodeAt(t)||(console.warn(`No node found at position ${t}`),null)}catch(e){return console.error(`Error getting node at position ${t}:`,e),null}}function qD(e){let{editor:t,node:n,nodePos:r}=e;if(!t||!t.state?.doc)return null;let i=n!=null,a=WD(r);if(!i&&!a)return null;if(i){let e=-1,r=null;if(t.state.doc.descendants((t,i)=>t===n?(e=i,r=t,!1):!0),e!==-1&&r!==null)return{pos:e,node:r}}if(a){let e=KD(t,r);if(e)return{pos:r,node:e}}return null}function JD(e,t=[],n=!1){if(!e||!e.state.selection)return!1;let{selection:r}=e.state;if(r.empty)return!1;if(r instanceof F){let e=r.node;return e?t.includes(e.type.name):!1}if(n){let{$from:e}=r;for(let n=e.depth;n>0;n--){let r=e.node(n);if(t.includes(r.type.name))return!0}}return!1}function YD(e,t=[]){if(!e||t.length===0)return!1;let{state:n}=e,{selection:r}=n,i=new Set(t);if(r instanceof F){let e=r.node?.type?.name;return!!e&&i.has(e)}if(r instanceof P||r instanceof Pn){let e=!0;return n.doc.nodesBetween(r.from,r.to,t=>t.isTextblock&&!i.has(t.type.name)?(e=!1,!1):e),e}return!1}var XD=async(e,t,n)=>{if(!e)throw Error(`No file provided`);if(e.size>5242880)throw Error(`File size exceeds maximum allowed (${FD/(1024*1024)}MB)`);for(let e=0;e<=100;e+=20){if(n?.aborted)throw Error(`Upload cancelled`);await new Promise(e=>setTimeout(e,100)),t?.({progress:e})}return await new Promise((t,r)=>{let i=new FileReader;i.onload=()=>t(i.result),i.onerror=()=>r(Error(`Failed to read image file`)),n&&n.addEventListener(`abort`,()=>{i.abort(),r(Error(`Upload cancelled`))}),i.readAsDataURL(e)})},ZD=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g;function QD(e,t){let n=[`http`,`https`,`ftp`,`ftps`,`mailto`,`tel`,`callto`,`sms`,`cid`,`xmpp`];return t&&t.forEach(e=>{let t=typeof e==`string`?e:e.scheme;t&&n.push(t)}),!e||e.replace(ZD,``).match(RegExp(`^(?:(?:${n.join(`|`)}):|[^a-z]|[a-z0-9+.\-]+(?:[^a-z+.\-:]|$))`,`i`))}function $D(e,t,n){try{let r=new URL(e,t);if(QD(r.href,n))return r.href}catch{}return`#`}function eO(e){let{doc:t}=e.state,{from:n,to:r}=e.state.selection,i=[],a=new Set;return t.nodesBetween(n,r,(e,t)=>{if(e.isBlock)return a.has(t)||(a.add(t),i.push(e)),!1}),i}var tO=({shortcuts:e})=>e.length===0?null:(0,Y.jsx)(`div`,{children:e.map((e,t)=>(0,Y.jsxs)(J.Fragment,{children:[t>0&&(0,Y.jsx)(`kbd`,{children:`+`}),(0,Y.jsx)(`kbd`,{children:e})]},t))}),Q=(0,J.forwardRef)(({className:e,children:t,tooltip:n,showTooltip:r=!0,shortcutKeys:i,variant:a,size:o,...s},c)=>{let l=(0,J.useMemo)(()=>BD({shortcutKeys:i}),[i]);return!n||!r?(0,Y.jsx)(`button`,{"data-slot":`planet-button`,className:LD(`planet-button`,e),ref:c,"data-style":a,"data-size":o,...s,children:t}):(0,Y.jsxs)(AD,{delay:200,children:[(0,Y.jsx)(jD,{"data-slot":`planet-button`,className:LD(`planet-button`,e),ref:c,"data-style":a,"data-size":o,...s,children:t}),(0,Y.jsxs)(MD,{children:[n,(0,Y.jsx)(tO,{shortcuts:l})]})]})});Q.displayName=`Button`;function nO({orientation:e=`horizontal`,size:t,style:n={},...r}){let i={...n,...e===`horizontal`&&!t&&{flex:1},...t&&{width:e===`vertical`?`1px`:t,height:e===`horizontal`?`1px`:t}};return(0,Y.jsx)(`div`,{...r,style:i})}function rO({decorative:e,orientation:t=`vertical`,className:n,...r}){let i=e?{role:`none`}:{"aria-orientation":t===`vertical`?t:void 0,role:`separator`};return(0,Y.jsx)(`div`,{className:LD(`planet-separator`,n),"data-orientation":t,...i,...r})}function iO({editor:e,containerRef:t,query:n,items:r,onSelect:i,onClose:a,orientation:o=`vertical`,autoSelectFirstItem:s=!0}){let[c,l]=(0,J.useState)(s?0:-1);return(0,J.useEffect)(()=>{let n=e=>{if(!r.length)return!1;let t=()=>l(e=>e===-1?0:(e+1)%r.length),n=()=>l(e=>e===-1?r.length-1:(e-1+r.length)%r.length);switch(e.key){case`ArrowUp`:return o===`horizontal`?!1:(e.preventDefault(),n(),!0);case`ArrowDown`:return o===`horizontal`?!1:(e.preventDefault(),t(),!0);case`ArrowLeft`:return o===`vertical`?!1:(e.preventDefault(),n(),!0);case`ArrowRight`:return o===`vertical`?!1:(e.preventDefault(),t(),!0);case`Tab`:return e.preventDefault(),e.shiftKey?n():t(),!0;case`Home`:return e.preventDefault(),l(0),!0;case`End`:return e.preventDefault(),l(r.length-1),!0;case`Enter`:return e.isComposing?!1:(e.preventDefault(),c!==-1&&r[c]&&i?.(r[c]),!0);case`Escape`:return e.preventDefault(),a?.(),!0;default:return!1}},s=null;if(e?s=e.view.dom:t?.current&&(s=t.current),s)return s.addEventListener(`keydown`,n,!0),()=>{s?.removeEventListener(`keydown`,n,!0)}},[e,t,r,c,i,a,o]),(0,J.useEffect)(()=>{n&&l(s?0:-1)},[n,s]),{selectedIndex:r.length?c:void 0,setSelectedIndex:l}}var aO=(e,t)=>{if(typeof e==`function`)e(t);else if(e&&typeof e==`object`&&`current`in e){let n=e;n.current=t}},oO=(e,t)=>{let n=(0,J.useRef)(null);return(0,J.useCallback)(r=>{if(e&&`current`in e){let t=e;t.current=r}n.current&&aO(n.current,null),n.current=t,t&&aO(t,r)},[e,t])},sO=e=>{let[t,n]=(0,J.useState)([]),r=(0,J.useCallback)(()=>e.current?Array.from(e.current.querySelectorAll(`button:not([disabled]), [role="button"]:not([disabled]), [tabindex="0"]:not([disabled])`)):[],[e]);(0,J.useEffect)(()=>{let t=e.current;if(!t)return;let i=()=>n(r());i();let a=new MutationObserver(i);return a.observe(t,{childList:!0,subtree:!0}),()=>a.disconnect()},[r,e]);let{selectedIndex:i}=iO({containerRef:e,items:t,orientation:`horizontal`,onSelect:e=>e.click(),autoSelectFirstItem:!1});(0,J.useEffect)(()=>{let t=e.current;if(!t)return;let n=e=>{let n=e.target;t.contains(n)&&n.setAttribute(`data-focus-visible`,`true`)},r=e=>{let n=e.target;t.contains(n)&&n.removeAttribute(`data-focus-visible`)};return t.addEventListener(`focus`,n,!0),t.addEventListener(`blur`,r,!0),()=>{t.removeEventListener(`focus`,n,!0),t.removeEventListener(`blur`,r,!0)}},[e]),(0,J.useEffect)(()=>{i!==void 0&&t[i]&&t[i].focus()},[i,t])},cO=(0,J.forwardRef)(({children:e,className:t,variant:n=`fixed`,...r},i)=>{let a=(0,J.useRef)(null),o=oO(a,i);return sO(a),(0,Y.jsx)(`div`,{ref:o,role:`toolbar`,"aria-label":`toolbar`,"data-variant":n,className:LD(`planet-toolbar`,t),...r,children:e})});cO.displayName=`Toolbar`;var lO=(0,J.forwardRef)(({children:e,className:t,...n},r)=>(0,Y.jsx)(`div`,{ref:r,role:`group`,className:LD(`planet-toolbar-group`,t),...n,children:e}));lO.displayName=`ToolbarGroup`;var uO=(0,J.forwardRef)(({...e},t)=>(0,Y.jsx)(rO,{ref:t,orientation:`vertical`,decorative:!0,...e}));uO.displayName=`ToolbarSeparator`;var dO=(0,J.memo)(({className:e,...t})=>(0,Y.jsx)(`svg`,{width:`24`,height:`24`,className:e,viewBox:`0 0 24 24`,fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`,...t,children:(0,Y.jsx)(`path`,{d:`M18.7071 6.70711C19.0976 6.31658 19.0976 5.68342 18.7071 5.29289C18.3166 4.90237 17.6834 4.90237 17.2929 5.29289L12 10.5858L6.70711 5.29289C6.31658 4.90237 5.68342 4.90237 5.29289 5.29289C4.90237 5.68342 4.90237 6.31658 5.29289 6.70711L10.5858 12L5.29289 17.2929C4.90237 17.6834 4.90237 18.3166 5.29289 18.7071C5.68342 19.0976 6.31658 19.0976 6.70711 18.7071L12 13.4142L17.2929 18.7071C17.6834 19.0976 18.3166 19.0976 18.7071 18.7071C19.0976 18.3166 19.0976 17.6834 18.7071 17.2929L13.4142 12L18.7071 6.70711Z`,fill:`currentColor`})}));dO.displayName=`CloseIcon`;function fO(e){let[t,n]=(0,J.useState)([]),r=async t=>{if(t.size>e.maxSize){let t=Error(`File size exceeds maximum allowed (${e.maxSize/1024/1024}MB)`);return e.onError?.(t),null}let r=new AbortController,i=crypto.randomUUID(),a={id:i,file:t,progress:0,status:`uploading`,abortController:r};n(e=>[...e,a]);try{if(!e.upload)throw Error(`Upload function is not defined`);let a=await e.upload(t,e=>{n(t=>t.map(t=>t.id===i?{...t,progress:e.progress}:t))},r.signal);if(!a)throw Error(`Upload failed: No URL returned`);return r.signal.aborted?null:(n(e=>e.map(e=>e.id===i?{...e,status:`success`,url:a,progress:100}:e)),e.onSuccess?.(a),a)}catch(t){return r.signal.aborted||(n(e=>e.map(e=>e.id===i?{...e,status:`error`,progress:0}:e)),e.onError?.(t instanceof Error?t:Error(`Upload failed`))),null}};return{fileItems:t,uploadFiles:async t=>{if(!t||t.length===0)return e.onError?.(Error(`No files to upload`)),[];if(e.limit&&t.length>e.limit)return e.onError?.(Error(`Maximum ${e.limit} file${e.limit===1?``:`s`} allowed`)),[];let n=t.map(e=>r(e));return(await Promise.all(n)).filter(e=>e!==null)},removeFileItem:e=>{n(t=>{let n=t.find(t=>t.id===e);return n?.abortController&&n.abortController.abort(),n?.url&&URL.revokeObjectURL(n.url),t.filter(t=>t.id!==e)})},clearAllFiles:()=>{t.forEach(e=>{e.abortController&&e.abortController.abort(),e.url&&URL.revokeObjectURL(e.url)}),n([])}}}var pO=()=>(0,Y.jsxs)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,className:`planet-image-upload-icon`,fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,Y.jsx)(`path`,{d:`M11.1953 4.41771C10.3478 4.08499 9.43578 3.94949 8.5282 4.02147C7.62062 4.09345 6.74133 4.37102 5.95691 4.83316C5.1725 5.2953 4.50354 5.92989 4.00071 6.68886C3.49788 7.44783 3.17436 8.31128 3.05465 9.2138C2.93495 10.1163 3.0222 11.0343 3.3098 11.8981C3.5974 12.7619 4.07781 13.5489 4.71463 14.1995C5.10094 14.5942 5.09414 15.2274 4.69945 15.6137C4.30476 16 3.67163 15.9932 3.28532 15.5985C2.43622 14.731 1.79568 13.6816 1.41221 12.5299C1.02875 11.3781 0.91241 10.1542 1.07201 8.95084C1.23162 7.74748 1.66298 6.59621 2.33343 5.58425C3.00387 4.57229 3.89581 3.72617 4.9417 3.10998C5.98758 2.4938 7.15998 2.1237 8.37008 2.02773C9.58018 1.93176 10.7963 2.11243 11.9262 2.55605C13.0561 2.99968 14.0703 3.69462 14.8919 4.58825C15.5423 5.29573 16.0585 6.11304 16.4177 7.00002H17.4999C18.6799 6.99991 19.8288 7.37933 20.7766 8.08222C21.7245 8.78515 22.4212 9.7743 22.7637 10.9036C23.1062 12.0328 23.0765 13.2423 22.6788 14.3534C22.2812 15.4644 21.5367 16.4181 20.5554 17.0736C20.0962 17.3803 19.4752 17.2567 19.1684 16.7975C18.8617 16.3382 18.9853 15.7172 19.4445 15.4105C20.069 14.9934 20.5427 14.3865 20.7958 13.6794C21.0488 12.9724 21.0678 12.2027 20.8498 11.4841C20.6318 10.7655 20.1885 10.136 19.5853 9.6887C18.9821 9.24138 18.251 8.99993 17.5001 9.00002H15.71C15.2679 9.00002 14.8783 8.70973 14.7518 8.28611C14.4913 7.41374 14.0357 6.61208 13.4195 5.94186C12.8034 5.27164 12.0427 4.75043 11.1953 4.41771Z`,fill:`currentColor`}),(0,Y.jsx)(`path`,{d:`M11 14.4142V21C11 21.5523 11.4477 22 12 22C12.5523 22 13 21.5523 13 21V14.4142L15.2929 16.7071C15.6834 17.0976 16.3166 17.0976 16.7071 16.7071C17.0976 16.3166 17.0976 15.6834 16.7071 15.2929L12.7078 11.2936C12.7054 11.2912 12.703 11.2888 12.7005 11.2864C12.5208 11.1099 12.2746 11.0008 12.003 11L12 11L11.997 11C11.8625 11.0004 11.7343 11.0273 11.6172 11.0759C11.502 11.1236 11.3938 11.1937 11.2995 11.2864C11.297 11.2888 11.2946 11.2912 11.2922 11.2936L7.29289 15.2929C6.90237 15.6834 6.90237 16.3166 7.29289 16.7071C7.68342 17.0976 8.31658 17.0976 8.70711 16.7071L11 14.4142Z`,fill:`currentColor`})]}),mO=()=>(0,Y.jsx)(`svg`,{width:`43`,height:`57`,viewBox:`0 0 43 57`,fill:`currentColor`,className:`planet-image-upload-dropzone-rect-primary`,xmlns:`http://www.w3.org/2000/svg`,children:(0,Y.jsx)(`path`,{d:`M0.75 10.75C0.75 5.64137 4.89137 1.5 10 1.5H32.3431C33.2051 1.5 34.0317 1.84241 34.6412 2.4519L40.2981 8.10876C40.9076 8.71825 41.25 9.5449 41.25 10.4069V46.75C41.25 51.8586 37.1086 56 32 56H10C4.89137 56 0.75 51.8586 0.75 46.75V10.75Z`,fill:`currentColor`,fillOpacity:`0.11`,stroke:`currentColor`,strokeWidth:`1.5`})}),hO=()=>(0,Y.jsx)(`svg`,{width:`10`,height:`10`,className:`planet-image-upload-dropzone-rect-secondary`,viewBox:`0 0 10 10`,fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`,children:(0,Y.jsx)(`path`,{d:`M0 0.75H0.343146C1.40401 0.75 2.42143 1.17143 3.17157 1.92157L8.82843 7.57843C9.57857 8.32857 10 9.34599 10 10.4069V10.75H4C1.79086 10.75 0 8.95914 0 6.75V0.75Z`,fill:`currentColor`})}),gO=({onFile:e,children:t})=>{let[n,r]=(0,J.useState)(!1),[i,a]=(0,J.useState)(!1);return(0,Y.jsx)(`div`,{className:`planet-image-upload-drag-area ${i?`drag-active`:``} ${n?`drag-over`:``}`,onDragEnter:e=>{e.preventDefault(),e.stopPropagation(),a(!0)},onDragLeave:e=>{e.preventDefault(),e.stopPropagation(),e.currentTarget.contains(e.relatedTarget)||(a(!1),r(!1))},onDragOver:e=>{e.preventDefault(),e.stopPropagation(),r(!0)},onDrop:t=>{t.preventDefault(),t.stopPropagation(),a(!1),r(!1);let n=Array.from(t.dataTransfer.files);n.length>0&&e(n)},children:t})},_O=({fileItem:e,onRemove:t})=>(0,Y.jsxs)(`div`,{className:`planet-image-upload-preview`,children:[e.status===`uploading`&&(0,Y.jsx)(`div`,{className:`planet-image-upload-progress`,style:{width:`${e.progress}%`}}),(0,Y.jsxs)(`div`,{className:`planet-image-upload-preview-content`,children:[(0,Y.jsxs)(`div`,{className:`planet-image-upload-file-info`,children:[(0,Y.jsx)(`div`,{className:`planet-image-upload-file-icon`,children:(0,Y.jsx)(pO,{})}),(0,Y.jsxs)(`div`,{className:`planet-image-upload-details`,children:[(0,Y.jsx)(`span`,{className:`planet-image-upload-text`,children:e.file.name}),(0,Y.jsx)(`span`,{className:`planet-image-upload-subtext`,children:(e=>{if(e===0)return`0 Bytes`;let t=1024,n=[`Bytes`,`KB`,`MB`,`GB`],r=Math.floor(Math.log(e)/Math.log(t));return`${parseFloat((e/t**r).toFixed(2))} ${n[r]}`})(e.file.size)})]})]}),(0,Y.jsxs)(`div`,{className:`planet-image-upload-actions`,children:[e.status===`uploading`&&(0,Y.jsxs)(`span`,{className:`planet-image-upload-progress-text`,children:[e.progress,`%`]}),(0,Y.jsx)(Q,{type:`button`,variant:`ghost`,onClick:e=>{e.stopPropagation(),t()},children:(0,Y.jsx)(dO,{className:`planet-button-icon`})})]})]})]}),vO=({maxSize:e,limit:t})=>(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`div`,{className:`planet-image-upload-dropzone`,children:[(0,Y.jsx)(mO,{}),(0,Y.jsx)(hO,{}),(0,Y.jsx)(`div`,{className:`planet-image-upload-icon-container`,children:(0,Y.jsx)(pO,{})})]}),(0,Y.jsxs)(`div`,{className:`planet-image-upload-content`,children:[(0,Y.jsxs)(`span`,{className:`planet-image-upload-text`,children:[(0,Y.jsx)(`em`,{children:`Click to upload`}),` or drag and drop`]}),(0,Y.jsxs)(`span`,{className:`planet-image-upload-subtext`,children:[`Maximum `,t,` file`,t===1?``:`s`,`, `,e/1024/1024,`MB each.`]})]})]}),yO=e=>{let{accept:t,limit:n,maxSize:r}=e.node.attrs,i=(0,J.useRef)(null),a=e.extension,{fileItems:o,uploadFiles:s,removeFileItem:c,clearAllFiles:l}=fO({maxSize:r,limit:n,accept:t,upload:a.options.upload,onSuccess:a.options.onSuccess,onError:a.options.onError}),u=async t=>{let n=await s(t);if(n.length>0){let r=e.getPos();if(WD(r)){let i=n.map((e,n)=>{let r=t[n]?.name.replace(/\.[^/.]+$/,``)||`unknown`;return{type:a.options.type,attrs:{...a.options,src:e,alt:r,title:r}}});e.editor.chain().focus().deleteRange({from:r,to:r+e.node.nodeSize}).insertContentAt(r,i).run(),UD(e.editor)}}},d=e=>{let t=e.target.files;if(!t||t.length===0){a.options.onError?.(Error(`No file selected`));return}u(Array.from(t))},f=()=>{i.current&&o.length===0&&(i.current.value=``,i.current.click())},p=o.length>0;return(0,Y.jsxs)(Dp,{className:`planet-image-upload`,tabIndex:0,onClick:f,children:[!p&&(0,Y.jsx)(gO,{onFile:u,children:(0,Y.jsx)(vO,{maxSize:r,limit:n})}),p&&(0,Y.jsxs)(`div`,{className:`planet-image-upload-previews`,children:[o.length>1&&(0,Y.jsxs)(`div`,{className:`planet-image-upload-header`,children:[(0,Y.jsxs)(`span`,{children:[`Uploading `,o.length,` files`]}),(0,Y.jsx)(Q,{type:`button`,variant:`ghost`,onClick:e=>{e.stopPropagation(),l()},children:`Clear All`})]}),o.map(e=>(0,Y.jsx)(_O,{fileItem:e,onRemove:()=>c(e.id)},e.id))]}),(0,Y.jsx)(`input`,{ref:i,name:`file`,accept:t,type:`file`,multiple:n>1,onChange:d,onClick:e=>e.stopPropagation()})]})},bO=rf.create({name:`imageUpload`,group:`block`,draggable:!0,selectable:!0,atom:!0,addOptions(){return{type:`image`,accept:`image/*`,limit:1,maxSize:0,upload:void 0,onError:void 0,onSuccess:void 0,HTMLAttributes:{}}},addAttributes(){return{accept:{default:this.options.accept},limit:{default:this.options.limit},maxSize:{default:this.options.maxSize}}},parseHTML(){return[{tag:`div[data-type="image-upload"]`}]},renderHTML({HTMLAttributes:e}){return[`div`,G({"data-type":`image-upload`},e)]},addNodeView(){return Fp(yO)},addCommands(){return{setImageUploadNode:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e})}},addKeyboardShortcuts(){return{Enter:({editor:e})=>{let{selection:t}=e.state,{nodeAfter:n}=t.$from;if(n&&n.type.name===`imageUpload`&&e.isActive(`imageUpload`)){let n=e.view.nodeDOM(t.$from.pos);if(n&&n instanceof HTMLElement){let e=n.firstChild;if(e&&e instanceof HTMLElement)return e.click(),!0}}return!1}}}}),xO=Fh.extend({renderHTML(){return[`div`,G(this.options.HTMLAttributes,{"data-type":this.name}),[`hr`]]}}),SO=new Zn(`planetSearch`);function CO(e,t,n){let r=[];if(!t)return r;let i=n?t:t.toLowerCase();return e.descendants((e,t)=>{if(!e.isTextblock)return;let a=``,o=[];e.descendants((e,n)=>{if(e.isText&&e.text)for(let r=0;r<e.text.length;r++)a+=e.text[r],o.push(t+1+n+r)});let s=n?a:a.toLowerCase(),c=0;for(;(c=s.indexOf(i,c))!==-1;){let e=o[c],t=o[c+i.length-1]+1;e!=null&&t!=null&&r.push({from:e,to:t}),c+=i.length}}),r}function wO(e,t,n){let r=t.map((e,t)=>xs.inline(e.from,e.to,{class:t===n?`planet-search-match planet-search-match--current`:`planet-search-match`}));return ws.create(e,r)}var TO={searchTerm:``,caseSensitive:!1,matches:[],currentIndex:-1,decorations:ws.empty},EO=q.create({name:`planetSearch`,addCommands(){return{setSearchTerm:e=>({tr:t,dispatch:n})=>(n&&n(t.setMeta(SO,{searchTerm:e,currentIndex:0})),!0),setSearchCaseSensitive:e=>({tr:t,dispatch:n})=>(n&&n(t.setMeta(SO,{caseSensitive:e,currentIndex:0})),!0),nextSearchMatch:()=>({tr:e,state:t,dispatch:n})=>{let r=SO.getState(t);if(!r||r.matches.length===0)return!1;let i=(r.currentIndex+1)%r.matches.length;return n&&n(e.setMeta(SO,{currentIndex:i})),!0},previousSearchMatch:()=>({tr:e,state:t,dispatch:n})=>{let r=SO.getState(t);if(!r||r.matches.length===0)return!1;let i=(r.currentIndex-1+r.matches.length)%r.matches.length;return n&&n(e.setMeta(SO,{currentIndex:i})),!0},clearSearch:()=>({tr:e,dispatch:t})=>(t&&t(e.setMeta(SO,{searchTerm:``,currentIndex:-1})),!0)}},addProseMirrorPlugins(){return[new Jn({key:SO,state:{init:()=>TO,apply(e,t,n,r){let i=e.getMeta(SO);if(!i&&!e.docChanged)return t;let a=i?.searchTerm??t.searchTerm,o=i?.caseSensitive??t.caseSensitive,s=CO(r.doc,a,o),c=i?.currentIndex??t.currentIndex;return s.length===0?c=-1:(c<0||c>=s.length)&&(c=0),{searchTerm:a,caseSensitive:o,matches:s,currentIndex:c,decorations:wO(r.doc,s,c)}}},props:{decorations(e){return SO.getState(e)?.decorations}}})]}}),DO=(0,J.memo)(({className:e,...t})=>(0,Y.jsx)(`svg`,{width:`24`,height:`24`,className:e,viewBox:`0 0 24 24`,fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`,...t,children:(0,Y.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M5.29289 8.29289C5.68342 7.90237 6.31658 7.90237 6.70711 8.29289L12 13.5858L17.2929 8.29289C17.6834 7.90237 18.3166 7.90237 18.7071 8.29289C19.0976 8.68342 19.0976 9.31658 18.7071 9.70711L12.7071 15.7071C12.3166 16.0976 11.6834 16.0976 11.2929 15.7071L5.29289 9.70711C4.90237 9.31658 4.90237 8.68342 5.29289 8.29289Z`,fill:`currentColor`})}));DO.displayName=`ChevronDownIcon`;function OO(e){let t=e.storage.pages;return!t||!(`activeEditor`in t)?null:t.activeEditor??null}function kO(e){let{editor:t}=wp(),n=e??t,[r,i]=(0,J.useState)(null);return(0,J.useEffect)(()=>{if(!n){i(null);return}let e=()=>i(OO(n));return e(),n.on(`update`,e),n.on(`selectionUpdate`,e),()=>{n.off(`update`,e),n.off(`selectionUpdate`,e)}},[n]),(0,J.useEffect)(()=>{if(!r)return;let e=()=>i(null);return r.on(`destroy`,e),()=>{r.off(`destroy`,e)}},[r]),_p({editor:r??n,selector(e){return e.editor?{editor:e.editor,editorState:e.editor.state,canCommand:e.editor.can}:{editor:null,editorState:void 0,canCommand:void 0}}})??{editor:null}}var AO=(0,J.forwardRef)(({variant:e,size:t=`default`,appearance:n=`default`,trimText:r=!1,className:i,children:a,...o},s)=>(0,Y.jsx)(`div`,{ref:s,className:`planet-badge ${i||``}`,"data-style":e,"data-size":t,"data-appearance":n,"data-text-trim":r?`on`:`off`,...o,children:a}));AO.displayName=`Badge`;function jO({level:e,shortcutKeys:t=BO[e]}){return(0,Y.jsx)(AO,{children:BD({shortcutKeys:t})})}var MO=(0,J.forwardRef)(({editor:e,level:t,text:n,hideWhenUnavailable:r=!1,onToggled:i,showShortcut:a=!1,onClick:o,children:s,...c},l)=>{let{editor:u}=kO(e),{isVisible:d,canToggle:f,isActive:p,handleToggle:m,label:h,Icon:g,shortcutKeys:_}=GO({editor:u,level:t,hideWhenUnavailable:r,onToggled:i}),v=(0,J.useCallback)(e=>{o?.(e),!e.defaultPrevented&&m()},[m,o]);return d?(0,Y.jsx)(Q,{type:`button`,variant:`ghost`,"data-active-state":p?`on`:`off`,role:`button`,tabIndex:-1,disabled:!f,"data-disabled":!f,"aria-label":h,"aria-pressed":p,tooltip:h,onClick:v,...c,ref:l,children:s??(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(g,{className:`planet-button-icon`}),n&&(0,Y.jsx)(`span`,{className:`planet-button-text`,children:n}),a&&(0,Y.jsx)(jO,{level:t,shortcutKeys:_})]})}):null});MO.displayName=`HeadingButton`;var NO=(0,J.memo)(({className:e,...t})=>(0,Y.jsxs)(`svg`,{width:`24`,height:`24`,className:e,viewBox:`0 0 24 24`,fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`,...t,children:[(0,Y.jsx)(`path`,{d:`M5 6C5 5.44772 4.55228 5 4 5C3.44772 5 3 5.44772 3 6V18C3 18.5523 3.44772 19 4 19C4.55228 19 5 18.5523 5 18V13H11V18C11 18.5523 11.4477 19 12 19C12.5523 19 13 18.5523 13 18V6C13 5.44772 12.5523 5 12 5C11.4477 5 11 5.44772 11 6V11H5V6Z`,fill:`currentColor`}),(0,Y.jsx)(`path`,{d:`M21.0001 10C21.0001 9.63121 20.7971 9.29235 20.472 9.11833C20.1468 8.94431 19.7523 8.96338 19.4454 9.16795L16.4454 11.168C15.9859 11.4743 15.8617 12.0952 16.1681 12.5547C16.4744 13.0142 17.0953 13.1384 17.5548 12.8321L19.0001 11.8685V18C19.0001 18.5523 19.4478 19 20.0001 19C20.5524 19 21.0001 18.5523 21.0001 18V10Z`,fill:`currentColor`})]}));NO.displayName=`HeadingOneIcon`;var PO=(0,J.memo)(({className:e,...t})=>(0,Y.jsxs)(`svg`,{width:`24`,height:`24`,className:e,viewBox:`0 0 24 24`,fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`,...t,children:[(0,Y.jsx)(`path`,{d:`M5 6C5 5.44772 4.55228 5 4 5C3.44772 5 3 5.44772 3 6V18C3 18.5523 3.44772 19 4 19C4.55228 19 5 18.5523 5 18V13H11V18C11 18.5523 11.4477 19 12 19C12.5523 19 13 18.5523 13 18V6C13 5.44772 12.5523 5 12 5C11.4477 5 11 5.44772 11 6V11H5V6Z`,fill:`currentColor`}),(0,Y.jsx)(`path`,{d:`M22.0001 12C22.0001 10.7611 21.1663 9.79297 20.0663 9.42632C18.9547 9.05578 17.6171 9.28724 16.4001 10.2C15.9582 10.5314 15.8687 11.1582 16.2001 11.6C16.5314 12.0418 17.1582 12.1314 17.6001 11.8C18.383 11.2128 19.0455 11.1942 19.4338 11.3237C19.8339 11.457 20.0001 11.7389 20.0001 12C20.0001 12.4839 19.8554 12.7379 19.6537 12.9481C19.4275 13.1837 19.1378 13.363 18.7055 13.6307C18.6313 13.6767 18.553 13.7252 18.4701 13.777C17.9572 14.0975 17.3128 14.5261 16.8163 15.2087C16.3007 15.9177 16.0001 16.8183 16.0001 18C16.0001 18.5523 16.4478 19 17.0001 19H21.0001C21.5523 19 22.0001 18.5523 22.0001 18C22.0001 17.4477 21.5523 17 21.0001 17H18.131C18.21 16.742 18.3176 16.5448 18.4338 16.385C18.6873 16.0364 19.0429 15.7775 19.5301 15.473C19.5898 15.4357 19.6536 15.3966 19.7205 15.3556C20.139 15.0992 20.6783 14.7687 21.0964 14.3332C21.6447 13.7621 22.0001 13.0161 22.0001 12Z`,fill:`currentColor`})]}));PO.displayName=`HeadingTwoIcon`;var FO=(0,J.memo)(({className:e,...t})=>(0,Y.jsxs)(`svg`,{width:`24`,height:`24`,className:e,viewBox:`0 0 24 24`,fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`,...t,children:[(0,Y.jsx)(`path`,{d:`M4 5C4.55228 5 5 5.44772 5 6V11H11V6C11 5.44772 11.4477 5 12 5C12.5523 5 13 5.44772 13 6V18C13 18.5523 12.5523 19 12 19C11.4477 19 11 18.5523 11 18V13H5V18C5 18.5523 4.55228 19 4 19C3.44772 19 3 18.5523 3 18V6C3 5.44772 3.44772 5 4 5Z`,fill:`currentColor`}),(0,Y.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M19.4608 11.2169C19.1135 11.0531 18.5876 11.0204 18.0069 11.3619C17.5309 11.642 16.918 11.4831 16.638 11.007C16.358 10.531 16.5169 9.91809 16.9929 9.63807C18.1123 8.97962 19.3364 8.94691 20.314 9.40808C21.2839 9.86558 21.9999 10.818 21.9999 12C21.9999 12.7957 21.6838 13.5587 21.1212 14.1213C20.5586 14.6839 19.7956 15 18.9999 15C18.4476 15 17.9999 14.5523 17.9999 14C17.9999 13.4477 18.4476 13 18.9999 13C19.2651 13 19.5195 12.8947 19.707 12.7071C19.8946 12.5196 19.9999 12.2652 19.9999 12C19.9999 11.6821 19.8159 11.3844 19.4608 11.2169Z`,fill:`currentColor`}),(0,Y.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M18.0001 14C18.0001 13.4477 18.4478 13 19.0001 13C19.7957 13 20.5588 13.3161 21.1214 13.8787C21.684 14.4413 22.0001 15.2043 22.0001 16C22.0001 17.2853 21.2767 18.3971 20.1604 18.8994C19.0257 19.41 17.642 19.2315 16.4001 18.3C15.9582 17.9686 15.8687 17.3418 16.2001 16.9C16.5314 16.4582 17.1582 16.3686 17.6001 16.7C18.3581 17.2685 18.9744 17.24 19.3397 17.0756C19.7234 16.9029 20.0001 16.5147 20.0001 16C20.0001 15.7348 19.8947 15.4804 19.7072 15.2929C19.5196 15.1054 19.2653 15 19.0001 15C18.4478 15 18.0001 14.5523 18.0001 14Z`,fill:`currentColor`})]}));FO.displayName=`HeadingThreeIcon`;var IO=(0,J.memo)(({className:e,...t})=>(0,Y.jsxs)(`svg`,{width:`24`,height:`24`,className:e,viewBox:`0 0 24 24`,fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`,...t,children:[(0,Y.jsx)(`path`,{d:`M4 5C4.55228 5 5 5.44772 5 6V11H11V6C11 5.44772 11.4477 5 12 5C12.5523 5 13 5.44772 13 6V18C13 18.5523 12.5523 19 12 19C11.4477 19 11 18.5523 11 18V13H5V18C5 18.5523 4.55228 19 4 19C3.44772 19 3 18.5523 3 18V6C3 5.44772 3.44772 5 4 5Z`,fill:`currentColor`}),(0,Y.jsx)(`path`,{d:`M17 9C17.5523 9 18 9.44772 18 10V13H20V10C20 9.44772 20.4477 9 21 9C21.5523 9 22 9.44772 22 10V18C22 18.5523 21.5523 19 21 19C20.4477 19 20 18.5523 20 18V15H17C16.4477 15 16 14.5523 16 14V10C16 9.44772 16.4477 9 17 9Z`,fill:`currentColor`})]}));IO.displayName=`HeadingFourIcon`;var LO=(0,J.memo)(({className:e,...t})=>(0,Y.jsxs)(`svg`,{width:`24`,height:`24`,className:e,viewBox:`0 0 24 24`,fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`,...t,children:[(0,Y.jsx)(`path`,{d:`M5 6C5 5.44772 4.55228 5 4 5C3.44772 5 3 5.44772 3 6V18C3 18.5523 3.44772 19 4 19C4.55228 19 5 18.5523 5 18V13H11V18C11 18.5523 11.4477 19 12 19C12.5523 19 13 18.5523 13 18V6C13 5.44772 12.5523 5 12 5C11.4477 5 11 5.44772 11 6V11H5V6Z`,fill:`currentColor`}),(0,Y.jsx)(`path`,{d:`M16 10C16 9.44772 16.4477 9 17 9H21C21.5523 9 22 9.44772 22 10C22 10.5523 21.5523 11 21 11H18V12H18.3C20.2754 12 22 13.4739 22 15.5C22 17.5261 20.2754 19 18.3 19C17.6457 19 17.0925 18.8643 16.5528 18.5944C16.0588 18.3474 15.8586 17.7468 16.1055 17.2528C16.3525 16.7588 16.9532 16.5586 17.4472 16.8056C17.7074 16.9357 17.9542 17 18.3 17C19.3246 17 20 16.2739 20 15.5C20 14.7261 19.3246 14 18.3 14H17C16.4477 14 16 13.5523 16 13L16 12.9928V10Z`,fill:`currentColor`})]}));LO.displayName=`HeadingFiveIcon`;var RO=(0,J.memo)(({className:e,...t})=>(0,Y.jsxs)(`svg`,{width:`24`,height:`24`,className:e,viewBox:`0 0 24 24`,fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`,...t,children:[(0,Y.jsx)(`path`,{d:`M5 6C5 5.44772 4.55228 5 4 5C3.44772 5 3 5.44772 3 6V18C3 18.5523 3.44772 19 4 19C4.55228 19 5 18.5523 5 18V13H11V18C11 18.5523 11.4477 19 12 19C12.5523 19 13 18.5523 13 18V6C13 5.44772 12.5523 5 12 5C11.4477 5 11 5.44772 11 6V11H5V6Z`,fill:`currentColor`}),(0,Y.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M20.7071 9.29289C21.0976 9.68342 21.0976 10.3166 20.7071 10.7071C19.8392 11.575 19.2179 12.2949 18.7889 13.0073C18.8587 13.0025 18.929 13 19 13C20.6569 13 22 14.3431 22 16C22 17.6569 20.6569 19 19 19C17.3431 19 16 17.6569 16 16C16 14.6007 16.2837 13.4368 16.8676 12.3419C17.4384 11.2717 18.2728 10.3129 19.2929 9.29289C19.6834 8.90237 20.3166 8.90237 20.7071 9.29289ZM19 17C18.4477 17 18 16.5523 18 16C18 15.4477 18.4477 15 19 15C19.5523 15 20 15.4477 20 16C20 16.5523 19.5523 17 19 17Z`,fill:`currentColor`})]}));RO.displayName=`HeadingSixIcon`;var zO={1:NO,2:PO,3:FO,4:IO,5:LO,6:RO},BO={1:`ctrl+alt+1`,2:`ctrl+alt+2`,3:`ctrl+alt+3`,4:`ctrl+alt+4`,5:`ctrl+alt+5`,6:`ctrl+alt+6`};function VO(e,t,n=!0){return!e||!e.isEditable||!HD(`heading`,e)||JD(e,[`image`])?!1:n?YD(e,[`paragraph`,`heading`,`bulletList`,`orderedList`,`taskList`,`blockquote`,`codeBlock`])?t?e.can().setNode(`heading`,{level:t})||e.can().clearNodes():e.can().setNode(`heading`)||e.can().clearNodes():!1:t?e.can().setNode(`heading`,{level:t}):e.can().setNode(`heading`)}function HO(e,t){return!e||!e.isEditable?!1:Array.isArray(t)?t.some(t=>e.isActive(`heading`,{level:t})):t?e.isActive(`heading`,{level:t}):e.isActive(`heading`)}function UO(e,t){if(!e||!e.isEditable)return!1;let n=Array.isArray(t)?t:[t],r=n.find(t=>VO(e,t));if(!r)return!1;try{let t=e.view,i=t.state,a=i.tr,o=eO(e),s=YD(e,[`paragraph`,`heading`,`bulletList`,`orderedList`,`taskList`,`blockquote`,`codeBlock`])&&o.length===1;if((i.selection.empty||i.selection instanceof P)&&s){let n=qD({editor:e,node:i.selection.$anchor.node(1)})?.pos;if(!WD(n))return!1;a=a.setSelection(F.create(i.doc,n)),t.dispatch(a),i=t.state}let c=i.selection,l=e.chain().focus();if(c instanceof F){let e=c.node.firstChild?.firstChild,t=c.node.lastChild?.lastChild,n=e?c.from+e.nodeSize:c.from+1,r=t?c.to-t.nodeSize:c.to-1,a=i.doc.resolve(n),o=i.doc.resolve(r);l=l.setTextSelection(P.between(a,o)).clearNodes()}return(n.some(t=>e.isActive(`heading`,{level:t}))?l.setNode(`paragraph`):l.setNode(`heading`,{level:r})).run(),e.chain().focus().selectTextblockEnd().run(),!0}catch{return!1}}function WO(e){let{editor:t,level:n,hideWhenUnavailable:r}=e;return t?r?!t.isEditable||!HD(`heading`,t)?!1:t.isActive(`code`)?!0:Array.isArray(n)?n.some(e=>VO(t,e)):VO(t,n):!0:!1}function GO(e){let{editor:t,level:n,hideWhenUnavailable:r=!1,onToggled:i}=e,{editor:a}=kO(t),[o,s]=(0,J.useState)(!0),c=VO(a,n),l=HO(a,n);return(0,J.useEffect)(()=>{if(!a)return;let e=()=>{s(WO({editor:a,level:n,hideWhenUnavailable:r}))};return e(),a.on(`selectionUpdate`,e),()=>{a.off(`selectionUpdate`,e)}},[a,n,r]),{isVisible:o,isActive:l,handleToggle:(0,J.useCallback)(()=>{if(!a)return!1;let e=UO(a,n);return e&&i?.(),e},[a,n,i]),canToggle:c,label:`Heading ${n}`,shortcutKeys:BO[n],Icon:zO[n]}}typeof window<`u`&&window.document&&window.document.createElement;function $(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}function KO(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function qO(...e){return t=>{let n=!1,r=e.map(e=>{let r=KO(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():KO(e[t],null)}}}}function JO(...e){return J.useCallback(qO(...e),e)}function YO(e,t=[]){let n=[];function r(t,r){let i=J.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=J.useMemo(()=>o,Object.values(o));return(0,Y.jsx)(s.Provider,{value:c,children:r})};o.displayName=t+`Provider`;function s(n,o){let s=o?.[e]?.[a]||i,c=J.useContext(s);if(c)return c;if(r!==void 0)return r;throw Error(`\`${n}\` must be used within \`${t}\``)}return[o,s]}let i=()=>{let t=n.map(e=>J.createContext(e));return function(n){let r=n?.[e]||t;return J.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,XO(i,...t)]}function XO(...e){let t=e[0];if(e.length===1)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return J.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}var ZO=globalThis?.document?J.useLayoutEffect:()=>{},QO=J.useInsertionEffect||ZO;function $O({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,a,o]=ek({defaultProp:t,onChange:n}),s=e!==void 0,c=s?e:i;{let t=J.useRef(e!==void 0);J.useEffect(()=>{let e=t.current;e!==s&&console.warn(`${r} is changing from ${e?`controlled`:`uncontrolled`} to ${s?`controlled`:`uncontrolled`}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),t.current=s},[s,r])}return[c,J.useCallback(t=>{if(s){let n=tk(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}function ek({defaultProp:e,onChange:t}){let[n,r]=J.useState(e),i=J.useRef(n),a=J.useRef(t);return QO(()=>{a.current=t},[t]),J.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function tk(e){return typeof e==`function`}function nk(e){let t=J.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];lk(r)&&typeof pk==`function`&&(r=pk(r._payload)),J.Children.forEach(r,e=>{if(sk(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;lk(n)&&typeof pk==`function`&&(n=pk(n._payload)),a=ik(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=J.cloneElement(a,void 0,s):!o&&J.Children.count(r)===1&&J.isValidElement(r)&&(a=r);let c=a?ok(a):void 0,l=JO(n,c);if(!a){if(r||r===0)throw Error(o?fk(e):dk(e));return r}let u=ak(i,a.props??{});return a.type!==J.Fragment&&(u.ref=n?l:c),J.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}var rk=Symbol.for(`radix.slottable`),ik=(e,t)=>{if(`child`in e.props){let t=e.props.child;return J.isValidElement(t)?J.cloneElement(t,void 0,e.props.children(t.props.children)):null}return J.isValidElement(t)?t:null};function ak(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function ok(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function sk(e){return J.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===rk}var ck=Symbol.for(`react.lazy`);function lk(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===ck&&`_payload`in e&&uk(e._payload)}function uk(e){return typeof e==`object`&&!!e&&`then`in e}var dk=e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,fk=e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,pk=J.use,mk=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=nk(`Primitive.${t}`),r=J.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,Y.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function hk(e,t){e&&op.flushSync(()=>e.dispatchEvent(t))}function gk(e){let t=e+`CollectionProvider`,[n,r]=YO(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=e=>{let{scope:t,children:n}=e,r=J.useRef(null),a=J.useRef(new Map).current;return(0,Y.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})};o.displayName=t;let s=e+`CollectionSlot`,c=nk(s),l=J.forwardRef((e,t)=>{let{scope:n,children:r}=e;return(0,Y.jsx)(c,{ref:JO(t,a(s,n).collectionRef),children:r})});l.displayName=s;let u=e+`CollectionItemSlot`,d=`data-radix-collection-item`,f=nk(u),p=J.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=J.useRef(null),s=JO(t,o),c=a(u,n);return J.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,Y.jsx)(f,{[d]:``,ref:s,children:r})});p.displayName=u;function m(t){let n=a(e+`CollectionConsumer`,t);return J.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${d}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return[{Provider:o,Slot:l,ItemSlot:p},m,r]}var _k=J.createContext(void 0);function vk(e){let t=J.useContext(_k);return e||t||`ltr`}function yk(e){let t=J.useRef(e);return J.useEffect(()=>{t.current=e}),J.useMemo(()=>((...e)=>t.current?.(...e)),[])}function bk(e,t=globalThis?.document){let n=yk(e);J.useEffect(()=>{let e=e=>{e.key===`Escape`&&n(e)};return t.addEventListener(`keydown`,e,{capture:!0}),()=>t.removeEventListener(`keydown`,e,{capture:!0})},[n,t])}var xk=`DismissableLayer`,Sk=`dismissableLayer.update`,Ck=`dismissableLayer.pointerDownOutside`,wk=`dismissableLayer.focusOutside`,Tk,Ek=J.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Dk=J.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:s,onDismiss:c,...l}=e,u=J.useContext(Ek),[d,f]=J.useState(null),p=d?.ownerDocument??globalThis?.document,[,m]=J.useState({}),h=JO(t,e=>f(e)),g=Array.from(u.layers),[_]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),v=g.indexOf(_),y=d?g.indexOf(d):-1,b=u.layersWithOutsidePointerEventsDisabled.size>0,x=y>=v,S=J.useRef(!1),C=Ak(e=>{let t=e.target;if(!(t instanceof Node))return;let n=[...u.branches].some(e=>e.contains(t));!x||n||(a?.(e),s?.(e),e.defaultPrevented||c?.())},{ownerDocument:p,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:S,dismissableSurfaces:u.dismissableSurfaces}),w=jk(e=>{if(r&&S.current)return;let t=e.target;[...u.branches].some(e=>e.contains(t))||(o?.(e),s?.(e),e.defaultPrevented||c?.())},p);return bk(e=>{y===u.layers.size-1&&(i?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))},p),J.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Tk=p.body.style.pointerEvents,p.body.style.pointerEvents=`none`),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),Mk(),()=>{n&&(u.layersWithOutsidePointerEventsDisabled.delete(d),u.layersWithOutsidePointerEventsDisabled.size===0&&(p.body.style.pointerEvents=Tk))}},[d,p,n,u]),J.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),Mk())},[d,u]),J.useEffect(()=>{let e=()=>m({});return document.addEventListener(Sk,e),()=>document.removeEventListener(Sk,e)},[]),(0,Y.jsx)(mk.div,{...l,ref:h,style:{pointerEvents:b?x?`auto`:`none`:void 0,...e.style},onFocusCapture:$(e.onFocusCapture,w.onFocusCapture),onBlurCapture:$(e.onBlurCapture,w.onBlurCapture),onPointerDownCapture:$(e.onPointerDownCapture,C.onPointerDownCapture)})});Dk.displayName=xk;var Ok=`DismissableLayerBranch`,kk=J.forwardRef((e,t)=>{let n=J.useContext(Ek),r=J.useRef(null),i=JO(t,r);return J.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,Y.jsx)(mk.div,{...e,ref:i})});kk.displayName=Ok;function Ak(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a}=t,o=yk(e),s=J.useRef(!1),c=J.useRef(!1),l=J.useRef(new Map),u=J.useRef(()=>{});return J.useEffect(()=>{function e(){c.current=!1,i.current=!1,l.current.clear()}function t(){return Array.from(l.current.values()).some(Boolean)}function d(e){if(!c.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||l.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{c.current&&u.current()},0)}function f(e){c.current&&l.current.set(e.type,!1)}let p=a=>{if(a.target&&!s.current){let s=function(){n.removeEventListener(`click`,u.current);let r=t();e(),r||Nk(Ck,o,d,{discrete:!0})},d={originalEvent:a};c.current=!0,i.current=r&&a.button===0,l.current.clear(),!r||a.button!==0?s():(n.removeEventListener(`click`,u.current),u.current=s,n.addEventListener(`click`,u.current,{once:!0}))}else n.removeEventListener(`click`,u.current),e();s.current=!1},m=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of m)n.addEventListener(e,d,!0),n.addEventListener(e,f);let h=window.setTimeout(()=>{n.addEventListener(`pointerdown`,p)},0);return()=>{window.clearTimeout(h),n.removeEventListener(`pointerdown`,p),n.removeEventListener(`click`,u.current);for(let e of m)n.removeEventListener(e,d,!0),n.removeEventListener(e,f)}},[n,o,r,i,a]),{onPointerDownCapture:()=>s.current=!0}}function jk(e,t=globalThis?.document){let n=yk(e),r=J.useRef(!1);return J.useEffect(()=>{let e=e=>{e.target&&!r.current&&Nk(wk,n,{originalEvent:e},{discrete:!1})};return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Mk(){let e=new CustomEvent(Sk);document.dispatchEvent(e)}function Nk(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?hk(i,a):i.dispatchEvent(a)}var Pk=0,Fk=null;function Ik(){J.useEffect(()=>{Fk||={start:Lk(),end:Lk()};let{start:e,end:t}=Fk;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),Pk++,()=>{Pk===1&&(Fk?.start.remove(),Fk?.end.remove(),Fk=null),Pk=Math.max(0,Pk-1)}},[])}function Lk(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}var Rk=`focusScope.autoFocusOnMount`,zk=`focusScope.autoFocusOnUnmount`,Bk={bubbles:!1,cancelable:!0},Vk=`FocusScope`,Hk=J.forwardRef((e,t)=>{let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=J.useState(null),l=yk(i),u=yk(a),d=J.useRef(null),f=JO(t,e=>c(e)),p=J.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;J.useEffect(()=>{if(r){let e=function(e){if(p.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:Yk(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||Yk(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&Yk(s)};document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,s,p.paused]),J.useEffect(()=>{if(s){Xk.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(Rk,Bk);s.addEventListener(Rk,l),s.dispatchEvent(t),t.defaultPrevented||(Uk($k(Gk(s)),{select:!0}),document.activeElement===e&&Yk(s))}return()=>{s.removeEventListener(Rk,l),setTimeout(()=>{let t=new CustomEvent(zk,Bk);s.addEventListener(zk,u),s.dispatchEvent(t),t.defaultPrevented||Yk(e??document.body,{select:!0}),s.removeEventListener(zk,u),Xk.remove(p)},0)}}},[s,l,u,p]);let m=J.useCallback(e=>{if(!n&&!r||p.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=Wk(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&Yk(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&Yk(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return(0,Y.jsx)(mk.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})});Hk.displayName=Vk;function Uk(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(Yk(r,{select:t}),document.activeElement!==n)return}function Wk(e){let t=Gk(e);return[Kk(t,e),Kk(t.reverse(),e)]}function Gk(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Kk(e,t){for(let n of e)if(!qk(n,{upTo:t}))return n}function qk(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}function Jk(e){return e instanceof HTMLInputElement&&`select`in e}function Yk(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Jk(e)&&t&&e.select()}}var Xk=Zk();function Zk(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=Qk(e,t),e.unshift(t)},remove(t){e=Qk(e,t),e[0]?.resume()}}}function Qk(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function $k(e){return e.filter(e=>e.tagName!==`A`)}var eA=J.useId||(()=>void 0),tA=0;function nA(e){let[t,n]=J.useState(eA());return ZO(()=>{e||n(e=>e??String(tA++))},[e]),e||(t?`radix-${t}`:``)}var rA=`Arrow`,iA=J.forwardRef((e,t)=>{let{children:n,width:r=10,height:i=5,...a}=e;return(0,Y.jsx)(mk.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,Y.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})});iA.displayName=rA;var aA=iA;function oA(e){let[t,n]=J.useState(void 0);return ZO(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}else n(void 0)},[e]),t}var sA=`Popper`,[cA,lA]=YO(sA),[uA,dA]=cA(sA),fA=e=>{let{__scopePopper:t,children:n}=e,[r,i]=J.useState(null),[a,o]=J.useState(void 0);return(0,Y.jsx)(uA,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})};fA.displayName=sA;var pA=`PopperAnchor`,mA=J.forwardRef((e,t)=>{let{__scopePopper:n,virtualRef:r,...i}=e,a=dA(pA,n),o=J.useRef(null),s=a.onAnchorChange,c=JO(t,J.useCallback(e=>{o.current=e,e&&s(e)},[s])),l=J.useRef(null);J.useEffect(()=>{if(!r)return;let e=l.current;l.current=r.current,e!==l.current&&s(l.current)});let u=a.placementState&&wA(a.placementState),d=u?.[0],f=u?.[1];return r?null:(0,Y.jsx)(mk.div,{"data-radix-popper-side":d,"data-radix-popper-align":f,...i,ref:c})});mA.displayName=pA;var hA=`PopperContent`,[gA,_A]=cA(hA),vA=J.forwardRef((e,t)=>{let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d=`partial`,hideWhenDetached:f=!1,updatePositionStrategy:p=`optimized`,onPlaced:m,...h}=e,g=dA(hA,n),[_,v]=J.useState(null),y=JO(t,e=>v(e)),[b,x]=J.useState(null),S=oA(b),C=S?.width??0,w=S?.height??0,T=r+(a===`center`?``:`-`+a),E=typeof u==`number`?u:{top:0,right:0,bottom:0,left:0,...u},ee=Array.isArray(l)?l:[l],D=ee.length>0,O={padding:E,boundary:ee.filter(SA),altBoundary:D},{refs:k,floatingStyles:te,placement:A,isPositioned:ne,middlewareData:re}=SE({strategy:`fixed`,placement:T,whileElementsMounted:(...e)=>cE(...e,{animationFrame:p===`always`}),elements:{reference:g.anchor},middleware:[wE({mainAxis:i+w,alignmentAxis:o}),c&&TE({mainAxis:!0,crossAxis:!1,limiter:d===`partial`?EE():void 0,...O}),c&&DE({...O}),OE({...O,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)}}),b&&AE({element:b,padding:s}),CA({arrowWidth:C,arrowHeight:w}),f&&kE({strategy:`referenceHidden`,...O,boundary:D?O.boundary:void 0})]}),ie=g.setPlacementState;ZO(()=>(ie(A),()=>{ie(void 0)}),[A,ie]);let[j,M]=wA(A),ae=yk(m);ZO(()=>{ne&&ae?.()},[ne,ae]);let oe=re.arrow?.x,se=re.arrow?.y,ce=re.arrow?.centerOffset!==0,[le,ue]=J.useState();return ZO(()=>{_&&ue(window.getComputedStyle(_).zIndex)},[_]),(0,Y.jsx)(`div`,{ref:k.setFloating,"data-radix-popper-content-wrapper":``,style:{...te,transform:ne?te.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:le,"--radix-popper-transform-origin":[re.transformOrigin?.x,re.transformOrigin?.y].join(` `),...re.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,Y.jsx)(gA,{scope:n,placedSide:j,placedAlign:M,onArrowChange:x,arrowX:oe,arrowY:se,shouldHideArrow:ce,children:(0,Y.jsx)(mk.div,{"data-side":j,"data-align":M,...h,ref:y,style:{...h.style,animation:ne?void 0:`none`}})})})});vA.displayName=hA;var yA=`PopperArrow`,bA={top:`bottom`,right:`left`,bottom:`top`,left:`right`},xA=J.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,i=_A(yA,n),a=bA[i.placedSide];return(0,Y.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,Y.jsx)(aA,{...r,ref:t,style:{...r.style,display:`block`}})})});xA.displayName=yA;function SA(e){return e!==null}var CA=e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=wA(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}});function wA(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var TA=fA,EA=mA,DA=vA,OA=xA,kA=`Portal`,AA=J.forwardRef((e,t)=>{let{container:n,...r}=e,[i,a]=J.useState(!1);ZO(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?op.createPortal((0,Y.jsx)(mk.div,{...r,ref:t}),o):null});AA.displayName=kA;function jA(e,t){return J.useReducer((e,n)=>t[e][n]??e,e)}var MA=e=>{let{present:t,children:n}=e,r=NA(t),i=typeof n==`function`?n({present:r.isPresent}):J.Children.only(n),a=FA(r.ref,LA(i));return typeof n==`function`||r.isPresent?J.cloneElement(i,{ref:a}):null};MA.displayName=`Presence`;function NA(e){let[t,n]=J.useState(),r=J.useRef(null),i=J.useRef(e),a=J.useRef(`none`),[o,s]=jA(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return J.useEffect(()=>{let e=IA(r.current);a.current=o===`mounted`?e:`none`},[o]),ZO(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,o=IA(t);e?s(`MOUNT`):o===`none`||t?.display===`none`?s(`UNMOUNT`):s(n&&r!==o?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,s]),ZO(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=a=>{let o=IA(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(s(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},c=e=>{e.target===t&&(a.current=IA(r.current))};return t.addEventListener(`animationstart`,c),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,c),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}else s(`ANIMATION_END`)},[t,s]),{isPresent:[`mounted`,`unmountSuspended`].includes(o),ref:J.useCallback(e=>{r.current=e?getComputedStyle(e):null,n(e)},[])}}function PA(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function FA(...e){let t=J.useRef(e);return t.current=e,J.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=PA(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():PA(n[e],null)}}},[])}function IA(e){return e?.animationName||`none`}function LA(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var RA=`rovingFocusGroup.onEntryFocus`,zA={bubbles:!1,cancelable:!0},BA=`RovingFocusGroup`,[VA,HA,UA]=gk(BA),[WA,GA]=YO(BA,[UA]),[KA,qA]=WA(BA),JA=J.forwardRef((e,t)=>(0,Y.jsx)(VA.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,Y.jsx)(VA.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,Y.jsx)(YA,{...e,ref:t})})}));JA.displayName=BA;var YA=J.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:u=!1,...d}=e,f=J.useRef(null),p=JO(t,f),m=vk(a),[h,g]=$O({prop:o,defaultProp:s??null,onChange:c,caller:BA}),[_,v]=J.useState(!1),y=yk(l),b=HA(n),x=J.useRef(!1),[S,C]=J.useState(0);return J.useEffect(()=>{let e=f.current;if(e)return e.addEventListener(RA,y),()=>e.removeEventListener(RA,y)},[y]),(0,Y.jsx)(KA,{scope:n,orientation:r,dir:m,loop:i,currentTabStopId:h,onItemFocus:J.useCallback(e=>g(e),[g]),onItemShiftTab:J.useCallback(()=>v(!0),[]),onFocusableItemAdd:J.useCallback(()=>C(e=>e+1),[]),onFocusableItemRemove:J.useCallback(()=>C(e=>e-1),[]),children:(0,Y.jsx)(mk.div,{tabIndex:_||S===0?-1:0,"data-orientation":r,...d,ref:p,style:{outline:`none`,...e.style},onMouseDown:$(e.onMouseDown,()=>{x.current=!0}),onFocus:$(e.onFocus,e=>{let t=!x.current;if(e.target===e.currentTarget&&t&&!_){let t=new CustomEvent(RA,zA);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=b().filter(e=>e.focusable);tj([e.find(e=>e.active),e.find(e=>e.id===h),...e].filter(Boolean).map(e=>e.ref.current),u)}}x.current=!1}),onBlur:$(e.onBlur,()=>v(!1))})})}),XA=`RovingFocusGroupItem`,ZA=J.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=nA(),l=a||c,u=qA(XA,n),d=u.currentTabStopId===l,f=HA(n),{onFocusableItemAdd:p,onFocusableItemRemove:m,currentTabStopId:h}=u;return J.useEffect(()=>{if(r)return p(),()=>m()},[r,p,m]),(0,Y.jsx)(VA.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:(0,Y.jsx)(mk.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:t,onMouseDown:$(e.onMouseDown,e=>{r?u.onItemFocus(l):e.preventDefault()}),onFocus:$(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:$(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){u.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=ej(e,u.orientation,u.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=f().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=u.loop?nj(n,r+1):n.slice(r+1)}setTimeout(()=>tj(n))}}),children:typeof o==`function`?o({isCurrentTabStop:d,hasTabStop:h!=null}):o})})});ZA.displayName=XA;var QA={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function $A(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}function ej(e,t,n){let r=$A(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return QA[r]}function tj(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function nj(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var rj=JA,ij=ZA,aj=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},oj=new WeakMap,sj=new WeakMap,cj={},lj=0,uj=function(e){return e&&(e.host||uj(e.parentNode))},dj=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=uj(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},fj=function(e,t,n,r){var i=dj(t,Array.isArray(e)?e:[e]);cj[n]||(cj[n]=new WeakMap);var a=cj[n],o=[],s=new Set,c=new Set(i),l=function(e){!e||s.has(e)||(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){!e||c.has(e)||Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(oj.get(e)||0)+1,l=(a.get(e)||0)+1;oj.set(e,c),a.set(e,l),o.push(e),c===1&&i&&sj.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),lj++,function(){o.forEach(function(e){var t=oj.get(e)-1,i=a.get(e)-1;oj.set(e,t),a.set(e,i),t||(sj.has(e)||e.removeAttribute(r),sj.delete(e)),i||e.removeAttribute(n)}),lj--,lj||(oj=new WeakMap,oj=new WeakMap,sj=new WeakMap,cj={})}},pj=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||aj(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),fj(r,i,n,`aria-hidden`)):function(){return null}},mj=function(){return mj=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},mj.apply(this,arguments)};function hj(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function gj(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var _j=`right-scroll-bar-position`,vj=`width-before-scroll-bar`,yj=`with-scroll-bars-hidden`,bj=`--removed-body-scroll-bar-size`;function xj(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Sj(e,t){var n=(0,J.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var Cj=typeof window<`u`?J.useLayoutEffect:J.useEffect,wj=new WeakMap;function Tj(e,t){var n=Sj(t||null,function(t){return e.forEach(function(e){return xj(e,t)})});return Cj(function(){var t=wj.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||xj(e,null)}),i.forEach(function(e){r.has(e)||xj(e,a)})}wj.set(n,e)},[e]),n}function Ej(e){return e}function Dj(e,t){t===void 0&&(t=Ej);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function Oj(e){e===void 0&&(e={});var t=Dj(null);return t.options=mj({async:!0,ssr:!1},e),t}var kj=function(e){var t=e.sideCar,n=hj(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return J.createElement(r,mj({},n))};kj.isSideCarExport=!0;function Aj(e,t){return e.useMedium(t),kj}var jj=Oj(),Mj=function(){},Nj=J.forwardRef(function(e,t){var n=J.useRef(null),r=J.useState({onScrollCapture:Mj,onWheelCapture:Mj,onTouchMoveCapture:Mj}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,_=e.as,v=_===void 0?`div`:_,y=e.gapMode,b=hj(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),x=f,S=Tj([n,t]),C=mj(mj({},b),i);return J.createElement(J.Fragment,null,u&&J.createElement(x,{sideCar:jj,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:y}),o?J.cloneElement(J.Children.only(s),mj(mj({},C),{ref:S})):J.createElement(v,mj({},C,{className:c,ref:S}),s))});Nj.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Nj.classNames={fullWidth:vj,zeroRight:_j};var Pj,Fj=function(){if(Pj)return Pj;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function Ij(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=Fj();return t&&e.setAttribute(`nonce`,t),e}function Lj(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Rj(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var zj=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Ij())&&(Lj(t,n),Rj(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Bj=function(){var e=zj();return function(t,n){J.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Vj=function(){var e=Bj();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},Hj={left:0,top:0,right:0,gap:0},Uj=function(e){return parseInt(e||``,10)||0},Wj=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[Uj(n),Uj(r),Uj(i)]},Gj=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return Hj;var t=Wj(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Kj=Vj(),qj=`data-scroll-locked`,Jj=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
|
|
183
|
+
.${yj} {
|
|
184
|
+
overflow: hidden ${r};
|
|
185
|
+
padding-right: ${s}px ${r};
|
|
186
|
+
}
|
|
187
|
+
body[${qj}] {
|
|
188
|
+
overflow: hidden ${r};
|
|
189
|
+
overscroll-behavior: contain;
|
|
190
|
+
${[t&&`position: relative ${r};`,n===`margin`&&`
|
|
191
|
+
padding-left: ${i}px;
|
|
192
|
+
padding-top: ${a}px;
|
|
193
|
+
padding-right: ${o}px;
|
|
194
|
+
margin-left:0;
|
|
195
|
+
margin-top:0;
|
|
196
|
+
margin-right: ${s}px ${r};
|
|
197
|
+
`,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
.${_j} {
|
|
201
|
+
right: ${s}px ${r};
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
.${vj} {
|
|
205
|
+
margin-right: ${s}px ${r};
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
.${_j} .${_j} {
|
|
209
|
+
right: 0 ${r};
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
.${vj} .${vj} {
|
|
213
|
+
margin-right: 0 ${r};
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
body[${qj}] {
|
|
217
|
+
${bj}: ${s}px;
|
|
218
|
+
}
|
|
219
|
+
`},Yj=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},Xj=function(){J.useEffect(function(){return document.body.setAttribute(qj,(Yj()+1).toString()),function(){var e=Yj()-1;e<=0?document.body.removeAttribute(qj):document.body.setAttribute(qj,e.toString())}},[])},Zj=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;Xj();var a=J.useMemo(function(){return Gj(i)},[i]);return J.createElement(Kj,{styles:Jj(a,!t,i,n?``:`!important`)})},Qj=!1;if(typeof window<`u`)try{var $j=Object.defineProperty({},"passive",{get:function(){return Qj=!0,!0}});window.addEventListener(`test`,$j,$j),window.removeEventListener(`test`,$j,$j)}catch{Qj=!1}var eM=Qj?{passive:!1}:!1,tM=function(e){return e.tagName===`TEXTAREA`},nM=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!tM(e)&&n[t]===`visible`)},rM=function(e){return nM(e,`overflowY`)},iM=function(e){return nM(e,`overflowX`)},aM=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),cM(e,r)){var i=lM(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},oM=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},sM=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},cM=function(e,t){return e===`v`?rM(t):iM(t)},lM=function(e,t){return e===`v`?oM(t):sM(t)},uM=function(e,t){return e===`h`&&t===`rtl`?-1:1},dM=function(e,t,n,r,i){var a=uM(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=lM(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&cM(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},fM=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},pM=function(e){return[e.deltaX,e.deltaY]},mM=function(e){return e&&`current`in e?e.current:e},hM=function(e,t){return e[0]===t[0]&&e[1]===t[1]},gM=function(e){return`
|
|
220
|
+
.block-interactivity-${e} {pointer-events: none;}
|
|
221
|
+
.allow-interactivity-${e} {pointer-events: all;}
|
|
222
|
+
`},_M=0,vM=[];function yM(e){var t=J.useRef([]),n=J.useRef([0,0]),r=J.useRef(),i=J.useState(_M++)[0],a=J.useState(Vj)[0],o=J.useRef(e);J.useEffect(function(){o.current=e},[e]),J.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=gj([e.lockRef.current],(e.shards||[]).map(mM),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=J.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=fM(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=aM(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=aM(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return dM(h,t,e,h===`h`?s:c,!0)},[]),c=J.useCallback(function(e){var n=e;if(!(!vM.length||vM[vM.length-1]!==a)){var r=`deltaY`in n?pM(n):fM(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&hM(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(mM).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=J.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:bM(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=J.useCallback(function(e){n.current=fM(e),r.current=void 0},[]),d=J.useCallback(function(t){l(t.type,pM(t),t.target,s(t,e.lockRef.current))},[]),f=J.useCallback(function(t){l(t.type,fM(t),t.target,s(t,e.lockRef.current))},[]);J.useEffect(function(){return vM.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,eM),document.addEventListener(`touchmove`,c,eM),document.addEventListener(`touchstart`,u,eM),function(){vM=vM.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,eM),document.removeEventListener(`touchmove`,c,eM),document.removeEventListener(`touchstart`,u,eM)}},[]);var p=e.removeScrollBar,m=e.inert;return J.createElement(J.Fragment,null,m?J.createElement(a,{styles:gM(i)}):null,p?J.createElement(Zj,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function bM(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var xM=Aj(jj,yM),SM=J.forwardRef(function(e,t){return J.createElement(Nj,mj({},e,{ref:t,sideCar:xM}))});SM.classNames=Nj.classNames;var CM=[`Enter`,` `],wM=[`ArrowDown`,`PageUp`,`Home`],TM=[`ArrowUp`,`PageDown`,`End`],EM=[...wM,...TM],DM={ltr:[...CM,`ArrowRight`],rtl:[...CM,`ArrowLeft`]},OM={ltr:[`ArrowLeft`],rtl:[`ArrowRight`]},kM=`Menu`,[AM,jM,MM]=gk(kM),[NM,PM]=YO(kM,[MM,lA,GA]),FM=lA(),IM=GA(),[LM,RM]=NM(kM),[zM,BM]=NM(kM),VM=e=>{let{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:o=!0}=e,s=FM(t),[c,l]=J.useState(null),u=J.useRef(!1),d=yk(a),f=vk(i);return J.useEffect(()=>{let e=()=>{u.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},t=()=>u.current=!1;return document.addEventListener(`keydown`,e,{capture:!0}),()=>{document.removeEventListener(`keydown`,e,{capture:!0}),document.removeEventListener(`pointerdown`,t,{capture:!0}),document.removeEventListener(`pointermove`,t,{capture:!0})}},[]),J.useEffect(()=>{if(!n)return;let e=()=>d(!1);return window.addEventListener(`blur`,e),()=>window.removeEventListener(`blur`,e)},[n,d]),(0,Y.jsx)(TA,{...s,children:(0,Y.jsx)(LM,{scope:t,open:n,onOpenChange:d,content:c,onContentChange:l,children:(0,Y.jsx)(zM,{scope:t,onClose:J.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:o,children:r})})})};VM.displayName=kM;var HM=`MenuAnchor`,UM=J.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=FM(n);return(0,Y.jsx)(EA,{...i,...r,ref:t})});UM.displayName=HM;var WM=`MenuPortal`,[GM,KM]=NM(WM,{forceMount:void 0}),qM=e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=RM(WM,t);return(0,Y.jsx)(GM,{scope:t,forceMount:n,children:(0,Y.jsx)(MA,{present:n||a.open,children:(0,Y.jsx)(AA,{asChild:!0,container:i,children:r})})})};qM.displayName=WM;var JM=`MenuContent`,[YM,XM]=NM(JM),ZM=J.forwardRef((e,t)=>{let n=KM(JM,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=RM(JM,e.__scopeMenu),o=BM(JM,e.__scopeMenu);return(0,Y.jsx)(AM.Provider,{scope:e.__scopeMenu,children:(0,Y.jsx)(MA,{present:r||a.open,children:(0,Y.jsx)(AM.Slot,{scope:e.__scopeMenu,children:o.modal?(0,Y.jsx)(QM,{...i,ref:t}):(0,Y.jsx)($M,{...i,ref:t})})})})}),QM=J.forwardRef((e,t)=>{let n=RM(JM,e.__scopeMenu),r=J.useRef(null),i=JO(t,r);return J.useEffect(()=>{let e=r.current;if(e)return pj(e)},[]),(0,Y.jsx)(tN,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:$(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),$M=J.forwardRef((e,t)=>{let n=RM(JM,e.__scopeMenu);return(0,Y.jsx)(tN,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),eN=nk(`MenuContent.ScrollLock`),tN=J.forwardRef((e,t)=>{let{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEntryFocus:c,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,disableOutsideScroll:m,...h}=e,g=RM(JM,n),_=BM(JM,n),v=FM(n),y=IM(n),b=jM(n),[x,S]=J.useState(null),C=J.useRef(null),w=JO(t,C,g.onContentChange),T=J.useRef(0),E=J.useRef(``),ee=J.useRef(0),D=J.useRef(null),O=J.useRef(`right`),k=J.useRef(0),te=m?SM:J.Fragment,A=m?{as:eN,allowPinchZoom:!0}:void 0,ne=e=>{let t=E.current+e,n=b().filter(e=>!e.disabled),r=document.activeElement,i=n.find(e=>e.ref.current===r)?.textValue,a=zN(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;(function e(t){E.current=t,window.clearTimeout(T.current),t!==``&&(T.current=window.setTimeout(()=>e(``),1e3))})(t),o&&setTimeout(()=>o.focus())};J.useEffect(()=>()=>window.clearTimeout(T.current),[]),Ik();let re=J.useCallback(e=>O.current===D.current?.side&&VN(e,D.current?.area),[]);return(0,Y.jsx)(YM,{scope:n,searchRef:E,onItemEnter:J.useCallback(e=>{re(e)&&e.preventDefault()},[re]),onItemLeave:J.useCallback(e=>{re(e)||(C.current?.focus(),S(null))},[re]),onTriggerLeave:J.useCallback(e=>{re(e)&&e.preventDefault()},[re]),pointerGraceTimerRef:ee,onPointerGraceIntentChange:J.useCallback(e=>{D.current=e},[]),children:(0,Y.jsx)(te,{...A,children:(0,Y.jsx)(Hk,{asChild:!0,trapped:i,onMountAutoFocus:$(a,e=>{e.preventDefault(),C.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:(0,Y.jsx)(Dk,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,children:(0,Y.jsx)(rj,{asChild:!0,...y,dir:_.dir,orientation:`vertical`,loop:r,currentTabStopId:x,onCurrentTabStopIdChange:S,onEntryFocus:$(c,e=>{_.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,Y.jsx)(DA,{role:`menu`,"aria-orientation":`vertical`,"data-state":PN(g.open),"data-radix-menu-content":``,dir:_.dir,...v,...h,ref:w,style:{outline:`none`,...h.style},onKeyDown:$(h.onKeyDown,e=>{let t=e.target.closest(`[data-radix-menu-content]`)===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=e.key.length===1;t&&(e.key===`Tab`&&e.preventDefault(),!n&&r&&ne(e.key));let i=C.current;if(e.target!==i||!EM.includes(e.key))return;e.preventDefault();let a=b().filter(e=>!e.disabled).map(e=>e.ref.current);TM.includes(e.key)&&a.reverse(),LN(a)}),onBlur:$(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(T.current),E.current=``)}),onPointerMove:$(e.onPointerMove,HN(e=>{let t=e.target,n=k.current!==e.clientX;e.currentTarget.contains(t)&&n&&(O.current=e.clientX>k.current?`right`:`left`,k.current=e.clientX)}))})})})})})})});ZM.displayName=JM;var nN=`MenuGroup`,rN=J.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,Y.jsx)(mk.div,{role:`group`,...r,ref:t})});rN.displayName=nN;var iN=`MenuLabel`,aN=J.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,Y.jsx)(mk.div,{...r,ref:t})});aN.displayName=iN;var oN=`MenuItem`,sN=`menu.itemSelect`,cN=J.forwardRef((e,t)=>{let{disabled:n=!1,onSelect:r,...i}=e,a=J.useRef(null),o=BM(oN,e.__scopeMenu),s=XM(oN,e.__scopeMenu),c=JO(t,a),l=J.useRef(!1),u=()=>{let e=a.current;if(!n&&e){let t=new CustomEvent(sN,{bubbles:!0,cancelable:!0});e.addEventListener(sN,e=>r?.(e),{once:!0}),hk(e,t),t.defaultPrevented?l.current=!1:o.onClose()}};return(0,Y.jsx)(lN,{...i,ref:c,disabled:n,onClick:$(e.onClick,u),onPointerDown:t=>{e.onPointerDown?.(t),l.current=!0},onPointerUp:$(e.onPointerUp,e=>{l.current||e.currentTarget?.click()}),onKeyDown:$(e.onKeyDown,e=>{let t=s.searchRef.current!==``;n||t&&e.key===` `||CM.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})});cN.displayName=oN;var lN=J.forwardRef((e,t)=>{let{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,o=XM(oN,n),s=IM(n),c=J.useRef(null),l=JO(t,c),[u,d]=J.useState(!1),[f,p]=J.useState(``);return J.useEffect(()=>{let e=c.current;e&&p((e.textContent??``).trim())},[a.children]),(0,Y.jsx)(AM.ItemSlot,{scope:n,disabled:r,textValue:i??f,children:(0,Y.jsx)(ij,{asChild:!0,...s,focusable:!r,children:(0,Y.jsx)(mk.div,{role:`menuitem`,"data-highlighted":u?``:void 0,"aria-disabled":r||void 0,"data-disabled":r?``:void 0,...a,ref:l,onPointerMove:$(e.onPointerMove,HN(e=>{r?o.onItemLeave(e):(o.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:$(e.onPointerLeave,HN(e=>o.onItemLeave(e))),onFocus:$(e.onFocus,()=>d(!0)),onBlur:$(e.onBlur,()=>d(!1))})})})}),uN=`MenuCheckboxItem`,dN=J.forwardRef((e,t)=>{let{checked:n=!1,onCheckedChange:r,...i}=e;return(0,Y.jsx)(yN,{scope:e.__scopeMenu,checked:n,children:(0,Y.jsx)(cN,{role:`menuitemcheckbox`,"aria-checked":FN(n)?`mixed`:n,...i,ref:t,"data-state":IN(n),onSelect:$(i.onSelect,()=>r?.(FN(n)?!0:!n),{checkForDefaultPrevented:!1})})})});dN.displayName=uN;var fN=`MenuRadioGroup`,[pN,mN]=NM(fN,{value:void 0,onValueChange:()=>{}}),hN=J.forwardRef((e,t)=>{let{value:n,onValueChange:r,...i}=e,a=yk(r);return(0,Y.jsx)(pN,{scope:e.__scopeMenu,value:n,onValueChange:a,children:(0,Y.jsx)(rN,{...i,ref:t})})});hN.displayName=fN;var gN=`MenuRadioItem`,_N=J.forwardRef((e,t)=>{let{value:n,...r}=e,i=mN(gN,e.__scopeMenu),a=n===i.value;return(0,Y.jsx)(yN,{scope:e.__scopeMenu,checked:a,children:(0,Y.jsx)(cN,{role:`menuitemradio`,"aria-checked":a,...r,ref:t,"data-state":IN(a),onSelect:$(r.onSelect,()=>i.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});_N.displayName=gN;var vN=`MenuItemIndicator`,[yN,bN]=NM(vN,{checked:!1}),xN=J.forwardRef((e,t)=>{let{__scopeMenu:n,forceMount:r,...i}=e,a=bN(vN,n);return(0,Y.jsx)(MA,{present:r||FN(a.checked)||a.checked===!0,children:(0,Y.jsx)(mk.span,{...i,ref:t,"data-state":IN(a.checked)})})});xN.displayName=vN;var SN=`MenuSeparator`,CN=J.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,Y.jsx)(mk.div,{role:`separator`,"aria-orientation":`horizontal`,...r,ref:t})});CN.displayName=SN;var wN=`MenuArrow`,TN=J.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=FM(n);return(0,Y.jsx)(OA,{...i,...r,ref:t})});TN.displayName=wN;var EN=`MenuSub`,[DN,ON]=NM(EN),kN=e=>{let{__scopeMenu:t,children:n,open:r=!1,onOpenChange:i}=e,a=RM(EN,t),o=FM(t),[s,c]=J.useState(null),[l,u]=J.useState(null),d=yk(i);return J.useEffect(()=>(a.open===!1&&d(!1),()=>d(!1)),[a.open,d]),(0,Y.jsx)(TA,{...o,children:(0,Y.jsx)(LM,{scope:t,open:r,onOpenChange:d,content:l,onContentChange:u,children:(0,Y.jsx)(DN,{scope:t,contentId:nA(),triggerId:nA(),trigger:s,onTriggerChange:c,children:n})})})};kN.displayName=EN;var AN=`MenuSubTrigger`,jN=J.forwardRef((e,t)=>{let n=RM(AN,e.__scopeMenu),r=BM(AN,e.__scopeMenu),i=ON(AN,e.__scopeMenu),a=XM(AN,e.__scopeMenu),o=J.useRef(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:c}=a,l={__scopeMenu:e.__scopeMenu},u=J.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return J.useEffect(()=>u,[u]),J.useEffect(()=>{let e=s.current;return()=>{window.clearTimeout(e),c(null)}},[s,c]),(0,Y.jsx)(UM,{asChild:!0,...l,children:(0,Y.jsx)(lN,{id:i.triggerId,"aria-haspopup":`menu`,"aria-expanded":n.open,"aria-controls":n.open?i.contentId:void 0,"data-state":PN(n.open),...e,ref:qO(t,i.onTriggerChange),onClick:t=>{e.onClick?.(t),!(e.disabled||t.defaultPrevented)&&(t.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:$(e.onPointerMove,HN(t=>{a.onItemEnter(t),!t.defaultPrevented&&!e.disabled&&!n.open&&!o.current&&(a.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:$(e.onPointerLeave,HN(e=>{u();let t=n.content?.getBoundingClientRect();if(t){let r=n.content?.dataset.side,i=r===`right`,o=i?-5:5,c=t[i?`left`:`right`],l=t[i?`right`:`left`];a.onPointerGraceIntentChange({area:[{x:e.clientX+o,y:e.clientY},{x:c,y:t.top},{x:l,y:t.top},{x:l,y:t.bottom},{x:c,y:t.bottom}],side:r}),window.clearTimeout(s.current),s.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(e),e.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:$(e.onKeyDown,t=>{let i=a.searchRef.current!==``;e.disabled||i&&t.key===` `||DM[r.dir].includes(t.key)&&(n.onOpenChange(!0),n.content?.focus(),t.preventDefault())})})})});jN.displayName=AN;var MN=`MenuSubContent`,NN=J.forwardRef((e,t)=>{let n=KM(JM,e.__scopeMenu),{forceMount:r=n.forceMount,align:i=`start`,...a}=e,o=RM(JM,e.__scopeMenu),s=BM(JM,e.__scopeMenu),c=ON(MN,e.__scopeMenu),l=J.useRef(null),u=JO(t,l);return(0,Y.jsx)(AM.Provider,{scope:e.__scopeMenu,children:(0,Y.jsx)(MA,{present:r||o.open,children:(0,Y.jsx)(AM.Slot,{scope:e.__scopeMenu,children:(0,Y.jsx)(tN,{id:c.contentId,"aria-labelledby":c.triggerId,...a,ref:u,align:i,side:s.dir===`rtl`?`left`:`right`,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{s.isUsingKeyboardRef.current&&l.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:$(e.onFocusOutside,e=>{e.target!==c.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:$(e.onEscapeKeyDown,e=>{s.onClose(),e.preventDefault()}),onKeyDown:$(e.onKeyDown,e=>{let t=e.currentTarget.contains(e.target),n=OM[s.dir].includes(e.key);t&&n&&(o.onOpenChange(!1),c.trigger?.focus(),e.preventDefault())})})})})})});NN.displayName=MN;function PN(e){return e?`open`:`closed`}function FN(e){return e===`indeterminate`}function IN(e){return FN(e)?`indeterminate`:e?`checked`:`unchecked`}function LN(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function RN(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function zN(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=RN(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function BN(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function VN(e,t){return t?BN({x:e.clientX,y:e.clientY},t):!1}function HN(e){return t=>t.pointerType===`mouse`?e(t):void 0}var UN=VM,WN=UM,GN=qM,KN=ZM,qN=rN,JN=aN,YN=cN,XN=dN,ZN=hN,QN=_N,$N=xN,eP=CN,tP=TN,nP=jN,rP=NN,iP=`DropdownMenu`,[aP,oP]=YO(iP,[PM]),sP=PM(),[cP,lP]=aP(iP),uP=e=>{let{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,c=sP(t),l=J.useRef(null),[u,d]=$O({prop:i,defaultProp:a??!1,onChange:o,caller:iP});return(0,Y.jsx)(cP,{scope:t,triggerId:nA(),triggerRef:l,contentId:nA(),open:u,onOpenChange:d,onOpenToggle:J.useCallback(()=>d(e=>!e),[d]),modal:s,children:(0,Y.jsx)(UN,{...c,open:u,onOpenChange:d,dir:r,modal:s,children:n})})};uP.displayName=iP;var dP=`DropdownMenuTrigger`,fP=J.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=lP(dP,n),o=sP(n);return(0,Y.jsx)(WN,{asChild:!0,...o,children:(0,Y.jsx)(mk.button,{type:`button`,id:a.triggerId,"aria-haspopup":`menu`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?`open`:`closed`,"data-disabled":r?``:void 0,disabled:r,...i,ref:qO(t,a.triggerRef),onPointerDown:$(e.onPointerDown,e=>{!r&&e.button===0&&e.ctrlKey===!1&&(a.onOpenToggle(),a.open||e.preventDefault())}),onKeyDown:$(e.onKeyDown,e=>{r||([`Enter`,` `].includes(e.key)&&a.onOpenToggle(),e.key===`ArrowDown`&&a.onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(e.key)&&e.preventDefault())})})})});fP.displayName=dP;var pP=`DropdownMenuPortal`,mP=e=>{let{__scopeDropdownMenu:t,...n}=e,r=sP(t);return(0,Y.jsx)(GN,{...r,...n})};mP.displayName=pP;var hP=`DropdownMenuContent`,gP=J.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=lP(hP,n),a=sP(n),o=J.useRef(!1);return(0,Y.jsx)(KN,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:$(e.onCloseAutoFocus,e=>{o.current||i.triggerRef.current?.focus(),o.current=!1,e.preventDefault()}),onInteractOutside:$(e.onInteractOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;(!i.modal||r)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});gP.displayName=hP;var _P=`DropdownMenuGroup`,vP=J.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=sP(n);return(0,Y.jsx)(qN,{...i,...r,ref:t})});vP.displayName=_P;var yP=`DropdownMenuLabel`,bP=J.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=sP(n);return(0,Y.jsx)(JN,{...i,...r,ref:t})});bP.displayName=yP;var xP=`DropdownMenuItem`,SP=J.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=sP(n);return(0,Y.jsx)(YN,{...i,...r,ref:t})});SP.displayName=xP;var CP=`DropdownMenuCheckboxItem`,wP=J.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=sP(n);return(0,Y.jsx)(XN,{...i,...r,ref:t})});wP.displayName=CP;var TP=`DropdownMenuRadioGroup`,EP=J.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=sP(n);return(0,Y.jsx)(ZN,{...i,...r,ref:t})});EP.displayName=TP;var DP=`DropdownMenuRadioItem`,OP=J.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=sP(n);return(0,Y.jsx)(QN,{...i,...r,ref:t})});OP.displayName=DP;var kP=`DropdownMenuItemIndicator`,AP=J.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=sP(n);return(0,Y.jsx)($N,{...i,...r,ref:t})});AP.displayName=kP;var jP=`DropdownMenuSeparator`,MP=J.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=sP(n);return(0,Y.jsx)(eP,{...i,...r,ref:t})});MP.displayName=jP;var NP=`DropdownMenuArrow`,PP=J.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=sP(n);return(0,Y.jsx)(tP,{...i,...r,ref:t})});PP.displayName=NP;var FP=`DropdownMenuSubTrigger`,IP=J.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=sP(n);return(0,Y.jsx)(nP,{...i,...r,ref:t})});IP.displayName=FP;var LP=`DropdownMenuSubContent`,RP=J.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=sP(n);return(0,Y.jsx)(rP,{...i,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});RP.displayName=LP;var zP=uP,BP=fP,VP=mP,HP=gP,UP=vP,WP=SP,GP=MP;function KP({...e}){return(0,Y.jsx)(zP,{"data-slot":`planet-dropdown-menu`,...e})}function qP({...e}){return(0,Y.jsx)(BP,{"data-slot":`planet-dropdown-menu-trigger`,...e})}function JP({className:e,align:t=`start`,sideOffset:n=4,...r}){return(0,Y.jsx)(VP,{children:(0,Y.jsx)(HP,{"data-slot":`planet-dropdown-menu-content`,sideOffset:n,align:t,className:LD(`planet-dropdown-menu-content`,e),onCloseAutoFocus:e=>e.preventDefault(),...r})})}function YP({className:e,...t}){return(0,Y.jsx)(UP,{"data-slot":`planet-dropdown-menu-group`,className:LD(`planet-dropdown-menu-group`,e),...t})}function XP({className:e,inset:t,variant:n=`default`,...r}){return(0,Y.jsx)(WP,{"data-slot":`planet-dropdown-menu-item`,"data-inset":t,"data-variant":n,className:LD(`planet-dropdown-menu-item`,e),...r})}function ZP({className:e,...t}){return(0,Y.jsx)(GP,{"data-slot":`planet-dropdown-menu-separator`,className:LD(`planet-dropdown-menu-separator`,e),...t})}var QP=(0,J.forwardRef)(({editor:e,levels:t=[1,2,3,4,5,6],hideWhenUnavailable:n=!1,onOpenChange:r,children:i,modal:a=!0,...o},s)=>{let{editor:c}=kO(e),[l,u]=(0,J.useState)(!1),{isVisible:d,isActive:f,canToggle:p,Icon:m}=tF({editor:c,levels:t,hideWhenUnavailable:n}),h=(0,J.useCallback)(e=>{!c||!p||(u(e),r?.(e))},[p,c,r]);return d?(0,Y.jsxs)(KP,{modal:a,open:l,onOpenChange:h,children:[(0,Y.jsx)(qP,{asChild:!0,children:(0,Y.jsx)(Q,{type:`button`,variant:`ghost`,"data-active-state":f?`on`:`off`,role:`button`,tabIndex:-1,disabled:!p,"data-disabled":!p,"aria-label":`Format text as heading`,"aria-pressed":f,tooltip:`Heading`,...o,ref:s,children:i||(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(m,{className:`planet-button-icon`}),(0,Y.jsx)(DO,{className:`planet-button-dropdown-small`})]})})}),(0,Y.jsx)(JP,{align:`start`,children:(0,Y.jsx)(YP,{children:t.map(e=>(0,Y.jsx)(XP,{asChild:!0,children:(0,Y.jsx)(MO,{editor:c,level:e,text:`Heading ${e}`,showTooltip:!1})},`heading-${e}`))})})]}):null});QP.displayName=`HeadingDropdownMenu`;var $P=(0,J.memo)(({className:e,...t})=>(0,Y.jsx)(`svg`,{width:`24`,height:`24`,className:e,viewBox:`0 0 24 24`,fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`,...t,children:(0,Y.jsx)(`path`,{d:`M6 3C6.55228 3 7 3.44772 7 4V11H17V4C17 3.44772 17.4477 3 18 3C18.5523 3 19 3.44772 19 4V20C19 20.5523 18.5523 21 18 21C17.4477 21 17 20.5523 17 20V13H7V20C7 20.5523 6.55228 21 6 21C5.44772 21 5 20.5523 5 20V4C5 3.44772 5.44772 3 6 3Z`,fill:`currentColor`})}));$P.displayName=`HeadingIcon`;function eF(e,t=[1,2,3,4,5,6]){if(!(!e||!e.isEditable))return t.find(t=>HO(e,t))}function tF(e){let{editor:t,levels:n=[1,2,3,4,5,6],hideWhenUnavailable:r=!1}=e||{},{editor:i}=kO(t),[a,o]=(0,J.useState)(!0),s=eF(i,n),c=HO(i),l=VO(i);return(0,J.useEffect)(()=>{if(!i)return;let e=()=>{o(WO({editor:i,hideWhenUnavailable:r,level:n}))};return e(),i.on(`selectionUpdate`,e),()=>{i.off(`selectionUpdate`,e)}},[i,r,n]),{isVisible:a,activeLevel:s,isActive:c,canToggle:l,levels:n,label:`Heading`,Icon:s?zO[s]:$P}}function nF({shortcutKeys:e=IF}){return(0,Y.jsx)(AO,{children:BD({shortcutKeys:e})})}var rF=(0,J.forwardRef)(({editor:e,text:t,hideWhenUnavailable:n=!1,onInserted:r,showShortcut:i=!1,onClick:a,icon:o,children:s,...c},l)=>{let{editor:u}=kO(e),{isVisible:d,canInsert:f,handleImage:p,label:m,isActive:h,shortcutKeys:g,Icon:_}=VF({editor:u,hideWhenUnavailable:n,onInserted:r}),v=(0,J.useCallback)(e=>{a?.(e),!e.defaultPrevented&&p()},[p,a]);if(!d)return null;let y=o??_;return(0,Y.jsx)(Q,{type:`button`,variant:`ghost`,"data-active-state":h?`on`:`off`,role:`button`,tabIndex:-1,disabled:!f,"data-disabled":!f,"aria-label":m,"aria-pressed":h,tooltip:m,onClick:v,...c,ref:l,children:s??(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(y,{className:`planet-button-icon`}),t&&(0,Y.jsx)(`span`,{className:`planet-button-text`,children:t}),i&&(0,Y.jsx)(nF,{shortcutKeys:g})]})})});rF.displayName=`ImageUploadButton`;var iF=[`shift`,`alt`,`meta`,`mod`,`ctrl`,`control`];function aF(){return typeof navigator>`u`?!1:/mac/i.test(navigator.userAgent)&&!/iphone|ipad|ipod/i.test(navigator.userAgent)}var oF={esc:`escape`,return:`enter`,left:`arrowleft`,right:`arrowright`,up:`arrowup`,down:`arrowdown`,ShiftLeft:`shift`,ShiftRight:`shift`,AltLeft:`alt`,AltRight:`alt`,MetaLeft:`meta`,MetaRight:`meta`,OSLeft:`meta`,OSRight:`meta`,ControlLeft:`ctrl`,ControlRight:`ctrl`};function sF(e){return(oF[e.trim()]||e.trim()).toLowerCase().replace(/key|digit|numpad/,``)}function cF(e){return iF.includes(e)}function lF(e,t=`,`){return e.toLowerCase().split(t)}function uF(e,t=`+`,n=`>`,r=!1,i,a){let o=[],s=!1;e=e.trim(),e.includes(n)?(s=!0,o=e.toLocaleLowerCase().split(n).map(e=>sF(e))):o=e.toLocaleLowerCase().split(t).map(e=>sF(e));let c={alt:o.includes(`alt`),ctrl:o.includes(`ctrl`)||o.includes(`control`),shift:o.includes(`shift`),meta:o.includes(`meta`),mod:o.includes(`mod`),useKey:r},l=o.filter(e=>!iF.includes(e));return{...c,keys:l,description:i,isSequence:s,hotkey:e,metadata:a}}typeof document<`u`&&(document.addEventListener(`keydown`,e=>{e.code!==void 0&&mF([sF(e.code)])}),document.addEventListener(`keyup`,e=>{e.code!==void 0&&hF([sF(e.code)])})),typeof window<`u`&&(window.addEventListener(`blur`,()=>{dF.clear()}),window.addEventListener(`focus`,()=>{dF.clear()}),window.addEventListener(`contextmenu`,()=>{setTimeout(()=>{dF.clear()},0)})),typeof document<`u`&&document.addEventListener(`visibilitychange`,()=>{dF.clear()});var dF=new Set;function fF(e){return Array.isArray(e)}function pF(e,t=`,`){return(fF(e)?e:e.split(t)).every(e=>dF.has(e.trim().toLowerCase()))}function mF(e){let t=Array.isArray(e)?e:[e];dF.has(`meta`)&&dF.forEach(e=>{cF(e)||dF.delete(e.toLowerCase())}),t.forEach(e=>{dF.add(e.toLowerCase())})}function hF(e){e===`meta`?dF.clear():(Array.isArray(e)?e:[e]).forEach(e=>{dF.delete(e.toLowerCase())})}function gF(e,t,n){(typeof n==`function`&&n(e,t)||n===!0)&&e.preventDefault()}function _F(e,t,n){return typeof n==`function`?n(e,t):n===!0||n===void 0}var vF=[`input`,`textarea`,`select`,`searchbox`,`slider`,`spinbutton`,`menuitem`,`menuitemcheckbox`,`menuitemradio`,`option`,`radio`,`textbox`];function yF(e){return bF(e,vF)}function bF(e,t=!1){let{target:n,composed:r}=e,i,a;return xF(n)&&r?(i=e.composedPath()[0]&&e.composedPath()[0].tagName,a=e.composedPath()[0]&&e.composedPath()[0].role):(i=n&&n.tagName,a=n&&n.role),fF(t)?!!(i&&t?.some(e=>e.toLowerCase()===i.toLowerCase()||e===a)):!!(i&&t&&t)}function xF(e){return!!e.tagName&&!e.tagName.startsWith(`-`)&&e.tagName.includes(`-`)}function SF(e,t){return e.length===0&&t?!1:t?e.some(e=>t.includes(e))||e.includes(`*`):!0}var CF=(e,t,n=!1)=>{let{alt:r,meta:i,mod:a,shift:o,ctrl:s,keys:c,useKey:l}=t,{code:u,key:d,ctrlKey:f,metaKey:p,shiftKey:m,altKey:h}=e,g=sF(u);if(l&&c?.length===1&&c.includes(d.toLowerCase()))return!0;if(!c?.includes(g)&&![`ctrl`,`control`,`unknown`,`meta`,`alt`,`shift`,`os`].includes(g))return!1;if(!n){if(r!==h&&g!==`alt`||o!==m&&g!==`shift`)return!1;if(a){if(aF()?!p:!f)return!1}else if(i!==p&&g!==`meta`&&g!==`os`||s!==f&&g!==`ctrl`&&g!==`control`)return!1}return c&&c.length===1&&c.includes(g)?!0:c&&c.length>0?c.includes(g)?pF(c):!1:!c||c.length===0},wF=(0,J.createContext)(void 0),TF=()=>(0,J.useContext)(wF);function EF(e,t){return e&&t&&typeof e==`object`&&typeof t==`object`?Object.keys(e).length===Object.keys(t).length&&Object.keys(e).reduce((n,r)=>n&&EF(e[r],t[r]),!0):e===t}var DF=(0,J.createContext)({hotkeys:[],activeScopes:[],toggleScope:()=>{},enableScope:()=>{},disableScope:()=>{}}),OF=()=>(0,J.useContext)(DF);function kF(e){let t=(0,J.useRef)(void 0);return EF(t.current,e)||(t.current=e),t.current}var AF=e=>{e.stopPropagation(),e.preventDefault(),e.stopImmediatePropagation()},jF=typeof window<`u`?J.useLayoutEffect:J.useEffect;function MF(e){if(!e)return;let{enabled:t,preventDefault:n,ignoreEventWhen:r,...i}=e;return typeof t==`function`?i:{...i,enabled:t}}function NF(e,t,n,r){let[i,a]=(0,J.useState)(null),o=(0,J.useCallback)(e=>(a(e),()=>a(null)),[]),s=(0,J.useRef)(!1),c=Array.isArray(n)?Array.isArray(r)?void 0:r:n,l=fF(e)?e.join(c?.delimiter):e,u=Array.isArray(n)?n:Array.isArray(r)?r:void 0,d=(0,J.useCallback)(t,u??[]),f=(0,J.useRef)(d);u?f.current=d:f.current=t;let p=kF(MF(c)),m=(0,J.useRef)(c?.enabled);m.current=c?.enabled;let h=(0,J.useRef)(c?.preventDefault);h.current=c?.preventDefault;let g=(0,J.useRef)(c?.ignoreEventWhen);g.current=c?.ignoreEventWhen;let{activeScopes:_}=OF(),v=TF();return jF(()=>{if(m.current===!1||!SF(_,p?.scopes))return;let e=[],t,n=(n,r=!1)=>{if(!(yF(n)&&!bF(n,p?.enableOnFormTags))){if(i!==null){let e=i.getRootNode();if((e instanceof Document||e instanceof ShadowRoot)&&e.activeElement!==i&&!i.contains(e.activeElement)){AF(n);return}}n.target?.isContentEditable&&!p?.enableOnContentEditable||lF(l,p?.delimiter).forEach(i=>{if(i.includes(p?.splitKey??`+`)&&i.includes(p?.sequenceSplitKey??`>`)){console.warn(`Hotkey ${i} contains both ${p?.splitKey??`+`} and ${p?.sequenceSplitKey??`>`} which is not supported.`);return}let a=uF(i,p?.splitKey,p?.sequenceSplitKey,p?.useKey,p?.description,p?.metadata);if(a.isSequence){t=setTimeout(()=>{e=[]},p?.sequenceTimeoutMs??1e3);let r=a.useKey?n.key:sF(n.code);if(cF(r.toLowerCase()))return;if(e.push(r),r!==a.keys?.[e.length-1]){e=[],t&&clearTimeout(t);return}e.length===a.keys?.length&&(f.current(n,a),t&&clearTimeout(t),e=[])}else if(CF(n,a,p?.ignoreModifiers)||a.keys?.includes(`*`)){if(g.current?.(n)||r&&s.current||(gF(n,a,h.current),!_F(n,a,m.current)))return;f.current(n,a),r||(s.current=!0)}})}},r=e=>{e.code!==void 0&&(mF(sF(e.code)),(p?.keydown===void 0&&p?.keyup!==!0||p?.keydown)&&n(e))},a=e=>{e.code!==void 0&&(hF(sF(e.code)),s.current=!1,p?.keyup&&n(e,!0))},o=i||c?.document||document;return o.addEventListener(`keyup`,a,c?.eventListenerOptions),o.addEventListener(`keydown`,r,c?.eventListenerOptions),v&&lF(l,p?.delimiter).forEach(e=>{v.addHotkey(uF(e,p?.splitKey,p?.sequenceSplitKey,p?.useKey,p?.description,p?.metadata))}),()=>{o.removeEventListener(`keyup`,a,c?.eventListenerOptions),o.removeEventListener(`keydown`,r,c?.eventListenerOptions),v&&lF(l,p?.delimiter).forEach(e=>{v.removeHotkey(uF(e,p?.splitKey,p?.sequenceSplitKey,p?.useKey,p?.description,p?.metadata))}),e=[],t&&clearTimeout(t)}},[i,p,_,l]),o}function PF(e=`max`,t=768){let[n,r]=(0,J.useState)(void 0);return(0,J.useEffect)(()=>{let n=e===`min`?`(min-width: ${t}px)`:`(max-width: ${t-1}px)`,i=window.matchMedia(n),a=e=>r(e.matches);return r(i.matches),i.addEventListener(`change`,a),()=>i.removeEventListener(`change`,a)},[e,t]),!!n}var FF=(0,J.memo)(({className:e,...t})=>(0,Y.jsx)(`svg`,{width:`24`,height:`24`,className:e,viewBox:`0 0 24 24`,fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`,...t,children:(0,Y.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M20 2C20 1.44772 19.5523 1 19 1C18.4477 1 18 1.44772 18 2V4H16C15.4477 4 15 4.44772 15 5C15 5.55228 15.4477 6 16 6H18V8C18 8.55228 18.4477 9 19 9C19.5523 9 20 8.55228 20 8V6H22C22.5523 6 23 5.55228 23 5C23 4.44772 22.5523 4 22 4H20V2ZM5 4C4.73478 4 4.48043 4.10536 4.29289 4.29289C4.10536 4.48043 4 4.73478 4 5V19C4 19.2652 4.10536 19.5196 4.29289 19.7071C4.48043 19.8946 4.73478 20 5 20H5.58579L14.379 11.2068C14.9416 10.6444 15.7045 10.3284 16.5 10.3284C17.2955 10.3284 18.0584 10.6444 18.621 11.2068L20 12.5858V12C20 11.4477 20.4477 11 21 11C21.5523 11 22 11.4477 22 12V14.998C22 14.9994 22 15.0007 22 15.002V19C22 19.7957 21.6839 20.5587 21.1213 21.1213C20.5587 21.6839 19.7957 22 19 22H6.00219C6.00073 22 5.99927 22 5.99781 22H5C4.20435 22 3.44129 21.6839 2.87868 21.1213C2.31607 20.5587 2 19.7957 2 19V5C2 4.20435 2.31607 3.44129 2.87868 2.87868C3.44129 2.31607 4.20435 2 5 2H12C12.5523 2 13 2.44772 13 3C13 3.55228 12.5523 4 12 4H5ZM8.41422 20H19C19.2652 20 19.5196 19.8946 19.7071 19.7071C19.8946 19.5196 20 19.2652 20 19V15.4142L17.207 12.6212C17.0195 12.4338 16.7651 12.3284 16.5 12.3284C16.2349 12.3284 15.9806 12.4337 15.7931 12.6211L8.41422 20ZM6.87868 6.87868C7.44129 6.31607 8.20435 6 9 6C9.79565 6 10.5587 6.31607 11.1213 6.87868C11.6839 7.44129 12 8.20435 12 9C12 9.79565 11.6839 10.5587 11.1213 11.1213C10.5587 11.6839 9.79565 12 9 12C8.20435 12 7.44129 11.6839 6.87868 11.1213C6.31607 10.5587 6 9.79565 6 9C6 8.20435 6.31607 7.44129 6.87868 6.87868ZM9 8C8.73478 8 8.48043 8.10536 8.29289 8.29289C8.10536 8.48043 8 8.73478 8 9C8 9.26522 8.10536 9.51957 8.29289 9.70711C8.48043 9.89464 8.73478 10 9 10C9.26522 10 9.51957 9.89464 9.70711 9.70711C9.89464 9.51957 10 9.26522 10 9C10 8.73478 9.89464 8.48043 9.70711 8.29289C9.51957 8.10536 9.26522 8 9 8Z`,fill:`currentColor`})}));FF.displayName=`ImagePlusIcon`;var IF=`mod+shift+i`;function LF(e){return!e||!e.isEditable||!GD(e,`imageUpload`)?!1:e.can().insertContent({type:`imageUpload`})}function RF(e){return!e||!e.isEditable?!1:e.isActive(`imageUpload`)}function zF(e){if(!e||!e.isEditable||!LF(e))return!1;try{return e.chain().focus().insertContent({type:`imageUpload`}).run()}catch{return!1}}function BF(e){let{editor:t,hideWhenUnavailable:n}=e;return!t||!t.isEditable?!1:n?GD(t,`imageUpload`)?t.isActive(`code`)?!0:LF(t):!1:!0}function VF(e){let{editor:t,hideWhenUnavailable:n=!1,onInserted:r}=e||{},{editor:i}=kO(t),a=PF(),[o,s]=(0,J.useState)(!0),c=LF(i),l=RF(i);(0,J.useEffect)(()=>{if(!i)return;let e=()=>{s(BF({editor:i,hideWhenUnavailable:n}))};return e(),i.on(`selectionUpdate`,e),()=>{i.off(`selectionUpdate`,e)}},[i,n]);let u=(0,J.useCallback)(()=>{if(!i)return!1;let e=zF(i);return e&&r?.(),e},[i,r]);return NF(IF,e=>{e.preventDefault(),u()},{enabled:o&&c,enableOnContentEditable:!a,enableOnFormTags:!0}),{isVisible:o,isActive:l,handleImage:u,canInsert:c,label:`Add image`,shortcutKeys:IF,Icon:FF}}function HF({className:e,type:t,...n}){return(0,Y.jsx)(`input`,{type:t,"data-slot":`planet-input`,className:LD(`planet-input`,e),...n})}var UF=[12,14,16,18,20,24,30,36,48,60,72],WF=16;function GF(e){if(!e)return null;let t=parseInt(e,10);return Number.isFinite(t)?t:null}function KF({editor:e}){let{editor:t}=kO(e),[n,r]=(0,J.useState)(!1),[i,a]=(0,J.useState)(``),o=_p({editor:t,selector:({editor:e})=>e?GF(e.getAttributes(`textStyle`).fontSize):null}),s=o??WF;if((0,J.useEffect)(()=>{n&&a(String(s))},[n,s]),!t)return null;let c=typeof t.commands.setFontSize==`function`,l=e=>{!c||!Number.isFinite(e)||e<=0||(t.chain().focus().setFontSize(`${e}px`).run(),r(!1))},u=()=>{c&&(t.chain().focus().unsetFontSize().run(),r(!1))},d=()=>{let e=parseInt(i,10);Number.isFinite(e)&&e>0&&l(e)};return(0,Y.jsxs)(KP,{open:n,onOpenChange:r,children:[(0,Y.jsx)(qP,{asChild:!0,children:(0,Y.jsxs)(Q,{type:`button`,variant:`ghost`,"data-active-state":o?`on`:`off`,"aria-label":`Font size`,tooltip:`Font size`,children:[(0,Y.jsx)(`span`,{className:`planet-button-text`,style:{minWidth:`1.5ch`,textAlign:`center`},children:s}),(0,Y.jsx)(DO,{className:`planet-button-dropdown-small`})]})}),(0,Y.jsxs)(JP,{align:`start`,children:[(0,Y.jsxs)(`div`,{style:{display:`flex`,gap:`0.25rem`,alignItems:`center`,padding:`0.25rem`},onKeyDown:e=>e.stopPropagation(),children:[(0,Y.jsx)(HF,{type:`number`,min:1,value:i,placeholder:`Custom`,autoFocus:!0,style:{width:`5rem`},onChange:e=>a(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),d())}}),(0,Y.jsx)(Q,{type:`button`,"data-style":`ghost`,showTooltip:!1,onClick:d,children:(0,Y.jsx)(`span`,{className:`planet-button-text`,children:`Set`})})]}),(0,Y.jsx)(ZP,{}),(0,Y.jsxs)(YP,{children:[(0,Y.jsx)(XP,{asChild:!0,children:(0,Y.jsx)(Q,{type:`button`,"data-style":`ghost`,"data-active-state":o?`off`:`on`,showTooltip:!1,onClick:u,children:(0,Y.jsx)(`span`,{className:`planet-button-text`,children:`Default`})})}),UF.map(e=>(0,Y.jsx)(XP,{asChild:!0,children:(0,Y.jsx)(Q,{type:`button`,"data-style":`ghost`,"data-active-state":s===e?`on`:`off`,showTooltip:!1,onClick:()=>l(e),children:(0,Y.jsx)(`span`,{className:`planet-button-text`,children:e})})},e))]})]})]})}function qF({type:e,shortcutKeys:t=eI[e]}){return(0,Y.jsx)(AO,{children:BD({shortcutKeys:t})})}var JF=(0,J.forwardRef)(({editor:e,type:t,text:n,hideWhenUnavailable:r=!1,onToggled:i,showShortcut:a=!1,onClick:o,children:s,...c},l)=>{let{editor:u}=kO(e),{isVisible:d,canToggle:f,isActive:p,handleToggle:m,label:h,shortcutKeys:g,Icon:_}=aI({editor:u,type:t,hideWhenUnavailable:r,onToggled:i}),v=(0,J.useCallback)(e=>{o?.(e),!e.defaultPrevented&&m()},[m,o]);return d?(0,Y.jsx)(Q,{type:`button`,variant:`ghost`,"data-active-state":p?`on`:`off`,role:`button`,tabIndex:-1,disabled:!f,"data-disabled":!f,"aria-label":h,"aria-pressed":p,tooltip:h,onClick:v,...c,ref:l,children:s??(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(_,{className:`planet-button-icon`}),n&&(0,Y.jsx)(`span`,{className:`planet-button-text`,children:n}),a&&(0,Y.jsx)(qF,{type:t,shortcutKeys:g})]})}):null});JF.displayName=`ListButton`;var YF=(0,J.memo)(({className:e,...t})=>(0,Y.jsxs)(`svg`,{width:`24`,height:`24`,className:e,viewBox:`0 0 24 24`,fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`,...t,children:[(0,Y.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M7 6C7 5.44772 7.44772 5 8 5H21C21.5523 5 22 5.44772 22 6C22 6.55228 21.5523 7 21 7H8C7.44772 7 7 6.55228 7 6Z`,fill:`currentColor`}),(0,Y.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M7 12C7 11.4477 7.44772 11 8 11H21C21.5523 11 22 11.4477 22 12C22 12.5523 21.5523 13 21 13H8C7.44772 13 7 12.5523 7 12Z`,fill:`currentColor`}),(0,Y.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M7 18C7 17.4477 7.44772 17 8 17H21C21.5523 17 22 17.4477 22 18C22 18.5523 21.5523 19 21 19H8C7.44772 19 7 18.5523 7 18Z`,fill:`currentColor`}),(0,Y.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M2 6C2 5.44772 2.44772 5 3 5H3.01C3.56228 5 4.01 5.44772 4.01 6C4.01 6.55228 3.56228 7 3.01 7H3C2.44772 7 2 6.55228 2 6Z`,fill:`currentColor`}),(0,Y.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M2 12C2 11.4477 2.44772 11 3 11H3.01C3.56228 11 4.01 11.4477 4.01 12C4.01 12.5523 3.56228 13 3.01 13H3C2.44772 13 2 12.5523 2 12Z`,fill:`currentColor`}),(0,Y.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M2 18C2 17.4477 2.44772 17 3 17H3.01C3.56228 17 4.01 17.4477 4.01 18C4.01 18.5523 3.56228 19 3.01 19H3C2.44772 19 2 18.5523 2 18Z`,fill:`currentColor`})]}));YF.displayName=`ListIcon`;var XF=(0,J.memo)(({className:e,...t})=>(0,Y.jsxs)(`svg`,{width:`24`,height:`24`,className:e,viewBox:`0 0 24 24`,fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`,...t,children:[(0,Y.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M9 6C9 5.44772 9.44772 5 10 5H21C21.5523 5 22 5.44772 22 6C22 6.55228 21.5523 7 21 7H10C9.44772 7 9 6.55228 9 6Z`,fill:`currentColor`}),(0,Y.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M9 12C9 11.4477 9.44772 11 10 11H21C21.5523 11 22 11.4477 22 12C22 12.5523 21.5523 13 21 13H10C9.44772 13 9 12.5523 9 12Z`,fill:`currentColor`}),(0,Y.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M9 18C9 17.4477 9.44772 17 10 17H21C21.5523 17 22 17.4477 22 18C22 18.5523 21.5523 19 21 19H10C9.44772 19 9 18.5523 9 18Z`,fill:`currentColor`}),(0,Y.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M3 6C3 5.44772 3.44772 5 4 5H5C5.55228 5 6 5.44772 6 6V10C6 10.5523 5.55228 11 5 11C4.44772 11 4 10.5523 4 10V7C3.44772 7 3 6.55228 3 6Z`,fill:`currentColor`}),(0,Y.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M3 10C3 9.44772 3.44772 9 4 9H6C6.55228 9 7 9.44772 7 10C7 10.5523 6.55228 11 6 11H4C3.44772 11 3 10.5523 3 10Z`,fill:`currentColor`}),(0,Y.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M5.82219 13.0431C6.54543 13.4047 6.99997 14.1319 6.99997 15C6.99997 15.5763 6.71806 16.0426 6.48747 16.35C6.31395 16.5814 6.1052 16.8044 5.91309 17H5.99997C6.55226 17 6.99997 17.4477 6.99997 18C6.99997 18.5523 6.55226 19 5.99997 19H3.99997C3.44769 19 2.99997 18.5523 2.99997 18C2.99997 17.4237 3.28189 16.9575 3.51247 16.65C3.74323 16.3424 4.03626 16.0494 4.26965 15.8161C4.27745 15.8083 4.2852 15.8006 4.29287 15.7929C4.55594 15.5298 4.75095 15.3321 4.88748 15.15C4.96287 15.0495 4.99021 14.9922 4.99911 14.9714C4.99535 14.9112 4.9803 14.882 4.9739 14.8715C4.96613 14.8588 4.95382 14.845 4.92776 14.8319C4.87723 14.8067 4.71156 14.7623 4.44719 14.8944C3.95321 15.1414 3.35254 14.9412 3.10555 14.4472C2.85856 13.9533 3.05878 13.3526 3.55276 13.1056C4.28839 12.7378 5.12272 12.6934 5.82219 13.0431Z`,fill:`currentColor`})]}));XF.displayName=`ListOrderedIcon`;var ZF=(0,J.memo)(({className:e,...t})=>(0,Y.jsxs)(`svg`,{width:`24`,height:`24`,className:e,viewBox:`0 0 24 24`,fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`,...t,children:[(0,Y.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M2 6C2 4.89543 2.89543 4 4 4H8C9.10457 4 10 4.89543 10 6V10C10 11.1046 9.10457 12 8 12H4C2.89543 12 2 11.1046 2 10V6ZM8 6H4V10H8V6Z`,fill:`currentColor`}),(0,Y.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M9.70711 14.2929C10.0976 14.6834 10.0976 15.3166 9.70711 15.7071L5.70711 19.7071C5.31658 20.0976 4.68342 20.0976 4.29289 19.7071L2.29289 17.7071C1.90237 17.3166 1.90237 16.6834 2.29289 16.2929C2.68342 15.9024 3.31658 15.9024 3.70711 16.2929L5 17.5858L8.29289 14.2929C8.68342 13.9024 9.31658 13.9024 9.70711 14.2929Z`,fill:`currentColor`}),(0,Y.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M12 6C12 5.44772 12.4477 5 13 5H21C21.5523 5 22 5.44772 22 6C22 6.55228 21.5523 7 21 7H13C12.4477 7 12 6.55228 12 6Z`,fill:`currentColor`}),(0,Y.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M12 12C12 11.4477 12.4477 11 13 11H21C21.5523 11 22 11.4477 22 12C22 12.5523 21.5523 13 21 13H13C12.4477 13 12 12.5523 12 12Z`,fill:`currentColor`}),(0,Y.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M12 18C12 17.4477 12.4477 17 13 17H21C21.5523 17 22 17.4477 22 18C22 18.5523 21.5523 19 21 19H13C12.4477 19 12 18.5523 12 18Z`,fill:`currentColor`})]}));ZF.displayName=`ListTodoIcon`;var QF={bulletList:YF,orderedList:XF,taskList:ZF},$F={bulletList:`Bullet List`,orderedList:`Ordered List`,taskList:`Task List`},eI={bulletList:`mod+shift+8`,orderedList:`mod+shift+7`,taskList:`mod+shift+9`};function tI(e,t,n=!0){if(!e||!e.isEditable||!HD(t,e)||JD(e,[`image`]))return!1;if(!n)switch(t){case`bulletList`:return e.can().toggleBulletList();case`orderedList`:return e.can().toggleOrderedList();case`taskList`:return e.can().toggleList(`taskList`,`taskItem`);default:return!1}if(!YD(e,[`paragraph`,`heading`,`bulletList`,`orderedList`,`taskList`,`blockquote`,`codeBlock`]))return!1;switch(t){case`bulletList`:return e.can().toggleBulletList()||e.can().clearNodes();case`orderedList`:return e.can().toggleOrderedList()||e.can().clearNodes();case`taskList`:return e.can().toggleList(`taskList`,`taskItem`)||e.can().clearNodes();default:return!1}}function nI(e,t){if(!e||!e.isEditable)return!1;switch(t){case`bulletList`:return e.isActive(`bulletList`);case`orderedList`:return e.isActive(`orderedList`);case`taskList`:return e.isActive(`taskList`);default:return!1}}function rI(e,t){if(!e||!e.isEditable||!tI(e,t))return!1;try{let n=e.view,r=n.state,i=r.tr,a=eO(e),o=YD(e,[`paragraph`,`heading`,`bulletList`,`orderedList`,`taskList`,`blockquote`,`codeBlock`])&&a.length===1;if((r.selection.empty||r.selection instanceof P)&&o){let t=qD({editor:e,node:r.selection.$anchor.node(1)})?.pos;if(!WD(t))return!1;i=i.setSelection(F.create(r.doc,t)),n.dispatch(i),r=n.state}let s=r.selection,c=e.chain().focus();if(s instanceof F){let e=s.node.firstChild?.firstChild,t=s.node.lastChild?.lastChild,n=e?s.from+e.nodeSize:s.from+1,i=t?s.to-t.nodeSize:s.to-1,a=r.doc.resolve(n),o=r.doc.resolve(i);c=c.setTextSelection(P.between(a,o)).clearNodes()}if(e.isActive(t))c.liftListItem(`listItem`).lift(`bulletList`).lift(`orderedList`).lift(`taskList`).run();else{let e={bulletList:()=>c.toggleBulletList(),orderedList:()=>c.toggleOrderedList(),taskList:()=>c.toggleList(`taskList`,`taskItem`)}[t];if(!e)return!1;e().run()}return e.chain().focus().selectTextblockEnd().run(),!0}catch{return!1}}function iI(e){let{editor:t,type:n,hideWhenUnavailable:r}=e;return t?r?!t.isEditable||!HD(n,t)?!1:t.isActive(`code`)?!0:tI(t,n):!0:!1}function aI(e){let{editor:t,type:n,hideWhenUnavailable:r=!1,onToggled:i}=e,{editor:a}=kO(t),[o,s]=(0,J.useState)(!0),c=tI(a,n),l=nI(a,n);return(0,J.useEffect)(()=>{if(!a)return;let e=()=>{s(iI({editor:a,type:n,hideWhenUnavailable:r}))};return e(),a.on(`selectionUpdate`,e),()=>{a.off(`selectionUpdate`,e)}},[a,n,r]),{isVisible:o,isActive:l,handleToggle:(0,J.useCallback)(()=>{if(!a)return!1;let e=rI(a,n);return e&&i?.(),e},[a,n,i]),canToggle:c,label:$F[n],shortcutKeys:eI[n],Icon:QF[n]}}var oI=[{label:`Bullet List`,type:`bulletList`,icon:YF},{label:`Ordered List`,type:`orderedList`,icon:XF},{label:`Task List`,type:`taskList`,icon:ZF}];function sI(e,t){return!e||!e.isEditable?!1:t.some(t=>tI(e,t))}function cI(e,t){return!e||!e.isEditable?!1:t.some(t=>nI(e,t))}function lI(e){return oI.filter(t=>!t.type||e.includes(t.type))}function uI(e){let{editor:t,hideWhenUnavailable:n,listInSchema:r,canToggleAny:i}=e;return t?n?r?t.isActive(`code`)?!0:i:!1:!0:!1}function dI(e,t){if(!(!e||!e.isEditable))return t.find(t=>nI(e,t))}function fI(e){let{editor:t,types:n=[`bulletList`,`orderedList`,`taskList`],hideWhenUnavailable:r=!1}=e||{},{editor:i}=kO(t),[a,o]=(0,J.useState)(!0),s=n.some(e=>HD(e,i)),c=(0,J.useMemo)(()=>lI(n),[n]),l=sI(i,n),u=cI(i,n),d=dI(i,n),f=c.find(e=>e.type===d);return(0,J.useEffect)(()=>{if(!i)return;let e=()=>{o(uI({editor:i,listTypes:n,hideWhenUnavailable:r,listInSchema:s,canToggleAny:l}))};return e(),i.on(`selectionUpdate`,e),()=>{i.off(`selectionUpdate`,e)}},[l,i,r,s,n]),{isVisible:a,activeType:d,isActive:u,canToggle:l,types:n,filteredLists:c,label:`List`,Icon:f?QF[f.type]:YF}}function pI({editor:e,types:t=[`bulletList`,`orderedList`,`taskList`],hideWhenUnavailable:n=!1,onOpenChange:r,modal:i=!0,...a},o){let{editor:s}=kO(e),[c,l]=(0,J.useState)(!1),{filteredLists:u,canToggle:d,isActive:f,isVisible:p,Icon:m}=fI({editor:s,types:t,hideWhenUnavailable:n}),h=(0,J.useCallback)(e=>{l(e),r?.(e)},[r]);return p?(0,Y.jsxs)(KP,{modal:i,open:c,onOpenChange:h,children:[(0,Y.jsx)(qP,{asChild:!0,children:(0,Y.jsxs)(Q,{type:`button`,variant:`ghost`,"data-active-state":f?`on`:`off`,role:`button`,tabIndex:-1,disabled:!d,"data-disabled":!d,"aria-label":`List options`,tooltip:`List`,...a,ref:o,children:[(0,Y.jsx)(m,{className:`planet-button-icon`}),(0,Y.jsx)(DO,{className:`planet-button-dropdown-small`})]})}),(0,Y.jsx)(JP,{align:`start`,children:(0,Y.jsx)(YP,{children:u.map(e=>(0,Y.jsx)(XP,{asChild:!0,children:(0,Y.jsx)(JF,{editor:s,type:e.type,text:e.label,showTooltip:!1})},e.type))})})]}):null}var mI=(0,J.forwardRef)(pI);mI.displayName=`ListDropdownMenu`;function hI({shortcutKeys:e=vI}){return(0,Y.jsx)(AO,{children:BD({shortcutKeys:e})})}var gI=(0,J.forwardRef)(({editor:e,text:t,hideWhenUnavailable:n=!1,onToggled:r,showShortcut:i=!1,onClick:a,children:o,...s},c)=>{let{editor:l}=kO(e),{isVisible:u,canToggle:d,isActive:f,handleToggle:p,label:m,shortcutKeys:h,Icon:g}=SI({editor:l,hideWhenUnavailable:n,onToggled:r}),_=(0,J.useCallback)(e=>{a?.(e),!e.defaultPrevented&&p()},[p,a]);return u?(0,Y.jsx)(Q,{type:`button`,variant:`ghost`,"data-active-state":f?`on`:`off`,role:`button`,tabIndex:-1,disabled:!d,"data-disabled":!d,"aria-label":m,"aria-pressed":f,tooltip:`Blockquote`,onClick:_,...s,ref:c,children:o??(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(g,{className:`planet-button-icon`}),t&&(0,Y.jsx)(`span`,{className:`planet-button-text`,children:t}),i&&(0,Y.jsx)(hI,{shortcutKeys:h})]})}):null});gI.displayName=`BlockquoteButton`;var _I=(0,J.memo)(({className:e,...t})=>(0,Y.jsxs)(`svg`,{width:`24`,height:`24`,className:e,viewBox:`0 0 24 24`,fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`,...t,children:[(0,Y.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M8 6C8 5.44772 8.44772 5 9 5H16C16.5523 5 17 5.44772 17 6C17 6.55228 16.5523 7 16 7H9C8.44772 7 8 6.55228 8 6Z`,fill:`currentColor`}),(0,Y.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M4 3C4.55228 3 5 3.44772 5 4L5 20C5 20.5523 4.55229 21 4 21C3.44772 21 3 20.5523 3 20L3 4C3 3.44772 3.44772 3 4 3Z`,fill:`currentColor`}),(0,Y.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M8 12C8 11.4477 8.44772 11 9 11H20C20.5523 11 21 11.4477 21 12C21 12.5523 20.5523 13 20 13H9C8.44772 13 8 12.5523 8 12Z`,fill:`currentColor`}),(0,Y.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M8 18C8 17.4477 8.44772 17 9 17H16C16.5523 17 17 17.4477 17 18C17 18.5523 16.5523 19 16 19H9C8.44772 19 8 18.5523 8 18Z`,fill:`currentColor`})]}));_I.displayName=`BlockquoteIcon`;var vI=`mod+shift+b`;function yI(e,t=!0){return!e||!e.isEditable||!HD(`blockquote`,e)||JD(e,[`image`])?!1:t?YD(e,[`paragraph`,`heading`,`bulletList`,`orderedList`,`taskList`,`blockquote`,`codeBlock`])?e.can().toggleWrap(`blockquote`)||e.can().clearNodes():!1:e.can().toggleWrap(`blockquote`)}function bI(e){if(!e||!e.isEditable||!yI(e))return!1;try{let t=e.view,n=t.state,r=n.tr,i=eO(e),a=YD(e,[`paragraph`,`heading`,`bulletList`,`orderedList`,`taskList`,`blockquote`,`codeBlock`])&&i.length===1;if((n.selection.empty||n.selection instanceof P)&&a){let i=qD({editor:e,node:n.selection.$anchor.node(1)})?.pos;if(!WD(i))return!1;r=r.setSelection(F.create(n.doc,i)),t.dispatch(r),n=t.state}let o=n.selection,s=e.chain().focus();if(o instanceof F){let e=o.node.firstChild?.firstChild,t=o.node.lastChild?.lastChild,r=e?o.from+e.nodeSize:o.from+1,i=t?o.to-t.nodeSize:o.to-1,a=n.doc.resolve(r),c=n.doc.resolve(i);s=s.setTextSelection(P.between(a,c)).clearNodes()}return(e.isActive(`blockquote`)?s.lift(`blockquote`):s.wrapIn(`blockquote`)).run(),e.chain().focus().selectTextblockEnd().run(),!0}catch{return!1}}function xI(e){let{editor:t,hideWhenUnavailable:n}=e;return t?n?!t.isEditable||!HD(`blockquote`,t)?!1:t.isActive(`code`)?!0:yI(t):!0:!1}function SI(e){let{editor:t,hideWhenUnavailable:n=!1,onToggled:r}=e||{},{editor:i}=kO(t),[a,o]=(0,J.useState)(!0),s=yI(i),c=i?.isActive(`blockquote`)||!1;return(0,J.useEffect)(()=>{if(!i)return;let e=()=>{o(xI({editor:i,hideWhenUnavailable:n}))};return e(),i.on(`selectionUpdate`,e),()=>{i.off(`selectionUpdate`,e)}},[i,n]),{isVisible:a,isActive:c,handleToggle:(0,J.useCallback)(()=>{if(!i)return!1;let e=bI(i);return e&&r?.(),e},[i,r]),canToggle:s,label:`Blockquote`,shortcutKeys:vI,Icon:_I}}function CI({shortcutKeys:e=EI}){return(0,Y.jsx)(AO,{children:BD({shortcutKeys:e})})}var wI=(0,J.forwardRef)(({editor:e,text:t,hideWhenUnavailable:n=!1,onToggled:r,showShortcut:i=!1,onClick:a,children:o,...s},c)=>{let{editor:l}=kO(e),{isVisible:u,canToggle:d,isActive:f,handleToggle:p,label:m,shortcutKeys:h,Icon:g}=AI({editor:l,hideWhenUnavailable:n,onToggled:r}),_=(0,J.useCallback)(e=>{a?.(e),!e.defaultPrevented&&p()},[p,a]);return u?(0,Y.jsx)(Q,{type:`button`,variant:`ghost`,"data-active-state":f?`on`:`off`,role:`button`,disabled:!d,"data-disabled":!d,tabIndex:-1,"aria-label":m,"aria-pressed":f,tooltip:`Code Block`,onClick:_,...s,ref:c,children:o??(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(g,{className:`planet-button-icon`}),t&&(0,Y.jsx)(`span`,{className:`planet-button-text`,children:t}),i&&(0,Y.jsx)(CI,{shortcutKeys:h})]})}):null});wI.displayName=`CodeBlockButton`;var TI=(0,J.memo)(({className:e,...t})=>(0,Y.jsxs)(`svg`,{width:`24`,height:`24`,className:e,viewBox:`0 0 24 24`,fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`,...t,children:[(0,Y.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M6.70711 2.29289C7.09763 2.68342 7.09763 3.31658 6.70711 3.70711L4.41421 6L6.70711 8.29289C7.09763 8.68342 7.09763 9.31658 6.70711 9.70711C6.31658 10.0976 5.68342 10.0976 5.29289 9.70711L2.29289 6.70711C1.90237 6.31658 1.90237 5.68342 2.29289 5.29289L5.29289 2.29289C5.68342 1.90237 6.31658 1.90237 6.70711 2.29289Z`,fill:`currentColor`}),(0,Y.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M10.2929 2.29289C10.6834 1.90237 11.3166 1.90237 11.7071 2.29289L14.7071 5.29289C15.0976 5.68342 15.0976 6.31658 14.7071 6.70711L11.7071 9.70711C11.3166 10.0976 10.6834 10.0976 10.2929 9.70711C9.90237 9.31658 9.90237 8.68342 10.2929 8.29289L12.5858 6L10.2929 3.70711C9.90237 3.31658 9.90237 2.68342 10.2929 2.29289Z`,fill:`currentColor`}),(0,Y.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M17 4C17 3.44772 17.4477 3 18 3H19C20.6569 3 22 4.34315 22 6V18C22 19.6569 20.6569 21 19 21H5C3.34315 21 2 19.6569 2 18V12C2 11.4477 2.44772 11 3 11C3.55228 11 4 11.4477 4 12V18C4 18.5523 4.44772 19 5 19H19C19.5523 19 20 18.5523 20 18V6C20 5.44772 19.5523 5 19 5H18C17.4477 5 17 4.55228 17 4Z`,fill:`currentColor`})]}));TI.displayName=`CodeBlockIcon`;var EI=`mod+alt+c`;function DI(e,t=!0){return!e||!e.isEditable||!HD(`codeBlock`,e)||JD(e,[`image`])?!1:t?YD(e,[`paragraph`,`heading`,`bulletList`,`orderedList`,`taskList`,`blockquote`,`codeBlock`])?e.can().toggleNode(`codeBlock`,`paragraph`)||e.can().clearNodes():!1:e.can().toggleNode(`codeBlock`,`paragraph`)}function OI(e){if(!e||!e.isEditable||!DI(e))return!1;try{let t=e.view,n=t.state,r=n.tr,i=eO(e),a=YD(e,[`paragraph`,`heading`,`bulletList`,`orderedList`,`taskList`,`blockquote`,`codeBlock`])&&i.length===1;if((n.selection.empty||n.selection instanceof P)&&a){let i=qD({editor:e,node:n.selection.$anchor.node(1)})?.pos;if(!WD(i))return!1;r=r.setSelection(F.create(n.doc,i)),t.dispatch(r),n=t.state}let o=n.selection,s=e.chain().focus();if(o instanceof F){let e=o.node.firstChild?.firstChild,t=o.node.lastChild?.lastChild,r=e?o.from+e.nodeSize:o.from+1,i=t?o.to-t.nodeSize:o.to-1,a=n.doc.resolve(r),c=n.doc.resolve(i);s=s.setTextSelection(P.between(a,c)).clearNodes()}return(e.isActive(`codeBlock`)?s.setNode(`paragraph`):s.toggleNode(`codeBlock`,`paragraph`)).run(),e.chain().focus().selectTextblockEnd().run(),!0}catch{return!1}}function kI(e){let{editor:t,hideWhenUnavailable:n}=e;return t?n?!t.isEditable||!HD(`codeBlock`,t)?!1:t.isActive(`code`)?!0:DI(t):!0:!1}function AI(e){let{editor:t,hideWhenUnavailable:n=!1,onToggled:r}=e||{},{editor:i}=kO(t),[a,o]=(0,J.useState)(!0),s=DI(i),c=i?.isActive(`codeBlock`)||!1;return(0,J.useEffect)(()=>{if(!i)return;let e=()=>{o(kI({editor:i,hideWhenUnavailable:n}))};return e(),i.on(`selectionUpdate`,e),()=>{i.off(`selectionUpdate`,e)}},[i,n]),{isVisible:a,isActive:c,handleToggle:(0,J.useCallback)(()=>{if(!i)return!1;let e=OI(i);return e&&r?.(),e},[i,r]),canToggle:s,label:`Code Block`,shortcutKeys:EI,Icon:TI}}var jI=(0,J.memo)(({className:e,...t})=>(0,Y.jsx)(`svg`,{width:`24`,height:`24`,className:e,viewBox:`0 0 24 24`,fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`,...t,children:(0,Y.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M4.43471 4.01458C4.34773 4.06032 4.26607 4.11977 4.19292 4.19292C4.11977 4.26607 4.06032 4.34773 4.01458 4.43471C2.14611 6.40628 1 9.0693 1 12C1 18.0751 5.92487 23 12 23C14.9306 23 17.5936 21.854 19.5651 19.9856C19.6522 19.9398 19.7339 19.8803 19.8071 19.8071C19.8803 19.7339 19.9398 19.6522 19.9856 19.5651C21.854 17.5936 23 14.9306 23 12C23 5.92487 18.0751 1 12 1C9.0693 1 6.40628 2.14611 4.43471 4.01458ZM6.38231 4.9681C7.92199 3.73647 9.87499 3 12 3C16.9706 3 21 7.02944 21 12C21 14.125 20.2635 16.078 19.0319 17.6177L6.38231 4.9681ZM17.6177 19.0319C16.078 20.2635 14.125 21 12 21C7.02944 21 3 16.9706 3 12C3 9.87499 3.73647 7.92199 4.9681 6.38231L17.6177 19.0319Z`,fill:`currentColor`})}));jI.displayName=`BanIcon`;var MI=(0,J.memo)(({className:e,...t})=>(0,Y.jsx)(`svg`,{width:`24`,height:`24`,className:e,viewBox:`0 0 24 24`,fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`,...t,children:(0,Y.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M14.7072 4.70711C15.0977 4.31658 15.0977 3.68342 14.7072 3.29289C14.3167 2.90237 13.6835 2.90237 13.293 3.29289L8.69294 7.89286L8.68594 7.9C8.13626 8.46079 7.82837 9.21474 7.82837 10C7.82837 10.2306 7.85491 10.4584 7.90631 10.6795L2.29289 16.2929C2.10536 16.4804 2 16.7348 2 17V20C2 20.5523 2.44772 21 3 21H12C12.2652 21 12.5196 20.8946 12.7071 20.7071L15.3205 18.0937C15.5416 18.1452 15.7695 18.1717 16.0001 18.1717C16.7853 18.1717 17.5393 17.8639 18.1001 17.3142L22.7072 12.7071C23.0977 12.3166 23.0977 11.6834 22.7072 11.2929C22.3167 10.9024 21.6835 10.9024 21.293 11.2929L16.6971 15.8887C16.5105 16.0702 16.2605 16.1717 16.0001 16.1717C15.7397 16.1717 15.4897 16.0702 15.303 15.8887L10.1113 10.697C9.92992 10.5104 9.82837 10.2604 9.82837 10C9.82837 9.73963 9.92992 9.48958 10.1113 9.30297L14.7072 4.70711ZM13.5858 17L9.00004 12.4142L4 17.4142V19H11.5858L13.5858 17Z`,fill:`currentColor`})}));MI.displayName=`HighlighterIcon`;var NI=`Popover`,[PI,FI]=YO(NI,[lA]),II=lA(),[LI,RI]=PI(NI),zI=e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!1}=e,s=II(t),c=J.useRef(null),[l,u]=J.useState(!1),[d,f]=$O({prop:r,defaultProp:i??!1,onChange:a,caller:NI});return(0,Y.jsx)(TA,{...s,children:(0,Y.jsx)(LI,{scope:t,contentId:nA(),triggerRef:c,open:d,onOpenChange:f,onOpenToggle:J.useCallback(()=>f(e=>!e),[f]),hasCustomAnchor:l,onCustomAnchorAdd:J.useCallback(()=>u(!0),[]),onCustomAnchorRemove:J.useCallback(()=>u(!1),[]),modal:o,children:n})})};zI.displayName=NI;var BI=`PopoverAnchor`,VI=J.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=RI(BI,n),a=II(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:s}=i;return J.useEffect(()=>(o(),()=>s()),[o,s]),(0,Y.jsx)(EA,{...a,...r,ref:t})});VI.displayName=BI;var HI=`PopoverTrigger`,UI=J.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=RI(HI,n),a=II(n),o=JO(t,i.triggerRef),s=(0,Y.jsx)(mk.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":iL(i.open),...r,ref:o,onClick:$(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?s:(0,Y.jsx)(EA,{asChild:!0,...a,children:s})});UI.displayName=HI;var WI=`PopoverPortal`,[GI,KI]=PI(WI,{forceMount:void 0}),qI=e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=RI(WI,t);return(0,Y.jsx)(GI,{scope:t,forceMount:n,children:(0,Y.jsx)(MA,{present:n||a.open,children:(0,Y.jsx)(AA,{asChild:!0,container:i,children:r})})})};qI.displayName=WI;var JI=`PopoverContent`,YI=J.forwardRef((e,t)=>{let n=KI(JI,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=RI(JI,e.__scopePopover);return(0,Y.jsx)(MA,{present:r||a.open,children:a.modal?(0,Y.jsx)(ZI,{...i,ref:t}):(0,Y.jsx)(QI,{...i,ref:t})})});YI.displayName=JI;var XI=nk(`PopoverContent.RemoveScroll`),ZI=J.forwardRef((e,t)=>{let n=RI(JI,e.__scopePopover),r=J.useRef(null),i=JO(t,r),a=J.useRef(!1);return J.useEffect(()=>{let e=r.current;if(e)return pj(e)},[]),(0,Y.jsx)(SM,{as:XI,allowPinchZoom:!0,children:(0,Y.jsx)($I,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:$(e.onCloseAutoFocus,e=>{e.preventDefault(),a.current||n.triggerRef.current?.focus()}),onPointerDownOutside:$(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;a.current=t.button===2||n},{checkForDefaultPrevented:!1}),onFocusOutside:$(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),QI=J.forwardRef((e,t)=>{let n=RI(JI,e.__scopePopover),r=J.useRef(!1),i=J.useRef(!1);return(0,Y.jsx)($I,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),$I=J.forwardRef((e,t)=>{let{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:u,...d}=e,f=RI(JI,n),p=II(n);return Ik(),(0,Y.jsx)(Hk,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,Y.jsx)(Dk,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>f.onOpenChange(!1),deferPointerDownOutside:!0,children:(0,Y.jsx)(DA,{"data-state":iL(f.open),role:`dialog`,id:f.contentId,...p,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-popover-content-available-width":`var(--radix-popper-available-width)`,"--radix-popover-content-available-height":`var(--radix-popper-available-height)`,"--radix-popover-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-popover-trigger-height":`var(--radix-popper-anchor-height)`}})})})}),eL=`PopoverClose`,tL=J.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=RI(eL,n);return(0,Y.jsx)(mk.button,{type:`button`,...r,ref:t,onClick:$(e.onClick,()=>i.onOpenChange(!1))})});tL.displayName=eL;var nL=`PopoverArrow`,rL=J.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=II(n);return(0,Y.jsx)(OA,{...i,...r,ref:t})});rL.displayName=nL;function iL(e){return e?`open`:`closed`}var aL=zI,oL=UI,sL=qI,cL=YI;function lL({...e}){return(0,Y.jsx)(aL,{...e})}function uL({...e}){return(0,Y.jsx)(oL,{...e})}function dL({className:e,align:t=`center`,sideOffset:n=4,...r}){return(0,Y.jsx)(sL,{children:(0,Y.jsx)(cL,{align:t,sideOffset:n,className:LD(`planet-popover`,e),...r})})}var fL=(0,J.forwardRef)(({className:e,...t},n)=>(0,Y.jsx)(`div`,{ref:n,className:LD(`planet-card`,e),...t}));fL.displayName=`Card`;var pL=(0,J.forwardRef)(({className:e,...t},n)=>(0,Y.jsx)(`div`,{ref:n,className:LD(`planet-card-header`,e),...t}));pL.displayName=`CardHeader`;var mL=(0,J.forwardRef)(({className:e,...t},n)=>(0,Y.jsx)(`div`,{ref:n,className:LD(`planet-card-body`,e),...t}));mL.displayName=`CardBody`;var hL=(0,J.forwardRef)(({className:e,orientation:t=`vertical`,...n},r)=>(0,Y.jsx)(`div`,{ref:r,"data-orientation":t,className:LD(`planet-card-item-group`,e),...n}));hL.displayName=`CardItemGroup`;var gL=(0,J.forwardRef)(({className:e,...t},n)=>(0,Y.jsx)(`div`,{ref:n,className:LD(`planet-card-group-label`,e),...t}));gL.displayName=`CardGroupLabel`;var _L=(0,J.forwardRef)(({className:e,...t},n)=>(0,Y.jsx)(`div`,{ref:n,className:LD(`planet-card-footer`,e),...t}));_L.displayName=`CardFooter`;function vL({shortcutKeys:e=bL}){return(0,Y.jsx)(AO,{children:BD({shortcutKeys:e})})}var yL=(0,J.forwardRef)(({editor:e,highlightColor:t,text:n,hideWhenUnavailable:r=!1,mode:i=`mark`,onApplied:a,showShortcut:o=!1,onClick:s,children:c,style:l,useColorValue:u=!1,...d},f)=>{let{editor:p}=kO(e),{isVisible:m,canColorHighlight:h,isActive:g,handleColorHighlight:_,label:v,shortcutKeys:y}=OL({editor:p,highlightColor:t,useColorValue:u,label:n||`Toggle highlight (${t})`,hideWhenUnavailable:r,mode:i,onApplied:a}),b=(0,J.useCallback)(e=>{s?.(e),!e.defaultPrevented&&_()},[_,s]),x=(0,J.useMemo)(()=>({...l,"--highlight-color":t}),[t,l]);return m?(0,Y.jsx)(Q,{type:`button`,variant:`ghost`,"data-active-state":g?`on`:`off`,role:`button`,tabIndex:-1,disabled:!h,"data-disabled":!h,"aria-label":v,"aria-pressed":g,tooltip:v,onClick:b,style:x,...d,ref:f,children:c??(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`span`,{className:`planet-button-highlight`,style:{"--highlight-color":t}}),n&&(0,Y.jsx)(`span`,{className:`planet-button-text`,children:n}),o&&(0,Y.jsx)(vL,{shortcutKeys:y})]})}):null});yL.displayName=`ColorHighlightButton`;var bL=`mod+shift+h`,xL=[{label:`Default background`,value:`var(--tt-bg-color)`,colorValue:`#ffffff`,border:`var(--tt-bg-color-contrast)`},{label:`Gray background`,value:`var(--tt-color-highlight-gray)`,colorValue:`#f8f8f7`,border:`var(--tt-color-highlight-gray-contrast)`},{label:`Brown background`,value:`var(--tt-color-highlight-brown)`,colorValue:`#f4eeee`,border:`var(--tt-color-highlight-brown-contrast)`},{label:`Orange background`,value:`var(--tt-color-highlight-orange)`,colorValue:`#fbecdd`,border:`var(--tt-color-highlight-orange-contrast)`},{label:`Yellow background`,value:`var(--tt-color-highlight-yellow)`,colorValue:`#fef9c3`,border:`var(--tt-color-highlight-yellow-contrast)`},{label:`Green background`,value:`var(--tt-color-highlight-green)`,colorValue:`#dcfce7`,border:`var(--tt-color-highlight-green-contrast)`},{label:`Blue background`,value:`var(--tt-color-highlight-blue)`,colorValue:`#e0f2fe`,border:`var(--tt-color-highlight-blue-contrast)`},{label:`Purple background`,value:`var(--tt-color-highlight-purple)`,colorValue:`#f3e8ff`,border:`var(--tt-color-highlight-purple-contrast)`},{label:`Pink background`,value:`var(--tt-color-highlight-pink)`,colorValue:`#fcf1f6`,border:`var(--tt-color-highlight-pink-contrast)`},{label:`Red background`,value:`var(--tt-color-highlight-red)`,colorValue:`#ffe4e6`,border:`var(--tt-color-highlight-red-contrast)`}];function SL(e){let t=new Map(xL.map(e=>[e.value,e]));return e.map(e=>t.get(e)).filter(e=>!!e)}function CL(e,t=!1){return t&&xL.find(t=>t.value===e||t.colorValue===e)?.colorValue||e}function wL(e,t=`mark`){if(!e||!e.isEditable)return!1;if(t===`mark`)return!VD(`highlight`,e)||JD(e,[`image`])?!1:e.can().setMark(`highlight`);if(!GD(e,[`nodeBackground`]))return!1;try{return e.can().toggleNodeBackgroundColor(`test`)}catch{return!1}}function TL(e,t,n=`mark`){if(!e||!e.isEditable)return!1;if(n===`mark`)return t?e.isActive(`highlight`,{color:t}):e.isActive(`highlight`);if(!t)return!1;try{let{state:n}=e,{selection:r}=n,i=r.$anchor;for(let e=i.depth;e>=0;e--){let n=i.node(e);if(n&&n.attrs?.backgroundColor===t)return!0}return!1}catch{return!1}}function EL(e,t=`mark`){return!e||!e.isEditable||!wL(e,t)?!1:t===`mark`?e.chain().focus().unsetMark(`highlight`).run():e.chain().focus().unsetNodeBackgroundColor().run()}function DL(e){let{editor:t,hideWhenUnavailable:n,mode:r}=e;if(!t)return!1;if(!n)return!0;if(!t.isEditable)return!1;if(r===`mark`){if(!VD(`highlight`,t))return!1}else if(!GD(t,[`nodeBackground`]))return!1;return t.isActive(`code`)?!0:wL(t,r)}function OL(e){let{editor:t,label:n,highlightColor:r,hideWhenUnavailable:i=!1,mode:a=`mark`,useColorValue:o=!1,onApplied:s}=e,{editor:c}=kO(t),l=PF(),[u,d]=(0,J.useState)(!0),f=wL(c,a),p=r&&CL(r,o),m=TL(c,p,a);(0,J.useEffect)(()=>{if(!c)return;let e=()=>{d(DL({editor:c,hideWhenUnavailable:i,mode:a}))};return e(),c.on(`selectionUpdate`,e),()=>{c.off(`selectionUpdate`,e)}},[c,i,a]);let h=(0,J.useCallback)(()=>{if(!c||!f||!p||!n)return!1;if(a===`mark`){if(c.state.storedMarks){let e=c.schema.marks.highlight;e&&c.view.dispatch(c.state.tr.removeStoredMark(e))}return setTimeout(()=>{let e=c.chain().focus().toggleHighlight({color:p}).run();return e&&s?.({color:p,label:n,mode:a}),e},0),!0}else{let e=c.chain().focus().toggleNodeBackgroundColor(p).run();return e&&s?.({color:p,label:n,mode:a}),e}},[f,p,c,n,s,a]),g=(0,J.useCallback)(()=>{let e=EL(c,a);return e&&s?.({color:``,label:`Remove highlight`,mode:a}),e},[c,s,a]);return NF(bL,e=>{e.preventDefault(),h()},{enabled:u&&f,enableOnContentEditable:!l,enableOnFormTags:!0}),{isVisible:u,isActive:m,handleColorHighlight:h,handleRemoveHighlight:g,canColorHighlight:f,label:n||`Highlight`,shortcutKeys:bL,Icon:MI,mode:a}}var kL=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,AL=PD,jL=((e,t)=>n=>{if(t?.variants==null)return AL(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=kL(t)||kL(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return AL(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)})(`planet-button-group`,{variants:{orientation:{horizontal:`planet-button-group-horizontal`,vertical:`planet-button-group-vertical`}},defaultVariants:{orientation:`horizontal`}});function ML({className:e,orientation:t,...n}){return(0,Y.jsx)(`div`,{role:`group`,"data-slot":`planet-button-group`,"data-orientation":t,className:LD(jL({orientation:t}),e),...n})}var NL=(0,J.forwardRef)(({className:e,children:t,...n},r)=>(0,Y.jsx)(Q,{type:`button`,className:e,variant:`ghost`,"data-appearance":`default`,role:`button`,tabIndex:-1,"aria-label":`Highlight text`,tooltip:`Highlight`,ref:r,...n,children:t??(0,Y.jsx)(MI,{className:`planet-button-icon`})}));NL.displayName=`ColorHighlightPopoverButton`;function PL({editor:e,colors:t=SL([`var(--tt-color-highlight-green)`,`var(--tt-color-highlight-blue)`,`var(--tt-color-highlight-red)`,`var(--tt-color-highlight-purple)`,`var(--tt-color-highlight-yellow)`]),useColorValue:n=!1}){let{handleRemoveHighlight:r}=OL({editor:e}),i=PF(),a=(0,J.useRef)(null),{selectedIndex:o}=iO({containerRef:a,items:(0,J.useMemo)(()=>[...t,{label:`Remove highlight`,value:`none`}],[t]),orientation:`both`,onSelect:e=>{if(!a.current)return!1;let t=a.current.querySelector(`[data-highlighted="true"]`);return t&&t.click(),e.value===`none`&&r(),!0},autoSelectFirstItem:!1});return(0,Y.jsx)(fL,{ref:a,tabIndex:0,style:i?{boxShadow:`none`,border:0}:{},children:(0,Y.jsx)(mL,{style:i?{padding:0}:{},children:(0,Y.jsxs)(hL,{orientation:`horizontal`,children:[(0,Y.jsx)(ML,{children:t.map((t,r)=>(0,Y.jsx)(ML,{children:(0,Y.jsx)(yL,{editor:e,highlightColor:n?t.colorValue:t.value,tooltip:t.label,"aria-label":`${t.label} highlight color`,tabIndex:r===o?0:-1,"data-highlighted":o===r,useColorValue:n})},t.value))}),(0,Y.jsx)(rO,{}),(0,Y.jsx)(ML,{children:(0,Y.jsx)(Q,{onClick:r,"aria-label":`Remove highlight`,tooltip:`Remove highlight`,tabIndex:o===t.length?0:-1,type:`button`,role:`menuitem`,variant:`ghost`,"data-highlighted":o===t.length,children:(0,Y.jsx)(jI,{className:`planet-button-icon`})})})]})})})}function FL({editor:e,colors:t=SL([`var(--tt-color-highlight-green)`,`var(--tt-color-highlight-blue)`,`var(--tt-color-highlight-red)`,`var(--tt-color-highlight-purple)`,`var(--tt-color-highlight-yellow)`]),hideWhenUnavailable:n=!1,useColorValue:r=!1,onApplied:i,...a}){let{editor:o}=kO(e),[s,c]=(0,J.useState)(!1),{isVisible:l,canColorHighlight:u,isActive:d,label:f,Icon:p}=OL({editor:o,hideWhenUnavailable:n,onApplied:i});return l?(0,Y.jsxs)(lL,{open:s,onOpenChange:c,children:[(0,Y.jsx)(uL,{asChild:!0,children:(0,Y.jsx)(NL,{disabled:!u,"data-active-state":d?`on`:`off`,"data-disabled":!u,"aria-pressed":d,"aria-label":f,tooltip:f,...a,children:(0,Y.jsx)(p,{className:`planet-button-icon`})})}),(0,Y.jsx)(dL,{"aria-label":`Highlight colors`,children:(0,Y.jsx)(PL,{editor:o,colors:t,useColorValue:r})})]}):null}var IL=(0,J.memo)(({className:e,...t})=>(0,Y.jsx)(`svg`,{width:`24`,height:`24`,className:e,viewBox:`0 0 24 24`,fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`,...t,children:(0,Y.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M21 4C21 3.44772 20.5523 3 20 3C19.4477 3 19 3.44772 19 4V11C19 11.7956 18.6839 12.5587 18.1213 13.1213C17.5587 13.6839 16.7956 14 16 14H6.41421L9.70711 10.7071C10.0976 10.3166 10.0976 9.68342 9.70711 9.29289C9.31658 8.90237 8.68342 8.90237 8.29289 9.29289L3.29289 14.2929C2.90237 14.6834 2.90237 15.3166 3.29289 15.7071L8.29289 20.7071C8.68342 21.0976 9.31658 21.0976 9.70711 20.7071C10.0976 20.3166 10.0976 19.6834 9.70711 19.2929L6.41421 16H16C17.3261 16 18.5979 15.4732 19.5355 14.5355C20.4732 13.5979 21 12.3261 21 11V4Z`,fill:`currentColor`})}));IL.displayName=`CornerDownLeftIcon`;var LL=(0,J.memo)(({className:e,...t})=>(0,Y.jsxs)(`svg`,{width:`24`,height:`24`,className:e,viewBox:`0 0 24 24`,fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`,...t,children:[(0,Y.jsx)(`path`,{d:`M14 3C14 2.44772 14.4477 2 15 2H21C21.5523 2 22 2.44772 22 3V9C22 9.55228 21.5523 10 21 10C20.4477 10 20 9.55228 20 9V5.41421L10.7071 14.7071C10.3166 15.0976 9.68342 15.0976 9.29289 14.7071C8.90237 14.3166 8.90237 13.6834 9.29289 13.2929L18.5858 4H15C14.4477 4 14 3.55228 14 3Z`,fill:`currentColor`}),(0,Y.jsx)(`path`,{d:`M4.29289 7.29289C4.48043 7.10536 4.73478 7 5 7H11C11.5523 7 12 6.55228 12 6C12 5.44772 11.5523 5 11 5H5C4.20435 5 3.44129 5.31607 2.87868 5.87868C2.31607 6.44129 2 7.20435 2 8V19C2 19.7957 2.31607 20.5587 2.87868 21.1213C3.44129 21.6839 4.20435 22 5 22H16C16.7957 22 17.5587 21.6839 18.1213 21.1213C18.6839 20.5587 19 19.7957 19 19V13C19 12.4477 18.5523 12 18 12C17.4477 12 17 12.4477 17 13V19C17 19.2652 16.8946 19.5196 16.7071 19.7071C16.5196 19.8946 16.2652 20 16 20H5C4.73478 20 4.48043 19.8946 4.29289 19.7071C4.10536 19.5196 4 19.2652 4 19V8C4 7.73478 4.10536 7.48043 4.29289 7.29289Z`,fill:`currentColor`})]}));LL.displayName=`ExternalLinkIcon`;var RL=(0,J.memo)(({className:e,...t})=>(0,Y.jsxs)(`svg`,{width:`24`,height:`24`,className:e,viewBox:`0 0 24 24`,fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`,...t,children:[(0,Y.jsx)(`path`,{d:`M16.9958 1.06669C15.4226 1.05302 13.907 1.65779 12.7753 2.75074L12.765 2.76086L11.045 4.47086C10.6534 4.86024 10.6515 5.49341 11.0409 5.88507C11.4303 6.27673 12.0634 6.27858 12.4551 5.88919L14.1697 4.18456C14.9236 3.45893 15.9319 3.05752 16.9784 3.06662C18.0272 3.07573 19.0304 3.49641 19.772 4.23804C20.5137 4.97967 20.9344 5.98292 20.9435 7.03171C20.9526 8.07776 20.5515 9.08563 19.8265 9.83941L16.833 12.8329C16.4274 13.2386 15.9393 13.5524 15.4019 13.7529C14.8645 13.9533 14.2903 14.0359 13.7181 13.9949C13.146 13.9539 12.5894 13.7904 12.0861 13.5154C11.5827 13.2404 11.1444 12.8604 10.8008 12.401C10.47 11.9588 9.84333 11.8685 9.40108 12.1993C8.95883 12.5301 8.86849 13.1568 9.1993 13.599C9.71464 14.288 10.3721 14.858 11.1272 15.2705C11.8822 15.683 12.7171 15.9283 13.5753 15.9898C14.4334 16.0513 15.2948 15.9274 16.1009 15.6267C16.907 15.326 17.639 14.8555 18.2473 14.247L21.2472 11.2471L21.2593 11.2347C22.3523 10.1031 22.9571 8.58751 22.9434 7.01433C22.9297 5.44115 22.2987 3.93628 21.1863 2.82383C20.0738 1.71138 18.5689 1.08036 16.9958 1.06669Z`,fill:`currentColor`}),(0,Y.jsx)(`path`,{d:`M10.4247 8.0102C9.56657 7.94874 8.70522 8.07256 7.89911 8.37326C7.09305 8.67395 6.36096 9.14458 5.75272 9.753L2.75285 12.7529L2.74067 12.7653C1.64772 13.8969 1.04295 15.4125 1.05662 16.9857C1.07029 18.5589 1.70131 20.0637 2.81376 21.1762C3.9262 22.2886 5.43108 22.9196 7.00426 22.9333C8.57744 22.947 10.0931 22.3422 11.2247 21.2493L11.2371 21.2371L12.9471 19.5271C13.3376 19.1366 13.3376 18.5034 12.9471 18.1129C12.5565 17.7223 11.9234 17.7223 11.5328 18.1129L9.82932 19.8164C9.07555 20.5414 8.06768 20.9425 7.02164 20.9334C5.97285 20.9243 4.9696 20.5036 4.22797 19.762C3.48634 19.0203 3.06566 18.0171 3.05655 16.9683C3.04746 15.9222 3.44851 14.9144 4.17355 14.1606L7.16719 11.167C7.5727 10.7613 8.06071 10.4476 8.59811 10.2471C9.13552 10.0467 9.70976 9.96412 10.2819 10.0051C10.854 10.0461 11.4106 10.2096 11.9139 10.4846C12.4173 10.7596 12.8556 11.1397 13.1992 11.599C13.53 12.0412 14.1567 12.1316 14.5989 11.8007C15.0412 11.4699 15.1315 10.8433 14.8007 10.401C14.2854 9.71205 13.6279 9.14198 12.8729 8.72948C12.1178 8.31697 11.2829 8.07166 10.4247 8.0102Z`,fill:`currentColor`})]}));RL.displayName=`LinkIcon`;var zL=(0,J.memo)(({className:e,...t})=>(0,Y.jsx)(`svg`,{width:`24`,height:`24`,className:e,viewBox:`0 0 24 24`,fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`,...t,children:(0,Y.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M7 5V4C7 3.17477 7.40255 2.43324 7.91789 1.91789C8.43324 1.40255 9.17477 1 10 1H14C14.8252 1 15.5668 1.40255 16.0821 1.91789C16.5975 2.43324 17 3.17477 17 4V5H21C21.5523 5 22 5.44772 22 6C22 6.55228 21.5523 7 21 7H20V20C20 20.8252 19.5975 21.5668 19.0821 22.0821C18.5668 22.5975 17.8252 23 17 23H7C6.17477 23 5.43324 22.5975 4.91789 22.0821C4.40255 21.5668 4 20.8252 4 20V7H3C2.44772 7 2 6.55228 2 6C2 5.44772 2.44772 5 3 5H7ZM9 4C9 3.82523 9.09745 3.56676 9.33211 3.33211C9.56676 3.09745 9.82523 3 10 3H14C14.1748 3 14.4332 3.09745 14.6679 3.33211C14.9025 3.56676 15 3.82523 15 4V5H9V4ZM6 7V20C6 20.1748 6.09745 20.4332 6.33211 20.6679C6.56676 20.9025 6.82523 21 7 21H17C17.1748 21 17.4332 20.9025 17.6679 20.6679C17.9025 20.4332 18 20.1748 18 20V7H6Z`,fill:`currentColor`})}));zL.displayName=`TrashIcon`;var BL=(0,J.forwardRef)(({className:e,children:t,...n},r)=>(0,Y.jsx)(Q,{type:`button`,className:e,variant:`ghost`,role:`button`,tabIndex:-1,"aria-label":`Link`,tooltip:`Link`,ref:r,...n,children:t||(0,Y.jsx)(RL,{className:`planet-button-icon`})}));BL.displayName=`LinkButton`;var VL=({url:e,setUrl:t,setLink:n,removeLink:r,openLink:i,isActive:a})=>{let o=PF(),s=e=>{e.key===`Enter`&&(e.preventDefault(),n())};return(0,Y.jsx)(fL,{style:{...o?{boxShadow:`none`,border:0}:{}},children:(0,Y.jsx)(mL,{style:{...o?{padding:0}:{}},children:(0,Y.jsxs)(hL,{orientation:`horizontal`,children:[(0,Y.jsx)(HF,{type:`url`,placeholder:`Paste a link...`,value:e,onChange:e=>t(e.target.value),onKeyDown:s,autoFocus:!0,autoComplete:`off`,autoCorrect:`off`,autoCapitalize:`off`,className:`planet-link-input`}),(0,Y.jsx)(ML,{children:(0,Y.jsx)(Q,{type:`button`,onClick:n,title:`Apply link`,disabled:!e&&!a,variant:`ghost`,children:(0,Y.jsx)(IL,{className:`planet-button-icon`})})}),(0,Y.jsx)(rO,{}),(0,Y.jsxs)(ML,{children:[(0,Y.jsx)(ML,{children:(0,Y.jsx)(Q,{type:`button`,onClick:i,title:`Open in new window`,disabled:!e&&!a,variant:`ghost`,children:(0,Y.jsx)(LL,{className:`planet-button-icon`})})}),(0,Y.jsx)(ML,{children:(0,Y.jsx)(Q,{type:`button`,onClick:r,title:`Remove link`,disabled:!e&&!a,variant:`ghost`,children:(0,Y.jsx)(zL,{className:`planet-button-icon`})})})]})]})})})},HL=({editor:e})=>(0,Y.jsx)(VL,{...YL({editor:e})}),UL=(0,J.forwardRef)(({editor:e,hideWhenUnavailable:t=!1,onSetLink:n,onOpenChange:r,autoOpenOnLinkActive:i=!0,onClick:a,children:o,...s},c)=>{let{editor:l}=kO(e),[u,d]=(0,J.useState)(!1),{isVisible:f,canSet:p,isActive:m,url:h,setUrl:g,setLink:_,removeLink:v,openLink:y,label:b,Icon:x}=YL({editor:l,hideWhenUnavailable:t,onSetLink:n}),S=(0,J.useCallback)(e=>{d(e),r?.(e)},[r]),C=(0,J.useCallback)(()=>{_(),d(!1)},[_]),w=(0,J.useCallback)(e=>{a?.(e),!e.defaultPrevented&&d(!u)},[a,u]);return(0,J.useEffect)(()=>{i&&m&&d(!0)},[i,m]),f?(0,Y.jsxs)(lL,{open:u,onOpenChange:S,children:[(0,Y.jsx)(uL,{asChild:!0,children:(0,Y.jsx)(BL,{disabled:!p,"data-active-state":m?`on`:`off`,"data-disabled":!p,"aria-label":b,"aria-pressed":m,onClick:w,...s,ref:c,children:o??(0,Y.jsx)(x,{className:`planet-button-icon`})})}),(0,Y.jsx)(dL,{collisionPadding:4,children:(0,Y.jsx)(VL,{url:h,setUrl:g,setLink:C,removeLink:v,openLink:y,isActive:m})})]}):null});UL.displayName=`LinkPopover`;function WL(e){if(!e||!e.isEditable||JD(e,[`image`],!0))return!1;try{return e.can().setMark(`link`)}catch{return!1}}function GL(e){return!e||!e.isEditable?!1:e.isActive(`link`)}function KL(e){let{editor:t,hideWhenUnavailable:n}=e;if(!t||!t.isEditable)return!1;let r=VD(`link`,t);return n?r?t.isActive(`code`)?!0:WL(t):!1:!0}function qL(e){let{editor:t,onSetLink:n}=e,[r,i]=(0,J.useState)(null);(0,J.useEffect)(()=>{if(!t)return;let{href:e}=t.getAttributes(`link`);GL(t)&&r===null&&i(e||``)},[t,r]),(0,J.useEffect)(()=>{if(!t)return;let e=()=>{let{href:e}=t.getAttributes(`link`);i(e||``)};return t.on(`selectionUpdate`,e),()=>{t.off(`selectionUpdate`,e)}},[t]);let a=(0,J.useCallback)(()=>{if(!r||!t)return;let{selection:e}=t.state,a=e.empty,o=t.chain().focus();o=o.extendMarkRange(`link`).setLink({href:r}),a&&(o=o.insertContent({type:`text`,text:r})),o.run(),i(null),n?.()},[t,n,r]),o=(0,J.useCallback)(()=>{t&&(t.chain().focus().extendMarkRange(`link`).unsetLink().setMeta(`preventAutolink`,!0).run(),i(``))},[t]),s=(0,J.useCallback)((e=`_blank`,t=`noopener,noreferrer`)=>{if(!r)return;let n=$D(r,window.location.href);n!==`#`&&window.open(n,e,t)},[r]);return{url:r||``,setUrl:i,setLink:a,removeLink:o,openLink:s}}function JL(e){let{editor:t,hideWhenUnavailable:n=!1}=e,r=WL(t),i=GL(t),[a,o]=(0,J.useState)(!0);return(0,J.useEffect)(()=>{if(!t)return;let e=()=>{o(KL({editor:t,hideWhenUnavailable:n}))};return e(),t.on(`selectionUpdate`,e),()=>{t.off(`selectionUpdate`,e)}},[t,n]),{isVisible:a,canSet:r,isActive:i}}function YL(e){let{editor:t,hideWhenUnavailable:n=!1,onSetLink:r}=e||{},{editor:i}=kO(t),{isVisible:a,canSet:o,isActive:s}=JL({editor:i,hideWhenUnavailable:n});return{isVisible:a,canSet:o,isActive:s,label:`Link`,Icon:RL,...qL({editor:i,onSetLink:r})}}function XL({type:e,shortcutKeys:t=oR[e]}){return(0,Y.jsx)(AO,{children:BD({shortcutKeys:t})})}var ZL=(0,J.forwardRef)(({editor:e,type:t,text:n,hideWhenUnavailable:r=!1,onToggled:i,showShortcut:a=!1,onClick:o,children:s,...c},l)=>{let{editor:u}=kO(e),{isVisible:d,handleMark:f,label:p,canToggle:m,isActive:h,Icon:g,shortcutKeys:_}=fR({editor:u,type:t,hideWhenUnavailable:r,onToggled:i}),v=(0,J.useCallback)(e=>{o?.(e),!e.defaultPrevented&&f()},[f,o]);return d?(0,Y.jsx)(Q,{type:`button`,disabled:!m,variant:`ghost`,"data-active-state":h?`on`:`off`,"data-disabled":!m,role:`button`,tabIndex:-1,"aria-label":p,"aria-pressed":h,tooltip:p,onClick:v,...c,ref:l,children:s??(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(g,{className:`planet-button-icon`}),n&&(0,Y.jsx)(`span`,{className:`planet-button-text`,children:n}),a&&(0,Y.jsx)(XL,{type:t,shortcutKeys:_})]})}):null});ZL.displayName=`MarkButton`;var QL=(0,J.memo)(({className:e,...t})=>(0,Y.jsx)(`svg`,{width:`24`,height:`24`,className:e,viewBox:`0 0 24 24`,fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`,...t,children:(0,Y.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M6 2.5C5.17157 2.5 4.5 3.17157 4.5 4V20C4.5 20.8284 5.17157 21.5 6 21.5H15C16.4587 21.5 17.8576 20.9205 18.8891 19.8891C19.9205 18.8576 20.5 17.4587 20.5 16C20.5 14.5413 19.9205 13.1424 18.8891 12.1109C18.6781 11.9 18.4518 11.7079 18.2128 11.5359C19.041 10.5492 19.5 9.29829 19.5 8C19.5 6.54131 18.9205 5.14236 17.8891 4.11091C16.8576 3.07946 15.4587 2.5 14 2.5H6ZM14 10.5C14.663 10.5 15.2989 10.2366 15.7678 9.76777C16.2366 9.29893 16.5 8.66304 16.5 8C16.5 7.33696 16.2366 6.70107 15.7678 6.23223C15.2989 5.76339 14.663 5.5 14 5.5H7.5V10.5H14ZM7.5 18.5V13.5H15C15.663 13.5 16.2989 13.7634 16.7678 14.2322C17.2366 14.7011 17.5 15.337 17.5 16C17.5 16.663 17.2366 17.2989 16.7678 17.7678C16.2989 18.2366 15.663 18.5 15 18.5H7.5Z`,fill:`currentColor`})}));QL.displayName=`BoldIcon`;var $L=(0,J.memo)(({className:e,...t})=>(0,Y.jsxs)(`svg`,{width:`24`,height:`24`,className:e,viewBox:`0 0 24 24`,fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`,...t,children:[(0,Y.jsx)(`path`,{d:`M15.4545 4.2983C15.6192 3.77115 15.3254 3.21028 14.7983 3.04554C14.2712 2.88081 13.7103 3.1746 13.5455 3.70175L8.54554 19.7017C8.38081 20.2289 8.6746 20.7898 9.20175 20.9545C9.72889 21.1192 10.2898 20.8254 10.4545 20.2983L15.4545 4.2983Z`,fill:`currentColor`}),(0,Y.jsx)(`path`,{d:`M6.70711 7.29289C7.09763 7.68342 7.09763 8.31658 6.70711 8.70711L3.41421 12L6.70711 15.2929C7.09763 15.6834 7.09763 16.3166 6.70711 16.7071C6.31658 17.0976 5.68342 17.0976 5.29289 16.7071L1.29289 12.7071C0.902369 12.3166 0.902369 11.6834 1.29289 11.2929L5.29289 7.29289C5.68342 6.90237 6.31658 6.90237 6.70711 7.29289Z`,fill:`currentColor`}),(0,Y.jsx)(`path`,{d:`M17.2929 7.29289C17.6834 6.90237 18.3166 6.90237 18.7071 7.29289L22.7071 11.2929C23.0976 11.6834 23.0976 12.3166 22.7071 12.7071L18.7071 16.7071C18.3166 17.0976 17.6834 17.0976 17.2929 16.7071C16.9024 16.3166 16.9024 15.6834 17.2929 15.2929L20.5858 12L17.2929 8.70711C16.9024 8.31658 16.9024 7.68342 17.2929 7.29289Z`,fill:`currentColor`})]}));$L.displayName=`Code2Icon`;var eR=(0,J.memo)(({className:e,...t})=>(0,Y.jsx)(`svg`,{width:`24`,height:`24`,className:e,viewBox:`0 0 24 24`,fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`,...t,children:(0,Y.jsx)(`path`,{d:`M15.0222 3H19C19.5523 3 20 3.44772 20 4C20 4.55228 19.5523 5 19 5H15.693L10.443 19H14C14.5523 19 15 19.4477 15 20C15 20.5523 14.5523 21 14 21H9.02418C9.00802 21.0004 8.99181 21.0004 8.97557 21H5C4.44772 21 4 20.5523 4 20C4 19.4477 4.44772 19 5 19H8.30704L13.557 5H10C9.44772 5 9 4.55228 9 4C9 3.44772 9.44772 3 10 3H14.9782C14.9928 2.99968 15.0075 2.99967 15.0222 3Z`,fill:`currentColor`})}));eR.displayName=`ItalicIcon`;var tR=(0,J.memo)(({className:e,...t})=>(0,Y.jsxs)(`svg`,{width:`24`,height:`24`,className:e,viewBox:`0 0 24 24`,fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`,...t,children:[(0,Y.jsx)(`path`,{d:`M9.00039 3H16.0001C16.5524 3 17.0001 3.44772 17.0001 4C17.0001 4.55229 16.5524 5 16.0001 5H9.00011C8.68006 4.99983 8.36412 5.07648 8.07983 5.22349C7.79555 5.37051 7.55069 5.5836 7.36585 5.84487C7.181 6.10614 7.06155 6.40796 7.01754 6.72497C6.97352 7.04198 7.00623 7.36492 7.11292 7.66667C7.29701 8.18737 7.02414 8.75872 6.50344 8.94281C5.98274 9.1269 5.4114 8.85403 5.2273 8.33333C5.01393 7.72984 4.94851 7.08396 5.03654 6.44994C5.12456 5.81592 5.36346 5.21229 5.73316 4.68974C6.10285 4.1672 6.59256 3.74101 7.16113 3.44698C7.72955 3.15303 8.36047 2.99975 9.00039 3Z`,fill:`currentColor`}),(0,Y.jsx)(`path`,{d:`M18 13H20C20.5523 13 21 12.5523 21 12C21 11.4477 20.5523 11 20 11H4C3.44772 11 3 11.4477 3 12C3 12.5523 3.44772 13 4 13H14C14.7956 13 15.5587 13.3161 16.1213 13.8787C16.6839 14.4413 17 15.2044 17 16C17 16.7956 16.6839 17.5587 16.1213 18.1213C15.5587 18.6839 14.7956 19 14 19H6C5.44772 19 5 19.4477 5 20C5 20.5523 5.44772 21 6 21H14C15.3261 21 16.5979 20.4732 17.5355 19.5355C18.4732 18.5979 19 17.3261 19 16C19 14.9119 18.6453 13.8604 18 13Z`,fill:`currentColor`})]}));tR.displayName=`StrikeIcon`;var nR=(0,J.memo)(({className:e,...t})=>(0,Y.jsxs)(`svg`,{width:`24`,height:`24`,className:e,viewBox:`0 0 24 24`,fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`,...t,children:[(0,Y.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M3.29289 7.29289C3.68342 6.90237 4.31658 6.90237 4.70711 7.29289L12.7071 15.2929C13.0976 15.6834 13.0976 16.3166 12.7071 16.7071C12.3166 17.0976 11.6834 17.0976 11.2929 16.7071L3.29289 8.70711C2.90237 8.31658 2.90237 7.68342 3.29289 7.29289Z`,fill:`currentColor`}),(0,Y.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M12.7071 7.29289C13.0976 7.68342 13.0976 8.31658 12.7071 8.70711L4.70711 16.7071C4.31658 17.0976 3.68342 17.0976 3.29289 16.7071C2.90237 16.3166 2.90237 15.6834 3.29289 15.2929L11.2929 7.29289C11.6834 6.90237 12.3166 6.90237 12.7071 7.29289Z`,fill:`currentColor`}),(0,Y.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M17.4079 14.3995C18.0284 14.0487 18.7506 13.9217 19.4536 14.0397C20.1566 14.1578 20.7977 14.5138 21.2696 15.0481L21.2779 15.0574L21.2778 15.0575C21.7439 15.5988 22 16.2903 22 17C22 18.0823 21.3962 18.8401 20.7744 19.3404C20.194 19.8073 19.4858 20.141 18.9828 20.378C18.9638 20.387 18.9451 20.3958 18.9266 20.4045C18.4473 20.6306 18.2804 20.7817 18.1922 20.918C18.1773 20.9412 18.1619 20.9681 18.1467 21H21C21.5523 21 22 21.4477 22 22C22 22.5523 21.5523 23 21 23H17C16.4477 23 16 22.5523 16 22C16 21.1708 16.1176 20.4431 16.5128 19.832C16.9096 19.2184 17.4928 18.8695 18.0734 18.5956C18.6279 18.334 19.138 18.0901 19.5207 17.7821C19.8838 17.49 20 17.2477 20 17C20 16.7718 19.9176 16.5452 19.7663 16.3672C19.5983 16.1792 19.3712 16.0539 19.1224 16.0121C18.8722 15.9701 18.6152 16.015 18.3942 16.1394C18.1794 16.2628 18.0205 16.4549 17.9422 16.675C17.7572 17.1954 17.1854 17.4673 16.665 17.2822C16.1446 17.0972 15.8728 16.5254 16.0578 16.005C16.2993 15.3259 16.7797 14.7584 17.4039 14.4018L17.4079 14.3995L17.4079 14.3995Z`,fill:`currentColor`})]}));nR.displayName=`SubscriptIcon`;var rR=(0,J.memo)(({className:e,...t})=>(0,Y.jsxs)(`svg`,{width:`24`,height:`24`,className:e,viewBox:`0 0 24 24`,fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`,...t,children:[(0,Y.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M12.7071 7.29289C13.0976 7.68342 13.0976 8.31658 12.7071 8.70711L4.70711 16.7071C4.31658 17.0976 3.68342 17.0976 3.29289 16.7071C2.90237 16.3166 2.90237 15.6834 3.29289 15.2929L11.2929 7.29289C11.6834 6.90237 12.3166 6.90237 12.7071 7.29289Z`,fill:`currentColor`}),(0,Y.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M3.29289 7.29289C3.68342 6.90237 4.31658 6.90237 4.70711 7.29289L12.7071 15.2929C13.0976 15.6834 13.0976 16.3166 12.7071 16.7071C12.3166 17.0976 11.6834 17.0976 11.2929 16.7071L3.29289 8.70711C2.90237 8.31658 2.90237 7.68342 3.29289 7.29289Z`,fill:`currentColor`}),(0,Y.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M17.405 1.40657C18.0246 1.05456 18.7463 0.92634 19.4492 1.04344C20.1521 1.16054 20.7933 1.51583 21.2652 2.0497L21.2697 2.05469L21.2696 2.05471C21.7431 2.5975 22 3.28922 22 4.00203C22 5.08579 21.3952 5.84326 20.7727 6.34289C20.1966 6.80531 19.4941 7.13675 18.9941 7.37261C18.9714 7.38332 18.9491 7.39383 18.9273 7.40415C18.4487 7.63034 18.2814 7.78152 18.1927 7.91844C18.1778 7.94155 18.1625 7.96834 18.1473 8.00003H21C21.5523 8.00003 22 8.44774 22 9.00003C22 9.55231 21.5523 10 21 10H17C16.4477 10 16 9.55231 16 9.00003C16 8.17007 16.1183 7.44255 16.5138 6.83161C16.9107 6.21854 17.4934 5.86971 18.0728 5.59591C18.6281 5.33347 19.1376 5.09075 19.5208 4.78316C19.8838 4.49179 20 4.25026 20 4.00203C20 3.77192 19.9178 3.54865 19.7646 3.37182C19.5968 3.18324 19.3696 3.05774 19.1205 3.01625C18.8705 2.97459 18.6137 3.02017 18.3933 3.14533C18.1762 3.26898 18.0191 3.45826 17.9406 3.67557C17.7531 4.19504 17.18 4.46414 16.6605 4.27662C16.141 4.0891 15.8719 3.51596 16.0594 2.99649C16.303 2.3219 16.7817 1.76125 17.4045 1.40689L17.405 1.40657Z`,fill:`currentColor`})]}));rR.displayName=`SuperscriptIcon`;var iR=(0,J.memo)(({className:e,...t})=>(0,Y.jsx)(`svg`,{width:`24`,height:`24`,className:e,viewBox:`0 0 24 24`,fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`,...t,children:(0,Y.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M7 4C7 3.44772 6.55228 3 6 3C5.44772 3 5 3.44772 5 4V10C5 11.8565 5.7375 13.637 7.05025 14.9497C8.36301 16.2625 10.1435 17 12 17C13.8565 17 15.637 16.2625 16.9497 14.9497C18.2625 13.637 19 11.8565 19 10V4C19 3.44772 18.5523 3 18 3C17.4477 3 17 3.44772 17 4V10C17 11.3261 16.4732 12.5979 15.5355 13.5355C14.5979 14.4732 13.3261 15 12 15C10.6739 15 9.40215 14.4732 8.46447 13.5355C7.52678 12.5979 7 11.3261 7 10V4ZM4 19C3.44772 19 3 19.4477 3 20C3 20.5523 3.44772 21 4 21H20C20.5523 21 21 20.5523 21 20C21 19.4477 20.5523 19 20 19H4Z`,fill:`currentColor`})}));iR.displayName=`UnderlineIcon`;var aR={bold:QL,italic:eR,underline:iR,strike:tR,code:$L,superscript:rR,subscript:nR},oR={bold:`mod+b`,italic:`mod+i`,underline:`mod+u`,strike:`mod+shift+s`,code:`mod+e`,superscript:`mod+.`,subscript:`mod+,`};function sR(e,t){return!e||!e.isEditable||!VD(t,e)||JD(e,[`image`])?!1:e.can().toggleMark(t)}function cR(e,t){return!e||!e.isEditable?!1:e.isActive(t)}function lR(e,t){return!e||!e.isEditable||!sR(e,t)?!1:e.chain().focus().toggleMark(t).run()}function uR(e){let{editor:t,type:n,hideWhenUnavailable:r}=e;return t?r?!t.isEditable||!VD(n,t)?!1:t.isActive(`code`)?!0:sR(t,n):!0:!1}function dR(e){return e.charAt(0).toUpperCase()+e.slice(1)}function fR(e){let{editor:t,type:n,hideWhenUnavailable:r=!1,onToggled:i}=e,{editor:a}=kO(t),[o,s]=(0,J.useState)(!0),c=sR(a,n),l=cR(a,n);return(0,J.useEffect)(()=>{if(!a)return;let e=()=>{s(uR({editor:a,type:n,hideWhenUnavailable:r}))};return e(),a.on(`selectionUpdate`,e),()=>{a.off(`selectionUpdate`,e)}},[a,n,r]),{isVisible:o,isActive:l,handleMark:(0,J.useCallback)(()=>{if(!a)return!1;let e=lR(a,n);return e&&i?.(),e},[a,n,i]),canToggle:c,label:dR(n),shortcutKeys:oR[n],Icon:aR[n]}}var pR=(0,J.memo)(({className:e,...t})=>(0,Y.jsxs)(`svg`,{width:`24`,height:`24`,className:e,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,...t,children:[(0,Y.jsx)(`path`,{d:`M4 4H20C20.5523 4 21 4.44772 21 5V19C21 19.5523 20.5523 20 20 20H4C3.44772 20 3 19.5523 3 19V5C3 4.44772 3.44772 4 4 4Z`,stroke:`currentColor`,strokeWidth:`2`,strokeLinejoin:`round`}),(0,Y.jsx)(`path`,{d:`M3 9.5H21`,stroke:`currentColor`,strokeWidth:`2`}),(0,Y.jsx)(`path`,{d:`M3 14.5H21`,stroke:`currentColor`,strokeWidth:`2`}),(0,Y.jsx)(`path`,{d:`M9 4V20`,stroke:`currentColor`,strokeWidth:`2`}),(0,Y.jsx)(`path`,{d:`M15 4V20`,stroke:`currentColor`,strokeWidth:`2`})]}));pR.displayName=`TableIcon`;var mR=[{label:`Add column before`,command:`addColumnBefore`},{label:`Add column after`,command:`addColumnAfter`},{label:`Delete column`,command:`deleteColumn`,destructive:!0}],hR=[{label:`Add row before`,command:`addRowBefore`},{label:`Add row after`,command:`addRowAfter`},{label:`Delete row`,command:`deleteRow`,destructive:!0}],gR=[{label:`Merge or split cells`,command:`mergeOrSplit`},{label:`Toggle header row`,command:`toggleHeaderRow`},{label:`Toggle header column`,command:`toggleHeaderColumn`}];function _R({editor:e}){let{editor:t}=kO(e),[n,r]=(0,J.useState)(!1),i=(0,J.useCallback)((e,n)=>{t&&t.chain().focus()[e]?.(n)?.run?.()},[t]),a=(0,J.useCallback)((e,n)=>t?!!t.can().chain().focus()[e]?.(n)?.run?.():!1,[t]);if(!t)return null;let o=t.isActive(`table`),s=e=>e.map(e=>{let t=a(e.command,e.args);return(0,Y.jsx)(XP,{asChild:!0,disabled:!t,children:(0,Y.jsx)(Q,{type:`button`,"data-style":`ghost`,disabled:!t,showTooltip:!1,onClick:()=>i(e.command,e.args),children:(0,Y.jsx)(`span`,{className:`planet-button-text`,style:e.destructive?{color:`var(--tt-color-text-red, #dc2626)`}:void 0,children:e.label})})},e.command)});return(0,Y.jsxs)(KP,{open:n,onOpenChange:r,children:[(0,Y.jsx)(qP,{asChild:!0,children:(0,Y.jsxs)(Q,{type:`button`,variant:`ghost`,"data-active-state":o?`on`:`off`,"aria-label":`Table options`,tooltip:`Table`,children:[(0,Y.jsx)(pR,{className:`planet-button-icon`}),(0,Y.jsx)(DO,{className:`planet-button-dropdown-small`})]})}),(0,Y.jsxs)(JP,{align:`start`,children:[(0,Y.jsx)(YP,{children:(0,Y.jsx)(XP,{asChild:!0,children:(0,Y.jsx)(Q,{type:`button`,"data-style":`ghost`,showTooltip:!1,onClick:()=>i(`insertTable`,{rows:3,cols:3,withHeaderRow:!0}),children:(0,Y.jsx)(`span`,{className:`planet-button-text`,children:`Insert table`})})})}),o&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(ZP,{}),(0,Y.jsx)(YP,{children:s(mR)}),(0,Y.jsx)(ZP,{}),(0,Y.jsx)(YP,{children:s(hR)}),(0,Y.jsx)(ZP,{}),(0,Y.jsx)(YP,{children:s(gR)}),(0,Y.jsx)(ZP,{}),(0,Y.jsx)(YP,{children:s([{label:`Delete table`,command:`deleteTable`,destructive:!0}])})]})]})]})}function vR({align:e,shortcutKeys:t=wR[e]}){return(0,Y.jsx)(AO,{children:BD({shortcutKeys:t})})}var yR=(0,J.forwardRef)(({editor:e,align:t,text:n,hideWhenUnavailable:r=!1,onAligned:i,showShortcut:a=!1,onClick:o,icon:s,children:c,...l},u)=>{let{editor:d}=kO(e),{isVisible:f,handleTextAlign:p,label:m,canAlign:h,isActive:g,Icon:_,shortcutKeys:v}=MR({editor:d,align:t,hideWhenUnavailable:r,onAligned:i}),y=(0,J.useCallback)(e=>{o?.(e),!e.defaultPrevented&&p()},[p,o]);if(!f)return null;let b=s??_;return(0,Y.jsx)(Q,{type:`button`,disabled:!h,variant:`ghost`,"data-active-state":g?`on`:`off`,"data-disabled":!h,role:`button`,tabIndex:-1,"aria-label":m,"aria-pressed":g,tooltip:m,onClick:y,...l,ref:u,children:c??(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(b,{className:`planet-button-icon`}),n&&(0,Y.jsx)(`span`,{className:`planet-button-text`,children:n}),a&&(0,Y.jsx)(vR,{align:t,shortcutKeys:v})]})})});yR.displayName=`TextAlignButton`;var bR=(0,J.memo)(({className:e,...t})=>(0,Y.jsxs)(`svg`,{width:`24`,height:`24`,className:e,viewBox:`0 0 24 24`,fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`,...t,children:[(0,Y.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M2 6C2 5.44772 2.44772 5 3 5H21C21.5523 5 22 5.44772 22 6C22 6.55228 21.5523 7 21 7H3C2.44772 7 2 6.55228 2 6Z`,fill:`currentColor`}),(0,Y.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M6 12C6 11.4477 6.44772 11 7 11H17C17.5523 11 18 11.4477 18 12C18 12.5523 17.5523 13 17 13H7C6.44772 13 6 12.5523 6 12Z`,fill:`currentColor`}),(0,Y.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M4 18C4 17.4477 4.44772 17 5 17H19C19.5523 17 20 17.4477 20 18C20 18.5523 19.5523 19 19 19H5C4.44772 19 4 18.5523 4 18Z`,fill:`currentColor`})]}));bR.displayName=`AlignCenterIcon`;var xR=(0,J.memo)(({className:e,...t})=>(0,Y.jsxs)(`svg`,{width:`24`,height:`24`,className:e,viewBox:`0 0 24 24`,fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`,...t,children:[(0,Y.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M2 6C2 5.44772 2.44772 5 3 5H21C21.5523 5 22 5.44772 22 6C22 6.55228 21.5523 7 21 7H3C2.44772 7 2 6.55228 2 6Z`,fill:`currentColor`}),(0,Y.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M2 12C2 11.4477 2.44772 11 3 11H21C21.5523 11 22 11.4477 22 12C22 12.5523 21.5523 13 21 13H3C2.44772 13 2 12.5523 2 12Z`,fill:`currentColor`}),(0,Y.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M2 18C2 17.4477 2.44772 17 3 17H21C21.5523 17 22 17.4477 22 18C22 18.5523 21.5523 19 21 19H3C2.44772 19 2 18.5523 2 18Z`,fill:`currentColor`})]}));xR.displayName=`AlignJustifyIcon`;var SR=(0,J.memo)(({className:e,...t})=>(0,Y.jsxs)(`svg`,{width:`24`,height:`24`,className:e,viewBox:`0 0 24 24`,fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`,...t,children:[(0,Y.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M2 6C2 5.44772 2.44772 5 3 5H21C21.5523 5 22 5.44772 22 6C22 6.55228 21.5523 7 21 7H3C2.44772 7 2 6.55228 2 6Z`,fill:`currentColor`}),(0,Y.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M2 12C2 11.4477 2.44772 11 3 11H15C15.5523 11 16 11.4477 16 12C16 12.5523 15.5523 13 15 13H3C2.44772 13 2 12.5523 2 12Z`,fill:`currentColor`}),(0,Y.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M2 18C2 17.4477 2.44772 17 3 17H17C17.5523 17 18 17.4477 18 18C18 18.5523 17.5523 19 17 19H3C2.44772 19 2 18.5523 2 18Z`,fill:`currentColor`})]}));SR.displayName=`AlignLeftIcon`;var CR=(0,J.memo)(({className:e,...t})=>(0,Y.jsxs)(`svg`,{width:`24`,height:`24`,className:e,viewBox:`0 0 24 24`,fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`,...t,children:[(0,Y.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M2 6C2 5.44772 2.44772 5 3 5H21C21.5523 5 22 5.44772 22 6C22 6.55228 21.5523 7 21 7H3C2.44772 7 2 6.55228 2 6Z`,fill:`currentColor`}),(0,Y.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M8 12C8 11.4477 8.44772 11 9 11H21C21.5523 11 22 11.4477 22 12C22 12.5523 21.5523 13 21 13H9C8.44772 13 8 12.5523 8 12Z`,fill:`currentColor`}),(0,Y.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M6 18C6 17.4477 6.44772 17 7 17H21C21.5523 17 22 17.4477 22 18C22 18.5523 21.5523 19 21 19H7C6.44772 19 6 18.5523 6 18Z`,fill:`currentColor`})]}));CR.displayName=`AlignRightIcon`;var wR={left:`mod+shift+l`,center:`mod+shift+e`,right:`mod+shift+r`,justify:`mod+shift+j`},TR={left:SR,center:bR,right:CR,justify:xR},ER={left:`Align left`,center:`Align center`,right:`Align right`,justify:`Align justify`};function DR(e,t){return!e||!e.isEditable||!GD(e,`textAlign`)||JD(e,[`image`,`horizontalRule`])?!1:e.can().setTextAlign(t)}function OR(e){return`setTextAlign`in e}function kR(e,t){return!e||!e.isEditable?!1:e.isActive({textAlign:t})}function AR(e,t){if(!e||!e.isEditable||!DR(e,t))return!1;let n=e.chain().focus();return OR(n)?n.setTextAlign(t).run():!1}function jR(e){let{editor:t,hideWhenUnavailable:n,align:r}=e;return t?n?!t.isEditable||!GD(t,`textAlign`)?!1:t.isActive(`code`)?!0:DR(t,r):!0:!1}function MR(e){let{editor:t,align:n,hideWhenUnavailable:r=!1,onAligned:i}=e,{editor:a}=kO(t),[o,s]=(0,J.useState)(!0),c=DR(a,n),l=kR(a,n);return(0,J.useEffect)(()=>{if(!a)return;let e=()=>{s(jR({editor:a,align:n,hideWhenUnavailable:r}))};return e(),a.on(`selectionUpdate`,e),()=>{a.off(`selectionUpdate`,e)}},[a,r,n]),{isVisible:o,isActive:l,handleTextAlign:(0,J.useCallback)(()=>{if(!a)return!1;let e=AR(a,n);return e&&i?.(),e},[a,n,i]),canAlign:c,label:ER[n],shortcutKeys:wR[n],Icon:TR[n]}}function NR({action:e,shortcutKeys:t=LR[e]}){return(0,Y.jsx)(AO,{children:BD({shortcutKeys:t})})}var PR=(0,J.forwardRef)(({editor:e,action:t,text:n,hideWhenUnavailable:r=!1,onExecuted:i,showShortcut:a=!1,onClick:o,children:s,...c},l)=>{let{editor:u}=kO(e),{isVisible:d,handleAction:f,label:p,canExecute:m,Icon:h,shortcutKeys:g}=UR({editor:u,action:t,hideWhenUnavailable:r,onExecuted:i}),_=(0,J.useCallback)(e=>{o?.(e),!e.defaultPrevented&&f()},[f,o]);return d?(0,Y.jsx)(Q,{type:`button`,disabled:!m,variant:`ghost`,"data-disabled":!m,role:`button`,tabIndex:-1,"aria-label":p,tooltip:p,onClick:_,...c,ref:l,children:s??(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(h,{className:`planet-button-icon`}),n&&(0,Y.jsx)(`span`,{className:`planet-button-text`,children:n}),a&&(0,Y.jsx)(NR,{action:t,shortcutKeys:g})]})}):null});PR.displayName=`UndoRedoButton`;var FR=(0,J.memo)(({className:e,...t})=>(0,Y.jsx)(`svg`,{width:`24`,height:`24`,className:e,viewBox:`0 0 24 24`,fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`,...t,children:(0,Y.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M15.7071 2.29289C15.3166 1.90237 14.6834 1.90237 14.2929 2.29289C13.9024 2.68342 13.9024 3.31658 14.2929 3.70711L17.5858 7H9.5C7.77609 7 6.12279 7.68482 4.90381 8.90381C3.68482 10.1228 3 11.7761 3 13.5C3 14.3536 3.16813 15.1988 3.49478 15.9874C3.82144 16.7761 4.30023 17.4926 4.90381 18.0962C6.12279 19.3152 7.77609 20 9.5 20H13C13.5523 20 14 19.5523 14 19C14 18.4477 13.5523 18 13 18H9.5C8.30653 18 7.16193 17.5259 6.31802 16.682C5.90016 16.2641 5.56869 15.768 5.34254 15.2221C5.1164 14.6761 5 14.0909 5 13.5C5 12.3065 5.47411 11.1619 6.31802 10.318C7.16193 9.47411 8.30653 9 9.5 9H17.5858L14.2929 12.2929C13.9024 12.6834 13.9024 13.3166 14.2929 13.7071C14.6834 14.0976 15.3166 14.0976 15.7071 13.7071L20.7071 8.70711C21.0976 8.31658 21.0976 7.68342 20.7071 7.29289L15.7071 2.29289Z`,fill:`currentColor`})}));FR.displayName=`Redo2Icon`;var IR=(0,J.memo)(({className:e,...t})=>(0,Y.jsx)(`svg`,{width:`24`,height:`24`,className:e,viewBox:`0 0 24 24`,fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`,...t,children:(0,Y.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M9.70711 3.70711C10.0976 3.31658 10.0976 2.68342 9.70711 2.29289C9.31658 1.90237 8.68342 1.90237 8.29289 2.29289L3.29289 7.29289C2.90237 7.68342 2.90237 8.31658 3.29289 8.70711L8.29289 13.7071C8.68342 14.0976 9.31658 14.0976 9.70711 13.7071C10.0976 13.3166 10.0976 12.6834 9.70711 12.2929L6.41421 9H14.5C15.0909 9 15.6761 9.1164 16.2221 9.34254C16.768 9.56869 17.2641 9.90016 17.682 10.318C18.0998 10.7359 18.4313 11.232 18.6575 11.7779C18.8836 12.3239 19 12.9091 19 13.5C19 14.0909 18.8836 14.6761 18.6575 15.2221C18.4313 15.768 18.0998 16.2641 17.682 16.682C17.2641 17.0998 16.768 17.4313 16.2221 17.6575C15.6761 17.8836 15.0909 18 14.5 18H11C10.4477 18 10 18.4477 10 19C10 19.5523 10.4477 20 11 20H14.5C15.3536 20 16.1988 19.8319 16.9874 19.5052C17.7761 19.1786 18.4926 18.6998 19.0962 18.0962C19.6998 17.4926 20.1786 16.7761 20.5052 15.9874C20.8319 15.1988 21 14.3536 21 13.5C21 12.6464 20.8319 11.8012 20.5052 11.0126C20.1786 10.2239 19.6998 9.50739 19.0962 8.90381C18.4926 8.30022 17.7761 7.82144 16.9874 7.49478C16.1988 7.16813 15.3536 7 14.5 7H6.41421L9.70711 3.70711Z`,fill:`currentColor`})}));IR.displayName=`Undo2Icon`;var LR={undo:`mod+z`,redo:`mod+shift+z`},RR={undo:`Undo`,redo:`Redo`},zR={undo:IR,redo:FR};function BR(e,t){return!e||!e.isEditable||JD(e,[`image`])?!1:t===`undo`?e.can().undo():e.can().redo()}function VR(e,t){if(!e||!e.isEditable||!BR(e,t))return!1;let n=e.chain().focus();return t===`undo`?n.undo().run():n.redo().run()}function HR(e){let{editor:t,hideWhenUnavailable:n,action:r}=e;return t?n?t.isEditable?t.isActive(`code`)?!0:BR(t,r):!1:!0:!1}function UR(e){let{editor:t,action:n,hideWhenUnavailable:r=!1,onExecuted:i}=e,{editor:a}=kO(t),[o,s]=(0,J.useState)(!0),c=BR(a,n);return(0,J.useEffect)(()=>{if(!a)return;let e=()=>{s(HR({editor:a,hideWhenUnavailable:r,action:n}))};return e(),a.on(`transaction`,e),()=>{a.off(`transaction`,e)}},[a,r,n]),{isVisible:o,handleAction:(0,J.useCallback)(()=>{if(!a)return!1;let e=VR(a,n);return e&&i?.(),e},[a,n,i]),canExecute:c,label:RR[n],shortcutKeys:LR[n],Icon:zR[n]}}var WR=(0,J.memo)(({className:e,...t})=>(0,Y.jsx)(`svg`,{width:`24`,height:`24`,className:e,viewBox:`0 0 24 24`,fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`,...t,children:(0,Y.jsx)(`path`,{d:`M12.7071 5.70711C13.0976 5.31658 13.0976 4.68342 12.7071 4.29289C12.3166 3.90237 11.6834 3.90237 11.2929 4.29289L4.29289 11.2929C3.90237 11.6834 3.90237 12.3166 4.29289 12.7071L11.2929 19.7071C11.6834 20.0976 12.3166 20.0976 12.7071 19.7071C13.0976 19.3166 13.0976 18.6834 12.7071 18.2929L7.41421 13L19 13C19.5523 13 20 12.5523 20 12C20 11.4477 19.5523 11 19 11L7.41421 11L12.7071 5.70711Z`,fill:`currentColor`})}));WR.displayName=`ArrowLeftIcon`;var GR=(0,J.memo)(({className:e,...t})=>(0,Y.jsxs)(`svg`,{width:`24`,height:`24`,className:e,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`,xmlns:`http://www.w3.org/2000/svg`,...t,children:[(0,Y.jsx)(`path`,{d:`M8 5V19`}),(0,Y.jsx)(`path`,{d:`M11 7H20`}),(0,Y.jsx)(`path`,{d:`M11 12H20`}),(0,Y.jsx)(`path`,{d:`M11 17H20`}),(0,Y.jsx)(`path`,{d:`M4 6.2V8.8`}),(0,Y.jsx)(`path`,{d:`M3.4 11.4H4.6V12.6H3.4V13.8H4.6`}),(0,Y.jsx)(`path`,{d:`M3.4 16.4H4.6V18.8H3.4`})]}));GR.displayName=`LineNumbersIcon`;var KR=(0,J.memo)(({className:e,...t})=>(0,Y.jsxs)(`svg`,{width:`24`,height:`24`,className:e,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,xmlns:`http://www.w3.org/2000/svg`,...t,children:[(0,Y.jsx)(`circle`,{cx:`11`,cy:`11`,r:`7`}),(0,Y.jsx)(`path`,{d:`M21 21l-4.35-4.35`})]}));KR.displayName=`SearchIcon`;var qR=o(((e,t)=>{var n=`Expected a function`,r=NaN,i=/^\s+|\s+$/g,a=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,s=/^0o[0-7]+$/i,c=parseInt,l=typeof global==`object`&&global&&global.Object===Object&&global,u=typeof self==`object`&&self&&self.Object===Object&&self,d=l||u||Function(`return this`)(),f=Object.prototype.toString,p=Math.max,m=Math.min,h=function(){return d.Date.now()};function g(e,t,r){var i,a,o,s,c,l,u=0,d=!1,f=!1,g=!0;if(typeof e!=`function`)throw TypeError(n);t=x(t)||0,v(r)&&(d=!!r.leading,f=`maxWait`in r,o=f?p(x(r.maxWait)||0,t):o,g=`trailing`in r?!!r.trailing:g);function _(t){var n=i,r=a;return i=a=void 0,u=t,s=e.apply(r,n),s}function y(e){return u=e,c=setTimeout(C,t),d?_(e):s}function b(e){var n=e-l,r=e-u,i=t-n;return f?m(i,o-r):i}function S(e){var n=e-l,r=e-u;return l===void 0||n>=t||n<0||f&&r>=o}function C(){var e=h();if(S(e))return w(e);c=setTimeout(C,b(e))}function w(e){return c=void 0,g&&i?_(e):(i=a=void 0,s)}function T(){c!==void 0&&clearTimeout(c),u=0,i=l=a=c=void 0}function E(){return c===void 0?s:w(h())}function ee(){var e=h(),n=S(e);if(i=arguments,a=this,l=e,n){if(c===void 0)return y(l);if(f)return c=setTimeout(C,t),_(l)}return c===void 0&&(c=setTimeout(C,t)),s}return ee.cancel=T,ee.flush=E,ee}function _(e,t,r){var i=!0,a=!0;if(typeof e!=`function`)throw TypeError(n);return v(r)&&(i=`leading`in r?!!r.leading:i,a=`trailing`in r?!!r.trailing:a),g(e,t,{leading:i,maxWait:t,trailing:a})}function v(e){var t=typeof e;return!!e&&(t==`object`||t==`function`)}function y(e){return!!e&&typeof e==`object`}function b(e){return typeof e==`symbol`||y(e)&&f.call(e)==`[object Symbol]`}function x(e){if(typeof e==`number`)return e;if(b(e))return r;if(v(e)){var t=typeof e.valueOf==`function`?e.valueOf():e;e=v(t)?t+``:t}if(typeof e!=`string`)return e===0?e:+e;e=e.replace(i,``);var n=o.test(e);return n||s.test(e)?c(e.slice(2),n?2:8):a.test(e)?r:+e}t.exports=_})),JR=e=>{let t=(0,J.useRef)(e);t.current=e,(0,J.useEffect)(()=>()=>{t.current()},[])},YR=c(qR(),1),XR={leading:!1,trailing:!0};function ZR(e,t=250,n=[],r=XR){let i=(0,J.useMemo)(()=>(0,YR.default)(e,t,r),n);return JR(()=>{i.cancel()}),i}function QR(){let[e,t]=(0,J.useState)({width:0,height:0,offsetTop:0,offsetLeft:0,scale:0}),n=ZR(()=>{if(typeof window>`u`)return;let e=window.visualViewport;if(!e)return;let{width:n=0,height:r=0,offsetTop:i=0,offsetLeft:a=0,scale:o=0}=e;t(e=>n===e.width&&r===e.height&&i===e.offsetTop&&a===e.offsetLeft&&o===e.scale?e:{width:n,height:r,offsetTop:i,offsetLeft:a,scale:o})},200);return(0,J.useEffect)(()=>{let e=window.visualViewport;if(e)return e.addEventListener(`resize`,n),n(),()=>{e.removeEventListener(`resize`,n)}},[n]),e}var $R={x:0,y:0,width:0,height:0,top:0,right:0,bottom:0,left:0},ez=typeof window>`u`,tz=!ez&&typeof ResizeObserver<`u`,nz=()=>!ez;function rz({element:e,enabled:t=!0,throttleMs:n=100,useResizeObserver:r=!0}={}){let[i,a]=(0,J.useState)($R),o=(0,J.useCallback)(()=>!t||!nz()?null:e?typeof e==`string`?document.querySelector(e):`current`in e?e.current:e:document.body,[e,t]),s=ZR(()=>{if(!t||!nz())return;let e=o();if(!e){a($R);return}let n=e.getBoundingClientRect();a({x:n.x,y:n.y,width:n.width,height:n.height,top:n.top,right:n.right,bottom:n.bottom,left:n.left})},n,[t,o],{leading:!0,trailing:!0});return(0,J.useEffect)(()=>{if(!t||!nz()){a($R);return}let e=o();if(!e)return;s();let n=[];if(r&&tz){let t=new ResizeObserver(()=>{window.requestAnimationFrame(s)});t.observe(e),n.push(()=>t.disconnect())}let i=()=>s();return window.addEventListener(`scroll`,i,!0),window.addEventListener(`resize`,i,!0),n.push(()=>{window.removeEventListener(`scroll`,i),window.removeEventListener(`resize`,i)}),()=>{n.forEach(e=>e()),a($R)}},[t,o,s,r]),i}function iz(e={}){return rz({...e,element:nz()?document.body:null})}function az({editor:e,overlayHeight:t=0}){let{height:n}=QR(),r=iz({enabled:!0,throttleMs:100,useResizeObserver:!0});return(0,J.useEffect)(()=>{(()=>{if(!e)return;let{state:i,view:a}=e;if(!a.hasFocus())return;let{from:o}=i.selection,s=a.coordsAtPos(o);if(n<r.height&&s&&n-s.top<t){let e=Math.max(n/2,t),r=window.scrollY,i=s.top+r-e;window.scrollTo({top:Math.max(0,i),behavior:`smooth`})}})()},[e,t,n,r.height]),r}function oz(e,t){let n=(0,J.useRef)(null),[r,i]=(0,J.useState)([]),[a,o]=(0,J.useState)(0);return(0,J.useEffect)(()=>{if(!t||!e){i([]);return}let r=e.view.dom,a=n.current;if(!a)return;let s=0,c=!1,l=()=>{let e=a.getBoundingClientRect(),t=r.getBoundingClientRect(),n=parseFloat(getComputedStyle(r).lineHeight),s=Number.isFinite(n)?n*.6:12,l=[],u=document.createRange(),d=document.createTreeWalker(r,NodeFilter.SHOW_TEXT),f;for(;f=d.nextNode();){if(!f.textContent||f.textContent.length===0)continue;u.selectNodeContents(f);let t=u.getClientRects();for(let n=0;n<t.length;n++){let r=t[n];r.height!==0&&l.push(r.top-e.top)}}Array.from(r.children).forEach(t=>{let n=t;if((n.textContent??``).trim().length>0)return;let r=n.getBoundingClientRect();r.height!==0&&l.push(r.top-e.top)}),l.sort((e,t)=>e-t);let p=[];for(let e of l)(p.length===0||e-p[p.length-1]>s)&&p.push(e);c||(o(t.left-e.left),i(p))},u=()=>{cancelAnimationFrame(s),s=requestAnimationFrame(l)};u(),e.on(`update`,u);let d=new ResizeObserver(u);return d.observe(r),window.addEventListener(`resize`,u),document.fonts?.ready.then(()=>!c&&u()),()=>{c=!0,cancelAnimationFrame(s),e.off(`update`,u),d.disconnect(),window.removeEventListener(`resize`,u)}},[e,t]),{wrapperRef:n,tops:r,left:a}}var sz=(0,J.memo)(({className:e,...t})=>(0,Y.jsxs)(`svg`,{width:`24`,height:`24`,className:e,viewBox:`0 0 24 24`,fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`,...t,children:[(0,Y.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M12 2C10.0222 2 8.08879 2.58649 6.4443 3.6853C4.79981 4.78412 3.51809 6.3459 2.76121 8.17317C2.00433 10.0004 1.8063 12.0111 2.19215 13.9509C2.578 15.8907 3.53041 17.6725 4.92894 19.0711C6.32746 20.4696 8.10929 21.422 10.0491 21.8079C11.9889 22.1937 13.9996 21.9957 15.8268 21.2388C17.6541 20.4819 19.2159 19.2002 20.3147 17.5557C21.4135 15.9112 22 13.9778 22 12C22 11.5955 21.7564 11.2309 21.3827 11.0761C21.009 10.9213 20.5789 11.0069 20.2929 11.2929C19.287 12.2988 17.9226 12.864 16.5 12.864C15.0774 12.864 13.713 12.2988 12.7071 11.2929C11.7012 10.287 11.136 8.92261 11.136 7.5C11.136 6.07739 11.7012 4.71304 12.7071 3.70711C12.9931 3.42111 13.0787 2.99099 12.9239 2.61732C12.7691 2.24364 12.4045 2 12 2ZM7.55544 5.34824C8.27036 4.87055 9.05353 4.51389 9.87357 4.28778C9.39271 5.27979 9.13604 6.37666 9.13604 7.5C9.13604 9.45304 9.91189 11.3261 11.2929 12.7071C12.6739 14.0881 14.547 14.864 16.5 14.864C17.6233 14.864 18.7202 14.6073 19.7122 14.1264C19.4861 14.9465 19.1295 15.7296 18.6518 16.4446C17.7727 17.7602 16.5233 18.7855 15.0615 19.391C13.5997 19.9965 11.9911 20.155 10.4393 19.8463C8.88743 19.5376 7.46197 18.7757 6.34315 17.6569C5.22433 16.538 4.4624 15.1126 4.15372 13.5607C3.84504 12.0089 4.00347 10.4003 4.60897 8.93853C5.21447 7.47672 6.23985 6.22729 7.55544 5.34824Z`,fill:`currentColor`}),(0,Y.jsx)(`path`,{d:`M19 2C19.5523 2 20 2.44772 20 3V4H21C21.5523 4 22 4.44772 22 5C22 5.55228 21.5523 6 21 6H20V7C20 7.55228 19.5523 8 19 8C18.4477 8 18 7.55228 18 7V6H17C16.4477 6 16 5.55228 16 5C16 4.44772 16.4477 4 17 4H18V3C18 2.44772 18.4477 2 19 2Z`,fill:`currentColor`})]}));sz.displayName=`MoonStarIcon`;var cz=(0,J.memo)(({className:e,...t})=>(0,Y.jsxs)(`svg`,{width:`24`,height:`24`,className:e,viewBox:`0 0 24 24`,fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`,...t,children:[(0,Y.jsx)(`path`,{d:`M12 1C12.5523 1 13 1.44772 13 2V4C13 4.55228 12.5523 5 12 5C11.4477 5 11 4.55228 11 4V2C11 1.44772 11.4477 1 12 1Z`,fill:`currentColor`}),(0,Y.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M7 12C7 9.23858 9.23858 7 12 7C14.7614 7 17 9.23858 17 12C17 14.7614 14.7614 17 12 17C9.23858 17 7 14.7614 7 12ZM12 9C10.3431 9 9 10.3431 9 12C9 13.6569 10.3431 15 12 15C13.6569 15 15 13.6569 15 12C15 10.3431 13.6569 9 12 9Z`,fill:`currentColor`}),(0,Y.jsx)(`path`,{d:`M13 20C13 19.4477 12.5523 19 12 19C11.4477 19 11 19.4477 11 20V22C11 22.5523 11.4477 23 12 23C12.5523 23 13 22.5523 13 22V20Z`,fill:`currentColor`}),(0,Y.jsx)(`path`,{d:`M4.22282 4.22289C4.61335 3.83236 5.24651 3.83236 5.63704 4.22289L7.04704 5.63289C7.43756 6.02341 7.43756 6.65658 7.04704 7.0471C6.65651 7.43762 6.02335 7.43762 5.63283 7.0471L4.22282 5.6371C3.8323 5.24658 3.8323 4.61341 4.22282 4.22289Z`,fill:`currentColor`}),(0,Y.jsx)(`path`,{d:`M18.367 16.9529C17.9765 16.5623 17.3433 16.5623 16.9528 16.9529C16.5623 17.3434 16.5623 17.9766 16.9528 18.3671L18.3628 19.7771C18.7533 20.1676 19.3865 20.1676 19.777 19.7771C20.1675 19.3866 20.1675 18.7534 19.777 18.3629L18.367 16.9529Z`,fill:`currentColor`}),(0,Y.jsx)(`path`,{d:`M1 12C1 11.4477 1.44772 11 2 11H4C4.55228 11 5 11.4477 5 12C5 12.5523 4.55228 13 4 13H2C1.44772 13 1 12.5523 1 12Z`,fill:`currentColor`}),(0,Y.jsx)(`path`,{d:`M20 11C19.4477 11 19 11.4477 19 12C19 12.5523 19.4477 13 20 13H22C22.5523 13 23 12.5523 23 12C23 11.4477 22.5523 11 22 11H20Z`,fill:`currentColor`}),(0,Y.jsx)(`path`,{d:`M7.04704 16.9529C7.43756 17.3434 7.43756 17.9766 7.04704 18.3671L5.63704 19.7771C5.24651 20.1676 4.61335 20.1676 4.22282 19.7771C3.8323 19.3866 3.8323 18.7534 4.22283 18.3629L5.63283 16.9529C6.02335 16.5623 6.65651 16.5623 7.04704 16.9529Z`,fill:`currentColor`}),(0,Y.jsx)(`path`,{d:`M19.777 5.6371C20.1675 5.24657 20.1675 4.61341 19.777 4.22289C19.3865 3.83236 18.7533 3.83236 18.3628 4.22289L16.9528 5.63289C16.5623 6.02341 16.5623 6.65658 16.9528 7.0471C17.3433 7.43762 17.9765 7.43762 18.367 7.0471L19.777 5.6371Z`,fill:`currentColor`})]}));cz.displayName=`SunIcon`;var lz=`planet-editor-theme`;function uz(){try{let e=localStorage.getItem(lz);return e===`dark`||e===`light`?e:null}catch{return null}}function dz(){let[e,t]=(0,J.useState)(!1);return(0,J.useEffect)(()=>{let e=uz();if(e){t(e===`dark`);return}t(!!document.querySelector(`meta[name="color-scheme"][content="dark"]`)||window.matchMedia(`(prefers-color-scheme: dark)`).matches)},[]),(0,J.useEffect)(()=>{let e=window.matchMedia(`(prefers-color-scheme: dark)`),n=()=>{uz()||t(e.matches)};return e.addEventListener(`change`,n),()=>e.removeEventListener(`change`,n)},[]),(0,J.useEffect)(()=>{document.documentElement.classList.toggle(`dark`,e)},[e]),(0,Y.jsx)(Q,{onClick:()=>t(e=>{let t=!e;try{localStorage.setItem(lz,t?`dark`:`light`)}catch{}return t}),"aria-label":`Switch to ${e?`light`:`dark`} mode`,variant:`ghost`,children:e?(0,Y.jsx)(sz,{className:`planet-button-icon`}):(0,Y.jsx)(cz,{className:`planet-button-icon`})})}function fz({editor:e,onClose:t}){let[n,r]=(0,J.useState)(``),[i,a]=(0,J.useState)(!1),[o,s]=(0,J.useState)({count:0,current:0}),c=(0,J.useRef)(null);(0,J.useEffect)(()=>{c.current?.focus(),c.current?.select()},[]),(0,J.useEffect)(()=>{let t=()=>{let t=SO.getState(e.state);s({count:t?.matches.length??0,current:t&&t.currentIndex>=0?t.currentIndex+1:0})};return t(),e.on(`transaction`,t),()=>{e.off(`transaction`,t)}},[e]),(0,J.useEffect)(()=>{e.commands.setSearchCaseSensitive(i),e.commands.setSearchTerm(n)},[e,n,i]),(0,J.useEffect)(()=>()=>{e.commands.clearSearch()},[e]),(0,J.useEffect)(()=>{e.view.dom.querySelector(`.planet-search-match--current`)?.scrollIntoView({block:`center`,behavior:`smooth`})},[e,o.current]);let l=()=>e.commands.nextSearchMatch(),u=()=>e.commands.previousSearchMatch();return(0,Y.jsxs)(`div`,{className:`planet-search-bar`,role:`search`,children:[(0,Y.jsx)(`input`,{ref:c,className:`planet-search-input`,type:`text`,placeholder:`Search…`,value:n,onChange:e=>r(e.target.value),onKeyDown:e=>{e.key===`Enter`?(e.preventDefault(),e.shiftKey?u():l()):e.key===`Escape`&&(e.preventDefault(),t())},"aria-label":`Search in document`}),(0,Y.jsx)(`span`,{className:`planet-search-count`,children:o.count>0?`${o.current}/${o.count}`:n?`0/0`:``}),(0,Y.jsx)(Q,{variant:`ghost`,"data-active-state":i?`on`:`off`,onClick:()=>a(e=>!e),"aria-pressed":i,"aria-label":`Match case`,title:`Match case`,children:(0,Y.jsx)(`span`,{className:`planet-search-case`,children:`Aa`})}),(0,Y.jsx)(Q,{variant:`ghost`,onClick:u,disabled:o.count===0,"aria-label":`Previous match`,title:`Previous (Shift+Enter)`,children:(0,Y.jsx)(DO,{className:`planet-button-icon`,style:{transform:`rotate(180deg)`}})}),(0,Y.jsx)(Q,{variant:`ghost`,onClick:l,disabled:o.count===0,"aria-label":`Next match`,title:`Next (Enter)`,children:(0,Y.jsx)(DO,{className:`planet-button-icon`})}),(0,Y.jsx)(Q,{variant:`ghost`,onClick:t,"aria-label":`Close search`,children:(0,Y.jsx)(dO,{className:`planet-button-icon`})})]})}var pz={type:`doc`,content:[{type:`heading`,attrs:{textAlign:null,level:1},content:[{type:`text`,text:`Getting started`}]},{type:`paragraph`,attrs:{textAlign:null},content:[{type:`text`,text:`Welcome to the `},{type:`text`,marks:[{type:`italic`},{type:`highlight`,attrs:{color:`var(--tt-color-highlight-yellow)`}}],text:`Simple Editor`},{type:`text`,text:` template! This template integrates `},{type:`text`,marks:[{type:`bold`}],text:`open source`},{type:`text`,text:` UI components and Planet extensions licensed under `},{type:`text`,marks:[{type:`bold`}],text:`MIT`},{type:`text`,text:`.`}]},{type:`paragraph`,attrs:{textAlign:null},content:[{type:`text`,text:`Integrate it by following the `},{type:`text`,marks:[{type:`link`,attrs:{href:`https://planet.dev/docs/ui-components/templates/simple-editor`,target:`_blank`,rel:`noopener noreferrer nofollow`,class:null}}],text:`Planet UI Components docs`},{type:`text`,text:` or using our CLI tool.`}]},{type:`codeBlock`,attrs:{language:null},content:[{type:`text`,text:`npm install planet-editor`}]},{type:`heading`,attrs:{textAlign:null,level:2},content:[{type:`text`,text:`Features`}]},{type:`blockquote`,content:[{type:`paragraph`,attrs:{textAlign:null},content:[{type:`text`,marks:[{type:`italic`}],text:`A fully responsive rich text editor with built-in support for common formatting and layout tools. Type markdown `},{type:`text`,marks:[{type:`code`}],text:`**`},{type:`text`,marks:[{type:`italic`}],text:` or use keyboard shortcuts `},{type:`text`,marks:[{type:`code`}],text:`⌘+B`},{type:`text`,text:` for `},{type:`text`,marks:[{type:`strike`}],text:`most`},{type:`text`,text:` all common markdown marks. 🪄`}]}]},{type:`paragraph`,attrs:{textAlign:`left`},content:[{type:`text`,text:`Add images, customize alignment, and apply `},{type:`text`,marks:[{type:`highlight`,attrs:{color:`var(--tt-color-highlight-blue)`}}],text:`advanced formatting`},{type:`text`,text:` to make your writing more engaging and professional.`}]},{type:`image`,attrs:{src:`data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI5MDAiIGhlaWdodD0iNDIwIiB2aWV3Qm94PSIwIDAgOTAwIDQyMCIgcm9sZT0iaW1nIiBhcmlhLWxhYmVsPSJQbGFjZWhvbGRlciBpbWFnZSI+CiAgPHJlY3Qgd2lkdGg9IjkwMCIgaGVpZ2h0PSI0MjAiIGZpbGw9IiNmNGY0ZjUiLz4KICA8cmVjdCB4PSIwLjUiIHk9IjAuNSIgd2lkdGg9Ijg5OSIgaGVpZ2h0PSI0MTkiIGZpbGw9Im5vbmUiIHN0cm9rZT0iI2U0ZTRlNyIvPgogIDxnIGZpbGw9Im5vbmUiIHN0cm9rZT0iI2M0YzRjYyIgc3Ryb2tlLXdpZHRoPSI0Ij4KICAgIDxyZWN0IHg9IjMzMCIgeT0iMTUwIiB3aWR0aD0iMjQwIiBoZWlnaHQ9IjE1MCIgcng9IjgiLz4KICAgIDxjaXJjbGUgY3g9IjM5MiIgY3k9IjIwMCIgcj0iMjAiLz4KICAgIDxwYXRoIGQ9Ik0zMzggMjkybDcwLTY0IDUwIDQ0IDYwLTU0IDc2IDc0Ii8+CiAgPC9nPgogIDx0ZXh0IHg9IjQ1MCIgeT0iMzQ2IiBmb250LWZhbWlseT0iSW50ZXIsIHN5c3RlbS11aSwgc2Fucy1zZXJpZiIgZm9udC1zaXplPSIyMiIgZmlsbD0iI2ExYTFhYSIgdGV4dC1hbmNob3I9Im1pZGRsZSI+UGxhY2Vob2xkZXIgaW1hZ2U8L3RleHQ+Cjwvc3ZnPgo=`,alt:`placeholder-image`,title:`placeholder-image`}},{type:`bulletList`,content:[{type:`listItem`,content:[{type:`paragraph`,attrs:{textAlign:`left`},content:[{type:`text`,marks:[{type:`bold`}],text:`Superscript`},{type:`text`,text:` (x`},{type:`text`,marks:[{type:`superscript`}],text:`2`},{type:`text`,text:`) and `},{type:`text`,marks:[{type:`bold`}],text:`Subscript`},{type:`text`,text:` (H`},{type:`text`,marks:[{type:`subscript`}],text:`2`},{type:`text`,text:`O) for precision.`}]}]},{type:`listItem`,content:[{type:`paragraph`,attrs:{textAlign:`left`},content:[{type:`text`,marks:[{type:`bold`}],text:`Typographic conversion`},{type:`text`,text:`: automatically convert to `},{type:`text`,marks:[{type:`code`}],text:`->`},{type:`text`,text:` an arrow `},{type:`text`,marks:[{type:`bold`}],text:`→`},{type:`text`,text:`.`}]}]}]},{type:`paragraph`,attrs:{textAlign:`left`},content:[{type:`text`,marks:[{type:`italic`}],text:`→ `},{type:`text`,marks:[{type:`link`,attrs:{href:`https://planet.dev/docs/ui-components/templates/simple-editor#features`,target:`_blank`,rel:`noopener noreferrer nofollow`,class:null}}],text:`Learn more`}]},{type:`horizontalRule`},{type:`heading`,attrs:{textAlign:`left`,level:2},content:[{type:`text`,text:`Make it your own`}]},{type:`paragraph`,attrs:{textAlign:`left`},content:[{type:`text`,text:`Switch between light and dark modes, and tailor the editor's appearance with customizable CSS to match your style.`}]},{type:`taskList`,content:[{type:`taskItem`,attrs:{checked:!0},content:[{type:`paragraph`,attrs:{textAlign:`left`},content:[{type:`text`,text:`Test template`}]}]},{type:`taskItem`,attrs:{checked:!1},content:[{type:`paragraph`,attrs:{textAlign:`left`},content:[{type:`text`,marks:[{type:`link`,attrs:{href:`https://planet.dev/docs/ui-components/templates/simple-editor`,target:`_blank`,rel:`noopener noreferrer nofollow`,class:null}}],text:`Integrate the free template`}]}]}]},{type:`paragraph`,attrs:{textAlign:`left`}}]},mz=({onHighlighterClick:e,onLinkClick:t,isMobile:n,lineNumbersActive:r,onToggleLineNumbers:i,onSearchClick:a})=>(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(nO,{}),(0,Y.jsxs)(lO,{children:[(0,Y.jsx)(PR,{action:`undo`}),(0,Y.jsx)(PR,{action:`redo`}),(0,Y.jsx)(Q,{variant:`ghost`,onClick:a,"aria-label":`Search`,title:`Search (⌘F)`,children:(0,Y.jsx)(KR,{className:`planet-button-icon`})})]}),(0,Y.jsx)(uO,{}),(0,Y.jsxs)(lO,{children:[(0,Y.jsx)(QP,{modal:!1,levels:[1,2,3,4]}),(0,Y.jsx)(KF,{}),(0,Y.jsx)(mI,{modal:!1,types:[`bulletList`,`orderedList`,`taskList`]}),(0,Y.jsx)(gI,{}),(0,Y.jsx)(wI,{})]}),(0,Y.jsx)(uO,{}),(0,Y.jsxs)(lO,{children:[(0,Y.jsx)(ZL,{type:`bold`}),(0,Y.jsx)(ZL,{type:`italic`}),(0,Y.jsx)(ZL,{type:`strike`}),(0,Y.jsx)(ZL,{type:`code`}),(0,Y.jsx)(ZL,{type:`underline`}),n?(0,Y.jsx)(NL,{onClick:e}):(0,Y.jsx)(FL,{}),n?(0,Y.jsx)(BL,{onClick:t}):(0,Y.jsx)(UL,{})]}),(0,Y.jsx)(uO,{}),(0,Y.jsxs)(lO,{children:[(0,Y.jsx)(ZL,{type:`superscript`}),(0,Y.jsx)(ZL,{type:`subscript`})]}),(0,Y.jsx)(uO,{}),(0,Y.jsxs)(lO,{children:[(0,Y.jsx)(yR,{align:`left`}),(0,Y.jsx)(yR,{align:`center`}),(0,Y.jsx)(yR,{align:`right`}),(0,Y.jsx)(yR,{align:`justify`})]}),(0,Y.jsx)(uO,{}),(0,Y.jsx)(lO,{children:(0,Y.jsx)(rF,{text:`Add`})}),(0,Y.jsx)(uO,{}),(0,Y.jsx)(lO,{children:(0,Y.jsx)(_R,{})}),(0,Y.jsx)(nO,{}),n&&(0,Y.jsx)(uO,{}),(0,Y.jsxs)(lO,{children:[(0,Y.jsx)(Q,{variant:`ghost`,"data-active-state":r?`on`:`off`,onClick:i,"aria-pressed":r,"aria-label":`Toggle line numbers`,title:`Line numbers`,children:(0,Y.jsx)(GR,{className:`planet-button-icon`})}),(0,Y.jsx)(dz,{})]})]}),hz=({type:e,onBack:t})=>(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(lO,{children:(0,Y.jsxs)(Q,{variant:`ghost`,onClick:t,children:[(0,Y.jsx)(WR,{className:`planet-button-icon`}),e===`highlighter`?(0,Y.jsx)(MI,{className:`planet-button-icon`}):(0,Y.jsx)(RL,{className:`planet-button-icon`})]})}),(0,Y.jsx)(uO,{}),e===`highlighter`?(0,Y.jsx)(PL,{}):(0,Y.jsx)(HL,{})]});function gz({content:e,editable:t=!0,onChange:n,uploadImage:r,lineNumbers:i=!1}){let a=PF(),{height:o}=QR(),[s,c]=(0,J.useState)(`main`),[l,u]=(0,J.useState)(i),[d,f]=(0,J.useState)(!1),p=(0,J.useRef)(null),m=Sp({immediatelyRender:!0,editable:t,onUpdate:({editor:e})=>n?.({html:e.getHTML(),json:e.getJSON()}),editorProps:{attributes:{autocomplete:`off`,autocorrect:`off`,autocapitalize:`off`,"aria-label":`Main content area, start typing to enter text.`,class:`simple-editor`}},extensions:[vb.configure({horizontalRule:!1,link:{openOnClick:!1,enableClickSelection:!0}}),xO,wb.configure({types:[`heading`,`paragraph`]}),ay,iy.configure({nested:!0}),Xb.configure({multicolor:!0}),iC.configure({table:{resizable:!0}}),cC,fC,Cb,qb,Qb,Zb,mb,bO.configure({accept:`image/*`,maxSize:FD,limit:3,upload:r??XD,onError:e=>console.error(`Upload failed:`,e)}),EO],content:e??pz}),h=az({editor:m,overlayHeight:p.current?.getBoundingClientRect().height??0});(0,J.useEffect)(()=>{!a&&s!==`main`&&c(`main`)},[a,s]),(0,J.useEffect)(()=>u(i),[i]);let{wrapperRef:g,tops:_,left:v}=oz(m,l);return m?(0,Y.jsxs)(`div`,{ref:g,className:`simple-editor-wrapper`,"data-line-numbers":l?`true`:void 0,onKeyDown:e=>{(e.metaKey||e.ctrlKey)&&e.key.toLowerCase()===`f`&&(e.preventDefault(),f(!0))},children:[d&&(0,Y.jsx)(fz,{editor:m,onClose:()=>f(!1)}),l&&(0,Y.jsx)(`div`,{className:`planet-line-gutter`,"aria-hidden":`true`,style:{left:v},children:_.map((e,t)=>(0,Y.jsx)(`span`,{className:`planet-line-number`,style:{top:e},children:String(t+1).padStart(5,`0`)},t))}),(0,Y.jsxs)(Cp.Provider,{value:{editor:m},children:[(0,Y.jsx)(cO,{ref:p,style:{...a?{bottom:`calc(100% - ${o-h.y}px)`}:{}},children:s===`main`?(0,Y.jsx)(mz,{onHighlighterClick:()=>c(`highlighter`),onLinkClick:()=>c(`link`),isMobile:a,lineNumbersActive:l,onToggleLineNumbers:()=>u(e=>!e),onSearchClick:()=>f(!0)}):(0,Y.jsx)(hz,{type:s===`highlighter`?`highlighter`:`link`,onBack:()=>c(`main`)})}),(0,Y.jsx)(mp,{editor:m,role:`presentation`,className:`simple-editor-content`})]})]}):(0,Y.jsx)(`div`,{className:`simple-editor-wrapper`})}function _z(e={}){let[t,n]=(0,J.useState)(!1);return(0,J.useEffect)(()=>n(!0),[]),t?(0,Y.jsx)(gz,{...e}):(0,Y.jsx)(`div`,{className:`simple-editor-wrapper`})}async function vz(e,t,n){if(!e)throw Error(`No file provided`);for(let e=0;e<=100;e+=25){if(n?.aborted)throw Error(`Upload cancelled`);await new Promise(e=>setTimeout(e,60)),t?.({progress:e})}return await new Promise((t,r)=>{let i=new FileReader;i.onload=()=>t(i.result),i.onerror=()=>r(Error(`Failed to read image file`)),n&&n.addEventListener(`abort`,()=>{i.abort(),r(Error(`Upload cancelled`))}),i.readAsDataURL(e)})}var yz=g(),bz=class extends HTMLElement{root;connectedCallback(){let e=document.createElement(`div`);this.appendChild(e),this.root=(0,yz.createRoot)(e),this.renderEditor()}disconnectedCallback(){this.root?.unmount(),this.root=void 0}static get observedAttributes(){return[`content`,`editable`,`line-numbers`]}attributeChangedCallback(){this.renderEditor()}renderEditor(){this.root&&this.root.render((0,J.createElement)(_z,{content:this.getAttribute(`content`)??``,editable:this.getAttribute(`editable`)!==`false`,lineNumbers:this.hasAttribute(`line-numbers`)?this.getAttribute(`line-numbers`)!==`false`:!1,uploadImage:vz,onChange:e=>this.dispatchEvent(new CustomEvent(`change`,{detail:e}))}))}};customElements.get(`planet-editor`)||customElements.define(`planet-editor`,bz)})();</script>
|
|
223
|
+
</body>
|
|
224
|
+
</html>
|