reactjs-tiptap-editor 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/{ActionMenuButton-DLQyd_gx.cjs → ActionMenuButton-BRWFTb3V.cjs} +1 -1
- package/lib/{ActionMenuButton-BKOg7hkq.js → ActionMenuButton-DgjFjzC8.js} +8 -8
- package/lib/Attachment.cjs +2 -2
- package/lib/Attachment.js +27 -29
- package/lib/Blockquote.cjs +1 -1
- package/lib/Blockquote.js +4 -4
- package/lib/Bold.cjs +1 -1
- package/lib/Bold.js +7 -7
- package/lib/BulletList.cjs +1 -1
- package/lib/BulletList.js +4 -4
- package/lib/Clear.cjs +1 -1
- package/lib/Clear.js +3 -3
- package/lib/Code.cjs +1 -1
- package/lib/Code.js +7 -7
- package/lib/CodeBlock.cjs +36 -36
- package/lib/CodeBlock.js +593 -596
- package/lib/CodeView.cjs +1 -1
- package/lib/CodeView.js +4 -4
- package/lib/Color.cjs +1 -1
- package/lib/Color.js +9 -9
- package/lib/Column.cjs +1 -1
- package/lib/Column.js +9 -9
- package/lib/Drawer-1_PmP-H0.cjs +1 -0
- package/lib/{Drawer-DZ5jvmrX.js → Drawer-DNnkwfnI.js} +48 -49
- package/lib/Drawer.cjs +1 -1
- package/lib/Drawer.js +5 -6
- package/lib/Emoji.cjs +1 -1
- package/lib/Emoji.js +155 -150
- package/lib/Excalidraw-DreGyrmJ.cjs +1 -0
- package/lib/Excalidraw-StBAUhjt.js +355 -0
- package/lib/Excalidraw.cjs +1 -1
- package/lib/Excalidraw.js +4 -5
- package/lib/ExportPdf.cjs +1 -1
- package/lib/ExportPdf.js +4 -4
- package/lib/ExportWord.cjs +1 -1
- package/lib/ExportWord.js +4 -4
- package/lib/FontFamily.cjs +1 -1
- package/lib/FontFamily.js +6 -6
- package/lib/FontSize.cjs +1 -1
- package/lib/FontSize.js +6 -6
- package/lib/Heading.cjs +1 -1
- package/lib/Heading.js +6 -6
- package/lib/Highlight.cjs +1 -1
- package/lib/Highlight.js +9 -9
- package/lib/History.cjs +1 -1
- package/lib/History.js +36 -36
- package/lib/HorizontalRule.cjs +1 -1
- package/lib/HorizontalRule.js +4 -4
- package/lib/{Icon-DUpv2cI6.cjs → Icon-B9hI3gal.cjs} +1 -1
- package/lib/{Icon-jKs8Hr6p.js → Icon-D3AdnMCj.js} +2 -2
- package/lib/Iframe-BDm-w-lg.cjs +1 -0
- package/lib/{Iframe-CmXkEqOd.js → Iframe-BIgQtyZo.js} +26 -28
- package/lib/Iframe.cjs +1 -1
- package/lib/Iframe.js +4 -5
- package/lib/Image.cjs +1 -1
- package/lib/Image.js +208 -229
- package/lib/ImageGif.cjs +1 -1
- package/lib/ImageGif.js +98 -91
- package/lib/ImportWord.cjs +28 -28
- package/lib/ImportWord.js +5 -5
- package/lib/Indent-BzyTbroV.cjs +1 -0
- package/lib/Indent-CnPAv7eT.js +153 -0
- package/lib/Indent.cjs +1 -1
- package/lib/Indent.js +4 -149
- package/lib/Italic.cjs +1 -1
- package/lib/Italic.js +4 -4
- package/lib/Katex-BE_GROI2.cjs +4 -0
- package/lib/{Katex-DsYXsjSS.js → Katex-D-SUWkkU.js} +771 -783
- package/lib/Katex.cjs +1 -1
- package/lib/Katex.js +4 -5
- package/lib/LineHeight.cjs +1 -1
- package/lib/LineHeight.js +17 -17
- package/lib/Link.cjs +1 -1
- package/lib/Link.js +2 -2
- package/lib/LinkEditBlock-5NRB9DRC.cjs +5 -0
- package/lib/{LinkEditBlock-CB8yIffE.js → LinkEditBlock-DcxIMK_D.js} +221 -221
- package/lib/Mention.cjs +1 -1
- package/lib/Mention.js +17 -19
- package/lib/Mermaid.cjs +2 -2
- package/lib/Mermaid.js +24 -26
- package/lib/MoreMark.cjs +1 -1
- package/lib/MoreMark.js +16 -16
- package/lib/OrderedList.cjs +1 -1
- package/lib/OrderedList.js +4 -4
- package/lib/SearchAndReplace.cjs +1 -1
- package/lib/SearchAndReplace.js +52 -52
- package/lib/SlashCommand.cjs +1 -1
- package/lib/SlashCommand.js +125 -120
- package/lib/Strike.cjs +1 -1
- package/lib/Strike.js +4 -4
- package/lib/Table-BYg26eMf.cjs +9 -0
- package/lib/{Table-Db8TcQX8.js → Table-DtC2-bqx.js} +30 -30
- package/lib/Table.cjs +1 -1
- package/lib/Table.js +1 -1
- package/lib/TaskList.cjs +1 -1
- package/lib/TaskList.js +4 -4
- package/lib/TextAlign.cjs +1 -1
- package/lib/TextAlign.js +14 -13
- package/lib/TextDirection.cjs +1 -1
- package/lib/TextDirection.js +7 -7
- package/lib/TextUnderline.cjs +1 -1
- package/lib/TextUnderline.js +4 -4
- package/lib/{Twitter-CXmmjz9R.js → Twitter-B3n8vc45.js} +73 -75
- package/lib/Twitter-DJ6JzZPJ.cjs +1 -0
- package/lib/Twitter.cjs +1 -1
- package/lib/Twitter.js +3 -4
- package/lib/Video.cjs +1 -1
- package/lib/Video.js +41 -33
- package/lib/bubble.cjs +4 -2
- package/lib/bubble.d.ts +1 -310
- package/lib/bubble.js +8782 -1104
- package/lib/button-BTnV4TZ7.cjs +1 -0
- package/lib/{button-DXMsXUEn.js → button-DHZeIKzF.js} +6 -6
- package/lib/checkbox-BoBTXwkF.cjs +1 -0
- package/lib/checkbox-Dm8Nfwg8.js +27 -0
- package/lib/components/ActionButton.d.ts +23 -0
- package/lib/components/ActionMenuButton.d.ts +28 -0
- package/lib/components/Bubble/RichTextBubbleColumns.d.ts +1 -0
- package/lib/components/Bubble/RichTextBubbleDrawer.d.ts +1 -0
- package/lib/components/Bubble/RichTextBubbleExcalidraw.d.ts +1 -0
- package/lib/components/Bubble/RichTextBubbleIframe.d.ts +1 -0
- package/lib/components/Bubble/RichTextBubbleKatex.d.ts +1 -0
- package/lib/components/Bubble/RichTextBubbleLink.d.ts +6 -0
- package/lib/components/Bubble/RichTextBubbleMedia.d.ts +4 -0
- package/lib/components/Bubble/RichTextBubbleMenuDragHandle.d.ts +1 -0
- package/lib/components/Bubble/RichTextBubbleMermaid.d.ts +1 -0
- package/lib/components/Bubble/RichTextBubbleTable.d.ts +5 -0
- package/lib/components/Bubble/RichTextBubbleText.d.ts +5 -0
- package/lib/components/Bubble/RichTextBubbleTwitter.d.ts +1 -0
- package/lib/components/Bubble/formatBubble.d.ts +55 -0
- package/lib/components/Bubble/index.d.ts +12 -0
- package/lib/components/ColorPicker.d.ts +11 -0
- package/lib/components/RichTextProvider.d.ts +8 -0
- package/lib/components/SizeSetter/SizeSetter.d.ts +13 -0
- package/lib/components/icons/Activity.d.ts +2 -0
- package/lib/components/icons/Animas.d.ts +2 -0
- package/lib/components/icons/AspectRatio.d.ts +2 -0
- package/lib/components/icons/Blockquote.d.ts +2 -0
- package/lib/components/icons/CodeView.d.ts +1 -0
- package/lib/components/icons/ColumnAddLeft.d.ts +1 -0
- package/lib/components/icons/ColumnAddRight.d.ts +1 -0
- package/lib/components/icons/DeleteColumn.d.ts +2 -0
- package/lib/components/icons/DeleteRow.d.ts +2 -0
- package/lib/components/icons/Direction.d.ts +1 -0
- package/lib/components/icons/Excalidraw.d.ts +1 -0
- package/lib/components/icons/ExportPdf.d.ts +1 -0
- package/lib/components/icons/ExportWord.d.ts +2 -0
- package/lib/components/icons/FileWordOutline.d.ts +2 -0
- package/lib/components/icons/Flag.d.ts +2 -0
- package/lib/components/icons/Food.d.ts +2 -0
- package/lib/components/icons/GIfIcon.d.ts +1 -0
- package/lib/components/icons/Html.d.ts +1 -0
- package/lib/components/icons/Icon.d.ts +8 -0
- package/lib/components/icons/IconColorFill.d.ts +5 -0
- package/lib/components/icons/IconHighlightFill.d.ts +3 -0
- package/lib/components/icons/ImportWord.d.ts +2 -0
- package/lib/components/icons/LeftToRight.d.ts +1 -0
- package/lib/components/icons/LineHeight.d.ts +2 -0
- package/lib/components/icons/MenuDown.d.ts +2 -0
- package/lib/components/icons/Mermaid.d.ts +1 -0
- package/lib/components/icons/NoFill.d.ts +1 -0
- package/lib/components/icons/Object.d.ts +2 -0
- package/lib/components/icons/RightToLeft.d.ts +1 -0
- package/lib/components/icons/SizeL.d.ts +2 -0
- package/lib/components/icons/SizeM.d.ts +2 -0
- package/lib/components/icons/SizeS.d.ts +2 -0
- package/lib/components/icons/Symbol.d.ts +2 -0
- package/lib/components/icons/Travel.d.ts +2 -0
- package/lib/components/icons/Twitter.d.ts +1 -0
- package/lib/components/icons/icons.d.ts +1 -0
- package/lib/components/icons/index.d.ts +12 -0
- package/lib/components/index.d.ts +6 -0
- package/lib/components/ui/button.d.ts +11 -0
- package/lib/components/ui/checkbox.d.ts +4 -0
- package/lib/components/ui/dialog.d.ts +19 -0
- package/lib/components/ui/dropdown-menu.d.ts +27 -0
- package/lib/components/ui/emoji-picker.d.ts +7 -0
- package/lib/components/ui/index.d.ts +14 -0
- package/lib/components/ui/input.d.ts +5 -0
- package/lib/components/ui/label.d.ts +5 -0
- package/lib/components/ui/popover.d.ts +6 -0
- package/lib/components/ui/select.d.ts +13 -0
- package/lib/components/ui/separator.d.ts +4 -0
- package/lib/components/ui/switch.d.ts +4 -0
- package/lib/components/ui/tabs.d.ts +7 -0
- package/lib/components/ui/textarea.d.ts +5 -0
- package/lib/components/ui/toast.d.ts +15 -0
- package/lib/components/ui/toaster.d.ts +1 -0
- package/lib/components/ui/toggle.d.ts +12 -0
- package/lib/components/ui/tooltip.d.ts +7 -0
- package/lib/components/ui/use-toast.d.ts +44 -0
- package/lib/constants/index.d.ts +47 -0
- package/lib/constants/resetCSS.d.ts +1 -0
- package/lib/dialog-DXF2Q8LZ.cjs +1 -0
- package/lib/dialog-xrO7nV_z.js +101 -0
- package/lib/dropdown-menu-Bh-wEgI8.cjs +1 -0
- package/lib/{dropdown-menu-BPp2Z_U-.js → dropdown-menu-ByeBPPyv.js} +32 -26
- package/lib/events.constant-B-VGURJp.cjs +1 -0
- package/lib/events.constant-CBPIqO_g.js +25 -0
- package/lib/extensions/Attachment/Attachment.d.ts +15 -0
- package/lib/extensions/Attachment/components/NodeViewAttachment/FileIcon.d.ts +1 -0
- package/lib/extensions/Attachment/components/NodeViewAttachment/FileIconString.d.ts +1 -0
- package/lib/extensions/Attachment/components/NodeViewAttachment/NodeViewAttachment.d.ts +1 -0
- package/lib/extensions/Attachment/components/RichTextAttachment.d.ts +1 -0
- package/lib/extensions/Attachment/index.d.ts +1 -0
- package/lib/extensions/Blockquote/Blockquote.d.ts +6 -0
- package/lib/extensions/Blockquote/components/RichTextBlockquote.d.ts +1 -0
- package/lib/extensions/Blockquote/index.d.ts +1 -0
- package/lib/extensions/Bold/Bold.d.ts +6 -0
- package/lib/extensions/Bold/components/RichTextBold.d.ts +1 -0
- package/lib/extensions/Bold/index.d.ts +1 -0
- package/lib/extensions/BulletList/BulletList.d.ts +6 -0
- package/lib/extensions/BulletList/components/RichTextBulletList.d.ts +1 -0
- package/lib/extensions/BulletList/index.d.ts +1 -0
- package/lib/extensions/Clear/Clear.d.ts +6 -0
- package/lib/extensions/Clear/components/RichTextClear.d.ts +1 -0
- package/lib/extensions/Clear/index.d.ts +1 -0
- package/lib/extensions/Code/Code.d.ts +6 -0
- package/lib/extensions/Code/components/RichTextCode.d.ts +1 -0
- package/lib/extensions/Code/index.d.ts +1 -0
- package/lib/extensions/CodeBlock/CodeBlock.d.ts +21 -0
- package/lib/extensions/CodeBlock/components/NodeViewCodeBlock/NodeViewCodeBlock.d.ts +1 -0
- package/lib/extensions/CodeBlock/components/RichTextCodeBlock.d.ts +1 -0
- package/lib/extensions/CodeBlock/index.d.ts +1 -0
- package/lib/extensions/CodeView/CodeView.d.ts +17 -0
- package/lib/extensions/CodeView/components/RichTextCodeView.d.ts +1 -0
- package/lib/extensions/CodeView/index.d.ts +1 -0
- package/lib/extensions/Color/Color.d.ts +22 -0
- package/lib/extensions/Color/components/RichTextColor.d.ts +1 -0
- package/lib/extensions/Color/index.d.ts +1 -0
- package/lib/extensions/Column/Column.d.ts +17 -0
- package/lib/extensions/Column/components/RichTextColumn.d.ts +1 -0
- package/lib/extensions/Column/index.d.ts +1 -0
- package/lib/extensions/Drawer/Drawer.d.ts +15 -0
- package/lib/extensions/Drawer/components/ControlDrawer/ControlDrawer.d.ts +2 -0
- package/lib/extensions/Drawer/components/ControlDrawer/icon.d.ts +28 -0
- package/lib/extensions/Drawer/components/EditDrawerBlock.d.ts +1 -0
- package/lib/extensions/Drawer/components/NodeViewDrawer/NodeViewDrawer.d.ts +1 -0
- package/lib/extensions/Drawer/components/RichTextDrawer.d.ts +1 -0
- package/lib/extensions/Drawer/index.d.ts +1 -0
- package/lib/extensions/Emoji/Emoji.d.ts +3 -0
- package/lib/extensions/Emoji/components/EmojiList/EmojiNodeView.d.ts +3 -0
- package/lib/extensions/Emoji/components/EmojiList/emojis.d.ts +4 -0
- package/lib/extensions/Emoji/components/RichTextEmoji.d.ts +1 -0
- package/lib/extensions/Emoji/index.d.ts +1 -0
- package/lib/extensions/Excalidraw/Excalidraw.d.ts +17 -0
- package/lib/extensions/Excalidraw/components/NodeViewExcalidraw/NodeViewExcalidraw.d.ts +2 -0
- package/lib/extensions/Excalidraw/components/RichTextExcalidraw.d.ts +1 -0
- package/lib/extensions/Excalidraw/index.d.ts +1 -0
- package/lib/extensions/ExportPdf/ExportPdf.d.ts +21 -0
- package/lib/extensions/ExportPdf/components/RichTextExportPdf.d.ts +1 -0
- package/lib/extensions/ExportPdf/index.d.ts +1 -0
- package/lib/extensions/ExportWord/ExportWord.d.ts +13 -0
- package/lib/extensions/ExportWord/components/RichTextExportWord.d.ts +1 -0
- package/lib/extensions/ExportWord/index.d.ts +1 -0
- package/lib/extensions/FontFamily/FontFamily.d.ts +10 -0
- package/lib/extensions/FontFamily/components/RichTextFontFamily.d.ts +15 -0
- package/lib/extensions/FontFamily/index.d.ts +1 -0
- package/lib/extensions/FontSize/FontSize.d.ts +32 -0
- package/lib/extensions/FontSize/components/RichTextFontSize.d.ts +12 -0
- package/lib/extensions/FontSize/index.d.ts +1 -0
- package/lib/extensions/Heading/Heading.d.ts +6 -0
- package/lib/extensions/Heading/components/RichTextHeading.d.ts +15 -0
- package/lib/extensions/Heading/index.d.ts +1 -0
- package/lib/extensions/Highlight/Highlight.d.ts +18 -0
- package/lib/extensions/Highlight/components/RichTextHighlight.d.ts +1 -0
- package/lib/extensions/Highlight/index.d.ts +1 -0
- package/lib/extensions/History/History.d.ts +6 -0
- package/lib/extensions/History/components/RichTextHistory.d.ts +2 -0
- package/lib/extensions/History/index.d.ts +1 -0
- package/lib/extensions/HorizontalRule/HorizontalRule.d.ts +6 -0
- package/lib/extensions/HorizontalRule/components/RichTextHorizontalRule.d.ts +1 -0
- package/lib/extensions/HorizontalRule/index.d.ts +1 -0
- package/lib/extensions/Iframe/Iframe.d.ts +16 -0
- package/lib/extensions/Iframe/components/IframeNodeView.d.ts +2 -0
- package/lib/extensions/Iframe/components/RichTextIframe.d.ts +1 -0
- package/lib/extensions/Iframe/index.d.ts +1 -0
- package/lib/extensions/Iframe/utils.d.ts +9 -0
- package/lib/extensions/Image/Image.d.ts +56 -0
- package/lib/extensions/Image/components/ImageCropper.d.ts +1 -0
- package/lib/extensions/Image/components/ImageView.d.ts +2 -0
- package/lib/extensions/Image/components/RichTextImage.d.ts +1 -0
- package/lib/extensions/Image/index.d.ts +1 -0
- package/lib/extensions/Image/store.d.ts +4 -0
- package/lib/extensions/ImageGif/ImageGif.d.ts +39 -0
- package/lib/extensions/ImageGif/components/ImageGifView.d.ts +2 -0
- package/lib/extensions/ImageGif/components/RichTextImageGif.d.ts +1 -0
- package/lib/extensions/ImageGif/components/services.d.ts +458 -0
- package/lib/extensions/ImageGif/index.d.ts +1 -0
- package/lib/extensions/ImportWord/ImportWord.d.ts +18 -0
- package/lib/extensions/ImportWord/components/RichTextImportWord.d.ts +1 -0
- package/lib/extensions/ImportWord/index.d.ts +1 -0
- package/lib/extensions/Indent/Indent.d.ts +23 -0
- package/lib/extensions/Indent/components/RichTextIndent.d.ts +1 -0
- package/lib/extensions/Indent/index.d.ts +1 -0
- package/lib/extensions/Italic/Italic.d.ts +6 -0
- package/lib/extensions/Italic/components/RichTextItalic.d.ts +1 -0
- package/lib/extensions/Italic/index.d.ts +1 -0
- package/lib/extensions/Katex/Katex.d.ts +17 -0
- package/lib/extensions/Katex/components/KatexWrapper.d.ts +1 -0
- package/lib/extensions/Katex/components/RichTextKatex.d.ts +1 -0
- package/lib/extensions/Katex/index.d.ts +1 -0
- package/lib/extensions/LineHeight/LineHeight.d.ts +7 -0
- package/lib/extensions/LineHeight/components/RichTextLightHeight.d.ts +1 -0
- package/lib/extensions/LineHeight/index.d.ts +1 -0
- package/lib/extensions/Link/Link.d.ts +6 -0
- package/lib/extensions/Link/components/LinkEditBlock.d.ts +8 -0
- package/lib/extensions/Link/components/LinkViewBlock.d.ts +8 -0
- package/lib/extensions/Link/components/RichTextLink.d.ts +1 -0
- package/lib/extensions/Link/index.d.ts +1 -0
- package/lib/extensions/Mention/Mention.d.ts +1 -0
- package/lib/extensions/Mention/components/NodeViewMentionList.d.ts +10 -0
- package/lib/extensions/Mention/index.d.ts +1 -0
- package/lib/extensions/Mermaid/Mermaid.d.ts +15 -0
- package/lib/extensions/Mermaid/components/EditMermaidBlock.d.ts +8 -0
- package/lib/extensions/Mermaid/components/NodeViewMermaid/NodeViewMermaid.d.ts +1 -0
- package/lib/extensions/Mermaid/components/RichTextMermaid.d.ts +1 -0
- package/lib/extensions/Mermaid/index.d.ts +1 -0
- package/lib/extensions/MoreMark/MoreMark.d.ts +20 -0
- package/lib/extensions/MoreMark/components/RichTextMoreMark.d.ts +14 -0
- package/lib/extensions/MoreMark/index.d.ts +1 -0
- package/lib/extensions/OrderedList/OrderedList.d.ts +6 -0
- package/lib/extensions/OrderedList/components/RichTextOrderedList.d.ts +1 -0
- package/lib/extensions/OrderedList/index.d.ts +1 -0
- package/lib/extensions/SearchAndReplace/SearchAndReplace.d.ts +36 -0
- package/lib/extensions/SearchAndReplace/components/RichTextSearchAndReplace.d.ts +1 -0
- package/lib/extensions/SearchAndReplace/index.d.ts +1 -0
- package/lib/extensions/SlashCommand/SlashCommand.d.ts +4 -0
- package/lib/extensions/SlashCommand/components/SlashCommandList.d.ts +6 -0
- package/lib/extensions/SlashCommand/components/SlashCommandNodeView.d.ts +3 -0
- package/lib/extensions/SlashCommand/index.d.ts +1 -0
- package/lib/extensions/SlashCommand/renderCommandListDefault.d.ts +7 -0
- package/lib/extensions/SlashCommand/types.d.ts +19 -0
- package/lib/extensions/Strike/Strike.d.ts +6 -0
- package/lib/extensions/Strike/components/RichTextStrike.d.ts +1 -0
- package/lib/extensions/Strike/index.d.ts +1 -0
- package/lib/extensions/Table/Table.d.ts +21 -0
- package/lib/extensions/Table/TableCellBackground.d.ts +14 -0
- package/lib/extensions/Table/components/CreateTablePopover.d.ts +7 -0
- package/lib/extensions/Table/components/RichTextTable.d.ts +1 -0
- package/lib/extensions/Table/index.d.ts +1 -0
- package/lib/extensions/TaskList/TaskList.d.ts +11 -0
- package/lib/extensions/TaskList/components/RichTextTaskList.d.ts +1 -0
- package/lib/extensions/TaskList/index.d.ts +1 -0
- package/lib/extensions/TextAlign/TextAlign.d.ts +17 -0
- package/lib/extensions/TextAlign/components/RichTextAlign.d.ts +14 -0
- package/lib/extensions/TextAlign/index.d.ts +1 -0
- package/lib/extensions/TextDirection/TextDirection.d.ts +5 -0
- package/lib/extensions/TextDirection/components/RichTextTextDirection.d.ts +15 -0
- package/lib/extensions/TextDirection/index.d.ts +1 -0
- package/lib/extensions/TextUnderline/TextUnderline.d.ts +6 -0
- package/lib/extensions/TextUnderline/components/RichTextUnderline.d.ts +1 -0
- package/lib/extensions/TextUnderline/index.d.ts +1 -0
- package/lib/extensions/Twitter/Twitter.d.ts +46 -0
- package/lib/extensions/Twitter/components/FormEditLinkTwitter.d.ts +6 -0
- package/lib/extensions/Twitter/components/NodeViewTweet.d.ts +8 -0
- package/lib/extensions/Twitter/components/RichTextTwitter.d.ts +1 -0
- package/lib/extensions/Twitter/index.d.ts +1 -0
- package/lib/extensions/Video/Video.d.ts +66 -0
- package/lib/extensions/Video/components/RichTextVideo.d.ts +1 -0
- package/lib/extensions/Video/index.d.ts +1 -0
- package/lib/extensions/Video/store.d.ts +4 -0
- package/lib/hooks/useActive.d.ts +21 -0
- package/lib/hooks/useAttributes.d.ts +2 -0
- package/lib/hooks/useButtonProps.d.ts +1 -0
- package/lib/hooks/useCopy.d.ts +5 -0
- package/lib/hooks/useExtension.d.ts +1 -0
- package/lib/hooks/useLocalStorage.d.ts +13 -0
- package/lib/index-B0fWAhpK.cjs +1 -0
- package/lib/{icons-Cllpys39.js → index-BQ17A_37.js} +173 -142
- package/lib/{index-Bnmd0WvY.js → index-BeUrdBxf.js} +23 -23
- package/lib/{index-DYkucCoF.js → index-CEbbM7Gx.js} +57 -76
- package/lib/{index-BPfVXs5_.js → index-ClAEwR0V.js} +580 -403
- package/lib/{index-CBce_TWY.js → index-D-FhWysc.js} +1 -1
- package/lib/{index-DzvuNTxo.cjs → index-DCJheRBq.cjs} +1 -1
- package/lib/index-DLqogznp.cjs +54 -0
- package/lib/index-DM3mpxB-.cjs +7 -0
- package/lib/index-DmOTQudI.cjs +1 -0
- package/lib/{index-N--9MohJ.cjs → index-DylewabB.cjs} +1 -1
- package/lib/{index-D-5U8dY8.cjs → index-TMqmkmT6.cjs} +1 -1
- package/lib/index-nFjllrEl.js +7390 -0
- package/lib/{index-D2TUfKkC.js → index-prphFVsp.js} +1 -1
- package/lib/index.cjs +3 -27
- package/lib/index.d.ts +1 -279
- package/lib/index.js +22 -129
- package/lib/input-CadAYBdT.cjs +1 -0
- package/lib/input-U-XBy56K.js +21 -0
- package/lib/{isNumber-ClPupm7P.cjs → isNumber-C2saEiG2.cjs} +1 -1
- package/lib/{isNumber-fpLGS0AZ.js → isNumber-CTm1pIvN.js} +1 -1
- package/lib/label-23SJWQ49.js +19 -0
- package/lib/label-C09fAh5p.cjs +1 -0
- package/lib/lib/utils.d.ts +2 -0
- package/lib/locale-bundle.cjs +1 -1
- package/lib/locale-bundle.d.ts +1 -6722
- package/lib/locale-bundle.js +1 -1
- package/lib/locales/en.d.ts +179 -0
- package/lib/locales/fi.d.ts +179 -0
- package/lib/locales/hu.d.ts +179 -0
- package/lib/{locale-bundle.d.cts → locales/index.d.ts} +5365 -6707
- package/lib/locales/pt-br.d.ts +179 -0
- package/lib/locales/vi.d.ts +179 -0
- package/lib/locales/zh-cn.d.ts +179 -0
- package/lib/plugins/image-upload.d.ts +13 -0
- package/lib/popover-C64cn4Pd.cjs +1 -0
- package/lib/{popover-CAuEW0Mr.js → popover-ydZ2mHXy.js} +7 -6
- package/lib/separator-BoKhvBG9.cjs +1 -0
- package/lib/separator-DqqiRHfY.js +241 -0
- package/lib/store/ProviderUniqueId.d.ts +6 -0
- package/lib/store/commandList.d.ts +2 -0
- package/lib/store/editor.d.ts +21 -0
- package/lib/store/fast-context.d.ts +7 -0
- package/lib/store/store.d.ts +23 -0
- package/lib/store-BPiGnThe.cjs +1 -0
- package/lib/store-Cu0gDf4G.js +10 -0
- package/lib/style.css +1 -1
- package/lib/{tabs-B5mVSN1I.js → tabs-BiYU230B.js} +3 -3
- package/lib/{tabs-BoLCMcCI.cjs → tabs-DebGjFBg.cjs} +1 -1
- package/lib/{textarea-DUUM1jZd.js → textarea--_-Ve3AB.js} +3 -3
- package/lib/textarea-BIkB9h_0.cjs +1 -0
- package/lib/theme/theme.d.ts +364 -0
- package/lib/theme.cjs +1 -0
- package/lib/theme.js +372 -0
- package/lib/{throttle-CdwDrFpn.js → throttle-CGM5M2yG.js} +10 -10
- package/lib/{throttle-qX7Yjtsg.cjs → throttle-DXN-aiH5.cjs} +1 -1
- package/lib/toggle-BWfca8kh.cjs +1 -0
- package/lib/{toggle-Cdp4IT2U.js → toggle-Crvm3Tcn.js} +20 -13
- package/lib/tooltip-9jtsGIcX.cjs +1 -0
- package/lib/tooltip-D_0vo9Xj.js +24 -0
- package/lib/types.d.ts +230 -0
- package/lib/{updatePosition-8Sdem5jb.cjs → updatePosition-C17CDdjq.cjs} +1 -1
- package/lib/{updatePosition-BPmcE0YD.js → updatePosition-DpMKxYdN.js} +1 -1
- package/lib/useButtonProps--5ytUuGi.js +136 -0
- package/lib/useButtonProps-DJ51kDtM.cjs +1 -0
- package/lib/utils/_event.d.ts +13 -0
- package/lib/utils/base64.d.ts +2 -0
- package/lib/utils/color.d.ts +7 -0
- package/lib/utils/columns.d.ts +14 -0
- package/lib/utils/customEvents/customEvents.d.ts +3 -0
- package/lib/utils/customEvents/events.constant.d.ts +9 -0
- package/lib/utils/delete-node.d.ts +2 -0
- package/lib/utils/dom-dataset.d.ts +28 -0
- package/lib/utils/download.d.ts +1 -0
- package/lib/utils/dynamicCSS.d.ts +25 -0
- package/lib/utils/editor-container-size.d.ts +4 -0
- package/lib/utils/file.d.ts +30 -0
- package/lib/utils/getRenderContainer.d.ts +3 -0
- package/lib/utils/indent.d.ts +14 -0
- package/lib/utils/is-mobile.d.ts +19 -0
- package/lib/utils/json.d.ts +2 -0
- package/lib/utils/lru-cache.d.ts +31 -0
- package/lib/utils/mitt.d.ts +21 -0
- package/lib/utils/node.d.ts +15 -0
- package/lib/utils/pdf.d.ts +3 -0
- package/lib/utils/plateform.d.ts +11 -0
- package/lib/utils/shortId.d.ts +1 -0
- package/lib/utils/storage.d.ts +2 -0
- package/lib/utils/updatePosition.d.ts +1 -0
- package/lib/utils/utils.d.ts +20 -0
- package/lib/utils/validateFile.d.ts +16 -0
- package/package.json +155 -169
- package/lib/Attachment.d.cts +0 -351
- package/lib/Attachment.d.ts +0 -351
- package/lib/Blockquote.d.cts +0 -350
- package/lib/Blockquote.d.ts +0 -350
- package/lib/Bold.d.cts +0 -350
- package/lib/Bold.d.ts +0 -350
- package/lib/BulletList.d.cts +0 -350
- package/lib/BulletList.d.ts +0 -350
- package/lib/Clear.d.cts +0 -349
- package/lib/Clear.d.ts +0 -349
- package/lib/Code.d.cts +0 -350
- package/lib/Code.d.ts +0 -350
- package/lib/CodeBlock.d.cts +0 -359
- package/lib/CodeBlock.d.ts +0 -359
- package/lib/CodeView.d.cts +0 -349
- package/lib/CodeView.d.ts +0 -349
- package/lib/Color.d.cts +0 -361
- package/lib/Color.d.ts +0 -361
- package/lib/Column.d.cts +0 -280
- package/lib/Column.d.ts +0 -280
- package/lib/Drawer-SRhwOc6T.cjs +0 -1
- package/lib/Drawer.d.cts +0 -351
- package/lib/Drawer.d.ts +0 -351
- package/lib/Emoji.d.cts +0 -279
- package/lib/Emoji.d.ts +0 -279
- package/lib/Excalidraw-DwBRXEtC.js +0 -345
- package/lib/Excalidraw-ZN3DQvDC.cjs +0 -1
- package/lib/Excalidraw.d.cts +0 -283
- package/lib/Excalidraw.d.ts +0 -283
- package/lib/ExportPdf.d.cts +0 -360
- package/lib/ExportPdf.d.ts +0 -360
- package/lib/ExportWord.d.cts +0 -348
- package/lib/ExportWord.d.ts +0 -348
- package/lib/FontFamily.d.cts +0 -372
- package/lib/FontFamily.d.ts +0 -372
- package/lib/FontSize.d.cts +0 -374
- package/lib/FontSize.d.ts +0 -374
- package/lib/Heading.d.cts +0 -364
- package/lib/Heading.d.ts +0 -364
- package/lib/Highlight.d.cts +0 -359
- package/lib/Highlight.d.ts +0 -359
- package/lib/History.d.cts +0 -352
- package/lib/History.d.ts +0 -352
- package/lib/HorizontalRule.d.cts +0 -350
- package/lib/HorizontalRule.d.ts +0 -350
- package/lib/Iframe-Cvca2G7X.cjs +0 -1
- package/lib/Iframe.d.cts +0 -275
- package/lib/Iframe.d.ts +0 -275
- package/lib/Image.d.cts +0 -384
- package/lib/Image.d.ts +0 -384
- package/lib/ImageGif.d.cts +0 -296
- package/lib/ImageGif.d.ts +0 -296
- package/lib/ImportWord.d.cts +0 -360
- package/lib/ImportWord.d.ts +0 -360
- package/lib/Indent.d.cts +0 -351
- package/lib/Indent.d.ts +0 -351
- package/lib/Italic.d.cts +0 -350
- package/lib/Italic.d.ts +0 -350
- package/lib/Katex-XfrNne6U.cjs +0 -4
- package/lib/Katex.d.cts +0 -284
- package/lib/Katex.d.ts +0 -284
- package/lib/LineHeight.d.cts +0 -350
- package/lib/LineHeight.d.ts +0 -350
- package/lib/Link.d.cts +0 -350
- package/lib/Link.d.ts +0 -350
- package/lib/LinkEditBlock-BZenZq-Z.cjs +0 -5
- package/lib/Mention.d.cts +0 -274
- package/lib/Mention.d.ts +0 -274
- package/lib/Mermaid.d.cts +0 -351
- package/lib/Mermaid.d.ts +0 -351
- package/lib/MoreMark.d.cts +0 -375
- package/lib/MoreMark.d.ts +0 -375
- package/lib/OrderedList.d.cts +0 -350
- package/lib/OrderedList.d.ts +0 -350
- package/lib/SearchAndReplace.d.cts +0 -292
- package/lib/SearchAndReplace.d.ts +0 -292
- package/lib/SlashCommand.d.cts +0 -309
- package/lib/SlashCommand.d.ts +0 -309
- package/lib/Strike.d.cts +0 -350
- package/lib/Strike.d.ts +0 -350
- package/lib/Table-B1j1Ebmh.cjs +0 -9
- package/lib/Table.d.cts +0 -371
- package/lib/Table.d.ts +0 -371
- package/lib/TaskList.d.cts +0 -356
- package/lib/TaskList.d.ts +0 -356
- package/lib/TextAlign.d.cts +0 -373
- package/lib/TextAlign.d.ts +0 -373
- package/lib/TextDirection.d.cts +0 -304
- package/lib/TextDirection.d.ts +0 -304
- package/lib/TextUnderline.d.cts +0 -350
- package/lib/TextUnderline.d.ts +0 -350
- package/lib/Twitter-CtVTIWJW.cjs +0 -1
- package/lib/Twitter.d.cts +0 -300
- package/lib/Twitter.d.ts +0 -300
- package/lib/Video.d.cts +0 -385
- package/lib/Video.d.ts +0 -385
- package/lib/bubble.d.cts +0 -310
- package/lib/button-B12K7BJ4.cjs +0 -1
- package/lib/clsx-C11secjj.cjs +0 -1
- package/lib/clsx-OuTLNxxd.js +0 -16
- package/lib/dialog-CaCS-W5S.cjs +0 -1
- package/lib/dialog-PtQivpHS.js +0 -100
- package/lib/dropdown-menu-CdSm4emp.cjs +0 -1
- package/lib/icons-CqHjeW5T.cjs +0 -1
- package/lib/index-BH4bc3jN.cjs +0 -33
- package/lib/index-DV5kbgRU.cjs +0 -1
- package/lib/index-Dfmm6FTT.cjs +0 -1
- package/lib/index-DnWWK9F_.js +0 -6374
- package/lib/index-DzcKxutn.js +0 -632
- package/lib/index-RfTlOzIr.cjs +0 -22
- package/lib/index.d.cts +0 -279
- package/lib/input-_ECRfn3Y.cjs +0 -1
- package/lib/input-wJ9PDEzZ.js +0 -21
- package/lib/label-BkgAe7IY.cjs +0 -1
- package/lib/label-CGdLYWv7.js +0 -19
- package/lib/popover-BgmUNMHj.cjs +0 -1
- package/lib/separator-CuBW_w98.js +0 -328
- package/lib/separator-DRIrVZ2N.cjs +0 -1
- package/lib/store-DX599H5W.js +0 -10
- package/lib/store-WStcMOiW.cjs +0 -1
- package/lib/switch-CnLJ7Y-b.cjs +0 -1
- package/lib/switch-Coix_FA1.js +0 -27
- package/lib/textarea-B-6zTKQz.cjs +0 -1
- package/lib/theme-B7aAsK_T.js +0 -15
- package/lib/theme-D8_cxGqB.cjs +0 -1
- package/lib/toggle-D41PzQLJ.cjs +0 -1
- package/lib/tooltip-BuEiE96N.cjs +0 -1
- package/lib/tooltip-CopwsU8q.js +0 -23
- package/lib/useButtonProps-BsEd4zYM.js +0 -141
- package/lib/useButtonProps-C6Vpn190.cjs +0 -1
package/lib/index-RfTlOzIr.cjs
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";const v=require("@tiptap/pm/state"),D=require("@tiptap/pm/model");require("@tiptap/pm/view");function It(r,e,t){for(let n=0;;n++){if(n==r.childCount||n==e.childCount)return r.childCount==e.childCount?null:t;let i=r.child(n),s=e.child(n);if(i==s){t+=i.nodeSize;continue}if(!i.sameMarkup(s))return t;if(i.isText&&i.text!=s.text){for(let o=0;i.text[o]==s.text[o];o++)t++;return t}if(i.content.size||s.content.size){let o=It(i.content,s.content,t+1);if(o!=null)return o}t+=i.nodeSize}}function zt(r,e,t,n){for(let i=r.childCount,s=e.childCount;;){if(i==0||s==0)return i==s?null:{a:t,b:n};let o=r.child(--i),l=e.child(--s),a=o.nodeSize;if(o==l){t-=a,n-=a;continue}if(!o.sameMarkup(l))return{a:t,b:n};if(o.isText&&o.text!=l.text){let c=0,f=Math.min(o.text.length,l.text.length);for(;c<f&&o.text[o.text.length-c-1]==l.text[l.text.length-c-1];)c++,t--,n--;return{a:t,b:n}}if(o.content.size||l.content.size){let c=zt(o.content,l.content,t-1,n-1);if(c)return c}t-=a,n-=a}}class w{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let n=0;n<e.length;n++)this.size+=e[n].nodeSize}nodesBetween(e,t,n,i=0,s){for(let o=0,l=0;l<t;o++){let a=this.content[o],c=l+a.nodeSize;if(c>e&&n(a,i+l,s||null,o)!==!1&&a.content.size){let f=l+1;a.nodesBetween(Math.max(0,e-f),Math.min(a.content.size,t-f),n,i+f)}l=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,i){let s="",o=!0;return this.nodesBetween(e,t,(l,a)=>{let c=l.isText?l.text.slice(Math.max(e,a)-a,t-a):l.isLeaf?i?typeof i=="function"?i(l):i:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&c||l.isTextblock)&&n&&(o?o=!1:s+=n),s+=c},0),s}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,n=e.firstChild,i=this.content.slice(),s=0;for(t.isText&&t.sameMarkup(n)&&(i[i.length-1]=t.withText(t.text+n.text),s=1);s<e.content.length;s++)i.push(e.content[s]);return new w(i,this.size+e.size)}cut(e,t=this.size){if(e==0&&t==this.size)return this;let n=[],i=0;if(t>e)for(let s=0,o=0;o<t;s++){let l=this.content[s],a=o+l.nodeSize;a>e&&((o<e||a>t)&&(l.isText?l=l.cut(Math.max(0,e-o),Math.min(l.text.length,t-o)):l=l.cut(Math.max(0,e-o-1),Math.min(l.content.size,t-o-1))),n.push(l),i+=l.nodeSize),o=a}return new w(n,i)}cutByIndex(e,t){return e==t?w.empty:e==0&&t==this.content.length?this:new w(this.content.slice(e,t))}replaceChild(e,t){let n=this.content[e];if(n==t)return this;let i=this.content.slice(),s=this.size+t.nodeSize-n.nodeSize;return i[e]=t,new w(i,s)}addToStart(e){return new w([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new w(this.content.concat(e),this.size+e.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 new 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 i=this.content[t];e(i,n,t),n+=i.nodeSize}}findDiffStart(e,t=0){return It(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return zt(this,e,t,n)}findIndex(e){if(e==0)return ge(0,e);if(e==this.size)return ge(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,n=0;;t++){let i=this.child(t),s=n+i.nodeSize;if(s>=e)return s==e?ge(t+1,s):ge(t,n);n=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return w.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new w(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return w.empty;let t,n=0;for(let i=0;i<e.length;i++){let s=e[i];n+=s.nodeSize,i&&s.isText&&e[i-1].sameMarkup(s)?(t||(t=e.slice(0,i)),t[t.length-1]=s.withText(t[t.length-1].text+s.text)):t&&t.push(s)}return new w(t||e,n)}static from(e){if(!e)return w.empty;if(e instanceof w)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new w([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}w.empty=new w([],0);const ze={index:0,offset:0};function ge(r,e){return ze.index=r,ze.offset=e,ze}function Je(r,e){if(r===e)return!0;if(!(r&&typeof r=="object")||!(e&&typeof e=="object"))return!1;let t=Array.isArray(r);if(Array.isArray(e)!=t)return!1;if(t){if(r.length!=e.length)return!1;for(let n=0;n<r.length;n++)if(!Je(r[n],e[n]))return!1}else{for(let n in r)if(!(n in e)||!Je(r[n],e[n]))return!1;for(let n in e)if(!(n in r))return!1}return!0}let F=class je{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let i=0;i<e.length;i++){let s=e[i];if(this.eq(s))return e;if(this.type.excludes(s.type))t||(t=e.slice(0,i));else{if(s.type.excludes(this.type))return e;!n&&s.type.rank>this.type.rank&&(t||(t=e.slice(0,i)),t.push(this),n=!0),t&&t.push(s)}}return t||(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&&Je(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 new RangeError("Invalid input for Mark.fromJSON");let n=e.marks[t.type];if(!n)throw new RangeError(`There is no mark type ${t.type} in this schema`);let i=n.create(t.attrs);return n.checkAttrs(i.attrs),i}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(e){if(!e||Array.isArray(e)&&e.length==0)return je.none;if(e instanceof je)return[e];let t=e.slice();return t.sort((n,i)=>n.type.rank-i.type.rank),t}};F.none=[];class Bn extends Error{}class k{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let n=Pt(this.content,e+this.openStart,t);return n&&new k(n,this.openStart,this.openEnd)}removeBetween(e,t){return new k(Ot(this.content,e+this.openStart,t+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(e,t){if(!t)return k.empty;let n=t.openStart||0,i=t.openEnd||0;if(typeof n!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new k(w.fromJSON(e,t.content),n,i)}static maxOpen(e,t=!0){let n=0,i=0;for(let s=e.firstChild;s&&!s.isLeaf&&(t||!s.type.spec.isolating);s=s.firstChild)n++;for(let s=e.lastChild;s&&!s.isLeaf&&(t||!s.type.spec.isolating);s=s.lastChild)i++;return new k(e,n,i)}}k.empty=new k(w.empty,0,0);function Ot(r,e,t){let{index:n,offset:i}=r.findIndex(e),s=r.maybeChild(n),{index:o,offset:l}=r.findIndex(t);if(i==e||s.isText){if(l!=t&&!r.child(o).isText)throw new RangeError("Removing non-flat range");return r.cut(0,e).append(r.cut(t))}if(n!=o)throw new RangeError("Removing non-flat range");return r.replaceChild(n,s.copy(Ot(s.content,e-i-1,t-i-1)))}function Pt(r,e,t,n){let{index:i,offset:s}=r.findIndex(e),o=r.maybeChild(i);if(s==e||o.isText)return n&&!n.canReplace(i,i,t)?null:r.cut(0,e).append(t).append(r.cut(e));let l=Pt(o.content,e-s-1,t,o);return l&&r.replaceChild(i,o.copy(l))}class He{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)}}function Dn(r){let e=Object.create(null);for(let t in r){let n=r[t];if(!n.hasDefault)return null;e[t]=n.default}return e}function Fn(r,e){let t=Object.create(null);for(let n in r){let i=e&&e[n];if(i===void 0){let s=r[n];if(s.hasDefault)i=s.default;else throw new RangeError("No value supplied for attribute "+n)}t[n]=i}return t}function Ln(r,e,t,n){for(let i in e)if(!(i in r))throw new RangeError(`Unsupported attribute ${i} for ${t} of type ${i}`);for(let i in r){let s=r[i];s.validate&&s.validate(e[i])}}function Wn(r,e){let t=Object.create(null);if(e)for(let n in e)t[n]=new jn(r,n,e[n]);return t}function Jn(r,e,t){let n=t.split("|");return i=>{let s=i===null?"null":typeof i;if(n.indexOf(s)<0)throw new RangeError(`Expected value of type ${n} for attribute ${e} on type ${r}, got ${s}`)}}class jn{constructor(e,t,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,"default"),this.default=n.default,this.validate=typeof n.validate=="string"?Jn(e,t,n.validate):n.validate}get isRequired(){return!this.hasDefault}}class Xe{constructor(e,t,n,i){this.name=e,this.rank=t,this.schema=n,this.spec=i,this.attrs=Wn(e,i.attrs),this.excluded=null;let s=Dn(this.attrs);this.instance=s?new F(this,s):null}create(e=null){return!e&&this.instance?this.instance:new F(this,Fn(this.attrs,e))}static compile(e,t){let n=Object.create(null),i=0;return e.forEach((s,o)=>n[s]=new Xe(s,i++,t,o)),n}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){Ln(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}function Hn(r){return r.tag!=null}function Vn(r){return r.style!=null}class Me{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let n=this.matchedStyles=[];t.forEach(i=>{if(Hn(i))this.tags.push(i);else if(Vn(i)){let s=/[^=]*/.exec(i.style)[0];n.indexOf(s)<0&&n.push(s),this.styles.push(i)}}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return!1;let s=e.nodes[i.node];return s.contentMatch.matchType(s)})}parse(e,t={}){let n=new gt(this,t,!1);return n.addAll(e,F.none,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new gt(this,t,!0);return n.addAll(e,F.none,t.from,t.to),k.maxOpen(n.finish())}matchTag(e,t,n){for(let i=n?this.tags.indexOf(n)+1:0;i<this.tags.length;i++){let s=this.tags[i];if(qn(e,s.tag)&&(s.namespace===void 0||e.namespaceURI==s.namespace)&&(!s.context||t.matchesContext(s.context))){if(s.getAttrs){let o=s.getAttrs(e);if(o===!1)continue;s.attrs=o||void 0}return s}}}matchStyle(e,t,n,i){for(let s=i?this.styles.indexOf(i)+1:0;s<this.styles.length;s++){let o=this.styles[s],l=o.style;if(!(l.indexOf(e)!=0||o.context&&!n.matchesContext(o.context)||l.length>e.length&&(l.charCodeAt(e.length)!=61||l.slice(e.length+1)!=t))){if(o.getAttrs){let a=o.getAttrs(t);if(a===!1)continue;o.attrs=a||void 0}return o}}}static schemaRules(e){let t=[];function n(i){let s=i.priority==null?50:i.priority,o=0;for(;o<t.length;o++){let l=t[o];if((l.priority==null?50:l.priority)<s)break}t.splice(o,0,i)}for(let i in e.marks){let s=e.marks[i].spec.parseDOM;s&&s.forEach(o=>{n(o=yt(o)),o.mark||o.ignore||o.clearMark||(o.mark=i)})}for(let i in e.nodes){let s=e.nodes[i].spec.parseDOM;s&&s.forEach(o=>{n(o=yt(o)),o.node||o.ignore||o.mark||(o.node=i)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Me(e,Me.schemaRules(e)))}}const $t={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},_n={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Bt={ol:!0,ul:!0},ce=1,Ve=2,ae=4;function mt(r,e,t){return e!=null?(e?ce:0)|(e==="full"?Ve:0):r&&r.whitespace=="pre"?ce|Ve:t&~ae}class ye{constructor(e,t,n,i,s,o){this.type=e,this.attrs=t,this.marks=n,this.solid=i,this.options=o,this.content=[],this.activeMarks=F.none,this.match=s||(o&ae?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(w.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let n=this.type.contentMatch,i;return(i=n.findWrapping(e.type))?(this.match=n,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&ce)){let n=this.content[this.content.length-1],i;if(n&&n.isText&&(i=/[ \t\r\n\u000c]+$/.exec(n.text))){let s=n;n.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=s.withText(s.text.slice(0,s.text.length-i[0].length))}}let t=w.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(w.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&&!$t.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class gt{constructor(e,t,n){this.parser=e,this.options=t,this.isOpen=n,this.open=0,this.localPreserveWS=!1;let i=t.topNode,s,o=mt(null,t.preserveWhitespace,0)|(n?ae:0);i?s=new ye(i.type,i.attrs,F.none,!0,t.topMatch||i.type.contentMatch,o):n?s=new ye(null,null,F.none,!0,null,o):s=new ye(e.schema.topNodeType,null,F.none,!0,null,o),this.nodes=[s],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,i=this.top,s=i.options&Ve?"full":this.localPreserveWS||(i.options&ce)>0,{schema:o}=this.parser;if(s==="full"||i.inlineContext(e)||/[^ \t\r\n\u000c]/.test(n)){if(s)if(s==="full")n=n.replace(/\r\n?/g,`
|
|
2
|
-
`);else if(o.linebreakReplacement&&/[\r\n]/.test(n)&&this.top.findWrapping(o.linebreakReplacement.create())){let l=n.split(/\r?\n|\r/);for(let a=0;a<l.length;a++)a&&this.insertNode(o.linebreakReplacement.create(),t,!0),l[a]&&this.insertNode(o.text(l[a]),t,!/\S/.test(l[a]));n=""}else n=n.replace(/\r?\n|\r/g," ");else if(n=n.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let l=i.content[i.content.length-1],a=e.previousSibling;(!l||a&&a.nodeName=="BR"||l.isText&&/[ \t\r\n\u000c]$/.test(l.text))&&(n=n.slice(1))}n&&this.insertNode(o.text(n),t,!/\S/.test(n)),this.findInText(e)}else this.findInside(e)}addElement(e,t,n){let i=this.localPreserveWS,s=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let o=e.nodeName.toLowerCase(),l;Bt.hasOwnProperty(o)&&this.parser.normalizeLists&&Kn(e);let a=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(l=this.parser.matchTag(e,this,n));e:if(a?a.ignore:_n.hasOwnProperty(o))this.findInside(e),this.ignoreFallback(e,t);else if(!a||a.skip||a.closeParent){a&&a.closeParent?this.open=Math.max(0,this.open-1):a&&a.skip.nodeType&&(e=a.skip);let c,f=this.needsBlock;if($t.hasOwnProperty(o))s.content.length&&s.content[0].isInline&&this.open&&(this.open--,s=this.top),c=!0,s.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,t);break e}let u=a&&a.skip?t:this.readStyles(e,t);u&&this.addAll(e,u),c&&this.sync(s),this.needsBlock=f}else{let c=this.readStyles(e,t);c&&this.addElementByRule(e,a,c,a.consuming===!1?l:void 0)}this.localPreserveWS=i}leafFallback(e,t){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
|
|
3
|
-
`),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 i=0;i<this.parser.matchedStyles.length;i++){let s=this.parser.matchedStyles[i],o=n.getPropertyValue(s);if(o)for(let l=void 0;;){let a=this.parser.matchStyle(s,o,this,l);if(!a)break;if(a.ignore)return null;if(a.clearMark?t=t.filter(c=>!a.clearMark(c)):t=t.concat(this.parser.schema.marks[a.mark].create(a.attrs)),a.consuming===!1)l=a;else break}}return t}addElementByRule(e,t,n,i){let s,o;if(t.node)if(o=this.parser.schema.nodes[t.node],o.isLeaf)this.insertNode(o.create(t.attrs),n,e.nodeName=="BR")||this.leafFallback(e,n);else{let a=this.enter(o,t.attrs||null,n,t.preserveWhitespace);a&&(s=!0,n=a)}else{let a=this.parser.schema.marks[t.mark];n=n.concat(a.create(t.attrs))}let l=this.top;if(o&&o.isLeaf)this.findInside(e);else if(i)this.addElement(e,n,i);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(a=>this.insertNode(a,n,!1));else{let a=e;typeof t.contentElement=="string"?a=e.querySelector(t.contentElement):typeof t.contentElement=="function"?a=t.contentElement(e):t.contentElement&&(a=t.contentElement),this.findAround(e,a,!0),this.addAll(a,n),this.findAround(e,a,!1)}s&&this.sync(l)&&this.open--}addAll(e,t,n,i){let s=n||0;for(let o=n?e.childNodes[n]:e.firstChild,l=i==null?null:e.childNodes[i];o!=l;o=o.nextSibling,++s)this.findAtPoint(e,s),this.addDOM(o,t);this.findAtPoint(e,s)}findPlace(e,t,n){let i,s;for(let o=this.open,l=0;o>=0;o--){let a=this.nodes[o],c=a.findWrapping(e);if(c&&(!i||i.length>c.length+l)&&(i=c,s=a,!c.length))break;if(a.solid){if(n)break;l+=2}}if(!i)return null;this.sync(s);for(let o=0;o<i.length;o++)t=this.enterInner(i[o],null,t,!1);return t}insertNode(e,t,n){if(e.isInline&&this.needsBlock&&!this.top.type){let s=this.textblockFromContext();s&&(t=this.enterInner(s,null,t))}let i=this.findPlace(e,t,n);if(i){this.closeExtra();let s=this.top;s.match&&(s.match=s.match.matchType(e.type));let o=F.none;for(let l of i.concat(e.marks))(s.type?s.type.allowsMarkType(l.type):wt(l.type,e.type))&&(o=l.addToSet(o));return s.content.push(e.mark(o)),!0}return!1}enter(e,t,n,i){let s=this.findPlace(e.create(t),n,!1);return s&&(s=this.enterInner(e,t,n,!0,i)),s}enterInner(e,t,n,i=!1,s){this.closeExtra();let o=this.top;o.match=o.match&&o.match.matchType(e);let l=mt(e,s,o.options);o.options&ae&&o.content.length==0&&(l|=ae);let a=F.none;return n=n.filter(c=>(o.type?o.type.allowsMarkType(c.type):wt(c.type,e))?(a=c.addToSet(a),!1):!0),this.nodes.push(new ye(e,t,a,i,null,l)),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;this.localPreserveWS&&(this.nodes[t].options|=ce)}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 i=n.length-1;i>=0;i--)e+=n[i].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 i=0;i<this.find.length;i++)this.find[i].pos==null&&e.nodeType==1&&e.contains(this.find[i].node)&&t.compareDocumentPosition(this.find[i].node)&(n?2:4)&&(this.find[i].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,i=!this.isOpen&&(!n||n.parent.type==this.nodes[0].type),s=-(n?n.depth+1:0)+(i?0:1),o=(l,a)=>{for(;l>=0;l--){let c=t[l];if(c==""){if(l==t.length-1||l==0)continue;for(;a>=s;a--)if(o(l-1,a))return!0;return!1}else{let f=a>0||a==0&&i?this.nodes[a].type:n&&a>=s?n.node(a-s).type:null;if(!f||f.name!=c&&!f.isInGroup(c))return!1;a--}}return!0};return o(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 t in this.parser.schema.nodes){let n=this.parser.schema.nodes[t];if(n.isTextblock&&n.defaultAttrs)return n}}}function Kn(r){for(let e=r.firstChild,t=null;e;e=e.nextSibling){let n=e.nodeType==1?e.nodeName.toLowerCase():null;n&&Bt.hasOwnProperty(n)&&t?(t.appendChild(e),e=t):n=="li"?t=e:n&&(t=null)}}function qn(r,e){return(r.matches||r.msMatchesSelector||r.webkitMatchesSelector||r.mozMatchesSelector).call(r,e)}function yt(r){let e={};for(let t in r)e[t]=r[t];return e}function wt(r,e){let t=e.schema.nodes;for(let n in t){let i=t[n];if(!i.allowsMarkType(r))continue;let s=[],o=l=>{s.push(l);for(let a=0;a<l.edgeCount;a++){let{type:c,next:f}=l.edge(a);if(c==e||s.indexOf(f)<0&&o(f))return!0}};if(o(i.contentMatch))return!0}}class Ye{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},n){n||(n=Oe(t).createDocumentFragment());let i=n,s=[];return e.forEach(o=>{if(s.length||o.marks.length){let l=0,a=0;for(;l<s.length&&a<o.marks.length;){let c=o.marks[a];if(!this.marks[c.type.name]){a++;continue}if(!c.eq(s[l][0])||c.type.spec.spanning===!1)break;l++,a++}for(;l<s.length;)i=s.pop()[1];for(;a<o.marks.length;){let c=o.marks[a++],f=this.serializeMark(c,o.isInline,t);f&&(s.push([c,i]),i.appendChild(f.dom),i=f.contentDOM||f.dom)}}i.appendChild(this.serializeNodeInner(o,t))}),n}serializeNodeInner(e,t){let{dom:n,contentDOM:i}=ve(Oe(t),this.nodes[e.type.name](e),null,e.attrs);if(i){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,t,i)}return n}serializeNode(e,t={}){let n=this.serializeNodeInner(e,t);for(let i=e.marks.length-1;i>=0;i--){let s=this.serializeMark(e.marks[i],e.isInline,t);s&&((s.contentDOM||s.dom).appendChild(n),n=s.dom)}return n}serializeMark(e,t,n={}){let i=this.marks[e.type.name];return i&&ve(Oe(n),i(e,t),null,e.attrs)}static renderSpec(e,t,n=null,i){return ve(e,t,n,i)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new Ye(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=kt(e.nodes);return t.text||(t.text=n=>n.text),t}static marksFromSchema(e){return kt(e.marks)}}function kt(r){let e={};for(let t in r){let n=r[t].spec.toDOM;n&&(e[t]=n)}return e}function Oe(r){return r.document||window.document}const xt=new WeakMap;function Un(r){let e=xt.get(r);return e===void 0&&xt.set(r,e=Xn(r)),e}function Xn(r){let e=null;function t(n){if(n&&typeof n=="object")if(Array.isArray(n))if(typeof n[0]=="string")e||(e=[]),e.push(n);else for(let i=0;i<n.length;i++)t(n[i]);else for(let i in n)t(n[i])}return t(r),e}function ve(r,e,t,n){if(typeof e=="string")return{dom:r.createTextNode(e)};if(e.nodeType!=null)return{dom:e};if(e.dom&&e.dom.nodeType!=null)return e;let i=e[0],s;if(typeof i!="string")throw new RangeError("Invalid array passed to renderSpec");if(n&&(s=Un(n))&&s.indexOf(e)>-1)throw new 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&&(t=i.slice(0,o),i=i.slice(o+1));let l,a=t?r.createElementNS(t,i):r.createElement(i),c=e[1],f=1;if(c&&typeof c=="object"&&c.nodeType==null&&!Array.isArray(c)){f=2;for(let u in c)if(c[u]!=null){let d=u.indexOf(" ");d>0?a.setAttributeNS(u.slice(0,d),u.slice(d+1),c[u]):u=="style"&&a.style?a.style.cssText=c[u]:a.setAttribute(u,c[u])}}for(let u=f;u<e.length;u++){let d=e[u];if(d===0){if(u<e.length-1||u>f)throw new RangeError("Content hole must be the only child of its parent node");return{dom:a,contentDOM:a}}else{let{dom:h,contentDOM:p}=ve(r,d,t,n);if(a.appendChild(h),p){if(l)throw new RangeError("Multiple content holes");l=p}}}return{dom:a,contentDOM:l}}const Dt=65535,Ft=Math.pow(2,16);function Yn(r,e){return r+e*Ft}function vt(r){return r&Dt}function Zn(r){return(r-(r&Dt))/Ft}const Lt=1,Wt=2,Se=4,Jt=8;class _e{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(this.delInfo&Jt)>0}get deletedBefore(){return(this.delInfo&(Lt|Se))>0}get deletedAfter(){return(this.delInfo&(Wt|Se))>0}get deletedAcross(){return(this.delInfo&Se)>0}}class ${constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&$.empty)return $.empty}recover(e){let t=0,n=vt(e);if(!this.inverted)for(let i=0;i<n;i++)t+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[n*3]+t+Zn(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 i=0,s=this.inverted?2:1,o=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let a=this.ranges[l]-(this.inverted?i:0);if(a>e)break;let c=this.ranges[l+s],f=this.ranges[l+o],u=a+c;if(e<=u){let d=c?e==a?-1:e==u?1:t:t,h=a+i+(d<0?0:f);if(n)return h;let p=e==(t<0?a:u)?null:Yn(l/3,e-a),m=e==a?Wt:e==u?Lt:Se;return(t<0?e!=a:e!=u)&&(m|=Jt),new _e(h,m,p)}i+=f-c}return n?e+i:new _e(e+i,0,null)}touches(e,t){let n=0,i=vt(t),s=this.inverted?2:1,o=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let a=this.ranges[l]-(this.inverted?n:0);if(a>e)break;let c=this.ranges[l+s],f=a+c;if(e<=f&&l==i*3)return!0;n+=this.ranges[l+o]-c}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let i=0,s=0;i<this.ranges.length;i+=3){let o=this.ranges[i],l=o-(this.inverted?s:0),a=o+(this.inverted?0:s),c=this.ranges[i+t],f=this.ranges[i+n];e(l,l+c,a,a+f),s+=f-c}}invert(){return new $(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?$.empty:new $(e<0?[0,-e,0]:[0,0,e])}}$.empty=new $([]);class fe{constructor(e,t,n=0,i=e?e.length:0){this.mirror=t,this.from=n,this.to=i,this._maps=e||[],this.ownData=!(e||t)}get maps(){return this._maps}slice(e=0,t=this.maps.length){return new fe(this._maps,this.mirror,e,t)}appendMap(e,t){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!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 i=e.getMirror(t);this.appendMap(e._maps[t],i!=null&&i<t?n+i: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=[]),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 i=e.getMirror(t);this.appendMap(e._maps[t].invert(),i!=null&&i>t?n-i-1:void 0)}}invert(){let e=new fe;return e.appendMappingInverted(this),e}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 i=0;for(let s=this.from;s<this.to;s++){let o=this._maps[s],l=o.mapResult(e,t);if(l.recover!=null){let a=this.getMirror(s);if(a!=null&&a>s&&a<this.to){s=a,e=this._maps[a].recover(l.recover);continue}}i|=l.delInfo,e=l.pos}return n?e:new _e(e,i,null)}}const Pe=Object.create(null);class O{getMap(){return $.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let n=Pe[t.stepType];if(!n)throw new RangeError(`No step type ${t.stepType} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in Pe)throw new RangeError("Duplicate use of step JSON ID "+e);return Pe[e]=t,t.prototype.jsonID=e,t}}class T{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new T(e,null)}static fail(e){return new T(null,e)}static fromReplace(e,t,n,i){try{return T.ok(e.replace(t,n,i))}catch(s){if(s instanceof Bn)return T.fail(s.message);throw s}}}function Ze(r,e,t){let n=[];for(let i=0;i<r.childCount;i++){let s=r.child(i);s.content.size&&(s=s.copy(Ze(s.content,e,s))),s.isInline&&(s=e(s,t,i)),n.push(s)}return w.fromArray(n)}class U extends O{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),i=n.node(n.sharedDepth(this.to)),s=new k(Ze(t.content,(o,l)=>!o.isAtom||!l.type.allowsMarkType(this.mark.type)?o:o.mark(this.mark.addToSet(o.marks)),i),t.openStart,t.openEnd);return T.fromReplace(e,this.from,this.to,s)}invert(){return new W(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new U(t.pos,n.pos,this.mark)}merge(e){return e instanceof U&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new U(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new U(t.from,t.to,e.markFromJSON(t.mark))}}O.jsonID("addMark",U);class W extends O{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 k(Ze(t.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),t.openStart,t.openEnd);return T.fromReplace(e,this.from,this.to,n)}invert(){return new U(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new W(t.pos,n.pos,this.mark)}merge(e){return e instanceof W&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new W(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new W(t.from,t.to,e.markFromJSON(t.mark))}}O.jsonID("removeMark",W);class X extends O{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return T.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return T.fromReplace(e,this.pos,this.pos+1,new k(w.from(n),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let n=this.mark.addToSet(t.marks);if(n.length==t.marks.length){for(let i=0;i<t.marks.length;i++)if(!t.marks[i].isInSet(n))return new X(this.pos,t.marks[i]);return new X(this.pos,this.mark)}}return new Q(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new X(t.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new X(t.pos,e.markFromJSON(t.mark))}}O.jsonID("addNodeMark",X);class Q extends O{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return T.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return T.fromReplace(e,this.pos,this.pos+1,new k(w.from(n),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return!t||!this.mark.isInSet(t.marks)?this:new X(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Q(t.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new Q(t.pos,e.markFromJSON(t.mark))}}O.jsonID("removeNodeMark",Q);class N extends O{constructor(e,t,n,i=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=i}apply(e){return this.structure&&Ke(e,this.from,this.to)?T.fail("Structure replace would overwrite content"):T.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new $([this.from,this.to-this.from,this.slice.size])}invert(e){return new N(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deletedAcross&&n.deletedAcross?null:new N(t.pos,Math.max(t.pos,n.pos),this.slice,this.structure)}merge(e){if(!(e instanceof N)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let t=this.slice.size+e.slice.size==0?k.empty:new k(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new N(this.from,this.to+(e.to-e.from),t,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let t=this.slice.size+e.slice.size==0?k.empty:new k(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new N(e.from,this.to,t,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(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new N(t.from,t.to,k.fromJSON(e,t.slice),!!t.structure)}}O.jsonID("replace",N);class R extends O{constructor(e,t,n,i,s,o,l=!1){super(),this.from=e,this.to=t,this.gapFrom=n,this.gapTo=i,this.slice=s,this.insert=o,this.structure=l}apply(e){if(this.structure&&(Ke(e,this.from,this.gapFrom)||Ke(e,this.gapTo,this.to)))return T.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return T.fail("Gap is not a flat range");let n=this.slice.insertAt(this.insert,t.content);return n?T.fromReplace(e,this.from,this.to,n):T.fail("Content does not fit in gap")}getMap(){return new $([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let t=this.gapTo-this.gapFrom;return new R(this.from,this.from+this.slice.size+t,this.from+this.insert,this.from+this.insert+t,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1),i=this.from==this.gapFrom?t.pos:e.map(this.gapFrom,-1),s=this.to==this.gapTo?n.pos:e.map(this.gapTo,1);return t.deletedAcross&&n.deletedAcross||i<t.pos||s>n.pos?null:new R(t.pos,n.pos,i,s,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(e,t){if(typeof t.from!="number"||typeof t.to!="number"||typeof t.gapFrom!="number"||typeof t.gapTo!="number"||typeof t.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new R(t.from,t.to,t.gapFrom,t.gapTo,k.fromJSON(e,t.slice),t.insert,!!t.structure)}}O.jsonID("replaceAround",R);function Ke(r,e,t){let n=r.resolve(e),i=t-e,s=n.depth;for(;i>0&&s>0&&n.indexAfter(s)==n.node(s).childCount;)s--,i--;if(i>0){let o=n.node(s).maybeChild(n.indexAfter(s));for(;i>0;){if(!o||o.isLeaf)return!0;o=o.firstChild,i--}}return!1}function Qn(r,e,t,n){let i=[],s=[],o,l;r.doc.nodesBetween(e,t,(a,c,f)=>{if(!a.isInline)return;let u=a.marks;if(!n.isInSet(u)&&f.type.allowsMarkType(n.type)){let d=Math.max(c,e),h=Math.min(c+a.nodeSize,t),p=n.addToSet(u);for(let m=0;m<u.length;m++)u[m].isInSet(p)||(o&&o.to==d&&o.mark.eq(u[m])?o.to=h:i.push(o=new W(d,h,u[m])));l&&l.to==d?l.to=h:s.push(l=new U(d,h,n))}}),i.forEach(a=>r.step(a)),s.forEach(a=>r.step(a))}function Gn(r,e,t,n){let i=[],s=0;r.doc.nodesBetween(e,t,(o,l)=>{if(!o.isInline)return;s++;let a=null;if(n instanceof Xe){let c=o.marks,f;for(;f=n.isInSet(c);)(a||(a=[])).push(f),c=f.removeFromSet(c)}else n?n.isInSet(o.marks)&&(a=[n]):a=o.marks;if(a&&a.length){let c=Math.min(l+o.nodeSize,t);for(let f=0;f<a.length;f++){let u=a[f],d;for(let h=0;h<i.length;h++){let p=i[h];p.step==s-1&&u.eq(i[h].style)&&(d=p)}d?(d.to=c,d.step=s):i.push({style:u,from:Math.max(l,e),to:c,step:s})}}}),i.forEach(o=>r.step(new W(o.from,o.to,o.style)))}function Qe(r,e,t,n=t.contentMatch,i=!0){let s=r.doc.nodeAt(e),o=[],l=e+1;for(let a=0;a<s.childCount;a++){let c=s.child(a),f=l+c.nodeSize,u=n.matchType(c.type);if(!u)o.push(new N(l,f,k.empty));else{n=u;for(let d=0;d<c.marks.length;d++)t.allowsMarkType(c.marks[d].type)||r.step(new W(l,f,c.marks[d]));if(i&&c.isText&&t.whitespace!="pre"){let d,h=/\r?\n|\r/g,p;for(;d=h.exec(c.text);)p||(p=new k(w.from(t.schema.text(" ",t.allowedMarks(c.marks))),0,0)),o.push(new N(l+d.index,l+d.index+d[0].length,p))}}l=f}if(!n.validEnd){let a=n.fillBefore(w.empty,!0);r.replace(l,l,new k(a,0,0))}for(let a=o.length-1;a>=0;a--)r.step(o[a])}function er(r,e,t){return(e==0||r.canReplace(e,r.childCount))&&(t==r.childCount||r.canReplace(0,t))}function se(r){let t=r.parent.content.cutByIndex(r.startIndex,r.endIndex);for(let n=r.depth,i=0,s=0;;--n){let o=r.$from.node(n),l=r.$from.index(n)+i,a=r.$to.indexAfter(n)-s;if(n<r.depth&&o.canReplace(l,a,t))return n;if(n==0||o.type.spec.isolating||!er(o,l,a))break;l&&(i=1),a<o.childCount&&(s=1)}return null}function tr(r,e,t){let{$from:n,$to:i,depth:s}=e,o=n.before(s+1),l=i.after(s+1),a=o,c=l,f=w.empty,u=0;for(let p=s,m=!1;p>t;p--)m||n.index(p)>0?(m=!0,f=w.from(n.node(p).copy(f)),u++):a--;let d=w.empty,h=0;for(let p=s,m=!1;p>t;p--)m||i.after(p+1)<i.end(p)?(m=!0,d=w.from(i.node(p).copy(d)),h++):c++;r.step(new R(a,c,o,l,new k(f.append(d),u,h),f.size-u,!0))}function Ge(r,e,t=null,n=r){let i=nr(r,e),s=i&&rr(n,e);return s?i.map(St).concat({type:e,attrs:t}).concat(s.map(St)):null}function St(r){return{type:r,attrs:null}}function nr(r,e){let{parent:t,startIndex:n,endIndex:i}=r,s=t.contentMatchAt(n).findWrapping(e);if(!s)return null;let o=s.length?s[0]:e;return t.canReplaceWith(n,i,o)?s:null}function rr(r,e){let{parent:t,startIndex:n,endIndex:i}=r,s=t.child(n),o=e.contentMatch.findWrapping(s.type);if(!o)return null;let a=(o.length?o[o.length-1]:e).contentMatch;for(let c=n;a&&c<i;c++)a=a.matchType(t.child(c).type);return!a||!a.validEnd?null:o}function ir(r,e,t){let n=w.empty;for(let o=t.length-1;o>=0;o--){if(n.size){let l=t[o].type.contentMatch.matchFragment(n);if(!l||!l.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}n=w.from(t[o].type.create(t[o].attrs,n))}let i=e.start,s=e.end;r.step(new R(i,s,i,s,new k(n,0,0),t.length,!0))}function sr(r,e,t,n,i){if(!n.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let s=r.steps.length;r.doc.nodesBetween(e,t,(o,l)=>{let a=typeof i=="function"?i(o):i;if(o.isTextblock&&!o.hasMarkup(n,a)&&or(r.doc,r.mapping.slice(s).map(l),n)){let c=null;if(n.schema.linebreakReplacement){let h=n.whitespace=="pre",p=!!n.contentMatch.matchType(n.schema.linebreakReplacement);h&&!p?c=!1:!h&&p&&(c=!0)}c===!1&&Ht(r,o,l,s),Qe(r,r.mapping.slice(s).map(l,1),n,void 0,c===null);let f=r.mapping.slice(s),u=f.map(l,1),d=f.map(l+o.nodeSize,1);return r.step(new R(u,d,u+1,d-1,new k(w.from(n.create(a,null,o.marks)),0,0),1,!0)),c===!0&&jt(r,o,l,s),!1}})}function jt(r,e,t,n){e.forEach((i,s)=>{if(i.isText){let o,l=/\r?\n|\r/g;for(;o=l.exec(i.text);){let a=r.mapping.slice(n).map(t+1+s+o.index);r.replaceWith(a,a+1,e.type.schema.linebreakReplacement.create())}}})}function Ht(r,e,t,n){e.forEach((i,s)=>{if(i.type==i.type.schema.linebreakReplacement){let o=r.mapping.slice(n).map(t+1+s);r.replaceWith(o,o+1,e.type.schema.text(`
|
|
4
|
-
`))}})}function or(r,e,t){let n=r.resolve(e),i=n.index();return n.parent.canReplaceWith(i,i+1,t)}function lr(r,e,t,n,i){let s=r.doc.nodeAt(e);if(!s)throw new RangeError("No node at given position");t||(t=s.type);let o=t.create(n,null,i||s.marks);if(s.isLeaf)return r.replaceWith(e,e+s.nodeSize,o);if(!t.validContent(s.content))throw new RangeError("Invalid content for node type "+t.name);r.step(new R(e,e+s.nodeSize,e+1,e+s.nodeSize-1,new k(w.from(o),0,0),1,!0))}function _(r,e,t=1,n){let i=r.resolve(e),s=i.depth-t,o=n&&n[n.length-1]||i.parent;if(s<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 c=i.depth-1,f=t-2;c>s;c--,f--){let u=i.node(c),d=i.index(c);if(u.type.spec.isolating)return!1;let h=u.content.cutByIndex(d,u.childCount),p=n&&n[f+1];p&&(h=h.replaceChild(0,p.type.create(p.attrs)));let m=n&&n[f]||u;if(!u.canReplace(d+1,u.childCount)||!m.type.validContent(h))return!1}let l=i.indexAfter(s),a=n&&n[0];return i.node(s).canReplaceWith(l,l,a?a.type:i.node(s+1).type)}function ar(r,e,t=1,n){let i=r.doc.resolve(e),s=w.empty,o=w.empty;for(let l=i.depth,a=i.depth-t,c=t-1;l>a;l--,c--){s=w.from(i.node(l).copy(s));let f=n&&n[c];o=w.from(f?f.type.create(f.attrs,o):i.node(l).copy(o))}r.step(new N(e,e,new k(s.append(o),t,t),!0))}function Y(r,e){let t=r.resolve(e),n=t.index();return Vt(t.nodeBefore,t.nodeAfter)&&t.parent.canReplace(n,n+1)}function cr(r,e){e.content.size||r.type.compatibleContent(e.type);let t=r.contentMatchAt(r.childCount),{linebreakReplacement:n}=r.type.schema;for(let i=0;i<e.childCount;i++){let s=e.child(i),o=s.type==n?r.type.schema.nodes.text:s.type;if(t=t.matchType(o),!t||!r.type.allowsMarks(s.marks))return!1}return t.validEnd}function Vt(r,e){return!!(r&&e&&!r.isLeaf&&cr(r,e))}function Ce(r,e,t=-1){let n=r.resolve(e);for(let i=n.depth;;i--){let s,o,l=n.index(i);if(i==n.depth?(s=n.nodeBefore,o=n.nodeAfter):t>0?(s=n.node(i+1),l++,o=n.node(i).maybeChild(l)):(s=n.node(i).maybeChild(l-1),o=n.node(i+1)),s&&!s.isTextblock&&Vt(s,o)&&n.node(i).canReplace(l,l+1))return e;if(i==0)break;e=t<0?n.before(i):n.after(i)}}function fr(r,e,t){let n=null,{linebreakReplacement:i}=r.doc.type.schema,s=r.doc.resolve(e-t),o=s.node().type;if(i&&o.inlineContent){let f=o.whitespace=="pre",u=!!o.contentMatch.matchType(i);f&&!u?n=!1:!f&&u&&(n=!0)}let l=r.steps.length;if(n===!1){let f=r.doc.resolve(e+t);Ht(r,f.node(),f.before(),l)}o.inlineContent&&Qe(r,e+t-1,o,s.node().contentMatchAt(s.index()),n==null);let a=r.mapping.slice(l),c=a.map(e-t);if(r.step(new N(c,a.map(e+t,-1),k.empty,!0)),n===!0){let f=r.doc.resolve(c);jt(r,f.node(),f.before(),r.steps.length)}return r}function ur(r,e,t){let n=r.resolve(e);if(n.parent.canReplaceWith(n.index(),n.index(),t))return e;if(n.parentOffset==0)for(let i=n.depth-1;i>=0;i--){let s=n.index(i);if(n.node(i).canReplaceWith(s,s,t))return n.before(i+1);if(s>0)return null}if(n.parentOffset==n.parent.content.size)for(let i=n.depth-1;i>=0;i--){let s=n.indexAfter(i);if(n.node(i).canReplaceWith(s,s,t))return n.after(i+1);if(s<n.node(i).childCount)return null}return null}function dr(r,e,t){let n=r.resolve(e);if(!t.content.size)return e;let i=t.content;for(let s=0;s<t.openStart;s++)i=i.firstChild.content;for(let s=1;s<=(t.openStart==0&&t.size?2:1);s++)for(let o=n.depth;o>=0;o--){let l=o==n.depth?0:n.pos<=(n.start(o+1)+n.end(o+1))/2?-1:1,a=n.index(o)+(l>0?1:0),c=n.node(o),f=!1;if(s==1)f=c.canReplace(a,a,i);else{let u=c.contentMatchAt(a).findWrapping(i.firstChild.type);f=u&&c.canReplaceWith(a,a,u[0])}if(f)return l==0?n.pos:l<0?n.before(o+1):n.after(o+1)}return null}function Te(r,e,t=e,n=k.empty){if(e==t&&!n.size)return null;let i=r.resolve(e),s=r.resolve(t);return _t(i,s,n)?new N(e,t,n):new hr(i,s,n).fit()}function _t(r,e,t){return!t.openStart&&!t.openEnd&&r.start()==e.start()&&r.parent.canReplace(r.index(),e.index(),t.content)}class hr{constructor(e,t,n){this.$from=e,this.$to=t,this.unplaced=n,this.frontier=[],this.placed=w.empty;for(let i=0;i<=e.depth;i++){let s=e.node(i);this.frontier.push({type:s.type,match:s.contentMatchAt(e.indexAfter(i))})}for(let i=e.depth;i>0;i--)this.placed=w.from(e.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let c=this.findFittable();c?this.placeNodes(c):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,n=this.$from,i=this.close(e<0?this.$to:n.doc.resolve(e));if(!i)return null;let s=this.placed,o=n.depth,l=i.depth;for(;o&&l&&s.childCount==1;)s=s.firstChild.content,o--,l--;let a=new k(s,o,l);return e>-1?new R(n.pos,e,this.$to.pos,this.$to.end(),a,t):a.size||n.pos!=this.$to.pos?new N(n.pos,i.pos,a):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,n=0,i=this.unplaced.openEnd;n<e;n++){let s=t.firstChild;if(t.childCount>1&&(i=0),s.type.spec.isolating&&i<=n){e=n;break}t=s.content}for(let t=1;t<=2;t++)for(let n=t==1?e:this.unplaced.openStart;n>=0;n--){let i,s=null;n?(s=$e(this.unplaced.content,n-1).firstChild,i=s.content):i=this.unplaced.content;let o=i.firstChild;for(let l=this.depth;l>=0;l--){let{type:a,match:c}=this.frontier[l],f,u=null;if(t==1&&(o?c.matchType(o.type)||(u=c.fillBefore(w.from(o),!1)):s&&a.compatibleContent(s.type)))return{sliceDepth:n,frontierDepth:l,parent:s,inject:u};if(t==2&&o&&(f=c.findWrapping(o.type)))return{sliceDepth:n,frontierDepth:l,parent:s,wrap:f};if(s&&c.matchType(s.type))break}}}openMore(){let{content:e,openStart:t,openEnd:n}=this.unplaced,i=$e(e,t);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new k(e,t+1,Math.max(n,i.size+t>=e.size-n?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:n}=this.unplaced,i=$e(e,t);if(i.childCount<=1&&t>0){let s=e.size-t<=t+i.size;this.unplaced=new k(oe(e,t-1,1),t-1,s?t-1:n)}else this.unplaced=new k(oe(e,t,1),t,n)}placeNodes({sliceDepth:e,frontierDepth:t,parent:n,inject:i,wrap:s}){for(;this.depth>t;)this.closeFrontierNode();if(s)for(let m=0;m<s.length;m++)this.openFrontierNode(s[m]);let o=this.unplaced,l=n?n.content:o.content,a=o.openStart-e,c=0,f=[],{match:u,type:d}=this.frontier[t];if(i){for(let m=0;m<i.childCount;m++)f.push(i.child(m));u=u.matchFragment(i)}let h=l.size+e-(o.content.size-o.openEnd);for(;c<l.childCount;){let m=l.child(c),g=u.matchType(m.type);if(!g)break;c++,(c>1||a==0||m.content.size)&&(u=g,f.push(Kt(m.mark(d.allowedMarks(m.marks)),c==1?a:0,c==l.childCount?h:-1)))}let p=c==l.childCount;p||(h=-1),this.placed=le(this.placed,t,w.from(f)),this.frontier[t].match=u,p&&h<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let m=0,g=l;m<h;m++){let y=g.lastChild;this.frontier.push({type:y.type,match:y.contentMatchAt(y.childCount)}),g=y.content}this.unplaced=p?e==0?k.empty:new k(oe(o.content,e-1,1),e-1,h<0?o.openEnd:e-1):new k(oe(o.content,e,c),o.openStart,o.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],t;if(!e.type.isTextblock||!Be(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,i=this.$to.after(n);for(;n>1&&i==this.$to.end(--n);)++i;return i}findCloseLevel(e){e:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:n,type:i}=this.frontier[t],s=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),o=Be(e,t,i,n,s);if(o){for(let l=t-1;l>=0;l--){let{match:a,type:c}=this.frontier[l],f=Be(e,l,c,a,!0);if(!f||f.childCount)continue e}return{depth:t,fit:o,move:s?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=le(this.placed,t.depth,t.fit)),e=t.move;for(let n=t.depth+1;n<=e.depth;n++){let i=e.node(n),s=i.type.contentMatch.fillBefore(i.content,!0,e.index(n));this.openFrontierNode(i.type,i.attrs,s)}return e}openFrontierNode(e,t=null,n){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=le(this.placed,this.depth,w.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let t=this.frontier.pop().match.fillBefore(w.empty,!0);t.childCount&&(this.placed=le(this.placed,this.frontier.length,t))}}function oe(r,e,t){return e==0?r.cutByIndex(t,r.childCount):r.replaceChild(0,r.firstChild.copy(oe(r.firstChild.content,e-1,t)))}function le(r,e,t){return e==0?r.append(t):r.replaceChild(r.childCount-1,r.lastChild.copy(le(r.lastChild.content,e-1,t)))}function $e(r,e){for(let t=0;t<e;t++)r=r.firstChild.content;return r}function Kt(r,e,t){if(e<=0)return r;let n=r.content;return e>1&&(n=n.replaceChild(0,Kt(n.firstChild,e-1,n.childCount==1?t-1:0))),e>0&&(n=r.type.contentMatch.fillBefore(n).append(n),t<=0&&(n=n.append(r.type.contentMatch.matchFragment(n).fillBefore(w.empty,!0)))),r.copy(n)}function Be(r,e,t,n,i){let s=r.node(e),o=i?r.indexAfter(e):r.index(e);if(o==s.childCount&&!t.compatibleContent(s.type))return null;let l=n.fillBefore(s.content,!0,o);return l&&!pr(t,s.content,o)?l:null}function pr(r,e,t){for(let n=t;n<e.childCount;n++)if(!r.allowsMarks(e.child(n).marks))return!0;return!1}function mr(r){return r.spec.defining||r.spec.definingForContent}function gr(r,e,t,n){if(!n.size)return r.deleteRange(e,t);let i=r.doc.resolve(e),s=r.doc.resolve(t);if(_t(i,s,n))return r.step(new N(e,t,n));let o=Ut(i,s);o[o.length-1]==0&&o.pop();let l=-(i.depth+1);o.unshift(l);for(let d=i.depth,h=i.pos-1;d>0;d--,h--){let p=i.node(d).type.spec;if(p.defining||p.definingAsContext||p.isolating)break;o.indexOf(d)>-1?l=d:i.before(d)==h&&o.splice(1,0,-d)}let a=o.indexOf(l),c=[],f=n.openStart;for(let d=n.content,h=0;;h++){let p=d.firstChild;if(c.push(p),h==n.openStart)break;d=p.content}for(let d=f-1;d>=0;d--){let h=c[d],p=mr(h.type);if(p&&!h.sameMarkup(i.node(Math.abs(l)-1)))f=d;else if(p||!h.type.isTextblock)break}for(let d=n.openStart;d>=0;d--){let h=(d+f+1)%(n.openStart+1),p=c[h];if(p)for(let m=0;m<o.length;m++){let g=o[(m+a)%o.length],y=!0;g<0&&(y=!1,g=-g);let x=i.node(g-1),S=i.index(g-1);if(x.canReplaceWith(S,S,p.type,p.marks))return r.replace(i.before(g),y?s.after(g):t,new k(qt(n.content,0,n.openStart,h),h,n.openEnd))}}let u=r.steps.length;for(let d=o.length-1;d>=0&&(r.replace(e,t,n),!(r.steps.length>u));d--){let h=o[d];h<0||(e=i.before(h),t=s.after(h))}}function qt(r,e,t,n,i){if(e<t){let s=r.firstChild;r=r.replaceChild(0,s.copy(qt(s.content,e+1,t,n,s)))}if(e>n){let s=i.contentMatchAt(0),o=s.fillBefore(r).append(r);r=o.append(s.matchFragment(o).fillBefore(w.empty,!0))}return r}function yr(r,e,t,n){if(!n.isInline&&e==t&&r.doc.resolve(e).parent.content.size){let i=ur(r.doc,e,n.type);i!=null&&(e=t=i)}r.replaceRange(e,t,new k(w.from(n),0,0))}function wr(r,e,t){let n=r.doc.resolve(e),i=r.doc.resolve(t),s=Ut(n,i);for(let o=0;o<s.length;o++){let l=s[o],a=o==s.length-1;if(a&&l==0||n.node(l).type.contentMatch.validEnd)return r.delete(n.start(l),i.end(l));if(l>0&&(a||n.node(l-1).canReplace(n.index(l-1),i.indexAfter(l-1))))return r.delete(n.before(l),i.after(l))}for(let o=1;o<=n.depth&&o<=i.depth;o++)if(e-n.start(o)==n.depth-o&&t>n.end(o)&&i.end(o)-t!=i.depth-o&&n.start(o-1)==i.start(o-1)&&n.node(o-1).canReplace(n.index(o-1),i.index(o-1)))return r.delete(n.before(o),t);r.delete(e,t)}function Ut(r,e){let t=[],n=Math.min(r.depth,e.depth);for(let i=n;i>=0;i--){let s=r.start(i);if(s<r.pos-(r.depth-i)||e.end(i)>e.pos+(e.depth-i)||r.node(i).type.spec.isolating||e.node(i).type.spec.isolating)break;(s==e.start(i)||i==r.depth&&i==e.depth&&r.parent.inlineContent&&e.parent.inlineContent&&i&&e.start(i-1)==s-1)&&t.push(i)}return t}class ee extends O{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 T.fail("No node at attribute step's position");let n=Object.create(null);for(let s in t.attrs)n[s]=t.attrs[s];n[this.attr]=this.value;let i=t.type.create(n,null,t.marks);return T.fromReplace(e,this.pos,this.pos+1,new k(w.from(i),0,t.isLeaf?0:1))}getMap(){return $.empty}invert(e){return new ee(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new ee(t.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.pos!="number"||typeof t.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new ee(t.pos,t.attr,t.value)}}O.jsonID("attr",ee);class ue extends O{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let i in e.attrs)t[i]=e.attrs[i];t[this.attr]=this.value;let n=e.type.create(t,e.content,e.marks);return T.ok(n)}getMap(){return $.empty}invert(e){return new ue(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new ue(t.attr,t.value)}}O.jsonID("docAttr",ue);let te=class extends Error{};te=function r(e){let t=Error.call(this,e);return t.__proto__=r.prototype,t};te.prototype=Object.create(Error.prototype);te.prototype.constructor=te;te.prototype.name="TransformError";class Xt{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new fe}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new te(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}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=k.empty){let i=Te(this.doc,e,t,n);return i&&this.step(i),this}replaceWith(e,t,n){return this.replace(e,t,new k(w.from(n),0,0))}delete(e,t){return this.replace(e,t,k.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,n){return gr(this,e,t,n),this}replaceRangeWith(e,t,n){return yr(this,e,t,n),this}deleteRange(e,t){return wr(this,e,t),this}lift(e,t){return tr(this,e,t),this}join(e,t=1){return fr(this,e,t),this}wrap(e,t){return ir(this,e,t),this}setBlockType(e,t=e,n,i=null){return sr(this,e,t,n,i),this}setNodeMarkup(e,t,n=null,i){return lr(this,e,t,n,i),this}setNodeAttribute(e,t,n){return this.step(new ee(e,t,n)),this}setDocAttribute(e,t){return this.step(new ue(e,t)),this}addNodeMark(e,t){return this.step(new X(e,t)),this}removeNodeMark(e,t){let n=this.doc.nodeAt(e);if(!n)throw new RangeError("No node at position "+e);if(t instanceof F)t.isInSet(n.marks)&&this.step(new Q(e,t));else{let i=n.marks,s,o=[];for(;s=t.isInSet(i);)o.push(new Q(e,s)),i=s.removeFromSet(i);for(let l=o.length-1;l>=0;l--)this.step(o[l])}return this}split(e,t=1,n){return ar(this,e,t,n),this}addMark(e,t,n){return Qn(this,e,t,n),this}removeMark(e,t,n){return Gn(this,e,t,n),this}clearIncompatible(e,t,n){return Qe(this,e,t,n),this}}const De=Object.create(null);class C{constructor(e,t,n){this.$anchor=e,this.$head=t,this.ranges=n||[new Yt(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=k.empty){let n=t.content.lastChild,i=null;for(let l=0;l<t.openEnd;l++)i=n,n=n.lastChild;let s=e.steps.length,o=this.ranges;for(let l=0;l<o.length;l++){let{$from:a,$to:c}=o[l],f=e.mapping.slice(s);e.replaceRange(f.map(a.pos),f.map(c.pos),l?k.empty:t),l==0&&Et(e,s,(n?n.isInline:i&&i.isTextblock)?-1:1)}}replaceWith(e,t){let n=e.steps.length,i=this.ranges;for(let s=0;s<i.length;s++){let{$from:o,$to:l}=i[s],a=e.mapping.slice(n),c=a.map(o.pos),f=a.map(l.pos);s?e.deleteRange(c,f):(e.replaceRangeWith(c,f,t),Et(e,n,t.isInline?-1:1))}}static findFrom(e,t,n=!1){let i=e.parent.inlineContent?new P(e):G(e.node(0),e.parent,e.pos,e.index(),t,n);if(i)return i;for(let s=e.depth-1;s>=0;s--){let o=t<0?G(e.node(0),e.node(s),e.before(s+1),e.index(s),t,n):G(e.node(0),e.node(s),e.after(s+1),e.index(s)+1,t,n);if(o)return o}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new L(e.node(0))}static atStart(e){return G(e,e,0,0,1)||new L(e)}static atEnd(e){return G(e,e,e.content.size,e.childCount,-1)||new L(e)}static fromJSON(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let n=De[t.type];if(!n)throw new RangeError(`No selection type ${t.type} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in De)throw new RangeError("Duplicate use of selection JSON ID "+e);return De[e]=t,t.prototype.jsonID=e,t}getBookmark(){return P.between(this.$anchor,this.$head).getBookmark()}}C.prototype.visible=!0;class Yt{constructor(e,t){this.$from=e,this.$to=t}}let bt=!1;function Mt(r){!bt&&!r.parent.inlineContent&&(bt=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+r.parent.type.name+")"))}class P extends C{constructor(e,t=e){Mt(e),Mt(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,t){let n=e.resolve(t.map(this.head));if(!n.parent.inlineContent)return C.near(n);let i=e.resolve(t.map(this.anchor));return new P(i.parent.inlineContent?i:n,n)}replace(e,t=k.empty){if(super.replace(e,t),t==k.empty){let n=this.$from.marksAcross(this.$to);n&&e.ensureMarks(n)}}eq(e){return e instanceof P&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new Ae(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,t){if(typeof t.anchor!="number"||typeof t.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new P(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,n=t){let i=e.resolve(t);return new this(i,n==t?i:e.resolve(n))}static between(e,t,n){let i=e.pos-t.pos;if((!n||i)&&(n=i>=0?1:-1),!t.parent.inlineContent){let s=C.findFrom(t,n,!0)||C.findFrom(t,-n,!0);if(s)t=s.$head;else return C.near(t,n)}return e.parent.inlineContent||(i==0?e=t:(e=(C.findFrom(e,-n,!0)||C.findFrom(e,n,!0)).$anchor,e.pos<t.pos!=i<0&&(e=t))),new P(e,t)}}C.jsonID("text",P);class Ae{constructor(e,t){this.anchor=e,this.head=t}map(e){return new Ae(e.map(this.anchor),e.map(this.head))}resolve(e){return P.between(e.resolve(this.anchor),e.resolve(this.head))}}class E extends C{constructor(e){let t=e.nodeAfter,n=e.node(0).resolve(e.pos+t.nodeSize);super(e,n),this.node=t}map(e,t){let{deleted:n,pos:i}=t.mapResult(this.anchor),s=e.resolve(i);return n?C.near(s):new E(s)}content(){return new k(w.from(this.node),0,0)}eq(e){return e instanceof E&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new et(this.anchor)}static fromJSON(e,t){if(typeof t.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new E(e.resolve(t.anchor))}static create(e,t){return new E(e.resolve(t))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}E.prototype.visible=!1;C.jsonID("node",E);class et{constructor(e){this.anchor=e}map(e){let{deleted:t,pos:n}=e.mapResult(this.anchor);return t?new Ae(n,n):new et(n)}resolve(e){let t=e.resolve(this.anchor),n=t.nodeAfter;return n&&E.isSelectable(n)?new E(t):C.near(t)}}class L extends C{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=k.empty){if(t==k.empty){e.delete(0,e.doc.content.size);let n=C.atStart(e.doc);n.eq(e.selection)||e.setSelection(n)}else super.replace(e,t)}toJSON(){return{type:"all"}}static fromJSON(e){return new L(e)}map(e){return new L(e)}eq(e){return e instanceof L}getBookmark(){return kr}}C.jsonID("all",L);const kr={map(){return this},resolve(r){return new L(r)}};function G(r,e,t,n,i,s=!1){if(e.inlineContent)return P.create(r,t);for(let o=n-(i>0?0:1);i>0?o<e.childCount:o>=0;o+=i){let l=e.child(o);if(l.isAtom){if(!s&&E.isSelectable(l))return E.create(r,t-(i<0?l.nodeSize:0))}else{let a=G(r,l,t+i,i<0?l.childCount:0,i,s);if(a)return a}t+=l.nodeSize*i}return null}function Et(r,e,t){let n=r.steps.length-1;if(n<e)return;let i=r.steps[n];if(!(i instanceof N||i instanceof R))return;let s=r.mapping.maps[n],o;s.forEach((l,a,c,f)=>{o==null&&(o=f)}),r.setSelection(C.near(r.doc.resolve(o),t))}function Ct(r,e){return!e||!r?r:r.bind(e)}class we{constructor(e,t,n){this.name=e,this.init=Ct(t.init,n),this.apply=Ct(t.apply,n)}}new we("doc",{init(r){return r.doc||r.schema.topNodeType.createAndFill()},apply(r){return r.doc}}),new we("selection",{init(r,e){return r.selection||C.atStart(e.doc)},apply(r){return r.selection}}),new we("storedMarks",{init(r){return r.storedMarks||null},apply(r,e,t,n){return n.selection.$cursor?r.storedMarks:null}}),new we("scrollToSelection",{init(){return 0},apply(r,e){return r.scrolledIntoView?e+1:e}});function Zt(r,e,t){for(let n in r){let i=r[n];i instanceof Function?i=i.bind(e):n=="handleDOMEvents"&&(i=Zt(i,e,{})),t[n]=i}return t}class xr{constructor(e){this.spec=e,this.props={},e.props&&Zt(e.props,this,this.props),this.key=e.key?e.key.key:Qt("plugin")}getState(e){return e[this.key]}}const Fe=Object.create(null);function Qt(r){return r in Fe?r+"$"+ ++Fe[r]:(Fe[r]=0,r+"$")}class vr{constructor(e="key"){this.key=Qt(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const Ne=(r,e)=>r.selection.empty?!1:(e&&e(r.tr.deleteSelection().scrollIntoView()),!0);function Gt(r,e){let{$cursor:t}=r.selection;return!t||(e?!e.endOfTextblock("backward",r):t.parentOffset>0)?null:t}const en=(r,e,t)=>{let n=Gt(r,t);if(!n)return!1;let i=tt(n);if(!i){let o=n.blockRange(),l=o&&se(o);return l==null?!1:(e&&e(r.tr.lift(o,l).scrollIntoView()),!0)}let s=i.nodeBefore;if(fn(r,i,e,-1))return!0;if(n.parent.content.size==0&&(ne(s,"end")||E.isSelectable(s)))for(let o=n.depth;;o--){let l=Te(r.doc,n.before(o),n.after(o),k.empty);if(l&&l.slice.size<l.to-l.from){if(e){let a=r.tr.step(l);a.setSelection(ne(s,"end")?C.findFrom(a.doc.resolve(a.mapping.map(i.pos,-1)),-1):E.create(a.doc,i.pos-s.nodeSize)),e(a.scrollIntoView())}return!0}if(o==1||n.node(o-1).childCount>1)break}return s.isAtom&&i.depth==n.depth-1?(e&&e(r.tr.delete(i.pos-s.nodeSize,i.pos).scrollIntoView()),!0):!1},Sr=(r,e,t)=>{let n=Gt(r,t);if(!n)return!1;let i=tt(n);return i?tn(r,i,e):!1},br=(r,e,t)=>{let n=rn(r,t);if(!n)return!1;let i=nt(n);return i?tn(r,i,e):!1};function tn(r,e,t){let n=e.nodeBefore,i=n,s=e.pos-1;for(;!i.isTextblock;s--){if(i.type.spec.isolating)return!1;let f=i.lastChild;if(!f)return!1;i=f}let o=e.nodeAfter,l=o,a=e.pos+1;for(;!l.isTextblock;a++){if(l.type.spec.isolating)return!1;let f=l.firstChild;if(!f)return!1;l=f}let c=Te(r.doc,s,a,k.empty);if(!c||c.from!=s||c instanceof N&&c.slice.size>=a-s)return!1;if(t){let f=r.tr.step(c);f.setSelection(P.create(f.doc,s)),t(f.scrollIntoView())}return!0}function ne(r,e,t=!1){for(let n=r;n;n=e=="start"?n.firstChild:n.lastChild){if(n.isTextblock)return!0;if(t&&n.childCount!=1)return!1}return!1}const nn=(r,e,t)=>{let{$head:n,empty:i}=r.selection,s=n;if(!i)return!1;if(n.parent.isTextblock){if(t?!t.endOfTextblock("backward",r):n.parentOffset>0)return!1;s=tt(n)}let o=s&&s.nodeBefore;return!o||!E.isSelectable(o)?!1:(e&&e(r.tr.setSelection(E.create(r.doc,s.pos-o.nodeSize)).scrollIntoView()),!0)};function tt(r){if(!r.parent.type.spec.isolating)for(let e=r.depth-1;e>=0;e--){if(r.index(e)>0)return r.doc.resolve(r.before(e+1));if(r.node(e).type.spec.isolating)break}return null}function rn(r,e){let{$cursor:t}=r.selection;return!t||(e?!e.endOfTextblock("forward",r):t.parentOffset<t.parent.content.size)?null:t}const sn=(r,e,t)=>{let n=rn(r,t);if(!n)return!1;let i=nt(n);if(!i)return!1;let s=i.nodeAfter;if(fn(r,i,e,1))return!0;if(n.parent.content.size==0&&(ne(s,"start")||E.isSelectable(s))){let o=Te(r.doc,n.before(),n.after(),k.empty);if(o&&o.slice.size<o.to-o.from){if(e){let l=r.tr.step(o);l.setSelection(ne(s,"start")?C.findFrom(l.doc.resolve(l.mapping.map(i.pos)),1):E.create(l.doc,l.mapping.map(i.pos))),e(l.scrollIntoView())}return!0}}return s.isAtom&&i.depth==n.depth-1?(e&&e(r.tr.delete(i.pos,i.pos+s.nodeSize).scrollIntoView()),!0):!1},on=(r,e,t)=>{let{$head:n,empty:i}=r.selection,s=n;if(!i)return!1;if(n.parent.isTextblock){if(t?!t.endOfTextblock("forward",r):n.parentOffset<n.parent.content.size)return!1;s=nt(n)}let o=s&&s.nodeAfter;return!o||!E.isSelectable(o)?!1:(e&&e(r.tr.setSelection(E.create(r.doc,s.pos)).scrollIntoView()),!0)};function nt(r){if(!r.parent.type.spec.isolating)for(let e=r.depth-1;e>=0;e--){let t=r.node(e);if(r.index(e)+1<t.childCount)return r.doc.resolve(r.after(e+1));if(t.type.spec.isolating)break}return null}const Mr=(r,e)=>{let t=r.selection,n=t instanceof E,i;if(n){if(t.node.isTextblock||!Y(r.doc,t.from))return!1;i=t.from}else if(i=Ce(r.doc,t.from,-1),i==null)return!1;if(e){let s=r.tr.join(i);n&&s.setSelection(E.create(s.doc,i-r.doc.resolve(i).nodeBefore.nodeSize)),e(s.scrollIntoView())}return!0},Er=(r,e)=>{let t=r.selection,n;if(t instanceof E){if(t.node.isTextblock||!Y(r.doc,t.to))return!1;n=t.to}else if(n=Ce(r.doc,t.to,1),n==null)return!1;return e&&e(r.tr.join(n).scrollIntoView()),!0},Cr=(r,e)=>{let{$from:t,$to:n}=r.selection,i=t.blockRange(n),s=i&&se(i);return s==null?!1:(e&&e(r.tr.lift(i,s).scrollIntoView()),!0)},ln=(r,e)=>{let{$head:t,$anchor:n}=r.selection;return!t.parent.type.spec.code||!t.sameParent(n)?!1:(e&&e(r.tr.insertText(`
|
|
5
|
-
`).scrollIntoView()),!0)};function rt(r){for(let e=0;e<r.edgeCount;e++){let{type:t}=r.edge(e);if(t.isTextblock&&!t.hasRequiredAttrs())return t}return null}const Tr=(r,e)=>{let{$head:t,$anchor:n}=r.selection;if(!t.parent.type.spec.code||!t.sameParent(n))return!1;let i=t.node(-1),s=t.indexAfter(-1),o=rt(i.contentMatchAt(s));if(!o||!i.canReplaceWith(s,s,o))return!1;if(e){let l=t.after(),a=r.tr.replaceWith(l,l,o.createAndFill());a.setSelection(C.near(a.doc.resolve(l),1)),e(a.scrollIntoView())}return!0},an=(r,e)=>{let t=r.selection,{$from:n,$to:i}=t;if(t instanceof L||n.parent.inlineContent||i.parent.inlineContent)return!1;let s=rt(i.parent.contentMatchAt(i.indexAfter()));if(!s||!s.isTextblock)return!1;if(e){let o=(!n.parentOffset&&i.index()<i.parent.childCount?n:i).pos,l=r.tr.insert(o,s.createAndFill());l.setSelection(P.create(l.doc,o+1)),e(l.scrollIntoView())}return!0},cn=(r,e)=>{let{$cursor:t}=r.selection;if(!t||t.parent.content.size)return!1;if(t.depth>1&&t.after()!=t.end(-1)){let s=t.before();if(_(r.doc,s))return e&&e(r.tr.split(s).scrollIntoView()),!0}let n=t.blockRange(),i=n&&se(n);return i==null?!1:(e&&e(r.tr.lift(n,i).scrollIntoView()),!0)};function Ar(r){return(e,t)=>{let{$from:n,$to:i}=e.selection;if(e.selection instanceof E&&e.selection.node.isBlock)return!n.parentOffset||!_(e.doc,n.pos)?!1:(t&&t(e.tr.split(n.pos).scrollIntoView()),!0);if(!n.depth)return!1;let s=[],o,l,a=!1,c=!1;for(let h=n.depth;;h--)if(n.node(h).isBlock){a=n.end(h)==n.pos+(n.depth-h),c=n.start(h)==n.pos-(n.depth-h),l=rt(n.node(h-1).contentMatchAt(n.indexAfter(h-1))),s.unshift(a&&l?{type:l}:null),o=h;break}else{if(h==1)return!1;s.unshift(null)}let f=e.tr;(e.selection instanceof P||e.selection instanceof L)&&f.deleteSelection();let u=f.mapping.map(n.pos),d=_(f.doc,u,s.length,s);if(d||(s[0]=l?{type:l}:null,d=_(f.doc,u,s.length,s)),!d)return!1;if(f.split(u,s.length,s),!a&&c&&n.node(o).type!=l){let h=f.mapping.map(n.before(o)),p=f.doc.resolve(h);l&&n.node(o-1).canReplaceWith(p.index(),p.index()+1,l)&&f.setNodeMarkup(f.mapping.map(n.before(o)),l)}return t&&t(f.scrollIntoView()),!0}}const Nr=Ar(),Rr=(r,e)=>{let{$from:t,to:n}=r.selection,i,s=t.sharedDepth(n);return s==0?!1:(i=t.before(s),e&&e(r.tr.setSelection(E.create(r.doc,i))),!0)};function Ir(r,e,t){let n=e.nodeBefore,i=e.nodeAfter,s=e.index();return!n||!i||!n.type.compatibleContent(i.type)?!1:!n.content.size&&e.parent.canReplace(s-1,s)?(t&&t(r.tr.delete(e.pos-n.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(s,s+1)||!(i.isTextblock||Y(r.doc,e.pos))?!1:(t&&t(r.tr.join(e.pos).scrollIntoView()),!0)}function fn(r,e,t,n){let i=e.nodeBefore,s=e.nodeAfter,o,l,a=i.type.spec.isolating||s.type.spec.isolating;if(!a&&Ir(r,e,t))return!0;let c=!a&&e.parent.canReplace(e.index(),e.index()+1);if(c&&(o=(l=i.contentMatchAt(i.childCount)).findWrapping(s.type))&&l.matchType(o[0]||s.type).validEnd){if(t){let h=e.pos+s.nodeSize,p=w.empty;for(let y=o.length-1;y>=0;y--)p=w.from(o[y].create(null,p));p=w.from(i.copy(p));let m=r.tr.step(new R(e.pos-1,h,e.pos,h,new k(p,1,0),o.length,!0)),g=m.doc.resolve(h+2*o.length);g.nodeAfter&&g.nodeAfter.type==i.type&&Y(m.doc,g.pos)&&m.join(g.pos),t(m.scrollIntoView())}return!0}let f=s.type.spec.isolating||n>0&&a?null:C.findFrom(e,1),u=f&&f.$from.blockRange(f.$to),d=u&&se(u);if(d!=null&&d>=e.depth)return t&&t(r.tr.lift(u,d).scrollIntoView()),!0;if(c&&ne(s,"start",!0)&&ne(i,"end")){let h=i,p=[];for(;p.push(h),!h.isTextblock;)h=h.lastChild;let m=s,g=1;for(;!m.isTextblock;m=m.firstChild)g++;if(h.canReplace(h.childCount,h.childCount,m.content)){if(t){let y=w.empty;for(let S=p.length-1;S>=0;S--)y=w.from(p[S].copy(y));let x=r.tr.step(new R(e.pos-p.length,e.pos+s.nodeSize,e.pos+g,e.pos+s.nodeSize-g,new k(y,p.length,0),0,!0));t(x.scrollIntoView())}return!0}}return!1}function un(r){return function(e,t){let n=e.selection,i=r<0?n.$from:n.$to,s=i.depth;for(;i.node(s).isInline;){if(!s)return!1;s--}return i.node(s).isTextblock?(t&&t(e.tr.setSelection(P.create(e.doc,r<0?i.start(s):i.end(s)))),!0):!1}}const zr=un(-1),Or=un(1);function Pr(r,e=null){return function(t,n){let{$from:i,$to:s}=t.selection,o=i.blockRange(s),l=o&&Ge(o,r,e);return l?(n&&n(t.tr.wrap(o,l).scrollIntoView()),!0):!1}}function Tt(r,e=null){return function(t,n){let i=!1;for(let s=0;s<t.selection.ranges.length&&!i;s++){let{$from:{pos:o},$to:{pos:l}}=t.selection.ranges[s];t.doc.nodesBetween(o,l,(a,c)=>{if(i)return!1;if(!(!a.isTextblock||a.hasMarkup(r,e)))if(a.type==r)i=!0;else{let f=t.doc.resolve(c),u=f.index();i=f.parent.canReplaceWith(u,u+1,r)}})}if(!i)return!1;if(n){let s=t.tr;for(let o=0;o<t.selection.ranges.length;o++){let{$from:{pos:l},$to:{pos:a}}=t.selection.ranges[o];s.setBlockType(l,a,r,e)}n(s.scrollIntoView())}return!0}}function it(...r){return function(e,t,n){for(let i=0;i<r.length;i++)if(r[i](e,t,n))return!0;return!1}}it(Ne,en,nn);it(Ne,sn,on);it(ln,an,cn,Nr);typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function $r(r,e=null){return function(t,n){let{$from:i,$to:s}=t.selection,o=i.blockRange(s);if(!o)return!1;let l=n?t.tr:null;return Br(l,o,r,e)?(n&&n(l.scrollIntoView()),!0):!1}}function Br(r,e,t,n=null){let i=!1,s=e,o=e.$from.doc;if(e.depth>=2&&e.$from.node(e.depth-1).type.compatibleContent(t)&&e.startIndex==0){if(e.$from.index(e.depth-1)==0)return!1;let a=o.resolve(e.start-2);s=new He(a,a,e.depth),e.endIndex<e.parent.childCount&&(e=new He(e.$from,o.resolve(e.$to.end(e.depth)),e.depth)),i=!0}let l=Ge(s,t,n,e);return l?(r&&Dr(r,e,l,i,t),!0):!1}function Dr(r,e,t,n,i){let s=w.empty;for(let f=t.length-1;f>=0;f--)s=w.from(t[f].type.create(t[f].attrs,s));r.step(new R(e.start-(n?2:0),e.end,e.start,e.end,new k(s,0,0),t.length,!0));let o=0;for(let f=0;f<t.length;f++)t[f].type==i&&(o=f+1);let l=t.length-o,a=e.start+t.length-(n?2:0),c=e.parent;for(let f=e.startIndex,u=e.endIndex,d=!0;f<u;f++,d=!1)!d&&_(r.doc,a,l)&&(r.split(a,l),a+=2*l),a+=c.child(f).nodeSize;return r}function Fr(r){return function(e,t){let{$from:n,$to:i}=e.selection,s=n.blockRange(i,o=>o.childCount>0&&o.firstChild.type==r);return s?t?n.node(s.depth-1).type==r?Lr(e,t,r,s):Wr(e,t,s):!0:!1}}function Lr(r,e,t,n){let i=r.tr,s=n.end,o=n.$to.end(n.depth);s<o&&(i.step(new R(s-1,o,s,o,new k(w.from(t.create(null,n.parent.copy())),1,0),1,!0)),n=new He(i.doc.resolve(n.$from.pos),i.doc.resolve(o),n.depth));const l=se(n);if(l==null)return!1;i.lift(n,l);let a=i.doc.resolve(i.mapping.map(s,-1)-1);return Y(i.doc,a.pos)&&a.nodeBefore.type==a.nodeAfter.type&&i.join(a.pos),e(i.scrollIntoView()),!0}function Wr(r,e,t){let n=r.tr,i=t.parent;for(let h=t.end,p=t.endIndex-1,m=t.startIndex;p>m;p--)h-=i.child(p).nodeSize,n.delete(h-1,h+1);let s=n.doc.resolve(t.start),o=s.nodeAfter;if(n.mapping.map(t.end)!=t.start+s.nodeAfter.nodeSize)return!1;let l=t.startIndex==0,a=t.endIndex==i.childCount,c=s.node(-1),f=s.index(-1);if(!c.canReplace(f+(l?0:1),f+1,o.content.append(a?w.empty:w.from(i))))return!1;let u=s.pos,d=u+o.nodeSize;return n.step(new R(u-(l?1:0),d+(a?1:0),u+1,d-1,new k((l?w.empty:w.from(i.copy(w.empty))).append(a?w.empty:w.from(i.copy(w.empty))),l?0:1,a?0:1),l?0:1)),e(n.scrollIntoView()),!0}function Jr(r){return function(e,t){let{$from:n,$to:i}=e.selection,s=n.blockRange(i,c=>c.childCount>0&&c.firstChild.type==r);if(!s)return!1;let o=s.startIndex;if(o==0)return!1;let l=s.parent,a=l.child(o-1);if(a.type!=r)return!1;if(t){let c=a.lastChild&&a.lastChild.type==l.type,f=w.from(c?r.create():null),u=new k(w.from(r.create(null,w.from(l.type.create(null,f)))),c?3:1,0),d=s.start,h=s.end;t(e.tr.step(new R(d-(c?3:1),h,d,h,u,1,!0)).scrollIntoView())}return!0}}var jr=Object.defineProperty,st=(r,e)=>{for(var t in e)jr(r,t,{get:e[t],enumerable:!0})};function dn(r){const{state:e,transaction:t}=r;let{selection:n}=t,{doc:i}=t,{storedMarks:s}=t;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return s},get selection(){return n},get doc(){return i},get tr(){return n=t.selection,i=t.doc,s=t.storedMarks,t}}}var Hr=class{constructor(r){this.editor=r.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=r.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:r,editor:e,state:t}=this,{view:n}=e,{tr:i}=t,s=this.buildProps(i);return Object.fromEntries(Object.entries(r).map(([o,l])=>[o,(...c)=>{const f=l(...c)(s);return!i.getMeta("preventDispatch")&&!this.hasCustomState&&n.dispatch(i),f}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(r,e=!0){const{rawCommands:t,editor:n,state:i}=this,{view:s}=n,o=[],l=!!r,a=r||i.tr,c=()=>(!l&&e&&!a.getMeta("preventDispatch")&&!this.hasCustomState&&s.dispatch(a),o.every(u=>u===!0)),f={...Object.fromEntries(Object.entries(t).map(([u,d])=>[u,(...p)=>{const m=this.buildProps(a,e),g=d(...p)(m);return o.push(g),f}])),run:c};return f}createCan(r){const{rawCommands:e,state:t}=this,n=!1,i=r||t.tr,s=this.buildProps(i,n);return{...Object.fromEntries(Object.entries(e).map(([l,a])=>[l,(...c)=>a(...c)({...s,dispatch:void 0})])),chain:()=>this.createChain(i,n)}}buildProps(r,e=!0){const{rawCommands:t,editor:n,state:i}=this,{view:s}=n,o={tr:r,editor:n,view:s,state:dn({state:i,transaction:r}),dispatch:e?()=>{}:void 0,chain:()=>this.createChain(r,e),can:()=>this.createCan(r),get commands(){return Object.fromEntries(Object.entries(t).map(([l,a])=>[l,(...c)=>a(...c)(o)]))}};return o}},hn={};st(hn,{blur:()=>Vr,clearContent:()=>_r,clearNodes:()=>Kr,command:()=>qr,createParagraphNear:()=>Ur,cut:()=>Xr,deleteCurrentNode:()=>Yr,deleteNode:()=>Zr,deleteRange:()=>Qr,deleteSelection:()=>Gr,enter:()=>ei,exitCode:()=>ti,extendMarkRange:()=>ri,first:()=>ii,focus:()=>oi,forEach:()=>li,insertContent:()=>ai,insertContentAt:()=>ui,joinBackward:()=>pi,joinDown:()=>hi,joinForward:()=>mi,joinItemBackward:()=>gi,joinItemForward:()=>yi,joinTextblockBackward:()=>wi,joinTextblockForward:()=>ki,joinUp:()=>di,keyboardShortcut:()=>vi,lift:()=>Si,liftEmptyBlock:()=>bi,liftListItem:()=>Mi,newlineInCode:()=>Ei,resetAttributes:()=>Ci,scrollIntoView:()=>Ti,selectAll:()=>Ai,selectNodeBackward:()=>Ni,selectNodeForward:()=>Ri,selectParentNode:()=>Ii,selectTextblockEnd:()=>zi,selectTextblockStart:()=>Oi,setContent:()=>$i,setMark:()=>Qi,setMeta:()=>Gi,setNode:()=>es,setNodeSelection:()=>ts,setTextDirection:()=>ns,setTextSelection:()=>rs,sinkListItem:()=>is,splitBlock:()=>ss,splitListItem:()=>ls,toggleList:()=>as,toggleMark:()=>cs,toggleNode:()=>fs,toggleWrap:()=>us,undoInputRule:()=>ds,unsetAllMarks:()=>hs,unsetMark:()=>ps,unsetTextDirection:()=>ms,updateAttributes:()=>gs,wrapIn:()=>ys,wrapInList:()=>ws});var Vr=()=>({editor:r,view:e})=>(requestAnimationFrame(()=>{var t;r.isDestroyed||(e.dom.blur(),(t=window==null?void 0:window.getSelection())==null||t.removeAllRanges())}),!0),_r=(r=!0)=>({commands:e})=>e.setContent("",{emitUpdate:r}),Kr=()=>({state:r,tr:e,dispatch:t})=>{const{selection:n}=e,{ranges:i}=n;return t&&i.forEach(({$from:s,$to:o})=>{r.doc.nodesBetween(s.pos,o.pos,(l,a)=>{if(l.type.isText)return;const{doc:c,mapping:f}=e,u=c.resolve(f.map(a)),d=c.resolve(f.map(a+l.nodeSize)),h=u.blockRange(d);if(!h)return;const p=se(h);if(l.type.isTextblock){const{defaultType:m}=u.parent.contentMatchAt(u.index());e.setNodeMarkup(h.start,m)}(p||p===0)&&e.lift(h,p)})}),!0},qr=r=>e=>r(e),Ur=()=>({state:r,dispatch:e})=>an(r,e),Xr=(r,e)=>({editor:t,tr:n})=>{const{state:i}=t,s=i.doc.slice(r.from,r.to);n.deleteRange(r.from,r.to);const o=n.mapping.map(e);return n.insert(o,s.content),n.setSelection(new v.TextSelection(n.doc.resolve(Math.max(o-1,0)))),!0},Yr=()=>({tr:r,dispatch:e})=>{const{selection:t}=r,n=t.$anchor.node();if(n.content.size>0)return!1;const i=r.selection.$anchor;for(let s=i.depth;s>0;s-=1)if(i.node(s).type===n.type){if(e){const l=i.before(s),a=i.after(s);r.delete(l,a).scrollIntoView()}return!0}return!1};function I(r,e){if(typeof r=="string"){if(!e.nodes[r])throw Error(`There is no node type named '${r}'. Maybe you forgot to add the extension?`);return e.nodes[r]}return r}var Zr=r=>({tr:e,state:t,dispatch:n})=>{const i=I(r,t.schema),s=e.selection.$anchor;for(let o=s.depth;o>0;o-=1)if(s.node(o).type===i){if(n){const a=s.before(o),c=s.after(o);e.delete(a,c).scrollIntoView()}return!0}return!1},Qr=r=>({tr:e,dispatch:t})=>{const{from:n,to:i}=r;return t&&e.delete(n,i),!0},Gr=()=>({state:r,dispatch:e})=>Ne(r,e),ei=()=>({commands:r})=>r.keyboardShortcut("Enter"),ti=()=>({state:r,dispatch:e})=>Tr(r,e);function ni(r){return Object.prototype.toString.call(r)==="[object RegExp]"}function Ee(r,e,t={strict:!0}){const n=Object.keys(e);return n.length?n.every(i=>t.strict?e[i]===r[i]:ni(e[i])?e[i].test(r[i]):e[i]===r[i]):!0}function pn(r,e,t={}){return r.find(n=>n.type===e&&Ee(Object.fromEntries(Object.keys(t).map(i=>[i,n.attrs[i]])),t))}function At(r,e,t={}){return!!pn(r,e,t)}function ot(r,e,t){var n;if(!r||!e)return;let i=r.parent.childAfter(r.parentOffset);if((!i.node||!i.node.marks.some(f=>f.type===e))&&(i=r.parent.childBefore(r.parentOffset)),!i.node||!i.node.marks.some(f=>f.type===e)||(t=t||((n=i.node.marks[0])==null?void 0:n.attrs),!pn([...i.node.marks],e,t)))return;let o=i.index,l=r.start()+i.offset,a=o+1,c=l+i.node.nodeSize;for(;o>0&&At([...r.parent.child(o-1).marks],e,t);)o-=1,l-=r.parent.child(o).nodeSize;for(;a<r.parent.childCount&&At([...r.parent.child(a).marks],e,t);)c+=r.parent.child(a).nodeSize,a+=1;return{from:l,to:c}}function Z(r,e){if(typeof r=="string"){if(!e.marks[r])throw Error(`There is no mark type named '${r}'. Maybe you forgot to add the extension?`);return e.marks[r]}return r}var ri=(r,e={})=>({tr:t,state:n,dispatch:i})=>{const s=Z(r,n.schema),{doc:o,selection:l}=t,{$from:a,from:c,to:f}=l;if(i){const u=ot(a,s,e);if(u&&u.from<=c&&u.to>=f){const d=v.TextSelection.create(o,u.from,u.to);t.setSelection(d)}}return!0},ii=r=>e=>{const t=typeof r=="function"?r(e):r;for(let n=0;n<t.length;n+=1)if(t[n](e))return!0;return!1};function lt(r){return r instanceof v.TextSelection}function V(r=0,e=0,t=0){return Math.min(Math.max(r,e),t)}function si(r,e=null){if(!e)return null;const t=v.Selection.atStart(r),n=v.Selection.atEnd(r);if(e==="start"||e===!0)return t;if(e==="end")return n;const i=t.from,s=n.to;return e==="all"?v.TextSelection.create(r,V(0,i,s),V(r.content.size,i,s)):v.TextSelection.create(r,V(e,i,s),V(e,i,s))}function mn(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}function Re(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}var oi=(r=null,e={})=>({editor:t,view:n,tr:i,dispatch:s})=>{e={scrollIntoView:!0,...e};const o=()=>{(Re()||mn())&&n.dom.focus(),requestAnimationFrame(()=>{t.isDestroyed||(n.focus(),e!=null&&e.scrollIntoView&&t.commands.scrollIntoView())})};if(n.hasFocus()&&r===null||r===!1)return!0;if(s&&r===null&&!lt(t.state.selection))return o(),!0;const l=si(i.doc,r)||t.state.selection,a=t.state.selection.eq(l);return s&&(a||i.setSelection(l),a&&i.storedMarks&&i.setStoredMarks(i.storedMarks),o()),!0},li=(r,e)=>t=>r.every((n,i)=>e(n,{...t,index:i})),ai=(r,e)=>({tr:t,commands:n})=>n.insertContentAt({from:t.selection.from,to:t.selection.to},r,e),gn=r=>{const e=r.childNodes;for(let t=e.length-1;t>=0;t-=1){const n=e[t];n.nodeType===3&&n.nodeValue&&/^(\n\s\s|\n)$/.test(n.nodeValue)?r.removeChild(n):n.nodeType===1&&gn(n)}return r};function ke(r){if(typeof window>"u")throw new Error("[tiptap error]: there is no window object available, so this function cannot be used");const e=`<body>${r}</body>`,t=new window.DOMParser().parseFromString(e,"text/html").body;return gn(t)}function de(r,e,t){if(r instanceof D.Node||r instanceof D.Fragment)return r;t={slice:!0,parseOptions:{},...t};const n=typeof r=="object"&&r!==null,i=typeof r=="string";if(n)try{if(Array.isArray(r)&&r.length>0)return D.Fragment.fromArray(r.map(l=>e.nodeFromJSON(l)));const o=e.nodeFromJSON(r);return t.errorOnInvalidContent&&o.check(),o}catch(s){if(t.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:s});return console.warn("[tiptap warn]: Invalid content.","Passed value:",r,"Error:",s),de("",e,t)}if(i){if(t.errorOnInvalidContent){let o=!1,l="";const a=new D.Schema({topNode:e.spec.topNode,marks:e.spec.marks,nodes:e.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:c=>(o=!0,l=typeof c=="string"?c:c.outerHTML,null)}]}})});if(t.slice?D.DOMParser.fromSchema(a).parseSlice(ke(r),t.parseOptions):D.DOMParser.fromSchema(a).parse(ke(r),t.parseOptions),t.errorOnInvalidContent&&o)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${l}`)})}const s=D.DOMParser.fromSchema(e);return t.slice?s.parseSlice(ke(r),t.parseOptions).content:s.parse(ke(r),t.parseOptions)}return de("",e,t)}function ci(r,e,t){const n=r.steps.length-1;if(n<e)return;const i=r.steps[n];if(!(i instanceof N||i instanceof R))return;const s=r.mapping.maps[n];let o=0;s.forEach((l,a,c,f)=>{o===0&&(o=f)}),r.setSelection(v.Selection.near(r.doc.resolve(o),t))}var fi=r=>!("type"in r),ui=(r,e,t)=>({tr:n,dispatch:i,editor:s})=>{var o;if(i){t={parseOptions:s.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...t};let l;const a=g=>{s.emit("contentError",{editor:s,error:g,disableCollaboration:()=>{"collaboration"in s.storage&&typeof s.storage.collaboration=="object"&&s.storage.collaboration&&(s.storage.collaboration.isDisabled=!0)}})},c={preserveWhitespace:"full",...t.parseOptions};if(!t.errorOnInvalidContent&&!s.options.enableContentCheck&&s.options.emitContentError)try{de(e,s.schema,{parseOptions:c,errorOnInvalidContent:!0})}catch(g){a(g)}try{l=de(e,s.schema,{parseOptions:c,errorOnInvalidContent:(o=t.errorOnInvalidContent)!=null?o:s.options.enableContentCheck})}catch(g){return a(g),!1}let{from:f,to:u}=typeof r=="number"?{from:r,to:r}:{from:r.from,to:r.to},d=!0,h=!0;if((fi(l)?l:[l]).forEach(g=>{g.check(),d=d?g.isText&&g.marks.length===0:!1,h=h?g.isBlock:!1}),f===u&&h){const{parent:g}=n.doc.resolve(f);g.isTextblock&&!g.type.spec.code&&!g.childCount&&(f-=1,u+=1)}let m;if(d){if(Array.isArray(e))m=e.map(g=>g.text||"").join("");else if(e instanceof D.Fragment){let g="";e.forEach(y=>{y.text&&(g+=y.text)}),m=g}else typeof e=="object"&&e&&e.text?m=e.text:m=e;n.insertText(m,f,u)}else{m=l;const g=n.doc.resolve(f),y=g.node(),x=g.parentOffset===0,S=y.isText||y.isTextblock,M=y.content.size>0;x&&S&&M&&(f=Math.max(0,f-1)),n.replaceWith(f,u,m)}t.updateSelection&&ci(n,n.steps.length-1,-1),t.applyInputRules&&n.setMeta("applyInputRules",{from:f,text:m}),t.applyPasteRules&&n.setMeta("applyPasteRules",{from:f,text:m})}return!0},di=()=>({state:r,dispatch:e})=>Mr(r,e),hi=()=>({state:r,dispatch:e})=>Er(r,e),pi=()=>({state:r,dispatch:e})=>en(r,e),mi=()=>({state:r,dispatch:e})=>sn(r,e),gi=()=>({state:r,dispatch:e,tr:t})=>{try{const n=Ce(r.doc,r.selection.$from.pos,-1);return n==null?!1:(t.join(n,2),e&&e(t),!0)}catch{return!1}},yi=()=>({state:r,dispatch:e,tr:t})=>{try{const n=Ce(r.doc,r.selection.$from.pos,1);return n==null?!1:(t.join(n,2),e&&e(t),!0)}catch{return!1}},wi=()=>({state:r,dispatch:e})=>Sr(r,e),ki=()=>({state:r,dispatch:e})=>br(r,e);function yn(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function xi(r){const e=r.split(/-(?!$)/);let t=e[e.length-1];t==="Space"&&(t=" ");let n,i,s,o;for(let l=0;l<e.length-1;l+=1){const a=e[l];if(/^(cmd|meta|m)$/i.test(a))o=!0;else if(/^a(lt)?$/i.test(a))n=!0;else if(/^(c|ctrl|control)$/i.test(a))i=!0;else if(/^s(hift)?$/i.test(a))s=!0;else if(/^mod$/i.test(a))Re()||yn()?o=!0:i=!0;else throw new Error(`Unrecognized modifier name: ${a}`)}return n&&(t=`Alt-${t}`),i&&(t=`Ctrl-${t}`),o&&(t=`Meta-${t}`),s&&(t=`Shift-${t}`),t}var vi=r=>({editor:e,view:t,tr:n,dispatch:i})=>{const s=xi(r).split(/-(?!$)/),o=s.find(c=>!["Alt","Ctrl","Meta","Shift"].includes(c)),l=new KeyboardEvent("keydown",{key:o==="Space"?" ":o,altKey:s.includes("Alt"),ctrlKey:s.includes("Ctrl"),metaKey:s.includes("Meta"),shiftKey:s.includes("Shift"),bubbles:!0,cancelable:!0}),a=e.captureTransaction(()=>{t.someProp("handleKeyDown",c=>c(t,l))});return a==null||a.steps.forEach(c=>{const f=c.map(n.mapping);f&&i&&n.maybeStep(f)}),!0};function re(r,e,t={}){const{from:n,to:i,empty:s}=r.selection,o=e?I(e,r.schema):null,l=[];r.doc.nodesBetween(n,i,(u,d)=>{if(u.isText)return;const h=Math.max(n,d),p=Math.min(i,d+u.nodeSize);l.push({node:u,from:h,to:p})});const a=i-n,c=l.filter(u=>o?o.name===u.node.type.name:!0).filter(u=>Ee(u.node.attrs,t,{strict:!1}));return s?!!c.length:c.reduce((u,d)=>u+d.to-d.from,0)>=a}var Si=(r,e={})=>({state:t,dispatch:n})=>{const i=I(r,t.schema);return re(t,i,e)?Cr(t,n):!1},bi=()=>({state:r,dispatch:e})=>cn(r,e),Mi=r=>({state:e,dispatch:t})=>{const n=I(r,e.schema);return Fr(n)(e,t)},Ei=()=>({state:r,dispatch:e})=>ln(r,e);function Ie(r,e){return e.nodes[r]?"node":e.marks[r]?"mark":null}function Nt(r,e){const t=typeof e=="string"?[e]:e;return Object.keys(r).reduce((n,i)=>(t.includes(i)||(n[i]=r[i]),n),{})}var Ci=(r,e)=>({tr:t,state:n,dispatch:i})=>{let s=null,o=null;const l=Ie(typeof r=="string"?r:r.name,n.schema);if(!l)return!1;l==="node"&&(s=I(r,n.schema)),l==="mark"&&(o=Z(r,n.schema));let a=!1;return t.selection.ranges.forEach(c=>{n.doc.nodesBetween(c.$from.pos,c.$to.pos,(f,u)=>{s&&s===f.type&&(a=!0,i&&t.setNodeMarkup(u,void 0,Nt(f.attrs,e))),o&&f.marks.length&&f.marks.forEach(d=>{o===d.type&&(a=!0,i&&t.addMark(u,u+f.nodeSize,o.create(Nt(d.attrs,e))))})})}),a},Ti=()=>({tr:r,dispatch:e})=>(e&&r.scrollIntoView(),!0),Ai=()=>({tr:r,dispatch:e})=>{if(e){const t=new v.AllSelection(r.doc);r.setSelection(t)}return!0},Ni=()=>({state:r,dispatch:e})=>nn(r,e),Ri=()=>({state:r,dispatch:e})=>on(r,e),Ii=()=>({state:r,dispatch:e})=>Rr(r,e),zi=()=>({state:r,dispatch:e})=>Or(r,e),Oi=()=>({state:r,dispatch:e})=>zr(r,e);function Pi(r,e,t={},n={}){return de(r,e,{slice:!1,parseOptions:t,errorOnInvalidContent:n.errorOnInvalidContent})}var $i=(r,{errorOnInvalidContent:e,emitUpdate:t=!0,parseOptions:n={}}={})=>({editor:i,tr:s,dispatch:o,commands:l})=>{const{doc:a}=s;if(n.preserveWhitespace!=="full"){const c=Pi(r,i.schema,n,{errorOnInvalidContent:e??i.options.enableContentCheck});return o&&s.replaceWith(0,a.content.size,c).setMeta("preventUpdate",!t),!0}return o&&s.setMeta("preventUpdate",!t),l.insertContentAt({from:0,to:a.content.size},r,{parseOptions:n,errorOnInvalidContent:e??i.options.enableContentCheck})};function wn(r,e){const t=Z(e,r.schema),{from:n,to:i,empty:s}=r.selection,o=[];s?(r.storedMarks&&o.push(...r.storedMarks),o.push(...r.selection.$head.marks())):r.doc.nodesBetween(n,i,a=>{o.push(...a.marks)});const l=o.find(a=>a.type.name===t.name);return l?{...l.attrs}:{}}function kn(r,e){const t=new Xt(r);return e.forEach(n=>{n.steps.forEach(i=>{t.step(i)})}),t}function Bi(r){for(let e=0;e<r.edgeCount;e+=1){const{type:t}=r.edge(e);if(t.isTextblock&&!t.hasRequiredAttrs())return t}return null}function Di(r,e,t){const n=[];return r.nodesBetween(e.from,e.to,(i,s)=>{t(i)&&n.push({node:i,pos:s})}),n}function xn(r,e){for(let t=r.depth;t>0;t-=1){const n=r.node(t);if(e(n))return{pos:t>0?r.before(t):0,start:r.start(t),depth:t,node:n}}}function he(r){return e=>xn(e.$from,r)}function ie(r,e,t){return r.config[e]===void 0&&r.parent?ie(r.parent,e,t):typeof r.config[e]=="function"?r.config[e].bind({...t,parent:r.parent?ie(r.parent,e,t):null}):r.config[e]}function Fi(r){return typeof r=="function"}function J(r,e=void 0,...t){return Fi(r)?e?r.bind(e)(...t):r(...t):r}function vn(r){const e=r.filter(i=>i.type==="extension"),t=r.filter(i=>i.type==="node"),n=r.filter(i=>i.type==="mark");return{baseExtensions:e,nodeExtensions:t,markExtensions:n}}function Sn(...r){return r.filter(e=>!!e).reduce((e,t)=>{const n={...e};return Object.entries(t).forEach(([i,s])=>{if(!n[i]){n[i]=s;return}if(i==="class"){const l=s?String(s).split(" "):[],a=n[i]?n[i].split(" "):[],c=l.filter(f=>!a.includes(f));n[i]=[...a,...c].join(" ")}else if(i==="style"){const l=s?s.split(";").map(f=>f.trim()).filter(Boolean):[],a=n[i]?n[i].split(";").map(f=>f.trim()).filter(Boolean):[],c=new Map;a.forEach(f=>{const[u,d]=f.split(":").map(h=>h.trim());c.set(u,d)}),l.forEach(f=>{const[u,d]=f.split(":").map(h=>h.trim());c.set(u,d)}),n[i]=Array.from(c.entries()).map(([f,u])=>`${f}: ${u}`).join("; ")}else n[i]=s}),n},{})}function Li(r,e){return e.filter(t=>t.type===r.type.name).filter(t=>t.attribute.rendered).map(t=>t.attribute.renderHTML?t.attribute.renderHTML(r.attrs)||{}:{[t.name]:r.attrs[t.name]}).reduce((t,n)=>Sn(t,n),{})}function bn(r,e,t){const{from:n,to:i}=e,{blockSeparator:s=`
|
|
6
|
-
|
|
7
|
-
`,textSerializers:o={}}=t||{};let l="";return r.nodesBetween(n,i,(a,c,f,u)=>{var d;a.isBlock&&c>n&&(l+=s);const h=o==null?void 0:o[a.type.name];if(h)return f&&(l+=h({node:a,pos:c,parent:f,index:u,range:e})),!1;a.isText&&(l+=(d=a==null?void 0:a.text)==null?void 0:d.slice(Math.max(n,c)-c,i-c))}),l}function Wi(r,e){const t={from:0,to:r.content.size};return bn(r,t,e)}function Mn(r){return Object.fromEntries(Object.entries(r.nodes).filter(([,e])=>e.spec.toText).map(([e,t])=>[e,t.spec.toText]))}function Ji(r,e){const t=I(e,r.schema),{from:n,to:i}=r.selection,s=[];r.doc.nodesBetween(n,i,l=>{s.push(l)});const o=s.reverse().find(l=>l.type.name===t.name);return o?{...o.attrs}:{}}function ji(r,e){const t=Ie(typeof e=="string"?e:e.name,r.schema);return t==="node"?Ji(r,e):t==="mark"?wn(r,e):{}}function Hi(r,e=JSON.stringify){const t={};return r.filter(n=>{const i=e(n);return Object.prototype.hasOwnProperty.call(t,i)?!1:t[i]=!0})}function Vi(r){const e=Hi(r);return e.length===1?e:e.filter((t,n)=>!e.filter((s,o)=>o!==n).some(s=>t.oldRange.from>=s.oldRange.from&&t.oldRange.to<=s.oldRange.to&&t.newRange.from>=s.newRange.from&&t.newRange.to<=s.newRange.to))}function En(r){const{mapping:e,steps:t}=r,n=[];return e.maps.forEach((i,s)=>{const o=[];if(i.ranges.length)i.forEach((l,a)=>{o.push({from:l,to:a})});else{const{from:l,to:a}=t[s];if(l===void 0||a===void 0)return;o.push({from:l,to:a})}o.forEach(({from:l,to:a})=>{const c=e.slice(s).map(l,-1),f=e.slice(s).map(a),u=e.invert().map(c,-1),d=e.invert().map(f);n.push({oldRange:{from:u,to:d},newRange:{from:c,to:f}})})}),Vi(n)}function at(r,e,t){const n=[];return r===e?t.resolve(r).marks().forEach(i=>{const s=t.resolve(r),o=ot(s,i.type);o&&n.push({mark:i,...o})}):t.nodesBetween(r,e,(i,s)=>{!i||(i==null?void 0:i.nodeSize)===void 0||n.push(...i.marks.map(o=>({from:s,to:s+i.nodeSize,mark:o})))}),n}var _i=(r,e,t,n=20)=>{const i=r.doc.resolve(t);let s=n,o=null;for(;s>0&&o===null;){const l=i.node(s);(l==null?void 0:l.type.name)===e?o=l:s-=1}return[o,s]};function be(r,e,t){return Object.fromEntries(Object.entries(t).filter(([n])=>{const i=r.find(s=>s.type===e&&s.name===n);return i?i.attribute.keepOnSplit:!1}))}function qe(r,e,t={}){const{empty:n,ranges:i}=r.selection,s=e?Z(e,r.schema):null;if(n)return!!(r.storedMarks||r.selection.$from.marks()).filter(u=>s?s.name===u.type.name:!0).find(u=>Ee(u.attrs,t,{strict:!1}));let o=0;const l=[];if(i.forEach(({$from:u,$to:d})=>{const h=u.pos,p=d.pos;r.doc.nodesBetween(h,p,(m,g)=>{if(!m.isText&&!m.marks.length)return;const y=Math.max(h,g),x=Math.min(p,g+m.nodeSize),S=x-y;o+=S,l.push(...m.marks.map(M=>({mark:M,from:y,to:x})))})}),o===0)return!1;const a=l.filter(u=>s?s.name===u.mark.type.name:!0).filter(u=>Ee(u.mark.attrs,t,{strict:!1})).reduce((u,d)=>u+d.to-d.from,0),c=l.filter(u=>s?u.mark.type!==s&&u.mark.type.excludes(s):!0).reduce((u,d)=>u+d.to-d.from,0);return(a>0?a+c:a)>=o}function Ki(r,e,t={}){if(!e)return re(r,null,t)||qe(r,null,t);const n=Ie(e,r.schema);return n==="node"?re(r,e,t):n==="mark"?qe(r,e,t):!1}var qi=(r,e)=>{const{$from:t,$to:n,$anchor:i}=r.selection;if(e){const s=he(l=>l.type.name===e)(r.selection);if(!s)return!1;const o=r.doc.resolve(s.pos+1);return i.pos+1===o.end()}return!(n.parentOffset<n.parent.nodeSize-2||t.pos!==n.pos)},Ui=r=>{const{$from:e,$to:t}=r.selection;return!(e.parentOffset>0||e.pos!==t.pos)};function Ue(r,e){const{nodeExtensions:t}=vn(e),n=t.find(o=>o.name===r);if(!n)return!1;const i={name:n.name,options:n.options,storage:n.storage},s=J(ie(n,"group",i));return typeof s!="string"?!1:s.split(" ").includes("list")}function ct(r,{checkChildren:e=!0,ignoreWhitespace:t=!1}={}){var n;if(t){if(r.type.name==="hardBreak")return!0;if(r.isText)return/^\s*$/m.test((n=r.text)!=null?n:"")}if(r.isText)return!r.text;if(r.isAtom||r.isLeaf)return!1;if(r.content.childCount===0)return!0;if(e){let i=!0;return r.content.forEach(s=>{i!==!1&&(ct(s,{ignoreWhitespace:t,checkChildren:e})||(i=!1))}),i}return!1}function Xi(r){return r instanceof v.NodeSelection}function Yi(r,e,t){const i=r.state.doc.content.size,s=V(e,0,i),o=V(t,0,i),l=r.coordsAtPos(s),a=r.coordsAtPos(o,-1),c=Math.min(l.top,a.top),f=Math.max(l.bottom,a.bottom),u=Math.min(l.left,a.left),d=Math.max(l.right,a.right),h=d-u,p=f-c,y={top:c,bottom:f,left:u,right:d,width:h,height:p,x:u,y:c};return{...y,toJSON:()=>y}}function Zi(r,e,t){var n;const{selection:i}=e;let s=null;if(lt(i)&&(s=i.$cursor),s){const l=(n=r.storedMarks)!=null?n:s.marks();return s.parent.type.allowsMarkType(t)&&(!!t.isInSet(l)||!l.some(c=>c.type.excludes(t)))}const{ranges:o}=i;return o.some(({$from:l,$to:a})=>{let c=l.depth===0?r.doc.inlineContent&&r.doc.type.allowsMarkType(t):!1;return r.doc.nodesBetween(l.pos,a.pos,(f,u,d)=>{if(c)return!1;if(f.isInline){const h=!d||d.type.allowsMarkType(t),p=!!t.isInSet(f.marks)||!f.marks.some(m=>m.type.excludes(t));c=h&&p}return!c}),c})}var Qi=(r,e={})=>({tr:t,state:n,dispatch:i})=>{const{selection:s}=t,{empty:o,ranges:l}=s,a=Z(r,n.schema);if(i)if(o){const c=wn(n,a);t.addStoredMark(a.create({...c,...e}))}else l.forEach(c=>{const f=c.$from.pos,u=c.$to.pos;n.doc.nodesBetween(f,u,(d,h)=>{const p=Math.max(h,f),m=Math.min(h+d.nodeSize,u);d.marks.find(y=>y.type===a)?d.marks.forEach(y=>{a===y.type&&t.addMark(p,m,a.create({...y.attrs,...e}))}):t.addMark(p,m,a.create(e))})});return Zi(n,t,a)},Gi=(r,e)=>({tr:t})=>(t.setMeta(r,e),!0),es=(r,e={})=>({state:t,dispatch:n,chain:i})=>{const s=I(r,t.schema);let o;return t.selection.$anchor.sameParent(t.selection.$head)&&(o=t.selection.$anchor.parent.attrs),s.isTextblock?i().command(({commands:l})=>Tt(s,{...o,...e})(t)?!0:l.clearNodes()).command(({state:l})=>Tt(s,{...o,...e})(l,n)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},ts=r=>({tr:e,dispatch:t})=>{if(t){const{doc:n}=e,i=V(r,0,n.content.size),s=v.NodeSelection.create(n,i);e.setSelection(s)}return!0},ns=(r,e)=>({tr:t,state:n,dispatch:i})=>{const{selection:s}=n;let o,l;return typeof e=="number"?(o=e,l=e):e&&"from"in e&&"to"in e?(o=e.from,l=e.to):(o=s.from,l=s.to),i&&t.doc.nodesBetween(o,l,(a,c)=>{a.isText||t.setNodeMarkup(c,void 0,{...a.attrs,dir:r})}),!0},rs=r=>({tr:e,dispatch:t})=>{if(t){const{doc:n}=e,{from:i,to:s}=typeof r=="number"?{from:r,to:r}:r,o=v.TextSelection.atStart(n).from,l=v.TextSelection.atEnd(n).to,a=V(i,o,l),c=V(s,o,l),f=v.TextSelection.create(n,a,c);e.setSelection(f)}return!0},is=r=>({state:e,dispatch:t})=>{const n=I(r,e.schema);return Jr(n)(e,t)};function Rt(r,e){const t=r.storedMarks||r.selection.$to.parentOffset&&r.selection.$from.marks();if(t){const n=t.filter(i=>e==null?void 0:e.includes(i.type.name));r.tr.ensureMarks(n)}}var ss=({keepMarks:r=!0}={})=>({tr:e,state:t,dispatch:n,editor:i})=>{const{selection:s,doc:o}=e,{$from:l,$to:a}=s,c=i.extensionManager.attributes,f=be(c,l.node().type.name,l.node().attrs);if(s instanceof v.NodeSelection&&s.node.isBlock)return!l.parentOffset||!_(o,l.pos)?!1:(n&&(r&&Rt(t,i.extensionManager.splittableMarks),e.split(l.pos).scrollIntoView()),!0);if(!l.parent.isBlock)return!1;const u=a.parentOffset===a.parent.content.size,d=l.depth===0?void 0:Bi(l.node(-1).contentMatchAt(l.indexAfter(-1)));let h=u&&d?[{type:d,attrs:f}]:void 0,p=_(e.doc,e.mapping.map(l.pos),1,h);if(!h&&!p&&_(e.doc,e.mapping.map(l.pos),1,d?[{type:d}]:void 0)&&(p=!0,h=d?[{type:d,attrs:f}]:void 0),n){if(p&&(s instanceof v.TextSelection&&e.deleteSelection(),e.split(e.mapping.map(l.pos),1,h),d&&!u&&!l.parentOffset&&l.parent.type!==d)){const m=e.mapping.map(l.before()),g=e.doc.resolve(m);l.node(-1).canReplaceWith(g.index(),g.index()+1,d)&&e.setNodeMarkup(e.mapping.map(l.before()),d)}r&&Rt(t,i.extensionManager.splittableMarks),e.scrollIntoView()}return p},ls=(r,e={})=>({tr:t,state:n,dispatch:i,editor:s})=>{var o;const l=I(r,n.schema),{$from:a,$to:c}=n.selection,f=n.selection.node;if(f&&f.isBlock||a.depth<2||!a.sameParent(c))return!1;const u=a.node(-1);if(u.type!==l)return!1;const d=s.extensionManager.attributes;if(a.parent.content.size===0&&a.node(-1).childCount===a.indexAfter(-1)){if(a.depth===2||a.node(-3).type!==l||a.index(-2)!==a.node(-2).childCount-1)return!1;if(i){let y=D.Fragment.empty;const x=a.index(-1)?1:a.index(-2)?2:3;for(let B=a.depth-x;B>=a.depth-3;B-=1)y=D.Fragment.from(a.node(B).copy(y));const S=a.indexAfter(-1)<a.node(-2).childCount?1:a.indexAfter(-2)<a.node(-3).childCount?2:3,M={...be(d,a.node().type.name,a.node().attrs),...e},b=((o=l.contentMatch.defaultType)==null?void 0:o.createAndFill(M))||void 0;y=y.append(D.Fragment.from(l.createAndFill(null,b)||void 0));const A=a.before(a.depth-(x-1));t.replace(A,a.after(-S),new D.Slice(y,4-x,0));let z=-1;t.doc.nodesBetween(A,t.doc.content.size,(B,K)=>{if(z>-1)return!1;B.isTextblock&&B.content.size===0&&(z=K+1)}),z>-1&&t.setSelection(v.TextSelection.near(t.doc.resolve(z))),t.scrollIntoView()}return!0}const h=c.pos===a.end()?u.contentMatchAt(0).defaultType:null,p={...be(d,u.type.name,u.attrs),...e},m={...be(d,a.node().type.name,a.node().attrs),...e};t.delete(a.pos,c.pos);const g=h?[{type:l,attrs:p},{type:h,attrs:m}]:[{type:l,attrs:p}];if(!_(t.doc,a.pos,2))return!1;if(i){const{selection:y,storedMarks:x}=n,{splittableMarks:S}=s.extensionManager,M=x||y.$to.parentOffset&&y.$from.marks();if(t.split(a.pos,2,g).scrollIntoView(),!M||!i)return!0;const b=M.filter(A=>S.includes(A.type.name));t.ensureMarks(b)}return!0},Le=(r,e)=>{const t=he(o=>o.type===e)(r.selection);if(!t)return!0;const n=r.doc.resolve(Math.max(0,t.pos-1)).before(t.depth);if(n===void 0)return!0;const i=r.doc.nodeAt(n);return t.node.type===(i==null?void 0:i.type)&&Y(r.doc,t.pos)&&r.join(t.pos),!0},We=(r,e)=>{const t=he(o=>o.type===e)(r.selection);if(!t)return!0;const n=r.doc.resolve(t.start).after(t.depth);if(n===void 0)return!0;const i=r.doc.nodeAt(n);return t.node.type===(i==null?void 0:i.type)&&Y(r.doc,n)&&r.join(n),!0},as=(r,e,t,n={})=>({editor:i,tr:s,state:o,dispatch:l,chain:a,commands:c,can:f})=>{const{extensions:u,splittableMarks:d}=i.extensionManager,h=I(r,o.schema),p=I(e,o.schema),{selection:m,storedMarks:g}=o,{$from:y,$to:x}=m,S=y.blockRange(x),M=g||m.$to.parentOffset&&m.$from.marks();if(!S)return!1;const b=he(A=>Ue(A.type.name,u))(m);if(S.depth>=1&&b&&S.depth-b.depth<=1){if(b.node.type===h)return c.liftListItem(p);if(Ue(b.node.type.name,u)&&h.validContent(b.node.content)&&l)return a().command(()=>(s.setNodeMarkup(b.pos,h),!0)).command(()=>Le(s,h)).command(()=>We(s,h)).run()}return!t||!M||!l?a().command(()=>f().wrapInList(h,n)?!0:c.clearNodes()).wrapInList(h,n).command(()=>Le(s,h)).command(()=>We(s,h)).run():a().command(()=>{const A=f().wrapInList(h,n),z=M.filter(B=>d.includes(B.type.name));return s.ensureMarks(z),A?!0:c.clearNodes()}).wrapInList(h,n).command(()=>Le(s,h)).command(()=>We(s,h)).run()},cs=(r,e={},t={})=>({state:n,commands:i})=>{const{extendEmptyMarkRange:s=!1}=t,o=Z(r,n.schema);return qe(n,o,e)?i.unsetMark(o,{extendEmptyMarkRange:s}):i.setMark(o,e)},fs=(r,e,t={})=>({state:n,commands:i})=>{const s=I(r,n.schema),o=I(e,n.schema),l=re(n,s,t);let a;return n.selection.$anchor.sameParent(n.selection.$head)&&(a=n.selection.$anchor.parent.attrs),l?i.setNode(o,a):i.setNode(s,{...a,...t})},us=(r,e={})=>({state:t,commands:n})=>{const i=I(r,t.schema);return re(t,i,e)?n.lift(i):n.wrapIn(i,e)},ds=()=>({state:r,dispatch:e})=>{const t=r.plugins;for(let n=0;n<t.length;n+=1){const i=t[n];let s;if(i.spec.isInputRules&&(s=i.getState(r))){if(e){const o=r.tr,l=s.transform;for(let a=l.steps.length-1;a>=0;a-=1)o.step(l.steps[a].invert(l.docs[a]));if(s.text){const a=o.doc.resolve(s.from).marks();o.replaceWith(s.from,s.to,r.schema.text(s.text,a))}else o.delete(s.from,s.to)}return!0}}return!1},hs=()=>({tr:r,dispatch:e})=>{const{selection:t}=r,{empty:n,ranges:i}=t;return n||e&&i.forEach(s=>{r.removeMark(s.$from.pos,s.$to.pos)}),!0},ps=(r,e={})=>({tr:t,state:n,dispatch:i})=>{var s;const{extendEmptyMarkRange:o=!1}=e,{selection:l}=t,a=Z(r,n.schema),{$from:c,empty:f,ranges:u}=l;if(!i)return!0;if(f&&o){let{from:d,to:h}=l;const p=(s=c.marks().find(g=>g.type===a))==null?void 0:s.attrs,m=ot(c,a,p);m&&(d=m.from,h=m.to),t.removeMark(d,h,a)}else u.forEach(d=>{t.removeMark(d.$from.pos,d.$to.pos,a)});return t.removeStoredMark(a),!0},ms=r=>({tr:e,state:t,dispatch:n})=>{const{selection:i}=t;let s,o;return typeof r=="number"?(s=r,o=r):r&&"from"in r&&"to"in r?(s=r.from,o=r.to):(s=i.from,o=i.to),n&&e.doc.nodesBetween(s,o,(l,a)=>{if(l.isText)return;const c={...l.attrs};delete c.dir,e.setNodeMarkup(a,void 0,c)}),!0},gs=(r,e={})=>({tr:t,state:n,dispatch:i})=>{let s=null,o=null;const l=Ie(typeof r=="string"?r:r.name,n.schema);if(!l)return!1;l==="node"&&(s=I(r,n.schema)),l==="mark"&&(o=Z(r,n.schema));let a=!1;return t.selection.ranges.forEach(c=>{const f=c.$from.pos,u=c.$to.pos;let d,h,p,m;t.selection.empty?n.doc.nodesBetween(f,u,(g,y)=>{s&&s===g.type&&(a=!0,p=Math.max(y,f),m=Math.min(y+g.nodeSize,u),d=y,h=g)}):n.doc.nodesBetween(f,u,(g,y)=>{y<f&&s&&s===g.type&&(a=!0,p=Math.max(y,f),m=Math.min(y+g.nodeSize,u),d=y,h=g),y>=f&&y<=u&&(s&&s===g.type&&(a=!0,i&&t.setNodeMarkup(y,void 0,{...g.attrs,...e})),o&&g.marks.length&&g.marks.forEach(x=>{if(o===x.type&&(a=!0,i)){const S=Math.max(y,f),M=Math.min(y+g.nodeSize,u);t.addMark(S,M,o.create({...x.attrs,...e}))}}))}),h&&(d!==void 0&&i&&t.setNodeMarkup(d,void 0,{...h.attrs,...e}),o&&h.marks.length&&h.marks.forEach(g=>{o===g.type&&i&&t.addMark(p,m,o.create({...g.attrs,...e}))}))}),a},ys=(r,e={})=>({state:t,dispatch:n})=>{const i=I(r,t.schema);return Pr(i,e)(t,n)},ws=(r,e={})=>({state:t,dispatch:n})=>{const i=I(r,t.schema);return $r(i,e)(t,n)},pe=class{constructor(r){var e;this.find=r.find,this.handler=r.handler,this.undoable=(e=r.undoable)!=null?e:!0}};function ks(r){return Object.prototype.toString.call(r).slice(8,-1)}function xe(r){return ks(r)!=="Object"?!1:r.constructor===Object&&Object.getPrototypeOf(r)===Object.prototype}function Cn(r,e){const t={...r};return xe(r)&&xe(e)&&Object.keys(e).forEach(n=>{xe(e[n])&&xe(r[n])?t[n]=Cn(r[n],e[n]):t[n]=e[n]}),t}var ft=class{constructor(r={}){this.type="extendable",this.parent=null,this.child=null,this.name="",this.config={name:this.name},this.config={...this.config,...r},this.name=this.config.name}get options(){return{...J(ie(this,"addOptions",{name:this.name}))||{}}}get storage(){return{...J(ie(this,"addStorage",{name:this.name,options:this.options}))||{}}}configure(r={}){const e=this.extend({...this.config,addOptions:()=>Cn(this.options,r)});return e.name=this.name,e.parent=this.parent,e}extend(r={}){const e=new this.constructor({...this.config,...r});return e.parent=this,this.child=e,e.name="name"in r?r.name:e.parent.name,e}},xs=class Tn extends ft{constructor(){super(...arguments),this.type="mark"}static create(e={}){const t=typeof e=="function"?e():e;return new Tn(t)}static handleExit({editor:e,mark:t}){const{tr:n}=e.state,i=e.state.selection.$from;if(i.pos===i.end()){const o=i.marks();if(!!!o.find(c=>(c==null?void 0:c.type.name)===t.name))return!1;const a=o.find(c=>(c==null?void 0:c.type.name)===t.name);return a&&n.removeStoredMark(a),n.insertText(" ",i.pos),e.view.dispatch(n),!0}return!1}configure(e){return super.configure(e)}extend(e){const t=typeof e=="function"?e():e;return super.extend(t)}};function vs(r){return typeof r=="number"}var ut=class{constructor(r){this.find=r.find,this.handler=r.handler}},Ss={};st(Ss,{ClipboardTextSerializer:()=>bs,Commands:()=>Ms,Delete:()=>Es,Drop:()=>Cs,Editable:()=>Ts,FocusEvents:()=>As,Keymap:()=>Ns,Paste:()=>Rs,Tabindex:()=>Is,TextDirection:()=>zs,focusEventsPluginKey:()=>Nn});var j=class An extends ft{constructor(){super(...arguments),this.type="extension"}static create(e={}){const t=typeof e=="function"?e():e;return new An(t)}configure(e){return super.configure(e)}extend(e){const t=typeof e=="function"?e():e;return super.extend(t)}},bs=j.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new v.Plugin({key:new v.PluginKey("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:r}=this,{state:e,schema:t}=r,{doc:n,selection:i}=e,{ranges:s}=i,o=Math.min(...s.map(f=>f.$from.pos)),l=Math.max(...s.map(f=>f.$to.pos)),a=Mn(t);return bn(n,{from:o,to:l},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:a})}}})]}}),Ms=j.create({name:"commands",addCommands(){return{...hn}}}),Es=j.create({name:"delete",onUpdate({transaction:r,appendedTransactions:e}){var t,n,i;const s=()=>{var o,l,a,c;if((c=(a=(l=(o=this.editor.options.coreExtensionOptions)==null?void 0:o.delete)==null?void 0:l.filterTransaction)==null?void 0:a.call(l,r))!=null?c:r.getMeta("y-sync$"))return;const f=kn(r.before,[r,...e]);En(f).forEach(h=>{f.mapping.mapResult(h.oldRange.from).deletedAfter&&f.mapping.mapResult(h.oldRange.to).deletedBefore&&f.before.nodesBetween(h.oldRange.from,h.oldRange.to,(p,m)=>{const g=m+p.nodeSize-2,y=h.oldRange.from<=m&&g<=h.oldRange.to;this.editor.emit("delete",{type:"node",node:p,from:m,to:g,newFrom:f.mapping.map(m),newTo:f.mapping.map(g),deletedRange:h.oldRange,newRange:h.newRange,partial:!y,editor:this.editor,transaction:r,combinedTransform:f})})});const d=f.mapping;f.steps.forEach((h,p)=>{var m,g;if(h instanceof W){const y=d.slice(p).map(h.from,-1),x=d.slice(p).map(h.to),S=d.invert().map(y,-1),M=d.invert().map(x),b=(m=f.doc.nodeAt(y-1))==null?void 0:m.marks.some(z=>z.eq(h.mark)),A=(g=f.doc.nodeAt(x))==null?void 0:g.marks.some(z=>z.eq(h.mark));this.editor.emit("delete",{type:"mark",mark:h.mark,from:h.from,to:h.to,deletedRange:{from:S,to:M},newRange:{from:y,to:x},partial:!!(A||b),editor:this.editor,transaction:r,combinedTransform:f})}})};(i=(n=(t=this.editor.options.coreExtensionOptions)==null?void 0:t.delete)==null?void 0:n.async)==null||i?setTimeout(s,0):s()}}),Cs=j.create({name:"drop",addProseMirrorPlugins(){return[new v.Plugin({key:new v.PluginKey("tiptapDrop"),props:{handleDrop:(r,e,t,n)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:t,moved:n})}}})]}}),Ts=j.create({name:"editable",addProseMirrorPlugins(){return[new v.Plugin({key:new v.PluginKey("editable"),props:{editable:()=>this.editor.options.editable}})]}}),Nn=new v.PluginKey("focusEvents"),As=j.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:r}=this;return[new v.Plugin({key:Nn,props:{handleDOMEvents:{focus:(e,t)=>{r.isFocused=!0;const n=r.state.tr.setMeta("focus",{event:t}).setMeta("addToHistory",!1);return e.dispatch(n),!1},blur:(e,t)=>{r.isFocused=!1;const n=r.state.tr.setMeta("blur",{event:t}).setMeta("addToHistory",!1);return e.dispatch(n),!1}}}})]}}),Ns=j.create({name:"keymap",addKeyboardShortcuts(){const r=()=>this.editor.commands.first(({commands:o})=>[()=>o.undoInputRule(),()=>o.command(({tr:l})=>{const{selection:a,doc:c}=l,{empty:f,$anchor:u}=a,{pos:d,parent:h}=u,p=u.parent.isTextblock&&d>0?l.doc.resolve(d-1):u,m=p.parent.type.spec.isolating,g=u.pos-u.parentOffset,y=m&&p.parent.childCount===1?g===u.pos:v.Selection.atStart(c).from===d;return!f||!h.type.isTextblock||h.textContent.length||!y||y&&u.parent.type.name==="paragraph"?!1:o.clearNodes()}),()=>o.deleteSelection(),()=>o.joinBackward(),()=>o.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:o})=>[()=>o.deleteSelection(),()=>o.deleteCurrentNode(),()=>o.joinForward(),()=>o.selectNodeForward()]),n={Enter:()=>this.editor.commands.first(({commands:o})=>[()=>o.newlineInCode(),()=>o.createParagraphNear(),()=>o.liftEmptyBlock(),()=>o.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:r,"Mod-Backspace":r,"Shift-Backspace":r,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},i={...n},s={...n,"Ctrl-h":r,"Alt-Backspace":r,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return Re()||yn()?s:i},addProseMirrorPlugins(){return[new v.Plugin({key:new v.PluginKey("clearDocument"),appendTransaction:(r,e,t)=>{if(r.some(m=>m.getMeta("composition")))return;const n=r.some(m=>m.docChanged)&&!e.doc.eq(t.doc),i=r.some(m=>m.getMeta("preventClearDocument"));if(!n||i)return;const{empty:s,from:o,to:l}=e.selection,a=v.Selection.atStart(e.doc).from,c=v.Selection.atEnd(e.doc).to;if(s||!(o===a&&l===c)||!ct(t.doc))return;const d=t.tr,h=dn({state:t,transaction:d}),{commands:p}=new Hr({editor:this.editor,state:h});if(p.clearNodes(),!!d.steps.length)return d}})]}}),Rs=j.create({name:"paste",addProseMirrorPlugins(){return[new v.Plugin({key:new v.PluginKey("tiptapPaste"),props:{handlePaste:(r,e,t)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:t})}}})]}}),Is=j.create({name:"tabindex",addProseMirrorPlugins(){return[new v.Plugin({key:new v.PluginKey("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}}),zs=j.create({name:"textDirection",addOptions(){return{direction:void 0}},addGlobalAttributes(){if(!this.options.direction)return[];const{nodeExtensions:r}=vn(this.extensions);return[{types:r.filter(e=>e.name!=="text").map(e=>e.name),attributes:{dir:{default:this.options.direction,parseHTML:e=>{const 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 v.Plugin({key:new v.PluginKey("textDirection"),props:{attributes:()=>{const r=this.options.direction;return r?{dir:r}:{}}}})]}});function Os(r){return new pe({find:r.find,handler:({state:e,range:t,match:n})=>{const i=J(r.getAttributes,void 0,n);if(i===!1||i===null)return null;const{tr:s}=e,o=n[n.length-1],l=n[0];if(o){const a=l.search(/\S/),c=t.from+l.indexOf(o),f=c+o.length;if(at(t.from,t.to,e.doc).filter(h=>h.mark.type.excluded.find(m=>m===r.type&&m!==h.mark.type)).filter(h=>h.to>c).length)return null;f<t.to&&s.delete(f,t.to),c>t.from&&s.delete(t.from+a,c);const d=t.from+a+o.length;s.addMark(t.from+a,d,r.type.create(i||{})),s.removeStoredMark(r.type)}},undoable:r.undoable})}function Ps(r){return new pe({find:r.find,handler:({state:e,range:t,match:n})=>{const i=J(r.getAttributes,void 0,n)||{},{tr:s}=e,o=t.from;let l=t.to;const a=r.type.create(i);if(n[1]){const c=n[0].lastIndexOf(n[1]);let f=o+c;f>l?f=l:l=f+n[1].length;const u=n[0][n[0].length-1];s.insertText(u,o+n[0].length-1),s.replaceWith(f,l,a)}else if(n[0]){const c=r.type.isInline?o:o-1;s.insert(c,r.type.create(i)).delete(s.mapping.map(o),s.mapping.map(l))}s.scrollIntoView()},undoable:r.undoable})}function $s(r){return new pe({find:r.find,handler:({state:e,range:t,match:n})=>{const i=e.doc.resolve(t.from),s=J(r.getAttributes,void 0,n)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),r.type))return null;e.tr.delete(t.from,t.to).setBlockType(t.from,t.from,r.type,s)},undoable:r.undoable})}function Bs(r){return new pe({find:r.find,handler:({state:e,range:t,match:n,chain:i})=>{const s=J(r.getAttributes,void 0,n)||{},o=e.tr.delete(t.from,t.to),a=o.doc.resolve(t.from).blockRange(),c=a&&Ge(a,r.type,s);if(!c)return null;if(o.wrap(a,c),r.keepMarks&&r.editor){const{selection:u,storedMarks:d}=e,{splittableMarks:h}=r.editor.extensionManager,p=d||u.$to.parentOffset&&u.$from.marks();if(p){const m=p.filter(g=>h.includes(g.type.name));o.ensureMarks(m)}}if(r.keepAttributes){const u=r.type.name==="bulletList"||r.type.name==="orderedList"?"listItem":"taskList";i().updateAttributes(u,s).run()}const f=o.doc.resolve(t.from-1).nodeBefore;f&&f.type===r.type&&Y(o.doc,t.from-1)&&(!r.joinPredicate||r.joinPredicate(n,f))&&o.join(t.from-1)},undoable:r.undoable})}var Ds=r=>"touches"in r,Fs=class{constructor(r){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=l=>{if(!this.isResizing||!this.activeHandle)return;const a=l.clientX-this.startX,c=l.clientY-this.startY;this.handleResize(a,c)},this.handleTouchMove=l=>{if(!this.isResizing||!this.activeHandle)return;const a=l.touches[0];if(!a)return;const c=a.clientX-this.startX,f=a.clientY-this.startY;this.handleResize(c,f)},this.handleMouseUp=()=>{if(!this.isResizing)return;const l=this.element.offsetWidth,a=this.element.offsetHeight;this.onCommit(l,a),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=l=>{l.key==="Shift"&&(this.isShiftKeyPressed=!0)},this.handleKeyUp=l=>{l.key==="Shift"&&(this.isShiftKeyPressed=!1)};var e,t,n,i,s,o;this.node=r.node,this.editor=r.editor,this.element=r.element,this.contentElement=r.contentElement,this.getPos=r.getPos,this.onResize=r.onResize,this.onCommit=r.onCommit,this.onUpdate=r.onUpdate,(e=r.options)!=null&&e.min&&(this.minSize={...this.minSize,...r.options.min}),(t=r.options)!=null&&t.max&&(this.maxSize=r.options.max),(n=r==null?void 0:r.options)!=null&&n.directions&&(this.directions=r.options.directions),(i=r.options)!=null&&i.preserveAspectRatio&&(this.preserveAspectRatio=r.options.preserveAspectRatio),(s=r.options)!=null&&s.className&&(this.classNames={container:r.options.className.container||"",wrapper:r.options.className.wrapper||"",handle:r.options.className.handle||"",resizing:r.options.className.resizing||""}),(o=r.options)!=null&&o.createCustomHandle&&(this.createCustomHandle=r.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}handleEditorUpdate(){const r=this.editor.isEditable;r!==this.lastEditableState&&(this.lastEditableState=r,r?r&&this.handleMap.size===0&&this.attachHandles():this.removeHandles())}update(r,e,t){return r.type!==this.node.type?!1:(this.node=r,this.onUpdate?this.onUpdate(r,e,t):!0)}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(){const r=document.createElement("div");return r.dataset.resizeContainer="",r.dataset.node=this.node.type.name,r.style.display="flex",this.classNames.container&&(r.className=this.classNames.container),r.appendChild(this.wrapper),r}createWrapper(){const r=document.createElement("div");return r.style.position="relative",r.style.display="block",r.dataset.resizeWrapper="",this.classNames.wrapper&&(r.className=this.classNames.wrapper),r.appendChild(this.element),r}createHandle(r){const e=document.createElement("div");return e.dataset.resizeHandle=r,e.style.position="absolute",this.classNames.handle&&(e.className=this.classNames.handle),e}positionHandle(r,e){const t=e.includes("top"),n=e.includes("bottom"),i=e.includes("left"),s=e.includes("right");t&&(r.style.top="0"),n&&(r.style.bottom="0"),i&&(r.style.left="0"),s&&(r.style.right="0"),(e==="top"||e==="bottom")&&(r.style.left="0",r.style.right="0"),(e==="left"||e==="right")&&(r.style.top="0",r.style.bottom="0")}attachHandles(){this.directions.forEach(r=>{let e;this.createCustomHandle?e=this.createCustomHandle(r):e=this.createHandle(r),e instanceof HTMLElement||(console.warn(`[ResizableNodeView] createCustomHandle("${r}") did not return an HTMLElement. Falling back to default handle.`),e=this.createHandle(r)),this.createCustomHandle||this.positionHandle(e,r),e.addEventListener("mousedown",t=>this.handleResizeStart(t,r)),e.addEventListener("touchstart",t=>this.handleResizeStart(t,r)),this.handleMap.set(r,e),this.wrapper.appendChild(e)})}removeHandles(){this.handleMap.forEach(r=>r.remove()),this.handleMap.clear()}applyInitialSize(){const r=this.node.attrs.width,e=this.node.attrs.height;r?(this.element.style.width=`${r}px`,this.initialWidth=r):this.initialWidth=this.element.offsetWidth,e?(this.element.style.height=`${e}px`,this.initialHeight=e):this.initialHeight=this.element.offsetHeight,this.initialWidth>0&&this.initialHeight>0&&(this.aspectRatio=this.initialWidth/this.initialHeight)}handleResizeStart(r,e){r.preventDefault(),r.stopPropagation(),this.isResizing=!0,this.activeHandle=e,Ds(r)?(this.startX=r.touches[0].clientX,this.startY=r.touches[0].clientY):(this.startX=r.clientX,this.startY=r.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(r,e){if(!this.activeHandle)return;const t=this.preserveAspectRatio||this.isShiftKeyPressed,{width:n,height:i}=this.calculateNewDimensions(this.activeHandle,r,e),s=this.applyConstraints(n,i,t);this.element.style.width=`${s.width}px`,this.element.style.height=`${s.height}px`,this.onResize&&this.onResize(s.width,s.height)}calculateNewDimensions(r,e,t){let n=this.startWidth,i=this.startHeight;const s=r.includes("right"),o=r.includes("left"),l=r.includes("bottom"),a=r.includes("top");return s?n=this.startWidth+e:o&&(n=this.startWidth-e),l?i=this.startHeight+t:a&&(i=this.startHeight-t),(r==="right"||r==="left")&&(n=this.startWidth+(s?e:-e)),(r==="top"||r==="bottom")&&(i=this.startHeight+(l?t:-t)),this.preserveAspectRatio||this.isShiftKeyPressed?this.applyAspectRatio(n,i,r):{width:n,height:i}}applyConstraints(r,e,t){var n,i,s,o;if(!t){let c=Math.max(this.minSize.width,r),f=Math.max(this.minSize.height,e);return(n=this.maxSize)!=null&&n.width&&(c=Math.min(this.maxSize.width,c)),(i=this.maxSize)!=null&&i.height&&(f=Math.min(this.maxSize.height,f)),{width:c,height:f}}let l=r,a=e;return l<this.minSize.width&&(l=this.minSize.width,a=l/this.aspectRatio),a<this.minSize.height&&(a=this.minSize.height,l=a*this.aspectRatio),(s=this.maxSize)!=null&&s.width&&l>this.maxSize.width&&(l=this.maxSize.width,a=l/this.aspectRatio),(o=this.maxSize)!=null&&o.height&&a>this.maxSize.height&&(a=this.maxSize.height,l=a*this.aspectRatio),{width:l,height:a}}applyAspectRatio(r,e,t){const n=t==="left"||t==="right",i=t==="top"||t==="bottom";return n?{width:r,height:r/this.aspectRatio}:i?{width:e*this.aspectRatio,height:e}:{width:r,height:r/this.aspectRatio}}};function Ls(r,e){const{selection:t}=r,{$from:n}=t;if(t instanceof v.NodeSelection){const s=n.index();return n.parent.canReplaceWith(s,s+1,e)}let i=n.depth;for(;i>=0;){const s=n.index(i);if(n.node(i).contentMatchAt(s).matchType(e))return!0;i-=1}return!1}function Ws(r){return r.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}var Js={};st(Js,{createAtomBlockMarkdownSpec:()=>js,createBlockMarkdownSpec:()=>Hs,createInlineMarkdownSpec:()=>Rn,parseAttributes:()=>dt,parseIndentedBlocks:()=>In,renderNestedMarkdownContent:()=>zn,serializeAttributes:()=>ht});function dt(r){if(!(r!=null&&r.trim()))return{};const e={},t=[],n=r.replace(/["']([^"']*)["']/g,c=>(t.push(c),`__QUOTED_${t.length-1}__`)),i=n.match(/(?:^|\s)\.([a-zA-Z][\w-]*)/g);if(i){const c=i.map(f=>f.trim().slice(1));e.class=c.join(" ")}const s=n.match(/(?:^|\s)#([a-zA-Z][\w-]*)/);s&&(e.id=s[1]);const o=/([a-zA-Z][\w-]*)\s*=\s*(__QUOTED_\d+__)/g;Array.from(n.matchAll(o)).forEach(([,c,f])=>{var u;const d=parseInt(((u=f.match(/__QUOTED_(\d+)__/))==null?void 0:u[1])||"0",10),h=t[d];h&&(e[c]=h.slice(1,-1))});const a=n.replace(/(?:^|\s)\.([a-zA-Z][\w-]*)/g,"").replace(/(?:^|\s)#([a-zA-Z][\w-]*)/g,"").replace(/([a-zA-Z][\w-]*)\s*=\s*__QUOTED_\d+__/g,"").trim();return a&&a.split(/\s+/).filter(Boolean).forEach(f=>{f.match(/^[a-zA-Z][\w-]*$/)&&(e[f]=!0)}),e}function ht(r){if(!r||Object.keys(r).length===0)return"";const e=[];return r.class&&String(r.class).split(/\s+/).filter(Boolean).forEach(n=>e.push(`.${n}`)),r.id&&e.push(`#${r.id}`),Object.entries(r).forEach(([t,n])=>{t==="class"||t==="id"||(n===!0?e.push(t):n!==!1&&n!=null&&e.push(`${t}="${String(n)}"`))}),e.join(" ")}function js(r){const{nodeName:e,name:t,parseAttributes:n=dt,serializeAttributes:i=ht,defaultAttributes:s={},requiredAttributes:o=[],allowedAttributes:l}=r,a=t||e,c=f=>{if(!l)return f;const u={};return l.forEach(d=>{d in f&&(u[d]=f[d])}),u};return{parseMarkdown:(f,u)=>{const d={...s,...f.attributes};return u.createNode(e,d,[])},markdownTokenizer:{name:e,level:"block",start(f){var u;const d=new RegExp(`^:::${a}(?:\\s|$)`,"m"),h=(u=f.match(d))==null?void 0:u.index;return h!==void 0?h:-1},tokenize(f,u,d){const h=new RegExp(`^:::${a}(?:\\s+\\{([^}]*)\\})?\\s*:::(?:\\n|$)`),p=f.match(h);if(!p)return;const m=p[1]||"",g=n(m);if(!o.find(x=>!(x in g)))return{type:e,raw:p[0],attributes:g}}},renderMarkdown:f=>{const u=c(f.attrs||{}),d=i(u),h=d?` {${d}}`:"";return`:::${a}${h} :::`}}}function Hs(r){const{nodeName:e,name:t,getContent:n,parseAttributes:i=dt,serializeAttributes:s=ht,defaultAttributes:o={},content:l="block",allowedAttributes:a}=r,c=t||e,f=u=>{if(!a)return u;const d={};return a.forEach(h=>{h in u&&(d[h]=u[h])}),d};return{parseMarkdown:(u,d)=>{let h;if(n){const m=n(u);h=typeof m=="string"?[{type:"text",text:m}]:m}else l==="block"?h=d.parseChildren(u.tokens||[]):h=d.parseInline(u.tokens||[]);const p={...o,...u.attributes};return d.createNode(e,p,h)},markdownTokenizer:{name:e,level:"block",start(u){var d;const h=new RegExp(`^:::${c}`,"m"),p=(d=u.match(h))==null?void 0:d.index;return p!==void 0?p:-1},tokenize(u,d,h){var p;const m=new RegExp(`^:::${c}(?:\\s+\\{([^}]*)\\})?\\s*\\n`),g=u.match(m);if(!g)return;const[y,x=""]=g,S=i(x);let M=1;const b=y.length;let A="";const z=/^:::([\w-]*)(\s.*)?/gm,B=u.slice(b);for(z.lastIndex=0;;){const K=z.exec(B);if(K===null)break;const me=K.index,Pn=K[1];if(!((p=K[2])!=null&&p.endsWith(":::"))){if(Pn)M+=1;else if(M-=1,M===0){const pt=B.slice(0,me);A=pt.trim();const $n=u.slice(0,b+me+K[0].length);let q=[];if(A)if(l==="block")for(q=h.blockTokens(pt),q.forEach(H=>{H.text&&(!H.tokens||H.tokens.length===0)&&(H.tokens=h.inlineTokens(H.text))});q.length>0;){const H=q[q.length-1];if(H.type==="paragraph"&&(!H.text||H.text.trim()===""))q.pop();else break}else q=h.inlineTokens(A);return{type:e,raw:$n,attributes:S,content:A,tokens:q}}}}}},renderMarkdown:(u,d)=>{const h=f(u.attrs||{}),p=s(h),m=p?` {${p}}`:"",g=d.renderChildren(u.content||[],`
|
|
8
|
-
|
|
9
|
-
`);return`:::${c}${m}
|
|
10
|
-
|
|
11
|
-
${g}
|
|
12
|
-
|
|
13
|
-
:::`}}}function Vs(r){if(!r.trim())return{};const e={},t=/(\w+)=(?:"([^"]*)"|'([^']*)')/g;let n=t.exec(r);for(;n!==null;){const[,i,s,o]=n;e[i]=s||o,n=t.exec(r)}return e}function _s(r){return Object.entries(r).filter(([,e])=>e!=null).map(([e,t])=>`${e}="${t}"`).join(" ")}function Rn(r){const{nodeName:e,name:t,getContent:n,parseAttributes:i=Vs,serializeAttributes:s=_s,defaultAttributes:o={},selfClosing:l=!1,allowedAttributes:a}=r,c=t||e,f=d=>{if(!a)return d;const h={};return a.forEach(p=>{const m=typeof p=="string"?p:p.name,g=typeof p=="string"?void 0:p.skipIfDefault;if(m in d){const y=d[m];if(g!==void 0&&y===g)return;h[m]=y}}),h},u=c.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return{parseMarkdown:(d,h)=>{const p={...o,...d.attributes};if(l)return h.createNode(e,p);const m=n?n(d):d.content||"";return m?h.createNode(e,p,[h.createTextNode(m)]):h.createNode(e,p,[])},markdownTokenizer:{name:e,level:"inline",start(d){const h=l?new RegExp(`\\[${u}\\s*[^\\]]*\\]`):new RegExp(`\\[${u}\\s*[^\\]]*\\][\\s\\S]*?\\[\\/${u}\\]`),p=d.match(h),m=p==null?void 0:p.index;return m!==void 0?m:-1},tokenize(d,h,p){const m=l?new RegExp(`^\\[${u}\\s*([^\\]]*)\\]`):new RegExp(`^\\[${u}\\s*([^\\]]*)\\]([\\s\\S]*?)\\[\\/${u}\\]`),g=d.match(m);if(!g)return;let y="",x="";if(l){const[,M]=g;x=M}else{const[,M,b]=g;x=M,y=b||""}const S=i(x.trim());return{type:e,raw:g[0],content:y.trim(),attributes:S}}},renderMarkdown:d=>{let h="";n?h=n(d):d.content&&d.content.length>0&&(h=d.content.filter(y=>y.type==="text").map(y=>y.text).join(""));const p=f(d.attrs||{}),m=s(p),g=m?` ${m}`:"";return l?`[${c}${g}]`:`[${c}${g}]${h}[/${c}]`}}}function In(r,e,t){var n,i,s,o;const l=r.split(`
|
|
14
|
-
`),a=[];let c="",f=0;const u=e.baseIndentSize||2;for(;f<l.length;){const d=l[f],h=d.match(e.itemPattern);if(!h){if(a.length>0)break;if(d.trim()===""){f+=1,c=`${c}${d}
|
|
15
|
-
`;continue}else return}const p=e.extractItemData(h),{indentLevel:m,mainContent:g}=p;c=`${c}${d}
|
|
16
|
-
`;const y=[g];for(f+=1;f<l.length;){const b=l[f];if(b.trim()===""){const z=l.slice(f+1).findIndex(me=>me.trim()!=="");if(z===-1)break;if((((i=(n=l[f+1+z].match(/^(\s*)/))==null?void 0:n[1])==null?void 0:i.length)||0)>m){y.push(b),c=`${c}${b}
|
|
17
|
-
`,f+=1;continue}else break}if((((o=(s=b.match(/^(\s*)/))==null?void 0:s[1])==null?void 0:o.length)||0)>m)y.push(b),c=`${c}${b}
|
|
18
|
-
`,f+=1;else break}let x;const S=y.slice(1);if(S.length>0){const b=S.map(A=>A.slice(m+u)).join(`
|
|
19
|
-
`);b.trim()&&(e.customNestedParser?x=e.customNestedParser(b):x=t.blockTokens(b))}const M=e.createToken(p,x);a.push(M)}if(a.length!==0)return{items:a,raw:c}}function zn(r,e,t,n){if(!r||!Array.isArray(r.content))return"";const i=typeof t=="function"?t(n):t,[s,...o]=r.content,l=e.renderChildren([s]),a=[`${i}${l}`];return o&&o.length>0&&o.forEach(c=>{const f=e.renderChildren([c]);if(f){const u=f.split(`
|
|
20
|
-
`).map(d=>d?e.indent(d):"").join(`
|
|
21
|
-
`);a.push(u)}}),a.join(`
|
|
22
|
-
`)}var Ks=class On extends ft{constructor(){super(...arguments),this.type="node"}static create(e={}){const t=typeof e=="function"?e():e;return new On(t)}configure(e){return super.configure(e)}extend(e){const t=typeof e=="function"?e():e;return super.extend(t)}},qs=class{constructor(r,e,t){this.isDragging=!1,this.component=r,this.editor=e.editor,this.options={stopEvent:null,ignoreMutation:null,...t},this.extension=e.extension,this.node=e.node,this.decorations=e.decorations,this.innerDecorations=e.innerDecorations,this.view=e.view,this.HTMLAttributes=e.HTMLAttributes,this.getPos=e.getPos,this.mount()}mount(){}get dom(){return this.editor.view.dom}get contentDOM(){return null}onDragStart(r){var e,t,n,i,s,o,l;const{view:a}=this.editor,c=r.target,f=c.nodeType===3?(e=c.parentElement)==null?void 0:e.closest("[data-drag-handle]"):c.closest("[data-drag-handle]");if(!this.dom||(t=this.contentDOM)!=null&&t.contains(c)||!f)return;let u=0,d=0;if(this.dom!==f){const x=this.dom.getBoundingClientRect(),S=f.getBoundingClientRect(),M=(i=r.offsetX)!=null?i:(n=r.nativeEvent)==null?void 0:n.offsetX,b=(o=r.offsetY)!=null?o:(s=r.nativeEvent)==null?void 0:s.offsetY;u=S.x-x.x+M,d=S.y-x.y+b}const h=this.dom.cloneNode(!0);try{const x=this.dom.getBoundingClientRect();h.style.width=`${Math.round(x.width)}px`,h.style.height=`${Math.round(x.height)}px`,h.style.boxSizing="border-box",h.style.pointerEvents="none"}catch{}let p=null;try{p=document.createElement("div"),p.style.position="absolute",p.style.top="-9999px",p.style.left="-9999px",p.style.pointerEvents="none",p.appendChild(h),document.body.appendChild(p),(l=r.dataTransfer)==null||l.setDragImage(h,u,d)}finally{p&&setTimeout(()=>{try{p==null||p.remove()}catch{}},0)}const m=this.getPos();if(typeof m!="number")return;const g=v.NodeSelection.create(a.state.doc,m),y=a.state.tr.setSelection(g);a.dispatch(y)}stopEvent(r){var e;if(!this.dom)return!1;if(typeof this.options.stopEvent=="function")return this.options.stopEvent({event:r});const t=r.target;if(!(this.dom.contains(t)&&!((e=this.contentDOM)!=null&&e.contains(t))))return!1;const i=r.type.startsWith("drag"),s=r.type==="drop";if((["INPUT","BUTTON","SELECT","TEXTAREA"].includes(t.tagName)||t.isContentEditable)&&!s&&!i)return!0;const{isEditable:l}=this.editor,{isDragging:a}=this,c=!!this.node.type.spec.draggable,f=v.NodeSelection.isSelectable(this.node),u=r.type==="copy",d=r.type==="paste",h=r.type==="cut",p=r.type==="mousedown";if(!c&&f&&i&&r.target===this.dom&&r.preventDefault(),c&&i&&!a&&r.target===this.dom)return r.preventDefault(),!1;if(c&&l&&!a&&p){const m=t.closest("[data-drag-handle]");m&&(this.dom===m||this.dom.contains(m))&&(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!(a||s||u||d||h||p&&f)}ignoreMutation(r){return!this.dom||!this.contentDOM?!0:typeof this.options.ignoreMutation=="function"?this.options.ignoreMutation({mutation:r}):this.node.isLeaf||this.node.isAtom?!0:r.type==="selection"||this.dom.contains(r.target)&&r.type==="childList"&&(Re()||mn())&&this.editor.isFocused&&[...Array.from(r.addedNodes),...Array.from(r.removedNodes)].every(t=>t.isContentEditable)?!1:this.contentDOM===r.target&&r.type==="attributes"?!0:!this.contentDOM.contains(r.target)}updateAttributes(r){this.editor.commands.command(({tr:e})=>{const t=this.getPos();return typeof t!="number"?!1:(e.setNodeMarkup(t,void 0,{...this.node.attrs,...r}),!0)})}deleteNode(){const r=this.getPos();if(typeof r!="number")return;const e=r+this.node.nodeSize;this.editor.commands.deleteRange({from:r,to:e})}};function Us(r){return new ut({find:r.find,handler:({state:e,range:t,match:n,pasteEvent:i})=>{const s=J(r.getAttributes,void 0,n,i);if(s===!1||s===null)return null;const{tr:o}=e,l=n[n.length-1],a=n[0];let c=t.to;if(l){const f=a.search(/\S/),u=t.from+a.indexOf(l),d=u+l.length;if(at(t.from,t.to,e.doc).filter(p=>p.mark.type.excluded.find(g=>g===r.type&&g!==p.mark.type)).filter(p=>p.to>u).length)return null;d<t.to&&o.delete(d,t.to),u>t.from&&o.delete(t.from+f,u),c=t.from+f+l.length,o.addMark(t.from+f,c,r.type.create(s||{})),o.removeStoredMark(r.type)}}})}function Xs(r){return new ut({find:r.find,handler({match:e,chain:t,range:n,pasteEvent:i}){const s=J(r.getAttributes,void 0,e,i),o=J(r.getContent,void 0,s);if(s===!1||s===null)return null;const l={type:r.type.name,attrs:s};o&&(l.content=o),e.input&&t().deleteRange(n).insertContentAt(n.from,l)}})}exports.AllSelection=L;exports.DOMParser=Me;exports.DOMSerializer=Ye;exports.Extension=j;exports.Fragment=w;exports.InputRule=pe;exports.Mapping=fe;exports.Mark=xs;exports.Node3=Ks;exports.NodeSelection=E;exports.NodeView=qs;exports.PasteRule=ut;exports.Plugin=xr;exports.PluginKey=vr;exports.ResizableNodeView=Fs;exports.Selection=C;exports.SelectionRange=Yt;exports.Slice=k;exports.TextSelection=P;exports.Transform=Xt;exports.callOrReturn=J;exports.canInsertNode=Ls;exports.combineTransactionSteps=kn;exports.createInlineMarkdownSpec=Rn;exports.deleteSelection=Ne;exports.dropPoint=dr;exports.escapeForRegEx=Ws;exports.findChildrenInRange=Di;exports.findParentNode=he;exports.findParentNodeClosestToPos=xn;exports.getAttributes=ji;exports.getChangedRanges=En;exports.getExtensionField=ie;exports.getMarksBetween=at;exports.getNodeAtPosition=_i;exports.getNodeType=I;exports.getRenderedAttributes=Li;exports.getText=Wi;exports.getTextSerializersFromSchema=Mn;exports.isActive=Ki;exports.isAtEndOfNode=qi;exports.isAtStartOfNode=Ui;exports.isList=Ue;exports.isNodeActive=re;exports.isNodeEmpty=ct;exports.isNodeSelection=Xi;exports.isNumber=vs;exports.isTextSelection=lt;exports.markInputRule=Os;exports.markPasteRule=Us;exports.mergeAttributes=Sn;exports.nodeInputRule=Ps;exports.nodePasteRule=Xs;exports.parseIndentedBlocks=In;exports.posToDOMRect=Yi;exports.renderNestedMarkdownContent=zn;exports.textblockTypeInputRule=$s;exports.wrappingInputRule=Bs;
|
package/lib/index.d.cts
DELETED
|
@@ -1,279 +0,0 @@
|
|
|
1
|
-
import { Editor } from '@tiptap/core';
|
|
2
|
-
import { JSX } from 'react/jsx-runtime';
|
|
3
|
-
|
|
4
|
-
declare interface IProviderRichTextProps {
|
|
5
|
-
editor: Editor;
|
|
6
|
-
children: React.ReactNode;
|
|
7
|
-
dark?: boolean;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export declare function RichTextProvider({ editor, children, dark }: IProviderRichTextProps): JSX.Element;
|
|
11
|
-
|
|
12
|
-
export { }
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
declare module '@tiptap/core' {
|
|
16
|
-
interface Commands<ReturnType> {
|
|
17
|
-
attachment: {
|
|
18
|
-
setAttachment: (attrs?: unknown) => ReturnType;
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
declare module '@tiptap/core' {
|
|
25
|
-
interface Commands<ReturnType> {
|
|
26
|
-
setCodeBlock: {
|
|
27
|
-
setCodeBlock: (options?: any) => ReturnType;
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
declare module '@tiptap/core' {
|
|
34
|
-
interface Commands<ReturnType> {
|
|
35
|
-
codeView: {
|
|
36
|
-
/**
|
|
37
|
-
* Toggle code view mode
|
|
38
|
-
*/
|
|
39
|
-
toggleCodeView: () => ReturnType;
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
declare module '@tiptap/core' {
|
|
46
|
-
interface Storage {
|
|
47
|
-
color: ColorStorage;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
declare module '@tiptap/core' {
|
|
53
|
-
interface Commands<ReturnType> {
|
|
54
|
-
columns: {
|
|
55
|
-
insertColumns: (attrs?: {
|
|
56
|
-
cols: number;
|
|
57
|
-
}) => ReturnType;
|
|
58
|
-
addColBefore: () => ReturnType;
|
|
59
|
-
addColAfter: () => ReturnType;
|
|
60
|
-
deleteCol: () => ReturnType;
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
declare module '@tiptap/core' {
|
|
67
|
-
interface Commands<ReturnType> {
|
|
68
|
-
drawer: {
|
|
69
|
-
setDrawer: (options: any, replace?: any) => ReturnType;
|
|
70
|
-
setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
|
|
71
|
-
};
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
declare module '@tiptap/core' {
|
|
77
|
-
interface Commands<ReturnType> {
|
|
78
|
-
excalidraw: {
|
|
79
|
-
setExcalidraw: (attrs?: IExcalidrawAttrs) => ReturnType;
|
|
80
|
-
};
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
declare module '@tiptap/core' {
|
|
86
|
-
interface Commands<ReturnType> {
|
|
87
|
-
exportPdf: {
|
|
88
|
-
exportToPdf: () => ReturnType;
|
|
89
|
-
};
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
declare module '@tiptap/core' {
|
|
95
|
-
interface Commands<ReturnType> {
|
|
96
|
-
exportWord: {
|
|
97
|
-
exportToWord: (docState: any) => ReturnType;
|
|
98
|
-
};
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
declare module '@tiptap/core' {
|
|
104
|
-
interface Commands<ReturnType> {
|
|
105
|
-
fontSize: {
|
|
106
|
-
/**
|
|
107
|
-
* Set the text font size. ex: "12px", "2em", or "small". Must be a valid
|
|
108
|
-
* CSS font-size
|
|
109
|
-
* (https://developer.mozilla.org/en-US/docs/Web/CSS/font-size).
|
|
110
|
-
*/
|
|
111
|
-
setFontSize: (fontSize: string) => ReturnType;
|
|
112
|
-
/**
|
|
113
|
-
* Unset the font size
|
|
114
|
-
*/
|
|
115
|
-
unsetFontSize: () => ReturnType;
|
|
116
|
-
};
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
declare module '@tiptap/core' {
|
|
122
|
-
interface Storage {
|
|
123
|
-
highlight: HighlightStorage;
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
declare module '@tiptap/core' {
|
|
129
|
-
interface Commands<ReturnType> {
|
|
130
|
-
iframe: {
|
|
131
|
-
/**
|
|
132
|
-
* Add an iframe
|
|
133
|
-
*/
|
|
134
|
-
setIframe: (options: {
|
|
135
|
-
src: string;
|
|
136
|
-
service: string;
|
|
137
|
-
}) => ReturnType;
|
|
138
|
-
};
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
declare module '@tiptap/core' {
|
|
144
|
-
interface Commands<ReturnType> {
|
|
145
|
-
imageUpload: {
|
|
146
|
-
/**
|
|
147
|
-
* Add an image
|
|
148
|
-
*/
|
|
149
|
-
setImageInline: (options: Partial<SetImageAttrsOptions>) => ReturnType;
|
|
150
|
-
/**
|
|
151
|
-
* Update an image
|
|
152
|
-
*/
|
|
153
|
-
updateImage: (options: Partial<SetImageAttrsOptions>) => ReturnType;
|
|
154
|
-
/**
|
|
155
|
-
* Set image alignment
|
|
156
|
-
*/
|
|
157
|
-
setAlignImage: (align: 'left' | 'center' | 'right') => ReturnType;
|
|
158
|
-
};
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
declare module '@tiptap/core' {
|
|
164
|
-
interface Commands<ReturnType> {
|
|
165
|
-
imageGifUpload: {
|
|
166
|
-
/**
|
|
167
|
-
* Add an image gif
|
|
168
|
-
*/
|
|
169
|
-
setImageGif: (options: Partial<SetImageAttrsOptions>) => ReturnType;
|
|
170
|
-
/**
|
|
171
|
-
* Update an image gif
|
|
172
|
-
*/
|
|
173
|
-
updateImageGif: (options: Partial<SetImageAttrsOptions>) => ReturnType;
|
|
174
|
-
/**
|
|
175
|
-
* Set image alignment
|
|
176
|
-
*/
|
|
177
|
-
setAlignImageGif: (align: 'left' | 'center' | 'right') => ReturnType;
|
|
178
|
-
};
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
declare module '@tiptap/core' {
|
|
184
|
-
interface Commands<ReturnType> {
|
|
185
|
-
indent: {
|
|
186
|
-
/**
|
|
187
|
-
* Set the indent attribute
|
|
188
|
-
*/
|
|
189
|
-
indent: () => ReturnType;
|
|
190
|
-
/**
|
|
191
|
-
* Set the outdent attribute
|
|
192
|
-
*/
|
|
193
|
-
outdent: () => ReturnType;
|
|
194
|
-
};
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
declare module '@tiptap/core' {
|
|
200
|
-
interface Commands<ReturnType> {
|
|
201
|
-
katex: {
|
|
202
|
-
setKatex: (arg?: IKatexAttrs) => ReturnType;
|
|
203
|
-
};
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
declare module '@tiptap/core' {
|
|
209
|
-
interface Commands<ReturnType> {
|
|
210
|
-
mermaid: {
|
|
211
|
-
setMermaid: (options: any, replace?: any) => ReturnType;
|
|
212
|
-
setAlignImageMermaid: (align: 'left' | 'center' | 'right') => ReturnType;
|
|
213
|
-
};
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
declare module '@tiptap/core' {
|
|
219
|
-
interface Commands<ReturnType> {
|
|
220
|
-
search: {
|
|
221
|
-
setSearchTerm: (searchTerm: string) => ReturnType;
|
|
222
|
-
setReplaceTerm: (replaceTerm: string) => ReturnType;
|
|
223
|
-
setCaseSensitive: (caseSensitive: boolean) => ReturnType;
|
|
224
|
-
resetIndex: () => ReturnType;
|
|
225
|
-
nextSearchResult: () => ReturnType;
|
|
226
|
-
previousSearchResult: () => ReturnType;
|
|
227
|
-
replace: () => ReturnType;
|
|
228
|
-
replaceAll: () => ReturnType;
|
|
229
|
-
};
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
declare module '@tiptap/core' {
|
|
235
|
-
interface Storage {
|
|
236
|
-
searchAndReplace: SearchAndReplaceStorage;
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
declare module '@tiptap/core' {
|
|
242
|
-
interface Commands<ReturnType> {
|
|
243
|
-
twitter: {
|
|
244
|
-
/**
|
|
245
|
-
* Insert a tweet
|
|
246
|
-
* @param options The tweet attributes
|
|
247
|
-
* @example editor.commands.setTweet({ src: 'https://x.com/seanpk/status/1800145949580517852' })
|
|
248
|
-
*/
|
|
249
|
-
setTweet: (options: SetTweetOptions) => ReturnType;
|
|
250
|
-
updateTweet: (options: SetTweetOptions) => ReturnType;
|
|
251
|
-
};
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
declare module '@tiptap/core' {
|
|
257
|
-
interface Commands<ReturnType> {
|
|
258
|
-
video: {
|
|
259
|
-
/**
|
|
260
|
-
* Add an video
|
|
261
|
-
*/
|
|
262
|
-
setVideo: (options: Partial<SetVideoOptions>) => ReturnType;
|
|
263
|
-
/**
|
|
264
|
-
* Update an video
|
|
265
|
-
*/
|
|
266
|
-
updateVideo: (options: Partial<SetVideoOptions>) => ReturnType;
|
|
267
|
-
};
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
declare module '@tiptap/core' {
|
|
273
|
-
interface Commands<ReturnType> {
|
|
274
|
-
tableCellBackground: {
|
|
275
|
-
setTableCellBackground: (color: string) => ReturnType;
|
|
276
|
-
unsetTableCellBackground: () => ReturnType;
|
|
277
|
-
};
|
|
278
|
-
}
|
|
279
|
-
}
|
package/lib/input-_ECRfn3Y.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const n=require("react/jsx-runtime"),o=require("react"),u=require("./index-DV5kbgRU.cjs");function a(t){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const i=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(r,e,i.get?i:{enumerable:!0,get:()=>t[e]})}}return r.default=t,Object.freeze(r)}const s=a(o),c=s.forwardRef(({className:t,type:r,...e},i)=>n.jsx("input",{type:r,className:u.cn("richtext-flex richtext-h-10 richtext-w-full richtext-rounded-md !richtext-border richtext-border-input richtext-bg-background richtext-px-3 richtext-py-2 richtext-text-sm richtext-ring-offset-background file:richtext-border-0 file:richtext-bg-transparent file:richtext-text-sm file:richtext-font-medium placeholder:richtext-text-muted-foreground focus-visible:richtext-outline-none disabled:richtext-cursor-not-allowed disabled:richtext-opacity-50",t),ref:i,...e}));c.displayName="Input";exports.Input=c;
|