@blocknote/core 0.19.2 → 0.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/blocknote.js +2035 -1758
- package/dist/blocknote.js.map +1 -1
- package/dist/blocknote.umd.cjs +6 -6
- package/dist/blocknote.umd.cjs.map +1 -1
- package/dist/src/api/blockManipulation/commands/insertBlocks/insertBlocks.js +6 -3
- package/dist/src/api/blockManipulation/commands/insertBlocks/insertBlocks.js.map +1 -1
- package/dist/src/api/blockManipulation/commands/moveBlocks/moveBlocks.js +219 -0
- package/dist/src/api/blockManipulation/commands/moveBlocks/moveBlocks.js.map +1 -0
- package/dist/src/api/blockManipulation/commands/moveBlocks/moveBlocks.test.js +175 -0
- package/dist/src/api/blockManipulation/commands/moveBlocks/moveBlocks.test.js.map +1 -0
- package/dist/src/api/blockManipulation/commands/splitBlock/splitBlock.test.js +4 -1
- package/dist/src/api/blockManipulation/commands/splitBlock/splitBlock.test.js.map +1 -1
- package/dist/src/api/blockManipulation/commands/updateBlock/updateBlock.js +6 -3
- package/dist/src/api/blockManipulation/commands/updateBlock/updateBlock.js.map +1 -1
- package/dist/src/api/blockManipulation/getBlock/getBlock.js +56 -0
- package/dist/src/api/blockManipulation/getBlock/getBlock.js.map +1 -0
- package/dist/src/api/blockManipulation/selections/selection.js +149 -0
- package/dist/src/api/blockManipulation/selections/selection.js.map +1 -0
- package/dist/src/api/blockManipulation/selections/selection.test.js +39 -0
- package/dist/src/api/blockManipulation/selections/selection.test.js.map +1 -0
- package/dist/src/api/blockManipulation/selections/textCursorPosition/textCursorPosition.js +3 -0
- package/dist/src/api/blockManipulation/selections/textCursorPosition/textCursorPosition.js.map +1 -1
- package/dist/src/api/clipboard/clipboard.test.js +6 -3
- package/dist/src/api/clipboard/clipboard.test.js.map +1 -1
- package/dist/src/api/clipboard/fromClipboard/handleFileInsertion.js +1 -1
- package/dist/src/api/clipboard/fromClipboard/handleFileInsertion.js.map +1 -1
- package/dist/src/api/clipboard/fromClipboard/handleVSCodePaste.js +2 -3
- package/dist/src/api/clipboard/fromClipboard/handleVSCodePaste.js.map +1 -1
- package/dist/src/api/clipboard/fromClipboard/pasteExtension.js +5 -5
- package/dist/src/api/clipboard/fromClipboard/pasteExtension.js.map +1 -1
- package/dist/src/api/clipboard/toClipboard/copyExtension.js +4 -2
- package/dist/src/api/clipboard/toClipboard/copyExtension.js.map +1 -1
- package/dist/src/api/nodeUtil.js +1 -1
- package/dist/src/api/nodeUtil.js.map +1 -1
- package/dist/src/api/parsers/markdown/parseMarkdown.test.js +4 -1
- package/dist/src/api/parsers/markdown/parseMarkdown.test.js.map +1 -1
- package/dist/src/blocks/AudioBlockContent/AudioBlockContent.js +14 -7
- package/dist/src/blocks/AudioBlockContent/AudioBlockContent.js.map +1 -1
- package/dist/src/blocks/AudioBlockContent/{audioBlockHelpers.js → parseAudioElement.js} +1 -1
- package/dist/src/blocks/AudioBlockContent/parseAudioElement.js.map +1 -0
- package/dist/src/blocks/FileBlockContent/FileBlockContent.js +5 -4
- package/dist/src/blocks/FileBlockContent/FileBlockContent.js.map +1 -1
- package/dist/src/blocks/FileBlockContent/helpers/parse/parseEmbedElement.js +5 -0
- package/dist/src/blocks/FileBlockContent/helpers/parse/parseEmbedElement.js.map +1 -0
- package/dist/src/blocks/FileBlockContent/helpers/parse/parseFigureElement.js +10 -0
- package/dist/src/blocks/FileBlockContent/helpers/parse/parseFigureElement.js.map +1 -0
- package/dist/src/blocks/FileBlockContent/helpers/render/createAddFileButton.js +39 -0
- package/dist/src/blocks/FileBlockContent/helpers/render/createAddFileButton.js.map +1 -0
- package/dist/src/blocks/FileBlockContent/helpers/render/createFileBlockWrapper.js +51 -0
- package/dist/src/blocks/FileBlockContent/helpers/render/createFileBlockWrapper.js.map +1 -0
- package/dist/src/blocks/FileBlockContent/helpers/render/createFileNameWithIcon.js +17 -0
- package/dist/src/blocks/FileBlockContent/helpers/render/createFileNameWithIcon.js.map +1 -0
- package/dist/src/blocks/FileBlockContent/helpers/render/createResizableFileBlockWrapper.js +147 -0
- package/dist/src/blocks/FileBlockContent/helpers/render/createResizableFileBlockWrapper.js.map +1 -0
- package/dist/src/blocks/FileBlockContent/helpers/toExternalHTML/createFigureWithCaption.js +9 -0
- package/dist/src/blocks/FileBlockContent/helpers/toExternalHTML/createFigureWithCaption.js.map +1 -0
- package/dist/src/blocks/FileBlockContent/helpers/toExternalHTML/createLinkWithCaption.js +11 -0
- package/dist/src/blocks/FileBlockContent/helpers/toExternalHTML/createLinkWithCaption.js.map +1 -0
- package/dist/src/blocks/ImageBlockContent/ImageBlockContent.js +17 -9
- package/dist/src/blocks/ImageBlockContent/ImageBlockContent.js.map +1 -1
- package/dist/src/blocks/ImageBlockContent/{imageBlockHelpers.js → parseImageElement.js} +1 -1
- package/dist/src/blocks/ImageBlockContent/parseImageElement.js.map +1 -0
- package/dist/src/blocks/TableBlockContent/TableExtension.js +8 -1
- package/dist/src/blocks/TableBlockContent/TableExtension.js.map +1 -1
- package/dist/src/blocks/VideoBlockContent/VideoBlockContent.js +18 -7
- package/dist/src/blocks/VideoBlockContent/VideoBlockContent.js.map +1 -1
- package/dist/src/blocks/VideoBlockContent/{videoBlockHelpers.js → parseVideoElement.js} +1 -1
- package/dist/src/blocks/VideoBlockContent/parseVideoElement.js.map +1 -0
- package/dist/src/editor/BlockNoteEditor.js +64 -62
- package/dist/src/editor/BlockNoteEditor.js.map +1 -1
- package/dist/src/editor/BlockNoteExtensions.js +5 -8
- package/dist/src/editor/BlockNoteExtensions.js.map +1 -1
- package/dist/src/extensions/FormattingToolbar/FormattingToolbarPlugin.js +4 -2
- package/dist/src/extensions/FormattingToolbar/FormattingToolbarPlugin.js.map +1 -1
- package/dist/src/extensions/KeyboardShortcuts/KeyboardShortcutsExtension.js +10 -8
- package/dist/src/extensions/KeyboardShortcuts/KeyboardShortcutsExtension.js.map +1 -1
- package/dist/src/extensions/LinkToolbar/LinkToolbarPlugin.js +7 -3
- package/dist/src/extensions/LinkToolbar/LinkToolbarPlugin.js.map +1 -1
- package/dist/src/extensions/LinkToolbar/protocols.js +14 -0
- package/dist/src/extensions/LinkToolbar/protocols.js.map +1 -0
- package/dist/src/extensions/Placeholder/PlaceholderPlugin.js +19 -13
- package/dist/src/extensions/Placeholder/PlaceholderPlugin.js.map +1 -1
- package/dist/src/extensions/SideMenu/SideMenuPlugin.js +5 -1
- package/dist/src/extensions/SideMenu/SideMenuPlugin.js.map +1 -1
- package/dist/src/extensions/SideMenu/dragging.js +8 -1
- package/dist/src/extensions/SideMenu/dragging.js.map +1 -1
- package/dist/src/extensions/SuggestionMenu/SuggestionPlugin.js +3 -3
- package/dist/src/extensions/SuggestionMenu/SuggestionPlugin.js.map +1 -1
- package/dist/src/extensions/TableHandles/TableHandlesPlugin.js +37 -11
- package/dist/src/extensions/TableHandles/TableHandlesPlugin.js.map +1 -1
- package/dist/src/i18n/locales/ru.js +1 -1
- package/dist/src/index.js +9 -2
- package/dist/src/index.js.map +1 -1
- package/dist/src/schema/inlineContent/createSpec.js +1 -1
- package/dist/src/schema/inlineContent/createSpec.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/webpack-stats.json +1 -1
- package/package.json +3 -3
- package/src/api/blockManipulation/commands/insertBlocks/insertBlocks.ts +6 -6
- package/src/api/blockManipulation/commands/moveBlocks/__snapshots__/moveBlocks.test.ts.snap +9506 -0
- package/src/api/blockManipulation/commands/moveBlocks/moveBlocks.test.ts +295 -0
- package/src/api/blockManipulation/commands/moveBlocks/moveBlocks.ts +336 -0
- package/src/api/blockManipulation/commands/splitBlock/splitBlock.test.ts +5 -1
- package/src/api/blockManipulation/commands/updateBlock/updateBlock.ts +11 -3
- package/src/api/blockManipulation/getBlock/getBlock.ts +141 -0
- package/src/api/blockManipulation/selections/__snapshots__/selection.test.ts.snap +660 -0
- package/src/api/blockManipulation/selections/selection.test.ts +56 -0
- package/src/api/blockManipulation/selections/selection.ts +244 -0
- package/src/api/blockManipulation/selections/textCursorPosition/textCursorPosition.ts +4 -0
- package/src/api/clipboard/__snapshots__/tableAllCells.html +1 -1
- package/src/api/clipboard/__snapshots__/tableCell.html +1 -1
- package/src/api/clipboard/__snapshots__/tableRow.html +1 -1
- package/src/api/clipboard/clipboard.test.ts +7 -3
- package/src/api/clipboard/fromClipboard/handleFileInsertion.ts +1 -1
- package/src/api/clipboard/fromClipboard/handleVSCodePaste.ts +7 -14
- package/src/api/clipboard/fromClipboard/pasteExtension.ts +6 -6
- package/src/api/clipboard/toClipboard/copyExtension.ts +7 -2
- package/src/api/exporters/html/__snapshots__/file/basic/internal.html +1 -1
- package/src/api/exporters/html/__snapshots__/file/nested/internal.html +1 -1
- package/src/api/exporters/html/__snapshots__/file/noCaption/internal.html +1 -1
- package/src/api/exporters/html/__snapshots__/file/noName/internal.html +1 -1
- package/src/api/exporters/html/__snapshots__/image/basic/internal.html +1 -1
- package/src/api/exporters/html/__snapshots__/image/nested/internal.html +1 -1
- package/src/api/exporters/html/__snapshots__/image/noCaption/internal.html +1 -1
- package/src/api/exporters/html/__snapshots__/image/noName/internal.html +1 -1
- package/src/api/exporters/html/__snapshots__/image/noPreview/internal.html +1 -1
- package/src/api/exporters/html/__snapshots__/simpleImage/basic/external.html +1 -1
- package/src/api/exporters/html/__snapshots__/simpleImage/basic/internal.html +1 -1
- package/src/api/exporters/html/__snapshots__/simpleImage/nested/external.html +1 -1
- package/src/api/exporters/html/__snapshots__/simpleImage/nested/internal.html +1 -1
- package/src/api/exporters/html/__snapshots__/simpleImage/noCaption/external.html +1 -1
- package/src/api/exporters/html/__snapshots__/simpleImage/noCaption/internal.html +1 -1
- package/src/api/exporters/html/__snapshots__/simpleImage/noName/external.html +1 -1
- package/src/api/exporters/html/__snapshots__/simpleImage/noName/internal.html +1 -1
- package/src/api/exporters/html/__snapshots__/simpleImage/noPreview/external.html +1 -1
- package/src/api/exporters/html/__snapshots__/simpleImage/noPreview/internal.html +1 -1
- package/src/api/exporters/markdown/__snapshots__/simpleImage/basic/markdown.md +1 -1
- package/src/api/exporters/markdown/__snapshots__/simpleImage/nested/markdown.md +2 -2
- package/src/api/exporters/markdown/__snapshots__/simpleImage/noCaption/markdown.md +1 -1
- package/src/api/exporters/markdown/__snapshots__/simpleImage/noName/markdown.md +1 -1
- package/src/api/nodeUtil.ts +2 -2
- package/src/api/parsers/markdown/parseMarkdown.test.ts +5 -7
- package/src/blocks/AudioBlockContent/AudioBlockContent.ts +13 -14
- package/src/blocks/FileBlockContent/FileBlockContent.ts +5 -12
- package/src/blocks/FileBlockContent/helpers/parse/parseEmbedElement.ts +5 -0
- package/src/blocks/FileBlockContent/helpers/parse/parseFigureElement.ts +16 -0
- package/src/blocks/FileBlockContent/helpers/render/createAddFileButton.ts +63 -0
- package/src/blocks/FileBlockContent/helpers/render/createFileBlockWrapper.ts +80 -0
- package/src/blocks/FileBlockContent/helpers/render/createFileNameWithIcon.ts +24 -0
- package/src/blocks/FileBlockContent/helpers/render/createResizableFileBlockWrapper.ts +204 -0
- package/src/blocks/FileBlockContent/helpers/toExternalHTML/createFigureWithCaption.ts +13 -0
- package/src/blocks/FileBlockContent/helpers/toExternalHTML/createLinkWithCaption.ts +15 -0
- package/src/blocks/ImageBlockContent/ImageBlockContent.ts +20 -28
- package/src/blocks/TableBlockContent/TableExtension.ts +12 -1
- package/src/blocks/VideoBlockContent/VideoBlockContent.ts +20 -27
- package/src/editor/Block.css +35 -51
- package/src/editor/BlockNoteEditor.ts +101 -92
- package/src/editor/BlockNoteExtensions.ts +9 -8
- package/src/editor/editor.css +1 -0
- package/src/extensions/FormattingToolbar/FormattingToolbarPlugin.ts +4 -2
- package/src/extensions/KeyboardShortcuts/KeyboardShortcutsExtension.ts +11 -8
- package/src/extensions/LinkToolbar/LinkToolbarPlugin.ts +11 -4
- package/src/extensions/LinkToolbar/protocols.ts +13 -0
- package/src/extensions/Placeholder/PlaceholderPlugin.ts +29 -21
- package/src/extensions/SideMenu/SideMenuPlugin.ts +5 -1
- package/src/extensions/SideMenu/dragging.ts +8 -1
- package/src/extensions/SuggestionMenu/SuggestionPlugin.ts +3 -6
- package/src/extensions/TableHandles/TableHandlesPlugin.ts +49 -12
- package/src/i18n/locales/ru.ts +1 -1
- package/src/index.ts +9 -2
- package/src/schema/inlineContent/createSpec.ts +2 -2
- package/types/src/api/blockManipulation/commands/moveBlocks/moveBlocks.d.ts +15 -0
- package/types/src/api/blockManipulation/getBlock/getBlock.d.ts +7 -0
- package/types/src/api/blockManipulation/selections/selection.d.ts +5 -0
- package/types/src/api/blockManipulation/selections/selection.test.d.ts +1 -0
- package/types/src/api/clipboard/fromClipboard/handleVSCodePaste.d.ts +2 -3
- package/types/src/api/clipboard/fromClipboard/pasteExtension.d.ts +1 -3
- package/types/src/api/nodeUtil.d.ts +1 -1
- package/types/src/blocks/AudioBlockContent/AudioBlockContent.d.ts +2 -5
- package/types/src/blocks/FileBlockContent/FileBlockContent.d.ts +2 -5
- package/types/src/blocks/FileBlockContent/helpers/parse/parseEmbedElement.d.ts +3 -0
- package/types/src/blocks/FileBlockContent/helpers/parse/parseFigureElement.d.ts +4 -0
- package/types/src/blocks/FileBlockContent/helpers/render/createAddFileButton.d.ts +6 -0
- package/types/src/blocks/FileBlockContent/helpers/render/createFileBlockWrapper.d.ts +9 -0
- package/types/src/blocks/FileBlockContent/helpers/render/createFileNameWithIcon.d.ts +6 -0
- package/types/src/blocks/FileBlockContent/helpers/render/createResizableFileBlockWrapper.d.ts +9 -0
- package/types/src/blocks/FileBlockContent/helpers/toExternalHTML/createFigureWithCaption.d.ts +3 -0
- package/types/src/blocks/FileBlockContent/helpers/toExternalHTML/createLinkWithCaption.d.ts +3 -0
- package/types/src/blocks/ImageBlockContent/ImageBlockContent.d.ts +2 -5
- package/types/src/blocks/VideoBlockContent/VideoBlockContent.d.ts +2 -5
- package/types/src/editor/BlockNoteEditor.d.ts +60 -14
- package/types/src/editor/BlockNoteExtensions.d.ts +1 -0
- package/types/src/extensions/KeyboardShortcuts/KeyboardShortcutsExtension.d.ts +1 -0
- package/types/src/extensions/LinkToolbar/protocols.d.ts +2 -0
- package/types/src/index.d.ts +9 -2
- package/types/src/pm-nodes/BlockContainer.d.ts +2 -2
- package/types/src/pm-nodes/BlockGroup.d.ts +2 -2
- package/dist/src/api/blockManipulation/commands/moveBlock/moveBlock.js +0 -116
- package/dist/src/api/blockManipulation/commands/moveBlock/moveBlock.js.map +0 -1
- package/dist/src/api/blockManipulation/commands/moveBlock/moveBlock.test.js +0 -110
- package/dist/src/api/blockManipulation/commands/moveBlock/moveBlock.test.js.map +0 -1
- package/dist/src/blocks/AudioBlockContent/audioBlockHelpers.js.map +0 -1
- package/dist/src/blocks/FileBlockContent/fileBlockHelpers.js +0 -317
- package/dist/src/blocks/FileBlockContent/fileBlockHelpers.js.map +0 -1
- package/dist/src/blocks/ImageBlockContent/imageBlockHelpers.js.map +0 -1
- package/dist/src/blocks/VideoBlockContent/videoBlockHelpers.js.map +0 -1
- package/src/api/blockManipulation/commands/moveBlock/__snapshots__/moveBlock.test.ts.snap +0 -3799
- package/src/api/blockManipulation/commands/moveBlock/moveBlock.test.ts +0 -196
- package/src/api/blockManipulation/commands/moveBlock/moveBlock.ts +0 -176
- package/src/blocks/FileBlockContent/fileBlockHelpers.ts +0 -456
- package/types/src/api/blockManipulation/commands/moveBlock/moveBlock.d.ts +0 -5
- package/types/src/blocks/FileBlockContent/fileBlockHelpers.d.ts +0 -41
- /package/src/blocks/AudioBlockContent/{audioBlockHelpers.ts → parseAudioElement.ts} +0 -0
- /package/src/blocks/ImageBlockContent/{imageBlockHelpers.ts → parseImageElement.ts} +0 -0
- /package/src/blocks/VideoBlockContent/{videoBlockHelpers.ts → parseVideoElement.ts} +0 -0
- /package/types/src/api/blockManipulation/commands/{moveBlock/moveBlock.test.d.ts → moveBlocks/moveBlocks.test.d.ts} +0 -0
- /package/types/src/blocks/AudioBlockContent/{audioBlockHelpers.d.ts → parseAudioElement.d.ts} +0 -0
- /package/types/src/blocks/ImageBlockContent/{imageBlockHelpers.d.ts → parseImageElement.d.ts} +0 -0
- /package/types/src/blocks/VideoBlockContent/{videoBlockHelpers.d.ts → parseVideoElement.d.ts} +0 -0
package/dist/blocknote.umd.cjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
(function(d,v){typeof exports=="object"&&typeof module<"u"?v(exports,require("prosemirror-model"),require("@tiptap/core"),require("prosemirror-state"),require("uuid"),require("prosemirror-highlight"),require("prosemirror-highlight/shiki"),require("shiki"),require("prosemirror-tables"),require("@tiptap/extension-bold"),require("@tiptap/extension-code"),require("@tiptap/extension-italic"),require("@tiptap/extension-strike"),require("@tiptap/extension-underline"),require("prosemirror-transform"),require("@tiptap/extension-table-cell"),require("@tiptap/extension-table-header"),require("@tiptap/extension-table-row"),require("@tiptap/extension-collaboration"),require("@tiptap/extension-collaboration-cursor"),require("@tiptap/extension-gapcursor"),require("@tiptap/extension-hard-break"),require("@tiptap/extension-history"),require("@tiptap/extension-link"),require("@tiptap/extension-text"),require("prosemirror-view"),require("prosemirror-dropcursor")):typeof define=="function"&&define.amd?define(["exports","prosemirror-model","@tiptap/core","prosemirror-state","uuid","prosemirror-highlight","prosemirror-highlight/shiki","shiki","prosemirror-tables","@tiptap/extension-bold","@tiptap/extension-code","@tiptap/extension-italic","@tiptap/extension-strike","@tiptap/extension-underline","prosemirror-transform","@tiptap/extension-table-cell","@tiptap/extension-table-header","@tiptap/extension-table-row","@tiptap/extension-collaboration","@tiptap/extension-collaboration-cursor","@tiptap/extension-gapcursor","@tiptap/extension-hard-break","@tiptap/extension-history","@tiptap/extension-link","@tiptap/extension-text","prosemirror-view","prosemirror-dropcursor"],v):(d=typeof globalThis<"u"?globalThis:d||self,v(d.blocknote={},d.prosemirrorModel,d.core,d.prosemirrorState,d.uuid,d.prosemirrorHighlight,d.shiki$1,d.shiki,d.prosemirrorTables,d.Bold,d.Code,d.Italic,d.Strike,d.Underline,d.prosemirrorTransform,d.extensionTableCell,d.extensionTableHeader,d.extensionTableRow,d.Collaboration,d.CollaborationCursor,d.extensionGapcursor,d.extensionHardBreak,d.extensionHistory,d.extensionLink,d.extensionText,d.pmView,d.prosemirrorDropcursor))})(this,function(d,v,k,y,oi,ii,ni,Le,$,ai,ri,li,si,di,be,ci,ui,pi,hi,mi,fi,gi,bi,ki,_i,M,yi){"use strict";var Fa=Object.defineProperty;var Ga=(d,v,k)=>v in d?Fa(d,v,{enumerable:!0,configurable:!0,writable:!0,value:k}):d[v]=k;var p=(d,v,k)=>Ga(d,typeof v!="symbol"?v+"":v,k);const W=e=>e&&typeof e=="object"&&"default"in e?e:{default:e};function vi(e){if(e&&typeof e=="object"&&"default"in e)return e;const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const o in e)if(o!=="default"){const i=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,i.get?i:{enumerable:!0,get:()=>e[o]})}}return t.default=e,Object.freeze(t)}const wi=W(ai),Ci=W(ri),Ei=W(li),xi=W(si),Si=W(di),Bi=W(hi),Ti=W(mi),dt=vi(M),Mi={slash_menu:{heading:{title:"عنوان 1",subtext:"يستخدم لعناوين المستوى الأعلى",aliases:["ع","عنوان1","ع1"],group:"العناوين"},heading_2:{title:"عنوان 2",subtext:"يستخدم للأقسام الرئيسية",aliases:["ع2","عنوان2","عنوان فرعي"],group:"العناوين"},heading_3:{title:"عنوان 3",subtext:"يستخدم للأقسام الفرعية والعناوين المجموعة",aliases:["ع3","عنوان3","عنوان فرعي"],group:"العناوين"},numbered_list:{title:"قائمة مرقمة",subtext:"تستخدم لعرض قائمة مرقمة",aliases:["ق","عناصر قائمة","قائمة","قائمة مرقمة"],group:"الكتل الأساسية"},bullet_list:{title:"قائمة نقطية",subtext:"تستخدم لعرض قائمة غير مرتبة",aliases:["ق","عناصر قائمة","قائمة","قائمة نقطية"],group:"الكتل الأساسية"},check_list:{title:"قائمة تحقق",subtext:"تستخدم لعرض قائمة بمربعات التحقق",aliases:["قوائم غير مرتبة","عناصر قائمة","قائمة","قائمة تحقق","قائمة التحقق","قائمة مشطوبة","مربع التحقق"],group:"الكتل الأساسية"},paragraph:{title:"فقرة",subtext:"تستخدم لنص الوثيقة الأساسي",aliases:["ف","فقرة"],group:"الكتل الأساسية"},code_block:{title:"كود",subtext:"يستخدم لعرض الكود مع تحديد الصيغة",aliases:["كود","مسبق"],group:"الكتل الأساسية"},table:{title:"جدول",subtext:"يستخدم للجداول",aliases:["جدول"],group:"متقدم"},image:{title:"صورة",subtext:"إدراج صورة",aliases:["صورة","رفع صورة","تحميل","صورة","صورة","وسائط","رابط"],group:"وسائط"},video:{title:"فيديو",subtext:"إدراج فيديو",aliases:["فيديو","رفع فيديو","تحميل","فيديو","فيلم","وسائط","رابط"],group:"وسائط"},audio:{title:"صوت",subtext:"إدراج صوت",aliases:["صوت","رفع صوت","تحميل","صوت","صوت","وسائط","رابط"],group:"وسائط"},file:{title:"ملف",subtext:"إدراج ملف",aliases:["ملف","تحميل","تضمين","وسائط","رابط"],group:"وسائط"},emoji:{title:"الرموز التعبيرية",subtext:"تُستخدم لإدراج رمز تعبيري",aliases:["رمز تعبيري","إيموجي","إيموت","عاطفة","وجه"],group:"آخرون"}},placeholders:{default:"أدخل نصًا أو اكتب '/' للأوامر",heading:"عنوان",bulletListItem:"قائمة",numberedListItem:"قائمة",checkListItem:"قائمة"},file_blocks:{image:{add_button_text:"إضافة صورة"},video:{add_button_text:"إضافة فيديو"},audio:{add_button_text:"إضافة صوت"},file:{add_button_text:"إضافة ملف"}},side_menu:{add_block_label:"إضافة محتوي",drag_handle_label:"فتح قائمة المحتويات"},drag_handle:{delete_menuitem:"حذف",colors_menuitem:"ألوان"},table_handle:{delete_column_menuitem:"حذف عمود",delete_row_menuitem:"حذف صف",add_left_menuitem:"إضافة عمود إلى اليسار",add_right_menuitem:"إضافة عمود إلى اليمين",add_above_menuitem:"إضافة صف أعلى",add_below_menuitem:"إضافة صف أسفل"},suggestion_menu:{no_items_title:"لم يتم العثور على عناصر",loading:"جارٍ التحميل…"},color_picker:{text_title:"نص",background_title:"خلفية",colors:{default:"افتراضي",gray:"رمادي",brown:"بني",red:"أحمر",orange:"برتقالي",yellow:"أصفر",green:"أخضر",blue:"أزرق",purple:"أرجواني",pink:"وردي"}},formatting_toolbar:{bold:{tooltip:"عريض",secondary_tooltip:"Mod+B"},italic:{tooltip:"مائل",secondary_tooltip:"Mod+I"},underline:{tooltip:"تحته خط",secondary_tooltip:"Mod+U"},strike:{tooltip:"مشطوب",secondary_tooltip:"Mod+Shift+X"},code:{tooltip:"كود",secondary_tooltip:""},colors:{tooltip:"ألوان"},link:{tooltip:"إنشاء رابط",secondary_tooltip:"Mod+K"},file_caption:{tooltip:"تحرير التسمية التوضيحية",input_placeholder:"تحرير التسمية التوضيحية"},file_replace:{tooltip:{image:"استبدال الصورة",video:"استبدال الفيديو",audio:"استبدال الصوت",file:"استبدال الملف"}},file_rename:{tooltip:{image:"إعادة تسمية الصورة",video:"إعادة تسمية الفيديو",audio:"إعادة تسمية الصوت",file:"إعادة تسمية الملف"},input_placeholder:{image:"إعادة تسمية الصورة",video:"إعادة تسمية الفيديو",audio:"إعادة تسمية الصوت",file:"إعادة تسمية الملف"}},file_download:{tooltip:{image:"تنزيل الصورة",video:"تنزيل الفيديو",audio:"تنزيل الصوت",file:"تنزيل الملف"}},file_delete:{tooltip:{image:"حذف الصورة",video:"حذف الفيديو",audio:"حذف الصوت",file:"حذف الملف"}},file_preview_toggle:{tooltip:"تبديل المعاينة"},nest:{tooltip:"محتويات متداخلة",secondary_tooltip:"Tab"},unnest:{tooltip:"إلغاء التداخل",secondary_tooltip:"Shift+Tab"},align_left:{tooltip:"محاذاة النص إلى اليسار"},align_center:{tooltip:"محاذاة النص في المنتصف"},align_right:{tooltip:"محاذاة النص إلى اليمين"},align_justify:{tooltip:"ضبط النص"}},file_panel:{upload:{title:"تحميل",file_placeholder:{image:"تحميل صورة",video:"تحميل فيديو",audio:"تحميل صوت",file:"تحميل ملف"},upload_error:"خطأ: فشل التحميل"},embed:{title:"تضمين",embed_button:{image:"تضمين صورة",video:"تضمين فيديو",audio:"تضمين صوت",file:"تضمين ملف"},url_placeholder:"أدخل الرابط"}},link_toolbar:{delete:{tooltip:"إزالة الرابط"},edit:{text:"تحرير الرابط",tooltip:"تحرير"},open:{tooltip:"فتح في تبويب جديد"},form:{title_placeholder:"تحرير العنوان",url_placeholder:"تحرير الرابط"}},generic:{ctrl_shortcut:"Ctrl"}},Li={slash_menu:{heading:{title:"Überschrift 1",subtext:"Hauptebene Überschrift",aliases:["h","überschrift1","h1"],group:"Überschriften"},heading_2:{title:"Überschrift 2",subtext:"Wichtige Abschnittsüberschrift",aliases:["h2","überschrift2","unterüberschrift"],group:"Überschriften"},heading_3:{title:"Überschrift 3",subtext:"Unterabschnitts- und Gruppenüberschrift",aliases:["h3","überschrift3","unterüberschrift"],group:"Überschriften"},numbered_list:{title:"Nummerierte Liste",subtext:"Liste mit nummerierten Elementen",aliases:["ol","li","liste","nummerierteliste","nummerierte liste"],group:"Grundlegende blöcke"},bullet_list:{title:"Aufzählungsliste",subtext:"Liste mit unnummerierten Elementen",aliases:["ul","li","liste","aufzählungsliste","aufzählung liste"],group:"Grundlegende blöcke"},check_list:{title:"Checkliste",subtext:"Liste mit Kontrollkästchen",aliases:["ul","li","liste","checkliste","check liste","geprüfte liste","kontrollkästchen"],group:"Grundlegende blöcke"},paragraph:{title:"Absatz",subtext:"Der Hauptteil Ihres Dokuments",aliases:["p","absatz"],group:"Grundlegende blöcke"},code_block:{title:"Codeblock",subtext:"Codeblock mit Syntaxhervorhebung",aliases:["code","pre"],group:"Grundlegende blöcke"},table:{title:"Tabelle",subtext:"Tabelle mit editierbaren Zellen",aliases:["tabelle"],group:"Erweitert"},image:{title:"Bild",subtext:"Größenveränderbares Bild mit Beschriftung",aliases:["bild","bildhochladen","hochladen","img","bild","medien","url"],group:"Medien"},video:{title:"Video",subtext:"Größenveränderbares Video mit Beschriftung",aliases:["video","videoupload","hochladen","mp4","film","medien","url"],group:"Medien"},audio:{title:"Audio",subtext:"Eingebettetes Audio mit Beschriftung",aliases:["audio","audioupload","hochladen","mp3","ton","medien","url"],group:"Medien"},file:{title:"Datei",subtext:"Eingebettete Datei",aliases:["datei","hochladen","einbetten","medien","url"],group:"Medien"},emoji:{title:"Emoji",subtext:"Nach Emoji suchen und einfügen",aliases:["emoji","emote","emotion","gesicht"],group:"Andere"}},placeholders:{default:"Text eingeben oder '/' für Befehle tippen",heading:"Überschrift",bulletListItem:"Liste",numberedListItem:"Liste",checkListItem:"Liste"},file_blocks:{image:{add_button_text:"Bild hinzufügen"},video:{add_button_text:"Video hinzufügen"},audio:{add_button_text:"Audio hinzufügen"},file:{add_button_text:"Datei hinzufügen"}},side_menu:{add_block_label:"Block hinzufügen",drag_handle_label:"Blockmenü öffnen"},drag_handle:{delete_menuitem:"Löschen",colors_menuitem:"Farben"},table_handle:{delete_column_menuitem:"Spalte löschen",delete_row_menuitem:"Zeile löschen",add_left_menuitem:"Spalte links hinzufügen",add_right_menuitem:"Spalte rechts hinzufügen",add_above_menuitem:"Zeile oberhalb hinzufügen",add_below_menuitem:"Zeile unterhalb hinzufügen"},suggestion_menu:{no_items_title:"Keine Elemente gefunden",loading:"Laden…"},color_picker:{text_title:"Text",background_title:"Hintergrund",colors:{default:"Standard",gray:"Grau",brown:"Braun",red:"Rot",orange:"Orange",yellow:"Gelb",green:"Grün",blue:"Blau",purple:"Lila",pink:"Rosa"}},formatting_toolbar:{bold:{tooltip:"Fett",secondary_tooltip:"Mod+B"},italic:{tooltip:"Kursiv",secondary_tooltip:"Mod+I"},underline:{tooltip:"Unterstrichen",secondary_tooltip:"Mod+U"},strike:{tooltip:"Durchgestrichen",secondary_tooltip:"Mod+Shift+S"},code:{tooltip:"Code",secondary_tooltip:""},colors:{tooltip:"Farben"},link:{tooltip:"Link erstellen",secondary_tooltip:"Mod+K"},file_caption:{tooltip:"Beschriftung bearbeiten",input_placeholder:"Beschriftung bearbeiten"},file_replace:{tooltip:{image:"Bild ersetzen",video:"Video ersetzen",audio:"Audio ersetzen",file:"Datei ersetzen"}},file_rename:{tooltip:{image:"Bild umbenennen",video:"Video umbenennen",audio:"Audio umbenennen",file:"Datei umbenennen"},input_placeholder:{image:"Bild umbenennen",video:"Video umbenennen",audio:"Audio umbenennen",file:"Datei umbenennen"}},file_download:{tooltip:{image:"Bild herunterladen",video:"Video herunterladen",audio:"Audio herunterladen",file:"Datei herunterladen"}},file_delete:{tooltip:{image:"Bild löschen",video:"Video löschen",audio:"Audio löschen",file:"Datei löschen"}},file_preview_toggle:{tooltip:"Vorschau umschalten"},nest:{tooltip:"Block verschachteln",secondary_tooltip:"Tab"},unnest:{tooltip:"Block entnesten",secondary_tooltip:"Shift+Tab"},align_left:{tooltip:"Text linksbündig"},align_center:{tooltip:"Text zentrieren"},align_right:{tooltip:"Text rechtsbündig"},align_justify:{tooltip:"Text Blocksatz"}},file_panel:{upload:{title:"Hochladen",file_placeholder:{image:"Bild hochladen",video:"Video hochladen",audio:"Audio hochladen",file:"Datei hochladen"},upload_error:"Fehler: Hochladen fehlgeschlagen"},embed:{title:"Einbetten",embed_button:{image:"Bild einbetten",video:"Video einbetten",audio:"Audio einbetten",file:"Datei einbetten"},url_placeholder:"URL eingeben"}},link_toolbar:{delete:{tooltip:"Link entfernen"},edit:{text:"Link bearbeiten",tooltip:"Bearbeiten"},open:{tooltip:"In neuem Tab öffnen"},form:{title_placeholder:"Titel bearbeiten",url_placeholder:"URL bearbeiten"}},generic:{ctrl_shortcut:"Strg"}},ct={slash_menu:{heading:{title:"Heading 1",subtext:"Top-level heading",aliases:["h","heading1","h1"],group:"Headings"},heading_2:{title:"Heading 2",subtext:"Key section heading",aliases:["h2","heading2","subheading"],group:"Headings"},heading_3:{title:"Heading 3",subtext:"Subsection and group heading",aliases:["h3","heading3","subheading"],group:"Headings"},numbered_list:{title:"Numbered List",subtext:"List with ordered items",aliases:["ol","li","list","numberedlist","numbered list"],group:"Basic blocks"},bullet_list:{title:"Bullet List",subtext:"List with unordered items",aliases:["ul","li","list","bulletlist","bullet list"],group:"Basic blocks"},check_list:{title:"Check List",subtext:"List with checkboxes",aliases:["ul","li","list","checklist","check list","checked list","checkbox"],group:"Basic blocks"},paragraph:{title:"Paragraph",subtext:"The body of your document",aliases:["p","paragraph"],group:"Basic blocks"},code_block:{title:"Code Block",subtext:"Code block with syntax highlighting",aliases:["code","pre"],group:"Basic blocks"},table:{title:"Table",subtext:"Table with editable cells",aliases:["table"],group:"Advanced"},image:{title:"Image",subtext:"Resizable image with caption",aliases:["image","imageUpload","upload","img","picture","media","url"],group:"Media"},video:{title:"Video",subtext:"Resizable video with caption",aliases:["video","videoUpload","upload","mp4","film","media","url"],group:"Media"},audio:{title:"Audio",subtext:"Embedded audio with caption",aliases:["audio","audioUpload","upload","mp3","sound","media","url"],group:"Media"},file:{title:"File",subtext:"Embedded file",aliases:["file","upload","embed","media","url"],group:"Media"},emoji:{title:"Emoji",subtext:"Search for and insert an emoji",aliases:["emoji","emote","emotion","face"],group:"Others"}},placeholders:{default:"Enter text or type '/' for commands",heading:"Heading",bulletListItem:"List",numberedListItem:"List",checkListItem:"List"},file_blocks:{image:{add_button_text:"Add image"},video:{add_button_text:"Add video"},audio:{add_button_text:"Add audio"},file:{add_button_text:"Add file"}},side_menu:{add_block_label:"Add block",drag_handle_label:"Open block menu"},drag_handle:{delete_menuitem:"Delete",colors_menuitem:"Colors"},table_handle:{delete_column_menuitem:"Delete column",delete_row_menuitem:"Delete row",add_left_menuitem:"Add column left",add_right_menuitem:"Add column right",add_above_menuitem:"Add row above",add_below_menuitem:"Add row below"},suggestion_menu:{no_items_title:"No items found",loading:"Loading…"},color_picker:{text_title:"Text",background_title:"Background",colors:{default:"Default",gray:"Gray",brown:"Brown",red:"Red",orange:"Orange",yellow:"Yellow",green:"Green",blue:"Blue",purple:"Purple",pink:"Pink"}},formatting_toolbar:{bold:{tooltip:"Bold",secondary_tooltip:"Mod+B"},italic:{tooltip:"Italic",secondary_tooltip:"Mod+I"},underline:{tooltip:"Underline",secondary_tooltip:"Mod+U"},strike:{tooltip:"Strike",secondary_tooltip:"Mod+Shift+S"},code:{tooltip:"Code",secondary_tooltip:""},colors:{tooltip:"Colors"},link:{tooltip:"Create link",secondary_tooltip:"Mod+K"},file_caption:{tooltip:"Edit caption",input_placeholder:"Edit caption"},file_replace:{tooltip:{image:"Replace image",video:"Replace video",audio:"Replace audio",file:"Replace file"}},file_rename:{tooltip:{image:"Rename image",video:"Rename video",audio:"Rename audio",file:"Rename file"},input_placeholder:{image:"Rename image",video:"Rename video",audio:"Rename audio",file:"Rename file"}},file_download:{tooltip:{image:"Download image",video:"Download video",audio:"Download audio",file:"Download file"}},file_delete:{tooltip:{image:"Delete image",video:"Delete video",audio:"Delete audio",file:"Delete file"}},file_preview_toggle:{tooltip:"Toggle preview"},nest:{tooltip:"Nest block",secondary_tooltip:"Tab"},unnest:{tooltip:"Unnest block",secondary_tooltip:"Shift+Tab"},align_left:{tooltip:"Align text left"},align_center:{tooltip:"Align text center"},align_right:{tooltip:"Align text right"},align_justify:{tooltip:"Justify text"}},file_panel:{upload:{title:"Upload",file_placeholder:{image:"Upload image",video:"Upload video",audio:"Upload audio",file:"Upload file"},upload_error:"Error: Upload failed"},embed:{title:"Embed",embed_button:{image:"Embed image",video:"Embed video",audio:"Embed audio",file:"Embed file"},url_placeholder:"Enter URL"}},link_toolbar:{delete:{tooltip:"Remove link"},edit:{text:"Edit link",tooltip:"Edit"},open:{tooltip:"Open in new tab"},form:{title_placeholder:"Edit title",url_placeholder:"Edit URL"}},generic:{ctrl_shortcut:"Ctrl"}},Ii=Object.freeze(Object.defineProperty({__proto__:null,ar:Mi,de:Li,en:ct,es:{slash_menu:{heading:{title:"Encabezado 1",subtext:"Encabezado de primer nivel",aliases:["h","encabezado1","h1"],group:"Encabezados"},heading_2:{title:"Encabezado 2",subtext:"Encabezado de sección principal",aliases:["h2","encabezado2","subencabezado"],group:"Encabezados"},heading_3:{title:"Encabezado 3",subtext:"Encabezado de subsección y grupo",aliases:["h3","encabezado3","subencabezado"],group:"Encabezados"},numbered_list:{title:"Lista Numerada",subtext:"Lista con elementos ordenados",aliases:["ol","li","lista","lista numerada"],group:"Bloques básicos"},bullet_list:{title:"Lista con Viñetas",subtext:"Lista con elementos no ordenados",aliases:["ul","li","lista","lista con viñetas"],group:"Bloques básicos"},check_list:{title:"Lista de Verificación",subtext:"Lista con casillas de verificación",aliases:["ul","li","lista","lista de verificación","lista de chequeo","checkbox"],group:"Bloques básicos"},paragraph:{title:"Párrafo",subtext:"El cuerpo de tu documento",aliases:["p","párrafo"],group:"Bloques básicos"},code_block:{title:"Bloque de Código",subtext:"Bloque de código con resaltado de sintaxis",aliases:["code","pre"],group:"Bloques básicos"},table:{title:"Tabla",subtext:"Tabla con celdas editables",aliases:["tabla"],group:"Avanzado"},image:{title:"Imagen",subtext:"Imagen redimensionable con leyenda",aliases:["imagen","subir imagen","cargar","img","foto","media","url"],group:"Medios"},video:{title:"Vídeo",subtext:"Vídeo redimensionable con leyenda",aliases:["video","subir vídeo","cargar","mp4","película","media","url"],group:"Medios"},audio:{title:"Audio",subtext:"Audio incrustado con leyenda",aliases:["audio","subir audio","cargar","mp3","sonido","media","url"],group:"Medios"},file:{title:"Archivo",subtext:"Archivo incrustado",aliases:["archivo","cargar","incrustar","media","url"],group:"Medios"},emoji:{title:"Emoji",subtext:"Busca e inserta un emoji",aliases:["emoji","emoticono","emoción","cara"],group:"Otros"}},placeholders:{default:"Escribe o teclea '/' para comandos",heading:"Encabezado",bulletListItem:"Lista",numberedListItem:"Lista",checkListItem:"Lista"},file_blocks:{image:{add_button_text:"Agregar imagen"},video:{add_button_text:"Agregar vídeo"},audio:{add_button_text:"Agregar audio"},file:{add_button_text:"Agregar archivo"}},side_menu:{add_block_label:"Agregar bloque",drag_handle_label:"Abrir menú de bloque"},drag_handle:{delete_menuitem:"Eliminar",colors_menuitem:"Colores"},table_handle:{delete_column_menuitem:"Eliminar columna",delete_row_menuitem:"Eliminar fila",add_left_menuitem:"Agregar columna a la izquierda",add_right_menuitem:"Agregar columna a la derecha",add_above_menuitem:"Agregar fila arriba",add_below_menuitem:"Agregar fila abajo"},suggestion_menu:{no_items_title:"No se encontraron elementos",loading:"Cargando…"},color_picker:{text_title:"Texto",background_title:"Fondo",colors:{default:"Por defecto",gray:"Gris",brown:"Marrón",red:"Rojo",orange:"Naranja",yellow:"Amarillo",green:"Verde",blue:"Azul",purple:"Morado",pink:"Rosa"}},formatting_toolbar:{bold:{tooltip:"Negrita",secondary_tooltip:"Mod+B"},italic:{tooltip:"Cursiva",secondary_tooltip:"Mod+I"},underline:{tooltip:"Subrayado",secondary_tooltip:"Mod+U"},strike:{tooltip:"Tachado",secondary_tooltip:"Mod+Shift+S"},code:{tooltip:"Código",secondary_tooltip:""},colors:{tooltip:"Colores"},link:{tooltip:"Crear enlace",secondary_tooltip:"Mod+K"},file_caption:{tooltip:"Editar leyenda",input_placeholder:"Editar leyenda"},file_replace:{tooltip:{image:"Reemplazar imagen",video:"Reemplazar vídeo",audio:"Reemplazar audio",file:"Reemplazar archivo"}},file_rename:{tooltip:{image:"Renombrar imagen",video:"Renombrar vídeo",audio:"Renombrar audio",file:"Renombrar archivo"},input_placeholder:{image:"Renombrar imagen",video:"Renombrar vídeo",audio:"Renombrar audio",file:"Renombrar archivo"}},file_download:{tooltip:{image:"Descargar imagen",video:"Descargar vídeo",audio:"Descargar audio",file:"Descargar archivo"}},file_delete:{tooltip:{image:"Eliminar imagen",video:"Eliminar vídeo",audio:"Eliminar audio",file:"Eliminar archivo"}},file_preview_toggle:{tooltip:"Alternar vista previa"},nest:{tooltip:"Anidar bloque",secondary_tooltip:"Tab"},unnest:{tooltip:"Desanidar bloque",secondary_tooltip:"Shift+Tab"},align_left:{tooltip:"Alinear texto a la izquierda"},align_center:{tooltip:"Alinear texto al centro"},align_right:{tooltip:"Alinear texto a la derecha"},align_justify:{tooltip:"Justificar texto"}},file_panel:{upload:{title:"Subir",file_placeholder:{image:"Subir imagen",video:"Subir vídeo",audio:"Subir audio",file:"Subir archivo"},upload_error:"Error: Fallo en la subida"},embed:{title:"Incrustar",embed_button:{image:"Incrustar imagen",video:"Incrustar vídeo",audio:"Incrustar audio",file:"Incrustar archivo"},url_placeholder:"Introduce la URL"}},link_toolbar:{delete:{tooltip:"Eliminar enlace"},edit:{text:"Editar enlace",tooltip:"Editar"},open:{tooltip:"Abrir en nueva pestaña"},form:{title_placeholder:"Editar título",url_placeholder:"Editar URL"}},generic:{ctrl_shortcut:"Ctrl"}},fr:{slash_menu:{heading:{title:"Titre 1",subtext:"Utilisé pour un titre de premier niveau",aliases:["h","titre1","h1"],group:"Titres"},heading_2:{title:"Titre 2",subtext:"Utilisé pour les sections clés",aliases:["h2","titre2","sous-titre"],group:"Titres"},heading_3:{title:"Titre 3",subtext:"Utilisé pour les sous-sections et les titres de groupe",aliases:["h3","titre3","sous-titre"],group:"Titres"},numbered_list:{title:"Liste Numérotée",subtext:"Utilisé pour afficher une liste numérotée",aliases:["ol","li","liste","listenumérotée","liste numérotée"],group:"Blocs de base"},bullet_list:{title:"Liste à Puces",subtext:"Utilisé pour afficher une liste non ordonnée",aliases:["ul","li","liste","listeàpuces","liste à puces"],group:"Blocs de base"},check_list:{title:"Liste de vérification",subtext:"Utilisé pour afficher une liste avec des cases à cocher",aliases:["ul","li","liste","liste de vérification","liste cochée","case à cocher"],group:"Blocs de base"},paragraph:{title:"Paragraphe",subtext:"Utilisé pour le corps de votre document",aliases:["p","paragraphe"],group:"Blocs de base"},code_block:{title:"Bloc de code",subtext:"Bloc de code avec coloration syntaxique",aliases:["code","pre"],group:"Blocs de base"},table:{title:"Tableau",subtext:"Utilisé pour les tableaux",aliases:["tableau"],group:"Avancé"},image:{title:"Image",subtext:"Insérer une image",aliases:["image","uploadImage","télécharger","img","photo","média","url"],group:"Médias"},video:{title:"Vidéo",subtext:"Insérer une vidéo",aliases:["vidéo","téléchargerVidéo","téléverser","mp4","film","média","url"],group:"Média"},audio:{title:"Audio",subtext:"Insérer un audio",aliases:["audio","téléchargerAudio","téléverser","mp3","son","média","url"],group:"Média"},file:{title:"Fichier",subtext:"Insérer un fichier",aliases:["fichier","téléverser","intégrer","média","url"],group:"Média"},emoji:{title:"Emoji",subtext:"Utilisé pour insérer un emoji",aliases:["emoji","émoticône","émotion","visage"],group:"Autres"}},placeholders:{default:"Entrez du texte ou tapez '/' pour les commandes",heading:"Titre",bulletListItem:"Liste",numberedListItem:"Liste",checkListItem:"Liste"},file_blocks:{image:{add_button_text:"Ajouter une image"},video:{add_button_text:"Ajouter une vidéo"},audio:{add_button_text:"Ajouter un audio"},file:{add_button_text:"Ajouter un fichier"}},side_menu:{add_block_label:"Ajouter un bloc",drag_handle_label:"Ouvrir le menu du bloc"},drag_handle:{delete_menuitem:"Supprimer",colors_menuitem:"Couleurs"},table_handle:{delete_column_menuitem:"Supprimer la colonne",delete_row_menuitem:"Supprimer la ligne",add_left_menuitem:"Ajouter une colonne à gauche",add_right_menuitem:"Ajouter une colonne à droite",add_above_menuitem:"Ajouter une ligne au-dessus",add_below_menuitem:"Ajouter une ligne en dessous"},suggestion_menu:{no_items_title:"Aucun élément trouvé",loading:"Chargement…"},color_picker:{text_title:"Texte",background_title:"Fond",colors:{default:"Défaut",gray:"Gris",brown:"Marron",red:"Rouge",orange:"Orange",yellow:"Jaune",green:"Vert",blue:"Bleu",purple:"Violet",pink:"Rose"}},formatting_toolbar:{bold:{tooltip:"Gras",secondary_tooltip:"Mod+B"},italic:{tooltip:"Italique",secondary_tooltip:"Mod+I"},underline:{tooltip:"Souligner",secondary_tooltip:"Mod+U"},strike:{tooltip:"Barré",secondary_tooltip:"Mod+Shift+X"},code:{tooltip:"Code",secondary_tooltip:""},colors:{tooltip:"Couleurs"},link:{tooltip:"Créer un lien",secondary_tooltip:"Mod+K"},file_caption:{tooltip:"Modifier la légende",input_placeholder:"Modifier la légende"},file_replace:{tooltip:{image:"Remplacer l'image",video:"Remplacer la vidéo",audio:"Remplacer l'audio",file:"Remplacer le fichier"}},file_rename:{tooltip:{image:"Renommer l'image",video:"Renommer la vidéo",audio:"Renommer l'audio",file:"Renommer le fichier"},input_placeholder:{image:"Renommer l'image",video:"Renommer la vidéo",audio:"Renommer l'audio",file:"Renommer le fichier"}},file_download:{tooltip:{image:"Télécharger l'image",video:"Télécharger la vidéo",audio:"Télécharger l'audio",file:"Télécharger le fichier"}},file_delete:{tooltip:{image:"Supprimer l'image",video:"Supprimer la vidéo",audio:"Supprimer l'audio",file:"Supprimer le fichier"}},file_preview_toggle:{tooltip:"Basculer l'aperçu"},nest:{tooltip:"Emboîter le bloc",secondary_tooltip:"Tab"},unnest:{tooltip:"Démboîter le bloc",secondary_tooltip:"Shift+Tab"},align_left:{tooltip:"Aligner le texte à gauche"},align_center:{tooltip:"Aligner le texte au centre"},align_right:{tooltip:"Aligner le texte à droite"},align_justify:{tooltip:"Justifier le texte"}},file_panel:{upload:{title:"Télécharger",file_placeholder:{image:"Télécharger une image",video:"Télécharger une vidéo",audio:"Télécharger un fichier audio",file:"Télécharger un fichier"},upload_error:"Erreur : Échec du téléchargement"},embed:{title:"Intégrer",embed_button:{image:"Intégrer une image",video:"Intégrer une vidéo",audio:"Intégrer un fichier audio",file:"Intégrer un fichier"},url_placeholder:"Entrez l'URL"}},link_toolbar:{delete:{tooltip:"Supprimer le lien"},edit:{text:"Modifier le lien",tooltip:"Modifier"},open:{tooltip:"Ouvrir dans un nouvel onglet"},form:{title_placeholder:"Modifier le titre",url_placeholder:"Modifier l'URL"}},generic:{ctrl_shortcut:"Ctrl"}},hr:{slash_menu:{heading:{title:"Naslov 1",subtext:"Glavni naslov",aliases:["h","naslov1","h1"],group:"Naslovi"},heading_2:{title:"Naslov 2",subtext:"Naslov poglavlja",aliases:["h2","naslov2","podnaslov"],group:"Naslovi"},heading_3:{title:"Naslov 3",subtext:"Naslov podpoglavlja",aliases:["h3","naslov3","podnaslov"],group:"Naslovi"},numbered_list:{title:"Numerirani popis",subtext:"Popis s numeriranim stavkama",aliases:["poredaniPopis","stavkaPopisa","popis","numeriraniPopis","numerirani popis"],group:"Osnovni blokovi"},bullet_list:{title:"Popis s oznakama",subtext:"Popis s grafičkim oznakama",aliases:["neporedaniPopis","stavkaPopisa","popis","popisSOznakama","popis s oznakama"],group:"Osnovni blokovi"},check_list:{title:"Check lista",subtext:"Popis s kućicama za označavanje",aliases:["neporedaniPopis","stavkaPopisa","popis","popisZaProvjeru","check lista","označeni popis","kućicaZaOznačavanje"],group:"Osnovni blokovi"},paragraph:{title:"Normalan tekst",subtext:"Tekst paragrafa",aliases:["p","paragraf"],group:"Osnovni blokovi"},table:{title:"Tablica",subtext:"Tablica s podesivim ćelijama",aliases:["tablica"],group:"Napredno"},image:{title:"Slika",subtext:"Slika s podesivom veličinom i natpisom",aliases:["slika","učitavanjeSlike","učitaj","img","fotografija","medij","url"],group:"Mediji"},video:{title:"Video",subtext:"Video s podesivom veličinom i natpisom",aliases:["video","učitavanjeVidea","učitaj","mp4","film","medij","url"],group:"Mediji"},audio:{title:"Audio",subtext:"Audio s natpisom",aliases:["audio","učitavanjeAudija","učitaj","mp3","zvuk","medij","url"],group:"Mediji"},file:{title:"Datoteka",subtext:"Ugrađena datoteka",aliases:["datoteka","učitaj","ugradi","medij","url"],group:"Mediji"},emoji:{title:"Emoji",subtext:"Pretraži i umetni emoji",aliases:["emoji","emotikon","emocija","lice"],group:"Ostalo"}},placeholders:{default:"Unesi tekst ili upiši ‘/’ za naredbe",heading:"Naslov",bulletListItem:"Lista",numberedListItem:"Lista",checkListItem:"Lista"},file_blocks:{image:{add_button_text:"Dodaj sliku"},video:{add_button_text:"Dodaj video"},audio:{add_button_text:"Dodaj audio"},file:{add_button_text:"Dodaj datoteku"}},side_menu:{add_block_label:"Dodaj blok",drag_handle_label:"Meni za dodavanje bloka"},drag_handle:{delete_menuitem:"Ukloni",colors_menuitem:"Boje"},table_handle:{delete_column_menuitem:"Ukloni stupac",delete_row_menuitem:"Ukloni redak",add_left_menuitem:"Dodaj stupac lijevo",add_right_menuitem:"Dodaj stupac desno",add_above_menuitem:"Dodaj redak iznad",add_below_menuitem:"Dodaj redak ispod"},suggestion_menu:{no_items_title:"Stavke nisu pronađene",loading:"Učitavanje…"},color_picker:{text_title:"Tekst",background_title:"Pozadina",colors:{default:"Zadano",gray:"Siva",brown:"Smeđa",red:"Crvena",orange:"Narančasta",yellow:"Žuta",green:"Zelena",blue:"Plava",purple:"Ljubičasta",pink:"Ružičasta"}},formatting_toolbar:{bold:{tooltip:"Podebljano",secondary_tooltip:"Mod+B"},italic:{tooltip:"Kurziv",secondary_tooltip:"Mod+I"},underline:{tooltip:"Podcrtano",secondary_tooltip:"Mod+U"},strike:{tooltip:"Precrtano",secondary_tooltip:"Mod+Shift+S"},code:{tooltip:"Kod",secondary_tooltip:""},colors:{tooltip:"Boja"},link:{tooltip:"Kreiraj poveznicu",secondary_tooltip:"Mod+K"},file_caption:{tooltip:"Uredi natpis",input_placeholder:"Uredi natpis"},file_replace:{tooltip:{image:"Zamijeni sliku",video:"Zamijeni video",audio:"Zamijeni audio",file:"Zamijeni datoteku"}},file_rename:{tooltip:{image:"Preimenuj sliku",video:"Preimenuj video",audio:"Preimenuj audio",file:"Preimenuj datoteku"},input_placeholder:{image:"Preimenuj sliku",video:"Preimenuj video",audio:"Preimenuj audio",file:"Preimenuj datoteku"}},file_download:{tooltip:{image:"Preuzmi sliku",video:"Preuzmi video",audio:"Preuzmi audio",file:"Preuzmi datoteku"}},file_delete:{tooltip:{image:"Ukloni sliku",video:"Ukloni video",audio:"Ukloni audio",file:"Ukloni datoteku"}},file_preview_toggle:{tooltip:"Prikaži/sakrij pregled"},nest:{tooltip:"Ugnijezdi blok",secondary_tooltip:"Tab"},unnest:{tooltip:"Razgnijezdi blok",secondary_tooltip:"Shift+Tab"},align_left:{tooltip:"Poravnaj tekst lijevo"},align_center:{tooltip:"Poravnaj tekst po sredini"},align_right:{tooltip:"Poravnaj tekst desno"},align_justify:{tooltip:"Poravnaj tekst obostrano"}},file_panel:{upload:{title:"Učitaj",file_placeholder:{image:"Učitaj sliku",video:"Učitaj video",audio:"Učitaj audio",file:"Učitaj datoteku"},upload_error:"Pogreška: Učitavanje nije uspjelo"},embed:{title:"Ugradi",embed_button:{image:"Ugradi sliku",video:"Ugradi video",audio:"Ugradi audio",file:"Ugradi datoteku"},url_placeholder:"Dodaj URL"}},link_toolbar:{delete:{tooltip:"Ukloni poveznicu"},edit:{text:"Uredi poveznicu",tooltip:"Uredi"},open:{tooltip:"Otvori u novoj kartici"},form:{title_placeholder:"Uredi naslov",url_placeholder:"Uredi URL"}},generic:{ctrl_shortcut:"Ctrl"}},is:{slash_menu:{heading:{title:"Fyrirsögn 1",subtext:"Notað fyrir efstu fyrirsögn",aliases:["h","fyrirsogn1","h1"],group:"Fyrirsagnir"},heading_2:{title:"Fyrirsögn 2",subtext:"Notað fyrir lykilhluta",aliases:["h2","fyrirsogn2","undirfyrirsogn"],group:"Fyrirsagnir"},heading_3:{title:"Fyrirsögn 3",subtext:"Notað fyrir undirhluta og hópfyrirsagnir",aliases:["h3","fyrirsogn3","undirfyrirsogn"],group:"Fyrirsagnir"},numbered_list:{title:"Númeruð listi",subtext:"Notað til að birta númeraðan lista",aliases:["ol","li","listi","numeradurlisti"],group:"Grunnblokkar"},bullet_list:{title:"Punktalisti",subtext:"Notað til að birta óraðaðan lista",aliases:["ul","li","listi","punktalisti"],group:"Grunnblokkar"},check_list:{title:"Athugunarlisti",subtext:"Notað til að sýna lista með gátreitum",aliases:["ul","li","listi","athugunarlisti","merktur listi"],group:"Grunnblokkar"},paragraph:{title:"Málsgrein",subtext:"Notað fyrir meginmál skjalsins",aliases:["p","malsgrein"],group:"Grunnblokkar"},code_block:{title:"Kóðablokk",subtext:"Kóðablokkur með litskiptingu",aliases:["kóði","pre"],group:"Grunnblokkar"},table:{title:"Tafla",subtext:"Notað fyrir töflur",aliases:["tafla"],group:"Ítarlegt"},image:{title:"Mynd",subtext:"Settu inn mynd",aliases:["mynd","myndaupphlaed","upphlaed","img","mynd","media","url"],group:"Miðlar"},video:{title:"Myndband",subtext:"Setja inn myndband",aliases:["myndband","videoUpphala","hlaða upp","mp4","kvikmynd","miðill","url"],group:"Miðill"},audio:{title:"Hljóð",subtext:"Setja inn hljóð",aliases:["hljóð","audioUpphala","hlaða upp","mp3","hljóð","miðill","url"],group:"Miðlar"},file:{title:"Skrá",subtext:"Setja inn skrá",aliases:["skrá","hlaða upp","fella inn","miðill","url"],group:"Miðlar"},emoji:{title:"Emoji",subtext:"Notað til að setja inn smámynd",aliases:["emoji","andlitsávísun","tilfinningar","andlit"],group:"Annað"}},placeholders:{default:"Sláðu inn texta eða skrifaðu '/' fyrir skipanir",heading:"Fyrirsögn",bulletListItem:"Listi",numberedListItem:"Listi",checkListItem:"Listi"},file_blocks:{image:{add_button_text:"Bæta við mynd"},video:{add_button_text:"Bæta við myndbandi"},audio:{add_button_text:"Bæta við hljóði"},file:{add_button_text:"Bæta við skrá"}},side_menu:{add_block_label:"Bæta við blokki",drag_handle_label:"Opna blokkarvalmynd"},drag_handle:{delete_menuitem:"Eyða",colors_menuitem:"Litir"},table_handle:{delete_column_menuitem:"Eyða dálki",delete_row_menuitem:"Eyða röð",add_left_menuitem:"Bæta dálki við til vinstri",add_right_menuitem:"Bæta dálki við til hægri",add_above_menuitem:"Bæta röð við fyrir ofan",add_below_menuitem:"Bæta röð við fyrir neðan"},suggestion_menu:{no_items_title:"Engir hlutir fundust",loading:"Hleður…"},color_picker:{text_title:"Texti",background_title:"Bakgrunnur",colors:{default:"Sjálfgefið",gray:"Grár",brown:"Brúnn",red:"Rauður",orange:"Appelsínugulur",yellow:"Gulur",green:"Grænn",blue:"Blár",purple:"Fjólublár",pink:"Bleikur"}},formatting_toolbar:{bold:{tooltip:"Feitletrað",secondary_tooltip:"Mod+B"},italic:{tooltip:"Skáletrað",secondary_tooltip:"Mod+I"},underline:{tooltip:"Undirstrikað",secondary_tooltip:"Mod+U"},strike:{tooltip:"Yfirstrikað",secondary_tooltip:"Mod+Shift+X"},code:{tooltip:"Kóði",secondary_tooltip:""},colors:{tooltip:"Litir"},link:{tooltip:"Búa til tengil",secondary_tooltip:"Mod+K"},file_caption:{tooltip:"Breyta myndatexta",input_placeholder:"Breyta myndatexta"},file_replace:{tooltip:{image:"Skipta um mynd",video:"Skipta um myndband",audio:"Skipta um hljóð",file:"Skipta um skrá"}},file_rename:{tooltip:{image:"Endurnefna mynd",video:"Endurnefna myndband",audio:"Endurnefna hljóð",file:"Endurnefna skrá"},input_placeholder:{image:"Endurnefna mynd",video:"Endurnefna myndband",audio:"Endurnefna hljóð",file:"Endurnefna skrá"}},file_download:{tooltip:{image:"Sækja mynd",video:"Sækja myndband",audio:"Sækja hljóð",file:"Sækja skrá"}},file_delete:{tooltip:{image:"Eyða mynd",video:"Eyða myndbandi",audio:"Eyða hljóði",file:"Eyða skrá"}},file_preview_toggle:{tooltip:"Skipta um forskoðun"},nest:{tooltip:"Fella blokk saman",secondary_tooltip:"Tab"},unnest:{tooltip:"Afþýða blokk",secondary_tooltip:"Shift+Tab"},align_left:{tooltip:"Vinstrijafna texta"},align_center:{tooltip:"Miðjustilla texta"},align_right:{tooltip:"Hægrijafna texta"},align_justify:{tooltip:"Jafna texta"}},file_panel:{upload:{title:"Hlaða upp",file_placeholder:{image:"Hlaða upp mynd",video:"Hlaða upp myndband",audio:"Hlaða upp hljóð",file:"Hlaða upp skrá"},upload_error:"Villa: Upphleðsla mistókst"},embed:{title:"Innsetja",embed_button:{image:"Innsetja mynd",video:"Innsetja myndband",audio:"Innsetja hljóð",file:"Innsetja skrá"},url_placeholder:"Sláðu inn URL"}},link_toolbar:{delete:{tooltip:"Fjarlægja tengil"},edit:{text:"Breyta tengli",tooltip:"Breyta"},open:{tooltip:"Opna í nýjum flipa"},form:{title_placeholder:"Breyta titli",url_placeholder:"Breyta URL"}},generic:{ctrl_shortcut:"Ctrl"}},ja:{slash_menu:{heading:{title:"見出し1",subtext:"トップレベルの見出しに使用",aliases:["h","見出し1","h1","大見出し"],group:"見出し"},heading_2:{title:"見出し2",subtext:"重要なセクションに使用",aliases:["h2","見出し2","subheading","中見出し"],group:"見出し"},heading_3:{title:"見出し3",subtext:"セクションやグループの見出しに使用",aliases:["h3","見出し3","subheading","小見出し"],group:"見出し"},numbered_list:{title:"番号付リスト",subtext:"番号付リストを表示するために使用",aliases:["ol","li","numberedlist","numbered list","リスト","番号付リスト","番号 リスト"],group:"基本ブロック"},bullet_list:{title:"箇条書き",subtext:"箇条書きを表示するために使用",aliases:["ul","li","bulletlist","bullet list","リスト","箇条書きリスト"],group:"基本ブロック"},check_list:{title:"チェックリスト",subtext:"チェックボックス付きリストを表示するために使用されます",aliases:["ul","li","list","checklist","checked list","リスト","チェックリスト","チェックされたリスト"],group:"基本ブロック"},paragraph:{title:"標準テキスト",subtext:"本文に使用",aliases:["p","paragraph","標準テキスト"],group:"基本ブロック"},code_block:{title:"コードブロック",subtext:"シンタックスハイライト付きのコードブロック",aliases:["code","pre","コード","コードブロック"],group:"基本ブロック"},table:{title:"表",subtext:"表に使用",aliases:["table","表","テーブル"],group:"高度なブロック"},image:{title:"画像",subtext:"画像を挿入",aliases:["image","imageUpload","upload","img","picture","media","url","画像"],group:"メディア"},video:{title:"ビデオ",subtext:"ビデオを挿入",aliases:["video","videoUpload","upload","mp4","film","media","url","ビデオ"],group:"メディア"},audio:{title:"オーディオ",subtext:"オーディオを挿入",aliases:["audio","audioUpload","upload","mp3","sound","media","url","オーディオ"],group:"メディア"},file:{title:"ファイル",subtext:"ファイルを挿入",aliases:["file","upload","embed","media","url","ファイル"],group:"メディア"},emoji:{title:"絵文字",subtext:"絵文字を挿入するために使用します",aliases:["絵文字","顔文字","感情表現","顔"],group:"その他"}},placeholders:{default:"テキストを入力するか'/' を入力してコマンド選択",heading:"見出し",bulletListItem:"リストを追加",numberedListItem:"リストを追加",checkListItem:"リストを追加"},file_blocks:{image:{add_button_text:"画像を追加"},video:{add_button_text:"ビデオを追加"},audio:{add_button_text:"オーディオを追加"},file:{add_button_text:"ファイルを追加"}},side_menu:{add_block_label:"ブロックを追加",drag_handle_label:"ブロックメニュー"},drag_handle:{delete_menuitem:"削除",colors_menuitem:"色を変更"},table_handle:{delete_column_menuitem:"列を削除",delete_row_menuitem:"行を削除",add_left_menuitem:"左に列を追加",add_right_menuitem:"右に列を追加",add_above_menuitem:"上に行を追加",add_below_menuitem:"下に行を追加"},suggestion_menu:{no_items_title:"アイテムが見つかりません",loading:"読込中…"},color_picker:{text_title:"文字色",background_title:"背景色",colors:{default:"デフォルト",gray:"グレー",brown:"茶色",red:"赤",orange:"オレンジ",yellow:"黄色",green:"緑",blue:"青",purple:"紫",pink:"ピンク"}},formatting_toolbar:{bold:{tooltip:"太字",secondary_tooltip:"Mod+B"},italic:{tooltip:"斜体",secondary_tooltip:"Mod+I"},underline:{tooltip:"下線",secondary_tooltip:"Mod+U"},strike:{tooltip:"打ち消し",secondary_tooltip:"Mod+Shift+X"},code:{tooltip:"コード",secondary_tooltip:""},colors:{tooltip:"色"},link:{tooltip:"リンク",secondary_tooltip:"Mod+K"},file_caption:{tooltip:"キャプションを編集",input_placeholder:"キャプションを編集"},file_replace:{tooltip:{image:"画像を置換",video:"ビデオを置換",audio:"オーディオを置換",file:"ファイルを置換"}},file_rename:{tooltip:{image:"画像の名前を変更",video:"ビデオの名前を変更",audio:"オーディオの名前を変更",file:"ファイルの名前を変更"},input_placeholder:{image:"画像の名前を変更",video:"ビデオの名前を変更",audio:"オーディオの名前を変更",file:"ファイルの名前を変更"}},file_download:{tooltip:{image:"画像をダウンロード",video:"ビデオをダウンロード",audio:"オーディオをダウンロード",file:"ファイルをダウンロード"}},file_delete:{tooltip:{image:"画像を削除",video:"ビデオを削除",audio:"オーディオを削除",file:"ファイルを削除"}},file_preview_toggle:{tooltip:"プレビューの切り替え"},nest:{tooltip:"インデント増",secondary_tooltip:"Tab"},unnest:{tooltip:"インデント減",secondary_tooltip:"Shift+Tab"},align_left:{tooltip:"左揃え"},align_center:{tooltip:"中央揃え"},align_right:{tooltip:"右揃え"},align_justify:{tooltip:"両端揃え"}},file_panel:{upload:{title:"アップロード",file_placeholder:{image:"画像をアップロード",video:"ビデオをアップロード",audio:"オーディオをアップロード",file:"ファイルをアップロード"},upload_error:"エラー: アップロードが失敗しました"},embed:{title:"埋め込み",embed_button:{image:"画像を埋め込む",video:"ビデオを埋め込む",audio:"オーディオを埋め込む",file:"ファイルを埋め込む"},url_placeholder:"URLを入力"}},link_toolbar:{delete:{tooltip:"リンクを解除"},edit:{text:"リンクを編集",tooltip:"編集"},open:{tooltip:"新しいタブでリンクを開く"},form:{title_placeholder:"タイトルを編集",url_placeholder:"URLを編集"}},generic:{ctrl_shortcut:"Ctrl"}},ko:{slash_menu:{heading:{title:"제목1",subtext:"섹션 제목(대)",aliases:["h","제목1","h1","대제목"],group:"제목"},heading_2:{title:"제목2",subtext:"섹션 제목(중)",aliases:["h2","제목2","중제목"],group:"제목"},heading_3:{title:"제목3",subtext:"섹션 제목(소)",aliases:["h3","제목3","subheading"],group:"제목"},numbered_list:{title:"번호 매기기 목록",subtext:"번호가 매겨진 목록을 추가합니다.",aliases:["ol","li","목록","번호 매기기 목록","번호 목록"],group:"기본 블록"},bullet_list:{title:"글머리 기호 목록",subtext:"간단한 글머리 기호를 추가합니다.",aliases:["ul","li","목록","글머리 기호 목록","글머리 목록"],group:"기본 블록"},check_list:{title:"체크리스트",subtext:"체크박스가 있는 목록을 표시하는 데 사용",aliases:["ul","li","목록","체크리스트","체크 리스트","체크된 목록","체크박스"],group:"기본 블록"},paragraph:{title:"본문",subtext:"일반 텍스트",aliases:["p","paragraph","본문"],group:"기본 블록"},code_block:{title:"코드 블록",subtext:"구문 강조가 있는 코드 블록",aliases:["code","pre"],group:"기본 블록"},table:{title:"표",subtext:"간단한 표를 추가합니다.",aliases:["표"],group:"고급"},image:{title:"이미지",subtext:"이미지 파일을 업로드합니다.",aliases:["image","imageUpload","upload","img","picture","media","이미지","url"],group:"미디어"},video:{title:"비디오",subtext:"비디오 삽입",aliases:["video","videoUpload","upload","mp4","film","media","동영상","url"],group:"미디어"},audio:{title:"오디오",subtext:"오디오 삽입",aliases:["audio","audioUpload","upload","mp3","sound","media","오디오","url"],group:"미디어"},file:{title:"파일",subtext:"파일 삽입",aliases:["file","upload","embed","media","파일","url"],group:"미디어"},emoji:{title:"이모지",subtext:"이모지 삽입용으로 사용됩니다",aliases:["이모지","emoji","감정 표현","emotion expression","표정","face expression","얼굴","face"],group:"기타"}},placeholders:{default:"텍스트를 입력하거나 /를 입력하여 명령을 입력하세요.",heading:"제목",bulletListItem:"목록",numberedListItem:"목록",checkListItem:"목록"},file_blocks:{image:{add_button_text:"이미지 추가"},video:{add_button_text:"비디오 추가"},audio:{add_button_text:"오디오 추가"},file:{add_button_text:"파일 추가"}},side_menu:{add_block_label:"블록 추가",drag_handle_label:"블록 메뉴 열기"},drag_handle:{delete_menuitem:"삭제",colors_menuitem:"색깔"},table_handle:{delete_column_menuitem:"열 1개 삭제",delete_row_menuitem:"행 삭제",add_left_menuitem:"왼쪽에 열 1개 추가",add_right_menuitem:"오른쪽에 열 1개 추가",add_above_menuitem:"위에 행 1개 추가",add_below_menuitem:"아래에 행 1개 추가"},suggestion_menu:{no_items_title:"항목을 찾을 수 없음",loading:"로딩 중…"},color_picker:{text_title:"텍스트",background_title:"배경",colors:{default:"기본",gray:"회색",brown:"갈색",red:"빨간색",orange:"주황색",yellow:"노란색",green:"녹색",blue:"파란색",purple:"보라색",pink:"분홍색"}},formatting_toolbar:{bold:{tooltip:"진하게",secondary_tooltip:"Mod+B"},italic:{tooltip:"기울임",secondary_tooltip:"Mod+I"},underline:{tooltip:"밑줄",secondary_tooltip:"Mod+U"},strike:{tooltip:"취소선",secondary_tooltip:"Mod+Shift+X"},code:{tooltip:"코드",secondary_tooltip:""},colors:{tooltip:"색깔"},link:{tooltip:"링크 만들기",secondary_tooltip:"Mod+K"},file_caption:{tooltip:"이미지 캡션 수정",input_placeholder:"이미지 캡션 수정"},file_replace:{tooltip:{image:"이미지 교체",video:"비디오 교체",audio:"오디오 교체",file:"파일 교체"}},file_rename:{tooltip:{image:"이미지 이름 변경",video:"비디오 이름 변경",audio:"오디오 이름 변경",file:"파일 이름 변경"},input_placeholder:{image:"이미지 이름 변경",video:"비디오 이름 변경",audio:"오디오 이름 변경",file:"파일 이름 변경"}},file_download:{tooltip:{image:"이미지 다운로드",video:"비디오 다운로드",audio:"오디오 다운로드",file:"파일 다운로드"}},file_delete:{tooltip:{image:"이미지 삭제",video:"비디오 삭제",audio:"오디오 삭제",file:"파일 삭제"}},file_preview_toggle:{tooltip:"미리보기 전환"},nest:{tooltip:"중첩 블록",secondary_tooltip:"Tab"},unnest:{tooltip:"비중첩 블록",secondary_tooltip:"Shift+Tab"},align_left:{tooltip:"텍스트 왼쪽 맞춤"},align_center:{tooltip:"텍스트 가운데 맞춤"},align_right:{tooltip:"텍스트 오른쪽 맞춤"},align_justify:{tooltip:"텍스트 양쪽 맞춤"}},file_panel:{upload:{title:"업로드",file_placeholder:{image:"이미지 업로드",video:"비디오 업로드",audio:"오디오 업로드",file:"파일 업로드"},upload_error:"오류: 업로드 실패"},embed:{title:"임베드",embed_button:{image:"이미지 삽입",video:"비디오 삽입",audio:"오디오 삽입",file:"파일 삽입"},url_placeholder:"URL을 입력하세요."}},link_toolbar:{delete:{tooltip:"링크 삭제"},edit:{text:"링크 수정",tooltip:"수정"},open:{tooltip:"새 탭으로 열기"},form:{title_placeholder:"제목 수정",url_placeholder:"URL 수정"}},generic:{ctrl_shortcut:"Ctrl"}},nl:{slash_menu:{heading:{title:"Kop 1",subtext:"Gebruikt voor een hoofdkop",aliases:["h","kop1","h1"],group:"Koppen"},heading_2:{title:"Kop 2",subtext:"Gebruikt voor belangrijke secties",aliases:["h2","kop2","subkop"],group:"Koppen"},heading_3:{title:"Kop 3",subtext:"Gebruikt voor subsecties en groepskoppen",aliases:["h3","kop3","subkop"],group:"Koppen"},numbered_list:{title:"Genummerde Lijst",subtext:"Gebruikt om een genummerde lijst weer te geven",aliases:["ol","li","lijst","genummerdelijst","genummerde lijst"],group:"Basisblokken"},bullet_list:{title:"Puntenlijst",subtext:"Gebruikt om een ongeordende lijst weer te geven",aliases:["ul","li","lijst","puntenlijst","punten lijst"],group:"Basisblokken"},check_list:{title:"Controlelijst",subtext:"Gebruikt om een lijst met selectievakjes weer te geven",aliases:["ul","li","lijst","aangevinkte lijst","selectievakje"],group:"Basisblokken"},paragraph:{title:"Paragraaf",subtext:"Gebruikt voor de hoofdtekst van uw document",aliases:["p","paragraaf"],group:"Basisblokken"},code_block:{title:"Codeblok",subtext:"Codeblok met syntax highlighting",aliases:["code","pre"],group:"Basisblokken"},table:{title:"Tabel",subtext:"Gebruikt voor tabellen",aliases:["tabel"],group:"Geavanceerd"},image:{title:"Afbeelding",subtext:"Voeg een afbeelding in",aliases:["afbeelding","imageUpload","upload","img","foto","media","url"],group:"Media"},video:{title:"Video",subtext:"Voeg een video in",aliases:["video","videoUploaden","upload","mp4","film","media","url","drive","dropbox"],group:"Media"},audio:{title:"Audio",subtext:"Voeg audio in",aliases:["audio","audioUploaden","upload","mp3","geluid","media","url"],group:"Media"},file:{title:"Bestand",subtext:"Voeg een bestand in",aliases:["bestand","upload","insluiten","media","url"],group:"Media"},emoji:{title:"Emoji",subtext:"Gebruikt voor het invoegen van een emoji",aliases:["emoji","emotie-uitdrukking","gezichtsuitdrukking","gezicht"],group:"Overig"}},placeholders:{default:"Voer tekst in of type '/' voor commando's",heading:"Kop",bulletListItem:"Lijst",numberedListItem:"Lijst",checkListItem:"Lijst"},file_blocks:{image:{add_button_text:"Afbeelding toevoegen"},video:{add_button_text:"Video toevoegen"},audio:{add_button_text:"Audio toevoegen"},file:{add_button_text:"Bestand toevoegen"}},side_menu:{add_block_label:"Nieuw blok",drag_handle_label:"Open blok menu"},drag_handle:{delete_menuitem:"Verwijder",colors_menuitem:"Kleuren"},table_handle:{delete_column_menuitem:"Verwijder kolom",delete_row_menuitem:"Verwijder rij",add_left_menuitem:"Voeg kolom links toe",add_right_menuitem:"Voeg kolom rechts toe",add_above_menuitem:"Voeg rij boven toe",add_below_menuitem:"Voeg rij onder toe"},suggestion_menu:{no_items_title:"Geen items gevonden",loading:"Laden…"},color_picker:{text_title:"Tekst",background_title:"Achtergrond",colors:{default:"Standaard",gray:"Grijs",brown:"Bruin",red:"Rood",orange:"Oranje",yellow:"Geel",green:"Groen",blue:"Blauw",purple:"Paars",pink:"Roze"}},formatting_toolbar:{bold:{tooltip:"Vet",secondary_tooltip:"Mod+B"},italic:{tooltip:"Cursief",secondary_tooltip:"Mod+I"},underline:{tooltip:"Onderstrepen",secondary_tooltip:"Mod+U"},strike:{tooltip:"Doorstrepen",secondary_tooltip:"Mod+Shift+X"},code:{tooltip:"Code",secondary_tooltip:""},colors:{tooltip:"Kleuren"},link:{tooltip:"Maak link",secondary_tooltip:"Mod+K"},file_caption:{tooltip:"Bewerk onderschrift",input_placeholder:"Bewerk onderschrift"},file_replace:{tooltip:{image:"Afbeelding vervangen",video:"Video vervangen",audio:"Audio vervangen",file:"Bestand vervangen"}},file_rename:{tooltip:{image:"Afbeelding hernoemen",video:"Video hernoemen",audio:"Audio hernoemen",file:"Bestand hernoemen"},input_placeholder:{image:"Afbeelding hernoemen",video:"Video hernoemen",audio:"Audio hernoemen",file:"Bestand hernoemen"}},file_download:{tooltip:{image:"Afbeelding downloaden",video:"Video downloaden",audio:"Audio downloaden",file:"Bestand downloaden"}},file_delete:{tooltip:{image:"Afbeelding verwijderen",video:"Video verwijderen",audio:"Audio verwijderen",file:"Bestand verwijderen"}},file_preview_toggle:{tooltip:"Voorbeeldschakelaar"},nest:{tooltip:"Nest blok",secondary_tooltip:"Tab"},unnest:{tooltip:"Ontnest blok",secondary_tooltip:"Shift+Tab"},align_left:{tooltip:"Tekst links uitlijnen"},align_center:{tooltip:"Tekst centreren"},align_right:{tooltip:"Tekst rechts uitlijnen"},align_justify:{tooltip:"Tekst uitvullen"}},file_panel:{upload:{title:"Upload",file_placeholder:{image:"Afbeelding uploaden",video:"Video uploaden",audio:"Audio uploaden",file:"Bestand uploaden"},upload_error:"Fout: Upload mislukt"},embed:{title:"Insluiten",embed_button:{image:"Afbeelding insluiten",video:"Video insluiten",audio:"Audio insluiten",file:"Bestand insluiten"},url_placeholder:"Voer URL in"}},link_toolbar:{delete:{tooltip:"Verwijder link"},edit:{text:"Bewerk link",tooltip:"Bewerk"},open:{tooltip:"Open in nieuw tabblad"},form:{title_placeholder:"Bewerk titel",url_placeholder:"Bewerk URL"}},generic:{ctrl_shortcut:"Ctrl"}},pl:{slash_menu:{heading:{title:"Nagłówek 1",subtext:"Używany dla nagłówka najwyższego poziomu",aliases:["h","naglowek1","h1"],group:"Nagłówki"},heading_2:{title:"Nagłówek 2",subtext:"Używany dla kluczowych sekcji",aliases:["h2","naglowek2","podnaglowek"],group:"Nagłówki"},heading_3:{title:"Nagłówek 3",subtext:"Używany dla podsekcji i grup nagłówków",aliases:["h3","naglowek3","podnaglowek"],group:"Nagłówki"},numbered_list:{title:"Lista numerowana",subtext:"Używana do wyświetlania listy numerowanej",aliases:["ol","li","lista","numerowana lista"],group:"Podstawowe bloki"},bullet_list:{title:"Lista punktowana",subtext:"Używana do wyświetlania listy bez numeracji",aliases:["ul","li","lista","punktowana lista"],group:"Podstawowe bloki"},check_list:{title:"Lista z polami wyboru",subtext:"Używana do wyświetlania listy z polami wyboru",aliases:["ul","li","lista","lista z polami wyboru","pole wyboru"],group:"Podstawowe bloki"},paragraph:{title:"Akapit",subtext:"Używany dla treści dokumentu",aliases:["p","akapit"],group:"Podstawowe bloki"},code_block:{title:"Blok kodu",subtext:"Blok kodu z podświetleniem składni",aliases:["kod","pre"],group:"Podstawowe bloki"},table:{title:"Tabela",subtext:"Używana do tworzenia tabel",aliases:["tabela"],group:"Zaawansowane"},image:{title:"Zdjęcie",subtext:"Wstaw zdjęcie",aliases:["obraz","wrzućZdjęcie","wrzuć","img","zdjęcie","media","url"],group:"Media"},video:{title:"Wideo",subtext:"Wstaw wideo",aliases:["wideo","wrzućWideo","wrzuć","mp4","film","media","url"],group:"Media"},audio:{title:"Audio",subtext:"Wstaw audio",aliases:["audio","wrzućAudio","wrzuć","mp3","dźwięk","media","url"],group:"Media"},file:{title:"Plik",subtext:"Wstaw plik",aliases:["plik","wrzuć","wstaw","media","url"],group:"Media"},emoji:{title:"Emoji",subtext:"Używane do wstawiania emoji",aliases:["emoji","emotka","wyrażenie emocji","twarz"],group:"Inne"}},placeholders:{default:"Wprowadź tekst lub wpisz '/' aby użyć poleceń",heading:"Nagłówek",bulletListItem:"Lista",numberedListItem:"Lista",checkListItem:"Lista"},file_blocks:{image:{add_button_text:"Dodaj zdjęcie"},video:{add_button_text:"Dodaj wideo"},audio:{add_button_text:"Dodaj audio"},file:{add_button_text:"Dodaj plik"}},side_menu:{add_block_label:"Dodaj blok",drag_handle_label:"Otwórz menu bloków"},drag_handle:{delete_menuitem:"Usuń",colors_menuitem:"Kolory"},table_handle:{delete_column_menuitem:"Usuń kolumnę",delete_row_menuitem:"Usuń wiersz",add_left_menuitem:"Dodaj kolumnę po lewej",add_right_menuitem:"Dodaj kolumnę po prawej",add_above_menuitem:"Dodaj wiersz powyżej",add_below_menuitem:"Dodaj wiersz poniżej"},suggestion_menu:{no_items_title:"Nie znaleziono elementów",loading:"Ładowanie…"},color_picker:{text_title:"Tekst",background_title:"Tło",colors:{default:"Domyślny",gray:"Szary",brown:"Brązowy",red:"Czerwony",orange:"Pomarańczowy",yellow:"Żółty",green:"Zielony",blue:"Niebieski",purple:"Fioletowy",pink:"Różowy"}},formatting_toolbar:{bold:{tooltip:"Pogrubienie",secondary_tooltip:"Mod+B"},italic:{tooltip:"Kursywa",secondary_tooltip:"Mod+I"},underline:{tooltip:"Podkreślenie",secondary_tooltip:"Mod+U"},strike:{tooltip:"Przekreślenie",secondary_tooltip:"Mod+Shift+X"},code:{tooltip:"Kod",secondary_tooltip:""},colors:{tooltip:"Kolory"},link:{tooltip:"Utwórz link",secondary_tooltip:"Mod+K"},file_caption:{tooltip:"Zmień podpis",input_placeholder:"Zmień podpis"},file_replace:{tooltip:{image:"Zmień obraz",video:"Zmień wideo",audio:"Zmień audio",file:"Zmień plik"}},file_rename:{tooltip:{image:"Zmień nazwę zdjęcia",video:"Zmień nazwę wideo",audio:"Zmień nazwę audio",file:"Zmień nazwę pliku"},input_placeholder:{image:"Zmień nazwę zdjęcia",video:"Zmień nazwę wideo",audio:"Zmień nazwę audio",file:"Zmień nazwę pliku"}},file_download:{tooltip:{image:"Pobierz zdjęcie",video:"Pobierz wideo",audio:"Pobierz audio",file:"Pobierz plik"}},file_delete:{tooltip:{image:"Usuń zdjęcie",video:"Usuń wideo",audio:"Usuń audio",file:"Usuń plik"}},file_preview_toggle:{tooltip:"Przełącz podgląd"},nest:{tooltip:"Zagnieźdź blok",secondary_tooltip:"Tab"},unnest:{tooltip:"Odgagnieźdź blok",secondary_tooltip:"Shift+Tab"},align_left:{tooltip:"Wyrównaj tekst do lewej"},align_center:{tooltip:"Wyśrodkuj tekst"},align_right:{tooltip:"Wyrównaj tekst do prawej"},align_justify:{tooltip:"Wyjustuj tekst"}},file_panel:{upload:{title:"Wrzuć",file_placeholder:{image:"Wrzuć zdjęcie",video:"Wrzuć wideo",audio:"Wrzuć audio",file:"Wrzuć plik"},upload_error:"Błąd: Przesyłanie nie powiodło się"},embed:{title:"Wstaw",embed_button:{image:"Wstaw zdjęice",video:"Wstaw wideo",audio:"Wstaw audio",file:"Wstaw plik"},url_placeholder:"Wprowadź URL"}},link_toolbar:{delete:{tooltip:"Usuń link"},edit:{text:"Edytuj link",tooltip:"Edytuj"},open:{tooltip:"Otwórz w nowej karcie"},form:{title_placeholder:"Edytuj tytuł",url_placeholder:"Edytuj URL"}},generic:{ctrl_shortcut:"Ctrl"}},pt:{slash_menu:{heading:{title:"Título",subtext:"Usado para um título de nível superior",aliases:["h","titulo1","h1"],group:"Títulos"},heading_2:{title:"Título 2",subtext:"Usado para seções principais",aliases:["h2","titulo2","subtitulo"],group:"Títulos"},heading_3:{title:"Título 3",subtext:"Usado para subseções e títulos de grupo",aliases:["h3","titulo3","subtitulo"],group:"Títulos"},numbered_list:{title:"Lista Numerada",subtext:"Usado para exibir uma lista numerada",aliases:["ol","li","lista","listanumerada","lista numerada"],group:"Blocos básicos"},bullet_list:{title:"Lista com Marcadores",subtext:"Usado para exibir uma lista não ordenada",aliases:["ul","li","lista","listamarcadores","lista com marcadores"],group:"Blocos básicos"},check_list:{title:"Lista de verificação",subtext:"Usado para exibir uma lista com caixas de seleção",aliases:["ul","li","lista","lista de verificação","lista marcada","caixa de seleção"],group:"Blocos básicos"},paragraph:{title:"Parágrafo",subtext:"Usado para o corpo do seu documento",aliases:["p","paragrafo"],group:"Blocos básicos"},code_block:{title:"Bloco de Código",subtext:"Usado para exibir código com destaque de sintaxe",aliases:["codigo","pre"],group:"Blocos básicos"},table:{title:"Tabela",subtext:"Usado para tabelas",aliases:["tabela"],group:"Avançado"},image:{title:"Imagem",subtext:"Inserir uma imagem",aliases:["imagem","uploadImagem","upload","img","foto","media","url"],group:"Mídia"},video:{title:"Vídeo",subtext:"Inserir um vídeo",aliases:["vídeo","uploadVídeo","upload","mp4","filme","mídia","url"],group:"Mídia"},audio:{title:"Áudio",subtext:"Inserir um áudio",aliases:["áudio","uploadÁudio","upload","mp3","som","mídia","url"],group:"Mídia"},file:{title:"Arquivo",subtext:"Inserir um arquivo",aliases:["arquivo","upload","incorporar","mídia","url"],group:"Mídia"},emoji:{title:"Emoji",subtext:"Usado para inserir um emoji",aliases:["emoji","emoticon","expressão emocional","rosto"],group:"Outros"}},placeholders:{default:"Digite texto ou use '/' para comandos",heading:"Título",bulletListItem:"Lista",numberedListItem:"Lista",checkListItem:"Lista"},file_blocks:{image:{add_button_text:"Adicionar imagem"},video:{add_button_text:"Adicionar vídeo"},audio:{add_button_text:"Adicionar áudio"},file:{add_button_text:"Adicionar arquivo"}},side_menu:{add_block_label:"Adicionar bloco",drag_handle_label:"Abrir menu do bloco"},drag_handle:{delete_menuitem:"Excluir",colors_menuitem:"Cores"},table_handle:{delete_column_menuitem:"Excluir coluna",delete_row_menuitem:"Excluir linha",add_left_menuitem:"Adicionar coluna à esquerda",add_right_menuitem:"Adicionar coluna à direita",add_above_menuitem:"Adicionar linha acima",add_below_menuitem:"Adicionar linha abaixo"},suggestion_menu:{no_items_title:"Nenhum item encontrado",loading:"Carregando…"},color_picker:{text_title:"Texto",background_title:"Fundo",colors:{default:"Padrão",gray:"Cinza",brown:"Marrom",red:"Vermelho",orange:"Laranja",yellow:"Amarelo",green:"Verde",blue:"Azul",purple:"Roxo",pink:"Rosa"}},formatting_toolbar:{bold:{tooltip:"Negrito",secondary_tooltip:"Mod+B"},italic:{tooltip:"Itálico",secondary_tooltip:"Mod+I"},underline:{tooltip:"Sublinhado",secondary_tooltip:"Mod+U"},strike:{tooltip:"Riscado",secondary_tooltip:"Mod+Shift+X"},code:{tooltip:"Código",secondary_tooltip:""},colors:{tooltip:"Cores"},link:{tooltip:"Criar link",secondary_tooltip:"Mod+K"},file_caption:{tooltip:"Editar legenda",input_placeholder:"Editar legenda"},file_replace:{tooltip:{image:"Substituir imagem",video:"Substituir vídeo",audio:"Substituir áudio",file:"Substituir arquivo"}},file_rename:{tooltip:{image:"Renomear imagem",video:"Renomear vídeo",audio:"Renomear áudio",file:"Renomear arquivo"},input_placeholder:{image:"Renomear imagem",video:"Renomear vídeo",audio:"Renomear áudio",file:"Renomear arquivo"}},file_download:{tooltip:{image:"Baixar imagem",video:"Baixar vídeo",audio:"Baixar áudio",file:"Baixar arquivo"}},file_delete:{tooltip:{image:"Excluir imagem",video:"Excluir vídeo",audio:"Excluir áudio",file:"Excluir arquivo"}},file_preview_toggle:{tooltip:"Alternar visualização"},nest:{tooltip:"Aninhar bloco",secondary_tooltip:"Tab"},unnest:{tooltip:"Desaninhar bloco",secondary_tooltip:"Shift+Tab"},align_left:{tooltip:"Alinhar à esquerda"},align_center:{tooltip:"Alinhar ao centro"},align_right:{tooltip:"Alinhar à direita"},align_justify:{tooltip:"Justificar texto"}},file_panel:{upload:{title:"Upload",file_placeholder:{image:"Upload de imagem",video:"Upload de vídeo",audio:"Upload de áudio",file:"Upload de arquivo"},upload_error:"Erro: Falha no upload"},embed:{title:"Incorporar",embed_button:{image:"Incorporar imagem",video:"Incorporar vídeo",audio:"Incorporar áudio",file:"Incorporar arquivo"},url_placeholder:"Insira a URL"}},link_toolbar:{delete:{tooltip:"Remover link"},edit:{text:"Editar link",tooltip:"Editar"},open:{tooltip:"Abrir em nova aba"},form:{title_placeholder:"Editar título",url_placeholder:"Editar URL"}},generic:{ctrl_shortcut:"Ctrl"}},ru:{slash_menu:{heading:{title:"Заголовок 1 уровня",subtext:"Используется для заголовка верхнего уровня",aliases:["h","heading1","h1","заголовок1"],group:"Заголовки"},heading_2:{title:"Заголовок 2 уровня",subtext:"Используется для ключевых разделов",aliases:["h2","heading2","subheading","заголовок2","подзаголовок"],group:"Заголовки"},heading_3:{title:"Заголовок 3 уровня",subtext:"Используется для подразделов и групп",aliases:["h3","heading3","subheading","заголовок3","подзаголовок"],group:"Заголовки"},numbered_list:{title:"Нумерованный список",subtext:"Используется для отображения нумерованного списка",aliases:["ol","li","list","numberedlist","numbered list","список","нумерованный список"],group:"Базовые блоки"},bullet_list:{title:"Маркированный список",subtext:"Для отображения неупорядоченного списка.",aliases:["ul","li","list","bulletlist","bullet list","список","маркированный список"],group:"Базовые блоки"},check_list:{title:"Контрольный список",subtext:"Для отображения списка с флажками",aliases:["ul","li","list","checklist","check list","checked list","checkbox","список"],group:"Базовые блоки"},paragraph:{title:"Параграф",subtext:"Основной текст",aliases:["p","paragraph","параграф"],group:"Базовые блоки"},code_block:{title:"Блок кода",subtext:"Блок кода с подсветкой синтаксиса",aliases:["code","pre","блок кода"],group:"Базовые блоки"},table:{title:"Таблица",subtext:"Используется для таблиц",aliases:["table","таблица"],group:"Продвинутый"},image:{title:"Картинка",subtext:"Вставить изображение",aliases:["image","imageUpload","upload","img","picture","media","url","загрузка","картинка","рисунок"],group:"Медиа"},video:{title:"Видео",subtext:"Вставить видео",aliases:["video","videoUpload","upload","mp4","film","media","url","загрузка","видео"],group:"Медиа"},audio:{title:"Аудио",subtext:"Вставить аудио",aliases:["audio","audioUpload","upload","mp3","sound","media","url","загрузка","аудио","звук","музыка"],group:"Медиа"},file:{title:"Файл",subtext:"Вставить файл",aliases:["file","upload","embed","media","url","загрузка","файл"],group:"Медиа"},emoji:{title:"Эмодзи",subtext:"Используется для вставки эмодзи",aliases:["эмодзи","смайлик","выражение эмоций","лицо"],group:"Прочее"}},placeholders:{default:"Ведите текст или введите «/» для команд",heading:"Заголовок",bulletListItem:"Список",numberedListItem:"Список",checkListItem:"Список"},file_blocks:{image:{add_button_text:"Добавить изображение"},video:{add_button_text:"Добавить видео"},audio:{add_button_text:"Добавить аудио"},file:{add_button_text:"Добавить файл"}},side_menu:{add_block_label:"Добавить блок",drag_handle_label:"Открыть меню блока"},drag_handle:{delete_menuitem:"Удалить",colors_menuitem:"Цвета"},table_handle:{delete_column_menuitem:"Удалить столбец",delete_row_menuitem:"Удалить строку",add_left_menuitem:"Добавить столбец слева",add_right_menuitem:"Добавить столбец справа",add_above_menuitem:"Добавить строку выше",add_below_menuitem:"Добавить строку ниже"},suggestion_menu:{no_items_title:"ничего не найдено",loading:"Загрузка…"},color_picker:{text_title:"Текст",background_title:"Задний фон",colors:{default:"По умолчинию",gray:"Серый",brown:"Коричневый",red:"Красный",orange:"Оранжевый",yellow:"Жёлтый",green:"Зелёный",blue:"Голубой",purple:"Фиолетовый",pink:"Розовый"}},formatting_toolbar:{bold:{tooltip:"Жирный",secondary_tooltip:"Mod+B"},italic:{tooltip:"Курсив",secondary_tooltip:"Mod+I"},underline:{tooltip:"Подчёркнутый",secondary_tooltip:"Mod+U"},strike:{tooltip:"Зачёркнутый",secondary_tooltip:"Mod+Shift+X"},code:{tooltip:"Код",secondary_tooltip:""},colors:{tooltip:"Цвета"},link:{tooltip:"Создать ссылку",secondary_tooltip:"Mod+K"},file_caption:{tooltip:"Изменить подпись",input_placeholder:"Изменить подпись"},file_replace:{tooltip:{image:"Заменить изображение",video:"Заменить видео",audio:"Заменить аудио",file:"Заменить файл"}},file_rename:{tooltip:{image:"Переименовать изображение",video:"Переименовать видео",audio:"Переименовать аудио",file:"Переименовать файл"},input_placeholder:{image:"Переименовать изображение",video:"Переименовать видео",audio:"Переименовать аудио",file:"Переименовать файл"}},file_download:{tooltip:{image:"Скачать картинку",video:"Скачать видео",audio:"Скачать аудио",file:"Скачать файл"}},file_delete:{tooltip:{image:"Удалить картинку",video:"Удалить видео",audio:"Удалить аудио",file:"Скачать файл"}},file_preview_toggle:{tooltip:"Переключить предварительный просмотр"},nest:{tooltip:"Сдвинуть вправо",secondary_tooltip:"Tab"},unnest:{tooltip:"Сдвинуть влево",secondary_tooltip:"Shift+Tab"},align_left:{tooltip:"Текст по левому краю"},align_center:{tooltip:"Текст по середине"},align_right:{tooltip:"Текст по правому краю"},align_justify:{tooltip:"По середине текст"}},file_panel:{upload:{title:"Загрузить",file_placeholder:{image:"Загрузить картинки",video:"Загрузить видео",audio:"Загрузить аудио",file:"Загрузить файл"},upload_error:"Ошибка: не удалось загрузить"},embed:{title:"Вставить",embed_button:{image:"Вставить картинку",video:"Вставить видео",audio:"Вставить аудио",file:"Вставить файл"},url_placeholder:"Введите URL"}},link_toolbar:{delete:{tooltip:"Удалить ссылку"},edit:{text:"Изменить ссылку",tooltip:"Редактировать"},open:{tooltip:"Открыть в новой вкладке"},form:{title_placeholder:"Изменить заголовок",url_placeholder:"Изменить URL"}},generic:{ctrl_shortcut:"Ctrl"}},vi:{slash_menu:{heading:{title:"Tiêu đề H1",subtext:"Sử dụng cho tiêu đề cấp cao nhất",aliases:["h","tieude1","dd1"],group:"Tiêu đề"},heading_2:{title:"Tiêu đề H2",subtext:"Sử dụng cho các phần chính",aliases:["h2","tieude2","tieudephu"],group:"Tiêu đề"},heading_3:{title:"Tiêu đề H3",subtext:"Sử dụng cho phụ đề và tiêu đề nhóm",aliases:["h3","tieude3","tieudephu"],group:"Tiêu đề"},numbered_list:{title:"Danh sách đánh số",subtext:"Sử dụng để hiển thị danh sách có đánh số",aliases:["ol","li","ds","danhsachdso","danh sach danh so"],group:"Khối cơ bản"},bullet_list:{title:"Danh sách",subtext:"Sử dụng để hiển thị danh sách không đánh số",aliases:["ul","li","ds","danhsach","danh sach"],group:"Khối cơ bản"},check_list:{title:"Danh sách kiểm tra",subtext:"Dùng để hiển thị danh sách có hộp kiểm",aliases:["ul","li","danh sach","danh sach kiem tra","danh sach da kiem tra","hop kiem"],group:"Khối cơ bản"},paragraph:{title:"Đoạn văn",subtext:"Sử dụng cho nội dung chính của tài liệu",aliases:["p","doanvan"],group:"Khối cơ bản"},code_block:{title:"Mã",subtext:"Sử dụng để hiển thị mã với cú pháp",aliases:["code","pre"],group:"Khối cơ bản"},table:{title:"Bảng",subtext:"Sử dụng để tạo bảng",aliases:["bang"],group:"Nâng cao"},image:{title:"Hình ảnh",subtext:"Chèn hình ảnh",aliases:["anh","tai-len-anh","tai-len","img","hinh","media","url"],group:"Phương tiện"},video:{title:"Video",subtext:"Chèn video",aliases:["video","tai-len-video","tai-len","mp4","phim","media","url"],group:"Phương tiện"},audio:{title:"Âm thanh",subtext:"Chèn âm thanh",aliases:["âm thanh","tai-len-am-thanh","tai-len","mp3","am thanh","media","url"],group:"Phương tiện"},file:{title:"Tệp",subtext:"Chèn tệp",aliases:["tep","tai-len","nhung","media","url"],group:"Phương tiện"},emoji:{title:"Biểu tượng cảm xúc",subtext:"Dùng để chèn biểu tượng cảm xúc",aliases:["biểu tượng cảm xúc","emoji","emoticon","cảm xúc expression","khuôn mặt","face"],group:"Khác"}},placeholders:{default:"Nhập văn bản hoặc gõ '/' để thêm định dạng",heading:"Tiêu đề",bulletListItem:"Danh sách",numberedListItem:"Danh sách",checkListItem:"Danh sách"},file_blocks:{image:{add_button_text:"Thêm ảnh"},video:{add_button_text:"Thêm video"},audio:{add_button_text:"Thêm âm thanh"},file:{add_button_text:"Thêm tệp"}},side_menu:{add_block_label:"Thêm khối",drag_handle_label:"Mở trình đơn khối"},drag_handle:{delete_menuitem:"Xóa",colors_menuitem:"Màu sắc"},table_handle:{delete_column_menuitem:"Xóa cột",delete_row_menuitem:"Xóa hàng",add_left_menuitem:"Thêm cột bên trái",add_right_menuitem:"Thêm cột bên phải",add_above_menuitem:"Thêm hàng phía trên",add_below_menuitem:"Thêm hàng phía dưới"},suggestion_menu:{no_items_title:"Không tìm thấy mục nào",loading:"Đang tải..."},color_picker:{text_title:"Văn bản",background_title:"Nền",colors:{default:"Mặc định",gray:"Xám",brown:"Nâu",red:"Đỏ",orange:"Cam",yellow:"Vàng",green:"Xanh lá",blue:"Xanh dương",purple:"Tím",pink:"Hồng"}},formatting_toolbar:{bold:{tooltip:"In đậm",secondary_tooltip:"Mod+B"},italic:{tooltip:"In nghiêng",secondary_tooltip:"Mod+I"},underline:{tooltip:"Gạch dưới",secondary_tooltip:"Mod+U"},strike:{tooltip:"Gạch ngang",secondary_tooltip:"Mod+Shift+X"},code:{tooltip:"Code",secondary_tooltip:""},colors:{tooltip:"Màu sắc"},link:{tooltip:"Tạo liên kết",secondary_tooltip:"Mod+K"},file_caption:{tooltip:"Chỉnh sửa chú thích",input_placeholder:"Chỉnh sửa chú thích"},file_replace:{tooltip:{image:"Thay thế hình ảnh",video:"Thay thế video",audio:"Thay thế âm thanh",file:"Thay thế tệp"}},file_rename:{tooltip:{image:"Đổi tên hình ảnh",video:"Đổi tên video",audio:"Đổi tên âm thanh",file:"Đổi tên tệp"},input_placeholder:{image:"Đổi tên hình ảnh",video:"Đổi tên video",audio:"Đổi tên âm thanh",file:"Đổi tên tệp"}},file_download:{tooltip:{image:"Tải xuống hình ảnh",video:"Tải xuống video",audio:"Tải xuống âm thanh",file:"Tải xuống tệp"}},file_delete:{tooltip:{image:"Xóa hình ảnh",video:"Xóa video",audio:"Xóa âm thanh",file:"Xóa tệp"}},file_preview_toggle:{tooltip:"Chuyển đổi xem trước"},nest:{tooltip:"Lồng khối",secondary_tooltip:"Tab"},unnest:{tooltip:"Bỏ lồng khối",secondary_tooltip:"Shift+Tab"},align_left:{tooltip:"Căn trái văn bản"},align_center:{tooltip:"Căn giữa văn bản"},align_right:{tooltip:"Căn phải văn bản"},align_justify:{tooltip:"Căn đều văn bản"}},file_panel:{upload:{title:"Tải lên",file_placeholder:{image:"Tải lên hình ảnh",video:"Tải lên video",audio:"Tải lên âm thanh",file:"Tải lên tệp"},upload_error:"Lỗi: Tải lên thất bại"},embed:{title:"Nhúng",embed_button:{image:"Nhúng hình ảnh",video:"Nhúng video",audio:"Nhúng âm thanh",file:"Nhúng tệp"},url_placeholder:"Nhập URL"}},link_toolbar:{delete:{tooltip:"Xóa liên kết"},edit:{text:"Chỉnh sửa liên kết",tooltip:"Chỉnh sửa"},open:{tooltip:"Mở trong tab mới"},form:{title_placeholder:"Chỉnh sửa tiêu đề",url_placeholder:"Chỉnh sửa URL"}},generic:{ctrl_shortcut:"Ctrl"}},zh:{slash_menu:{heading:{title:"一级标题",subtext:"用于顶级标题",aliases:["h","heading1","h1","标题","一级标题"],group:"标题"},heading_2:{title:"二级标题",subtext:"用于关键部分",aliases:["h2","heading2","subheading","标题","二级标题","副标题"],group:"标题"},heading_3:{title:"三级标题",subtext:"用于小节和分组标题",aliases:["h3","heading3","subheading","标题","三级标题"],group:"标题"},numbered_list:{title:"有序列表",subtext:"用于显示有序列表",aliases:["ol","li","list","numberedlist","numbered list","列表","有序列表"],group:"基础"},bullet_list:{title:"无序列表",subtext:"用于显示无序列表",aliases:["ul","li","list","bulletlist","bullet list","列表","无序列表"],group:"基础"},check_list:{title:"检查清单",subtext:"用于显示带有复选框的列表",aliases:["ul","li","checklist","checked list","列表","检查清单","勾选列表","复选框"],group:"基础"},paragraph:{title:"段落",subtext:"用于文档正文",aliases:["p","paragraph","text","正文"],group:"基础"},code_block:{title:"代码块",subtext:"用于显示带有语法高亮的代码块",aliases:["code","pre","代码","预格式"],group:"基础"},table:{title:"表格",subtext:"使用表格",aliases:["table","表格"],group:"高级功能"},image:{title:"图片",subtext:"插入图片",aliases:["图片","上传图片","上传","image","img","相册","媒体","url"],group:"媒体"},video:{title:"视频",subtext:"插入视频",aliases:["视频","视频上传","上传","video","mp4","电影","媒体","url","驱动","dropbox"],group:"媒体"},audio:{title:"音频",subtext:"插入音频",aliases:["音频","音频上传","上传","audio","mp3","声音","媒体","url","驱动","dropbox"],group:"媒体"},file:{title:"文件",subtext:"插入文件",aliases:["文件","上传","file","嵌入","媒体","url"],group:"媒体"},emoji:{title:"表情符号",subtext:"用于插入表情符号",aliases:["表情符号","emoji","face","emote","表情","表情表达","表情"],group:"其他"}},placeholders:{default:"输入 '/' 以使用命令",heading:"标题",bulletListItem:"列表",numberedListItem:"列表",checkListItem:"列表"},file_blocks:{image:{add_button_text:"添加图片"},video:{add_button_text:"添加视频"},audio:{add_button_text:"添加音频"},file:{add_button_text:"添加文件"}},side_menu:{add_block_label:"添加块",drag_handle_label:"打开菜单"},drag_handle:{delete_menuitem:"删除",colors_menuitem:"颜色"},table_handle:{delete_column_menuitem:"删除列",delete_row_menuitem:"删除行",add_left_menuitem:"左侧添加列",add_right_menuitem:"右侧添加列",add_above_menuitem:"上方添加行",add_below_menuitem:"下方添加行"},suggestion_menu:{no_items_title:"无匹配项",loading:"加载中…"},color_picker:{text_title:"文本",background_title:"背景色",colors:{default:"默认",gray:"灰色",brown:"棕色",red:"红色",orange:"橙色",yellow:"黄色",green:"绿色",blue:"蓝色",purple:"紫色",pink:"粉色"}},formatting_toolbar:{bold:{tooltip:"加粗",secondary_tooltip:"Mod+B"},italic:{tooltip:"斜体",secondary_tooltip:"Mod+I"},underline:{tooltip:"下划线",secondary_tooltip:"Mod+U"},strike:{tooltip:"删除线",secondary_tooltip:"Mod+Shift+X"},code:{tooltip:"代码标记",secondary_tooltip:""},colors:{tooltip:"颜色"},link:{tooltip:"添加链接",secondary_tooltip:"Mod+K"},file_caption:{tooltip:"编辑标题",input_placeholder:"编辑标题"},file_replace:{tooltip:{image:"替换图片",video:"替换视频",audio:"替换音频",file:"替换文件"}},file_rename:{tooltip:{image:"重命名图片",video:"重命名视频",audio:"重命名音频",file:"重命名文件"},input_placeholder:{image:"重命名图片",video:"重命名视频",audio:"重命名音频",file:"重命名文件"}},file_download:{tooltip:{image:"下载图片",video:"下载视频",audio:"下载音频",file:"下载文件"}},file_delete:{tooltip:{image:"删除图片",video:"删除视频",audio:"删除音频",file:"删除文件"}},file_preview_toggle:{tooltip:"切换预览"},nest:{tooltip:"嵌套",secondary_tooltip:"Tab"},unnest:{tooltip:"取消嵌套",secondary_tooltip:"Shift+Tab"},align_left:{tooltip:"左对齐"},align_center:{tooltip:"居中"},align_right:{tooltip:"右对齐"},align_justify:{tooltip:"文本对齐"}},file_panel:{upload:{title:"上传",file_placeholder:{image:"上传图片",video:"上传视频",audio:"上传音频",file:"上传文件"},upload_error:"Error:上传失败"},embed:{title:"嵌入",embed_button:{image:"嵌入图片",video:"嵌入视频",audio:"嵌入音频",file:"嵌入文件"},url_placeholder:"输入图片地址"}},link_toolbar:{delete:{tooltip:"清除链接"},edit:{text:"编辑链接",tooltip:"编辑"},open:{tooltip:"新窗口打开"},form:{title_placeholder:"编辑标题",url_placeholder:"编辑链接地址"}},generic:{ctrl_shortcut:"Ctrl"}}},Symbol.toStringTag,{value:"Module"}));class A extends Error{constructor(t){super(`Unreachable case: ${t}`)}}function Pi(e,t=!0){const{"data-test":o,...i}=e;if(Object.keys(i).length>0&&t)throw new Error("Object must be empty "+JSON.stringify(e))}function Ai(e,t=JSON.stringify){const o={};return e.filter(i=>{const n=t(i);return Object.prototype.hasOwnProperty.call(o,n)?!1:o[n]=!0})}function Ni(e){const t=e.filter((i,n)=>e.indexOf(i)!==n);return Ai(t)}const X=k.Extension.create({name:"uniqueID",priority:1e4,addOptions(){return{attributeName:"id",types:[],setIdAttribute:!1,generateID:()=>{if(typeof window<"u"&&window.__TEST_OPTIONS){const e=window.__TEST_OPTIONS;return e.mockID===void 0?e.mockID=0:e.mockID++,e.mockID.toString()}return oi.v4()},filterTransaction:null}},addGlobalAttributes(){return[{types:this.options.types,attributes:{[this.options.attributeName]:{default:null,parseHTML:e=>e.getAttribute(`data-${this.options.attributeName}`),renderHTML:e=>{const t={[`data-${this.options.attributeName}`]:e[this.options.attributeName]};return this.options.setIdAttribute?{...t,id:e[this.options.attributeName]}:t}}}}]},addProseMirrorPlugins(){let e=null,t=!1;return[new y.Plugin({key:new y.PluginKey("uniqueID"),appendTransaction:(o,i,n)=>{const a=o.some(f=>f.docChanged)&&!i.doc.eq(n.doc),r=this.options.filterTransaction&&o.some(f=>{let g,_;return!(!((_=(g=this.options).filterTransaction)===null||_===void 0)&&_.call(g,f))});if(!a||r)return;const{tr:l}=n,{types:s,attributeName:u,generateID:c}=this.options,h=k.combineTransactionSteps(i.doc,o),{mapping:m}=h;if(k.getChangedRanges(h).forEach(({newRange:f})=>{const g=k.findChildrenInRange(n.doc,f,j=>s.includes(j.type.name)),_=g.map(({node:j})=>j.attrs[u]).filter(j=>j!==null),w=Ni(_);g.forEach(({node:j,pos:G})=>{let ie;const ge=(ie=l.doc.nodeAt(G))===null||ie===void 0?void 0:ie.attrs[u];if(ge===null){const S=i.doc.type.createAndFill().content;if(i.doc.content.findDiffStart(S)===null){const ti=JSON.parse(JSON.stringify(n.doc.toJSON()));if(ti.content[0].content[0].attrs.id="initialBlockId",JSON.stringify(ti.content)===JSON.stringify(S.toJSON())){l.setNodeMarkup(G,void 0,{...j.attrs,[u]:"initialBlockId"});return}}l.setNodeMarkup(G,void 0,{...j.attrs,[u]:c()});return}const{deleted:Me}=m.invert().mapResult(G);Me&&w.includes(ge)&&l.setNodeMarkup(G,void 0,{...j.attrs,[u]:c()})})}),!!l.steps.length)return l},view(o){const i=n=>{let a;e=!((a=o.dom.parentElement)===null||a===void 0)&&a.contains(n.target)?o.dom.parentElement:null};return window.addEventListener("dragstart",i),{destroy(){window.removeEventListener("dragstart",i)}}},props:{handleDOMEvents:{drop:(o,i)=>{let n;return(e!==o.dom.parentElement||((n=i.dataTransfer)===null||n===void 0?void 0:n.effectAllowed)==="copy")&&(e=null,t=!0),!1},paste:()=>(t=!0,!1)},transformPasted:o=>{if(!t)return o;const{types:i,attributeName:n}=this.options,a=r=>{const l=[];return r.forEach(s=>{if(s.isText){l.push(s);return}if(!i.includes(s.type.name)){l.push(s.copy(a(s.content)));return}const u=s.type.create({...s.attrs,[n]:null},a(s.content),s.marks);l.push(u)}),v.Fragment.from(l)};return t=!1,new v.Slice(a(o.content),o.openStart,o.openEnd)}}})]}});function Ie(e){return e.type==="link"}function Pe(e){return typeof e!="string"&&e.type==="link"}function Z(e){return typeof e!="string"&&e.type==="text"}function ut(e,t,o){const i=[];for(const[n,a]of Object.entries(e.styles)){const r=o[n];if(!r)throw new Error(`style ${n} not found in styleSchema`);if(r.propSchema==="boolean")i.push(t.mark(n));else if(r.propSchema==="string")i.push(t.mark(n,{stringValue:a}));else throw new A(r.propSchema)}return e.text.split(/(\n)/g).filter(n=>n.length>0).map(n=>n===`
|
|
2
|
-
`?t.nodes.hardBreak.createChecked():t.text(n,i))}function ji(e,t,o){const i=t.marks.link.create({href:e.href});return Ae(e.content,t,o).map(n=>{if(n.type.name==="text")return n.mark([...n.marks,i]);if(n.type.name==="hardBreak")return n;throw new Error("unexpected node type")})}function Ae(e,t,o){const i=[];if(typeof e=="string")return i.push(...ut({type:"text",text:e,styles:{}},t,o)),i;for(const n of e)i.push(...ut(n,t,o));return i}function N(e,t,o){const i=[];for(const n of e)typeof n=="string"?i.push(...Ae(n,t,o)):Pe(n)?i.push(...ji(n,t,o)):Z(n)?i.push(...Ae([n],t,o)):i.push(pt(n,t,o));return i}function ne(e,t,o){var n;const i=[];for(const a of e.rows){const r=[];for(let s=0;s<a.cells.length;s++){const u=a.cells[s];let c;if(!u)c=t.nodes.tableParagraph.createChecked({});else if(typeof u=="string")c=t.nodes.tableParagraph.createChecked({},t.text(u));else{const m=N(u,t,o);c=t.nodes.tableParagraph.createChecked({},m)}const h=t.nodes.tableCell.createChecked({colwidth:(n=e.columnWidths)!=null&&n[s]?[e.columnWidths[s]]:null},c);r.push(h)}const l=t.nodes.tableRow.createChecked({},r);i.push(l)}return i}function pt(e,t,o){let i,n=e.type;if(n===void 0&&(n="paragraph"),!t.nodes[n])throw new Error(`node type ${n} not found in schema`);if(!e.content)i=t.nodes[n].createChecked(e.props);else if(typeof e.content=="string"){const a=N([e.content],t,o);i=t.nodes[n].createChecked(e.props,a)}else if(Array.isArray(e.content)){const a=N(e.content,t,o);i=t.nodes[n].createChecked(e.props,a)}else if(e.content.type==="tableContent"){const a=ne(e.content,t,o);i=t.nodes[n].createChecked(e.props,a)}else throw new A(e.content.type);return i}function V(e,t,o){let i=e.id;i===void 0&&(i=X.options.generateID());const n=[];if(e.children)for(const r of e.children)n.push(V(r,t,o));const a=t.nodes[e.type];if(a.isInGroup("blockContent")){const r=pt(e,t,o),l=n.length>0?t.nodes.blockGroup.createChecked({},n):void 0;return t.nodes.blockContainer.createChecked({id:i,...e.props},l?[r,l]:r)}else{if(a.isInGroup("bnBlock"))return t.nodes[e.type].createChecked({id:i,...e.props},n);throw new Error(`block type ${e.type} doesn't match blockContent or bnBlock group`)}}function ht(e){const t=[...e.classList].filter(o=>!o.startsWith("bn-"))||[];t.length>0?e.className=t.join(" "):e.removeAttribute("class")}function mt(e,t,o,i){let n;if(t)if(typeof t=="string")n=N([t],e.pmSchema,e.schema.styleSchema);else if(Array.isArray(t))n=N(t,e.pmSchema,e.schema.styleSchema);else if(t.type==="tableContent")n=ne(t,e.pmSchema,e.schema.styleSchema);else throw new A(t.type);else throw new Error("blockContent is required");const a=o.serializeFragment(v.Fragment.from(n),i);return a.nodeType===1&&ht(a),a}function Di(e,t,o,i,n,a,r){var g,_,w,j,G,ie,ge,Me;const l=(r==null?void 0:r.document)??document,s=t.pmSchema.nodes.blockContainer;let u=o.props;if(!o.props){u={};for(const[T,S]of Object.entries(t.schema.blockSchema[o.type].propSchema))u[T]=S.default}const h=[...((_=(g=s.spec)==null?void 0:g.toDOM)==null?void 0:_.call(g,s.create({id:o.id,...u}))).dom.attributes],m=t.blockImplementations[o.type].implementation.toExternalHTML({...o,props:u},t),b=l.createDocumentFragment();if(m.dom.classList.contains("bn-block-content")){const T=[...h,...m.dom.attributes].filter(S=>S.name.startsWith("data")&&S.name!=="data-content-type"&&S.name!=="data-file-block"&&S.name!=="data-node-view-wrapper"&&S.name!=="data-node-type"&&S.name!=="data-id"&&S.name!=="data-index"&&S.name!=="data-editable");for(const S of T)m.dom.firstChild.setAttribute(S.name,S.value);ht(m.dom.firstChild),b.append(...m.dom.childNodes)}else b.append(m.dom);if(m.contentDOM&&o.content){const T=mt(t,o.content,i,r);m.contentDOM.appendChild(T)}let f;if(n.has(o.type)?f="OL":a.has(o.type)&&(f="UL"),f){if(((w=e.lastChild)==null?void 0:w.nodeName)!==f){const S=l.createElement(f);e.append(S)}const T=l.createElement("li");T.append(b),e.lastChild.appendChild(T)}else e.append(b);if(o.children&&o.children.length>0){const T=l.createDocumentFragment();if(ft(T,t,o.children,i,n,a,r),((j=e.lastChild)==null?void 0:j.nodeName)==="UL"||((G=e.lastChild)==null?void 0:G.nodeName)==="OL")for(;((ie=T.firstChild)==null?void 0:ie.nodeName)==="UL"||((ge=T.firstChild)==null?void 0:ge.nodeName)==="OL";)e.lastChild.lastChild.appendChild(T.firstChild);t.pmSchema.nodes[o.type].isInGroup("blockContent")?e.append(T):(Me=m.contentDOM)==null||Me.append(T)}}const ft=(e,t,o,i,n,a,r)=>{for(const l of o)Di(e,t,l,i,n,a,r)},Hi=(e,t,o,i,n,a)=>{const l=((a==null?void 0:a.document)??document).createDocumentFragment();return ft(l,e,t,o,i,n,a),l},ae=(e,t)=>{const o=v.DOMSerializer.fromSchema(e);return{exportBlocks:(i,n)=>{const a=Hi(t,i,o,new Set(["numberedListItem"]),new Set(["bulletListItem","checkListItem"]),n),r=document.createElement("div");return r.append(a),r.innerHTML},exportInlineContent:(i,n)=>{const a=mt(t,i,o,n),r=document.createElement("div");return r.append(a.cloneNode(!0)),r.innerHTML}}};function Ui(e,t,o,i){let n;if(t)if(typeof t=="string")n=N([t],e.pmSchema,e.schema.styleSchema);else if(Array.isArray(t))n=N(t,e.pmSchema,e.schema.styleSchema);else if(t.type==="tableContent")n=ne(t,e.pmSchema,e.schema.styleSchema);else throw new A(t.type);else throw new Error("blockContent is required");return o.serializeFragment(v.Fragment.from(n),i)}function Oi(e,t,o,i,n){var h,m,b,f,g;const a=e.pmSchema.nodes.blockContainer;let r=t.props;if(!t.props){r={};for(const[_,w]of Object.entries(e.schema.blockSchema[t.type].propSchema))r[_]=w.default}const s=e.blockImplementations[t.type].implementation.toInternalHTML({...t,props:r},e);if(t.type==="numberedListItem"&&s.dom.setAttribute("data-index",i.toString()),s.contentDOM&&t.content){const _=Ui(e,t.content,o,n);s.contentDOM.appendChild(_)}if(e.pmSchema.nodes[t.type].isInGroup("bnBlock")){if(t.children&&t.children.length>0){const _=gt(e,t.children,o,n);(h=s.contentDOM)==null||h.append(_)}return s.dom}const c=(b=(m=a.spec)==null?void 0:m.toDOM)==null?void 0:b.call(m,a.create({id:t.id,...r}));return(f=c.contentDOM)==null||f.appendChild(s.dom),t.children&&t.children.length>0&&((g=c.contentDOM)==null||g.appendChild(bt(e,t.children,o,n))),c.dom}function gt(e,t,o,i){const a=((i==null?void 0:i.document)??document).createDocumentFragment();let r=0;for(const l of t){l.type==="numberedListItem"?r++:r=0;const s=Oi(e,l,o,r,i);a.appendChild(s)}return a}const bt=(e,t,o,i)=>{var l;const n=e.pmSchema.nodes.blockGroup,a=n.spec.toDOM(n.create({})),r=gt(e,t,o,i);return(l=a.contentDOM)==null||l.appendChild(r),a.dom},kt=(e,t)=>{const o=v.DOMSerializer.fromSchema(e);return{serializeBlocks:(i,n)=>bt(t,i,o,n).outerHTML}};function re(e,t){const o=e.resolve(t);if(o.nodeAfter&&o.nodeAfter.type.isInGroup("bnBlock"))return{posBeforeNode:o.pos,node:o.nodeAfter};let i=o.depth,n=o.node(i);for(;i>0;){if(n.type.isInGroup("bnBlock"))return{posBeforeNode:o.before(i),node:n};i--,n=o.node(i)}const a=[];e.descendants((l,s)=>{l.type.isInGroup("bnBlock")&&a.push(s)}),console.warn(`Position ${t} is not within a blockContainer node.`);const r=e.resolve(a.find(l=>l>=t)||a[a.length-1]);return{posBeforeNode:r.pos,node:r.nodeAfter}}function ke(e,t){if(!e.type.isInGroup("bnBlock"))throw new Error(`Attempted to get bnBlock node at position but found node of different type ${e.type}`);const o=e,i=t,n=i+o.nodeSize,a={node:o,beforePos:i,afterPos:n};if(o.type.name==="blockContainer"){let r,l;if(o.forEach((s,u)=>{if(s.type.spec.group==="blockContent"){const c=s,h=i+u+1,m=h+s.nodeSize;r={node:c,beforePos:h,afterPos:m}}else if(s.type.name==="blockGroup"){const c=s,h=i+u+1,m=h+s.nodeSize;l={node:c,beforePos:h,afterPos:m}}}),!r)throw new Error(`blockContainer node does not contain a blockContent node in its children: ${o}`);return{isBlockContainer:!0,bnBlock:a,blockContent:r,childContainer:l,blockNoteType:r.node.type.name}}else{if(!a.node.type.isInGroup("childContainer"))throw new Error(`bnBlock node is not in the childContainer group: ${a.node}`);return{isBlockContainer:!1,bnBlock:a,childContainer:a,blockNoteType:a.node.type.name}}}function K(e){return ke(e.node,e.posBeforeNode)}function J(e){if(!e.nodeAfter)throw new Error(`Attempted to get blockContainer node at position ${e.pos} but a node at this position does not exist`);return ke(e.nodeAfter,e.pos)}function C(e){const t=re(e.doc,e.selection.anchor);return K(t)}function q(e,t){let o,i;if(t.firstChild.descendants((n,a)=>o?!1:!n.type.isInGroup("bnBlock")||n.attrs.id!==e?!0:(o=n,i=a+1,!1)),o===void 0||i===void 0)throw Error("Could not find block in the editor with matching ID.");return{node:o,posBeforeNode:i}}const _t=()=>typeof navigator<"u"&&(/Mac/.test(navigator.platform)||/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent));function U(e,t="Ctrl"){return _t()?e.replace("Mod","⌘"):e.replace("Mod",t)}function O(...e){return e.filter(t=>t).join(" ")}const Ri=()=>/^((?!chrome|android).)*safari/i.test(navigator.userAgent);function D(e,t,o,i){const n=document.createElement("div");n.className=O("bn-block-content",o.class),n.setAttribute("data-content-type",e);for(const[r,l]of Object.entries(o))r!=="class"&&n.setAttribute(r,l);const a=document.createElement(t);a.className=O("bn-inline-content",i.class);for(const[r,l]of Object.entries(i))r!=="class"&&a.setAttribute(r,l);return n.appendChild(a),{dom:n,contentDOM:a}}const Ne=(e,t)=>{let o=V(e,t.pmSchema,t.schema.styleSchema);o.type.name==="blockContainer"&&(o=o.firstChild);const i=t.pmSchema.nodes[o.type.name].spec.toDOM;if(i===void 0)throw new Error("This block has no default HTML serialization as its corresponding TipTap node doesn't implement `renderHTML`.");const n=i(o);if(typeof n!="object"||!("dom"in n))throw new Error("Cannot use this block's default HTML serialization as its corresponding TipTap node's `renderHTML` function does not return an object with the `dom` property.");return n},E={backgroundColor:{default:"default"},textColor:{default:"default"},textAlignment:{default:"left",values:["left","center","right","justify"]}},je=["backgroundColor","textColor"];function le(e){return"data-"+e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function zi(e){const t=e.split("/");return!t.length||t[t.length-1]===""?e:t[t.length-1]}function De(e){const t={};return Object.entries(e).filter(([o,i])=>!je.includes(o)).forEach(([o,i])=>{t[o]={default:i.default,keepOnSplit:!0,parseHTML:n=>{const a=n.getAttribute(le(o));if(a===null)return null;if(typeof i.default=="boolean")return a==="true"?!0:a==="false"?!1:null;if(typeof i.default=="number"){const r=parseFloat(a);return!Number.isNaN(r)&&Number.isFinite(r)?r:null}return a},renderHTML:n=>n[o]!==i.default?{[le(o)]:n[o]}:{}}}),t}function yt(e,t,o,i){if(typeof e=="boolean")throw new Error("Cannot find node position as getPos is a boolean, not a function.");const n=e(),r=o.state.doc.resolve(n).node().attrs.id;if(!r)throw new Error("Block doesn't have id");const l=t.getBlock(r);if(l.type!==i)throw new Error("Block type does not match");return l}function se(e,t,o,i,n=!1,a){const r=document.createElement("div");if(a!==void 0)for(const[l,s]of Object.entries(a))l!=="class"&&r.setAttribute(l,s);r.className=O("bn-block-content",(a==null?void 0:a.class)||""),r.setAttribute("data-content-type",t);for(const[l,s]of Object.entries(o))!je.includes(l)&&s!==i[l].default&&r.setAttribute(le(l),s);return n&&r.setAttribute("data-file-block",""),r.appendChild(e.dom),e.contentDOM!==void 0&&(e.contentDOM.className=O("bn-inline-content",e.contentDOM.className),e.contentDOM.setAttribute("data-editable","")),{...e,dom:r}}function R(e){return k.Node.create(e)}function He(e,t){return{config:e,implementation:t}}function z(e,t,o){return He({type:e.name,content:e.config.content==="inline*"?"inline":e.config.content==="tableRow+"?"table":"none",propSchema:t},{node:e,requiredExtensions:o,toInternalHTML:Ne,toExternalHTML:Ne})}function Ue(e){return Object.fromEntries(Object.entries(e).map(([t,o])=>[t,o.config]))}function vt(e,t){e.stopEvent=o=>(o.type==="mousedown"&&setTimeout(()=>{t.view.dom.blur()},10),!0)}function wt(e,t){const o=[{tag:"[data-content-type="+e.type+"]",contentElement:"[data-editable]"}];return t&&o.push({tag:"*",getAttrs(i){if(typeof i=="string")return!1;const n=t==null?void 0:t(i);return n===void 0?!1:n}}),o}function de(e,t){const o=R({name:e.type,content:e.content==="inline"?"inline*":"",group:"blockContent",selectable:e.isSelectable??!0,addAttributes(){return De(e.propSchema)},parseHTML(){return wt(e,t.parse)},renderHTML({HTMLAttributes:i}){const n=document.createElement("div");return se({dom:n,contentDOM:e.content==="inline"?n:void 0},e.type,{},e.propSchema,e.isFileBlock,i)},addNodeView(){return({getPos:i})=>{var u;const n=this.options.editor,a=yt(i,n,this.editor,e.type),r=((u=this.options.domAttributes)==null?void 0:u.blockContent)||{},l=t.render(a,n),s=se(l,a.type,a.props,e.propSchema,r);return e.isSelectable===!1&&vt(s,this.editor),s}}});if(o.name!==e.type)throw new Error("Node name does not match block type. This is a bug in BlockNote.");return He(e,{node:o,toInternalHTML:(i,n)=>{var l;const a=((l=o.options.domAttributes)==null?void 0:l.blockContent)||{},r=t.render(i,n);return se(r,i.type,i.props,e.propSchema,e.isFileBlock,a)},toExternalHTML:(i,n)=>{var l,s;const a=((l=o.options.domAttributes)==null?void 0:l.blockContent)||{};let r=(s=t.toExternalHTML)==null?void 0:s.call(t,i,n);return r===void 0&&(r=t.render(i,n)),se(r,i.type,i.props,e.propSchema,a)}})}function Oe(e,t,o){const i={type:"tableContent",columnWidths:[],rows:[]};return e.content.forEach((n,a,r)=>{const l={cells:[]};r===0&&n.content.forEach(s=>{var u;i.columnWidths.push(((u=s.attrs.colwidth)==null?void 0:u[0])||void 0)}),n.content.forEach(s=>{l.cells.push(ce(s.firstChild,t,o))}),i.rows.push(l)}),i}function ce(e,t,o){const i=[];let n;return e.content.forEach(a=>{if(a.type.name==="hardBreak"){if(n)if(Z(n))n.text+=`
|
|
1
|
+
(function(d,v){typeof exports=="object"&&typeof module<"u"?v(exports,require("prosemirror-model"),require("@tiptap/core"),require("prosemirror-state"),require("uuid"),require("prosemirror-highlight"),require("prosemirror-highlight/shiki"),require("shiki"),require("prosemirror-tables"),require("@tiptap/extension-bold"),require("@tiptap/extension-code"),require("@tiptap/extension-italic"),require("@tiptap/extension-strike"),require("@tiptap/extension-underline"),require("prosemirror-transform"),require("@tiptap/extension-table-cell"),require("@tiptap/extension-table-header"),require("@tiptap/extension-table-row"),require("@tiptap/extension-collaboration"),require("@tiptap/extension-collaboration-cursor"),require("@tiptap/extension-gapcursor"),require("@tiptap/extension-hard-break"),require("@tiptap/extension-history"),require("@tiptap/extension-link"),require("@tiptap/extension-text"),require("prosemirror-view"),require("prosemirror-dropcursor")):typeof define=="function"&&define.amd?define(["exports","prosemirror-model","@tiptap/core","prosemirror-state","uuid","prosemirror-highlight","prosemirror-highlight/shiki","shiki","prosemirror-tables","@tiptap/extension-bold","@tiptap/extension-code","@tiptap/extension-italic","@tiptap/extension-strike","@tiptap/extension-underline","prosemirror-transform","@tiptap/extension-table-cell","@tiptap/extension-table-header","@tiptap/extension-table-row","@tiptap/extension-collaboration","@tiptap/extension-collaboration-cursor","@tiptap/extension-gapcursor","@tiptap/extension-hard-break","@tiptap/extension-history","@tiptap/extension-link","@tiptap/extension-text","prosemirror-view","prosemirror-dropcursor"],v):(d=typeof globalThis<"u"?globalThis:d||self,v(d.blocknote={},d.prosemirrorModel,d.core,d.prosemirrorState,d.uuid,d.prosemirrorHighlight,d.shiki$1,d.shiki,d.prosemirrorTables,d.Bold,d.Code,d.Italic,d.Strike,d.Underline,d.prosemirrorTransform,d.extensionTableCell,d.extensionTableHeader,d.extensionTableRow,d.Collaboration,d.CollaborationCursor,d.extensionGapcursor,d.extensionHardBreak,d.extensionHistory,d.extensionLink,d.extensionText,d.pmView,d.prosemirrorDropcursor))})(this,function(d,v,k,_,si,li,di,Me,U,ci,ui,pi,hi,mi,fe,fi,gi,bi,ki,_i,yi,wi,vi,Ci,xi,L,Ei){"use strict";var er=Object.defineProperty;var tr=(d,v,k)=>v in d?er(d,v,{enumerable:!0,configurable:!0,writable:!0,value:k}):d[v]=k;var h=(d,v,k)=>tr(d,typeof v!="symbol"?v+"":v,k);const Z=e=>e&&typeof e=="object"&&"default"in e?e:{default:e};function Si(e){if(e&&typeof e=="object"&&"default"in e)return e;const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const o in e)if(o!=="default"){const i=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,i.get?i:{enumerable:!0,get:()=>e[o]})}}return t.default=e,Object.freeze(t)}const Bi=Z(ci),Ti=Z(ui),Mi=Z(pi),Ii=Z(hi),Li=Z(mi),Pi=Z(ki),Ai=Z(_i),st=Si(L),Ni={slash_menu:{heading:{title:"عنوان 1",subtext:"يستخدم لعناوين المستوى الأعلى",aliases:["ع","عنوان1","ع1"],group:"العناوين"},heading_2:{title:"عنوان 2",subtext:"يستخدم للأقسام الرئيسية",aliases:["ع2","عنوان2","عنوان فرعي"],group:"العناوين"},heading_3:{title:"عنوان 3",subtext:"يستخدم للأقسام الفرعية والعناوين المجموعة",aliases:["ع3","عنوان3","عنوان فرعي"],group:"العناوين"},numbered_list:{title:"قائمة مرقمة",subtext:"تستخدم لعرض قائمة مرقمة",aliases:["ق","عناصر قائمة","قائمة","قائمة مرقمة"],group:"الكتل الأساسية"},bullet_list:{title:"قائمة نقطية",subtext:"تستخدم لعرض قائمة غير مرتبة",aliases:["ق","عناصر قائمة","قائمة","قائمة نقطية"],group:"الكتل الأساسية"},check_list:{title:"قائمة تحقق",subtext:"تستخدم لعرض قائمة بمربعات التحقق",aliases:["قوائم غير مرتبة","عناصر قائمة","قائمة","قائمة تحقق","قائمة التحقق","قائمة مشطوبة","مربع التحقق"],group:"الكتل الأساسية"},paragraph:{title:"فقرة",subtext:"تستخدم لنص الوثيقة الأساسي",aliases:["ف","فقرة"],group:"الكتل الأساسية"},code_block:{title:"كود",subtext:"يستخدم لعرض الكود مع تحديد الصيغة",aliases:["كود","مسبق"],group:"الكتل الأساسية"},table:{title:"جدول",subtext:"يستخدم للجداول",aliases:["جدول"],group:"متقدم"},image:{title:"صورة",subtext:"إدراج صورة",aliases:["صورة","رفع صورة","تحميل","صورة","صورة","وسائط","رابط"],group:"وسائط"},video:{title:"فيديو",subtext:"إدراج فيديو",aliases:["فيديو","رفع فيديو","تحميل","فيديو","فيلم","وسائط","رابط"],group:"وسائط"},audio:{title:"صوت",subtext:"إدراج صوت",aliases:["صوت","رفع صوت","تحميل","صوت","صوت","وسائط","رابط"],group:"وسائط"},file:{title:"ملف",subtext:"إدراج ملف",aliases:["ملف","تحميل","تضمين","وسائط","رابط"],group:"وسائط"},emoji:{title:"الرموز التعبيرية",subtext:"تُستخدم لإدراج رمز تعبيري",aliases:["رمز تعبيري","إيموجي","إيموت","عاطفة","وجه"],group:"آخرون"}},placeholders:{default:"أدخل نصًا أو اكتب '/' للأوامر",heading:"عنوان",bulletListItem:"قائمة",numberedListItem:"قائمة",checkListItem:"قائمة"},file_blocks:{image:{add_button_text:"إضافة صورة"},video:{add_button_text:"إضافة فيديو"},audio:{add_button_text:"إضافة صوت"},file:{add_button_text:"إضافة ملف"}},side_menu:{add_block_label:"إضافة محتوي",drag_handle_label:"فتح قائمة المحتويات"},drag_handle:{delete_menuitem:"حذف",colors_menuitem:"ألوان"},table_handle:{delete_column_menuitem:"حذف عمود",delete_row_menuitem:"حذف صف",add_left_menuitem:"إضافة عمود إلى اليسار",add_right_menuitem:"إضافة عمود إلى اليمين",add_above_menuitem:"إضافة صف أعلى",add_below_menuitem:"إضافة صف أسفل"},suggestion_menu:{no_items_title:"لم يتم العثور على عناصر",loading:"جارٍ التحميل…"},color_picker:{text_title:"نص",background_title:"خلفية",colors:{default:"افتراضي",gray:"رمادي",brown:"بني",red:"أحمر",orange:"برتقالي",yellow:"أصفر",green:"أخضر",blue:"أزرق",purple:"أرجواني",pink:"وردي"}},formatting_toolbar:{bold:{tooltip:"عريض",secondary_tooltip:"Mod+B"},italic:{tooltip:"مائل",secondary_tooltip:"Mod+I"},underline:{tooltip:"تحته خط",secondary_tooltip:"Mod+U"},strike:{tooltip:"مشطوب",secondary_tooltip:"Mod+Shift+X"},code:{tooltip:"كود",secondary_tooltip:""},colors:{tooltip:"ألوان"},link:{tooltip:"إنشاء رابط",secondary_tooltip:"Mod+K"},file_caption:{tooltip:"تحرير التسمية التوضيحية",input_placeholder:"تحرير التسمية التوضيحية"},file_replace:{tooltip:{image:"استبدال الصورة",video:"استبدال الفيديو",audio:"استبدال الصوت",file:"استبدال الملف"}},file_rename:{tooltip:{image:"إعادة تسمية الصورة",video:"إعادة تسمية الفيديو",audio:"إعادة تسمية الصوت",file:"إعادة تسمية الملف"},input_placeholder:{image:"إعادة تسمية الصورة",video:"إعادة تسمية الفيديو",audio:"إعادة تسمية الصوت",file:"إعادة تسمية الملف"}},file_download:{tooltip:{image:"تنزيل الصورة",video:"تنزيل الفيديو",audio:"تنزيل الصوت",file:"تنزيل الملف"}},file_delete:{tooltip:{image:"حذف الصورة",video:"حذف الفيديو",audio:"حذف الصوت",file:"حذف الملف"}},file_preview_toggle:{tooltip:"تبديل المعاينة"},nest:{tooltip:"محتويات متداخلة",secondary_tooltip:"Tab"},unnest:{tooltip:"إلغاء التداخل",secondary_tooltip:"Shift+Tab"},align_left:{tooltip:"محاذاة النص إلى اليسار"},align_center:{tooltip:"محاذاة النص في المنتصف"},align_right:{tooltip:"محاذاة النص إلى اليمين"},align_justify:{tooltip:"ضبط النص"}},file_panel:{upload:{title:"تحميل",file_placeholder:{image:"تحميل صورة",video:"تحميل فيديو",audio:"تحميل صوت",file:"تحميل ملف"},upload_error:"خطأ: فشل التحميل"},embed:{title:"تضمين",embed_button:{image:"تضمين صورة",video:"تضمين فيديو",audio:"تضمين صوت",file:"تضمين ملف"},url_placeholder:"أدخل الرابط"}},link_toolbar:{delete:{tooltip:"إزالة الرابط"},edit:{text:"تحرير الرابط",tooltip:"تحرير"},open:{tooltip:"فتح في تبويب جديد"},form:{title_placeholder:"تحرير العنوان",url_placeholder:"تحرير الرابط"}},generic:{ctrl_shortcut:"Ctrl"}},Di={slash_menu:{heading:{title:"Überschrift 1",subtext:"Hauptebene Überschrift",aliases:["h","überschrift1","h1"],group:"Überschriften"},heading_2:{title:"Überschrift 2",subtext:"Wichtige Abschnittsüberschrift",aliases:["h2","überschrift2","unterüberschrift"],group:"Überschriften"},heading_3:{title:"Überschrift 3",subtext:"Unterabschnitts- und Gruppenüberschrift",aliases:["h3","überschrift3","unterüberschrift"],group:"Überschriften"},numbered_list:{title:"Nummerierte Liste",subtext:"Liste mit nummerierten Elementen",aliases:["ol","li","liste","nummerierteliste","nummerierte liste"],group:"Grundlegende blöcke"},bullet_list:{title:"Aufzählungsliste",subtext:"Liste mit unnummerierten Elementen",aliases:["ul","li","liste","aufzählungsliste","aufzählung liste"],group:"Grundlegende blöcke"},check_list:{title:"Checkliste",subtext:"Liste mit Kontrollkästchen",aliases:["ul","li","liste","checkliste","check liste","geprüfte liste","kontrollkästchen"],group:"Grundlegende blöcke"},paragraph:{title:"Absatz",subtext:"Der Hauptteil Ihres Dokuments",aliases:["p","absatz"],group:"Grundlegende blöcke"},code_block:{title:"Codeblock",subtext:"Codeblock mit Syntaxhervorhebung",aliases:["code","pre"],group:"Grundlegende blöcke"},table:{title:"Tabelle",subtext:"Tabelle mit editierbaren Zellen",aliases:["tabelle"],group:"Erweitert"},image:{title:"Bild",subtext:"Größenveränderbares Bild mit Beschriftung",aliases:["bild","bildhochladen","hochladen","img","bild","medien","url"],group:"Medien"},video:{title:"Video",subtext:"Größenveränderbares Video mit Beschriftung",aliases:["video","videoupload","hochladen","mp4","film","medien","url"],group:"Medien"},audio:{title:"Audio",subtext:"Eingebettetes Audio mit Beschriftung",aliases:["audio","audioupload","hochladen","mp3","ton","medien","url"],group:"Medien"},file:{title:"Datei",subtext:"Eingebettete Datei",aliases:["datei","hochladen","einbetten","medien","url"],group:"Medien"},emoji:{title:"Emoji",subtext:"Nach Emoji suchen und einfügen",aliases:["emoji","emote","emotion","gesicht"],group:"Andere"}},placeholders:{default:"Text eingeben oder '/' für Befehle tippen",heading:"Überschrift",bulletListItem:"Liste",numberedListItem:"Liste",checkListItem:"Liste"},file_blocks:{image:{add_button_text:"Bild hinzufügen"},video:{add_button_text:"Video hinzufügen"},audio:{add_button_text:"Audio hinzufügen"},file:{add_button_text:"Datei hinzufügen"}},side_menu:{add_block_label:"Block hinzufügen",drag_handle_label:"Blockmenü öffnen"},drag_handle:{delete_menuitem:"Löschen",colors_menuitem:"Farben"},table_handle:{delete_column_menuitem:"Spalte löschen",delete_row_menuitem:"Zeile löschen",add_left_menuitem:"Spalte links hinzufügen",add_right_menuitem:"Spalte rechts hinzufügen",add_above_menuitem:"Zeile oberhalb hinzufügen",add_below_menuitem:"Zeile unterhalb hinzufügen"},suggestion_menu:{no_items_title:"Keine Elemente gefunden",loading:"Laden…"},color_picker:{text_title:"Text",background_title:"Hintergrund",colors:{default:"Standard",gray:"Grau",brown:"Braun",red:"Rot",orange:"Orange",yellow:"Gelb",green:"Grün",blue:"Blau",purple:"Lila",pink:"Rosa"}},formatting_toolbar:{bold:{tooltip:"Fett",secondary_tooltip:"Mod+B"},italic:{tooltip:"Kursiv",secondary_tooltip:"Mod+I"},underline:{tooltip:"Unterstrichen",secondary_tooltip:"Mod+U"},strike:{tooltip:"Durchgestrichen",secondary_tooltip:"Mod+Shift+S"},code:{tooltip:"Code",secondary_tooltip:""},colors:{tooltip:"Farben"},link:{tooltip:"Link erstellen",secondary_tooltip:"Mod+K"},file_caption:{tooltip:"Beschriftung bearbeiten",input_placeholder:"Beschriftung bearbeiten"},file_replace:{tooltip:{image:"Bild ersetzen",video:"Video ersetzen",audio:"Audio ersetzen",file:"Datei ersetzen"}},file_rename:{tooltip:{image:"Bild umbenennen",video:"Video umbenennen",audio:"Audio umbenennen",file:"Datei umbenennen"},input_placeholder:{image:"Bild umbenennen",video:"Video umbenennen",audio:"Audio umbenennen",file:"Datei umbenennen"}},file_download:{tooltip:{image:"Bild herunterladen",video:"Video herunterladen",audio:"Audio herunterladen",file:"Datei herunterladen"}},file_delete:{tooltip:{image:"Bild löschen",video:"Video löschen",audio:"Audio löschen",file:"Datei löschen"}},file_preview_toggle:{tooltip:"Vorschau umschalten"},nest:{tooltip:"Block verschachteln",secondary_tooltip:"Tab"},unnest:{tooltip:"Block entnesten",secondary_tooltip:"Shift+Tab"},align_left:{tooltip:"Text linksbündig"},align_center:{tooltip:"Text zentrieren"},align_right:{tooltip:"Text rechtsbündig"},align_justify:{tooltip:"Text Blocksatz"}},file_panel:{upload:{title:"Hochladen",file_placeholder:{image:"Bild hochladen",video:"Video hochladen",audio:"Audio hochladen",file:"Datei hochladen"},upload_error:"Fehler: Hochladen fehlgeschlagen"},embed:{title:"Einbetten",embed_button:{image:"Bild einbetten",video:"Video einbetten",audio:"Audio einbetten",file:"Datei einbetten"},url_placeholder:"URL eingeben"}},link_toolbar:{delete:{tooltip:"Link entfernen"},edit:{text:"Link bearbeiten",tooltip:"Bearbeiten"},open:{tooltip:"In neuem Tab öffnen"},form:{title_placeholder:"Titel bearbeiten",url_placeholder:"URL bearbeiten"}},generic:{ctrl_shortcut:"Strg"}},lt={slash_menu:{heading:{title:"Heading 1",subtext:"Top-level heading",aliases:["h","heading1","h1"],group:"Headings"},heading_2:{title:"Heading 2",subtext:"Key section heading",aliases:["h2","heading2","subheading"],group:"Headings"},heading_3:{title:"Heading 3",subtext:"Subsection and group heading",aliases:["h3","heading3","subheading"],group:"Headings"},numbered_list:{title:"Numbered List",subtext:"List with ordered items",aliases:["ol","li","list","numberedlist","numbered list"],group:"Basic blocks"},bullet_list:{title:"Bullet List",subtext:"List with unordered items",aliases:["ul","li","list","bulletlist","bullet list"],group:"Basic blocks"},check_list:{title:"Check List",subtext:"List with checkboxes",aliases:["ul","li","list","checklist","check list","checked list","checkbox"],group:"Basic blocks"},paragraph:{title:"Paragraph",subtext:"The body of your document",aliases:["p","paragraph"],group:"Basic blocks"},code_block:{title:"Code Block",subtext:"Code block with syntax highlighting",aliases:["code","pre"],group:"Basic blocks"},table:{title:"Table",subtext:"Table with editable cells",aliases:["table"],group:"Advanced"},image:{title:"Image",subtext:"Resizable image with caption",aliases:["image","imageUpload","upload","img","picture","media","url"],group:"Media"},video:{title:"Video",subtext:"Resizable video with caption",aliases:["video","videoUpload","upload","mp4","film","media","url"],group:"Media"},audio:{title:"Audio",subtext:"Embedded audio with caption",aliases:["audio","audioUpload","upload","mp3","sound","media","url"],group:"Media"},file:{title:"File",subtext:"Embedded file",aliases:["file","upload","embed","media","url"],group:"Media"},emoji:{title:"Emoji",subtext:"Search for and insert an emoji",aliases:["emoji","emote","emotion","face"],group:"Others"}},placeholders:{default:"Enter text or type '/' for commands",heading:"Heading",bulletListItem:"List",numberedListItem:"List",checkListItem:"List"},file_blocks:{image:{add_button_text:"Add image"},video:{add_button_text:"Add video"},audio:{add_button_text:"Add audio"},file:{add_button_text:"Add file"}},side_menu:{add_block_label:"Add block",drag_handle_label:"Open block menu"},drag_handle:{delete_menuitem:"Delete",colors_menuitem:"Colors"},table_handle:{delete_column_menuitem:"Delete column",delete_row_menuitem:"Delete row",add_left_menuitem:"Add column left",add_right_menuitem:"Add column right",add_above_menuitem:"Add row above",add_below_menuitem:"Add row below"},suggestion_menu:{no_items_title:"No items found",loading:"Loading…"},color_picker:{text_title:"Text",background_title:"Background",colors:{default:"Default",gray:"Gray",brown:"Brown",red:"Red",orange:"Orange",yellow:"Yellow",green:"Green",blue:"Blue",purple:"Purple",pink:"Pink"}},formatting_toolbar:{bold:{tooltip:"Bold",secondary_tooltip:"Mod+B"},italic:{tooltip:"Italic",secondary_tooltip:"Mod+I"},underline:{tooltip:"Underline",secondary_tooltip:"Mod+U"},strike:{tooltip:"Strike",secondary_tooltip:"Mod+Shift+S"},code:{tooltip:"Code",secondary_tooltip:""},colors:{tooltip:"Colors"},link:{tooltip:"Create link",secondary_tooltip:"Mod+K"},file_caption:{tooltip:"Edit caption",input_placeholder:"Edit caption"},file_replace:{tooltip:{image:"Replace image",video:"Replace video",audio:"Replace audio",file:"Replace file"}},file_rename:{tooltip:{image:"Rename image",video:"Rename video",audio:"Rename audio",file:"Rename file"},input_placeholder:{image:"Rename image",video:"Rename video",audio:"Rename audio",file:"Rename file"}},file_download:{tooltip:{image:"Download image",video:"Download video",audio:"Download audio",file:"Download file"}},file_delete:{tooltip:{image:"Delete image",video:"Delete video",audio:"Delete audio",file:"Delete file"}},file_preview_toggle:{tooltip:"Toggle preview"},nest:{tooltip:"Nest block",secondary_tooltip:"Tab"},unnest:{tooltip:"Unnest block",secondary_tooltip:"Shift+Tab"},align_left:{tooltip:"Align text left"},align_center:{tooltip:"Align text center"},align_right:{tooltip:"Align text right"},align_justify:{tooltip:"Justify text"}},file_panel:{upload:{title:"Upload",file_placeholder:{image:"Upload image",video:"Upload video",audio:"Upload audio",file:"Upload file"},upload_error:"Error: Upload failed"},embed:{title:"Embed",embed_button:{image:"Embed image",video:"Embed video",audio:"Embed audio",file:"Embed file"},url_placeholder:"Enter URL"}},link_toolbar:{delete:{tooltip:"Remove link"},edit:{text:"Edit link",tooltip:"Edit"},open:{tooltip:"Open in new tab"},form:{title_placeholder:"Edit title",url_placeholder:"Edit URL"}},generic:{ctrl_shortcut:"Ctrl"}},ji=Object.freeze(Object.defineProperty({__proto__:null,ar:Ni,de:Di,en:lt,es:{slash_menu:{heading:{title:"Encabezado 1",subtext:"Encabezado de primer nivel",aliases:["h","encabezado1","h1"],group:"Encabezados"},heading_2:{title:"Encabezado 2",subtext:"Encabezado de sección principal",aliases:["h2","encabezado2","subencabezado"],group:"Encabezados"},heading_3:{title:"Encabezado 3",subtext:"Encabezado de subsección y grupo",aliases:["h3","encabezado3","subencabezado"],group:"Encabezados"},numbered_list:{title:"Lista Numerada",subtext:"Lista con elementos ordenados",aliases:["ol","li","lista","lista numerada"],group:"Bloques básicos"},bullet_list:{title:"Lista con Viñetas",subtext:"Lista con elementos no ordenados",aliases:["ul","li","lista","lista con viñetas"],group:"Bloques básicos"},check_list:{title:"Lista de Verificación",subtext:"Lista con casillas de verificación",aliases:["ul","li","lista","lista de verificación","lista de chequeo","checkbox"],group:"Bloques básicos"},paragraph:{title:"Párrafo",subtext:"El cuerpo de tu documento",aliases:["p","párrafo"],group:"Bloques básicos"},code_block:{title:"Bloque de Código",subtext:"Bloque de código con resaltado de sintaxis",aliases:["code","pre"],group:"Bloques básicos"},table:{title:"Tabla",subtext:"Tabla con celdas editables",aliases:["tabla"],group:"Avanzado"},image:{title:"Imagen",subtext:"Imagen redimensionable con leyenda",aliases:["imagen","subir imagen","cargar","img","foto","media","url"],group:"Medios"},video:{title:"Vídeo",subtext:"Vídeo redimensionable con leyenda",aliases:["video","subir vídeo","cargar","mp4","película","media","url"],group:"Medios"},audio:{title:"Audio",subtext:"Audio incrustado con leyenda",aliases:["audio","subir audio","cargar","mp3","sonido","media","url"],group:"Medios"},file:{title:"Archivo",subtext:"Archivo incrustado",aliases:["archivo","cargar","incrustar","media","url"],group:"Medios"},emoji:{title:"Emoji",subtext:"Busca e inserta un emoji",aliases:["emoji","emoticono","emoción","cara"],group:"Otros"}},placeholders:{default:"Escribe o teclea '/' para comandos",heading:"Encabezado",bulletListItem:"Lista",numberedListItem:"Lista",checkListItem:"Lista"},file_blocks:{image:{add_button_text:"Agregar imagen"},video:{add_button_text:"Agregar vídeo"},audio:{add_button_text:"Agregar audio"},file:{add_button_text:"Agregar archivo"}},side_menu:{add_block_label:"Agregar bloque",drag_handle_label:"Abrir menú de bloque"},drag_handle:{delete_menuitem:"Eliminar",colors_menuitem:"Colores"},table_handle:{delete_column_menuitem:"Eliminar columna",delete_row_menuitem:"Eliminar fila",add_left_menuitem:"Agregar columna a la izquierda",add_right_menuitem:"Agregar columna a la derecha",add_above_menuitem:"Agregar fila arriba",add_below_menuitem:"Agregar fila abajo"},suggestion_menu:{no_items_title:"No se encontraron elementos",loading:"Cargando…"},color_picker:{text_title:"Texto",background_title:"Fondo",colors:{default:"Por defecto",gray:"Gris",brown:"Marrón",red:"Rojo",orange:"Naranja",yellow:"Amarillo",green:"Verde",blue:"Azul",purple:"Morado",pink:"Rosa"}},formatting_toolbar:{bold:{tooltip:"Negrita",secondary_tooltip:"Mod+B"},italic:{tooltip:"Cursiva",secondary_tooltip:"Mod+I"},underline:{tooltip:"Subrayado",secondary_tooltip:"Mod+U"},strike:{tooltip:"Tachado",secondary_tooltip:"Mod+Shift+S"},code:{tooltip:"Código",secondary_tooltip:""},colors:{tooltip:"Colores"},link:{tooltip:"Crear enlace",secondary_tooltip:"Mod+K"},file_caption:{tooltip:"Editar leyenda",input_placeholder:"Editar leyenda"},file_replace:{tooltip:{image:"Reemplazar imagen",video:"Reemplazar vídeo",audio:"Reemplazar audio",file:"Reemplazar archivo"}},file_rename:{tooltip:{image:"Renombrar imagen",video:"Renombrar vídeo",audio:"Renombrar audio",file:"Renombrar archivo"},input_placeholder:{image:"Renombrar imagen",video:"Renombrar vídeo",audio:"Renombrar audio",file:"Renombrar archivo"}},file_download:{tooltip:{image:"Descargar imagen",video:"Descargar vídeo",audio:"Descargar audio",file:"Descargar archivo"}},file_delete:{tooltip:{image:"Eliminar imagen",video:"Eliminar vídeo",audio:"Eliminar audio",file:"Eliminar archivo"}},file_preview_toggle:{tooltip:"Alternar vista previa"},nest:{tooltip:"Anidar bloque",secondary_tooltip:"Tab"},unnest:{tooltip:"Desanidar bloque",secondary_tooltip:"Shift+Tab"},align_left:{tooltip:"Alinear texto a la izquierda"},align_center:{tooltip:"Alinear texto al centro"},align_right:{tooltip:"Alinear texto a la derecha"},align_justify:{tooltip:"Justificar texto"}},file_panel:{upload:{title:"Subir",file_placeholder:{image:"Subir imagen",video:"Subir vídeo",audio:"Subir audio",file:"Subir archivo"},upload_error:"Error: Fallo en la subida"},embed:{title:"Incrustar",embed_button:{image:"Incrustar imagen",video:"Incrustar vídeo",audio:"Incrustar audio",file:"Incrustar archivo"},url_placeholder:"Introduce la URL"}},link_toolbar:{delete:{tooltip:"Eliminar enlace"},edit:{text:"Editar enlace",tooltip:"Editar"},open:{tooltip:"Abrir en nueva pestaña"},form:{title_placeholder:"Editar título",url_placeholder:"Editar URL"}},generic:{ctrl_shortcut:"Ctrl"}},fr:{slash_menu:{heading:{title:"Titre 1",subtext:"Utilisé pour un titre de premier niveau",aliases:["h","titre1","h1"],group:"Titres"},heading_2:{title:"Titre 2",subtext:"Utilisé pour les sections clés",aliases:["h2","titre2","sous-titre"],group:"Titres"},heading_3:{title:"Titre 3",subtext:"Utilisé pour les sous-sections et les titres de groupe",aliases:["h3","titre3","sous-titre"],group:"Titres"},numbered_list:{title:"Liste Numérotée",subtext:"Utilisé pour afficher une liste numérotée",aliases:["ol","li","liste","listenumérotée","liste numérotée"],group:"Blocs de base"},bullet_list:{title:"Liste à Puces",subtext:"Utilisé pour afficher une liste non ordonnée",aliases:["ul","li","liste","listeàpuces","liste à puces"],group:"Blocs de base"},check_list:{title:"Liste de vérification",subtext:"Utilisé pour afficher une liste avec des cases à cocher",aliases:["ul","li","liste","liste de vérification","liste cochée","case à cocher"],group:"Blocs de base"},paragraph:{title:"Paragraphe",subtext:"Utilisé pour le corps de votre document",aliases:["p","paragraphe"],group:"Blocs de base"},code_block:{title:"Bloc de code",subtext:"Bloc de code avec coloration syntaxique",aliases:["code","pre"],group:"Blocs de base"},table:{title:"Tableau",subtext:"Utilisé pour les tableaux",aliases:["tableau"],group:"Avancé"},image:{title:"Image",subtext:"Insérer une image",aliases:["image","uploadImage","télécharger","img","photo","média","url"],group:"Médias"},video:{title:"Vidéo",subtext:"Insérer une vidéo",aliases:["vidéo","téléchargerVidéo","téléverser","mp4","film","média","url"],group:"Média"},audio:{title:"Audio",subtext:"Insérer un audio",aliases:["audio","téléchargerAudio","téléverser","mp3","son","média","url"],group:"Média"},file:{title:"Fichier",subtext:"Insérer un fichier",aliases:["fichier","téléverser","intégrer","média","url"],group:"Média"},emoji:{title:"Emoji",subtext:"Utilisé pour insérer un emoji",aliases:["emoji","émoticône","émotion","visage"],group:"Autres"}},placeholders:{default:"Entrez du texte ou tapez '/' pour les commandes",heading:"Titre",bulletListItem:"Liste",numberedListItem:"Liste",checkListItem:"Liste"},file_blocks:{image:{add_button_text:"Ajouter une image"},video:{add_button_text:"Ajouter une vidéo"},audio:{add_button_text:"Ajouter un audio"},file:{add_button_text:"Ajouter un fichier"}},side_menu:{add_block_label:"Ajouter un bloc",drag_handle_label:"Ouvrir le menu du bloc"},drag_handle:{delete_menuitem:"Supprimer",colors_menuitem:"Couleurs"},table_handle:{delete_column_menuitem:"Supprimer la colonne",delete_row_menuitem:"Supprimer la ligne",add_left_menuitem:"Ajouter une colonne à gauche",add_right_menuitem:"Ajouter une colonne à droite",add_above_menuitem:"Ajouter une ligne au-dessus",add_below_menuitem:"Ajouter une ligne en dessous"},suggestion_menu:{no_items_title:"Aucun élément trouvé",loading:"Chargement…"},color_picker:{text_title:"Texte",background_title:"Fond",colors:{default:"Défaut",gray:"Gris",brown:"Marron",red:"Rouge",orange:"Orange",yellow:"Jaune",green:"Vert",blue:"Bleu",purple:"Violet",pink:"Rose"}},formatting_toolbar:{bold:{tooltip:"Gras",secondary_tooltip:"Mod+B"},italic:{tooltip:"Italique",secondary_tooltip:"Mod+I"},underline:{tooltip:"Souligner",secondary_tooltip:"Mod+U"},strike:{tooltip:"Barré",secondary_tooltip:"Mod+Shift+X"},code:{tooltip:"Code",secondary_tooltip:""},colors:{tooltip:"Couleurs"},link:{tooltip:"Créer un lien",secondary_tooltip:"Mod+K"},file_caption:{tooltip:"Modifier la légende",input_placeholder:"Modifier la légende"},file_replace:{tooltip:{image:"Remplacer l'image",video:"Remplacer la vidéo",audio:"Remplacer l'audio",file:"Remplacer le fichier"}},file_rename:{tooltip:{image:"Renommer l'image",video:"Renommer la vidéo",audio:"Renommer l'audio",file:"Renommer le fichier"},input_placeholder:{image:"Renommer l'image",video:"Renommer la vidéo",audio:"Renommer l'audio",file:"Renommer le fichier"}},file_download:{tooltip:{image:"Télécharger l'image",video:"Télécharger la vidéo",audio:"Télécharger l'audio",file:"Télécharger le fichier"}},file_delete:{tooltip:{image:"Supprimer l'image",video:"Supprimer la vidéo",audio:"Supprimer l'audio",file:"Supprimer le fichier"}},file_preview_toggle:{tooltip:"Basculer l'aperçu"},nest:{tooltip:"Emboîter le bloc",secondary_tooltip:"Tab"},unnest:{tooltip:"Démboîter le bloc",secondary_tooltip:"Shift+Tab"},align_left:{tooltip:"Aligner le texte à gauche"},align_center:{tooltip:"Aligner le texte au centre"},align_right:{tooltip:"Aligner le texte à droite"},align_justify:{tooltip:"Justifier le texte"}},file_panel:{upload:{title:"Télécharger",file_placeholder:{image:"Télécharger une image",video:"Télécharger une vidéo",audio:"Télécharger un fichier audio",file:"Télécharger un fichier"},upload_error:"Erreur : Échec du téléchargement"},embed:{title:"Intégrer",embed_button:{image:"Intégrer une image",video:"Intégrer une vidéo",audio:"Intégrer un fichier audio",file:"Intégrer un fichier"},url_placeholder:"Entrez l'URL"}},link_toolbar:{delete:{tooltip:"Supprimer le lien"},edit:{text:"Modifier le lien",tooltip:"Modifier"},open:{tooltip:"Ouvrir dans un nouvel onglet"},form:{title_placeholder:"Modifier le titre",url_placeholder:"Modifier l'URL"}},generic:{ctrl_shortcut:"Ctrl"}},hr:{slash_menu:{heading:{title:"Naslov 1",subtext:"Glavni naslov",aliases:["h","naslov1","h1"],group:"Naslovi"},heading_2:{title:"Naslov 2",subtext:"Naslov poglavlja",aliases:["h2","naslov2","podnaslov"],group:"Naslovi"},heading_3:{title:"Naslov 3",subtext:"Naslov podpoglavlja",aliases:["h3","naslov3","podnaslov"],group:"Naslovi"},numbered_list:{title:"Numerirani popis",subtext:"Popis s numeriranim stavkama",aliases:["poredaniPopis","stavkaPopisa","popis","numeriraniPopis","numerirani popis"],group:"Osnovni blokovi"},bullet_list:{title:"Popis s oznakama",subtext:"Popis s grafičkim oznakama",aliases:["neporedaniPopis","stavkaPopisa","popis","popisSOznakama","popis s oznakama"],group:"Osnovni blokovi"},check_list:{title:"Check lista",subtext:"Popis s kućicama za označavanje",aliases:["neporedaniPopis","stavkaPopisa","popis","popisZaProvjeru","check lista","označeni popis","kućicaZaOznačavanje"],group:"Osnovni blokovi"},paragraph:{title:"Normalan tekst",subtext:"Tekst paragrafa",aliases:["p","paragraf"],group:"Osnovni blokovi"},table:{title:"Tablica",subtext:"Tablica s podesivim ćelijama",aliases:["tablica"],group:"Napredno"},image:{title:"Slika",subtext:"Slika s podesivom veličinom i natpisom",aliases:["slika","učitavanjeSlike","učitaj","img","fotografija","medij","url"],group:"Mediji"},video:{title:"Video",subtext:"Video s podesivom veličinom i natpisom",aliases:["video","učitavanjeVidea","učitaj","mp4","film","medij","url"],group:"Mediji"},audio:{title:"Audio",subtext:"Audio s natpisom",aliases:["audio","učitavanjeAudija","učitaj","mp3","zvuk","medij","url"],group:"Mediji"},file:{title:"Datoteka",subtext:"Ugrađena datoteka",aliases:["datoteka","učitaj","ugradi","medij","url"],group:"Mediji"},emoji:{title:"Emoji",subtext:"Pretraži i umetni emoji",aliases:["emoji","emotikon","emocija","lice"],group:"Ostalo"}},placeholders:{default:"Unesi tekst ili upiši ‘/’ za naredbe",heading:"Naslov",bulletListItem:"Lista",numberedListItem:"Lista",checkListItem:"Lista"},file_blocks:{image:{add_button_text:"Dodaj sliku"},video:{add_button_text:"Dodaj video"},audio:{add_button_text:"Dodaj audio"},file:{add_button_text:"Dodaj datoteku"}},side_menu:{add_block_label:"Dodaj blok",drag_handle_label:"Meni za dodavanje bloka"},drag_handle:{delete_menuitem:"Ukloni",colors_menuitem:"Boje"},table_handle:{delete_column_menuitem:"Ukloni stupac",delete_row_menuitem:"Ukloni redak",add_left_menuitem:"Dodaj stupac lijevo",add_right_menuitem:"Dodaj stupac desno",add_above_menuitem:"Dodaj redak iznad",add_below_menuitem:"Dodaj redak ispod"},suggestion_menu:{no_items_title:"Stavke nisu pronađene",loading:"Učitavanje…"},color_picker:{text_title:"Tekst",background_title:"Pozadina",colors:{default:"Zadano",gray:"Siva",brown:"Smeđa",red:"Crvena",orange:"Narančasta",yellow:"Žuta",green:"Zelena",blue:"Plava",purple:"Ljubičasta",pink:"Ružičasta"}},formatting_toolbar:{bold:{tooltip:"Podebljano",secondary_tooltip:"Mod+B"},italic:{tooltip:"Kurziv",secondary_tooltip:"Mod+I"},underline:{tooltip:"Podcrtano",secondary_tooltip:"Mod+U"},strike:{tooltip:"Precrtano",secondary_tooltip:"Mod+Shift+S"},code:{tooltip:"Kod",secondary_tooltip:""},colors:{tooltip:"Boja"},link:{tooltip:"Kreiraj poveznicu",secondary_tooltip:"Mod+K"},file_caption:{tooltip:"Uredi natpis",input_placeholder:"Uredi natpis"},file_replace:{tooltip:{image:"Zamijeni sliku",video:"Zamijeni video",audio:"Zamijeni audio",file:"Zamijeni datoteku"}},file_rename:{tooltip:{image:"Preimenuj sliku",video:"Preimenuj video",audio:"Preimenuj audio",file:"Preimenuj datoteku"},input_placeholder:{image:"Preimenuj sliku",video:"Preimenuj video",audio:"Preimenuj audio",file:"Preimenuj datoteku"}},file_download:{tooltip:{image:"Preuzmi sliku",video:"Preuzmi video",audio:"Preuzmi audio",file:"Preuzmi datoteku"}},file_delete:{tooltip:{image:"Ukloni sliku",video:"Ukloni video",audio:"Ukloni audio",file:"Ukloni datoteku"}},file_preview_toggle:{tooltip:"Prikaži/sakrij pregled"},nest:{tooltip:"Ugnijezdi blok",secondary_tooltip:"Tab"},unnest:{tooltip:"Razgnijezdi blok",secondary_tooltip:"Shift+Tab"},align_left:{tooltip:"Poravnaj tekst lijevo"},align_center:{tooltip:"Poravnaj tekst po sredini"},align_right:{tooltip:"Poravnaj tekst desno"},align_justify:{tooltip:"Poravnaj tekst obostrano"}},file_panel:{upload:{title:"Učitaj",file_placeholder:{image:"Učitaj sliku",video:"Učitaj video",audio:"Učitaj audio",file:"Učitaj datoteku"},upload_error:"Pogreška: Učitavanje nije uspjelo"},embed:{title:"Ugradi",embed_button:{image:"Ugradi sliku",video:"Ugradi video",audio:"Ugradi audio",file:"Ugradi datoteku"},url_placeholder:"Dodaj URL"}},link_toolbar:{delete:{tooltip:"Ukloni poveznicu"},edit:{text:"Uredi poveznicu",tooltip:"Uredi"},open:{tooltip:"Otvori u novoj kartici"},form:{title_placeholder:"Uredi naslov",url_placeholder:"Uredi URL"}},generic:{ctrl_shortcut:"Ctrl"}},is:{slash_menu:{heading:{title:"Fyrirsögn 1",subtext:"Notað fyrir efstu fyrirsögn",aliases:["h","fyrirsogn1","h1"],group:"Fyrirsagnir"},heading_2:{title:"Fyrirsögn 2",subtext:"Notað fyrir lykilhluta",aliases:["h2","fyrirsogn2","undirfyrirsogn"],group:"Fyrirsagnir"},heading_3:{title:"Fyrirsögn 3",subtext:"Notað fyrir undirhluta og hópfyrirsagnir",aliases:["h3","fyrirsogn3","undirfyrirsogn"],group:"Fyrirsagnir"},numbered_list:{title:"Númeruð listi",subtext:"Notað til að birta númeraðan lista",aliases:["ol","li","listi","numeradurlisti"],group:"Grunnblokkar"},bullet_list:{title:"Punktalisti",subtext:"Notað til að birta óraðaðan lista",aliases:["ul","li","listi","punktalisti"],group:"Grunnblokkar"},check_list:{title:"Athugunarlisti",subtext:"Notað til að sýna lista með gátreitum",aliases:["ul","li","listi","athugunarlisti","merktur listi"],group:"Grunnblokkar"},paragraph:{title:"Málsgrein",subtext:"Notað fyrir meginmál skjalsins",aliases:["p","malsgrein"],group:"Grunnblokkar"},code_block:{title:"Kóðablokk",subtext:"Kóðablokkur með litskiptingu",aliases:["kóði","pre"],group:"Grunnblokkar"},table:{title:"Tafla",subtext:"Notað fyrir töflur",aliases:["tafla"],group:"Ítarlegt"},image:{title:"Mynd",subtext:"Settu inn mynd",aliases:["mynd","myndaupphlaed","upphlaed","img","mynd","media","url"],group:"Miðlar"},video:{title:"Myndband",subtext:"Setja inn myndband",aliases:["myndband","videoUpphala","hlaða upp","mp4","kvikmynd","miðill","url"],group:"Miðill"},audio:{title:"Hljóð",subtext:"Setja inn hljóð",aliases:["hljóð","audioUpphala","hlaða upp","mp3","hljóð","miðill","url"],group:"Miðlar"},file:{title:"Skrá",subtext:"Setja inn skrá",aliases:["skrá","hlaða upp","fella inn","miðill","url"],group:"Miðlar"},emoji:{title:"Emoji",subtext:"Notað til að setja inn smámynd",aliases:["emoji","andlitsávísun","tilfinningar","andlit"],group:"Annað"}},placeholders:{default:"Sláðu inn texta eða skrifaðu '/' fyrir skipanir",heading:"Fyrirsögn",bulletListItem:"Listi",numberedListItem:"Listi",checkListItem:"Listi"},file_blocks:{image:{add_button_text:"Bæta við mynd"},video:{add_button_text:"Bæta við myndbandi"},audio:{add_button_text:"Bæta við hljóði"},file:{add_button_text:"Bæta við skrá"}},side_menu:{add_block_label:"Bæta við blokki",drag_handle_label:"Opna blokkarvalmynd"},drag_handle:{delete_menuitem:"Eyða",colors_menuitem:"Litir"},table_handle:{delete_column_menuitem:"Eyða dálki",delete_row_menuitem:"Eyða röð",add_left_menuitem:"Bæta dálki við til vinstri",add_right_menuitem:"Bæta dálki við til hægri",add_above_menuitem:"Bæta röð við fyrir ofan",add_below_menuitem:"Bæta röð við fyrir neðan"},suggestion_menu:{no_items_title:"Engir hlutir fundust",loading:"Hleður…"},color_picker:{text_title:"Texti",background_title:"Bakgrunnur",colors:{default:"Sjálfgefið",gray:"Grár",brown:"Brúnn",red:"Rauður",orange:"Appelsínugulur",yellow:"Gulur",green:"Grænn",blue:"Blár",purple:"Fjólublár",pink:"Bleikur"}},formatting_toolbar:{bold:{tooltip:"Feitletrað",secondary_tooltip:"Mod+B"},italic:{tooltip:"Skáletrað",secondary_tooltip:"Mod+I"},underline:{tooltip:"Undirstrikað",secondary_tooltip:"Mod+U"},strike:{tooltip:"Yfirstrikað",secondary_tooltip:"Mod+Shift+X"},code:{tooltip:"Kóði",secondary_tooltip:""},colors:{tooltip:"Litir"},link:{tooltip:"Búa til tengil",secondary_tooltip:"Mod+K"},file_caption:{tooltip:"Breyta myndatexta",input_placeholder:"Breyta myndatexta"},file_replace:{tooltip:{image:"Skipta um mynd",video:"Skipta um myndband",audio:"Skipta um hljóð",file:"Skipta um skrá"}},file_rename:{tooltip:{image:"Endurnefna mynd",video:"Endurnefna myndband",audio:"Endurnefna hljóð",file:"Endurnefna skrá"},input_placeholder:{image:"Endurnefna mynd",video:"Endurnefna myndband",audio:"Endurnefna hljóð",file:"Endurnefna skrá"}},file_download:{tooltip:{image:"Sækja mynd",video:"Sækja myndband",audio:"Sækja hljóð",file:"Sækja skrá"}},file_delete:{tooltip:{image:"Eyða mynd",video:"Eyða myndbandi",audio:"Eyða hljóði",file:"Eyða skrá"}},file_preview_toggle:{tooltip:"Skipta um forskoðun"},nest:{tooltip:"Fella blokk saman",secondary_tooltip:"Tab"},unnest:{tooltip:"Afþýða blokk",secondary_tooltip:"Shift+Tab"},align_left:{tooltip:"Vinstrijafna texta"},align_center:{tooltip:"Miðjustilla texta"},align_right:{tooltip:"Hægrijafna texta"},align_justify:{tooltip:"Jafna texta"}},file_panel:{upload:{title:"Hlaða upp",file_placeholder:{image:"Hlaða upp mynd",video:"Hlaða upp myndband",audio:"Hlaða upp hljóð",file:"Hlaða upp skrá"},upload_error:"Villa: Upphleðsla mistókst"},embed:{title:"Innsetja",embed_button:{image:"Innsetja mynd",video:"Innsetja myndband",audio:"Innsetja hljóð",file:"Innsetja skrá"},url_placeholder:"Sláðu inn URL"}},link_toolbar:{delete:{tooltip:"Fjarlægja tengil"},edit:{text:"Breyta tengli",tooltip:"Breyta"},open:{tooltip:"Opna í nýjum flipa"},form:{title_placeholder:"Breyta titli",url_placeholder:"Breyta URL"}},generic:{ctrl_shortcut:"Ctrl"}},ja:{slash_menu:{heading:{title:"見出し1",subtext:"トップレベルの見出しに使用",aliases:["h","見出し1","h1","大見出し"],group:"見出し"},heading_2:{title:"見出し2",subtext:"重要なセクションに使用",aliases:["h2","見出し2","subheading","中見出し"],group:"見出し"},heading_3:{title:"見出し3",subtext:"セクションやグループの見出しに使用",aliases:["h3","見出し3","subheading","小見出し"],group:"見出し"},numbered_list:{title:"番号付リスト",subtext:"番号付リストを表示するために使用",aliases:["ol","li","numberedlist","numbered list","リスト","番号付リスト","番号 リスト"],group:"基本ブロック"},bullet_list:{title:"箇条書き",subtext:"箇条書きを表示するために使用",aliases:["ul","li","bulletlist","bullet list","リスト","箇条書きリスト"],group:"基本ブロック"},check_list:{title:"チェックリスト",subtext:"チェックボックス付きリストを表示するために使用されます",aliases:["ul","li","list","checklist","checked list","リスト","チェックリスト","チェックされたリスト"],group:"基本ブロック"},paragraph:{title:"標準テキスト",subtext:"本文に使用",aliases:["p","paragraph","標準テキスト"],group:"基本ブロック"},code_block:{title:"コードブロック",subtext:"シンタックスハイライト付きのコードブロック",aliases:["code","pre","コード","コードブロック"],group:"基本ブロック"},table:{title:"表",subtext:"表に使用",aliases:["table","表","テーブル"],group:"高度なブロック"},image:{title:"画像",subtext:"画像を挿入",aliases:["image","imageUpload","upload","img","picture","media","url","画像"],group:"メディア"},video:{title:"ビデオ",subtext:"ビデオを挿入",aliases:["video","videoUpload","upload","mp4","film","media","url","ビデオ"],group:"メディア"},audio:{title:"オーディオ",subtext:"オーディオを挿入",aliases:["audio","audioUpload","upload","mp3","sound","media","url","オーディオ"],group:"メディア"},file:{title:"ファイル",subtext:"ファイルを挿入",aliases:["file","upload","embed","media","url","ファイル"],group:"メディア"},emoji:{title:"絵文字",subtext:"絵文字を挿入するために使用します",aliases:["絵文字","顔文字","感情表現","顔"],group:"その他"}},placeholders:{default:"テキストを入力するか'/' を入力してコマンド選択",heading:"見出し",bulletListItem:"リストを追加",numberedListItem:"リストを追加",checkListItem:"リストを追加"},file_blocks:{image:{add_button_text:"画像を追加"},video:{add_button_text:"ビデオを追加"},audio:{add_button_text:"オーディオを追加"},file:{add_button_text:"ファイルを追加"}},side_menu:{add_block_label:"ブロックを追加",drag_handle_label:"ブロックメニュー"},drag_handle:{delete_menuitem:"削除",colors_menuitem:"色を変更"},table_handle:{delete_column_menuitem:"列を削除",delete_row_menuitem:"行を削除",add_left_menuitem:"左に列を追加",add_right_menuitem:"右に列を追加",add_above_menuitem:"上に行を追加",add_below_menuitem:"下に行を追加"},suggestion_menu:{no_items_title:"アイテムが見つかりません",loading:"読込中…"},color_picker:{text_title:"文字色",background_title:"背景色",colors:{default:"デフォルト",gray:"グレー",brown:"茶色",red:"赤",orange:"オレンジ",yellow:"黄色",green:"緑",blue:"青",purple:"紫",pink:"ピンク"}},formatting_toolbar:{bold:{tooltip:"太字",secondary_tooltip:"Mod+B"},italic:{tooltip:"斜体",secondary_tooltip:"Mod+I"},underline:{tooltip:"下線",secondary_tooltip:"Mod+U"},strike:{tooltip:"打ち消し",secondary_tooltip:"Mod+Shift+X"},code:{tooltip:"コード",secondary_tooltip:""},colors:{tooltip:"色"},link:{tooltip:"リンク",secondary_tooltip:"Mod+K"},file_caption:{tooltip:"キャプションを編集",input_placeholder:"キャプションを編集"},file_replace:{tooltip:{image:"画像を置換",video:"ビデオを置換",audio:"オーディオを置換",file:"ファイルを置換"}},file_rename:{tooltip:{image:"画像の名前を変更",video:"ビデオの名前を変更",audio:"オーディオの名前を変更",file:"ファイルの名前を変更"},input_placeholder:{image:"画像の名前を変更",video:"ビデオの名前を変更",audio:"オーディオの名前を変更",file:"ファイルの名前を変更"}},file_download:{tooltip:{image:"画像をダウンロード",video:"ビデオをダウンロード",audio:"オーディオをダウンロード",file:"ファイルをダウンロード"}},file_delete:{tooltip:{image:"画像を削除",video:"ビデオを削除",audio:"オーディオを削除",file:"ファイルを削除"}},file_preview_toggle:{tooltip:"プレビューの切り替え"},nest:{tooltip:"インデント増",secondary_tooltip:"Tab"},unnest:{tooltip:"インデント減",secondary_tooltip:"Shift+Tab"},align_left:{tooltip:"左揃え"},align_center:{tooltip:"中央揃え"},align_right:{tooltip:"右揃え"},align_justify:{tooltip:"両端揃え"}},file_panel:{upload:{title:"アップロード",file_placeholder:{image:"画像をアップロード",video:"ビデオをアップロード",audio:"オーディオをアップロード",file:"ファイルをアップロード"},upload_error:"エラー: アップロードが失敗しました"},embed:{title:"埋め込み",embed_button:{image:"画像を埋め込む",video:"ビデオを埋め込む",audio:"オーディオを埋め込む",file:"ファイルを埋め込む"},url_placeholder:"URLを入力"}},link_toolbar:{delete:{tooltip:"リンクを解除"},edit:{text:"リンクを編集",tooltip:"編集"},open:{tooltip:"新しいタブでリンクを開く"},form:{title_placeholder:"タイトルを編集",url_placeholder:"URLを編集"}},generic:{ctrl_shortcut:"Ctrl"}},ko:{slash_menu:{heading:{title:"제목1",subtext:"섹션 제목(대)",aliases:["h","제목1","h1","대제목"],group:"제목"},heading_2:{title:"제목2",subtext:"섹션 제목(중)",aliases:["h2","제목2","중제목"],group:"제목"},heading_3:{title:"제목3",subtext:"섹션 제목(소)",aliases:["h3","제목3","subheading"],group:"제목"},numbered_list:{title:"번호 매기기 목록",subtext:"번호가 매겨진 목록을 추가합니다.",aliases:["ol","li","목록","번호 매기기 목록","번호 목록"],group:"기본 블록"},bullet_list:{title:"글머리 기호 목록",subtext:"간단한 글머리 기호를 추가합니다.",aliases:["ul","li","목록","글머리 기호 목록","글머리 목록"],group:"기본 블록"},check_list:{title:"체크리스트",subtext:"체크박스가 있는 목록을 표시하는 데 사용",aliases:["ul","li","목록","체크리스트","체크 리스트","체크된 목록","체크박스"],group:"기본 블록"},paragraph:{title:"본문",subtext:"일반 텍스트",aliases:["p","paragraph","본문"],group:"기본 블록"},code_block:{title:"코드 블록",subtext:"구문 강조가 있는 코드 블록",aliases:["code","pre"],group:"기본 블록"},table:{title:"표",subtext:"간단한 표를 추가합니다.",aliases:["표"],group:"고급"},image:{title:"이미지",subtext:"이미지 파일을 업로드합니다.",aliases:["image","imageUpload","upload","img","picture","media","이미지","url"],group:"미디어"},video:{title:"비디오",subtext:"비디오 삽입",aliases:["video","videoUpload","upload","mp4","film","media","동영상","url"],group:"미디어"},audio:{title:"오디오",subtext:"오디오 삽입",aliases:["audio","audioUpload","upload","mp3","sound","media","오디오","url"],group:"미디어"},file:{title:"파일",subtext:"파일 삽입",aliases:["file","upload","embed","media","파일","url"],group:"미디어"},emoji:{title:"이모지",subtext:"이모지 삽입용으로 사용됩니다",aliases:["이모지","emoji","감정 표현","emotion expression","표정","face expression","얼굴","face"],group:"기타"}},placeholders:{default:"텍스트를 입력하거나 /를 입력하여 명령을 입력하세요.",heading:"제목",bulletListItem:"목록",numberedListItem:"목록",checkListItem:"목록"},file_blocks:{image:{add_button_text:"이미지 추가"},video:{add_button_text:"비디오 추가"},audio:{add_button_text:"오디오 추가"},file:{add_button_text:"파일 추가"}},side_menu:{add_block_label:"블록 추가",drag_handle_label:"블록 메뉴 열기"},drag_handle:{delete_menuitem:"삭제",colors_menuitem:"색깔"},table_handle:{delete_column_menuitem:"열 1개 삭제",delete_row_menuitem:"행 삭제",add_left_menuitem:"왼쪽에 열 1개 추가",add_right_menuitem:"오른쪽에 열 1개 추가",add_above_menuitem:"위에 행 1개 추가",add_below_menuitem:"아래에 행 1개 추가"},suggestion_menu:{no_items_title:"항목을 찾을 수 없음",loading:"로딩 중…"},color_picker:{text_title:"텍스트",background_title:"배경",colors:{default:"기본",gray:"회색",brown:"갈색",red:"빨간색",orange:"주황색",yellow:"노란색",green:"녹색",blue:"파란색",purple:"보라색",pink:"분홍색"}},formatting_toolbar:{bold:{tooltip:"진하게",secondary_tooltip:"Mod+B"},italic:{tooltip:"기울임",secondary_tooltip:"Mod+I"},underline:{tooltip:"밑줄",secondary_tooltip:"Mod+U"},strike:{tooltip:"취소선",secondary_tooltip:"Mod+Shift+X"},code:{tooltip:"코드",secondary_tooltip:""},colors:{tooltip:"색깔"},link:{tooltip:"링크 만들기",secondary_tooltip:"Mod+K"},file_caption:{tooltip:"이미지 캡션 수정",input_placeholder:"이미지 캡션 수정"},file_replace:{tooltip:{image:"이미지 교체",video:"비디오 교체",audio:"오디오 교체",file:"파일 교체"}},file_rename:{tooltip:{image:"이미지 이름 변경",video:"비디오 이름 변경",audio:"오디오 이름 변경",file:"파일 이름 변경"},input_placeholder:{image:"이미지 이름 변경",video:"비디오 이름 변경",audio:"오디오 이름 변경",file:"파일 이름 변경"}},file_download:{tooltip:{image:"이미지 다운로드",video:"비디오 다운로드",audio:"오디오 다운로드",file:"파일 다운로드"}},file_delete:{tooltip:{image:"이미지 삭제",video:"비디오 삭제",audio:"오디오 삭제",file:"파일 삭제"}},file_preview_toggle:{tooltip:"미리보기 전환"},nest:{tooltip:"중첩 블록",secondary_tooltip:"Tab"},unnest:{tooltip:"비중첩 블록",secondary_tooltip:"Shift+Tab"},align_left:{tooltip:"텍스트 왼쪽 맞춤"},align_center:{tooltip:"텍스트 가운데 맞춤"},align_right:{tooltip:"텍스트 오른쪽 맞춤"},align_justify:{tooltip:"텍스트 양쪽 맞춤"}},file_panel:{upload:{title:"업로드",file_placeholder:{image:"이미지 업로드",video:"비디오 업로드",audio:"오디오 업로드",file:"파일 업로드"},upload_error:"오류: 업로드 실패"},embed:{title:"임베드",embed_button:{image:"이미지 삽입",video:"비디오 삽입",audio:"오디오 삽입",file:"파일 삽입"},url_placeholder:"URL을 입력하세요."}},link_toolbar:{delete:{tooltip:"링크 삭제"},edit:{text:"링크 수정",tooltip:"수정"},open:{tooltip:"새 탭으로 열기"},form:{title_placeholder:"제목 수정",url_placeholder:"URL 수정"}},generic:{ctrl_shortcut:"Ctrl"}},nl:{slash_menu:{heading:{title:"Kop 1",subtext:"Gebruikt voor een hoofdkop",aliases:["h","kop1","h1"],group:"Koppen"},heading_2:{title:"Kop 2",subtext:"Gebruikt voor belangrijke secties",aliases:["h2","kop2","subkop"],group:"Koppen"},heading_3:{title:"Kop 3",subtext:"Gebruikt voor subsecties en groepskoppen",aliases:["h3","kop3","subkop"],group:"Koppen"},numbered_list:{title:"Genummerde Lijst",subtext:"Gebruikt om een genummerde lijst weer te geven",aliases:["ol","li","lijst","genummerdelijst","genummerde lijst"],group:"Basisblokken"},bullet_list:{title:"Puntenlijst",subtext:"Gebruikt om een ongeordende lijst weer te geven",aliases:["ul","li","lijst","puntenlijst","punten lijst"],group:"Basisblokken"},check_list:{title:"Controlelijst",subtext:"Gebruikt om een lijst met selectievakjes weer te geven",aliases:["ul","li","lijst","aangevinkte lijst","selectievakje"],group:"Basisblokken"},paragraph:{title:"Paragraaf",subtext:"Gebruikt voor de hoofdtekst van uw document",aliases:["p","paragraaf"],group:"Basisblokken"},code_block:{title:"Codeblok",subtext:"Codeblok met syntax highlighting",aliases:["code","pre"],group:"Basisblokken"},table:{title:"Tabel",subtext:"Gebruikt voor tabellen",aliases:["tabel"],group:"Geavanceerd"},image:{title:"Afbeelding",subtext:"Voeg een afbeelding in",aliases:["afbeelding","imageUpload","upload","img","foto","media","url"],group:"Media"},video:{title:"Video",subtext:"Voeg een video in",aliases:["video","videoUploaden","upload","mp4","film","media","url","drive","dropbox"],group:"Media"},audio:{title:"Audio",subtext:"Voeg audio in",aliases:["audio","audioUploaden","upload","mp3","geluid","media","url"],group:"Media"},file:{title:"Bestand",subtext:"Voeg een bestand in",aliases:["bestand","upload","insluiten","media","url"],group:"Media"},emoji:{title:"Emoji",subtext:"Gebruikt voor het invoegen van een emoji",aliases:["emoji","emotie-uitdrukking","gezichtsuitdrukking","gezicht"],group:"Overig"}},placeholders:{default:"Voer tekst in of type '/' voor commando's",heading:"Kop",bulletListItem:"Lijst",numberedListItem:"Lijst",checkListItem:"Lijst"},file_blocks:{image:{add_button_text:"Afbeelding toevoegen"},video:{add_button_text:"Video toevoegen"},audio:{add_button_text:"Audio toevoegen"},file:{add_button_text:"Bestand toevoegen"}},side_menu:{add_block_label:"Nieuw blok",drag_handle_label:"Open blok menu"},drag_handle:{delete_menuitem:"Verwijder",colors_menuitem:"Kleuren"},table_handle:{delete_column_menuitem:"Verwijder kolom",delete_row_menuitem:"Verwijder rij",add_left_menuitem:"Voeg kolom links toe",add_right_menuitem:"Voeg kolom rechts toe",add_above_menuitem:"Voeg rij boven toe",add_below_menuitem:"Voeg rij onder toe"},suggestion_menu:{no_items_title:"Geen items gevonden",loading:"Laden…"},color_picker:{text_title:"Tekst",background_title:"Achtergrond",colors:{default:"Standaard",gray:"Grijs",brown:"Bruin",red:"Rood",orange:"Oranje",yellow:"Geel",green:"Groen",blue:"Blauw",purple:"Paars",pink:"Roze"}},formatting_toolbar:{bold:{tooltip:"Vet",secondary_tooltip:"Mod+B"},italic:{tooltip:"Cursief",secondary_tooltip:"Mod+I"},underline:{tooltip:"Onderstrepen",secondary_tooltip:"Mod+U"},strike:{tooltip:"Doorstrepen",secondary_tooltip:"Mod+Shift+X"},code:{tooltip:"Code",secondary_tooltip:""},colors:{tooltip:"Kleuren"},link:{tooltip:"Maak link",secondary_tooltip:"Mod+K"},file_caption:{tooltip:"Bewerk onderschrift",input_placeholder:"Bewerk onderschrift"},file_replace:{tooltip:{image:"Afbeelding vervangen",video:"Video vervangen",audio:"Audio vervangen",file:"Bestand vervangen"}},file_rename:{tooltip:{image:"Afbeelding hernoemen",video:"Video hernoemen",audio:"Audio hernoemen",file:"Bestand hernoemen"},input_placeholder:{image:"Afbeelding hernoemen",video:"Video hernoemen",audio:"Audio hernoemen",file:"Bestand hernoemen"}},file_download:{tooltip:{image:"Afbeelding downloaden",video:"Video downloaden",audio:"Audio downloaden",file:"Bestand downloaden"}},file_delete:{tooltip:{image:"Afbeelding verwijderen",video:"Video verwijderen",audio:"Audio verwijderen",file:"Bestand verwijderen"}},file_preview_toggle:{tooltip:"Voorbeeldschakelaar"},nest:{tooltip:"Nest blok",secondary_tooltip:"Tab"},unnest:{tooltip:"Ontnest blok",secondary_tooltip:"Shift+Tab"},align_left:{tooltip:"Tekst links uitlijnen"},align_center:{tooltip:"Tekst centreren"},align_right:{tooltip:"Tekst rechts uitlijnen"},align_justify:{tooltip:"Tekst uitvullen"}},file_panel:{upload:{title:"Upload",file_placeholder:{image:"Afbeelding uploaden",video:"Video uploaden",audio:"Audio uploaden",file:"Bestand uploaden"},upload_error:"Fout: Upload mislukt"},embed:{title:"Insluiten",embed_button:{image:"Afbeelding insluiten",video:"Video insluiten",audio:"Audio insluiten",file:"Bestand insluiten"},url_placeholder:"Voer URL in"}},link_toolbar:{delete:{tooltip:"Verwijder link"},edit:{text:"Bewerk link",tooltip:"Bewerk"},open:{tooltip:"Open in nieuw tabblad"},form:{title_placeholder:"Bewerk titel",url_placeholder:"Bewerk URL"}},generic:{ctrl_shortcut:"Ctrl"}},pl:{slash_menu:{heading:{title:"Nagłówek 1",subtext:"Używany dla nagłówka najwyższego poziomu",aliases:["h","naglowek1","h1"],group:"Nagłówki"},heading_2:{title:"Nagłówek 2",subtext:"Używany dla kluczowych sekcji",aliases:["h2","naglowek2","podnaglowek"],group:"Nagłówki"},heading_3:{title:"Nagłówek 3",subtext:"Używany dla podsekcji i grup nagłówków",aliases:["h3","naglowek3","podnaglowek"],group:"Nagłówki"},numbered_list:{title:"Lista numerowana",subtext:"Używana do wyświetlania listy numerowanej",aliases:["ol","li","lista","numerowana lista"],group:"Podstawowe bloki"},bullet_list:{title:"Lista punktowana",subtext:"Używana do wyświetlania listy bez numeracji",aliases:["ul","li","lista","punktowana lista"],group:"Podstawowe bloki"},check_list:{title:"Lista z polami wyboru",subtext:"Używana do wyświetlania listy z polami wyboru",aliases:["ul","li","lista","lista z polami wyboru","pole wyboru"],group:"Podstawowe bloki"},paragraph:{title:"Akapit",subtext:"Używany dla treści dokumentu",aliases:["p","akapit"],group:"Podstawowe bloki"},code_block:{title:"Blok kodu",subtext:"Blok kodu z podświetleniem składni",aliases:["kod","pre"],group:"Podstawowe bloki"},table:{title:"Tabela",subtext:"Używana do tworzenia tabel",aliases:["tabela"],group:"Zaawansowane"},image:{title:"Zdjęcie",subtext:"Wstaw zdjęcie",aliases:["obraz","wrzućZdjęcie","wrzuć","img","zdjęcie","media","url"],group:"Media"},video:{title:"Wideo",subtext:"Wstaw wideo",aliases:["wideo","wrzućWideo","wrzuć","mp4","film","media","url"],group:"Media"},audio:{title:"Audio",subtext:"Wstaw audio",aliases:["audio","wrzućAudio","wrzuć","mp3","dźwięk","media","url"],group:"Media"},file:{title:"Plik",subtext:"Wstaw plik",aliases:["plik","wrzuć","wstaw","media","url"],group:"Media"},emoji:{title:"Emoji",subtext:"Używane do wstawiania emoji",aliases:["emoji","emotka","wyrażenie emocji","twarz"],group:"Inne"}},placeholders:{default:"Wprowadź tekst lub wpisz '/' aby użyć poleceń",heading:"Nagłówek",bulletListItem:"Lista",numberedListItem:"Lista",checkListItem:"Lista"},file_blocks:{image:{add_button_text:"Dodaj zdjęcie"},video:{add_button_text:"Dodaj wideo"},audio:{add_button_text:"Dodaj audio"},file:{add_button_text:"Dodaj plik"}},side_menu:{add_block_label:"Dodaj blok",drag_handle_label:"Otwórz menu bloków"},drag_handle:{delete_menuitem:"Usuń",colors_menuitem:"Kolory"},table_handle:{delete_column_menuitem:"Usuń kolumnę",delete_row_menuitem:"Usuń wiersz",add_left_menuitem:"Dodaj kolumnę po lewej",add_right_menuitem:"Dodaj kolumnę po prawej",add_above_menuitem:"Dodaj wiersz powyżej",add_below_menuitem:"Dodaj wiersz poniżej"},suggestion_menu:{no_items_title:"Nie znaleziono elementów",loading:"Ładowanie…"},color_picker:{text_title:"Tekst",background_title:"Tło",colors:{default:"Domyślny",gray:"Szary",brown:"Brązowy",red:"Czerwony",orange:"Pomarańczowy",yellow:"Żółty",green:"Zielony",blue:"Niebieski",purple:"Fioletowy",pink:"Różowy"}},formatting_toolbar:{bold:{tooltip:"Pogrubienie",secondary_tooltip:"Mod+B"},italic:{tooltip:"Kursywa",secondary_tooltip:"Mod+I"},underline:{tooltip:"Podkreślenie",secondary_tooltip:"Mod+U"},strike:{tooltip:"Przekreślenie",secondary_tooltip:"Mod+Shift+X"},code:{tooltip:"Kod",secondary_tooltip:""},colors:{tooltip:"Kolory"},link:{tooltip:"Utwórz link",secondary_tooltip:"Mod+K"},file_caption:{tooltip:"Zmień podpis",input_placeholder:"Zmień podpis"},file_replace:{tooltip:{image:"Zmień obraz",video:"Zmień wideo",audio:"Zmień audio",file:"Zmień plik"}},file_rename:{tooltip:{image:"Zmień nazwę zdjęcia",video:"Zmień nazwę wideo",audio:"Zmień nazwę audio",file:"Zmień nazwę pliku"},input_placeholder:{image:"Zmień nazwę zdjęcia",video:"Zmień nazwę wideo",audio:"Zmień nazwę audio",file:"Zmień nazwę pliku"}},file_download:{tooltip:{image:"Pobierz zdjęcie",video:"Pobierz wideo",audio:"Pobierz audio",file:"Pobierz plik"}},file_delete:{tooltip:{image:"Usuń zdjęcie",video:"Usuń wideo",audio:"Usuń audio",file:"Usuń plik"}},file_preview_toggle:{tooltip:"Przełącz podgląd"},nest:{tooltip:"Zagnieźdź blok",secondary_tooltip:"Tab"},unnest:{tooltip:"Odgagnieźdź blok",secondary_tooltip:"Shift+Tab"},align_left:{tooltip:"Wyrównaj tekst do lewej"},align_center:{tooltip:"Wyśrodkuj tekst"},align_right:{tooltip:"Wyrównaj tekst do prawej"},align_justify:{tooltip:"Wyjustuj tekst"}},file_panel:{upload:{title:"Wrzuć",file_placeholder:{image:"Wrzuć zdjęcie",video:"Wrzuć wideo",audio:"Wrzuć audio",file:"Wrzuć plik"},upload_error:"Błąd: Przesyłanie nie powiodło się"},embed:{title:"Wstaw",embed_button:{image:"Wstaw zdjęice",video:"Wstaw wideo",audio:"Wstaw audio",file:"Wstaw plik"},url_placeholder:"Wprowadź URL"}},link_toolbar:{delete:{tooltip:"Usuń link"},edit:{text:"Edytuj link",tooltip:"Edytuj"},open:{tooltip:"Otwórz w nowej karcie"},form:{title_placeholder:"Edytuj tytuł",url_placeholder:"Edytuj URL"}},generic:{ctrl_shortcut:"Ctrl"}},pt:{slash_menu:{heading:{title:"Título",subtext:"Usado para um título de nível superior",aliases:["h","titulo1","h1"],group:"Títulos"},heading_2:{title:"Título 2",subtext:"Usado para seções principais",aliases:["h2","titulo2","subtitulo"],group:"Títulos"},heading_3:{title:"Título 3",subtext:"Usado para subseções e títulos de grupo",aliases:["h3","titulo3","subtitulo"],group:"Títulos"},numbered_list:{title:"Lista Numerada",subtext:"Usado para exibir uma lista numerada",aliases:["ol","li","lista","listanumerada","lista numerada"],group:"Blocos básicos"},bullet_list:{title:"Lista com Marcadores",subtext:"Usado para exibir uma lista não ordenada",aliases:["ul","li","lista","listamarcadores","lista com marcadores"],group:"Blocos básicos"},check_list:{title:"Lista de verificação",subtext:"Usado para exibir uma lista com caixas de seleção",aliases:["ul","li","lista","lista de verificação","lista marcada","caixa de seleção"],group:"Blocos básicos"},paragraph:{title:"Parágrafo",subtext:"Usado para o corpo do seu documento",aliases:["p","paragrafo"],group:"Blocos básicos"},code_block:{title:"Bloco de Código",subtext:"Usado para exibir código com destaque de sintaxe",aliases:["codigo","pre"],group:"Blocos básicos"},table:{title:"Tabela",subtext:"Usado para tabelas",aliases:["tabela"],group:"Avançado"},image:{title:"Imagem",subtext:"Inserir uma imagem",aliases:["imagem","uploadImagem","upload","img","foto","media","url"],group:"Mídia"},video:{title:"Vídeo",subtext:"Inserir um vídeo",aliases:["vídeo","uploadVídeo","upload","mp4","filme","mídia","url"],group:"Mídia"},audio:{title:"Áudio",subtext:"Inserir um áudio",aliases:["áudio","uploadÁudio","upload","mp3","som","mídia","url"],group:"Mídia"},file:{title:"Arquivo",subtext:"Inserir um arquivo",aliases:["arquivo","upload","incorporar","mídia","url"],group:"Mídia"},emoji:{title:"Emoji",subtext:"Usado para inserir um emoji",aliases:["emoji","emoticon","expressão emocional","rosto"],group:"Outros"}},placeholders:{default:"Digite texto ou use '/' para comandos",heading:"Título",bulletListItem:"Lista",numberedListItem:"Lista",checkListItem:"Lista"},file_blocks:{image:{add_button_text:"Adicionar imagem"},video:{add_button_text:"Adicionar vídeo"},audio:{add_button_text:"Adicionar áudio"},file:{add_button_text:"Adicionar arquivo"}},side_menu:{add_block_label:"Adicionar bloco",drag_handle_label:"Abrir menu do bloco"},drag_handle:{delete_menuitem:"Excluir",colors_menuitem:"Cores"},table_handle:{delete_column_menuitem:"Excluir coluna",delete_row_menuitem:"Excluir linha",add_left_menuitem:"Adicionar coluna à esquerda",add_right_menuitem:"Adicionar coluna à direita",add_above_menuitem:"Adicionar linha acima",add_below_menuitem:"Adicionar linha abaixo"},suggestion_menu:{no_items_title:"Nenhum item encontrado",loading:"Carregando…"},color_picker:{text_title:"Texto",background_title:"Fundo",colors:{default:"Padrão",gray:"Cinza",brown:"Marrom",red:"Vermelho",orange:"Laranja",yellow:"Amarelo",green:"Verde",blue:"Azul",purple:"Roxo",pink:"Rosa"}},formatting_toolbar:{bold:{tooltip:"Negrito",secondary_tooltip:"Mod+B"},italic:{tooltip:"Itálico",secondary_tooltip:"Mod+I"},underline:{tooltip:"Sublinhado",secondary_tooltip:"Mod+U"},strike:{tooltip:"Riscado",secondary_tooltip:"Mod+Shift+X"},code:{tooltip:"Código",secondary_tooltip:""},colors:{tooltip:"Cores"},link:{tooltip:"Criar link",secondary_tooltip:"Mod+K"},file_caption:{tooltip:"Editar legenda",input_placeholder:"Editar legenda"},file_replace:{tooltip:{image:"Substituir imagem",video:"Substituir vídeo",audio:"Substituir áudio",file:"Substituir arquivo"}},file_rename:{tooltip:{image:"Renomear imagem",video:"Renomear vídeo",audio:"Renomear áudio",file:"Renomear arquivo"},input_placeholder:{image:"Renomear imagem",video:"Renomear vídeo",audio:"Renomear áudio",file:"Renomear arquivo"}},file_download:{tooltip:{image:"Baixar imagem",video:"Baixar vídeo",audio:"Baixar áudio",file:"Baixar arquivo"}},file_delete:{tooltip:{image:"Excluir imagem",video:"Excluir vídeo",audio:"Excluir áudio",file:"Excluir arquivo"}},file_preview_toggle:{tooltip:"Alternar visualização"},nest:{tooltip:"Aninhar bloco",secondary_tooltip:"Tab"},unnest:{tooltip:"Desaninhar bloco",secondary_tooltip:"Shift+Tab"},align_left:{tooltip:"Alinhar à esquerda"},align_center:{tooltip:"Alinhar ao centro"},align_right:{tooltip:"Alinhar à direita"},align_justify:{tooltip:"Justificar texto"}},file_panel:{upload:{title:"Upload",file_placeholder:{image:"Upload de imagem",video:"Upload de vídeo",audio:"Upload de áudio",file:"Upload de arquivo"},upload_error:"Erro: Falha no upload"},embed:{title:"Incorporar",embed_button:{image:"Incorporar imagem",video:"Incorporar vídeo",audio:"Incorporar áudio",file:"Incorporar arquivo"},url_placeholder:"Insira a URL"}},link_toolbar:{delete:{tooltip:"Remover link"},edit:{text:"Editar link",tooltip:"Editar"},open:{tooltip:"Abrir em nova aba"},form:{title_placeholder:"Editar título",url_placeholder:"Editar URL"}},generic:{ctrl_shortcut:"Ctrl"}},ru:{slash_menu:{heading:{title:"Заголовок 1 уровня",subtext:"Используется для заголовка верхнего уровня",aliases:["h","heading1","h1","заголовок1"],group:"Заголовки"},heading_2:{title:"Заголовок 2 уровня",subtext:"Используется для ключевых разделов",aliases:["h2","heading2","subheading","заголовок2","подзаголовок"],group:"Заголовки"},heading_3:{title:"Заголовок 3 уровня",subtext:"Используется для подразделов и групп",aliases:["h3","heading3","subheading","заголовок3","подзаголовок"],group:"Заголовки"},numbered_list:{title:"Нумерованный список",subtext:"Используется для отображения нумерованного списка",aliases:["ol","li","list","numberedlist","numbered list","список","нумерованный список"],group:"Базовые блоки"},bullet_list:{title:"Маркированный список",subtext:"Для отображения неупорядоченного списка.",aliases:["ul","li","list","bulletlist","bullet list","список","маркированный список"],group:"Базовые блоки"},check_list:{title:"Контрольный список",subtext:"Для отображения списка с флажками",aliases:["ul","li","list","checklist","check list","checked list","checkbox","список"],group:"Базовые блоки"},paragraph:{title:"Параграф",subtext:"Основной текст",aliases:["p","paragraph","параграф"],group:"Базовые блоки"},code_block:{title:"Блок кода",subtext:"Блок кода с подсветкой синтаксиса",aliases:["code","pre","блок кода"],group:"Базовые блоки"},table:{title:"Таблица",subtext:"Используется для таблиц",aliases:["table","таблица"],group:"Продвинутый"},image:{title:"Картинка",subtext:"Вставить изображение",aliases:["image","imageUpload","upload","img","picture","media","url","загрузка","картинка","рисунок"],group:"Медиа"},video:{title:"Видео",subtext:"Вставить видео",aliases:["video","videoUpload","upload","mp4","film","media","url","загрузка","видео"],group:"Медиа"},audio:{title:"Аудио",subtext:"Вставить аудио",aliases:["audio","audioUpload","upload","mp3","sound","media","url","загрузка","аудио","звук","музыка"],group:"Медиа"},file:{title:"Файл",subtext:"Вставить файл",aliases:["file","upload","embed","media","url","загрузка","файл"],group:"Медиа"},emoji:{title:"Эмодзи",subtext:"Используется для вставки эмодзи",aliases:["эмодзи","смайлик","выражение эмоций","лицо"],group:"Прочее"}},placeholders:{default:"Ведите текст или введите «/» для команд",heading:"Заголовок",bulletListItem:"Список",numberedListItem:"Список",checkListItem:"Список"},file_blocks:{image:{add_button_text:"Добавить изображение"},video:{add_button_text:"Добавить видео"},audio:{add_button_text:"Добавить аудио"},file:{add_button_text:"Добавить файл"}},side_menu:{add_block_label:"Добавить блок",drag_handle_label:"Открыть меню блока"},drag_handle:{delete_menuitem:"Удалить",colors_menuitem:"Цвета"},table_handle:{delete_column_menuitem:"Удалить столбец",delete_row_menuitem:"Удалить строку",add_left_menuitem:"Добавить столбец слева",add_right_menuitem:"Добавить столбец справа",add_above_menuitem:"Добавить строку выше",add_below_menuitem:"Добавить строку ниже"},suggestion_menu:{no_items_title:"ничего не найдено",loading:"Загрузка…"},color_picker:{text_title:"Текст",background_title:"Задний фон",colors:{default:"По умолчинию",gray:"Серый",brown:"Коричневый",red:"Красный",orange:"Оранжевый",yellow:"Жёлтый",green:"Зелёный",blue:"Голубой",purple:"Фиолетовый",pink:"Розовый"}},formatting_toolbar:{bold:{tooltip:"Жирный",secondary_tooltip:"Mod+B"},italic:{tooltip:"Курсив",secondary_tooltip:"Mod+I"},underline:{tooltip:"Подчёркнутый",secondary_tooltip:"Mod+U"},strike:{tooltip:"Зачёркнутый",secondary_tooltip:"Mod+Shift+X"},code:{tooltip:"Код",secondary_tooltip:""},colors:{tooltip:"Цвета"},link:{tooltip:"Создать ссылку",secondary_tooltip:"Mod+K"},file_caption:{tooltip:"Изменить подпись",input_placeholder:"Изменить подпись"},file_replace:{tooltip:{image:"Заменить изображение",video:"Заменить видео",audio:"Заменить аудио",file:"Заменить файл"}},file_rename:{tooltip:{image:"Переименовать изображение",video:"Переименовать видео",audio:"Переименовать аудио",file:"Переименовать файл"},input_placeholder:{image:"Переименовать изображение",video:"Переименовать видео",audio:"Переименовать аудио",file:"Переименовать файл"}},file_download:{tooltip:{image:"Скачать картинку",video:"Скачать видео",audio:"Скачать аудио",file:"Скачать файл"}},file_delete:{tooltip:{image:"Удалить картинку",video:"Удалить видео",audio:"Удалить аудио",file:"Удалить файл"}},file_preview_toggle:{tooltip:"Переключить предварительный просмотр"},nest:{tooltip:"Сдвинуть вправо",secondary_tooltip:"Tab"},unnest:{tooltip:"Сдвинуть влево",secondary_tooltip:"Shift+Tab"},align_left:{tooltip:"Текст по левому краю"},align_center:{tooltip:"Текст по середине"},align_right:{tooltip:"Текст по правому краю"},align_justify:{tooltip:"По середине текст"}},file_panel:{upload:{title:"Загрузить",file_placeholder:{image:"Загрузить картинки",video:"Загрузить видео",audio:"Загрузить аудио",file:"Загрузить файл"},upload_error:"Ошибка: не удалось загрузить"},embed:{title:"Вставить",embed_button:{image:"Вставить картинку",video:"Вставить видео",audio:"Вставить аудио",file:"Вставить файл"},url_placeholder:"Введите URL"}},link_toolbar:{delete:{tooltip:"Удалить ссылку"},edit:{text:"Изменить ссылку",tooltip:"Редактировать"},open:{tooltip:"Открыть в новой вкладке"},form:{title_placeholder:"Изменить заголовок",url_placeholder:"Изменить URL"}},generic:{ctrl_shortcut:"Ctrl"}},vi:{slash_menu:{heading:{title:"Tiêu đề H1",subtext:"Sử dụng cho tiêu đề cấp cao nhất",aliases:["h","tieude1","dd1"],group:"Tiêu đề"},heading_2:{title:"Tiêu đề H2",subtext:"Sử dụng cho các phần chính",aliases:["h2","tieude2","tieudephu"],group:"Tiêu đề"},heading_3:{title:"Tiêu đề H3",subtext:"Sử dụng cho phụ đề và tiêu đề nhóm",aliases:["h3","tieude3","tieudephu"],group:"Tiêu đề"},numbered_list:{title:"Danh sách đánh số",subtext:"Sử dụng để hiển thị danh sách có đánh số",aliases:["ol","li","ds","danhsachdso","danh sach danh so"],group:"Khối cơ bản"},bullet_list:{title:"Danh sách",subtext:"Sử dụng để hiển thị danh sách không đánh số",aliases:["ul","li","ds","danhsach","danh sach"],group:"Khối cơ bản"},check_list:{title:"Danh sách kiểm tra",subtext:"Dùng để hiển thị danh sách có hộp kiểm",aliases:["ul","li","danh sach","danh sach kiem tra","danh sach da kiem tra","hop kiem"],group:"Khối cơ bản"},paragraph:{title:"Đoạn văn",subtext:"Sử dụng cho nội dung chính của tài liệu",aliases:["p","doanvan"],group:"Khối cơ bản"},code_block:{title:"Mã",subtext:"Sử dụng để hiển thị mã với cú pháp",aliases:["code","pre"],group:"Khối cơ bản"},table:{title:"Bảng",subtext:"Sử dụng để tạo bảng",aliases:["bang"],group:"Nâng cao"},image:{title:"Hình ảnh",subtext:"Chèn hình ảnh",aliases:["anh","tai-len-anh","tai-len","img","hinh","media","url"],group:"Phương tiện"},video:{title:"Video",subtext:"Chèn video",aliases:["video","tai-len-video","tai-len","mp4","phim","media","url"],group:"Phương tiện"},audio:{title:"Âm thanh",subtext:"Chèn âm thanh",aliases:["âm thanh","tai-len-am-thanh","tai-len","mp3","am thanh","media","url"],group:"Phương tiện"},file:{title:"Tệp",subtext:"Chèn tệp",aliases:["tep","tai-len","nhung","media","url"],group:"Phương tiện"},emoji:{title:"Biểu tượng cảm xúc",subtext:"Dùng để chèn biểu tượng cảm xúc",aliases:["biểu tượng cảm xúc","emoji","emoticon","cảm xúc expression","khuôn mặt","face"],group:"Khác"}},placeholders:{default:"Nhập văn bản hoặc gõ '/' để thêm định dạng",heading:"Tiêu đề",bulletListItem:"Danh sách",numberedListItem:"Danh sách",checkListItem:"Danh sách"},file_blocks:{image:{add_button_text:"Thêm ảnh"},video:{add_button_text:"Thêm video"},audio:{add_button_text:"Thêm âm thanh"},file:{add_button_text:"Thêm tệp"}},side_menu:{add_block_label:"Thêm khối",drag_handle_label:"Mở trình đơn khối"},drag_handle:{delete_menuitem:"Xóa",colors_menuitem:"Màu sắc"},table_handle:{delete_column_menuitem:"Xóa cột",delete_row_menuitem:"Xóa hàng",add_left_menuitem:"Thêm cột bên trái",add_right_menuitem:"Thêm cột bên phải",add_above_menuitem:"Thêm hàng phía trên",add_below_menuitem:"Thêm hàng phía dưới"},suggestion_menu:{no_items_title:"Không tìm thấy mục nào",loading:"Đang tải..."},color_picker:{text_title:"Văn bản",background_title:"Nền",colors:{default:"Mặc định",gray:"Xám",brown:"Nâu",red:"Đỏ",orange:"Cam",yellow:"Vàng",green:"Xanh lá",blue:"Xanh dương",purple:"Tím",pink:"Hồng"}},formatting_toolbar:{bold:{tooltip:"In đậm",secondary_tooltip:"Mod+B"},italic:{tooltip:"In nghiêng",secondary_tooltip:"Mod+I"},underline:{tooltip:"Gạch dưới",secondary_tooltip:"Mod+U"},strike:{tooltip:"Gạch ngang",secondary_tooltip:"Mod+Shift+X"},code:{tooltip:"Code",secondary_tooltip:""},colors:{tooltip:"Màu sắc"},link:{tooltip:"Tạo liên kết",secondary_tooltip:"Mod+K"},file_caption:{tooltip:"Chỉnh sửa chú thích",input_placeholder:"Chỉnh sửa chú thích"},file_replace:{tooltip:{image:"Thay thế hình ảnh",video:"Thay thế video",audio:"Thay thế âm thanh",file:"Thay thế tệp"}},file_rename:{tooltip:{image:"Đổi tên hình ảnh",video:"Đổi tên video",audio:"Đổi tên âm thanh",file:"Đổi tên tệp"},input_placeholder:{image:"Đổi tên hình ảnh",video:"Đổi tên video",audio:"Đổi tên âm thanh",file:"Đổi tên tệp"}},file_download:{tooltip:{image:"Tải xuống hình ảnh",video:"Tải xuống video",audio:"Tải xuống âm thanh",file:"Tải xuống tệp"}},file_delete:{tooltip:{image:"Xóa hình ảnh",video:"Xóa video",audio:"Xóa âm thanh",file:"Xóa tệp"}},file_preview_toggle:{tooltip:"Chuyển đổi xem trước"},nest:{tooltip:"Lồng khối",secondary_tooltip:"Tab"},unnest:{tooltip:"Bỏ lồng khối",secondary_tooltip:"Shift+Tab"},align_left:{tooltip:"Căn trái văn bản"},align_center:{tooltip:"Căn giữa văn bản"},align_right:{tooltip:"Căn phải văn bản"},align_justify:{tooltip:"Căn đều văn bản"}},file_panel:{upload:{title:"Tải lên",file_placeholder:{image:"Tải lên hình ảnh",video:"Tải lên video",audio:"Tải lên âm thanh",file:"Tải lên tệp"},upload_error:"Lỗi: Tải lên thất bại"},embed:{title:"Nhúng",embed_button:{image:"Nhúng hình ảnh",video:"Nhúng video",audio:"Nhúng âm thanh",file:"Nhúng tệp"},url_placeholder:"Nhập URL"}},link_toolbar:{delete:{tooltip:"Xóa liên kết"},edit:{text:"Chỉnh sửa liên kết",tooltip:"Chỉnh sửa"},open:{tooltip:"Mở trong tab mới"},form:{title_placeholder:"Chỉnh sửa tiêu đề",url_placeholder:"Chỉnh sửa URL"}},generic:{ctrl_shortcut:"Ctrl"}},zh:{slash_menu:{heading:{title:"一级标题",subtext:"用于顶级标题",aliases:["h","heading1","h1","标题","一级标题"],group:"标题"},heading_2:{title:"二级标题",subtext:"用于关键部分",aliases:["h2","heading2","subheading","标题","二级标题","副标题"],group:"标题"},heading_3:{title:"三级标题",subtext:"用于小节和分组标题",aliases:["h3","heading3","subheading","标题","三级标题"],group:"标题"},numbered_list:{title:"有序列表",subtext:"用于显示有序列表",aliases:["ol","li","list","numberedlist","numbered list","列表","有序列表"],group:"基础"},bullet_list:{title:"无序列表",subtext:"用于显示无序列表",aliases:["ul","li","list","bulletlist","bullet list","列表","无序列表"],group:"基础"},check_list:{title:"检查清单",subtext:"用于显示带有复选框的列表",aliases:["ul","li","checklist","checked list","列表","检查清单","勾选列表","复选框"],group:"基础"},paragraph:{title:"段落",subtext:"用于文档正文",aliases:["p","paragraph","text","正文"],group:"基础"},code_block:{title:"代码块",subtext:"用于显示带有语法高亮的代码块",aliases:["code","pre","代码","预格式"],group:"基础"},table:{title:"表格",subtext:"使用表格",aliases:["table","表格"],group:"高级功能"},image:{title:"图片",subtext:"插入图片",aliases:["图片","上传图片","上传","image","img","相册","媒体","url"],group:"媒体"},video:{title:"视频",subtext:"插入视频",aliases:["视频","视频上传","上传","video","mp4","电影","媒体","url","驱动","dropbox"],group:"媒体"},audio:{title:"音频",subtext:"插入音频",aliases:["音频","音频上传","上传","audio","mp3","声音","媒体","url","驱动","dropbox"],group:"媒体"},file:{title:"文件",subtext:"插入文件",aliases:["文件","上传","file","嵌入","媒体","url"],group:"媒体"},emoji:{title:"表情符号",subtext:"用于插入表情符号",aliases:["表情符号","emoji","face","emote","表情","表情表达","表情"],group:"其他"}},placeholders:{default:"输入 '/' 以使用命令",heading:"标题",bulletListItem:"列表",numberedListItem:"列表",checkListItem:"列表"},file_blocks:{image:{add_button_text:"添加图片"},video:{add_button_text:"添加视频"},audio:{add_button_text:"添加音频"},file:{add_button_text:"添加文件"}},side_menu:{add_block_label:"添加块",drag_handle_label:"打开菜单"},drag_handle:{delete_menuitem:"删除",colors_menuitem:"颜色"},table_handle:{delete_column_menuitem:"删除列",delete_row_menuitem:"删除行",add_left_menuitem:"左侧添加列",add_right_menuitem:"右侧添加列",add_above_menuitem:"上方添加行",add_below_menuitem:"下方添加行"},suggestion_menu:{no_items_title:"无匹配项",loading:"加载中…"},color_picker:{text_title:"文本",background_title:"背景色",colors:{default:"默认",gray:"灰色",brown:"棕色",red:"红色",orange:"橙色",yellow:"黄色",green:"绿色",blue:"蓝色",purple:"紫色",pink:"粉色"}},formatting_toolbar:{bold:{tooltip:"加粗",secondary_tooltip:"Mod+B"},italic:{tooltip:"斜体",secondary_tooltip:"Mod+I"},underline:{tooltip:"下划线",secondary_tooltip:"Mod+U"},strike:{tooltip:"删除线",secondary_tooltip:"Mod+Shift+X"},code:{tooltip:"代码标记",secondary_tooltip:""},colors:{tooltip:"颜色"},link:{tooltip:"添加链接",secondary_tooltip:"Mod+K"},file_caption:{tooltip:"编辑标题",input_placeholder:"编辑标题"},file_replace:{tooltip:{image:"替换图片",video:"替换视频",audio:"替换音频",file:"替换文件"}},file_rename:{tooltip:{image:"重命名图片",video:"重命名视频",audio:"重命名音频",file:"重命名文件"},input_placeholder:{image:"重命名图片",video:"重命名视频",audio:"重命名音频",file:"重命名文件"}},file_download:{tooltip:{image:"下载图片",video:"下载视频",audio:"下载音频",file:"下载文件"}},file_delete:{tooltip:{image:"删除图片",video:"删除视频",audio:"删除音频",file:"删除文件"}},file_preview_toggle:{tooltip:"切换预览"},nest:{tooltip:"嵌套",secondary_tooltip:"Tab"},unnest:{tooltip:"取消嵌套",secondary_tooltip:"Shift+Tab"},align_left:{tooltip:"左对齐"},align_center:{tooltip:"居中"},align_right:{tooltip:"右对齐"},align_justify:{tooltip:"文本对齐"}},file_panel:{upload:{title:"上传",file_placeholder:{image:"上传图片",video:"上传视频",audio:"上传音频",file:"上传文件"},upload_error:"Error:上传失败"},embed:{title:"嵌入",embed_button:{image:"嵌入图片",video:"嵌入视频",audio:"嵌入音频",file:"嵌入文件"},url_placeholder:"输入图片地址"}},link_toolbar:{delete:{tooltip:"清除链接"},edit:{text:"编辑链接",tooltip:"编辑"},open:{tooltip:"新窗口打开"},form:{title_placeholder:"编辑标题",url_placeholder:"编辑链接地址"}},generic:{ctrl_shortcut:"Ctrl"}}},Symbol.toStringTag,{value:"Module"}));class j extends Error{constructor(t){super(`Unreachable case: ${t}`)}}function Hi(e,t=!0){const{"data-test":o,...i}=e;if(Object.keys(i).length>0&&t)throw new Error("Object must be empty "+JSON.stringify(e))}function Oi(e,t=JSON.stringify){const o={};return e.filter(i=>{const n=t(i);return Object.prototype.hasOwnProperty.call(o,n)?!1:o[n]=!0})}function Ui(e){const t=e.filter((i,n)=>e.indexOf(i)!==n);return Oi(t)}const J=k.Extension.create({name:"uniqueID",priority:1e4,addOptions(){return{attributeName:"id",types:[],setIdAttribute:!1,generateID:()=>{if(typeof window<"u"&&window.__TEST_OPTIONS){const e=window.__TEST_OPTIONS;return e.mockID===void 0?e.mockID=0:e.mockID++,e.mockID.toString()}return si.v4()},filterTransaction:null}},addGlobalAttributes(){return[{types:this.options.types,attributes:{[this.options.attributeName]:{default:null,parseHTML:e=>e.getAttribute(`data-${this.options.attributeName}`),renderHTML:e=>{const t={[`data-${this.options.attributeName}`]:e[this.options.attributeName]};return this.options.setIdAttribute?{...t,id:e[this.options.attributeName]}:t}}}}]},addProseMirrorPlugins(){let e=null,t=!1;return[new _.Plugin({key:new _.PluginKey("uniqueID"),appendTransaction:(o,i,n)=>{const a=o.some(g=>g.docChanged)&&!i.doc.eq(n.doc),r=this.options.filterTransaction&&o.some(g=>{let b,y;return!(!((y=(b=this.options).filterTransaction)===null||y===void 0)&&y.call(b,g))});if(!a||r)return;const{tr:s}=n,{types:l,attributeName:u,generateID:c}=this.options,p=k.combineTransactionSteps(i.doc,o),{mapping:m}=p;if(k.getChangedRanges(p).forEach(({newRange:g})=>{const b=k.findChildrenInRange(n.doc,g,M=>l.includes(M.type.name)),y=b.map(({node:M})=>M.attrs[u]).filter(M=>M!==null),w=Ui(y);b.forEach(({node:M,pos:x})=>{let O;const ne=(O=s.doc.nodeAt(x))===null||O===void 0?void 0:O.attrs[u];if(ne===null){const B=i.doc.type.createAndFill().content;if(i.doc.content.findDiffStart(B)===null){const ri=JSON.parse(JSON.stringify(n.doc.toJSON()));if(ri.content[0].content[0].attrs.id="initialBlockId",JSON.stringify(ri.content)===JSON.stringify(B.toJSON())){s.setNodeMarkup(x,void 0,{...M.attrs,[u]:"initialBlockId"});return}}s.setNodeMarkup(x,void 0,{...M.attrs,[u]:c()});return}const{deleted:Te}=m.invert().mapResult(x);Te&&w.includes(ne)&&s.setNodeMarkup(x,void 0,{...M.attrs,[u]:c()})})}),!!s.steps.length)return s},view(o){const i=n=>{let a;e=!((a=o.dom.parentElement)===null||a===void 0)&&a.contains(n.target)?o.dom.parentElement:null};return window.addEventListener("dragstart",i),{destroy(){window.removeEventListener("dragstart",i)}}},props:{handleDOMEvents:{drop:(o,i)=>{let n;return(e!==o.dom.parentElement||((n=i.dataTransfer)===null||n===void 0?void 0:n.effectAllowed)==="copy")&&(e=null,t=!0),!1},paste:()=>(t=!0,!1)},transformPasted:o=>{if(!t)return o;const{types:i,attributeName:n}=this.options,a=r=>{const s=[];return r.forEach(l=>{if(l.isText){s.push(l);return}if(!i.includes(l.type.name)){s.push(l.copy(a(l.content)));return}const u=l.type.create({...l.attrs,[n]:null},a(l.content),l.marks);s.push(u)}),v.Fragment.from(s)};return t=!1,new v.Slice(a(o.content),o.openStart,o.openEnd)}}})]}});function Ie(e){return e.type==="link"}function Le(e){return typeof e!="string"&&e.type==="link"}function Y(e){return typeof e!="string"&&e.type==="text"}function dt(e,t,o){const i=[];for(const[n,a]of Object.entries(e.styles)){const r=o[n];if(!r)throw new Error(`style ${n} not found in styleSchema`);if(r.propSchema==="boolean")i.push(t.mark(n));else if(r.propSchema==="string")i.push(t.mark(n,{stringValue:a}));else throw new j(r.propSchema)}return e.text.split(/(\n)/g).filter(n=>n.length>0).map(n=>n===`
|
|
2
|
+
`?t.nodes.hardBreak.createChecked():t.text(n,i))}function Ri(e,t,o){const i=t.marks.link.create({href:e.href});return Pe(e.content,t,o).map(n=>{if(n.type.name==="text")return n.mark([...n.marks,i]);if(n.type.name==="hardBreak")return n;throw new Error("unexpected node type")})}function Pe(e,t,o){const i=[];if(typeof e=="string")return i.push(...dt({type:"text",text:e,styles:{}},t,o)),i;for(const n of e)i.push(...dt(n,t,o));return i}function H(e,t,o){const i=[];for(const n of e)typeof n=="string"?i.push(...Pe(n,t,o)):Le(n)?i.push(...Ri(n,t,o)):Y(n)?i.push(...Pe([n],t,o)):i.push(ct(n,t,o));return i}function ae(e,t,o){var n;const i=[];for(const a of e.rows){const r=[];for(let l=0;l<a.cells.length;l++){const u=a.cells[l];let c;if(!u)c=t.nodes.tableParagraph.createChecked({});else if(typeof u=="string")c=t.nodes.tableParagraph.createChecked({},t.text(u));else{const m=H(u,t,o);c=t.nodes.tableParagraph.createChecked({},m)}const p=t.nodes.tableCell.createChecked({colwidth:(n=e.columnWidths)!=null&&n[l]?[e.columnWidths[l]]:null},c);r.push(p)}const s=t.nodes.tableRow.createChecked({},r);i.push(s)}return i}function ct(e,t,o){let i,n=e.type;if(n===void 0&&(n="paragraph"),!t.nodes[n])throw new Error(`node type ${n} not found in schema`);if(!e.content)i=t.nodes[n].createChecked(e.props);else if(typeof e.content=="string"){const a=H([e.content],t,o);i=t.nodes[n].createChecked(e.props,a)}else if(Array.isArray(e.content)){const a=H(e.content,t,o);i=t.nodes[n].createChecked(e.props,a)}else if(e.content.type==="tableContent"){const a=ae(e.content,t,o);i=t.nodes[n].createChecked(e.props,a)}else throw new j(e.content.type);return i}function q(e,t,o){let i=e.id;i===void 0&&(i=J.options.generateID());const n=[];if(e.children)for(const r of e.children)n.push(q(r,t,o));const a=t.nodes[e.type];if(a.isInGroup("blockContent")){const r=ct(e,t,o),s=n.length>0?t.nodes.blockGroup.createChecked({},n):void 0;return t.nodes.blockContainer.createChecked({id:i,...e.props},s?[r,s]:r)}else{if(a.isInGroup("bnBlock"))return t.nodes[e.type].createChecked({id:i,...e.props},n);throw new Error(`block type ${e.type} doesn't match blockContent or bnBlock group`)}}function ut(e){const t=[...e.classList].filter(o=>!o.startsWith("bn-"))||[];t.length>0?e.className=t.join(" "):e.removeAttribute("class")}function pt(e,t,o,i){let n;if(t)if(typeof t=="string")n=H([t],e.pmSchema,e.schema.styleSchema);else if(Array.isArray(t))n=H(t,e.pmSchema,e.schema.styleSchema);else if(t.type==="tableContent")n=ae(t,e.pmSchema,e.schema.styleSchema);else throw new j(t.type);else throw new Error("blockContent is required");const a=o.serializeFragment(v.Fragment.from(n),i);return a.nodeType===1&&ut(a),a}function Vi(e,t,o,i,n,a,r){var b,y,w,M,x,O,ne,Te;const s=(r==null?void 0:r.document)??document,l=t.pmSchema.nodes.blockContainer;let u=o.props;if(!o.props){u={};for(const[I,B]of Object.entries(t.schema.blockSchema[o.type].propSchema))u[I]=B.default}const p=[...((y=(b=l.spec)==null?void 0:b.toDOM)==null?void 0:y.call(b,l.create({id:o.id,...u}))).dom.attributes],m=t.blockImplementations[o.type].implementation.toExternalHTML({...o,props:u},t),f=s.createDocumentFragment();if(m.dom.classList.contains("bn-block-content")){const I=[...p,...m.dom.attributes].filter(B=>B.name.startsWith("data")&&B.name!=="data-content-type"&&B.name!=="data-file-block"&&B.name!=="data-node-view-wrapper"&&B.name!=="data-node-type"&&B.name!=="data-id"&&B.name!=="data-index"&&B.name!=="data-editable");for(const B of I)m.dom.firstChild.setAttribute(B.name,B.value);ut(m.dom.firstChild),f.append(...m.dom.childNodes)}else f.append(m.dom);if(m.contentDOM&&o.content){const I=pt(t,o.content,i,r);m.contentDOM.appendChild(I)}let g;if(n.has(o.type)?g="OL":a.has(o.type)&&(g="UL"),g){if(((w=e.lastChild)==null?void 0:w.nodeName)!==g){const B=s.createElement(g);e.append(B)}const I=s.createElement("li");I.append(f),e.lastChild.appendChild(I)}else e.append(f);if(o.children&&o.children.length>0){const I=s.createDocumentFragment();if(ht(I,t,o.children,i,n,a,r),((M=e.lastChild)==null?void 0:M.nodeName)==="UL"||((x=e.lastChild)==null?void 0:x.nodeName)==="OL")for(;((O=I.firstChild)==null?void 0:O.nodeName)==="UL"||((ne=I.firstChild)==null?void 0:ne.nodeName)==="OL";)e.lastChild.lastChild.appendChild(I.firstChild);t.pmSchema.nodes[o.type].isInGroup("blockContent")?e.append(I):(Te=m.contentDOM)==null||Te.append(I)}}const ht=(e,t,o,i,n,a,r)=>{for(const s of o)Vi(e,t,s,i,n,a,r)},zi=(e,t,o,i,n,a)=>{const s=((a==null?void 0:a.document)??document).createDocumentFragment();return ht(s,e,t,o,i,n,a),s},re=(e,t)=>{const o=v.DOMSerializer.fromSchema(e);return{exportBlocks:(i,n)=>{const a=zi(t,i,o,new Set(["numberedListItem"]),new Set(["bulletListItem","checkListItem"]),n),r=document.createElement("div");return r.append(a),r.innerHTML},exportInlineContent:(i,n)=>{const a=pt(t,i,o,n),r=document.createElement("div");return r.append(a.cloneNode(!0)),r.innerHTML}}};function Fi(e,t,o,i){let n;if(t)if(typeof t=="string")n=H([t],e.pmSchema,e.schema.styleSchema);else if(Array.isArray(t))n=H(t,e.pmSchema,e.schema.styleSchema);else if(t.type==="tableContent")n=ae(t,e.pmSchema,e.schema.styleSchema);else throw new j(t.type);else throw new Error("blockContent is required");return o.serializeFragment(v.Fragment.from(n),i)}function Gi(e,t,o,i,n){var p,m,f,g,b;const a=e.pmSchema.nodes.blockContainer;let r=t.props;if(!t.props){r={};for(const[y,w]of Object.entries(e.schema.blockSchema[t.type].propSchema))r[y]=w.default}const l=e.blockImplementations[t.type].implementation.toInternalHTML({...t,props:r},e);if(t.type==="numberedListItem"&&l.dom.setAttribute("data-index",i.toString()),l.contentDOM&&t.content){const y=Fi(e,t.content,o,n);l.contentDOM.appendChild(y)}if(e.pmSchema.nodes[t.type].isInGroup("bnBlock")){if(t.children&&t.children.length>0){const y=mt(e,t.children,o,n);(p=l.contentDOM)==null||p.append(y)}return l.dom}const c=(f=(m=a.spec)==null?void 0:m.toDOM)==null?void 0:f.call(m,a.create({id:t.id,...r}));return(g=c.contentDOM)==null||g.appendChild(l.dom),t.children&&t.children.length>0&&((b=c.contentDOM)==null||b.appendChild(ft(e,t.children,o,n))),c.dom}function mt(e,t,o,i){const a=((i==null?void 0:i.document)??document).createDocumentFragment();let r=0;for(const s of t){s.type==="numberedListItem"?r++:r=0;const l=Gi(e,s,o,r,i);a.appendChild(l)}return a}const ft=(e,t,o,i)=>{var s;const n=e.pmSchema.nodes.blockGroup,a=n.spec.toDOM(n.create({})),r=mt(e,t,o,i);return(s=a.contentDOM)==null||s.appendChild(r),a.dom},gt=(e,t)=>{const o=v.DOMSerializer.fromSchema(e);return{serializeBlocks:(i,n)=>ft(t,i,o,n).outerHTML}};function z(e,t){const o=e.resolve(t);if(o.nodeAfter&&o.nodeAfter.type.isInGroup("bnBlock"))return{posBeforeNode:o.pos,node:o.nodeAfter};let i=o.depth,n=o.node(i);for(;i>0;){if(n.type.isInGroup("bnBlock"))return{posBeforeNode:o.before(i),node:n};i--,n=o.node(i)}const a=[];e.descendants((s,l)=>{s.type.isInGroup("bnBlock")&&a.push(l)}),console.warn(`Position ${t} is not within a blockContainer node.`);const r=e.resolve(a.find(s=>s>=t)||a[a.length-1]);return{posBeforeNode:r.pos,node:r.nodeAfter}}function ge(e,t){if(!e.type.isInGroup("bnBlock"))throw new Error(`Attempted to get bnBlock node at position but found node of different type ${e.type}`);const o=e,i=t,n=i+o.nodeSize,a={node:o,beforePos:i,afterPos:n};if(o.type.name==="blockContainer"){let r,s;if(o.forEach((l,u)=>{if(l.type.spec.group==="blockContent"){const c=l,p=i+u+1,m=p+l.nodeSize;r={node:c,beforePos:p,afterPos:m}}else if(l.type.name==="blockGroup"){const c=l,p=i+u+1,m=p+l.nodeSize;s={node:c,beforePos:p,afterPos:m}}}),!r)throw new Error(`blockContainer node does not contain a blockContent node in its children: ${o}`);return{isBlockContainer:!0,bnBlock:a,blockContent:r,childContainer:s,blockNoteType:r.node.type.name}}else{if(!a.node.type.isInGroup("childContainer"))throw new Error(`bnBlock node is not in the childContainer group: ${a.node}`);return{isBlockContainer:!1,bnBlock:a,childContainer:a,blockNoteType:a.node.type.name}}}function F(e){return ge(e.node,e.posBeforeNode)}function Q(e){if(!e.nodeAfter)throw new Error(`Attempted to get blockContainer node at position ${e.pos} but a node at this position does not exist`);return ge(e.nodeAfter,e.pos)}function C(e){const t=z(e.doc,e.selection.anchor);return F(t)}function P(e,t){let o,i;if(t.firstChild.descendants((n,a)=>o?!1:!n.type.isInGroup("bnBlock")||n.attrs.id!==e?!0:(o=n,i=a+1,!1)),!(o===void 0||i===void 0))return{node:o,posBeforeNode:i}}const bt=()=>typeof navigator<"u"&&(/Mac/.test(navigator.platform)||/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent));function G(e,t="Ctrl"){return bt()?e.replace("Mod","⌘"):e.replace("Mod",t)}function $(...e){return e.filter(t=>t).join(" ")}const $i=()=>/^((?!chrome|android).)*safari/i.test(navigator.userAgent);function R(e,t,o,i){const n=document.createElement("div");n.className=$("bn-block-content",o.class),n.setAttribute("data-content-type",e);for(const[r,s]of Object.entries(o))r!=="class"&&n.setAttribute(r,s);const a=document.createElement(t);a.className=$("bn-inline-content",i.class);for(const[r,s]of Object.entries(i))r!=="class"&&a.setAttribute(r,s);return n.appendChild(a),{dom:n,contentDOM:a}}const Ae=(e,t)=>{let o=q(e,t.pmSchema,t.schema.styleSchema);o.type.name==="blockContainer"&&(o=o.firstChild);const i=t.pmSchema.nodes[o.type.name].spec.toDOM;if(i===void 0)throw new Error("This block has no default HTML serialization as its corresponding TipTap node doesn't implement `renderHTML`.");const n=i(o);if(typeof n!="object"||!("dom"in n))throw new Error("Cannot use this block's default HTML serialization as its corresponding TipTap node's `renderHTML` function does not return an object with the `dom` property.");return n},S={backgroundColor:{default:"default"},textColor:{default:"default"},textAlignment:{default:"left",values:["left","center","right","justify"]}},Ne=["backgroundColor","textColor"];function se(e){return"data-"+e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function Wi(e){const t=e.split("/");return!t.length||t[t.length-1]===""?e:t[t.length-1]}function De(e){const t={};return Object.entries(e).filter(([o,i])=>!Ne.includes(o)).forEach(([o,i])=>{t[o]={default:i.default,keepOnSplit:!0,parseHTML:n=>{const a=n.getAttribute(se(o));if(a===null)return null;if(typeof i.default=="boolean")return a==="true"?!0:a==="false"?!1:null;if(typeof i.default=="number"){const r=parseFloat(a);return!Number.isNaN(r)&&Number.isFinite(r)?r:null}return a},renderHTML:n=>n[o]!==i.default?{[se(o)]:n[o]}:{}}}),t}function kt(e,t,o,i){if(typeof e=="boolean")throw new Error("Cannot find node position as getPos is a boolean, not a function.");const n=e(),r=o.state.doc.resolve(n).node().attrs.id;if(!r)throw new Error("Block doesn't have id");const s=t.getBlock(r);if(s.type!==i)throw new Error("Block type does not match");return s}function le(e,t,o,i,n=!1,a){const r=document.createElement("div");if(a!==void 0)for(const[s,l]of Object.entries(a))s!=="class"&&r.setAttribute(s,l);r.className=$("bn-block-content",(a==null?void 0:a.class)||""),r.setAttribute("data-content-type",t);for(const[s,l]of Object.entries(o))!Ne.includes(s)&&l!==i[s].default&&r.setAttribute(se(s),l);return n&&r.setAttribute("data-file-block",""),r.appendChild(e.dom),e.contentDOM!==void 0&&(e.contentDOM.className=$("bn-inline-content",e.contentDOM.className),e.contentDOM.setAttribute("data-editable","")),{...e,dom:r}}function W(e){return k.Node.create(e)}function je(e,t){return{config:e,implementation:t}}function K(e,t,o){return je({type:e.name,content:e.config.content==="inline*"?"inline":e.config.content==="tableRow+"?"table":"none",propSchema:t},{node:e,requiredExtensions:o,toInternalHTML:Ae,toExternalHTML:Ae})}function He(e){return Object.fromEntries(Object.entries(e).map(([t,o])=>[t,o.config]))}function _t(e,t){e.stopEvent=o=>(o.type==="mousedown"&&setTimeout(()=>{t.view.dom.blur()},10),!0)}function yt(e,t){const o=[{tag:"[data-content-type="+e.type+"]",contentElement:"[data-editable]"}];return t&&o.push({tag:"*",getAttrs(i){if(typeof i=="string")return!1;const n=t==null?void 0:t(i);return n===void 0?!1:n}}),o}function de(e,t){const o=W({name:e.type,content:e.content==="inline"?"inline*":"",group:"blockContent",selectable:e.isSelectable??!0,addAttributes(){return De(e.propSchema)},parseHTML(){return yt(e,t.parse)},renderHTML({HTMLAttributes:i}){const n=document.createElement("div");return le({dom:n,contentDOM:e.content==="inline"?n:void 0},e.type,{},e.propSchema,e.isFileBlock,i)},addNodeView(){return({getPos:i})=>{var u;const n=this.options.editor,a=kt(i,n,this.editor,e.type),r=((u=this.options.domAttributes)==null?void 0:u.blockContent)||{},s=t.render(a,n),l=le(s,a.type,a.props,e.propSchema,r);return e.isSelectable===!1&&_t(l,this.editor),l}}});if(o.name!==e.type)throw new Error("Node name does not match block type. This is a bug in BlockNote.");return je(e,{node:o,toInternalHTML:(i,n)=>{var s;const a=((s=o.options.domAttributes)==null?void 0:s.blockContent)||{},r=t.render(i,n);return le(r,i.type,i.props,e.propSchema,e.isFileBlock,a)},toExternalHTML:(i,n)=>{var s,l;const a=((s=o.options.domAttributes)==null?void 0:s.blockContent)||{};let r=(l=t.toExternalHTML)==null?void 0:l.call(t,i,n);return r===void 0&&(r=t.render(i,n)),le(r,i.type,i.props,e.propSchema,a)}})}function Oe(e,t,o){const i={type:"tableContent",columnWidths:[],rows:[]};return e.content.forEach((n,a,r)=>{const s={cells:[]};r===0&&n.content.forEach(l=>{var u;i.columnWidths.push(((u=l.attrs.colwidth)==null?void 0:u[0])||void 0)}),n.content.forEach(l=>{s.cells.push(ce(l.firstChild,t,o))}),i.rows.push(s)}),i}function ce(e,t,o){const i=[];let n;return e.content.forEach(a=>{if(a.type.name==="hardBreak"){if(n)if(Y(n))n.text+=`
|
|
3
3
|
`;else if(Ie(n))n.content[n.content.length-1].text+=`
|
|
4
4
|
`;else throw new Error("unexpected");else n={type:"text",text:`
|
|
5
|
-
`,styles:{}};return}if(a.type.name!=="link"&&a.type.name!=="text"&&t[a.type.name]){n&&(i.push(n),n=void 0),i.push(_e(a,t,o));return}const r={};let l;for(const s of a.marks)if(s.type.name==="link")l=s;else{const u=o[s.type.name];if(!u)throw new Error(`style ${s.type.name} not found in styleSchema`);if(u.propSchema==="boolean")r[u.type]=!0;else if(u.propSchema==="string")r[u.type]=s.attrs.stringValue;else throw new A(u.propSchema)}n?Z(n)?l?(i.push(n),n={type:"link",href:l.attrs.href,content:[{type:"text",text:a.textContent,styles:r}]}):JSON.stringify(n.styles)===JSON.stringify(r)?n.text+=a.textContent:(i.push(n),n={type:"text",text:a.textContent,styles:r}):Ie(n)&&(l?n.href===l.attrs.href?JSON.stringify(n.content[n.content.length-1].styles)===JSON.stringify(r)?n.content[n.content.length-1].text+=a.textContent:n.content.push({type:"text",text:a.textContent,styles:r}):(i.push(n),n={type:"link",href:l.attrs.href,content:[{type:"text",text:a.textContent,styles:r}]}):(i.push(n),n={type:"text",text:a.textContent,styles:r})):l?n={type:"link",href:l.attrs.href,content:[{type:"text",text:a.textContent,styles:r}]}:n={type:"text",text:a.textContent,styles:r}}),n&&i.push(n),i}function _e(e,t,o){if(e.type.name==="text"||e.type.name==="link")throw new Error("unexpected");const i={},n=t[e.type.name];for(const[l,s]of Object.entries(e.attrs)){if(!n)throw Error("ic node is of an unrecognized type: "+e.type.name);const u=n.propSchema;l in u&&(i[l]=s)}let a;return n.content==="styled"?a=ce(e,t,o):a=void 0,{type:e.type.name,props:i,content:a}}function x(e,t,o,i,n){var f;if(!e.type.isInGroup("bnBlock"))throw Error("Node must be in bnBlock group, but is of type"+e.type.name);const a=n==null?void 0:n.get(e);if(a)return a;const r=ke(e,0);let l=r.bnBlock.node.attrs.id;l===null&&(l=X.options.generateID());const s=t[r.blockNoteType];if(!s)throw Error("Block is of an unrecognized type: "+r.blockNoteType);const u={};for(const[g,_]of Object.entries({...e.attrs,...r.isBlockContainer?r.blockContent.node.attrs:{}})){const w=s.propSchema;g in w&&(u[g]=_)}const c=t[r.blockNoteType],h=[];(f=r.childContainer)==null||f.node.forEach(g=>{h.push(x(g,t,o,i,n))});let m;if(c.content==="inline"){if(!r.isBlockContainer)throw new Error("impossible");m=ce(r.blockContent.node,o,i)}else if(c.content==="table"){if(!r.isBlockContainer)throw new Error("impossible");m=Oe(r.blockContent.node,o,i)}else if(c.content==="none")m=void 0;else throw new A(c.content);const b={id:l,type:c.type,props:u,content:m,children:h};return n==null||n.set(e,b),b}function Re(e,t,o,i){return e.dom.setAttribute("data-inline-content-type",t),Object.entries(o).filter(([n,a])=>a!==i[n].default).map(([n,a])=>[le(n),a]).forEach(([n,a])=>e.dom.setAttribute(n,a)),e.contentDOM!==void 0&&e.contentDOM.setAttribute("data-editable",""),e}function Ct(e){return{Backspace:({editor:t})=>{const o=t.state.selection.$from;return t.state.selection.empty&&o.node().type.name===e.type&&o.parentOffset===0}}}function Et(e,t){return{config:e,implementation:t}}function xt(e,t){return Et({type:e.name,propSchema:t,content:e.config.content==="inline*"?"styled":"none"},{node:e})}function ze(e){return Object.fromEntries(Object.entries(e).map(([t,o])=>[t,o.config]))}function St(e){return[{tag:`[data-inline-content-type="${e.type}"]`,contentElement:t=>{const o=t;return o.matches("[data-editable]")?o:o.querySelector("[data-editable]")||o}}]}function Vi(e,t){const o=k.Node.create({name:e.type,inline:!0,group:"inline",selectable:e.content==="styled",atom:e.content==="none",content:e.content==="styled"?"inline*":"",addAttributes(){return De(e.propSchema)},addKeyboardShortcuts(){return Ct(e)},parseHTML(){return St(e)},renderHTML({node:i}){const n=this.options.editor,a=t.render(_e(i,n.schema.inlineContentSchema,n.schema.styleSchema),()=>{},n);return Re(a,e.type,i.attrs,e.propSchema)},addNodeView(){return({node:i,getPos:n})=>{const a=this.options.editor,r=t.render(_e(i,a.schema.inlineContentSchema,a.schema.styleSchema),l=>{if(typeof n=="boolean")return;const s=N([l],a._tiptapEditor.schema,a.schema.styleSchema);a._tiptapEditor.view.dispatch(a._tiptapEditor.view.state.tr.replaceWith(n(),n()+i.nodeSize,s))},a);return Re(r,e.type,i.attrs,e.propSchema)}}});return xt(o,e.propSchema)}function Bt(e){return e==="boolean"?{}:{stringValue:{default:void 0,keepOnSplit:!0,parseHTML:t=>t.getAttribute("data-value"),renderHTML:t=>t.stringValue!==void 0?{"data-value":t.stringValue}:{}}}}function Tt(e,t,o,i){return e.dom.setAttribute("data-style-type",t),i==="string"&&e.dom.setAttribute("data-value",o),e.contentDOM!==void 0&&e.contentDOM.setAttribute("data-editable",""),e}function Ve(e,t){return{config:e,implementation:t}}function F(e,t){return Ve({type:e.name,propSchema:t},{mark:e})}function Fe(e){return Object.fromEntries(Object.entries(e).map(([t,o])=>[t,o.config]))}function Mt(e){return[{tag:`[data-style-type="${e.type}"]`,contentElement:t=>{const o=t;return o.matches("[data-editable]")?o:o.querySelector("[data-editable]")||o}}]}function Fi(e,t){const o=k.Mark.create({name:e.type,addAttributes(){return Bt(e.propSchema)},parseHTML(){return Mt(e)},renderHTML({mark:i}){let n;if(e.propSchema==="boolean")n=t.render();else if(e.propSchema==="string")n=t.render(i.attrs.stringValue);else throw new A(e.propSchema);return Tt(n,e.type,i.attrs.stringValue,e.propSchema)}});return Ve(e,{mark:o})}const Lt='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M3 8L9.00319 2H19.9978C20.5513 2 21 2.45531 21 2.9918V21.0082C21 21.556 20.5551 22 20.0066 22H3.9934C3.44476 22 3 21.5501 3 20.9932V8ZM10 4V9H5V20H19V4H10Z"></path></svg>',ue=(e,t,o,i,n)=>{const a=document.createElement("div");if(a.className="bn-file-block-content-wrapper",e.props.url===""){const r=It(e,t,i,n);a.appendChild(r.dom);const l=document.createElement("div");l.className="bn-file-loading-preview",l.textContent="Loading...";const s=t.onUploadStart(c=>{c===e.id&&(a.removeChild(r.dom),a.appendChild(l))}),u=t.onUploadEnd(c=>{c===e.id&&(a.removeChild(l),a.appendChild(r.dom))});return{dom:a,destroy:()=>{var c;(c=r.destroy)==null||c.call(r),s(),u()}}}else if(e.props.showPreview===!1){const r=Ge(e).dom;return{dom:Y(e,r).dom}}else return a.appendChild(o.dom),{dom:a,destroy:o.destroy}},Ge=e=>{const t=document.createElement("div");t.className="bn-file-default-preview";const o=document.createElement("div");o.className="bn-file-default-preview-icon",o.innerHTML=Lt;const i=document.createElement("p");return i.className="bn-file-default-preview-name",i.textContent=e.props.name||"",t.appendChild(o),t.appendChild(i),{dom:t}},Y=(e,t)=>{const o=document.createElement("div");o.className="bn-file-and-caption-wrapper";const i=document.createElement("p");return i.className="bn-file-caption",i.textContent=e.props.caption,typeof e.props.previewWidth=="number"&&e.props.previewWidth>0&&e.props.caption!==void 0&&(i.style.width=`${e.props.previewWidth}px`),o.appendChild(t),o.appendChild(i),{dom:o}},It=(e,t,o,i)=>{const n=document.createElement("div");n.className="bn-add-file-button";const a=document.createElement("div");a.className="bn-add-file-button-icon",i?a.appendChild(i):a.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M3 8L9.00319 2H19.9978C20.5513 2 21 2.45531 21 2.9918V21.0082C21 21.556 20.5551 22 20.0066 22H3.9934C3.44476 22 3 21.5501 3 20.9932V8ZM10 4V9H5V20H19V4H10Z"></path></svg>';const r=document.createElement("p");r.className="bn-add-file-button-text",r.innerHTML=o||t.dictionary.file_blocks.file.add_button_text;const l=u=>{u.preventDefault()},s=()=>{t.dispatch(t._tiptapEditor.state.tr.setMeta(t.filePanel.plugin,{block:e}))};return n.appendChild(a),n.appendChild(r),n.addEventListener("mousedown",l,!0),n.addEventListener("click",s,!0),{dom:n,destroy:()=>{n.removeEventListener("mousedown",l,!0),n.removeEventListener("click",s,!0)}}},We=e=>({url:e.src||void 0}),pe=(e,t)=>{const o=e.querySelector(t);if(!o)return;const i=e.querySelector("figcaption"),n=(i==null?void 0:i.textContent)??void 0;return{targetElement:o,caption:n}},he=(e,t)=>{const o=document.createElement("div"),i=document.createElement("p");return i.textContent=t,o.appendChild(e),o.appendChild(i),{dom:o}},ye=(e,t)=>{const o=document.createElement("figure"),i=document.createElement("figcaption");return i.textContent=t,o.appendChild(e),o.appendChild(i),{dom:o}},Ke=(e,t,o,i,n)=>{if(!e.props.previewWidth)throw new Error("Block must have a `previewWidth` prop.");const a=document.createElement("div");a.className="bn-visual-media-wrapper";const r=document.createElement("div");r.className="bn-visual-media-resize-handle",r.style.left="4px";const l=document.createElement("div");l.className="bn-visual-media-resize-handle",l.style.right="4px";let s;const u=g=>{if(!s){!t.isEditable&&a.contains(r)&&a.contains(l)&&(a.removeChild(r),a.removeChild(l));return}let _;e.props.textAlignment==="center"?s.handleUsed==="left"?_=s.initialWidth+(s.initialClientX-g.clientX)*2:_=s.initialWidth+(g.clientX-s.initialClientX)*2:s.handleUsed==="left"?_=s.initialWidth+s.initialClientX-g.clientX:_=s.initialWidth+g.clientX-s.initialClientX;const w=64;_<w?n(w):_>t.domElement.firstElementChild.clientWidth?n(t.domElement.firstElementChild.clientWidth):n(_)},c=g=>{(!g.target||!a.contains(g.target)||!t.isEditable)&&a.contains(r)&&a.contains(l)&&(a.removeChild(r),a.removeChild(l)),s&&(s=void 0,t.updateBlock(e,{props:{previewWidth:i()}}))},h=()=>{t.isEditable&&(a.appendChild(r),a.appendChild(l))},m=g=>{g.relatedTarget===r||g.relatedTarget===l||s||t.isEditable&&a.contains(r)&&a.contains(l)&&(a.removeChild(r),a.removeChild(l))},b=g=>{g.preventDefault(),a.appendChild(r),a.appendChild(l),s={handleUsed:"left",initialWidth:e.props.previewWidth,initialClientX:g.clientX}},f=g=>{g.preventDefault(),a.appendChild(r),a.appendChild(l),s={handleUsed:"right",initialWidth:e.props.previewWidth,initialClientX:g.clientX}};return a.appendChild(o),window.addEventListener("mousemove",u),window.addEventListener("mouseup",c),o.addEventListener("mouseenter",h),o.addEventListener("mouseleave",m),r.addEventListener("mousedown",b),l.addEventListener("mousedown",f),{dom:a,destroy:()=>{window.removeEventListener("mousemove",u),window.removeEventListener("mouseup",c),o.removeEventListener("mouseenter",h),o.removeEventListener("mouseleave",m),r.removeEventListener("mousedown",b),l.removeEventListener("mousedown",f)}}},Pt=e=>({url:e.src||void 0}),At='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M2 16.0001H5.88889L11.1834 20.3319C11.2727 20.405 11.3846 20.4449 11.5 20.4449C11.7761 20.4449 12 20.2211 12 19.9449V4.05519C12 3.93977 11.9601 3.8279 11.887 3.73857C11.7121 3.52485 11.3971 3.49335 11.1834 3.66821L5.88889 8.00007H2C1.44772 8.00007 1 8.44778 1 9.00007V15.0001C1 15.5524 1.44772 16.0001 2 16.0001ZM23 12C23 15.292 21.5539 18.2463 19.2622 20.2622L17.8445 18.8444C19.7758 17.1937 21 14.7398 21 12C21 9.26016 19.7758 6.80629 17.8445 5.15557L19.2622 3.73779C21.5539 5.75368 23 8.70795 23 12ZM18 12C18 10.0883 17.106 8.38548 15.7133 7.28673L14.2842 8.71584C15.3213 9.43855 16 10.64 16 12C16 13.36 15.3213 14.5614 14.2842 15.2841L15.7133 16.7132C17.106 15.6145 18 13.9116 18 12Z"></path></svg>',Nt={backgroundColor:E.backgroundColor,name:{default:""},url:{default:""},caption:{default:""},showPreview:{default:!0}},jt={type:"audio",propSchema:Nt,content:"none",isFileBlock:!0,fileBlockAccept:["audio/*"]},Dt=(e,t)=>{const o=document.createElement("div");o.innerHTML=At;const i=document.createElement("audio");i.className="bn-audio",t.resolveFileUrl(e.props.url).then(a=>{i.src=a}),i.controls=!0,i.contentEditable="false",i.draggable=!1;const n=Y(e,i);return ue(e,t,n,t.dictionary.file_blocks.audio.add_button_text,o.firstElementChild)},Ht=e=>{if(e.tagName==="AUDIO")return Pt(e);if(e.tagName==="FIGURE"){const t=pe(e,"audio");if(!t)return;const{targetElement:o,caption:i}=t;return{...Pt(o),caption:i}}},Ut=e=>{if(!e.props.url){const o=document.createElement("p");return o.textContent="Add audio",{dom:o}}let t;return e.props.showPreview?(t=document.createElement("audio"),t.src=e.props.url):(t=document.createElement("a"),t.href=e.props.url,t.textContent=e.props.name||e.props.url),e.props.caption?e.props.showPreview?ye(t,e.props.caption):he(t,e.props.caption):{dom:t}},Ot=de(jt,{render:Dt,parse:Ht,toExternalHTML:Ut}),Rt=[{id:"text",name:"Plain Text",match:["text","txt","plain"]},...Le.bundledLanguagesInfo.filter(e=>["c","cpp","css","glsl","graphql","haml","html","java","javascript","json","jsonc","jsonl","jsx","julia","less","markdown","mdx","php","postcss","pug","python","r","regexp","sass","scss","shellscript","sql","svelte","typescript","vue","vue-html","wasm","wgsl","xml","yaml"].includes(e.id)).map(e=>({match:[e.id,...e.aliases||[]],id:e.id,name:e.name})),{id:"tsx",name:"TSX",match:["tsx","typescriptreact"]},{id:"haskell",name:"Haskell",match:["haskell","hs"]},{id:"csharp",name:"C#",match:["c#","csharp","cs"]},{id:"latex",name:"LaTeX",match:["latex"]},{id:"lua",name:"Lua",match:["lua"]},{id:"mermaid",name:"Mermaid",match:["mermaid","mmd"]},{id:"ruby",name:"Ruby",match:["ruby","rb"]},{id:"rust",name:"Rust",match:["rust","rs"]},{id:"scala",name:"Scala",match:["scala"]},{id:"swift",name:"Swift",match:["swift"]},{id:"kotlin",name:"Kotlin",match:["kotlin","kt","kts"]},{id:"objective-c",name:"Objective C",match:["objective-c","objc"]}],ve={language:{default:"javascript",values:[...Rt.map(e=>e.id)]}},zt=R({name:"codeBlock",content:"inline*",group:"blockContent",marks:"",code:!0,defining:!0,addOptions(){return{defaultLanguage:"javascript",indentLineWithTab:!0,supportedLanguages:Rt}},addAttributes(){const e=this.options.supportedLanguages;return{language:{default:this.options.defaultLanguage,parseHTML:t=>{var a;let o=t,i=null;(o==null?void 0:o.tagName)==="DIV"&&(o==null?void 0:o.dataset.contentType)==="codeBlock"&&(o=o.children[0]),(o==null?void 0:o.tagName)==="PRE"&&(o=o==null?void 0:o.children[0]);const n=o==null?void 0:o.getAttribute("data-language");if(n)i=n.toLowerCase();else{const l=[...(o==null?void 0:o.className.split(" "))||[]].filter(u=>u.startsWith("language-")).map(u=>u.replace("language-","")),[s]=l;i=s.toLowerCase()}return i?((a=e.find(({match:r})=>r.includes(i)))==null?void 0:a.id)||this.options.defaultLanguage:null},renderHTML:t=>t.language&&t.language!=="text"?{class:`language-${t.language}`}:{}}}},parseHTML(){return[{tag:"div[data-content-type="+this.name+"]"},{tag:"pre",preserveWhitespace:"full"}]},renderHTML({HTMLAttributes:e}){var n,a;const t=document.createElement("pre"),{dom:o,contentDOM:i}=D(this.name,"code",((n=this.options.domAttributes)==null?void 0:n.blockContent)||{},{...((a=this.options.domAttributes)==null?void 0:a.inlineContent)||{},...e});return o.removeChild(i),o.appendChild(t),t.appendChild(i),{dom:o,contentDOM:i}},addNodeView(){const e=this.options.supportedLanguages;return({editor:t,node:o,getPos:i,HTMLAttributes:n})=>{var h,m;const a=document.createElement("pre"),r=document.createElement("select"),l=document.createElement("div"),{dom:s,contentDOM:u}=D(this.name,"code",{...((h=this.options.domAttributes)==null?void 0:h.blockContent)||{},...n},((m=this.options.domAttributes)==null?void 0:m.inlineContent)||{}),c=b=>{const f=b.target.value;t.commands.command(({tr:g})=>(g.setNodeAttribute(i(),"language",f),!0))};return e.forEach(({id:b,name:f})=>{const g=document.createElement("option");g.value=b,g.text=f,r.appendChild(g)}),l.contentEditable="false",r.value=o.attrs.language||this.options.defaultLanguage,s.removeChild(u),s.appendChild(l),s.appendChild(a),a.appendChild(u),l.appendChild(r),r.addEventListener("change",c),{dom:s,contentDOM:u,update:b=>b.type===this.type,destroy:()=>{r.removeEventListener("change",c)}}}},addProseMirrorPlugins(){let e,t;const o=this.options.supportedLanguages,i=a=>{if(!e)return Le.createHighlighter({themes:["github-dark"],langs:[]}).then(l=>{e=l});const r=a.language;return r&&r!=="text"&&!e.getLoadedLanguages().includes(r)&&o.find(({id:l})=>l===r)&&Le.bundledLanguagesInfo.find(({id:l})=>l===r)?e.loadLanguage(r):(t||(t=ni.createParser(e)),t(a))};return[ii.createHighlightPlugin({parser:i,languageExtractor:a=>a.attrs.language,nodeTypes:[this.name]})]},addInputRules(){const e=this.options.supportedLanguages;return[new k.InputRule({find:/^```(.*?)\s$/,handler:({state:t,range:o,match:i})=>{var l;const n=t.doc.resolve(o.from),a=i[1].trim(),r={language:((l=e.find(({match:s})=>s.includes(a)))==null?void 0:l.id)||this.options.defaultLanguage};if(!n.node(-1).canReplaceWith(n.index(-1),n.indexAfter(-1),this.type))return null;t.tr.delete(o.from,o.to).setBlockType(o.from,o.from,this.type,r).setSelection(y.TextSelection.create(t.tr.doc,o.from))}})]},addKeyboardShortcuts(){return{Delete:({editor:e})=>{const{selection:t}=e.state,{$from:o}=t;if(e.isActive(this.name)&&!o.parent.textContent&&k.isTextSelection(t)){const i=o.pos-o.parentOffset-2;return e.chain().setNodeSelection(i).deleteSelection().run(),!0}return!1},Tab:({editor:e})=>this.options.indentLineWithTab&&e.isActive(this.name)?(e.commands.insertContent(" "),!0):!1,Enter:({editor:e})=>{const{$from:t}=e.state.selection;if(!e.isActive(this.name))return!1;const o=t.parentOffset===t.parent.nodeSize-2,i=t.parent.textContent.endsWith(`
|
|
5
|
+
`,styles:{}};return}if(a.type.name!=="link"&&a.type.name!=="text"&&t[a.type.name]){n&&(i.push(n),n=void 0),i.push(be(a,t,o));return}const r={};let s;for(const l of a.marks)if(l.type.name==="link")s=l;else{const u=o[l.type.name];if(!u)throw new Error(`style ${l.type.name} not found in styleSchema`);if(u.propSchema==="boolean")r[u.type]=!0;else if(u.propSchema==="string")r[u.type]=l.attrs.stringValue;else throw new j(u.propSchema)}n?Y(n)?s?(i.push(n),n={type:"link",href:s.attrs.href,content:[{type:"text",text:a.textContent,styles:r}]}):JSON.stringify(n.styles)===JSON.stringify(r)?n.text+=a.textContent:(i.push(n),n={type:"text",text:a.textContent,styles:r}):Ie(n)&&(s?n.href===s.attrs.href?JSON.stringify(n.content[n.content.length-1].styles)===JSON.stringify(r)?n.content[n.content.length-1].text+=a.textContent:n.content.push({type:"text",text:a.textContent,styles:r}):(i.push(n),n={type:"link",href:s.attrs.href,content:[{type:"text",text:a.textContent,styles:r}]}):(i.push(n),n={type:"text",text:a.textContent,styles:r})):s?n={type:"link",href:s.attrs.href,content:[{type:"text",text:a.textContent,styles:r}]}:n={type:"text",text:a.textContent,styles:r}}),n&&i.push(n),i}function be(e,t,o){if(e.type.name==="text"||e.type.name==="link")throw new Error("unexpected");const i={},n=t[e.type.name];for(const[s,l]of Object.entries(e.attrs)){if(!n)throw Error("ic node is of an unrecognized type: "+e.type.name);const u=n.propSchema;s in u&&(i[s]=l)}let a;return n.content==="styled"?a=ce(e,t,o):a=void 0,{type:e.type.name,props:i,content:a}}function E(e,t,o,i,n){var g;if(!e.type.isInGroup("bnBlock"))throw Error("Node must be in bnBlock group, but is of type"+e.type.name);const a=n==null?void 0:n.get(e);if(a)return a;const r=ge(e,0);let s=r.bnBlock.node.attrs.id;s===null&&(s=J.options.generateID());const l=t[r.blockNoteType];if(!l)throw Error("Block is of an unrecognized type: "+r.blockNoteType);const u={};for(const[b,y]of Object.entries({...e.attrs,...r.isBlockContainer?r.blockContent.node.attrs:{}})){const w=l.propSchema;b in w&&(u[b]=y)}const c=t[r.blockNoteType],p=[];(g=r.childContainer)==null||g.node.forEach(b=>{p.push(E(b,t,o,i,n))});let m;if(c.content==="inline"){if(!r.isBlockContainer)throw new Error("impossible");m=ce(r.blockContent.node,o,i)}else if(c.content==="table"){if(!r.isBlockContainer)throw new Error("impossible");m=Oe(r.blockContent.node,o,i)}else if(c.content==="none")m=void 0;else throw new j(c.content);const f={id:s,type:c.type,props:u,content:m,children:p};return n==null||n.set(e,f),f}function Ue(e,t,o,i){return e.dom.setAttribute("data-inline-content-type",t),Object.entries(o).filter(([n,a])=>a!==i[n].default).map(([n,a])=>[se(n),a]).forEach(([n,a])=>e.dom.setAttribute(n,a)),e.contentDOM!==void 0&&e.contentDOM.setAttribute("data-editable",""),e}function wt(e){return{Backspace:({editor:t})=>{const o=t.state.selection.$from;return t.state.selection.empty&&o.node().type.name===e.type&&o.parentOffset===0}}}function vt(e,t){return{config:e,implementation:t}}function Ct(e,t){return vt({type:e.name,propSchema:t,content:e.config.content==="inline*"?"styled":"none"},{node:e})}function Re(e){return Object.fromEntries(Object.entries(e).map(([t,o])=>[t,o.config]))}function xt(e){return[{tag:`[data-inline-content-type="${e.type}"]`,contentElement:t=>{const o=t;return o.matches("[data-editable]")?o:o.querySelector("[data-editable]")||o}}]}function Ki(e,t){const o=k.Node.create({name:e.type,inline:!0,group:"inline",selectable:e.content==="styled",atom:e.content==="none",content:e.content==="styled"?"inline*":"",addAttributes(){return De(e.propSchema)},addKeyboardShortcuts(){return wt(e)},parseHTML(){return xt(e)},renderHTML({node:i}){const n=this.options.editor,a=t.render(be(i,n.schema.inlineContentSchema,n.schema.styleSchema),()=>{},n);return Ue(a,e.type,i.attrs,e.propSchema)},addNodeView(){return({node:i,getPos:n})=>{const a=this.options.editor,r=t.render(be(i,a.schema.inlineContentSchema,a.schema.styleSchema),s=>{if(typeof n=="boolean")return;const l=H([s],a._tiptapEditor.schema,a.schema.styleSchema);a.dispatch(a.prosemirrorView.state.tr.replaceWith(n(),n()+i.nodeSize,l))},a);return Ue(r,e.type,i.attrs,e.propSchema)}}});return Ct(o,e.propSchema)}function Et(e){return e==="boolean"?{}:{stringValue:{default:void 0,keepOnSplit:!0,parseHTML:t=>t.getAttribute("data-value"),renderHTML:t=>t.stringValue!==void 0?{"data-value":t.stringValue}:{}}}}function St(e,t,o,i){return e.dom.setAttribute("data-style-type",t),i==="string"&&e.dom.setAttribute("data-value",o),e.contentDOM!==void 0&&e.contentDOM.setAttribute("data-editable",""),e}function Ve(e,t){return{config:e,implementation:t}}function X(e,t){return Ve({type:e.name,propSchema:t},{mark:e})}function ze(e){return Object.fromEntries(Object.entries(e).map(([t,o])=>[t,o.config]))}function Bt(e){return[{tag:`[data-style-type="${e.type}"]`,contentElement:t=>{const o=t;return o.matches("[data-editable]")?o:o.querySelector("[data-editable]")||o}}]}function qi(e,t){const o=k.Mark.create({name:e.type,addAttributes(){return Et(e.propSchema)},parseHTML(){return Bt(e)},renderHTML({mark:i}){let n;if(e.propSchema==="boolean")n=t.render();else if(e.propSchema==="string")n=t.render(i.attrs.stringValue);else throw new j(e.propSchema);return St(n,e.type,i.attrs.stringValue,e.propSchema)}});return Ve(e,{mark:o})}const ue=(e,t)=>{const o=e.querySelector(t);if(!o)return;const i=e.querySelector("figcaption"),n=(i==null?void 0:i.textContent)??void 0;return{targetElement:o,caption:n}},Tt=(e,t,o,i)=>{const n=document.createElement("div");n.className="bn-add-file-button";const a=document.createElement("div");a.className="bn-add-file-button-icon",i?a.appendChild(i):a.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M3 8L9.00319 2H19.9978C20.5513 2 21 2.45531 21 2.9918V21.0082C21 21.556 20.5551 22 20.0066 22H3.9934C3.44476 22 3 21.5501 3 20.9932V8ZM10 4V9H5V20H19V4H10Z"></path></svg>',n.appendChild(a);const r=document.createElement("p");r.className="bn-add-file-button-text",r.innerHTML=o||t.dictionary.file_blocks.file.add_button_text,n.appendChild(r);const s=u=>{u.preventDefault()},l=()=>{t.dispatch(t._tiptapEditor.state.tr.setMeta(t.filePanel.plugin,{block:e}))};return n.addEventListener("mousedown",s,!0),n.addEventListener("click",l,!0),{dom:n,destroy:()=>{n.removeEventListener("mousedown",s,!0),n.removeEventListener("click",l,!0)}}},Mt='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M3 8L9.00319 2H19.9978C20.5513 2 21 2.45531 21 2.9918V21.0082C21 21.556 20.5551 22 20.0066 22H3.9934C3.44476 22 3 21.5501 3 20.9932V8ZM10 4V9H5V20H19V4H10Z"></path></svg>',It=e=>{const t=document.createElement("div");t.className="bn-file-name-with-icon";const o=document.createElement("div");o.className="bn-file-icon",o.innerHTML=Mt,t.appendChild(o);const i=document.createElement("p");return i.className="bn-file-name",i.textContent=e.props.name,t.appendChild(i),{dom:t}},ke=(e,t,o,i,n)=>{const a=document.createElement("div");if(a.className="bn-file-block-content-wrapper",e.props.url===""){const s=Tt(e,t,i,n);a.appendChild(s.dom);const l=t.onUploadStart(u=>{if(u===e.id){a.removeChild(s.dom);const c=document.createElement("div");c.className="bn-file-loading-preview",c.textContent="Loading...",a.appendChild(c)}});return{dom:a,destroy:()=>{l(),s.destroy()}}}const r={dom:a};if(e.props.showPreview===!1||!o){const s=It(e);a.appendChild(s.dom),r.destroy=()=>{var l;(l=s.destroy)==null||l.call(s)}}else a.appendChild(o.dom);if(e.props.caption){const s=document.createElement("p");s.className="bn-file-caption",s.textContent=e.props.caption,a.appendChild(s)}return r},_e=(e,t)=>{const o=document.createElement("figure"),i=document.createElement("figcaption");return i.textContent=t,o.appendChild(e),o.appendChild(i),{dom:o}},pe=(e,t)=>{const o=document.createElement("div"),i=document.createElement("p");return i.textContent=t,o.appendChild(e),o.appendChild(i),{dom:o}},Lt=e=>({url:e.src||void 0}),Pt='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M2 16.0001H5.88889L11.1834 20.3319C11.2727 20.405 11.3846 20.4449 11.5 20.4449C11.7761 20.4449 12 20.2211 12 19.9449V4.05519C12 3.93977 11.9601 3.8279 11.887 3.73857C11.7121 3.52485 11.3971 3.49335 11.1834 3.66821L5.88889 8.00007H2C1.44772 8.00007 1 8.44778 1 9.00007V15.0001C1 15.5524 1.44772 16.0001 2 16.0001ZM23 12C23 15.292 21.5539 18.2463 19.2622 20.2622L17.8445 18.8444C19.7758 17.1937 21 14.7398 21 12C21 9.26016 19.7758 6.80629 17.8445 5.15557L19.2622 3.73779C21.5539 5.75368 23 8.70795 23 12ZM18 12C18 10.0883 17.106 8.38548 15.7133 7.28673L14.2842 8.71584C15.3213 9.43855 16 10.64 16 12C16 13.36 15.3213 14.5614 14.2842 15.2841L15.7133 16.7132C17.106 15.6145 18 13.9116 18 12Z"></path></svg>',At={backgroundColor:S.backgroundColor,name:{default:""},url:{default:""},caption:{default:""},showPreview:{default:!0}},Nt={type:"audio",propSchema:At,content:"none",isFileBlock:!0,fileBlockAccept:["audio/*"]},Dt=(e,t)=>{const o=document.createElement("div");o.innerHTML=Pt;const i=document.createElement("audio");return i.className="bn-audio",t.resolveFileUrl?t.resolveFileUrl(e.props.url).then(n=>{i.src=n}):i.src=e.props.url,i.controls=!0,i.contentEditable="false",i.draggable=!1,ke(e,t,{dom:i},t.dictionary.file_blocks.audio.add_button_text,o.firstElementChild)},jt=e=>{if(e.tagName==="AUDIO")return Lt(e);if(e.tagName==="FIGURE"){const t=ue(e,"audio");if(!t)return;const{targetElement:o,caption:i}=t;return{...Lt(o),caption:i}}},Ht=e=>{if(!e.props.url){const o=document.createElement("p");return o.textContent="Add audio",{dom:o}}let t;return e.props.showPreview?(t=document.createElement("audio"),t.src=e.props.url):(t=document.createElement("a"),t.href=e.props.url,t.textContent=e.props.name||e.props.url),e.props.caption?e.props.showPreview?_e(t,e.props.caption):pe(t,e.props.caption):{dom:t}},Ot=de(Nt,{render:Dt,parse:jt,toExternalHTML:Ht}),Ut=[{id:"text",name:"Plain Text",match:["text","txt","plain"]},...Me.bundledLanguagesInfo.filter(e=>["c","cpp","css","glsl","graphql","haml","html","java","javascript","json","jsonc","jsonl","jsx","julia","less","markdown","mdx","php","postcss","pug","python","r","regexp","sass","scss","shellscript","sql","svelte","typescript","vue","vue-html","wasm","wgsl","xml","yaml"].includes(e.id)).map(e=>({match:[e.id,...e.aliases||[]],id:e.id,name:e.name})),{id:"tsx",name:"TSX",match:["tsx","typescriptreact"]},{id:"haskell",name:"Haskell",match:["haskell","hs"]},{id:"csharp",name:"C#",match:["c#","csharp","cs"]},{id:"latex",name:"LaTeX",match:["latex"]},{id:"lua",name:"Lua",match:["lua"]},{id:"mermaid",name:"Mermaid",match:["mermaid","mmd"]},{id:"ruby",name:"Ruby",match:["ruby","rb"]},{id:"rust",name:"Rust",match:["rust","rs"]},{id:"scala",name:"Scala",match:["scala"]},{id:"swift",name:"Swift",match:["swift"]},{id:"kotlin",name:"Kotlin",match:["kotlin","kt","kts"]},{id:"objective-c",name:"Objective C",match:["objective-c","objc"]}],ye={language:{default:"javascript",values:[...Ut.map(e=>e.id)]}},Rt=W({name:"codeBlock",content:"inline*",group:"blockContent",marks:"",code:!0,defining:!0,addOptions(){return{defaultLanguage:"javascript",indentLineWithTab:!0,supportedLanguages:Ut}},addAttributes(){const e=this.options.supportedLanguages;return{language:{default:this.options.defaultLanguage,parseHTML:t=>{var a;let o=t,i=null;(o==null?void 0:o.tagName)==="DIV"&&(o==null?void 0:o.dataset.contentType)==="codeBlock"&&(o=o.children[0]),(o==null?void 0:o.tagName)==="PRE"&&(o=o==null?void 0:o.children[0]);const n=o==null?void 0:o.getAttribute("data-language");if(n)i=n.toLowerCase();else{const s=[...(o==null?void 0:o.className.split(" "))||[]].filter(u=>u.startsWith("language-")).map(u=>u.replace("language-","")),[l]=s;i=l.toLowerCase()}return i?((a=e.find(({match:r})=>r.includes(i)))==null?void 0:a.id)||this.options.defaultLanguage:null},renderHTML:t=>t.language&&t.language!=="text"?{class:`language-${t.language}`}:{}}}},parseHTML(){return[{tag:"div[data-content-type="+this.name+"]"},{tag:"pre",preserveWhitespace:"full"}]},renderHTML({HTMLAttributes:e}){var n,a;const t=document.createElement("pre"),{dom:o,contentDOM:i}=R(this.name,"code",((n=this.options.domAttributes)==null?void 0:n.blockContent)||{},{...((a=this.options.domAttributes)==null?void 0:a.inlineContent)||{},...e});return o.removeChild(i),o.appendChild(t),t.appendChild(i),{dom:o,contentDOM:i}},addNodeView(){const e=this.options.supportedLanguages;return({editor:t,node:o,getPos:i,HTMLAttributes:n})=>{var p,m;const a=document.createElement("pre"),r=document.createElement("select"),s=document.createElement("div"),{dom:l,contentDOM:u}=R(this.name,"code",{...((p=this.options.domAttributes)==null?void 0:p.blockContent)||{},...n},((m=this.options.domAttributes)==null?void 0:m.inlineContent)||{}),c=f=>{const g=f.target.value;t.commands.command(({tr:b})=>(b.setNodeAttribute(i(),"language",g),!0))};return e.forEach(({id:f,name:g})=>{const b=document.createElement("option");b.value=f,b.text=g,r.appendChild(b)}),s.contentEditable="false",r.value=o.attrs.language||this.options.defaultLanguage,l.removeChild(u),l.appendChild(s),l.appendChild(a),a.appendChild(u),s.appendChild(r),r.addEventListener("change",c),{dom:l,contentDOM:u,update:f=>f.type===this.type,destroy:()=>{r.removeEventListener("change",c)}}}},addProseMirrorPlugins(){let e,t;const o=this.options.supportedLanguages,i=a=>{if(!e)return Me.createHighlighter({themes:["github-dark"],langs:[]}).then(s=>{e=s});const r=a.language;return r&&r!=="text"&&!e.getLoadedLanguages().includes(r)&&o.find(({id:s})=>s===r)&&Me.bundledLanguagesInfo.find(({id:s})=>s===r)?e.loadLanguage(r):(t||(t=di.createParser(e)),t(a))};return[li.createHighlightPlugin({parser:i,languageExtractor:a=>a.attrs.language,nodeTypes:[this.name]})]},addInputRules(){const e=this.options.supportedLanguages;return[new k.InputRule({find:/^```(.*?)\s$/,handler:({state:t,range:o,match:i})=>{var s;const n=t.doc.resolve(o.from),a=i[1].trim(),r={language:((s=e.find(({match:l})=>l.includes(a)))==null?void 0:s.id)||this.options.defaultLanguage};if(!n.node(-1).canReplaceWith(n.index(-1),n.indexAfter(-1),this.type))return null;t.tr.delete(o.from,o.to).setBlockType(o.from,o.from,this.type,r).setSelection(_.TextSelection.create(t.tr.doc,o.from))}})]},addKeyboardShortcuts(){return{Delete:({editor:e})=>{const{selection:t}=e.state,{$from:o}=t;if(e.isActive(this.name)&&!o.parent.textContent&&k.isTextSelection(t)){const i=o.pos-o.parentOffset-2;return e.chain().setNodeSelection(i).deleteSelection().run(),!0}return!1},Tab:({editor:e})=>this.options.indentLineWithTab&&e.isActive(this.name)?(e.commands.insertContent(" "),!0):!1,Enter:({editor:e})=>{const{$from:t}=e.state.selection;if(!e.isActive(this.name))return!1;const o=t.parentOffset===t.parent.nodeSize-2,i=t.parent.textContent.endsWith(`
|
|
6
6
|
|
|
7
7
|
`);return!o||!i?(e.commands.insertContent(`
|
|
8
|
-
`),!0):e.chain().command(({tr:n})=>(n.delete(t.pos-2,t.pos),!0)).exitCode().run()},"Shift-Enter":({editor:e})=>{const{$from:t}=e.state.selection;return e.isActive(this.name)?(e.chain().insertContentAt(t.pos-t.parentOffset+t.parent.nodeSize,{type:"paragraph"}).run(),!0):!1}}}}),Vt=z(zt,ve);function Gi(e){var t;return z(zt.configure(e),{language:{default:e.defaultLanguage||ve.language.default,values:((t=e.supportedLanguages)==null?void 0:t.map(o=>o.id))||ve.language.values}})}const Ft={backgroundColor:E.backgroundColor,name:{default:""},url:{default:""},caption:{default:""}},Gt={type:"file",propSchema:Ft,content:"none",isFileBlock:!0},Wt=(e,t)=>{const o=Ge(e).dom,i=Y(e,o);return ue(e,t,i)},Kt=e=>{if(e.tagName==="EMBED")return We(e);if(e.tagName==="FIGURE"){const t=pe(e,"embed");if(!t)return;const{targetElement:o,caption:i}=t;return{...We(o),caption:i}}},qt=e=>{if(!e.props.url){const o=document.createElement("p");return o.textContent="Add file",{dom:o}}const t=document.createElement("a");return t.href=e.props.url,t.textContent=e.props.name||e.props.url,e.props.caption?he(t,e.props.caption):{dom:t}},$t=de(Gt,{render:Wt,parse:Kt,toExternalHTML:qt}),Wi=async e=>{const t=new FormData;return t.append("file",e),(await(await fetch("https://tmpfiles.org/api/v1/upload",{method:"POST",body:t})).json()).data.url.replace("tmpfiles.org/","tmpfiles.org/dl/")},qe=e=>{const t=e.src||void 0,o=e.width||void 0;return{url:t,previewWidth:o}},Xt='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M5 11.1005L7 9.1005L12.5 14.6005L16 11.1005L19 14.1005V5H5V11.1005ZM4 3H20C20.5523 3 21 3.44772 21 4V20C21 20.5523 20.5523 21 20 21H4C3.44772 21 3 20.5523 3 20V4C3 3.44772 3.44772 3 4 3ZM15.5 10C14.6716 10 14 9.32843 14 8.5C14 7.67157 14.6716 7 15.5 7C16.3284 7 17 7.67157 17 8.5C17 9.32843 16.3284 10 15.5 10Z"></path></svg>',Zt={textAlignment:E.textAlignment,backgroundColor:E.backgroundColor,name:{default:""},url:{default:""},caption:{default:""},showPreview:{default:!0},previewWidth:{default:512}},Jt={type:"image",propSchema:Zt,content:"none",isFileBlock:!0,fileBlockAccept:["image/*"]},Yt=(e,t)=>{const o=document.createElement("div");o.innerHTML=Xt;const i=document.createElement("img");i.className="bn-visual-media",t.resolveFileUrl(e.props.url).then(r=>{i.src=r}),i.alt=e.props.name||e.props.caption||"BlockNote image",i.contentEditable="false",i.draggable=!1,i.width=Math.min(e.props.previewWidth,t.domElement.firstElementChild.clientWidth);const n=Ke(e,t,i,()=>i.width,r=>i.width=r),a=Y(e,n.dom);return ue(e,t,a,t.dictionary.file_blocks.image.add_button_text,o.firstElementChild)},Qt=e=>{if(e.tagName==="IMG")return qe(e);if(e.tagName==="FIGURE"){const t=pe(e,"img");if(!t)return;const{targetElement:o,caption:i}=t;return{...qe(o),caption:i}}},eo=e=>{if(!e.props.url){const o=document.createElement("p");return o.textContent="Add image",{dom:o}}let t;return e.props.showPreview?(t=document.createElement("img"),t.src=e.props.url,t.alt=e.props.name||e.props.caption||"BlockNote image",t.width=e.props.previewWidth):(t=document.createElement("a"),t.href=e.props.url,t.textContent=e.props.name||e.props.url),e.props.caption?e.props.showPreview?ye(t,e.props.caption):he(t,e.props.caption):{dom:t}},to=de(Jt,{render:Yt,parse:Qt,toExternalHTML:eo}),Ki=35,$e=120,qi=31,$i=k.Extension.create({name:"BlockNoteTableExtension",addProseMirrorPlugins:()=>[$.columnResizing({cellMinWidth:Ki,defaultCellMinWidth:$e,View:null}),$.tableEditing()],addKeyboardShortcuts(){return{Enter:()=>this.editor.state.selection.empty&&this.editor.state.selection.$head.parent.type.name==="tableParagraph"?(this.editor.commands.setHardBreak(),!0):!1,Backspace:()=>{const e=this.editor.state.selection,t=e.empty,o=e.$head.parentOffset===0,i=e.$head.node().type.name==="tableParagraph";return t&&o&&i}}},extendNodeSchema(e){const t={name:e.name,options:e.options,storage:e.storage};return{tableRole:k.callOrReturn(k.getExtensionField(e,"tableRole",t))}}}),oo=e=>{const t=e.src||void 0,o=e.width||void 0;return{url:t,previewWidth:o}},io='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M2 3.9934C2 3.44476 2.45531 3 2.9918 3H21.0082C21.556 3 22 3.44495 22 3.9934V20.0066C22 20.5552 21.5447 21 21.0082 21H2.9918C2.44405 21 2 20.5551 2 20.0066V3.9934ZM8 5V19H16V5H8ZM4 5V7H6V5H4ZM18 5V7H20V5H18ZM4 9V11H6V9H4ZM18 9V11H20V9H18ZM4 13V15H6V13H4ZM18 13V15H20V13H18ZM4 17V19H6V17H4ZM18 17V19H20V17H18Z"></path></svg>',no={textAlignment:E.textAlignment,backgroundColor:E.backgroundColor,name:{default:""},url:{default:""},caption:{default:""},showPreview:{default:!0},previewWidth:{default:512}},ao={type:"video",propSchema:no,content:"none",isFileBlock:!0,fileBlockAccept:["video/*"]},ro=(e,t)=>{const o=document.createElement("div");o.innerHTML=io;const i=document.createElement("video");i.className="bn-visual-media",i.src=e.props.url,i.controls=!0,i.contentEditable="false",i.draggable=!1,i.width=Math.min(e.props.previewWidth,t.domElement.firstElementChild.clientWidth);const n=Ke(e,t,i,()=>i.width,r=>i.width=r),a=Y(e,n.dom);return ue(e,t,a,t.dictionary.file_blocks.video.add_button_text,o.firstElementChild)},lo=e=>{if(e.tagName==="VIDEO")return oo(e);if(e.tagName==="FIGURE"){const t=pe(e,"video");if(!t)return;const{targetElement:o,caption:i}=t;return{...oo(o),caption:i}}},so=e=>{if(!e.props.url){const o=document.createElement("p");return o.textContent="Add video",{dom:o}}let t;return e.props.showPreview?(t=document.createElement("video"),t.src=e.props.url,t.width=e.props.previewWidth):(t=document.createElement("a"),t.href=e.props.url,t.textContent=e.props.name||e.props.url),e.props.caption?e.props.showPreview?ye(t,e.props.caption):he(t,e.props.caption):{dom:t}},co=de(ao,{render:ro,parse:lo,toExternalHTML:so}),Xi=k.Mark.create({name:"backgroundColor",addAttributes(){return{stringValue:{default:void 0,parseHTML:e=>e.getAttribute("data-background-color"),renderHTML:e=>({"data-background-color":e.stringValue})}}},parseHTML(){return[{tag:"span",getAttrs:e=>typeof e=="string"?!1:e.hasAttribute("data-background-color")?{stringValue:e.getAttribute("data-background-color")}:!1}]},renderHTML({HTMLAttributes:e}){return["span",e,0]}}),Zi=F(Xi,"string"),Ji=k.Mark.create({name:"textColor",addAttributes(){return{stringValue:{default:void 0,parseHTML:e=>e.getAttribute("data-text-color"),renderHTML:e=>({"data-text-color":e.stringValue})}}},parseHTML(){return[{tag:"span",getAttrs:e=>typeof e=="string"?!1:e.hasAttribute("data-text-color")?{stringValue:e.getAttribute("data-text-color")}:!1}]},renderHTML({HTMLAttributes:e}){return["span",e,0]}}),Yi=F(Ji,"string"),B=(e,t,o)=>({state:i,dispatch:n})=>{const a=J(i.doc.resolve(t));if(n){const r=i.schema.nodes[a.blockNoteType],l=i.schema.nodes[o.type||a.blockNoteType],s=l.isInGroup("bnBlock")?l:i.schema.nodes.blockContainer;if(a.isBlockContainer&&l.isInGroup("blockContent"))uo(o,i,e,a),Qi(o,i,e,r,l,a);else if(!a.isBlockContainer&&l.isInGroup("bnBlock"))uo(o,i,e,a);else{const u=x(a.bnBlock.node,e.schema.blockSchema,e.schema.inlineContentSchema,e.schema.styleSchema,e.blockCache);return i.tr.replaceWith(a.bnBlock.beforePos,a.bnBlock.afterPos,V({children:u.children,...o},i.schema,e.schema.styleSchema)),!0}i.tr.setNodeMarkup(a.bnBlock.beforePos,s,{...a.bnBlock.node.attrs,...o.props})}return!0};function Qi(e,t,o,i,n,a){let r="keep";if(e.content)if(typeof e.content=="string")r=N([e.content],t.schema,o.schema.styleSchema);else if(Array.isArray(e.content))r=N(e.content,t.schema,o.schema.styleSchema);else if(e.content.type==="tableContent")r=ne(e.content,t.schema,o.schema.styleSchema);else throw new A(e.content.type);else i.spec.content===""||n.spec.content!==i.spec.content&&(r=[]);r==="keep"?t.tr.setNodeMarkup(a.blockContent.beforePos,e.type===void 0?void 0:t.schema.nodes[e.type],{...a.blockContent.node.attrs,...e.props}):t.tr.replaceWith(a.blockContent.beforePos,a.blockContent.afterPos,n.createChecked({...a.blockContent.node.attrs,...e.props},r))}function uo(e,t,o,i){if(e.children!==void 0){const n=e.children.map(a=>V(a,t.schema,o.schema.styleSchema));if(i.childContainer)t.tr.step(new be.ReplaceStep(i.childContainer.beforePos+1,i.childContainer.afterPos-1,new v.Slice(v.Fragment.from(n),0,0)));else{if(!i.isBlockContainer)throw new Error("impossible");t.tr.insert(i.blockContent.afterPos,t.schema.nodes.blockGroup.createChecked({},n))}}}function po(e,t,o){const i=e._tiptapEditor,n=typeof t=="string"?t:t.id,{posBeforeNode:a}=q(n,i.state.doc);i.commands.command(({state:l,dispatch:s})=>(B(e,a,o)({state:l,dispatch:s}),!0));const r=i.state.doc.resolve(a+1).node();return x(r,e.schema.blockSchema,e.schema.inlineContentSchema,e.schema.styleSchema,e.blockCache)}const en={...E,level:{default:1,values:[1,2,3]}},tn=R({name:"heading",content:"inline*",group:"blockContent",addAttributes(){return{level:{default:1,parseHTML:e=>{const t=e.getAttribute("data-level"),o=parseInt(t);if(isFinite(o))return o},renderHTML:e=>({"data-level":e.level.toString()})}}},addInputRules(){return[...[1,2,3].map(e=>new k.InputRule({find:new RegExp(`^(#{${e}})\\s$`),handler:({state:t,chain:o,range:i})=>{const n=C(t);!n.isBlockContainer||n.blockContent.node.type.spec.content!=="inline*"||o().command(B(this.options.editor,n.bnBlock.beforePos,{type:"heading",props:{level:e}})).deleteRange({from:i.from,to:i.to}).run()}}))]},addKeyboardShortcuts(){return{"Mod-Alt-1":()=>{const e=C(this.editor.state);return!e.isBlockContainer||e.blockContent.node.type.spec.content!=="inline*"?!0:this.editor.commands.command(B(this.options.editor,e.bnBlock.beforePos,{type:"heading",props:{level:1}}))},"Mod-Alt-2":()=>{const e=C(this.editor.state);return!e.isBlockContainer||e.blockContent.node.type.spec.content!=="inline*"?!0:this.editor.commands.command(B(this.options.editor,e.bnBlock.beforePos,{type:"heading",props:{level:2}}))},"Mod-Alt-3":()=>{const e=C(this.editor.state);return!e.isBlockContainer||e.blockContent.node.type.spec.content!=="inline*"?!0:this.editor.commands.command(B(this.options.editor,e.bnBlock.beforePos,{type:"heading",props:{level:3}}))}}},parseHTML(){return[{tag:"div[data-content-type="+this.name+"]",getAttrs:e=>typeof e=="string"?!1:{level:e.getAttribute("data-level")}},{tag:"h1",attrs:{level:1},node:"heading"},{tag:"h2",attrs:{level:2},node:"heading"},{tag:"h3",attrs:{level:3},node:"heading"}]},renderHTML({node:e,HTMLAttributes:t}){var o,i;return D(this.name,`h${e.attrs.level}`,{...((o=this.options.domAttributes)==null?void 0:o.blockContent)||{},...t},((i=this.options.domAttributes)==null?void 0:i.inlineContent)||{})}}),on=z(tn,en),ho=(e,t,o)=>({state:i,dispatch:n})=>{const a=re(i.doc,e),r=K(a);if(!r.isBlockContainer)throw new Error(`BlockContainer expected when calling splitBlock, position ${e}`);const l=[{type:r.bnBlock.node.type,attrs:o?{...r.bnBlock.node.attrs,id:void 0}:{}},{type:t?r.blockContent.node.type:i.schema.nodes.paragraph,attrs:o?{...r.blockContent.node.attrs}:{}}];return n&&i.tr.split(e,2,l),!0},Xe=e=>{const t=e._tiptapEditor,o=C(t.state);if(!o.isBlockContainer)return!1;const{bnBlock:i,blockContent:n}=o,a=t.state.selection.anchor===t.state.selection.head;return!(n.node.type.name==="bulletListItem"||n.node.type.name==="numberedListItem"||n.node.type.name==="checkListItem")||!a?!1:t.commands.first(({state:r,chain:l,commands:s})=>[()=>s.command(()=>n.node.childCount===0?s.command(B(e,i.beforePos,{type:"paragraph",props:{}})):!1),()=>s.command(()=>n.node.childCount>0?(l().deleteSelection().command(ho(r.selection.from,!0)).run(),!0):!1)])},nn={...E},an=R({name:"bulletListItem",content:"inline*",group:"blockContent",priority:90,addInputRules(){return[new k.InputRule({find:new RegExp("^[-+*]\\s$"),handler:({state:e,chain:t,range:o})=>{const i=C(e);!i.isBlockContainer||i.blockContent.node.type.spec.content!=="inline*"||t().command(B(this.options.editor,i.bnBlock.beforePos,{type:"bulletListItem",props:{}})).deleteRange({from:o.from,to:o.to})}})]},addKeyboardShortcuts(){return{Enter:()=>Xe(this.options.editor),"Mod-Shift-8":()=>{const e=C(this.editor.state);return!e.isBlockContainer||e.blockContent.node.type.spec.content!=="inline*"?!0:this.editor.commands.command(B(this.options.editor,e.bnBlock.beforePos,{type:"bulletListItem",props:{}}))}}},parseHTML(){return[{tag:"div[data-content-type="+this.name+"]"},{tag:"li",getAttrs:e=>{if(typeof e=="string")return!1;const t=e.parentElement;return t===null?!1:t.tagName==="UL"||t.tagName==="DIV"&&t.parentElement.tagName==="UL"?{}:!1},node:"bulletListItem"},{tag:"p",getAttrs:e=>{if(typeof e=="string")return!1;const t=e.parentElement;return t===null?!1:t.getAttribute("data-content-type")==="bulletListItem"?{}:!1},priority:300,node:"bulletListItem"}]},renderHTML({HTMLAttributes:e}){var t,o;return D(this.name,"p",{...((t=this.options.domAttributes)==null?void 0:t.blockContent)||{},...e},((o=this.options.domAttributes)==null?void 0:o.inlineContent)||{})}}),rn=z(an,nn),ln={...E,checked:{default:!1}},sn=R({name:"checkListItem",content:"inline*",group:"blockContent",addAttributes(){return{checked:{default:!1,parseHTML:e=>e.getAttribute("data-checked")==="true"||void 0,renderHTML:e=>e.checked?{"data-checked":e.checked.toString()}:{}}}},addInputRules(){return[new k.InputRule({find:new RegExp("\\[\\s*\\]\\s$"),handler:({state:e,chain:t,range:o})=>{const i=C(e);!i.isBlockContainer||i.blockContent.node.type.spec.content!=="inline*"||t().command(B(this.options.editor,i.bnBlock.beforePos,{type:"checkListItem",props:{checked:!1}})).deleteRange({from:o.from,to:o.to})}}),new k.InputRule({find:new RegExp("\\[[Xx]\\]\\s$"),handler:({state:e,chain:t,range:o})=>{const i=C(e);!i.isBlockContainer||i.blockContent.node.type.spec.content!=="inline*"||t().command(B(this.options.editor,i.bnBlock.beforePos,{type:"checkListItem",props:{checked:!0}})).deleteRange({from:o.from,to:o.to})}})]},addKeyboardShortcuts(){return{Enter:()=>Xe(this.options.editor),"Mod-Shift-9":()=>{const e=C(this.editor.state);return!e.isBlockContainer||e.blockContent.node.type.spec.content!=="inline*"?!0:this.editor.commands.command(B(this.options.editor,e.bnBlock.beforePos,{type:"checkListItem",props:{}}))}}},parseHTML(){return[{tag:"div[data-content-type="+this.name+"]"},{tag:"input",getAttrs:e=>typeof e=="string"?!1:e.type==="checkbox"?{checked:e.checked}:!1,node:"checkListItem"},{tag:"li",getAttrs:e=>{if(typeof e=="string")return!1;const t=e.parentElement;if(t===null)return!1;if(t.tagName==="UL"||t.tagName==="DIV"&&t.parentElement.tagName==="UL"){const o=e.querySelector("input[type=checkbox]")||null;return o===null?!1:{checked:o.checked}}return!1},node:"checkListItem"}]},renderHTML({node:e,HTMLAttributes:t}){var a,r;const o=document.createElement("input");o.type="checkbox",o.checked=e.attrs.checked,e.attrs.checked&&o.setAttribute("checked","");const{dom:i,contentDOM:n}=D(this.name,"p",{...((a=this.options.domAttributes)==null?void 0:a.blockContent)||{},...t},((r=this.options.domAttributes)==null?void 0:r.inlineContent)||{});return i.insertBefore(o,n),{dom:i,contentDOM:n}},addNodeView(){return({node:e,getPos:t,editor:o,HTMLAttributes:i})=>{var c,h;const n=document.createElement("div"),a=document.createElement("div");a.contentEditable="false";const r=document.createElement("input");r.type="checkbox",r.checked=e.attrs.checked,e.attrs.checked&&r.setAttribute("checked","");const l=()=>{if(!o.isEditable){r.checked=!r.checked;return}if(typeof t!="boolean"){const m=re(o.state.doc,t());if(m.node.type.name!=="blockContainer")throw new Error(`Expected blockContainer node, got ${m.node.type.name}`);this.editor.commands.command(B(this.options.editor,m.posBeforeNode,{type:"checkListItem",props:{checked:r.checked}}))}};r.addEventListener("change",l);const{dom:s,contentDOM:u}=D(this.name,"p",{...((c=this.options.domAttributes)==null?void 0:c.blockContent)||{},...i},((h=this.options.domAttributes)==null?void 0:h.inlineContent)||{});if(typeof t!="boolean"){const b="label-"+this.editor.state.doc.resolve(t()).node().attrs.id;r.setAttribute("aria-labelledby",b),u.id=b}return s.removeChild(u),s.appendChild(n),n.appendChild(a),n.appendChild(u),a.appendChild(r),{dom:s,contentDOM:u,destroy:()=>{r.removeEventListener("change",l)}}}}}),dn=z(sn,ln),cn=new y.PluginKey("numbered-list-indexing"),un=()=>new y.Plugin({key:cn,appendTransaction:(e,t,o)=>{const i=o.tr;i.setMeta("numberedListIndexing",!0);let n=!1;return o.doc.descendants((a,r)=>{if(a.type.name==="blockContainer"&&a.firstChild.type.name==="numberedListItem"){let l="1";const s=K({posBeforeNode:r,node:a});if(!s.isBlockContainer)throw new Error("impossible");const u=i.doc.resolve(s.bnBlock.beforePos).nodeBefore;if(u){const m=K({posBeforeNode:s.bnBlock.beforePos-u.nodeSize,node:u});if(m.blockNoteType==="numberedListItem"){if(!m.isBlockContainer)throw new Error("impossible");const f=m.blockContent.node.attrs.index;l=(parseInt(f)+1).toString()}}const c=s.blockContent.node;c.attrs.index!==l&&(n=!0,i.setNodeMarkup(s.blockContent.beforePos,void 0,{...c.attrs,index:l}))}}),n?i:null}}),pn={...E},hn=R({name:"numberedListItem",content:"inline*",group:"blockContent",priority:90,addAttributes(){return{index:{default:null,parseHTML:e=>e.getAttribute("data-index"),renderHTML:e=>({"data-index":e.index})}}},addInputRules(){return[new k.InputRule({find:new RegExp("^1\\.\\s$"),handler:({state:e,chain:t,range:o})=>{const i=C(e);!i.isBlockContainer||i.blockContent.node.type.spec.content!=="inline*"||t().command(B(this.options.editor,i.bnBlock.beforePos,{type:"numberedListItem",props:{}})).deleteRange({from:o.from,to:o.to})}})]},addKeyboardShortcuts(){return{Enter:()=>Xe(this.options.editor),"Mod-Shift-7":()=>{const e=C(this.editor.state);return!e.isBlockContainer||e.blockContent.node.type.spec.content!=="inline*"?!0:this.editor.commands.command(B(this.options.editor,e.bnBlock.beforePos,{type:"numberedListItem",props:{}}))}}},addProseMirrorPlugins(){return[un()]},parseHTML(){return[{tag:"div[data-content-type="+this.name+"]"},{tag:"li",getAttrs:e=>{if(typeof e=="string")return!1;const t=e.parentElement;return t===null?!1:t.tagName==="OL"||t.tagName==="DIV"&&t.parentElement.tagName==="OL"?{}:!1},node:"numberedListItem"},{tag:"p",getAttrs:e=>{if(typeof e=="string")return!1;const t=e.parentElement;return t===null?!1:t.getAttribute("data-content-type")==="numberedListItem"?{}:!1},priority:300,node:"numberedListItem"}]},renderHTML({HTMLAttributes:e}){var t,o;return D(this.name,"p",{...((t=this.options.domAttributes)==null?void 0:t.blockContent)||{},...e},((o=this.options.domAttributes)==null?void 0:o.inlineContent)||{})}}),mn=z(hn,pn),fn={...E},gn=R({name:"paragraph",content:"inline*",group:"blockContent",addKeyboardShortcuts(){return{"Mod-Alt-0":()=>{const e=C(this.editor.state);return!e.isBlockContainer||e.blockContent.node.type.spec.content!=="inline*"?!0:this.editor.commands.command(B(this.options.editor,e.bnBlock.beforePos,{type:"paragraph",props:{}}))}}},parseHTML(){return[{tag:"div[data-content-type="+this.name+"]"},{tag:"p",priority:200,getAttrs:e=>{var t;return typeof e=="string"||!((t=e.textContent)!=null&&t.trim())?!1:{}},node:"paragraph"}]},renderHTML({HTMLAttributes:e}){var t,o;return D(this.name,"p",{...((t=this.options.domAttributes)==null?void 0:t.blockContent)||{},...e},((o=this.options.domAttributes)==null?void 0:o.inlineContent)||{})}}),bn=z(gn,fn),kn={textColor:E.textColor},_n=R({name:"table",content:"tableRow+",group:"blockContent",tableRole:"table",isolating:!0,parseHTML(){return[{tag:"table"}]},renderHTML({HTMLAttributes:e}){var t,o;return D(this.name,"table",{...((t=this.options.domAttributes)==null?void 0:t.blockContent)||{},...e},((o=this.options.domAttributes)==null?void 0:o.inlineContent)||{})},addNodeView(){return({node:e,HTMLAttributes:t})=>{var i;class o extends $.TableView{constructor(a,r,l){super(a,r),this.node=a,this.cellMinWidth=r,this.blockContentHTMLAttributes=l;const s=document.createElement("div");s.className=O("bn-block-content",l.class),s.setAttribute("data-content-type","table");for(const[m,b]of Object.entries(l))m!=="class"&&s.setAttribute(m,b);const u=this.dom,c=document.createElement("div");c.className="tableWrapper-inner",c.appendChild(u.firstChild),u.appendChild(c),s.appendChild(u);const h=document.createElement("div");h.className="table-widgets-container",h.style.position="relative",u.appendChild(h),this.dom=s}ignoreMutation(a){return!a.target.closest(".tableWrapper-inner")||super.ignoreMutation(a)}}return new o(e,$e,{...((i=this.options.domAttributes)==null?void 0:i.blockContent)||{},...t})}}}),yn=k.Node.create({name:"tableParagraph",group:"tableContent",content:"inline*",parseHTML(){return[{preserveWhitespace:"full",priority:210,context:"tableContent",tag:"p",getAttrs:e=>({})},{tag:"p",getAttrs:e=>{if(typeof e=="string"||!e.textContent)return!1;const t=e.parentElement;return t===null?!1:t.tagName==="TD"?{}:!1}}]},renderHTML({HTMLAttributes:e}){return["p",e,0]}}),vn=z(_n,kn,[$i,yn,ui.TableHeader.extend({content:"tableContent"}),ci.TableCell.extend({content:"tableContent"}),pi.TableRow]),Ze={paragraph:bn,heading:on,codeBlock:Vt,bulletListItem:rn,numberedListItem:mn,checkListItem:dn,table:vn,file:$t,image:to,video:co,audio:Ot},mo=Ue(Ze),Je={bold:F(wi.default,"boolean"),italic:F(Ei.default,"boolean"),underline:F(Si.default,"boolean"),strike:F(xi.default,"boolean"),code:F(Ci.default,"boolean"),textColor:Yi,backgroundColor:Zi},wn=Fe(Je),Ye={text:{config:"text",implementation:{}},link:{config:"link",implementation:{}}},fo=ze(Ye);function L(e,t){return e in t.schema.blockSchema&&t.schema.blockSchema[e]===mo[e]}function go(e,t){return e in t.schema.inlineContentSchema&&t.schema.inlineContentSchema[e]===fo[e]}function bo(e,t,o){return t.type===e&&t.type in o.schema.blockSchema&&L(t.type,o)}function Cn(e,t){return e.type in t.schema.blockSchema&&t.schema.blockSchema[e.type].isFileBlock||!1}function En(e,t){return e.type in t.schema.blockSchema&&t.schema.blockSchema[e.type].isFileBlock&&"showPreview"in t.schema.blockSchema[e.type].propSchema||!1}function xn(e,t){return t.schema.blockSchema[e.type].isFileBlock&&!e.props.url}function ko(e,t,o){return t in o.schema.blockSchema&&e in o.schema.blockSchema[t].propSchema&&o.schema.blockSchema[t].propSchema[e]===E[e]}function Sn(e,t,o){return ko(e,t.type,o)}function Bn(e,t,o,i="before"){const n=typeof o=="string"?o:o.id,a=[];for(const u of t)a.push(V(u,e.pmSchema,e.schema.styleSchema));const{node:r,posBeforeNode:l}=q(n,e._tiptapEditor.state.doc);i==="before"&&e.dispatch(e._tiptapEditor.state.tr.insert(l,a)),i==="after"&&e.dispatch(e._tiptapEditor.state.tr.insert(l+r.nodeSize,a));const s=[];for(const u of a)s.push(x(u,e.schema.blockSchema,e.schema.inlineContentSchema,e.schema.styleSchema,e.blockCache));return s}function Tn(e){const{bnBlock:t}=C(e._tiptapEditor.state),o={blockId:t.node.attrs.id,blockPos:t.beforePos};return e._tiptapEditor.state.selection instanceof $.CellSelection?{...o,type:"cell",anchorCell:e._tiptapEditor.state.selection.$anchorCell.pos,headCell:e._tiptapEditor.state.selection.$headCell.pos}:e._tiptapEditor.state.selection instanceof y.NodeSelection?{...o,type:"node",from:e._tiptapEditor.state.selection.from}:{...o,type:"text",anchor:e._tiptapEditor.state.selection.anchor,head:e._tiptapEditor.state.selection.head}}function Mn(e,t){const o=q(t.blockId,e._tiptapEditor.state.doc).posBeforeNode;let i;t.type==="cell"?i=$.CellSelection.create(e._tiptapEditor.state.doc,t.anchorCell+(o-t.blockPos),t.headCell+(o-t.blockPos)):t.type==="node"?i=y.NodeSelection.create(e._tiptapEditor.state.doc,t.from+(o-t.blockPos)):i=y.TextSelection.create(e._tiptapEditor.state.doc,t.anchor+(o-t.blockPos),t.head+(o-t.blockPos)),e._tiptapEditor.view.dispatch(e._tiptapEditor.state.tr.setSelection(i))}function _o(e,t,o){const{block:i}=e.getTextCursorPosition(),n=Tn(e);e.removeBlocks([i]),e.insertBlocks([i],t,o),Mn(e,n)}function Ln(e){const t=e.getSelection();if(t&&t.blocks.length>1)return;const{prevBlock:o,parentBlock:i}=e.getTextCursorPosition();let n,a;o?o.children.length>0?(n=o.children[o.children.length-1].id,a="after"):(n=o.id,a="before"):i&&(n=i.id,a="before"),!(!n||!a)&&_o(e,n,a)}function In(e){const t=e.getSelection();if(t&&t.blocks.length>1)return;const{nextBlock:o,parentBlock:i}=e.getTextCursorPosition();let n,a;o?o.children.length>0?(n=o.children[0].id,a="before"):(n=o.id,a="after"):i&&(n=i.id,a="after"),!(!n||!a)&&_o(e,n,a)}function Pn(e,t){return function({state:o,dispatch:i}){const{$from:n,$to:a}=o.selection,r=n.blockRange(a,c=>c.childCount>0&&(c.type.name==="blockGroup"||c.type.name==="column"));if(!r)return!1;const l=r.startIndex;if(l===0)return!1;const u=r.parent.child(l-1);if(u.type!==e)return!1;if(i){const c=u.lastChild&&u.lastChild.type===t,h=v.Fragment.from(c?e.create():null),m=new v.Slice(v.Fragment.from(e.create(null,v.Fragment.from(t.create(null,h)))),c?3:1,0),b=r.start,f=r.end;i(o.tr.step(new be.ReplaceAroundStep(b-(c?3:1),f,b,f,m,1,!0)).scrollIntoView())}return!0}}function yo(e){return e._tiptapEditor.commands.command(Pn(e._tiptapEditor.schema.nodes.blockContainer,e._tiptapEditor.schema.nodes.blockGroup))}function An(e){e._tiptapEditor.commands.liftListItem("blockContainer")}function Nn(e){const{bnBlock:t}=C(e._tiptapEditor.state);return e._tiptapEditor.state.doc.resolve(t.beforePos).nodeBefore!==null}function jn(e){const{bnBlock:t}=C(e._tiptapEditor.state);return e._tiptapEditor.state.doc.resolve(t.beforePos).depth>1}function vo(e,t,o){const i=e._tiptapEditor;let n=i.state.tr;const a=[];for(const h of o)a.push(V(h,e.pmSchema,e.schema.styleSchema));const r=new Set(t.map(h=>typeof h=="string"?h:h.id)),l=[],s=typeof t[0]=="string"?t[0]:t[0].id;let u=0;if(i.state.doc.descendants((h,m)=>{if(r.size===0)return!1;if(!h.type.isInGroup("bnBlock")||!r.has(h.attrs.id))return!0;if(l.push(x(h,e.schema.blockSchema,e.schema.inlineContentSchema,e.schema.styleSchema,e.blockCache)),r.delete(h.attrs.id),o.length>0&&h.attrs.id===s){const _=n.doc.nodeSize;n=n.insert(m,a);const w=n.doc.nodeSize;u+=_-w}const b=n.doc.nodeSize,f=n.doc.resolve(m-u);f.node().type.name==="blockGroup"&&f.node(f.depth-1).type.name!=="doc"&&f.node().childCount===1?n=n.delete(f.before(),f.after()):n=n.delete(m-u,m-u+h.nodeSize);const g=n.doc.nodeSize;return u+=b-g,!1}),r.size>0){const h=[...r].join(`
|
|
9
|
-
`);throw Error("Blocks with the following IDs could not be found in the editor: "+h)}e.dispatch(n);const c=[];for(const h of a)c.push(x(h,e.schema.blockSchema,e.schema.inlineContentSchema,e.schema.styleSchema,e.blockCache));return{insertedBlocks:c,removedBlocks:l}}function Dn(e,t,o){return vo(e,t,o)}function Hn(e,t){return vo(e,t,[]).removedBlocks}function Un(e,t,o,i={updateSelection:!0}){const n=o._tiptapEditor.state.tr;let{from:a,to:r}=typeof e=="number"?{from:e,to:e}:{from:e.from,to:e.to},l=!0,s=!0,u="";if(t.forEach(c=>{c.check(),l&&c.isText&&c.marks.length===0?u+=c.text:l=!1,s=s?c.isBlock:!1}),a===r&&s){const{parent:c}=n.doc.resolve(a);c.isTextblock&&!c.type.spec.code&&!c.childCount&&(a-=1,r+=1)}return l?n.insertText(u,a,r):n.replaceWith(a,r,t),i.updateSelection&&k.selectionToInsertionEnd(n,n.steps.length-1,-1),o.dispatch(n),!0}function On(e){const{bnBlock:t}=C(e._tiptapEditor.state),o=e._tiptapEditor.state.doc.resolve(t.beforePos),i=o.nodeBefore,n=e._tiptapEditor.state.doc.resolve(t.afterPos).nodeAfter;let a;return o.depth>1&&(a=o.node(),a.type.isInGroup("bnBlock")||(a=o.node(o.depth-1))),{block:x(t.node,e.schema.blockSchema,e.schema.inlineContentSchema,e.schema.styleSchema,e.blockCache),prevBlock:i===null?void 0:x(i,e.schema.blockSchema,e.schema.inlineContentSchema,e.schema.styleSchema,e.blockCache),nextBlock:n===null?void 0:x(n,e.schema.blockSchema,e.schema.inlineContentSchema,e.schema.styleSchema,e.blockCache),parentBlock:a===void 0?void 0:x(a,e.schema.blockSchema,e.schema.inlineContentSchema,e.schema.styleSchema,e.blockCache)}}function wo(e,t,o="start"){const i=typeof t=="string"?t:t.id,n=q(i,e._tiptapEditor.state.doc),a=K(n),r=e.schema.blockSchema[a.blockNoteType].content;if(a.isBlockContainer){const l=a.blockContent;if(r==="none"){e._tiptapEditor.commands.setNodeSelection(l.beforePos);return}if(r==="inline")o==="start"?e._tiptapEditor.commands.setTextSelection(l.beforePos+1):e._tiptapEditor.commands.setTextSelection(l.afterPos-1);else if(r==="table")o==="start"?e._tiptapEditor.commands.setTextSelection(l.beforePos+4):e._tiptapEditor.commands.setTextSelection(l.afterPos-4);else throw new A(r)}else{const l=o==="start"?a.childContainer.node.firstChild:a.childContainer.node.lastChild;wo(e,l.attrs.id,o)}}d.esmDependencies=void 0;async function we(){if(d.esmDependencies)return d.esmDependencies;const e=await Promise.all([import("rehype-parse"),import("rehype-stringify"),import("unified"),import("hast-util-from-dom"),import("rehype-remark"),import("remark-gfm"),import("remark-stringify"),import("remark-parse"),import("remark-rehype"),import("rehype-format")]);return d.esmDependencies={rehypeParse:e[0],rehypeStringify:e[1],unified:e[2],hastUtilFromDom:e[3],rehypeRemark:e[4],remarkGfm:e[5],remarkStringify:e[6],remarkParse:e[7],remarkRehype:e[8],rehypeFormat:e[9]},d.esmDependencies}function Rn(){const e=t=>{let o=t.children.length;for(let i=0;i<o;i++){const n=t.children[i];if(n.type==="element"&&(e(n),n.tagName==="u"))if(n.children.length>0){t.children.splice(i,1,...n.children);const a=n.children.length-1;o+=a,i+=a}else t.children.splice(i,1),o--,i--}};return e}function zn(){const e=d.esmDependencies;if(!e)throw new Error("addSpacesToCheckboxes requires ESM dependencies to be initialized");const t=o=>{var i;if(o.children&&"length"in o.children&&o.children.length)for(let n=o.children.length-1;n>=0;n--){const a=o.children[n],r=n+1<o.children.length?o.children[n+1]:void 0;a.type==="element"&&a.tagName==="input"&&((i=a.properties)==null?void 0:i.type)==="checkbox"&&(r==null?void 0:r.type)==="element"&&r.tagName==="p"?(r.tagName="span",r.children.splice(0,0,e.hastUtilFromDom.fromDom(document.createTextNode(" ")))):t(a)}};return t}function Ce(e){const t=d.esmDependencies;if(!t)throw new Error("cleanHTMLToMarkdown requires ESM dependencies to be initialized");return t.unified.unified().use(t.rehypeParse.default,{fragment:!0}).use(Rn).use(zn).use(t.rehypeRemark.default).use(t.remarkGfm.default).use(t.remarkStringify.default,{handlers:{text:i=>i.value}}).processSync(e).value}async function Co(e,t,o,i){await we();const a=ae(t,o).exportBlocks(e,i);return Ce(a)}function Vn(e){return Array.prototype.indexOf.call(e.parentElement.childNodes,e)}function Fn(e){return e.nodeType===3&&!/\S/.test(e.nodeValue||"")}function Gn(e){e.querySelectorAll("li > ul, li > ol").forEach(t=>{const o=Vn(t),i=t.parentElement,n=Array.from(i.childNodes).slice(o+1);t.remove(),n.forEach(a=>{a.remove()}),i.insertAdjacentElement("afterend",t),n.reverse().forEach(a=>{if(Fn(a))return;const r=document.createElement("li");r.append(a),t.insertAdjacentElement("afterend",r)}),i.childNodes.length===0&&i.remove()})}function Wn(e){e.querySelectorAll("li + ul, li + ol").forEach(t=>{var a,r;const o=t.previousElementSibling,i=document.createElement("div");o.insertAdjacentElement("afterend",i),i.append(o);const n=document.createElement("div");for(n.setAttribute("data-node-type","blockGroup"),i.append(n);((a=i.nextElementSibling)==null?void 0:a.nodeName)==="UL"||((r=i.nextElementSibling)==null?void 0:r.nodeName)==="OL";)n.append(i.nextElementSibling)})}let Eo=null;function Kn(){return Eo||(Eo=document.implementation.createHTMLDocument("title"))}function xo(e){if(typeof e=="string"){const t=Kn().createElement("div");t.innerHTML=e,e=t}return Gn(e),Wn(e),e}async function Qe(e,t,o,i,n){const a=xo(e),l=v.DOMParser.fromSchema(n).parse(a,{topNode:n.nodes.blockGroup.create()}),s=[];for(let u=0;u<l.childCount;u++)s.push(x(l.child(u),t,o,i));return s}function qn(e,t){const o=t.value?t.value:"",i={};t.lang&&(i["data-language"]=t.lang);let n={type:"element",tagName:"code",properties:i,children:[{type:"text",value:o}]};return t.meta&&(n.data={meta:t.meta}),e.patch(t,n),n=e.applyData(t,n),n={type:"element",tagName:"pre",properties:{},children:[n]},e.patch(t,n),n}async function So(e,t,o,i,n){const a=await we(),r=a.unified.unified().use(a.remarkParse.default).use(a.remarkGfm.default).use(a.remarkRehype.default,{handlers:{...a.remarkRehype.defaultHandlers,code:qn}}).use(a.rehypeStringify.default).processSync(e);return Qe(r.value,t,o,i,n)}const et=["vscode-editor-data","blocknote/html","text/html","text/plain","Files"];function $n(e,t){if(!e.startsWith(".")||!t.startsWith("."))throw new Error("The strings provided are not valid file extensions.");return e===t}function Xn(e,t){const o=e.split("/"),i=t.split("/");if(o.length!==2)throw new Error(`The string ${e} is not a valid MIME type.`);if(i.length!==2)throw new Error(`The string ${t} is not a valid MIME type.`);return o[1]==="*"||i[1]==="*"?o[0]===i[0]:(o[0]==="*"||i[0]==="*"||o[0]===i[0])&&o[1]===i[1]}async function Bo(e,t){if(!t.uploadFile){console.warn("Attempted ot insert file, but uploadFile is not set in the BlockNote editor options");return}const o="dataTransfer"in e?e.dataTransfer:e.clipboardData;if(o===null)return;let i=null;for(const r of et)if(o.types.includes(r)){i=r;break}if(i!=="Files")return;const n=o.items;if(!n)return;e.preventDefault();const a=Object.values(t.schema.blockSchema).filter(r=>r.isFileBlock);for(let r=0;r<n.length;r++){let l="file";for(const u of a)for(const c of u.fileBlockAccept||[]){const h=c.startsWith("."),m=n[r].getAsFile();if(m&&(!h&&m.type&&Xn(n[r].type,c)||h&&$n("."+m.name.split(".").pop(),c))){l=u.type;break}}const s=n[r].getAsFile();if(s){const u={type:l,props:{name:s.name}};let c;if(e.type==="paste")c=t.insertBlocks([u],t.getTextCursorPosition().block,"after")[0].id;else if(e.type==="drop"){const b={left:e.clientX,top:e.clientY},f=t._tiptapEditor.view.posAtCoords(b);if(!f)return;const g=re(t._tiptapEditor.state.doc,f.pos),_=K(g);c=t.insertBlocks([u],_.bnBlock.node.attrs.id,"after")[0].id}else return;const h=await t.uploadFile(s,c),m=typeof h=="string"?{props:{url:h}}:{...h};t.updateBlock(c,m)}}}const Zn=e=>k.Extension.create({name:"dropFile",addProseMirrorPlugins(){return[new y.Plugin({props:{handleDOMEvents:{drop(t,o){if(!e.isEditable)return;let i=null;for(const n of et)if(o.dataTransfer.types.includes(n)){i=n;break}return i===null?!0:i==="Files"?(Bo(o,e),!0):!1}}}})]}});async function Jn(e,t){const o=t.prosemirrorView,{schema:i}=o.state;if(!e.clipboardData)return!1;const n=e.clipboardData.getData("text/plain");if(!n)return!1;if(!i.nodes.codeBlock)return o.pasteText(n),!0;const a=e.clipboardData.getData("vscode-editor-data"),r=a?JSON.parse(a):void 0,l=r==null?void 0:r.mode;return l?(t._tiptapEditor.view.pasteHTML(`<pre><code class="language-${l}">${n.replace(/\r\n?/g,`
|
|
10
|
-
`)}</code></pre>`),!0):!1}const Yn=e=>k.Extension.create({name:"pasteFromClipboard",addProseMirrorPlugins(){return[new y.Plugin({props:{handleDOMEvents:{paste(t,o){if(o.preventDefault(),!e.isEditable)return;let i;for(const a of et)if(o.clipboardData.types.includes(a)){i=a;break}if(!i)return!0;if(i==="vscode-editor-data")return Jn(o,e),!0;if(i==="Files")return Bo(o,e),!0;let n=o.clipboardData.getData(i);return i==="blocknote/html"?(e._tiptapEditor.view.pasteHTML(n),!0):i==="text/html"?(n=xo(n.trim()).innerHTML,e._tiptapEditor.view.pasteHTML(n),!0):(e._tiptapEditor.view.pasteText(n),!0)}}}})]}});function To(e,t){const o=[];return e.descendants(i=>{var n,a;return i.type.name==="blockContainer"&&((n=i.firstChild)==null?void 0:n.type.name)==="blockGroup"?!0:i.type.name==="columnList"&&i.childCount===1?((a=i.firstChild)==null||a.forEach(r=>{o.push(x(r,t.blockSchema,t.inlineContentSchema,t.styleSchema))}),!1):i.type.isInGroup("bnBlock")?(o.push(x(i,t.blockSchema,t.inlineContentSchema,t.styleSchema)),!1):!0}),o}function Qn(e,t,o){var l;let i=!1;const n=e.state.selection instanceof $.CellSelection;if(!n){const s=e.state.doc.slice(e.state.selection.from,e.state.selection.to,!1).content,u=[];for(let c=0;c<s.childCount;c++)u.push(s.child(c));i=u.find(c=>c.type.isInGroup("bnBlock")||c.type.name==="blockGroup"||c.type.spec.group==="blockContent")===void 0,i&&(t=s)}let a;const r=ae(e.state.schema,o);if(n){((l=t.firstChild)==null?void 0:l.type.name)==="table"&&(t=t.firstChild.content);const s=Oe(t,o.schema.inlineContentSchema,o.schema.styleSchema);a=r.exportInlineContent(s,{})}else if(i){const s=ce(t,o.schema.inlineContentSchema,o.schema.styleSchema);a=r.exportInlineContent(s,{})}else{const s=To(t,o.schema);a=r.exportBlocks(s,{})}return a}function Mo(e,t){"node"in e.state.selection&&e.state.selection.node.type.spec.group==="blockContent"&&t.dispatch(t._tiptapEditor.state.tr.setSelection(new y.NodeSelection(e.state.doc.resolve(e.state.selection.from-1))));const o=dt.__serializeForClipboard(e,e.state.selection.content()).dom.innerHTML,i=e.state.selection.content().content,n=Qn(e,i,t),a=Ce(n);return{clipboardHTML:o,externalHTML:n,markdown:a}}const Lo=(e,t,o)=>{o.preventDefault(),o.clipboardData.clearData();const{clipboardHTML:i,externalHTML:n,markdown:a}=Mo(t,e);o.clipboardData.setData("blocknote/html",i),o.clipboardData.setData("text/html",n),o.clipboardData.setData("text/plain",a)},ea=e=>k.Extension.create({name:"copyToClipboard",addProseMirrorPlugins(){return[new y.Plugin({props:{handleDOMEvents:{copy(t,o){return Lo(e,t,o),!0},cut(t,o){return Lo(e,t,o),t.dispatch(t.state.tr.deleteSelection()),!0},dragstart(t,o){if(!("node"in t.state.selection)||t.state.selection.node.type.spec.group!=="blockContent")return;e.dispatch(e._tiptapEditor.state.tr.setSelection(new y.NodeSelection(t.state.doc.resolve(t.state.selection.from-1)))),o.preventDefault(),o.dataTransfer.clearData();const{clipboardHTML:i,externalHTML:n,markdown:a}=Mo(t,e);return o.dataTransfer.setData("blocknote/html",i),o.dataTransfer.setData("text/html",n),o.dataTransfer.setData("text/plain",a),!0}}}})]}}),ta=k.Extension.create({name:"blockBackgroundColor",addGlobalAttributes(){return[{types:["blockContainer"],attributes:{backgroundColor:{default:E.backgroundColor.default,parseHTML:e=>e.hasAttribute("data-background-color")?e.getAttribute("data-background-color"):E.backgroundColor.default,renderHTML:e=>e.backgroundColor===E.backgroundColor.default?{}:{"data-background-color":e.backgroundColor}}}}]}});class Q{constructor(){p(this,"callbacks",{})}on(t,o){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(o),()=>this.off(t,o)}emit(t,...o){const i=this.callbacks[t];i&&i.forEach(n=>n.apply(this,o))}off(t,o){const i=this.callbacks[t];i&&(o?this.callbacks[t]=i.filter(n=>n!==o):delete this.callbacks[t])}removeAllListeners(){this.callbacks={}}}class Io{constructor(t,o,i,n){p(this,"state");p(this,"emitUpdate");p(this,"mouseDownHandler",()=>{var t;(t=this.state)!=null&&t.show&&(this.state.show=!1,this.emitUpdate())});p(this,"dragstartHandler",()=>{var t;(t=this.state)!=null&&t.show&&(this.state.show=!1,this.emitUpdate())});p(this,"scrollHandler",()=>{var t;if((t=this.state)!=null&&t.show){const o=this.pmView.root.querySelector(`[data-node-type="blockContainer"][data-id="${this.state.block.id}"]`);if(!o)return;this.state.referencePos=o.getBoundingClientRect(),this.emitUpdate()}});p(this,"closeMenu",()=>{var t;(t=this.state)!=null&&t.show&&(this.state.show=!1,this.emitUpdate())});this.editor=t,this.pluginKey=o,this.pmView=i,this.emitUpdate=()=>{if(!this.state)throw new Error("Attempting to update uninitialized file panel");n(this.state)},i.dom.addEventListener("mousedown",this.mouseDownHandler),i.dom.addEventListener("dragstart",this.dragstartHandler),i.root.addEventListener("scroll",this.scrollHandler,!0)}update(t,o){var n,a;const i=this.pluginKey.getState(t.state);if(!((n=this.state)!=null&&n.show)&&i.block&&this.editor.isEditable){const r=this.pmView.root.querySelector(`[data-node-type="blockContainer"][data-id="${i.block.id}"]`);if(!r)return;this.state={show:!0,referencePos:r.getBoundingClientRect(),block:i.block},this.emitUpdate();return}(!t.state.selection.eq(o.selection)||!t.state.doc.eq(o.doc)||!this.editor.isEditable)&&(a=this.state)!=null&&a.show&&(this.state.show=!1,this.emitUpdate())}destroy(){this.pmView.dom.removeEventListener("mousedown",this.mouseDownHandler),this.pmView.dom.removeEventListener("dragstart",this.dragstartHandler),this.pmView.root.removeEventListener("scroll",this.scrollHandler,!0)}}const tt=new y.PluginKey("FilePanelPlugin");class Po extends Q{constructor(o){super();p(this,"view");p(this,"plugin");p(this,"closeMenu",()=>{var o;return(o=this.view)==null?void 0:o.closeMenu()});this.plugin=new y.Plugin({key:tt,view:i=>(this.view=new Io(o,tt,i,n=>{this.emit("update",n)}),this.view),props:{handleKeyDown:(i,n)=>{var a;return n.key==="Escape"&&this.shown?((a=this.view)==null||a.closeMenu(),!0):!1}},state:{init:()=>({block:void 0}),apply:i=>{var a;return{block:(a=i.getMeta(tt))==null?void 0:a.block}}}})}get shown(){var o,i;return((i=(o=this.view)==null?void 0:o.state)==null?void 0:i.show)||!1}onUpdate(o){return this.on("update",o)}}class Ao{constructor(t,o,i){p(this,"state");p(this,"emitUpdate");p(this,"preventHide",!1);p(this,"preventShow",!1);p(this,"shouldShow",({state:t,from:o,to:i,view:n})=>{const{doc:a,selection:r}=t,{empty:l}=r,s=!a.textBetween(o,i).length&&k.isTextSelection(t.selection);return r.$from.parent.type.spec.code||k.isNodeSelection(r)&&r.node.type.spec.code?!1:!(!n.hasFocus()||l||s)});p(this,"blurHandler",t=>{var i;if(this.preventHide){this.preventHide=!1;return}const o=this.pmView.dom.parentElement;t&&t.relatedTarget&&(o===t.relatedTarget||o.contains(t.relatedTarget)||t.relatedTarget.matches(".bn-ui-container, .bn-ui-container *"))||(i=this.state)!=null&&i.show&&(this.state.show=!1,this.emitUpdate())});p(this,"viewMousedownHandler",()=>{this.preventShow=!0});p(this,"viewMouseupHandler",()=>{this.preventShow=!1,setTimeout(()=>this.update(this.pmView))});p(this,"dragHandler",()=>{var t;(t=this.state)!=null&&t.show&&(this.state.show=!1,this.emitUpdate())});p(this,"scrollHandler",()=>{var t;(t=this.state)!=null&&t.show&&(this.state.referencePos=this.getSelectionBoundingBox(),this.emitUpdate())});p(this,"closeMenu",()=>{var t;(t=this.state)!=null&&t.show&&(this.state.show=!1,this.emitUpdate())});this.editor=t,this.pmView=o,this.emitUpdate=()=>{if(!this.state)throw new Error("Attempting to update uninitialized formatting toolbar");i(this.state)},o.dom.addEventListener("mousedown",this.viewMousedownHandler),o.dom.addEventListener("mouseup",this.viewMouseupHandler),o.dom.addEventListener("dragstart",this.dragHandler),o.dom.addEventListener("dragover",this.dragHandler),o.dom.addEventListener("blur",this.blurHandler),o.root.addEventListener("scroll",this.scrollHandler,!0)}update(t,o){var m,b;const{state:i,composing:n}=t,{doc:a,selection:r}=i,l=o&&o.doc.eq(a)&&o.selection.eq(r);if(n||l)return;const{ranges:s}=r,u=Math.min(...s.map(f=>f.$from.pos)),c=Math.max(...s.map(f=>f.$to.pos)),h=(m=this.shouldShow)==null?void 0:m.call(this,{view:t,state:i,from:u,to:c});if(!this.preventShow&&(h||this.preventHide)){this.state={show:!0,referencePos:this.getSelectionBoundingBox()},this.emitUpdate();return}if((b=this.state)!=null&&b.show&&!this.preventHide&&(!h||this.preventShow||!this.editor.isEditable)){this.state.show=!1,this.emitUpdate();return}}destroy(){this.pmView.dom.removeEventListener("mousedown",this.viewMousedownHandler),this.pmView.dom.removeEventListener("mouseup",this.viewMouseupHandler),this.pmView.dom.removeEventListener("dragstart",this.dragHandler),this.pmView.dom.removeEventListener("dragover",this.dragHandler),this.pmView.dom.removeEventListener("blur",this.blurHandler),this.pmView.root.removeEventListener("scroll",this.scrollHandler,!0)}getSelectionBoundingBox(){const{state:t}=this.pmView,{selection:o}=t,{ranges:i}=o,n=Math.min(...i.map(r=>r.$from.pos)),a=Math.max(...i.map(r=>r.$to.pos));if(k.isNodeSelection(o)){const r=this.pmView.nodeDOM(n);if(r)return r.getBoundingClientRect()}return k.posToDOMRect(this.pmView,n,a)}}const No=new y.PluginKey("FormattingToolbarPlugin");class jo extends Q{constructor(o){super();p(this,"view");p(this,"plugin");p(this,"closeMenu",()=>this.view.closeMenu());this.plugin=new y.Plugin({key:No,view:i=>(this.view=new Ao(o,i,n=>{this.emit("update",n)}),this.view),props:{handleKeyDown:(i,n)=>n.key==="Escape"&&this.shown?(this.view.closeMenu(),!0):!1}})}get shown(){var o,i;return((i=(o=this.view)==null?void 0:o.state)==null?void 0:i.show)||!1}onUpdate(o){return this.on("update",o)}}const Do=(e,t)=>{const o=e.resolve(t);if(o.depth<=1)return;const i=o.posAtIndex(o.index(o.depth-1),o.depth-1);return J(e.resolve(i))},ot=(e,t)=>{const o=e.resolve(t),i=o.index();if(i===0)return;const n=o.posAtIndex(i-1);return J(e.resolve(n))},Ho=(e,t)=>{for(;t.childContainer;){const o=t.childContainer.node,i=e.resolve(t.childContainer.beforePos+1).posAtIndex(o.childCount-1);t=J(e.resolve(i))}return t},oa=(e,t)=>e.isBlockContainer&&e.blockContent.node.type.spec.content==="inline*"&&e.blockContent.node.childCount>0&&t.isBlockContainer&&t.blockContent.node.type.spec.content==="inline*",ia=(e,t,o,i)=>{if(!i.isBlockContainer)throw new Error(`Attempted to merge block at position ${i.bnBlock.beforePos} into previous block at position ${o.bnBlock.beforePos}, but next block is not a block container`);if(i.childContainer){const n=e.doc.resolve(i.childContainer.beforePos+1),a=e.doc.resolve(i.childContainer.afterPos-1),r=n.blockRange(a);if(t){const l=e.doc.resolve(i.bnBlock.beforePos);e.tr.lift(r,l.depth)}}if(t){if(!o.isBlockContainer)throw new Error(`Attempted to merge block at position ${i.bnBlock.beforePos} into previous block at position ${o.bnBlock.beforePos}, but previous block is not a block container`);t(e.tr.delete(o.blockContent.afterPos-1,i.blockContent.beforePos+1))}return!0},Uo=e=>({state:t,dispatch:o})=>{const i=t.doc.resolve(e),n=J(i),a=ot(t.doc,n.bnBlock.beforePos);if(!a)return!1;const r=Ho(t.doc,a);return oa(r,n)?ia(t,o,r,n):!1},na=k.Extension.create({priority:50,addKeyboardShortcuts(){return{Backspace:()=>this.editor.commands.first(({chain:i,commands:n})=>[()=>n.deleteSelection(),()=>n.undoInputRule(),()=>n.command(({state:a})=>{const r=C(a);if(!r.isBlockContainer)return!1;const l=a.selection.from===r.blockContent.beforePos+1,s=r.blockContent.node.type.name==="paragraph";return l&&!s?n.command(B(this.options.editor,r.bnBlock.beforePos,{type:"paragraph",props:{}})):!1}),()=>n.command(({state:a})=>{const r=C(a);if(!r.isBlockContainer)return!1;const{blockContent:l}=r;return a.selection.from===l.beforePos+1?n.liftListItem("blockContainer"):!1}),()=>n.command(({state:a})=>{const r=C(a);if(!r.isBlockContainer)return!1;const{bnBlock:l,blockContent:s}=r,u=a.selection.from===s.beforePos+1,c=a.selection.empty,h=l.beforePos;return u&&c?i().command(Uo(h)).scrollIntoView().run():!1}),()=>n.command(({state:a,dispatch:r})=>{const l=C(a);if(!l.isBlockContainer||!(a.selection.from===l.blockContent.beforePos+1)||ot(a.doc,l.bnBlock.beforePos))return!1;const c=Do(a.doc,l.bnBlock.beforePos);if((c==null?void 0:c.blockNoteType)!=="column")return!1;const h=c,m=Do(a.doc,h.bnBlock.beforePos);if((m==null?void 0:m.blockNoteType)!=="columnList")throw new Error("parent of column is not a column list");const b=h.childContainer.node.childCount===1,f=b&&m.childContainer.node.childCount===2,g=m.childContainer.node.firstChild===h.bnBlock.node;if(r){const _=a.doc.slice(l.bnBlock.beforePos,l.bnBlock.afterPos,!1);if(f)if(g){a.tr.step(new be.ReplaceAroundStep(m.bnBlock.beforePos,m.bnBlock.afterPos,h.bnBlock.afterPos+1,m.bnBlock.afterPos-2,_,_.size,!1));const w=a.tr.doc.resolve(h.bnBlock.beforePos);a.tr.setSelection(y.TextSelection.between(w,w))}else{a.tr.step(new be.ReplaceAroundStep(m.bnBlock.beforePos,m.bnBlock.afterPos,m.bnBlock.beforePos+2,h.bnBlock.beforePos-1,_,0,!1));const w=a.tr.doc.resolve(a.tr.mapping.map(h.bnBlock.beforePos-1));a.tr.setSelection(y.TextSelection.between(w,w))}else if(b)if(g){a.tr.delete(h.bnBlock.beforePos,h.bnBlock.afterPos),a.tr.insert(m.bnBlock.beforePos,_.content);const w=a.tr.doc.resolve(m.bnBlock.beforePos);a.tr.setSelection(y.TextSelection.between(w,w))}else a.tr.delete(h.bnBlock.beforePos-1,h.bnBlock.beforePos+1);else{a.tr.delete(l.bnBlock.beforePos,l.bnBlock.afterPos),g?a.tr.insert(m.bnBlock.beforePos-1,_.content):a.tr.insert(h.bnBlock.beforePos-1,_.content);const w=a.tr.doc.resolve(h.bnBlock.beforePos-1);a.tr.setSelection(y.TextSelection.between(w,w))}}return!0}),()=>n.command(({state:a})=>{const r=C(a);if(!r.isBlockContainer)throw new Error("todo");const l=a.selection.from===r.blockContent.beforePos+1,s=a.selection.empty,u=ot(a.doc,r.bnBlock.beforePos);if(u&&l&&s){const c=Ho(a.doc,u);if(!c.isBlockContainer)throw new Error("todo");if(c.blockContent.node.type.spec.content===""||c.blockContent.node.type.spec.content==="inline*"&&c.blockContent.node.childCount===0)return i().cut({from:r.bnBlock.beforePos,to:r.bnBlock.afterPos},c.bnBlock.afterPos).deleteRange({from:c.bnBlock.beforePos,to:c.bnBlock.afterPos}).run()}return!1})]),Delete:()=>this.editor.commands.first(({commands:i})=>[()=>i.deleteSelection(),()=>i.command(({state:n})=>{const a=C(n);if(!a.isBlockContainer)return!1;const{bnBlock:r,blockContent:l,childContainer:s}=a,{depth:u}=n.doc.resolve(r.beforePos),c=r.afterPos===n.doc.nodeSize-3,h=n.selection.from===l.afterPos-1,m=n.selection.empty;if(!c&&h&&m&&!(s!==void 0)){let f=u,g=r.afterPos+1,_=n.doc.resolve(g).depth;for(;_<f;)f=_,g+=2,_=n.doc.resolve(g).depth;return i.command(Uo(g-1))}return!1})]),Enter:()=>this.editor.commands.first(({commands:i})=>[()=>i.command(({state:n})=>{const a=C(n);if(!a.isBlockContainer)return!1;const{bnBlock:r,blockContent:l}=a,{depth:s}=n.doc.resolve(r.beforePos),u=n.selection.$anchor.parentOffset===0,c=n.selection.anchor===n.selection.head,h=l.node.childCount===0,m=s>1;return u&&c&&h&&m?i.liftListItem("blockContainer"):!1}),()=>i.command(({state:n,dispatch:a})=>{const r=C(n);if(!r.isBlockContainer)return!1;const{bnBlock:l,blockContent:s}=r,u=n.selection.$anchor.parentOffset===0,c=n.selection.anchor===n.selection.head,h=s.node.childCount===0;if(u&&c&&h){const m=l.afterPos,b=m+2;if(a){const f=n.schema.nodes.blockContainer.createAndFill();n.tr.insert(m,f).scrollIntoView(),n.tr.setSelection(new y.TextSelection(n.doc.resolve(b)))}return!0}return!1}),()=>i.command(({state:n,chain:a})=>{const r=C(n);if(!r.isBlockContainer)return!1;const{blockContent:l}=r,s=n.selection.$anchor.parentOffset===0;return l.node.childCount===0?!1:(a().deleteSelection().command(ho(n.selection.from,s,s)).run(),!0)})]),Tab:()=>{var i,n,a;return(i=this.options.editor.formattingToolbar)!=null&&i.shown||(n=this.options.editor.linkToolbar)!=null&&n.shown||(a=this.options.editor.filePanel)!=null&&a.shown?!1:yo(this.options.editor)},"Shift-Tab":()=>{var i,n,a;return(i=this.options.editor.formattingToolbar)!=null&&i.shown||(n=this.options.editor.linkToolbar)!=null&&n.shown||(a=this.options.editor.filePanel)!=null&&a.shown?!1:(this.editor.commands.liftListItem("blockContainer"),!0)},"Shift-Mod-ArrowUp":()=>(this.options.editor.moveBlockUp(),!0),"Shift-Mod-ArrowDown":()=>(this.options.editor.moveBlockDown(),!0)}}});class aa{constructor(t,o,i){p(this,"state");p(this,"emitUpdate");p(this,"menuUpdateTimer");p(this,"startMenuUpdateTimer");p(this,"stopMenuUpdateTimer");p(this,"mouseHoveredLinkMark");p(this,"mouseHoveredLinkMarkRange");p(this,"keyboardHoveredLinkMark");p(this,"keyboardHoveredLinkMarkRange");p(this,"linkMark");p(this,"linkMarkRange");p(this,"mouseOverHandler",t=>{if(this.mouseHoveredLinkMark=void 0,this.mouseHoveredLinkMarkRange=void 0,this.stopMenuUpdateTimer(),t.target instanceof HTMLAnchorElement&&t.target.nodeName==="A"){const o=t.target,i=this.pmView.posAtDOM(o,0)+1,n=this.pmView.state.doc.resolve(i),a=n.marks();for(const r of a)if(r.type.name===this.pmView.state.schema.mark("link").type.name){this.mouseHoveredLinkMark=r,this.mouseHoveredLinkMarkRange=k.getMarkRange(n,r.type,r.attrs)||void 0;break}}return this.startMenuUpdateTimer(),!1});p(this,"clickHandler",t=>{var i;const o=this.pmView.dom.parentElement;this.linkMark&&t&&t.target&&!(o===t.target||o.contains(t.target))&&(i=this.state)!=null&&i.show&&(this.state.show=!1,this.emitUpdate())});p(this,"scrollHandler",()=>{var t;this.linkMark!==void 0&&(t=this.state)!=null&&t.show&&(this.state.referencePos=k.posToDOMRect(this.pmView,this.linkMarkRange.from,this.linkMarkRange.to),this.emitUpdate())});p(this,"closeMenu",()=>{var t;(t=this.state)!=null&&t.show&&(this.state.show=!1,this.emitUpdate())});this.editor=t,this.pmView=o,this.emitUpdate=()=>{if(!this.state)throw new Error("Attempting to update uninitialized link toolbar");i(this.state)},this.startMenuUpdateTimer=()=>{this.menuUpdateTimer=setTimeout(()=>{this.update()},250)},this.stopMenuUpdateTimer=()=>(this.menuUpdateTimer&&(clearTimeout(this.menuUpdateTimer),this.menuUpdateTimer=void 0),!1),this.pmView.dom.addEventListener("mouseover",this.mouseOverHandler),this.pmView.root.addEventListener("click",this.clickHandler,!0),this.pmView.root.addEventListener("scroll",this.scrollHandler,!0)}editLink(t,o){var n;const i=this.pmView.state.tr.insertText(o,this.linkMarkRange.from,this.linkMarkRange.to);i.addMark(this.linkMarkRange.from,this.linkMarkRange.from+o.length,this.pmView.state.schema.mark("link",{href:t})),this.editor.dispatch(i),this.pmView.focus(),(n=this.state)!=null&&n.show&&(this.state.show=!1,this.emitUpdate())}deleteLink(){var t;this.editor.dispatch(this.pmView.state.tr.removeMark(this.linkMarkRange.from,this.linkMarkRange.to,this.linkMark.type).setMeta("preventAutolink",!0)),this.pmView.focus(),(t=this.state)!=null&&t.show&&(this.state.show=!1,this.emitUpdate())}update(){var o;if(!this.pmView.hasFocus())return;const t=this.linkMark;if(this.linkMark=void 0,this.linkMarkRange=void 0,this.keyboardHoveredLinkMark=void 0,this.keyboardHoveredLinkMarkRange=void 0,this.pmView.state.selection.empty){const i=this.pmView.state.selection.$from.marks();for(const n of i)if(n.type.name===this.pmView.state.schema.mark("link").type.name){this.keyboardHoveredLinkMark=n,this.keyboardHoveredLinkMarkRange=k.getMarkRange(this.pmView.state.selection.$from,n.type,n.attrs)||void 0;break}}if(this.mouseHoveredLinkMark&&(this.linkMark=this.mouseHoveredLinkMark,this.linkMarkRange=this.mouseHoveredLinkMarkRange),this.keyboardHoveredLinkMark&&(this.linkMark=this.keyboardHoveredLinkMark,this.linkMarkRange=this.keyboardHoveredLinkMarkRange),this.linkMark&&this.editor.isEditable){this.state={show:!0,referencePos:k.posToDOMRect(this.pmView,this.linkMarkRange.from,this.linkMarkRange.to),url:this.linkMark.attrs.href,text:this.pmView.state.doc.textBetween(this.linkMarkRange.from,this.linkMarkRange.to)},this.emitUpdate();return}if((o=this.state)!=null&&o.show&&t&&(!this.linkMark||!this.editor.isEditable)){this.state.show=!1,this.emitUpdate();return}}destroy(){this.pmView.dom.removeEventListener("mouseover",this.mouseOverHandler),this.pmView.root.removeEventListener("scroll",this.scrollHandler,!0),this.pmView.root.removeEventListener("click",this.clickHandler,!0)}}const Oo=new y.PluginKey("LinkToolbarPlugin");class Ro extends Q{constructor(o){super();p(this,"view");p(this,"plugin");p(this,"editLink",(o,i)=>{this.view.editLink(o,i)});p(this,"deleteLink",()=>{this.view.deleteLink()});p(this,"startHideTimer",()=>{this.view.startMenuUpdateTimer()});p(this,"stopHideTimer",()=>{this.view.stopMenuUpdateTimer()});p(this,"closeMenu",()=>this.view.closeMenu());this.plugin=new y.Plugin({key:Oo,view:i=>(this.view=new aa(o,i,n=>{this.emit("update",n)}),this.view),props:{handleKeyDown:(i,n)=>n.key==="Escape"&&this.shown?(this.view.closeMenu(),!0):!1}})}onUpdate(o){return this.on("update",o)}get shown(){var o,i;return((i=(o=this.view)==null?void 0:o.state)==null?void 0:i.show)||!1}}const ra=new y.PluginKey("node-selection-keyboard");class la{constructor(){p(this,"plugin");this.plugin=new y.Plugin({key:ra,props:{handleKeyDown:(t,o)=>{if("node"in t.state.selection){if(o.ctrlKey||o.metaKey)return!1;if(o.key.length===1)return o.preventDefault(),!0;if(o.key==="Enter"&&!o.shiftKey&&!o.altKey&&!o.ctrlKey&&!o.metaKey){const i=t.state.tr;return t.dispatch(i.insert(t.state.tr.selection.$to.after(),t.state.schema.nodes.paragraph.createChecked()).setSelection(new y.TextSelection(i.doc.resolve(t.state.tr.selection.$to.after()+1)))),!0}}return!1}}})}}const sa=new y.PluginKey("blocknote-placeholder");class da{constructor(t,o){p(this,"plugin");this.plugin=new y.Plugin({key:sa,view:()=>{const i=document.createElement("style"),n=t._tiptapEditor.options.injectNonce;n&&i.setAttribute("nonce",n),t._tiptapEditor.view.root instanceof ShadowRoot?t._tiptapEditor.view.root.append(i):t._tiptapEditor.view.root.head.appendChild(i);const a=i.sheet,r=(s="")=>`.bn-block-content${s} .bn-inline-content:has(> .ProseMirror-trailingBreak:only-child):before`,l=(s,u=!0)=>{const c=u?"[data-is-empty-and-focused]":"";if(s==="default")return r(c);const h=`[data-content-type="${s}"]`;return r(c+h)};for(const[s,u]of Object.entries(o)){const c=s==="default";a.insertRule(`${l(s,c)}{ content: ${JSON.stringify(u)}; }`),c||a.insertRule(`${l(s,!0)}{ content: ${JSON.stringify(u)}; }`)}return{destroy:()=>{t._tiptapEditor.view.root instanceof ShadowRoot?t._tiptapEditor.view.root.removeChild(i):t._tiptapEditor.view.root.head.removeChild(i)}}},props:{decorations:i=>{const{doc:n,selection:a}=i;if(!t.isEditable||!a.empty||a.$from.parent.type.spec.code)return;const r=a.$anchor,l=r.parent;if(l.content.size>0)return null;const s=r.before(),u=M.Decoration.node(s,s+l.nodeSize,{"data-is-empty-and-focused":"true"});return M.DecorationSet.create(n,[u])}}})}}const zo=new y.PluginKey("previous-blocks"),ca={index:"index",level:"level",type:"type",depth:"depth","depth-change":"depth-change"};class ua{constructor(){p(this,"plugin");let t;this.plugin=new y.Plugin({key:zo,view(o){return{update:async(i,n)=>{var a;((a=this.key)==null?void 0:a.getState(i.state).updatedBlocks.size)>0&&(t=setTimeout(()=>{i.dispatch(i.state.tr.setMeta(zo,{clearUpdate:!0}))},0))},destroy:()=>{t&&clearTimeout(t)}}},state:{init(){return{prevTransactionOldBlockAttrs:{},currentTransactionOldBlockAttrs:{},updatedBlocks:new Set}},apply(o,i,n,a){if(i.currentTransactionOldBlockAttrs={},i.updatedBlocks.clear(),!o.docChanged||n.doc.eq(a.doc))return i;const r={},l=k.findChildren(n.doc,c=>c.attrs.id),s=new Map(l.map(c=>[c.node.attrs.id,c])),u=k.findChildren(a.doc,c=>c.attrs.id);for(const c of u){const h=s.get(c.node.attrs.id),m=h==null?void 0:h.node.firstChild,b=c.node.firstChild;if(h&&m&&b){const f={index:b.attrs.index,level:b.attrs.level,type:b.type.name,depth:a.doc.resolve(c.pos).depth};let g={index:m.attrs.index,level:m.attrs.level,type:m.type.name,depth:n.doc.resolve(h.pos).depth};r[c.node.attrs.id]=g,o.getMeta("numberedListIndexing")&&(c.node.attrs.id in i.prevTransactionOldBlockAttrs&&(g=i.prevTransactionOldBlockAttrs[c.node.attrs.id]),f.type==="numberedListItem"&&(g.index=f.index)),i.currentTransactionOldBlockAttrs[c.node.attrs.id]=g,JSON.stringify(g)!==JSON.stringify(f)&&(g["depth-change"]=g.depth-f.depth,i.updatedBlocks.add(c.node.attrs.id))}}return i.prevTransactionOldBlockAttrs=r,i}},props:{decorations(o){const i=this.getState(o);if(i.updatedBlocks.size===0)return;const n=[];return o.doc.descendants((a,r)=>{if(!a.attrs.id||!i.updatedBlocks.has(a.attrs.id))return;const l=i.currentTransactionOldBlockAttrs[a.attrs.id],s={};for(const[c,h]of Object.entries(l))s["data-prev-"+ca[c]]=h||"none";const u=M.Decoration.node(r,r+a.nodeSize,{...s});n.push(u)}),M.DecorationSet.create(o.doc,n)}}})}}function Vo(e,t){var o,i;for(;e&&e.parentElement&&e.parentElement!==t.dom&&((o=e.getAttribute)==null?void 0:o.call(e,"data-node-type"))!=="blockContainer";)e=e.parentElement;if(((i=e.getAttribute)==null?void 0:i.call(e,"data-node-type"))==="blockContainer")return{node:e,id:e.getAttribute("data-id")}}class ee extends y.Selection{constructor(o,i){super(o,i);p(this,"nodes");const n=o.node();this.nodes=[],o.doc.nodesBetween(o.pos,i.pos,(a,r,l)=>{if(l!==null&&l.eq(n))return this.nodes.push(a),!1})}static create(o,i,n=i){return new ee(o.resolve(i),o.resolve(n))}content(){return new v.Slice(v.Fragment.from(this.nodes),0,0)}eq(o){if(!(o instanceof ee)||this.nodes.length!==o.nodes.length||this.from!==o.from||this.to!==o.to)return!1;for(let i=0;i<this.nodes.length;i++)if(!this.nodes[i].eq(o.nodes[i]))return!1;return!0}map(o,i){const n=i.mapResult(this.from),a=i.mapResult(this.to);return a.deleted?y.Selection.near(o.resolve(n.pos)):n.deleted?y.Selection.near(o.resolve(a.pos)):new ee(o.resolve(n.pos),o.resolve(a.pos))}toJSON(){return{type:"node",anchor:this.anchor,head:this.head}}}let H;function pa(e,t){let o,i;const n=t.resolve(e.from).node().type.spec.group==="blockContent",a=t.resolve(e.to).node().type.spec.group==="blockContent",r=Math.min(e.$anchor.depth,e.$head.depth);if(n&&a){const l=e.$from.start(r-1),s=e.$to.end(r-1);o=t.resolve(l-1).pos,i=t.resolve(s+1).pos}else o=e.from,i=e.to;return{from:o,to:i}}function Fo(e,t,o=t){t===o&&(o+=e.state.doc.resolve(t+1).node().nodeSize);const i=e.domAtPos(t).node.cloneNode(!0),n=e.domAtPos(t).node,a=(c,h)=>Array.prototype.indexOf.call(c.children,h),r=a(n,e.domAtPos(t+1).node.parentElement),l=a(n,e.domAtPos(o-1).node.parentElement);for(let c=n.childElementCount-1;c>=0;c--)(c>l||c<r)&&i.removeChild(i.children[c]);Go(e.root),H=i;const u=e.dom.className.split(" ").filter(c=>c!=="ProseMirror"&&c!=="bn-root"&&c!=="bn-editor").join(" ");H.className=H.className+" bn-drag-preview "+u,e.root instanceof ShadowRoot?e.root.appendChild(H):e.root.body.appendChild(H)}function Go(e){H!==void 0&&(e instanceof ShadowRoot?e.removeChild(H):e.body.removeChild(H),H=void 0)}function ha(e,t,o){if(!e.dataTransfer)return;const i=o.prosemirrorView,n=q(t.id,i.state.doc).posBeforeNode;if(n!=null){const a=i.state.selection,r=i.state.doc,{from:l,to:s}=pa(a,r),u=l<=n&&n<s,c=a.$anchor.node()!==a.$head.node()||a instanceof ee;u&&c?(i.dispatch(i.state.tr.setSelection(ee.create(r,l,s))),Fo(i,l,s)):(i.dispatch(i.state.tr.setSelection(y.NodeSelection.create(i.state.doc,n))),Fo(i,n));const h=i.state.selection.content(),m=o.pmSchema,b=dt.__serializeForClipboard(i,h).dom.innerHTML,f=ae(m,o),g=To(h.content,o.schema),_=f.exportBlocks(g,{}),w=Ce(_);e.dataTransfer.clearData(),e.dataTransfer.setData("blocknote/html",b),e.dataTransfer.setData("text/html",_),e.dataTransfer.setData("text/plain",w),e.dataTransfer.effectAllowed="move",e.dataTransfer.setDragImage(H,0,0),i.dragging={slice:h,move:!0}}}const me=.1;function it(e,t,o=!0){const i=e.root.elementsFromPoint(t.left,t.top);for(const n of i)if(e.dom.contains(n))return o&&n.closest("[data-node-type=columnList]")?it(e,{left:t.left+50,top:t.top},!1):Vo(n,e)}function ma(e,t){if(!t.dom.firstChild)return;const o=t.dom.firstChild.getBoundingClientRect(),i={left:e.x,top:e.y},n=i.left<o.left,a=i.left>o.right;n&&(i.left=o.left+10),a&&(i.left=o.right-10);let r=it(t,i);if(!a&&r){const l=r.node.getBoundingClientRect();i.left=l.right-10,r=it(t,i,!1)}return r}class Wo{constructor(t,o,i){p(this,"state");p(this,"emitUpdate");p(this,"mousePos");p(this,"hoveredBlock");p(this,"menuFrozen",!1);p(this,"updateState",t=>{this.state=t,this.emitUpdate(this.state)});p(this,"updateStateFromMousePos",()=>{var i,n,a,r;if(this.menuFrozen||!this.mousePos)return;const t=ma(this.mousePos,this.pmView);if(!t||!this.editor.isEditable){(i=this.state)!=null&&i.show&&(this.state.show=!1,this.updateState(this.state));return}if((n=this.state)!=null&&n.show&&((a=this.hoveredBlock)!=null&&a.hasAttribute("data-id"))&&((r=this.hoveredBlock)==null?void 0:r.getAttribute("data-id"))===t.id)return;this.hoveredBlock=t.node;const o=t.node.firstChild;if(o&&this.editor.isEditable){const l=o.getBoundingClientRect(),s=t.node.closest("[data-node-type=column]");this.updateState({show:!0,referencePos:new DOMRect(s?s.firstElementChild.getBoundingClientRect().x:this.pmView.dom.firstChild.getBoundingClientRect().x,l.y,l.width,l.height),block:this.editor.getBlock(this.hoveredBlock.getAttribute("data-id"))})}});p(this,"onDrop",t=>{var i;if(this.editor._tiptapEditor.commands.blur(),t.synthetic||!((i=t.dataTransfer)!=null&&i.types.includes("blocknote/html")))return;const o=this.pmView.posAtCoords({left:t.clientX,top:t.clientY});if(!o||o.inside===-1){const n=this.createSyntheticEvent(t);this.pmView.dom.dispatchEvent(n)}});p(this,"onDragOver",t=>{var i;if(t.synthetic||!((i=t.dataTransfer)!=null&&i.types.includes("blocknote/html")))return;const o=this.pmView.posAtCoords({left:t.clientX,top:t.clientY});if(!o||o.inside===-1&&this.pmView.dom.firstChild){const n=this.createSyntheticEvent(t);this.pmView.dom.dispatchEvent(n)}});p(this,"onKeyDown",t=>{var o;(o=this.state)!=null&&o.show&&this.editor.isFocused()&&(this.state.show=!1,this.emitUpdate(this.state))});p(this,"onMouseMove",t=>{var a;if(this.menuFrozen)return;this.mousePos={x:t.clientX,y:t.clientY};const o=this.pmView.dom.getBoundingClientRect(),i=this.mousePos.x>o.left&&this.mousePos.x<o.right&&this.mousePos.y>o.top&&this.mousePos.y<o.bottom,n=this.pmView.dom.parentElement;if(i&&t&&t.target&&!(n===t.target||n.contains(t.target))){(a=this.state)!=null&&a.show&&(this.state.show=!1,this.emitUpdate(this.state));return}this.updateStateFromMousePos()});this.editor=t,this.pmView=o,this.emitUpdate=()=>{if(!this.state)throw new Error("Attempting to update uninitialized side menu");i(this.state)},this.pmView.root.addEventListener("drop",this.onDrop,!0),this.pmView.root.addEventListener("dragover",this.onDragOver),we(),this.pmView.root.addEventListener("mousemove",this.onMouseMove,!0),this.pmView.root.addEventListener("keydown",this.onKeyDown,!0)}createSyntheticEvent(t){const o=new Event(t.type,t),i=this.pmView.dom.firstChild.getBoundingClientRect();return o.clientX=t.clientX,o.clientY=t.clientY,t.clientX<i.left&&t.clientX>i.left-i.width*me?o.clientX=i.left+i.width*me/2:t.clientX>i.right&&t.clientX<i.right+i.width*me?o.clientX=i.right-i.width*me/2:(t.clientX<i.left||t.clientX>i.right)&&(o.clientX=i.left+me*i.width*2),o.clientY=Math.min(Math.max(t.clientY,i.top),i.top+i.height),o.dataTransfer=t.dataTransfer,o.preventDefault=()=>t.preventDefault(),o.synthetic=!0,o}update(t,o){var n;!o.doc.eq(this.pmView.state.doc)&&((n=this.state)!=null&&n.show)&&this.updateStateFromMousePos()}destroy(){var t;(t=this.state)!=null&&t.show&&(this.state.show=!1,this.emitUpdate(this.state)),this.pmView.root.removeEventListener("mousemove",this.onMouseMove,!0),this.pmView.root.removeEventListener("dragover",this.onDragOver),this.pmView.root.removeEventListener("drop",this.onDrop,!0),this.pmView.root.removeEventListener("keydown",this.onKeyDown,!0)}}const Ko=new y.PluginKey("SideMenuPlugin");class qo extends Q{constructor(o){super();p(this,"view");p(this,"plugin");p(this,"blockDragStart",(o,i)=>{ha(o,i,this.editor)});p(this,"blockDragEnd",()=>Go(this.editor.prosemirrorView.root));p(this,"freezeMenu",()=>{this.view.menuFrozen=!0,this.view.state.show=!0,this.view.emitUpdate(this.view.state)});p(this,"unfreezeMenu",()=>{this.view.menuFrozen=!1,this.view.state.show=!1,this.view.emitUpdate(this.view.state)});this.editor=o,this.plugin=new y.Plugin({key:Ko,view:i=>(this.view=new Wo(o,i,n=>{this.emit("update",n)}),this.view)})}onUpdate(o){return this.on("update",o)}}const fa=k.findParentNode(e=>e.type.name==="blockContainer");class ga{constructor(t,o){p(this,"state");p(this,"emitUpdate");p(this,"rootEl");p(this,"pluginState");p(this,"handleScroll",()=>{var t,o;if((t=this.state)!=null&&t.show){const i=(o=this.rootEl)==null?void 0:o.querySelector(`[data-decoration-id="${this.pluginState.decorationId}"]`);if(!i)return;this.state.referencePos=i.getBoundingClientRect(),this.emitUpdate(this.pluginState.triggerCharacter)}});p(this,"closeMenu",()=>{this.editor.dispatch(this.editor._tiptapEditor.view.state.tr.setMeta(te,null))});p(this,"clearQuery",()=>{this.pluginState!==void 0&&this.editor._tiptapEditor.chain().focus().deleteRange({from:this.pluginState.queryStartPos-(this.pluginState.deleteTriggerCharacter?this.pluginState.triggerCharacter.length:0),to:this.editor._tiptapEditor.state.selection.from}).run()});this.editor=t,this.pluginState=void 0,this.emitUpdate=i=>{var n;if(!this.state)throw new Error("Attempting to update uninitialized suggestions menu");o(i,{...this.state,ignoreQueryLength:(n=this.pluginState)==null?void 0:n.ignoreQueryLength})},this.rootEl=this.editor._tiptapEditor.view.root,this.rootEl.addEventListener("scroll",this.handleScroll,!0)}update(t,o){var u;const i=te.getState(o),n=te.getState(t.state),a=i===void 0&&n!==void 0,r=i!==void 0&&n===void 0;if(!a&&!(i!==void 0&&n!==void 0)&&!r)return;if(this.pluginState=r?i:n,r||!this.editor.isEditable){this.state.show=!1,this.emitUpdate(this.pluginState.triggerCharacter);return}const s=(u=this.rootEl)==null?void 0:u.querySelector(`[data-decoration-id="${this.pluginState.decorationId}"]`);this.editor.isEditable&&s&&(this.state={show:!0,referencePos:s.getBoundingClientRect(),query:this.pluginState.query},this.emitUpdate(this.pluginState.triggerCharacter))}destroy(){var t;(t=this.rootEl)==null||t.removeEventListener("scroll",this.handleScroll,!0)}}const te=new y.PluginKey("SuggestionMenuPlugin");class $o extends Q{constructor(o){super();p(this,"view");p(this,"plugin");p(this,"triggerCharacters",[]);p(this,"addTriggerCharacter",o=>{this.triggerCharacters.push(o)});p(this,"removeTriggerCharacter",o=>{this.triggerCharacters=this.triggerCharacters.filter(i=>i!==o)});p(this,"closeMenu",()=>this.view.closeMenu());p(this,"clearQuery",()=>this.view.clearQuery());const i=this.triggerCharacters;this.plugin=new y.Plugin({key:te,view:()=>(this.view=new ga(o,(n,a)=>{this.emit(`update ${n}`,a)}),this.view),state:{init(){},apply(n,a,r,l){if(n.getMeta("orderedListIndexing")!==void 0||n.selection.$from.parent.type.spec.code)return a;const s=n.getMeta(te);if(typeof s=="object"&&s!==null&&a===void 0)return{triggerCharacter:s.triggerCharacter,deleteTriggerCharacter:s.deleteTriggerCharacter!==!1,queryStartPos:l.selection.from,query:"",decorationId:`id_${Math.floor(Math.random()*4294967295)}`,ignoreQueryLength:s==null?void 0:s.ignoreQueryLength};if(a===void 0)return a;if(l.selection.from!==l.selection.to||s===null||n.getMeta("focus")||n.getMeta("blur")||n.getMeta("pointer")||a.triggerCharacter!==void 0&&l.selection.from<a.queryStartPos)return;const u={...a};return u.query=l.doc.textBetween(a.queryStartPos,l.selection.from),u}},props:{handleTextInput(n,a,r,l){const s=this.getState(n.state);return i.includes(l)&&s===void 0?(n.dispatch(n.state.tr.insertText(l).scrollIntoView().setMeta(te,{triggerCharacter:l})),!0):!1},decorations(n){const a=this.getState(n);if(a===void 0)return null;if(!a.deleteTriggerCharacter){const r=fa(n.selection);if(r)return M.DecorationSet.create(n.doc,[M.Decoration.node(r.pos,r.pos+r.node.nodeSize,{nodeName:"span",class:"bn-suggestion-decorator","data-decoration-id":a.decorationId})])}return M.DecorationSet.create(n.doc,[M.Decoration.inline(a.queryStartPos-a.triggerCharacter.length,a.queryStartPos,{nodeName:"span",class:"bn-suggestion-decorator","data-decoration-id":a.decorationId})])}}})}onUpdate(o,i){return this.triggerCharacters.includes(o)||this.addTriggerCharacter(o),this.on(`update ${o}`,i)}get shown(){var o,i;return((i=(o=this.view)==null?void 0:o.state)==null?void 0:i.show)||!1}}function ba(e,t){e.suggestionMenus.addTriggerCharacter(t)}let I;function Xo(e){I||(I=document.createElement("div"),I.innerHTML="_",I.style.opacity="0",I.style.height="1px",I.style.width="1px",e instanceof Document?e.body.appendChild(I):e.appendChild(I))}function ka(e){I&&(e instanceof Document?e.body.removeChild(I):e.removeChild(I),I=void 0)}function Ee(e){return Array.prototype.indexOf.call(e.parentElement.childNodes,e)}function _a(e){let t=e;for(;t&&t.nodeName!=="TD"&&t.nodeName!=="TH"&&!t.classList.contains("tableWrapper");){if(t.classList.contains("ProseMirror"))return;const o=t.parentNode;if(!o||!(o instanceof Element))return;t=o}return t.nodeName==="TD"||t.nodeName==="TH"?{type:"cell",domNode:t,tbodyNode:t.closest("tbody")}:{type:"wrapper",domNode:t,tbodyNode:t.querySelector("tbody")}}function ya(e,t){const o=t.querySelectorAll(e);for(let i=0;i<o.length;i++)o[i].style.visibility="hidden"}class Zo{constructor(t,o,i){p(this,"state");p(this,"emitUpdate");p(this,"tableId");p(this,"tablePos");p(this,"tableElement");p(this,"menuFrozen",!1);p(this,"mouseState","up");p(this,"prevWasEditable",null);p(this,"viewMousedownHandler",()=>{this.mouseState="down"});p(this,"mouseUpHandler",t=>{this.mouseState="up",this.mouseMoveHandler(t)});p(this,"mouseMoveHandler",t=>{var u,c,h,m;if(this.menuFrozen||this.mouseState==="selecting"||!(t.target instanceof Element)||!this.pmView.dom.contains(t.target))return;const o=_a(t.target);if((o==null?void 0:o.type)==="cell"&&this.mouseState==="down"&&!((u=this.state)!=null&&u.draggingState)){this.mouseState="selecting",(c=this.state)!=null&&c.show&&(this.state.show=!1,this.state.showAddOrRemoveRowsButton=!1,this.state.showAddOrRemoveColumnsButton=!1,this.emitUpdate());return}if(!o||!this.editor.isEditable){(h=this.state)!=null&&h.show&&(this.state.show=!1,this.state.showAddOrRemoveRowsButton=!1,this.state.showAddOrRemoveColumnsButton=!1,this.emitUpdate());return}if(!o.tbodyNode)return;const i=o.tbodyNode.getBoundingClientRect(),n=Vo(o.domNode,this.pmView);if(!n)return;this.tableElement=n.node;let a;const r=q(n.id,this.editor._tiptapEditor.state.doc),l=x(r.node,this.editor.schema.blockSchema,this.editor.schema.inlineContentSchema,this.editor.schema.styleSchema,this.editor.blockCache);if(bo("table",l,this.editor)&&(this.tablePos=r.posBeforeNode+1,a=l),!a)return;this.tableId=n.id;const s=(m=o.domNode.closest(".tableWrapper"))==null?void 0:m.querySelector(".table-widgets-container");if((o==null?void 0:o.type)==="wrapper"){const b=t.clientY>=i.bottom-1&&t.clientY<i.bottom+20,f=t.clientX>=i.right-1&&t.clientX<i.right+20,g=t.clientX>i.right||t.clientY>i.bottom;this.state={...this.state,show:!0,showAddOrRemoveRowsButton:b,showAddOrRemoveColumnsButton:f,referencePosTable:i,block:a,widgetContainer:s,colIndex:g?void 0:this.state.colIndex,rowIndex:g?void 0:this.state.rowIndex,referencePosCell:g?void 0:this.state.referencePosCell}}else{const b=Ee(o.domNode),f=Ee(o.domNode.parentElement),g=o.domNode.getBoundingClientRect();if(this.state!==void 0&&this.state.show&&this.tableId===n.id&&this.state.rowIndex===f&&this.state.colIndex===b)return;this.state={show:!0,showAddOrRemoveColumnsButton:b===a.content.rows[0].cells.length-1,showAddOrRemoveRowsButton:f===a.content.rows.length-1,referencePosTable:i,block:a,draggingState:void 0,referencePosCell:g,colIndex:b,rowIndex:f,widgetContainer:s}}return this.emitUpdate(),!1});p(this,"dragOverHandler",t=>{var m;if(((m=this.state)==null?void 0:m.draggingState)===void 0)return;t.preventDefault(),t.dataTransfer.dropEffect="move",ya(".prosemirror-dropcursor-block, .prosemirror-dropcursor-inline",this.pmView.root);const o={left:Math.min(Math.max(t.clientX,this.state.referencePosTable.left+1),this.state.referencePosTable.right-1),top:Math.min(Math.max(t.clientY,this.state.referencePosTable.top+1),this.state.referencePosTable.bottom-1)},i=this.pmView.root.elementsFromPoint(o.left,o.top).filter(b=>b.tagName==="TD"||b.tagName==="TH");if(i.length===0)throw new Error("Could not find table cell element that the mouse cursor is hovering over.");const n=i[0];let a=!1;const r=Ee(n.parentElement),l=Ee(n),s=this.state.draggingState.draggedCellOrientation==="row"?this.state.rowIndex:this.state.colIndex,c=(this.state.draggingState.draggedCellOrientation==="row"?r:l)!==s;(this.state.rowIndex!==r||this.state.colIndex!==l)&&(this.state.rowIndex=r,this.state.colIndex=l,this.state.referencePosCell=n.getBoundingClientRect(),a=!0);const h=this.state.draggingState.draggedCellOrientation==="row"?o.top:o.left;this.state.draggingState.mousePos!==h&&(this.state.draggingState.mousePos=h,a=!0),a&&this.emitUpdate(),c&&this.editor.dispatch(this.pmView.state.tr.setMeta(oe,!0))});p(this,"dropHandler",t=>{if(this.mouseState="up",this.state===void 0||this.state.draggingState===void 0)return;if(this.state.rowIndex===void 0||this.state.colIndex===void 0)throw new Error("Attempted to drop table row or column, but no table block was hovered prior.");t.preventDefault();const{draggingState:o,colIndex:i,rowIndex:n}=this.state,a=this.state.block.content.rows;if(o.draggedCellOrientation==="row"){const r=a[o.originalIndex];a.splice(o.originalIndex,1),a.splice(n,0,r)}else{const r=a.map(l=>l.cells[o.originalIndex]);a.forEach((l,s)=>{l.cells.splice(o.originalIndex,1),l.cells.splice(i,0,r[s])})}this.editor.updateBlock(this.state.block,{type:"table",content:{type:"tableContent",rows:a}}),this.editor.setTextCursorPosition(this.state.block.id)});this.editor=t,this.pmView=o,this.emitUpdate=()=>{if(!this.state)throw new Error("Attempting to update uninitialized image toolbar");i(this.state)},o.dom.addEventListener("mousemove",this.mouseMoveHandler),o.dom.addEventListener("mousedown",this.viewMousedownHandler),window.addEventListener("mouseup",this.mouseUpHandler),o.root.addEventListener("dragover",this.dragOverHandler),o.root.addEventListener("drop",this.dropHandler)}update(){if(!this.state||!this.state.show)return;const t=this.tableElement.querySelector("tbody");if(t){if(this.state.rowIndex!==void 0&&this.state.colIndex!==void 0){this.state.rowIndex>=t.children.length&&(this.state.rowIndex=t.children.length-1),this.state.colIndex>=t.children[0].children.length&&(this.state.colIndex=t.children[0].children.length-1);const i=t.children[this.state.rowIndex].children[this.state.colIndex];this.state.referencePosCell=i.getBoundingClientRect()}this.state.block=this.editor.getBlock(this.state.block.id),this.state.referencePosTable=t.getBoundingClientRect(),this.emitUpdate()}}destroy(){this.pmView.dom.removeEventListener("mousemove",this.mouseMoveHandler),window.removeEventListener("mouseup",this.mouseUpHandler),this.pmView.dom.removeEventListener("mousedown",this.viewMousedownHandler),this.pmView.root.removeEventListener("dragover",this.dragOverHandler),this.pmView.root.removeEventListener("drop",this.dropHandler)}}const oe=new y.PluginKey("TableHandlesPlugin");class Jo extends Q{constructor(o){super();p(this,"view");p(this,"plugin");p(this,"colDragStart",o=>{if(this.view.state===void 0||this.view.state.colIndex===void 0)throw new Error("Attempted to drag table column, but no table block was hovered prior.");this.view.state.draggingState={draggedCellOrientation:"col",originalIndex:this.view.state.colIndex,mousePos:o.clientX},this.view.emitUpdate(),this.editor.dispatch(this.editor._tiptapEditor.state.tr.setMeta(oe,{draggedCellOrientation:this.view.state.draggingState.draggedCellOrientation,originalIndex:this.view.state.colIndex,newIndex:this.view.state.colIndex,tablePos:this.view.tablePos})),Xo(this.editor._tiptapEditor.view.root),o.dataTransfer.setDragImage(I,0,0),o.dataTransfer.effectAllowed="move"});p(this,"rowDragStart",o=>{if(this.view.state===void 0||this.view.state.rowIndex===void 0)throw new Error("Attempted to drag table row, but no table block was hovered prior.");this.view.state.draggingState={draggedCellOrientation:"row",originalIndex:this.view.state.rowIndex,mousePos:o.clientY},this.view.emitUpdate(),this.editor.dispatch(this.editor._tiptapEditor.state.tr.setMeta(oe,{draggedCellOrientation:this.view.state.draggingState.draggedCellOrientation,originalIndex:this.view.state.rowIndex,newIndex:this.view.state.rowIndex,tablePos:this.view.tablePos})),Xo(this.editor._tiptapEditor.view.root),o.dataTransfer.setDragImage(I,0,0),o.dataTransfer.effectAllowed="copyMove"});p(this,"dragEnd",()=>{if(this.view.state===void 0)throw new Error("Attempted to drag table row, but no table block was hovered prior.");this.view.state.draggingState=void 0,this.view.emitUpdate(),this.editor.dispatch(this.editor._tiptapEditor.state.tr.setMeta(oe,null)),ka(this.editor._tiptapEditor.view.root)});p(this,"freezeHandles",()=>{this.view.menuFrozen=!0});p(this,"unfreezeHandles",()=>{this.view.menuFrozen=!1});this.editor=o,this.plugin=new y.Plugin({key:oe,view:i=>(this.view=new Zo(o,i,n=>{this.emit("update",n)}),this.view),props:{decorations:i=>{if(this.view===void 0||this.view.state===void 0||this.view.state.draggingState===void 0||this.view.tablePos===void 0)return;const n=this.view.state.draggingState.draggedCellOrientation==="row"?this.view.state.rowIndex:this.view.state.colIndex;if(n===void 0)return;const a=[];if(n===this.view.state.draggingState.originalIndex)return M.DecorationSet.create(i.doc,a);const r=i.doc.resolve(this.view.tablePos+1),l=r.node();if(this.view.state.draggingState.draggedCellOrientation==="row"){const s=i.doc.resolve(r.posAtIndex(n)+1),u=s.node();for(let c=0;c<u.childCount;c++){const h=i.doc.resolve(s.posAtIndex(c)+1),m=h.node(),b=h.pos+(n>this.view.state.draggingState.originalIndex?m.nodeSize-2:0);a.push(M.Decoration.widget(b,()=>{const f=document.createElement("div");return f.className="bn-table-drop-cursor",f.style.left="0",f.style.right="0",n>this.view.state.draggingState.originalIndex?f.style.bottom="-2px":f.style.top="-3px",f.style.height="4px",f}))}}else for(let s=0;s<l.childCount;s++){const u=i.doc.resolve(r.posAtIndex(s)+1),c=i.doc.resolve(u.posAtIndex(n)+1),h=c.node(),m=c.pos+(n>this.view.state.draggingState.originalIndex?h.nodeSize-2:0);a.push(M.Decoration.widget(m,()=>{const b=document.createElement("div");return b.className="bn-table-drop-cursor",b.style.top="0",b.style.bottom="0",n>this.view.state.draggingState.originalIndex?b.style.right="-2px":b.style.left="-3px",b.style.width="4px",b}))}return M.DecorationSet.create(i.doc,a)}}})}onUpdate(o){return this.on("update",o)}}const va=k.Extension.create({name:"textAlignment",addGlobalAttributes(){return[{types:["paragraph","heading","bulletListItem","numberedListItem","checkListItem"],attributes:{textAlignment:{default:"left",parseHTML:e=>e.getAttribute("data-text-alignment"),renderHTML:e=>e.textAlignment==="left"?{}:{"data-text-alignment":e.textAlignment}}}}]}}),wa=k.Extension.create({name:"blockTextColor",addGlobalAttributes(){return[{types:["blockContainer"],attributes:{textColor:{default:E.textColor.default,parseHTML:e=>e.hasAttribute("data-text-color")?e.getAttribute("data-text-color"):E.textColor.default,renderHTML:e=>e.textColor===E.textColor.default?{}:{"data-text-color":e.textColor}}}}]}}),Ca=k.Extension.create({name:"trailingNode",addProseMirrorPlugins(){const e=new y.PluginKey(this.name);return[new y.Plugin({key:e,appendTransaction:(t,o,i)=>{const{doc:n,tr:a,schema:r}=i,l=e.getState(i),s=n.content.size-2,u=r.nodes.blockContainer,c=r.nodes.paragraph;if(l)return a.insert(s,u.create(void 0,c.create()))},state:{init:(t,o)=>{},apply:(t,o)=>{if(!t.docChanged)return o;let i=t.doc.lastChild;if(!i||i.type.name!=="blockGroup")throw new Error("Expected blockGroup");if(i=i.lastChild,!i||i.type.name!=="blockContainer")return!0;const n=i.firstChild;if(!n)throw new Error("Expected blockContent");return i.nodeSize>4||n.type.spec.content!=="inline*"}}})]}}),Ea={blockColor:"data-block-color",blockStyle:"data-block-style",id:"data-id",depth:"data-depth",depthChange:"data-depth-change"},xa=k.Node.create({name:"blockContainer",group:"blockGroupChild bnBlock",content:"blockContent blockGroup?",priority:50,defining:!0,parseHTML(){return[{tag:"div",getAttrs:e=>{if(typeof e=="string")return!1;const t={};for(const[o,i]of Object.entries(Ea))e.getAttribute(i)&&(t[o]=e.getAttribute(i));return e.getAttribute("data-node-type")==="blockContainer"?t:!1}}]},renderHTML({HTMLAttributes:e}){var n;const t=document.createElement("div");t.className="bn-block-outer",t.setAttribute("data-node-type","blockOuter");for(const[a,r]of Object.entries(e))a!=="class"&&t.setAttribute(a,r);const o={...((n=this.options.domAttributes)==null?void 0:n.block)||{},...e},i=document.createElement("div");i.className=O("bn-block",o.class),i.setAttribute("data-node-type",this.name);for(const[a,r]of Object.entries(o))a!=="class"&&i.setAttribute(a,r);return t.appendChild(i),{dom:t,contentDOM:i}}}),Sa=k.Node.create({name:"blockGroup",group:"childContainer",content:"blockGroupChild+",parseHTML(){return[{tag:"div",getAttrs:e=>typeof e=="string"?!1:e.getAttribute("data-node-type")==="blockGroup"?null:!1}]},renderHTML({HTMLAttributes:e}){var i;const t={...((i=this.options.domAttributes)==null?void 0:i.blockGroup)||{},...e},o=document.createElement("div");o.className=O("bn-block-group",t.class),o.setAttribute("data-node-type","blockGroup");for(const[n,a]of Object.entries(t))n!=="class"&&o.setAttribute(n,a);return{dom:o,contentDOM:o}}}),Ba=k.Node.create({name:"doc",topNode:!0,content:"blockGroup"}),Yo=e=>{const t={},o=Ta(e);for(const n of o)t[n.name]=n;t.formattingToolbar=new jo(e.editor),t.linkToolbar=new Ro(e.editor),t.sideMenu=new qo(e.editor),t.suggestionMenus=new $o(e.editor),t.filePanel=new Po(e.editor),t.placeholder=new da(e.editor,e.placeholders),(e.animations??!0)&&(t.animations=new ua),e.tableHandles&&(t.tableHandles=new Jo(e.editor)),t.dropCursor={plugin:e.dropCursor({width:5,color:"#ddeeff",editor:e.editor})},t.nodeSelectionKeyboard=new la;const i=e.disableExtensions||[];for(const n of i)delete t[n];return t},Ta=e=>{var o;const t=[k.extensions.ClipboardTextSerializer,k.extensions.Commands,k.extensions.Editable,k.extensions.FocusEvents,k.extensions.Tabindex,fi.Gapcursor,X.configure({types:["blockContainer","columnList","column"],setIdAttribute:e.setIdAttribute}),gi.HardBreak.extend({priority:10}),_i.Text,ki.Link.extend({inclusive:!1,addKeyboardShortcuts(){return{"Mod-k":()=>(this.editor.commands.toggleLink({href:""}),!0)}}}),...Object.values(e.styleSpecs).map(i=>i.implementation.mark),wa,ta,va,k.Extension.create({name:"OverrideEscape",addKeyboardShortcuts(){return{Escape:()=>e.editor.suggestionMenus.shown?!1:this.editor.commands.blur()}}}),Ba,xa.configure({editor:e.editor,domAttributes:e.domAttributes}),na.configure({editor:e.editor}),Sa.configure({domAttributes:e.domAttributes}),...Object.values(e.inlineContentSpecs).filter(i=>i.config!=="link"&&i.config!=="text").map(i=>i.implementation.node.configure({editor:e.editor})),...Object.values(e.blockSpecs).flatMap(i=>[...(i.implementation.requiredExtensions||[]).map(n=>n.configure({editor:e.editor,domAttributes:e.domAttributes})),i.implementation.node.configure({editor:e.editor,domAttributes:e.domAttributes})]),ea(e.editor),Yn(e.editor),Zn(e.editor),...e.trailingBlock===void 0||e.trailingBlock?[Ca]:[]];if(e.collaboration){if(t.push(Bi.default.configure({fragment:e.collaboration.fragment})),(o=e.collaboration.provider)!=null&&o.awareness){const i=n=>{const a=document.createElement("span");a.classList.add("collaboration-cursor__caret"),a.setAttribute("style",`border-color: ${n.color}`);const r=document.createElement("span");r.classList.add("collaboration-cursor__label"),r.setAttribute("style",`background-color: ${n.color}`),r.insertBefore(document.createTextNode(n.name),null);const l=document.createTextNode(""),s=document.createTextNode("");return a.insertBefore(l,null),a.insertBefore(r,null),a.insertBefore(s,null),a};t.push(Ti.default.configure({user:e.collaboration.user,render:e.collaboration.renderCursor||i,provider:e.collaboration.provider}))}}else t.push(bi.History);return t};function Ma(e,t){const o=[];return e.forEach((i,n,a)=>{a!==t&&o.push(i)}),v.Fragment.from(o)}function La(e,t){const o=[];for(let i=0;i<e.childCount;i++)if(e.child(i).type.name==="tableRow")if(o.length>0&&o[o.length-1].type.name==="table"){const n=o[o.length-1],a=n.copy(n.content.addToEnd(e.child(i)));o[o.length-1]=a}else{const n=t.nodes.table.createChecked(void 0,e.child(i));o.push(n)}else o.push(e.child(i));return e=v.Fragment.from(o),e}function Ia(e,t){let o=v.Fragment.from(e.content);o=La(o,t.state.schema);for(let i=0;i<o.childCount;i++)if(o.child(i).type.spec.group==="blockContent"){const n=[o.child(i)];if(i+1<o.childCount&&o.child(i+1).type.name==="blockGroup"){const r=o.child(i+1).child(0).child(0);(r.type.name==="bulletListItem"||r.type.name==="numberedListItem"||r.type.name==="checkListItem")&&(n.push(o.child(i+1)),o=Ma(o,i+1))}const a=t.state.schema.nodes.blockContainer.createChecked(void 0,n);o=o.replaceChild(i,a)}return new v.Slice(o,e.openStart,e.openEnd)}function nt(e){return e&&Object.fromEntries(Object.entries(e).filter(([,t])=>t!==void 0))}class xe{constructor(t){p(this,"blockSpecs");p(this,"inlineContentSpecs");p(this,"styleSpecs");p(this,"blockSchema");p(this,"inlineContentSchema");p(this,"styleSchema");p(this,"BlockNoteEditor","only for types");p(this,"Block","only for types");p(this,"PartialBlock","only for types");this.blockSpecs=nt(t==null?void 0:t.blockSpecs)||Ze,this.inlineContentSpecs=nt(t==null?void 0:t.inlineContentSpecs)||Ye,this.styleSpecs=nt(t==null?void 0:t.styleSpecs)||Je,this.blockSchema=Ue(this.blockSpecs),this.inlineContentSchema=ze(this.inlineContentSpecs),this.styleSchema=Fe(this.styleSpecs)}static create(t){return new xe(t)}}const Te=class Te extends k.Editor{constructor(o,i){super({...o,content:void 0});p(this,"_state");p(this,"_creating",!1);p(this,"mount",o=>{o?(this.options.element=o,this.createViewAlternative()):(this.destroy(),this._creating=!1)});const n=this.schema;let a;const r=n.nodes.doc.createAndFill;n.nodes.doc.createAndFill=(...s)=>{if(a)return a;const u=r.apply(n.nodes.doc,s),c=JSON.parse(JSON.stringify(u.toJSON()));return c.content[0].content[0].attrs.id="initialBlockId",a=v.Node.fromJSON(n,c),a};let l;try{const s=o==null?void 0:o.content.map(u=>V(u,this.schema,i).toJSON());l=k.createDocument({type:"doc",content:[{type:"blockGroup",content:s}]},this.schema,this.options.parseOptions)}catch(s){throw console.error("Error creating document from blocks passed as `initialContent`. Caused by exception: ",s),new Error("Error creating document from blocks passed as `initialContent`:\n"+ +JSON.stringify(o.content))}this._state=y.EditorState.create({doc:l,schema:this.schema})}get state(){return this.view&&(this._state=this.view.state),this._state}dispatch(o){this.view?this.view.dispatch(o):this._state=this.state.apply(o)}createViewAlternative(){this._creating=!0,queueMicrotask(()=>{if(!this._creating)return;this.view=new M.EditorView({mount:this.options.element},{...this.options.editorProps,dispatchTransaction:this.dispatchTransaction.bind(this),state:this.state});const o=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(o),this.createNodeViews(),this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0,this._creating=!1})}};p(Te,"create",(o,i)=>{var a,r;const n=(a=globalThis==null?void 0:globalThis.window)==null?void 0:a.setTimeout;typeof((r=globalThis==null?void 0:globalThis.window)==null?void 0:r.setTimeout)<"u"&&(globalThis.window.setTimeout=()=>0);try{return new Te(o,i)}finally{n&&(globalThis.window.setTimeout=n)}});let Se=Te;Se.prototype.createView=function(){this.options.onPaste=this.options.onDrop=void 0};const Pa={enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!1};class at{constructor(t){p(this,"_pmSchema");p(this,"extensions",{});p(this,"headless",!1);p(this,"_tiptapEditor");p(this,"elementRenderer",null);p(this,"blockCache",new WeakMap);p(this,"dictionary");p(this,"schema");p(this,"blockImplementations");p(this,"inlineContentImplementations");p(this,"styleImplementations");p(this,"formattingToolbar");p(this,"linkToolbar");p(this,"sideMenu");p(this,"suggestionMenus");p(this,"filePanel");p(this,"tableHandles");p(this,"uploadFile");p(this,"onUploadStartCallbacks",[]);p(this,"onUploadEndCallbacks",[]);p(this,"resolveFileUrl");p(this,"mount",t=>{this._tiptapEditor.mount(t)});var l,s,u,c,h,m,b;this.options=t;const o=t;if(o.onEditorContentChange)throw new Error("onEditorContentChange initialization option is deprecated, use <BlockNoteView onChange={...} />, the useEditorChange(...) hook, or editor.onChange(...)");if(o.onTextCursorPositionChange)throw new Error("onTextCursorPositionChange initialization option is deprecated, use <BlockNoteView onSelectionChange={...} />, the useEditorSelectionChange(...) hook, or editor.onSelectionChange(...)");if(o.onEditorReady)throw new Error("onEditorReady is deprecated. Editor is immediately ready for use after creation.");if(o.editable)throw new Error("editable initialization option is deprecated, use <BlockNoteView editable={true/false} />, or alternatively editor.isEditable = true/false");this.dictionary=t.dictionary||ct;const i={defaultStyles:!0,schema:t.schema||xe.create(),_headless:!1,...t,placeholders:{...this.dictionary.placeholders,...t.placeholders}};if(this.schema=i.schema,this.blockImplementations=i.schema.blockSpecs,this.inlineContentImplementations=i.schema.inlineContentSpecs,this.styleImplementations=i.schema.styleSpecs,this.extensions=Yo({editor:this,domAttributes:i.domAttributes||{},blockSpecs:this.schema.blockSpecs,styleSpecs:this.schema.styleSpecs,inlineContentSpecs:this.schema.inlineContentSpecs,collaboration:i.collaboration,trailingBlock:i.trailingBlock,disableExtensions:i.disableExtensions,setIdAttribute:i.setIdAttribute,animations:i.animations??!0,tableHandles:L("table",this),dropCursor:this.options.dropCursor??yi.dropCursor,placeholders:i.placeholders}),(((l=i._tiptapOptions)==null?void 0:l.extensions)||[]).forEach(f=>{this.extensions[f.name]=f}),Object.entries(i._extensions||{}).forEach(([f,g])=>{this.extensions[f]=g}),this.formattingToolbar=this.extensions.formattingToolbar,this.linkToolbar=this.extensions.linkToolbar,this.sideMenu=this.extensions.sideMenu,this.suggestionMenus=this.extensions.suggestionMenus,this.filePanel=this.extensions.filePanel,this.tableHandles=this.extensions.tableHandles,i.uploadFile){const f=i.uploadFile;this.uploadFile=async(g,_)=>{this.onUploadStartCallbacks.forEach(w=>w.apply(this,[_]));try{return await f(g,_)}finally{this.onUploadEndCallbacks.forEach(w=>w.apply(this,[_]))}}}this.resolveFileUrl=i.resolveFileUrl||(async f=>f),this.headless=i._headless,i.collaboration&&i.initialContent&&console.warn("When using Collaboration, initialContent might cause conflicts, because changes should come from the collaboration provider");const n=i.initialContent||(t.collaboration?[{type:"paragraph",id:"initialBlockId"}]:[{type:"paragraph",id:X.options.generateID()}]);if(!Array.isArray(n)||n.length===0)throw new Error("initialContent must be a non-empty array of blocks, received: "+n);const a=[...Object.entries(this.extensions).map(([f,g])=>{if(g instanceof k.Extension||g instanceof k.Node||g instanceof k.Mark)return g;if(!g.plugin)throw new Error("Extension should either be a TipTap extension or a ProseMirror plugin in a plugin property");return k.Extension.create({name:f,addProseMirrorPlugins:()=>[g.plugin]})})],r={...Pa,...i._tiptapOptions,content:n,extensions:a,editorProps:{...(s=i._tiptapOptions)==null?void 0:s.editorProps,attributes:{tabIndex:"0",...(c=(u=i._tiptapOptions)==null?void 0:u.editorProps)==null?void 0:c.attributes,...(h=i.domAttributes)==null?void 0:h.editor,class:O("bn-editor",i.defaultStyles?"bn-default-styles":"",((b=(m=i.domAttributes)==null?void 0:m.editor)==null?void 0:b.class)||"")},transformPasted:Ia}};this.headless?this._pmSchema=k.getSchema(r.extensions):(this._tiptapEditor=Se.create(r,this.schema.styleSchema),this._pmSchema=this._tiptapEditor.schema)}get pmSchema(){return this._pmSchema}static create(t={}){return new at(t)}dispatch(t){this._tiptapEditor.dispatch(t)}get prosemirrorView(){return this._tiptapEditor.view}get domElement(){return this._tiptapEditor.view.dom}isFocused(){return this._tiptapEditor.view.hasFocus()}focus(){this._tiptapEditor.view.focus()}onUploadStart(t){return this.onUploadStartCallbacks.push(t),()=>{const o=this.onUploadStartCallbacks.indexOf(t);o>-1&&this.onUploadStartCallbacks.splice(o,1)}}onUploadEnd(t){return this.onUploadEndCallbacks.push(t),()=>{const o=this.onUploadEndCallbacks.indexOf(t);o>-1&&this.onUploadEndCallbacks.splice(o,1)}}get topLevelBlocks(){return this.document}get document(){const t=[];return this._tiptapEditor.state.doc.firstChild.descendants(o=>(t.push(x(o,this.schema.blockSchema,this.schema.inlineContentSchema,this.schema.styleSchema,this.blockCache)),!1)),t}getBlock(t){const o=typeof t=="string"?t:t.id;let i;return this._tiptapEditor.state.doc.firstChild.descendants(n=>typeof i<"u"?!1:n.type.name!=="blockContainer"||n.attrs.id!==o?!0:(i=x(n,this.schema.blockSchema,this.schema.inlineContentSchema,this.schema.styleSchema,this.blockCache),!1)),i}forEachBlock(t,o=!1){const i=this.document.slice();o&&i.reverse();function n(a){for(const r of a){if(t(r)===!1)return!1;const l=o?r.children.slice().reverse():r.children;if(!n(l))return!1}return!0}n(i)}onEditorContentChange(t){this._tiptapEditor.on("update",t)}onEditorSelectionChange(t){this._tiptapEditor.on("selectionUpdate",t)}getTextCursorPosition(){return On(this)}setTextCursorPosition(t,o="start"){wo(this,t,o)}getSelection(){if(this._tiptapEditor.state.selection.from===this._tiptapEditor.state.selection.to||"node"in this._tiptapEditor.state.selection)return;const t=[];return this._tiptapEditor.state.doc.descendants((o,i)=>{if(o.type.spec.group!=="blockContent")return!0;const n=i+o.nodeSize-1,a=i+1;return n<=this._tiptapEditor.state.selection.from||a>=this._tiptapEditor.state.selection.to?!0:(t.push(x(this._tiptapEditor.state.doc.resolve(i).node(),this.schema.blockSchema,this.schema.inlineContentSchema,this.schema.styleSchema,this.blockCache)),!1)}),{blocks:t}}get isEditable(){if(!this._tiptapEditor){if(!this.headless)throw new Error("no editor, but also not headless?");return!1}return this._tiptapEditor.isEditable===void 0?!0:this._tiptapEditor.isEditable}set isEditable(t){if(!this._tiptapEditor){if(!this.headless)throw new Error("no editor, but also not headless?");return}this._tiptapEditor.options.editable!==t&&this._tiptapEditor.setEditable(t)}insertBlocks(t,o,i="before"){return Bn(this,t,o,i)}updateBlock(t,o){return po(this,t,o)}removeBlocks(t){return Hn(this,t)}replaceBlocks(t,o){return Dn(this,t,o)}insertInlineContent(t){const o=N(t,this.pmSchema,this.schema.styleSchema);Un({from:this._tiptapEditor.state.selection.from,to:this._tiptapEditor.state.selection.to},o,this)}getActiveStyles(){const t={},o=this._tiptapEditor.state.selection.$to.marks();for(const i of o){const n=this.schema.styleSchema[i.type.name];if(!n){i.type.name!=="link"&&console.warn("mark not found in styleschema",i.type.name);continue}n.propSchema==="boolean"?t[n.type]=!0:t[n.type]=i.attrs.stringValue}return t}addStyles(t){for(const[o,i]of Object.entries(t)){const n=this.schema.styleSchema[o];if(!n)throw new Error(`style ${o} not found in styleSchema`);if(n.propSchema==="boolean")this._tiptapEditor.commands.setMark(o);else if(n.propSchema==="string")this._tiptapEditor.commands.setMark(o,{stringValue:i});else throw new A(n.propSchema)}}removeStyles(t){for(const o of Object.keys(t))this._tiptapEditor.commands.unsetMark(o)}toggleStyles(t){for(const[o,i]of Object.entries(t)){const n=this.schema.styleSchema[o];if(!n)throw new Error(`style ${o} not found in styleSchema`);if(n.propSchema==="boolean")this._tiptapEditor.commands.toggleMark(o);else if(n.propSchema==="string")this._tiptapEditor.commands.toggleMark(o,{stringValue:i});else throw new A(n.propSchema)}}getSelectedText(){return this._tiptapEditor.state.doc.textBetween(this._tiptapEditor.state.selection.from,this._tiptapEditor.state.selection.to)}getSelectedLinkUrl(){return this._tiptapEditor.getAttributes("link").href}createLink(t,o){if(t==="")return;const{from:i,to:n}=this._tiptapEditor.state.selection;o||(o=this._tiptapEditor.state.doc.textBetween(i,n));const a=this.pmSchema.mark("link",{href:t});this.dispatch(this._tiptapEditor.state.tr.insertText(o,i,n).addMark(i,i+o.length,a))}canNestBlock(){return Nn(this)}nestBlock(){yo(this)}canUnnestBlock(){return jn(this)}unnestBlock(){An(this)}moveBlockUp(){Ln(this)}moveBlockDown(){In(this)}async blocksToHTMLLossy(t=this.document){return ae(this.pmSchema,this).exportBlocks(t,{})}async blocksToFullHTML(t){return kt(this.pmSchema,this).serializeBlocks(t,{})}async tryParseHTMLToBlocks(t){return Qe(t,this.schema.blockSchema,this.schema.inlineContentSchema,this.schema.styleSchema,this.pmSchema)}async blocksToMarkdownLossy(t=this.document){return Co(t,this.pmSchema,this,{})}async tryParseMarkdownToBlocks(t){return So(t,this.schema.blockSchema,this.schema.inlineContentSchema,this.schema.styleSchema,this.pmSchema)}updateCollaborationUserInfo(t){if(!this.options.collaboration)throw new Error("Cannot update collaboration user info when collaboration is disabled.");this._tiptapEditor.commands.updateUser(t)}onChange(t){if(this.headless)return;const o=()=>{t(this)};return this._tiptapEditor.on("update",o),()=>{this._tiptapEditor.off("update",o)}}onSelectionChange(t){if(this.headless)return;const o=()=>{t(this)};return this._tiptapEditor.on("selectionUpdate",o),()=>{this._tiptapEditor.off("selectionUpdate",o)}}openSuggestionMenu(t,o){const i=this.prosemirrorView.state.tr,n=o&&o.deleteTriggerCharacter?i.insertText(t):i;this.prosemirrorView.focus(),this.prosemirrorView.dispatch(n.scrollIntoView().setMeta(this.suggestionMenus.plugin,{triggerCharacter:t,deleteTriggerCharacter:(o==null?void 0:o.deleteTriggerCharacter)||!1,ignoreQueryLength:(o==null?void 0:o.ignoreQueryLength)||!1}))}}const Aa={gray:{text:"#9b9a97",background:"#ebeced"},brown:{text:"#64473a",background:"#e9e5e3"},red:{text:"#e03e3e",background:"#fbe4e4"},orange:{text:"#d9730d",background:"#f6e9d9"},yellow:{text:"#dfab01",background:"#fbf3db"},green:{text:"#4d6461",background:"#ddedea"},blue:{text:"#0b6e99",background:"#ddebf1"},purple:{text:"#6940a5",background:"#eae4f2"},pink:{text:"#ad1a72",background:"#f4dfeb"}},Na={gray:{text:"#bebdb8",background:"#9b9a97"},brown:{text:"#8e6552",background:"#64473a"},red:{text:"#ec4040",background:"#be3434"},orange:{text:"#e3790d",background:"#b7600a"},yellow:{text:"#dfab01",background:"#b58b00"},green:{text:"#6b8b87",background:"#4d6461"},blue:{text:"#0e87bc",background:"#0b6e99"},purple:{text:"#8552d7",background:"#6940a5"},pink:{text:"#da208f",background:"#ad1a72"}};class ja{constructor(t,o,i){this.mappings=o,this.options=i}async resolveFile(t){var i;if(!((i=this.options)!=null&&i.resolveFileUrl))return(await fetch(t)).blob();const o=await this.options.resolveFileUrl(t);return o instanceof Blob?o:(await fetch(o)).blob()}mapStyles(t){return Object.entries(t).map(([i,n])=>this.mappings.styleMapping[i](n,this))}mapInlineContent(t){return this.mappings.inlineContentMapping[t.type](t,this)}transformInlineContent(t){return t.map(o=>this.mapInlineContent(o))}async mapBlock(t,o,i){return this.mappings.blockMapping[t.type](t,this,o,i)}}function Da(e){return{createBlockMapping:t=>t,createInlineContentMapping:t=>t,createStyleMapping:t=>t}}let Be,rt;async function Ha(e,t){if(!go("text",e))return[];if(!Be){Be=import("@emoji-mart/data"),rt=await import("emoji-mart");const n=(await Be).default;await rt.init({data:n})}const o=(await Be).default;return(t.trim()===""?Object.values(o.emojis):await rt.SearchIndex.search(t)).map(n=>({id:n.skins[0].native,onItemClick:()=>e.insertInlineContent(n.skins[0].native+" ")}))}function Ua(e){let t=e.getTextCursorPosition().block,o=e.schema.blockSchema[t.type].content;for(;o==="none";)t=e.getTextCursorPosition().nextBlock,o=e.schema.blockSchema[t.type].content,e.setTextCursorPosition(t,"end")}function P(e,t){const o=e.getTextCursorPosition().block;if(o.content===void 0)throw new Error("Slash Menu open in a block that doesn't contain content.");let i;return Array.isArray(o.content)&&(o.content.length===1&&Z(o.content[0])&&o.content[0].type==="text"&&o.content[0].text==="/"||o.content.length===0)?(i=e.updateBlock(o,t),e.setTextCursorPosition(i)):(i=e.insertBlocks([t],o,"after")[0],e.setTextCursorPosition(e.getTextCursorPosition().nextBlock)),Ua(e),i}function Oa(e){const t=[];return L("heading",e)&&t.push({onItemClick:()=>{P(e,{type:"heading",props:{level:1}})},badge:U("Mod-Alt-1"),key:"heading",...e.dictionary.slash_menu.heading},{onItemClick:()=>{P(e,{type:"heading",props:{level:2}})},badge:U("Mod-Alt-2"),key:"heading_2",...e.dictionary.slash_menu.heading_2},{onItemClick:()=>{P(e,{type:"heading",props:{level:3}})},badge:U("Mod-Alt-3"),key:"heading_3",...e.dictionary.slash_menu.heading_3}),L("numberedListItem",e)&&t.push({onItemClick:()=>{P(e,{type:"numberedListItem"})},badge:U("Mod-Shift-7"),key:"numbered_list",...e.dictionary.slash_menu.numbered_list}),L("bulletListItem",e)&&t.push({onItemClick:()=>{P(e,{type:"bulletListItem"})},badge:U("Mod-Shift-8"),key:"bullet_list",...e.dictionary.slash_menu.bullet_list}),L("checkListItem",e)&&t.push({onItemClick:()=>{P(e,{type:"checkListItem"})},badge:U("Mod-Shift-9"),key:"check_list",...e.dictionary.slash_menu.check_list}),L("paragraph",e)&&t.push({onItemClick:()=>{P(e,{type:"paragraph"})},badge:U("Mod-Alt-0"),key:"paragraph",...e.dictionary.slash_menu.paragraph}),L("codeBlock",e)&&t.push({onItemClick:()=>{P(e,{type:"codeBlock"})},badge:U("Mod-Alt-c"),key:"code_block",...e.dictionary.slash_menu.code_block}),L("table",e)&&t.push({onItemClick:()=>{P(e,{type:"table",content:{type:"tableContent",rows:[{cells:["","",""]},{cells:["","",""]}]}})},badge:void 0,key:"table",...e.dictionary.slash_menu.table}),L("image",e)&&t.push({onItemClick:()=>{const o=P(e,{type:"image"});e.dispatch(e._tiptapEditor.state.tr.setMeta(e.filePanel.plugin,{block:o}))},key:"image",...e.dictionary.slash_menu.image}),L("video",e)&&t.push({onItemClick:()=>{const o=P(e,{type:"video"});e.dispatch(e._tiptapEditor.state.tr.setMeta(e.filePanel.plugin,{block:o}))},key:"video",...e.dictionary.slash_menu.video}),L("audio",e)&&t.push({onItemClick:()=>{const o=P(e,{type:"audio"});e.dispatch(e._tiptapEditor.state.tr.setMeta(e.filePanel.plugin,{block:o}))},key:"audio",...e.dictionary.slash_menu.audio}),L("file",e)&&t.push({onItemClick:()=>{const o=P(e,{type:"file"});e.dispatch(e._tiptapEditor.state.tr.setMeta(e.filePanel.plugin,{block:o}))},key:"file",...e.dictionary.slash_menu.file}),t.push({onItemClick:()=>{e.openSuggestionMenu(":",{deleteTriggerCharacter:!0,ignoreQueryLength:!0})},key:"emoji",...e.dictionary.slash_menu.emoji}),t}function Ra(e,t){return e.filter(({title:o,aliases:i})=>o.toLowerCase().includes(t.toLowerCase())||i&&i.filter(n=>n.toLowerCase().includes(t.toLowerCase())).length!==0)}function za(e,...t){const o=[...e];for(const i of t)for(const n of i){const a=o.findLastIndex(r=>r.group===n.group);a===-1?o.push(n):o.splice(a+1,0,n)}return o}function lt(e=""){return typeof e=="string"?[{type:"text",text:e,styles:{}}]:e}function fe(e){return typeof e=="string"?lt(e):Array.isArray(e)?e.flatMap(t=>typeof t=="string"?lt(t):Pe(t)?{...t,content:lt(t.content)}:Z(t)?t:{props:{},...t,content:fe(t.content)}):(e==null?void 0:e.type)==="tableContent"?{type:"tableContent",columnWidths:e.columnWidths,rows:e.rows.map(t=>({...t,cells:t.cells.map(o=>fe(o))}))}:e}function Va(e,t){return t.map(o=>st(e.blockSchema,o))}function st(e,t){var n;const o=e[t.type].content,i={id:"",type:t.type,props:{},content:o==="inline"?[]:o==="table"?{type:"tableContent",columnWidths:[],rows:[]}:void 0,children:[],...t};if(Object.entries(e[t.type].propSchema).forEach(([a,r])=>{i.props[a]===void 0&&(i.props[a]=r.default)}),o==="inline"){const a=i.content;i.content=fe(a)}else if(o==="table"){const a=i.content;i.content={type:"tableContent",columnWidths:(a==null?void 0:a.columnWidths)||((n=a==null?void 0:a.rows[0])==null?void 0:n.cells.map(()=>{}))||[],rows:(a==null?void 0:a.rows.map(r=>({cells:r.cells.map(l=>fe(l))})))||[]}}return{...i,content:fe(i.content),children:i.children.map(a=>st(e,a))}}function Qo(e){e.id||(e.id=X.options.generateID()),e.children&&ei(e.children)}function ei(e){for(const t of e)Qo(t)}d.AudioBlock=Ot,d.BlockNoteEditor=at,d.BlockNoteSchema=xe,d.COLORS_DARK_MODE_DEFAULT=Na,d.COLORS_DEFAULT=Aa,d.CodeBlock=Vt,d.EMPTY_CELL_HEIGHT=qi,d.EMPTY_CELL_WIDTH=$e,d.Exporter=ja,d.FILE_AUDIO_ICON_SVG=At,d.FILE_ICON_SVG=Lt,d.FILE_IMAGE_ICON_SVG=Xt,d.FILE_VIDEO_ICON_SVG=io,d.FileBlock=$t,d.FilePanelProsemirrorPlugin=Po,d.FilePanelView=Io,d.FormattingToolbarProsemirrorPlugin=jo,d.FormattingToolbarView=Ao,d.HTMLToBlocks=Qe,d.ImageBlock=to,d.LinkToolbarProsemirrorPlugin=Ro,d.SideMenuProsemirrorPlugin=qo,d.SideMenuView=Wo,d.SuggestionMenuProseMirrorPlugin=$o,d.TableHandlesProsemirrorPlugin=Jo,d.TableHandlesView=Zo,d.UniqueID=X,d.UnreachableCaseError=A,d.VideoBlock=co,d.addIdsToBlock=Qo,d.addIdsToBlocks=ei,d.addInlineContentAttributes=Re,d.addInlineContentKeyboardShortcuts=Ct,d.addStyleAttributes=Tt,d.applyNonSelectableBlockFix=vt,d.assertEmpty=Pi,d.audioBlockConfig=jt,d.audioParse=Ht,d.audioPropSchema=Nt,d.audioRender=Dt,d.audioToExternalHTML=Ut,d.blockToNode=V,d.blocksToMarkdown=Co,d.camelToDataKebab=le,d.checkBlockHasDefaultProp=Sn,d.checkBlockIsDefaultType=bo,d.checkBlockIsFileBlock=Cn,d.checkBlockIsFileBlockWithPlaceholder=xn,d.checkBlockIsFileBlockWithPreview=En,d.checkBlockTypeHasDefaultProp=ko,d.checkDefaultBlockTypeInSchema=L,d.checkDefaultInlineContentTypeInSchema=go,d.cleanHTMLToMarkdown=Ce,d.combineByGroup=za,d.contentNodeToInlineContent=ce,d.contentNodeToTableContent=Oe,d.createAddFileButton=It,d.createBlockSpec=de,d.createBlockSpecFromStronglyTypedTiptapNode=z,d.createDefaultBlockDOMOutputSpec=D,d.createDefaultFilePreview=Ge,d.createExternalHTMLExporter=ae,d.createFigureWithCaption=ye,d.createFileAndCaptionWrapper=Y,d.createFileBlockWrapper=ue,d.createInlineContentSpec=Vi,d.createInlineContentSpecFromTipTapNode=xt,d.createInternalBlockSpec=He,d.createInternalHTMLSerializer=kt,d.createInternalInlineContentSpec=Et,d.createInternalStyleSpec=Ve,d.createLinkWithCaption=he,d.createResizeHandlesWrapper=Ke,d.createStronglyTypedTiptapNode=R,d.createStyleSpec=Fi,d.createStyleSpecFromTipTapMark=F,d.createSuggestionMenu=ba,d.customizeCodeBlock=Gi,d.defaultBlockSchema=mo,d.defaultBlockSpecs=Ze,d.defaultBlockToHTML=Ne,d.defaultCodeBlockPropSchema=ve,d.defaultInlineContentSchema=fo,d.defaultInlineContentSpecs=Ye,d.defaultProps=E,d.defaultStyleSchema=wn,d.defaultStyleSpecs=Je,d.fileBlockConfig=Gt,d.fileParse=Kt,d.filePropSchema=Ft,d.fileRender=Wt,d.fileToExternalHTML=qt,d.filenameFromURL=zi,d.filterSuggestionItems=Ra,d.formatKeyboardShortcut=U,d.formattingToolbarPluginKey=No,d.getBlockFromPos=yt,d.getBlockInfo=K,d.getBlockInfoFromResolvedPos=J,d.getBlockInfoFromSelection=C,d.getBlockInfoWithManualOffset=ke,d.getBlockNoteExtensions=Yo,d.getBlockSchemaFromSpecs=Ue,d.getDefaultEmojiPickerItems=Ha,d.getDefaultSlashMenuItems=Oa,d.getInlineContentParseRules=St,d.getInlineContentSchemaFromSpecs=ze,d.getNearestBlockPos=re,d.getNodeById=q,d.getParseRules=wt,d.getStyleParseRules=Mt,d.getStyleSchemaFromSpecs=Fe,d.imageBlockConfig=Jt,d.imageParse=Qt,d.imagePropSchema=Zt,d.imageRender=Yt,d.imageToExternalHTML=eo,d.inheritedProps=je,d.initializeESMDependencies=we,d.inlineContentToNodes=N,d.insertOrUpdateBlock=P,d.isAppleOS=_t,d.isLinkInlineContent=Ie,d.isPartialLinkInlineContent=Pe,d.isSafari=Ri,d.isStyledTextInlineContent=Z,d.linkToolbarPluginKey=Oo,d.locales=Ii,d.mappingFactory=Da,d.markdownToBlocks=So,d.mergeCSSClasses=O,d.nodeToBlock=x,d.nodeToCustomInlineContent=_e,d.parseEmbedElement=We,d.parseFigureElement=pe,d.parseImageElement=qe,d.partialBlockToBlockForTesting=st,d.partialBlocksToBlocksForTesting=Va,d.propsToAttributes=De,d.sideMenuPluginKey=Ko,d.stylePropsToAttributes=Bt,d.tableContentToNodes=ne,d.tableHandlesPluginKey=oe,d.updateBlock=po,d.updateBlockCommand=B,d.uploadToTmpFilesDotOrg_DEV_ONLY=Wi,d.videoBlockConfig=ao,d.videoParse=lo,d.videoPropSchema=no,d.videoRender=ro,d.videoToExternalHTML=so,d.wrapInBlockStructure=se,Object.defineProperty(d,Symbol.toStringTag,{value:"Module"})});
|
|
8
|
+
`),!0):e.chain().command(({tr:n})=>(n.delete(t.pos-2,t.pos),!0)).exitCode().run()},"Shift-Enter":({editor:e})=>{const{$from:t}=e.state.selection;return e.isActive(this.name)?(e.chain().insertContentAt(t.pos-t.parentOffset+t.parent.nodeSize,{type:"paragraph"}).run(),!0):!1}}}}),Vt=K(Rt,ye);function Xi(e){var t;return K(Rt.configure(e),{language:{default:e.defaultLanguage||ye.language.default,values:((t=e.supportedLanguages)==null?void 0:t.map(o=>o.id))||ye.language.values}})}const Fe=e=>({url:e.src||void 0}),zt={backgroundColor:S.backgroundColor,name:{default:""},url:{default:""},caption:{default:""}},Ft={type:"file",propSchema:zt,content:"none",isFileBlock:!0},Gt=(e,t)=>ke(e,t),$t=e=>{if(e.tagName==="EMBED")return Fe(e);if(e.tagName==="FIGURE"){const t=ue(e,"embed");if(!t)return;const{targetElement:o,caption:i}=t;return{...Fe(o),caption:i}}},Wt=e=>{if(!e.props.url){const o=document.createElement("p");return o.textContent="Add file",{dom:o}}const t=document.createElement("a");return t.href=e.props.url,t.textContent=e.props.name||e.props.url,e.props.caption?pe(t,e.props.caption):{dom:t}},Kt=de(Ft,{render:Gt,parse:$t,toExternalHTML:Wt}),Ge=(e,t,o,i,n,a)=>{const{dom:r,destroy:s}=ke(e,t,o,n,a),l=r;e.props.url&&e.props.showPreview&&(l.style.width=`${e.props.previewWidth}px`);const u=document.createElement("div");u.className="bn-resize-handle",u.style.left="4px";const c=document.createElement("div");c.className="bn-resize-handle",c.style.right="4px";let p,m=e.props.previewWidth;const f=x=>{if(!p){!t.isEditable&&i.contains(u)&&i.contains(c)&&(i.removeChild(u),i.removeChild(c));return}let O;e.props.textAlignment==="center"?p.handleUsed==="left"?O=p.initialWidth+(p.initialClientX-x.clientX)*2:O=p.initialWidth+(x.clientX-p.initialClientX)*2:p.handleUsed==="left"?O=p.initialWidth+p.initialClientX-x.clientX:O=p.initialWidth+x.clientX-p.initialClientX,m=Math.max(O,64),l.style.width=`${m}px`},g=x=>{(!x.target||!l.contains(x.target)||!t.isEditable)&&i.contains(u)&&i.contains(c)&&(i.removeChild(u),i.removeChild(c)),p&&(p=void 0,t.updateBlock(e,{props:{previewWidth:m}}))},b=()=>{t.isEditable&&(i.appendChild(u),i.appendChild(c))},y=x=>{x.relatedTarget===u||x.relatedTarget===c||p||t.isEditable&&i.contains(u)&&i.contains(c)&&(i.removeChild(u),i.removeChild(c))},w=x=>{x.preventDefault(),p={handleUsed:"left",initialWidth:l.clientWidth,initialClientX:x.clientX}},M=x=>{x.preventDefault(),p={handleUsed:"right",initialWidth:l.clientWidth,initialClientX:x.clientX}};return window.addEventListener("mousemove",f),window.addEventListener("mouseup",g),l.addEventListener("mouseenter",b),l.addEventListener("mouseleave",y),u.addEventListener("mousedown",w),c.addEventListener("mousedown",M),{dom:l,destroy:()=>{s==null||s(),window.removeEventListener("mousemove",f),window.removeEventListener("mouseup",g),l.removeEventListener("mouseenter",b),l.removeEventListener("mouseleave",y),u.removeEventListener("mousedown",w),c.removeEventListener("mousedown",M)}}},Zi=async e=>{const t=new FormData;return t.append("file",e),(await(await fetch("https://tmpfiles.org/api/v1/upload",{method:"POST",body:t})).json()).data.url.replace("tmpfiles.org/","tmpfiles.org/dl/")},qt=e=>{const t=e.src||void 0,o=e.width||void 0;return{url:t,previewWidth:o}},Xt='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M5 11.1005L7 9.1005L12.5 14.6005L16 11.1005L19 14.1005V5H5V11.1005ZM4 3H20C20.5523 3 21 3.44772 21 4V20C21 20.5523 20.5523 21 20 21H4C3.44772 21 3 20.5523 3 20V4C3 3.44772 3.44772 3 4 3ZM15.5 10C14.6716 10 14 9.32843 14 8.5C14 7.67157 14.6716 7 15.5 7C16.3284 7 17 7.67157 17 8.5C17 9.32843 16.3284 10 15.5 10Z"></path></svg>',Zt={textAlignment:S.textAlignment,backgroundColor:S.backgroundColor,name:{default:""},url:{default:""},caption:{default:""},showPreview:{default:!0},previewWidth:{default:512}},Jt={type:"image",propSchema:Zt,content:"none",isFileBlock:!0,fileBlockAccept:["image/*"]},Yt=(e,t)=>{const o=document.createElement("div");o.innerHTML=Xt;const i=document.createElement("div");i.className="bn-visual-media-wrapper";const n=document.createElement("img");return n.className="bn-visual-media",t.resolveFileUrl?t.resolveFileUrl(e.props.url).then(a=>{n.src=a}):n.src=e.props.url,n.alt=e.props.name||e.props.caption||"BlockNote image",n.contentEditable="false",n.draggable=!1,i.appendChild(n),Ge(e,t,{dom:i},i,t.dictionary.file_blocks.image.add_button_text,o.firstElementChild)},Qt=e=>{if(e.tagName==="IMG")return qt(e);if(e.tagName==="FIGURE"){const t=ue(e,"img");if(!t)return;const{targetElement:o,caption:i}=t;return{...qt(o),caption:i}}},eo=e=>{if(!e.props.url){const o=document.createElement("p");return o.textContent="Add image",{dom:o}}let t;return e.props.showPreview?(t=document.createElement("img"),t.src=e.props.url,t.alt=e.props.name||e.props.caption||"BlockNote image",t.width=e.props.previewWidth):(t=document.createElement("a"),t.href=e.props.url,t.textContent=e.props.name||e.props.url),e.props.caption?e.props.showPreview?_e(t,e.props.caption):pe(t,e.props.caption):{dom:t}},to=de(Jt,{render:Yt,parse:Qt,toExternalHTML:eo}),Ji=35,$e=120,Yi=31,Qi=k.Extension.create({name:"BlockNoteTableExtension",addProseMirrorPlugins:()=>[U.columnResizing({cellMinWidth:Ji,defaultCellMinWidth:$e,View:null}),U.tableEditing()],addKeyboardShortcuts(){return{Enter:()=>this.editor.state.selection.empty&&this.editor.state.selection.$head.parent.type.name==="tableParagraph"?(this.editor.commands.setHardBreak(),!0):!1,Backspace:()=>{const e=this.editor.state.selection,t=e.empty,o=e.$head.parentOffset===0,i=e.$head.node().type.name==="tableParagraph";return t&&o&&i},Tab:()=>this.editor.commands.command(({state:e,dispatch:t,view:o})=>U.goToNextCell(1)(e,t,o)),"Shift-Tab":()=>this.editor.commands.command(({state:e,dispatch:t,view:o})=>U.goToNextCell(-1)(e,t,o))}},extendNodeSchema(e){const t={name:e.name,options:e.options,storage:e.storage};return{tableRole:k.callOrReturn(k.getExtensionField(e,"tableRole",t))}}}),oo=e=>{const t=e.src||void 0,o=e.width||void 0;return{url:t,previewWidth:o}},io='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M2 3.9934C2 3.44476 2.45531 3 2.9918 3H21.0082C21.556 3 22 3.44495 22 3.9934V20.0066C22 20.5552 21.5447 21 21.0082 21H2.9918C2.44405 21 2 20.5551 2 20.0066V3.9934ZM8 5V19H16V5H8ZM4 5V7H6V5H4ZM18 5V7H20V5H18ZM4 9V11H6V9H4ZM18 9V11H20V9H18ZM4 13V15H6V13H4ZM18 13V15H20V13H18ZM4 17V19H6V17H4ZM18 17V19H20V17H18Z"></path></svg>',no={textAlignment:S.textAlignment,backgroundColor:S.backgroundColor,name:{default:""},url:{default:""},caption:{default:""},showPreview:{default:!0},previewWidth:{default:512}},ao={type:"video",propSchema:no,content:"none",isFileBlock:!0,fileBlockAccept:["video/*"]},ro=(e,t)=>{const o=document.createElement("div");o.innerHTML=io;const i=document.createElement("div");i.className="bn-visual-media-wrapper";const n=document.createElement("video");return n.className="bn-visual-media",t.resolveFileUrl?t.resolveFileUrl(e.props.url).then(a=>{n.src=a}):n.src=e.props.url,n.controls=!0,n.contentEditable="false",n.draggable=!1,n.width=e.props.previewWidth,i.appendChild(n),Ge(e,t,{dom:i},i,t.dictionary.file_blocks.video.add_button_text,o.firstElementChild)},so=e=>{if(e.tagName==="VIDEO")return oo(e);if(e.tagName==="FIGURE"){const t=ue(e,"video");if(!t)return;const{targetElement:o,caption:i}=t;return{...oo(o),caption:i}}},lo=e=>{if(!e.props.url){const o=document.createElement("p");return o.textContent="Add video",{dom:o}}let t;return e.props.showPreview?(t=document.createElement("video"),t.src=e.props.url,t.width=e.props.previewWidth):(t=document.createElement("a"),t.href=e.props.url,t.textContent=e.props.name||e.props.url),e.props.caption?e.props.showPreview?_e(t,e.props.caption):pe(t,e.props.caption):{dom:t}},co=de(ao,{render:ro,parse:so,toExternalHTML:lo}),en=k.Mark.create({name:"backgroundColor",addAttributes(){return{stringValue:{default:void 0,parseHTML:e=>e.getAttribute("data-background-color"),renderHTML:e=>({"data-background-color":e.stringValue})}}},parseHTML(){return[{tag:"span",getAttrs:e=>typeof e=="string"?!1:e.hasAttribute("data-background-color")?{stringValue:e.getAttribute("data-background-color")}:!1}]},renderHTML({HTMLAttributes:e}){return["span",e,0]}}),tn=X(en,"string"),on=k.Mark.create({name:"textColor",addAttributes(){return{stringValue:{default:void 0,parseHTML:e=>e.getAttribute("data-text-color"),renderHTML:e=>({"data-text-color":e.stringValue})}}},parseHTML(){return[{tag:"span",getAttrs:e=>typeof e=="string"?!1:e.hasAttribute("data-text-color")?{stringValue:e.getAttribute("data-text-color")}:!1}]},renderHTML({HTMLAttributes:e}){return["span",e,0]}}),nn=X(on,"string"),T=(e,t,o)=>({state:i,dispatch:n})=>{const a=Q(i.doc.resolve(t));if(n){const r=i.schema.nodes[a.blockNoteType],s=i.schema.nodes[o.type||a.blockNoteType],l=s.isInGroup("bnBlock")?s:i.schema.nodes.blockContainer;if(a.isBlockContainer&&s.isInGroup("blockContent"))uo(o,i,e,a),an(o,i,e,r,s,a);else if(!a.isBlockContainer&&s.isInGroup("bnBlock"))uo(o,i,e,a);else{const u=E(a.bnBlock.node,e.schema.blockSchema,e.schema.inlineContentSchema,e.schema.styleSchema,e.blockCache);return i.tr.replaceWith(a.bnBlock.beforePos,a.bnBlock.afterPos,q({children:u.children,...o},i.schema,e.schema.styleSchema)),!0}i.tr.setNodeMarkup(a.bnBlock.beforePos,l,{...a.bnBlock.node.attrs,...o.props})}return!0};function an(e,t,o,i,n,a){let r="keep";if(e.content)if(typeof e.content=="string")r=H([e.content],t.schema,o.schema.styleSchema);else if(Array.isArray(e.content))r=H(e.content,t.schema,o.schema.styleSchema);else if(e.content.type==="tableContent")r=ae(e.content,t.schema,o.schema.styleSchema);else throw new j(e.content.type);else i.spec.content===""||n.spec.content!==i.spec.content&&(r=[]);r==="keep"?t.tr.setNodeMarkup(a.blockContent.beforePos,e.type===void 0?void 0:t.schema.nodes[e.type],{...a.blockContent.node.attrs,...e.props}):t.tr.replaceWith(a.blockContent.beforePos,a.blockContent.afterPos,n.createChecked({...a.blockContent.node.attrs,...e.props},r))}function uo(e,t,o,i){if(e.children!==void 0){const n=e.children.map(a=>q(a,t.schema,o.schema.styleSchema));if(i.childContainer)t.tr.step(new fe.ReplaceStep(i.childContainer.beforePos+1,i.childContainer.afterPos-1,new v.Slice(v.Fragment.from(n),0,0)));else{if(!i.isBlockContainer)throw new Error("impossible");t.tr.insert(i.blockContent.afterPos,t.schema.nodes.blockGroup.createChecked({},n))}}}function po(e,t,o){const i=e._tiptapEditor,n=typeof t=="string"?t:t.id,a=P(n,i.state.doc);if(!a)throw new Error(`Block with ID ${n} not found`);i.commands.command(({state:s,dispatch:l})=>(T(e,a.posBeforeNode,o)({state:s,dispatch:l}),!0));const r=i.state.doc.resolve(a.posBeforeNode+1).node();return E(r,e.schema.blockSchema,e.schema.inlineContentSchema,e.schema.styleSchema,e.blockCache)}const rn={...S,level:{default:1,values:[1,2,3]}},sn=W({name:"heading",content:"inline*",group:"blockContent",addAttributes(){return{level:{default:1,parseHTML:e=>{const t=e.getAttribute("data-level"),o=parseInt(t);if(isFinite(o))return o},renderHTML:e=>({"data-level":e.level.toString()})}}},addInputRules(){return[...[1,2,3].map(e=>new k.InputRule({find:new RegExp(`^(#{${e}})\\s$`),handler:({state:t,chain:o,range:i})=>{const n=C(t);!n.isBlockContainer||n.blockContent.node.type.spec.content!=="inline*"||o().command(T(this.options.editor,n.bnBlock.beforePos,{type:"heading",props:{level:e}})).deleteRange({from:i.from,to:i.to}).run()}}))]},addKeyboardShortcuts(){return{"Mod-Alt-1":()=>{const e=C(this.editor.state);return!e.isBlockContainer||e.blockContent.node.type.spec.content!=="inline*"?!0:this.editor.commands.command(T(this.options.editor,e.bnBlock.beforePos,{type:"heading",props:{level:1}}))},"Mod-Alt-2":()=>{const e=C(this.editor.state);return!e.isBlockContainer||e.blockContent.node.type.spec.content!=="inline*"?!0:this.editor.commands.command(T(this.options.editor,e.bnBlock.beforePos,{type:"heading",props:{level:2}}))},"Mod-Alt-3":()=>{const e=C(this.editor.state);return!e.isBlockContainer||e.blockContent.node.type.spec.content!=="inline*"?!0:this.editor.commands.command(T(this.options.editor,e.bnBlock.beforePos,{type:"heading",props:{level:3}}))}}},parseHTML(){return[{tag:"div[data-content-type="+this.name+"]",getAttrs:e=>typeof e=="string"?!1:{level:e.getAttribute("data-level")}},{tag:"h1",attrs:{level:1},node:"heading"},{tag:"h2",attrs:{level:2},node:"heading"},{tag:"h3",attrs:{level:3},node:"heading"}]},renderHTML({node:e,HTMLAttributes:t}){var o,i;return R(this.name,`h${e.attrs.level}`,{...((o=this.options.domAttributes)==null?void 0:o.blockContent)||{},...t},((i=this.options.domAttributes)==null?void 0:i.inlineContent)||{})}}),ln=K(sn,rn),ho=(e,t,o)=>({state:i,dispatch:n})=>{const a=z(i.doc,e),r=F(a);if(!r.isBlockContainer)throw new Error(`BlockContainer expected when calling splitBlock, position ${e}`);const s=[{type:r.bnBlock.node.type,attrs:o?{...r.bnBlock.node.attrs,id:void 0}:{}},{type:t?r.blockContent.node.type:i.schema.nodes.paragraph,attrs:o?{...r.blockContent.node.attrs}:{}}];return n&&i.tr.split(e,2,s),!0},We=e=>{const t=e._tiptapEditor,o=C(t.state);if(!o.isBlockContainer)return!1;const{bnBlock:i,blockContent:n}=o,a=t.state.selection.anchor===t.state.selection.head;return!(n.node.type.name==="bulletListItem"||n.node.type.name==="numberedListItem"||n.node.type.name==="checkListItem")||!a?!1:t.commands.first(({state:r,chain:s,commands:l})=>[()=>l.command(()=>n.node.childCount===0?l.command(T(e,i.beforePos,{type:"paragraph",props:{}})):!1),()=>l.command(()=>n.node.childCount>0?(s().deleteSelection().command(ho(r.selection.from,!0)).run(),!0):!1)])},dn={...S},cn=W({name:"bulletListItem",content:"inline*",group:"blockContent",priority:90,addInputRules(){return[new k.InputRule({find:new RegExp("^[-+*]\\s$"),handler:({state:e,chain:t,range:o})=>{const i=C(e);!i.isBlockContainer||i.blockContent.node.type.spec.content!=="inline*"||t().command(T(this.options.editor,i.bnBlock.beforePos,{type:"bulletListItem",props:{}})).deleteRange({from:o.from,to:o.to})}})]},addKeyboardShortcuts(){return{Enter:()=>We(this.options.editor),"Mod-Shift-8":()=>{const e=C(this.editor.state);return!e.isBlockContainer||e.blockContent.node.type.spec.content!=="inline*"?!0:this.editor.commands.command(T(this.options.editor,e.bnBlock.beforePos,{type:"bulletListItem",props:{}}))}}},parseHTML(){return[{tag:"div[data-content-type="+this.name+"]"},{tag:"li",getAttrs:e=>{if(typeof e=="string")return!1;const t=e.parentElement;return t===null?!1:t.tagName==="UL"||t.tagName==="DIV"&&t.parentElement.tagName==="UL"?{}:!1},node:"bulletListItem"},{tag:"p",getAttrs:e=>{if(typeof e=="string")return!1;const t=e.parentElement;return t===null?!1:t.getAttribute("data-content-type")==="bulletListItem"?{}:!1},priority:300,node:"bulletListItem"}]},renderHTML({HTMLAttributes:e}){var t,o;return R(this.name,"p",{...((t=this.options.domAttributes)==null?void 0:t.blockContent)||{},...e},((o=this.options.domAttributes)==null?void 0:o.inlineContent)||{})}}),un=K(cn,dn),pn={...S,checked:{default:!1}},hn=W({name:"checkListItem",content:"inline*",group:"blockContent",addAttributes(){return{checked:{default:!1,parseHTML:e=>e.getAttribute("data-checked")==="true"||void 0,renderHTML:e=>e.checked?{"data-checked":e.checked.toString()}:{}}}},addInputRules(){return[new k.InputRule({find:new RegExp("\\[\\s*\\]\\s$"),handler:({state:e,chain:t,range:o})=>{const i=C(e);!i.isBlockContainer||i.blockContent.node.type.spec.content!=="inline*"||t().command(T(this.options.editor,i.bnBlock.beforePos,{type:"checkListItem",props:{checked:!1}})).deleteRange({from:o.from,to:o.to})}}),new k.InputRule({find:new RegExp("\\[[Xx]\\]\\s$"),handler:({state:e,chain:t,range:o})=>{const i=C(e);!i.isBlockContainer||i.blockContent.node.type.spec.content!=="inline*"||t().command(T(this.options.editor,i.bnBlock.beforePos,{type:"checkListItem",props:{checked:!0}})).deleteRange({from:o.from,to:o.to})}})]},addKeyboardShortcuts(){return{Enter:()=>We(this.options.editor),"Mod-Shift-9":()=>{const e=C(this.editor.state);return!e.isBlockContainer||e.blockContent.node.type.spec.content!=="inline*"?!0:this.editor.commands.command(T(this.options.editor,e.bnBlock.beforePos,{type:"checkListItem",props:{}}))}}},parseHTML(){return[{tag:"div[data-content-type="+this.name+"]"},{tag:"input",getAttrs:e=>typeof e=="string"?!1:e.type==="checkbox"?{checked:e.checked}:!1,node:"checkListItem"},{tag:"li",getAttrs:e=>{if(typeof e=="string")return!1;const t=e.parentElement;if(t===null)return!1;if(t.tagName==="UL"||t.tagName==="DIV"&&t.parentElement.tagName==="UL"){const o=e.querySelector("input[type=checkbox]")||null;return o===null?!1:{checked:o.checked}}return!1},node:"checkListItem"}]},renderHTML({node:e,HTMLAttributes:t}){var a,r;const o=document.createElement("input");o.type="checkbox",o.checked=e.attrs.checked,e.attrs.checked&&o.setAttribute("checked","");const{dom:i,contentDOM:n}=R(this.name,"p",{...((a=this.options.domAttributes)==null?void 0:a.blockContent)||{},...t},((r=this.options.domAttributes)==null?void 0:r.inlineContent)||{});return i.insertBefore(o,n),{dom:i,contentDOM:n}},addNodeView(){return({node:e,getPos:t,editor:o,HTMLAttributes:i})=>{var c,p;const n=document.createElement("div"),a=document.createElement("div");a.contentEditable="false";const r=document.createElement("input");r.type="checkbox",r.checked=e.attrs.checked,e.attrs.checked&&r.setAttribute("checked","");const s=()=>{if(!o.isEditable){r.checked=!r.checked;return}if(typeof t!="boolean"){const m=z(o.state.doc,t());if(m.node.type.name!=="blockContainer")throw new Error(`Expected blockContainer node, got ${m.node.type.name}`);this.editor.commands.command(T(this.options.editor,m.posBeforeNode,{type:"checkListItem",props:{checked:r.checked}}))}};r.addEventListener("change",s);const{dom:l,contentDOM:u}=R(this.name,"p",{...((c=this.options.domAttributes)==null?void 0:c.blockContent)||{},...i},((p=this.options.domAttributes)==null?void 0:p.inlineContent)||{});if(typeof t!="boolean"){const f="label-"+this.editor.state.doc.resolve(t()).node().attrs.id;r.setAttribute("aria-labelledby",f),u.id=f}return l.removeChild(u),l.appendChild(n),n.appendChild(a),n.appendChild(u),a.appendChild(r),{dom:l,contentDOM:u,destroy:()=>{r.removeEventListener("change",s)}}}}}),mn=K(hn,pn),fn=new _.PluginKey("numbered-list-indexing"),gn=()=>new _.Plugin({key:fn,appendTransaction:(e,t,o)=>{const i=o.tr;i.setMeta("numberedListIndexing",!0);let n=!1;return o.doc.descendants((a,r)=>{if(a.type.name==="blockContainer"&&a.firstChild.type.name==="numberedListItem"){let s="1";const l=F({posBeforeNode:r,node:a});if(!l.isBlockContainer)throw new Error("impossible");const u=i.doc.resolve(l.bnBlock.beforePos).nodeBefore;if(u){const m=F({posBeforeNode:l.bnBlock.beforePos-u.nodeSize,node:u});if(m.blockNoteType==="numberedListItem"){if(!m.isBlockContainer)throw new Error("impossible");const g=m.blockContent.node.attrs.index;s=(parseInt(g)+1).toString()}}const c=l.blockContent.node;c.attrs.index!==s&&(n=!0,i.setNodeMarkup(l.blockContent.beforePos,void 0,{...c.attrs,index:s}))}}),n?i:null}}),bn={...S},kn=W({name:"numberedListItem",content:"inline*",group:"blockContent",priority:90,addAttributes(){return{index:{default:null,parseHTML:e=>e.getAttribute("data-index"),renderHTML:e=>({"data-index":e.index})}}},addInputRules(){return[new k.InputRule({find:new RegExp("^1\\.\\s$"),handler:({state:e,chain:t,range:o})=>{const i=C(e);!i.isBlockContainer||i.blockContent.node.type.spec.content!=="inline*"||t().command(T(this.options.editor,i.bnBlock.beforePos,{type:"numberedListItem",props:{}})).deleteRange({from:o.from,to:o.to})}})]},addKeyboardShortcuts(){return{Enter:()=>We(this.options.editor),"Mod-Shift-7":()=>{const e=C(this.editor.state);return!e.isBlockContainer||e.blockContent.node.type.spec.content!=="inline*"?!0:this.editor.commands.command(T(this.options.editor,e.bnBlock.beforePos,{type:"numberedListItem",props:{}}))}}},addProseMirrorPlugins(){return[gn()]},parseHTML(){return[{tag:"div[data-content-type="+this.name+"]"},{tag:"li",getAttrs:e=>{if(typeof e=="string")return!1;const t=e.parentElement;return t===null?!1:t.tagName==="OL"||t.tagName==="DIV"&&t.parentElement.tagName==="OL"?{}:!1},node:"numberedListItem"},{tag:"p",getAttrs:e=>{if(typeof e=="string")return!1;const t=e.parentElement;return t===null?!1:t.getAttribute("data-content-type")==="numberedListItem"?{}:!1},priority:300,node:"numberedListItem"}]},renderHTML({HTMLAttributes:e}){var t,o;return R(this.name,"p",{...((t=this.options.domAttributes)==null?void 0:t.blockContent)||{},...e},((o=this.options.domAttributes)==null?void 0:o.inlineContent)||{})}}),_n=K(kn,bn),yn={...S},wn=W({name:"paragraph",content:"inline*",group:"blockContent",addKeyboardShortcuts(){return{"Mod-Alt-0":()=>{const e=C(this.editor.state);return!e.isBlockContainer||e.blockContent.node.type.spec.content!=="inline*"?!0:this.editor.commands.command(T(this.options.editor,e.bnBlock.beforePos,{type:"paragraph",props:{}}))}}},parseHTML(){return[{tag:"div[data-content-type="+this.name+"]"},{tag:"p",priority:200,getAttrs:e=>{var t;return typeof e=="string"||!((t=e.textContent)!=null&&t.trim())?!1:{}},node:"paragraph"}]},renderHTML({HTMLAttributes:e}){var t,o;return R(this.name,"p",{...((t=this.options.domAttributes)==null?void 0:t.blockContent)||{},...e},((o=this.options.domAttributes)==null?void 0:o.inlineContent)||{})}}),vn=K(wn,yn),Cn={textColor:S.textColor},xn=W({name:"table",content:"tableRow+",group:"blockContent",tableRole:"table",isolating:!0,parseHTML(){return[{tag:"table"}]},renderHTML({HTMLAttributes:e}){var t,o;return R(this.name,"table",{...((t=this.options.domAttributes)==null?void 0:t.blockContent)||{},...e},((o=this.options.domAttributes)==null?void 0:o.inlineContent)||{})},addNodeView(){return({node:e,HTMLAttributes:t})=>{var i;class o extends U.TableView{constructor(a,r,s){super(a,r),this.node=a,this.cellMinWidth=r,this.blockContentHTMLAttributes=s;const l=document.createElement("div");l.className=$("bn-block-content",s.class),l.setAttribute("data-content-type","table");for(const[m,f]of Object.entries(s))m!=="class"&&l.setAttribute(m,f);const u=this.dom,c=document.createElement("div");c.className="tableWrapper-inner",c.appendChild(u.firstChild),u.appendChild(c),l.appendChild(u);const p=document.createElement("div");p.className="table-widgets-container",p.style.position="relative",u.appendChild(p),this.dom=l}ignoreMutation(a){return!a.target.closest(".tableWrapper-inner")||super.ignoreMutation(a)}}return new o(e,$e,{...((i=this.options.domAttributes)==null?void 0:i.blockContent)||{},...t})}}}),En=k.Node.create({name:"tableParagraph",group:"tableContent",content:"inline*",parseHTML(){return[{preserveWhitespace:"full",priority:210,context:"tableContent",tag:"p",getAttrs:e=>({})},{tag:"p",getAttrs:e=>{if(typeof e=="string"||!e.textContent)return!1;const t=e.parentElement;return t===null?!1:t.tagName==="TD"?{}:!1}}]},renderHTML({HTMLAttributes:e}){return["p",e,0]}}),Sn=K(xn,Cn,[Qi,En,gi.TableHeader.extend({content:"tableContent"}),fi.TableCell.extend({content:"tableContent"}),bi.TableRow]),Ke={paragraph:vn,heading:ln,codeBlock:Vt,bulletListItem:un,numberedListItem:_n,checkListItem:mn,table:Sn,file:Kt,image:to,video:co,audio:Ot},mo=He(Ke),qe={bold:X(Bi.default,"boolean"),italic:X(Mi.default,"boolean"),underline:X(Li.default,"boolean"),strike:X(Ii.default,"boolean"),code:X(Ti.default,"boolean"),textColor:nn,backgroundColor:tn},Bn=ze(qe),Xe={text:{config:"text",implementation:{}},link:{config:"link",implementation:{}}},fo=Re(Xe);function A(e,t){return e in t.schema.blockSchema&&t.schema.blockSchema[e]===mo[e]}function go(e,t){return e in t.schema.inlineContentSchema&&t.schema.inlineContentSchema[e]===fo[e]}function bo(e,t,o){return t.type===e&&t.type in o.schema.blockSchema&&A(t.type,o)}function Tn(e,t){return e.type in t.schema.blockSchema&&t.schema.blockSchema[e.type].isFileBlock||!1}function Mn(e,t){return e.type in t.schema.blockSchema&&t.schema.blockSchema[e.type].isFileBlock&&"showPreview"in t.schema.blockSchema[e.type].propSchema||!1}function In(e,t){return t.schema.blockSchema[e.type].isFileBlock&&!e.props.url}function ko(e,t,o){return t in o.schema.blockSchema&&e in o.schema.blockSchema[t].propSchema&&o.schema.blockSchema[t].propSchema[e]===S[e]}function Ln(e,t,o){return ko(e,t.type,o)}function Pn(e,t){const o=typeof t=="string"?t:t.id,i=P(o,e._tiptapEditor.state.doc);if(i)return E(i.node,e.schema.blockSchema,e.schema.inlineContentSchema,e.schema.styleSchema,e.blockCache)}function An(e,t){const o=typeof t=="string"?t:t.id,i=P(o,e._tiptapEditor.state.doc);if(!i)return;const a=e._tiptapEditor.state.doc.resolve(i.posBeforeNode).nodeBefore;if(a)return E(a,e.schema.blockSchema,e.schema.inlineContentSchema,e.schema.styleSchema,e.blockCache)}function Nn(e,t){const o=typeof t=="string"?t:t.id,i=P(o,e._tiptapEditor.state.doc);if(!i)return;const a=e._tiptapEditor.state.doc.resolve(i.posBeforeNode+i.node.nodeSize).nodeAfter;if(a)return E(a,e.schema.blockSchema,e.schema.inlineContentSchema,e.schema.styleSchema,e.blockCache)}function Dn(e,t){const o=typeof t=="string"?t:t.id,i=P(o,e._tiptapEditor.state.doc);if(!i)return;const n=e._tiptapEditor.state.doc.resolve(i.posBeforeNode),a=n.node(),r=n.node(-1),s=r.type.name!=="doc"?a.type.name==="blockGroup"?r:a:void 0;if(s)return E(s,e.schema.blockSchema,e.schema.inlineContentSchema,e.schema.styleSchema,e.blockCache)}function jn(e,t,o,i="before"){const n=typeof o=="string"?o:o.id,a=[];for(const l of t)a.push(q(l,e.pmSchema,e.schema.styleSchema));const r=P(n,e._tiptapEditor.state.doc);if(!r)throw new Error(`Block with ID ${n} not found`);i==="before"&&e.dispatch(e._tiptapEditor.state.tr.insert(r.posBeforeNode,a)),i==="after"&&e.dispatch(e._tiptapEditor.state.tr.insert(r.posBeforeNode+r.node.nodeSize,a));const s=[];for(const l of a)s.push(E(l,e.schema.blockSchema,e.schema.inlineContentSchema,e.schema.styleSchema,e.blockCache));return s}function Hn(e){const t=e._tiptapEditor.state,o=t.selection,i=z(t.doc,o.anchor);if(o instanceof U.CellSelection)return{type:"cell",anchorBlockId:i.node.attrs.id,anchorCellOffset:o.$anchorCell.pos-i.posBeforeNode,headCellOffset:o.$headCell.pos-i.posBeforeNode};if(e._tiptapEditor.state.selection instanceof _.NodeSelection)return{type:"node",anchorBlockId:i.node.attrs.id};{const n=z(t.doc,o.head);return{type:"text",anchorBlockId:i.node.attrs.id,headBlockId:n.node.attrs.id,anchorOffset:o.anchor-i.posBeforeNode,headOffset:o.head-n.posBeforeNode}}}function On(e,t){var n,a;const o=(n=P(t.anchorBlockId,e._tiptapEditor.state.doc))==null?void 0:n.posBeforeNode;if(o===void 0)throw new Error(`Could not find block with ID ${t.anchorBlockId} to update selection`);let i;if(t.type==="cell")i=U.CellSelection.create(e._tiptapEditor.state.doc,o+t.anchorCellOffset,o+t.headCellOffset);else if(t.type==="node")i=_.NodeSelection.create(e._tiptapEditor.state.doc,o+1);else{const r=(a=P(t.headBlockId,e._tiptapEditor.state.doc))==null?void 0:a.posBeforeNode;if(r===void 0)throw new Error(`Could not find block with ID ${t.headBlockId} to update selection`);i=_.TextSelection.create(e._tiptapEditor.state.doc,o+t.anchorOffset,r+t.headOffset)}e.dispatch(e._tiptapEditor.state.tr.setSelection(i))}function Ze(e){return e.map(t=>t.type==="columnList"?t.children.map(o=>Ze(o.children)).flat():{...t,children:Ze(t.children)}).flat()}function _o(e,t,o){var a;const i=((a=e.getSelection())==null?void 0:a.blocks)||[e.getTextCursorPosition().block],n=Hn(e);e.removeBlocks(i),e.insertBlocks(Ze(i),t,o),On(e,n)}function yo(e){return!e||e.type!=="columnList"}function wo(e,t,o){let i,n;if(t?t.children.length>0?(i=t.children[t.children.length-1],n="after"):(i=t,n="before"):o&&(i=o,n="before"),!i||!n)return;const a=e.getParentBlock(i);return yo(a)?{referenceBlock:i,placement:n}:wo(e,n==="after"?i:e.getPrevBlock(i),a)}function vo(e,t,o){let i,n;if(t?t.children.length>0?(i=t.children[0],n="before"):(i=t,n="after"):o&&(i=o,n="after"),!i||!n)return;const a=e.getParentBlock(i);return yo(a)?{referenceBlock:i,placement:n}:vo(e,n==="before"?i:e.getNextBlock(i),a)}function Un(e){const t=e.getSelection(),o=(t==null?void 0:t.blocks[0])||e.getTextCursorPosition().block,i=wo(e,e.getPrevBlock(o),e.getParentBlock(o));i&&_o(e,i.referenceBlock,i.placement)}function Rn(e){const t=e.getSelection(),o=(t==null?void 0:t.blocks[(t==null?void 0:t.blocks.length)-1])||e.getTextCursorPosition().block,i=vo(e,e.getNextBlock(o),e.getParentBlock(o));i&&_o(e,i.referenceBlock,i.placement)}function Vn(e,t){return function({state:o,dispatch:i}){const{$from:n,$to:a}=o.selection,r=n.blockRange(a,c=>c.childCount>0&&(c.type.name==="blockGroup"||c.type.name==="column"));if(!r)return!1;const s=r.startIndex;if(s===0)return!1;const u=r.parent.child(s-1);if(u.type!==e)return!1;if(i){const c=u.lastChild&&u.lastChild.type===t,p=v.Fragment.from(c?e.create():null),m=new v.Slice(v.Fragment.from(e.create(null,v.Fragment.from(t.create(null,p)))),c?3:1,0),f=r.start,g=r.end;i(o.tr.step(new fe.ReplaceAroundStep(f-(c?3:1),g,f,g,m,1,!0)).scrollIntoView())}return!0}}function Co(e){return e._tiptapEditor.commands.command(Vn(e._tiptapEditor.schema.nodes.blockContainer,e._tiptapEditor.schema.nodes.blockGroup))}function zn(e){e._tiptapEditor.commands.liftListItem("blockContainer")}function Fn(e){const{bnBlock:t}=C(e._tiptapEditor.state);return e._tiptapEditor.state.doc.resolve(t.beforePos).nodeBefore!==null}function Gn(e){const{bnBlock:t}=C(e._tiptapEditor.state);return e._tiptapEditor.state.doc.resolve(t.beforePos).depth>1}function xo(e,t,o){const i=e._tiptapEditor;let n=i.state.tr;const a=[];for(const p of o)a.push(q(p,e.pmSchema,e.schema.styleSchema));const r=new Set(t.map(p=>typeof p=="string"?p:p.id)),s=[],l=typeof t[0]=="string"?t[0]:t[0].id;let u=0;if(i.state.doc.descendants((p,m)=>{if(r.size===0)return!1;if(!p.type.isInGroup("bnBlock")||!r.has(p.attrs.id))return!0;if(s.push(E(p,e.schema.blockSchema,e.schema.inlineContentSchema,e.schema.styleSchema,e.blockCache)),r.delete(p.attrs.id),o.length>0&&p.attrs.id===l){const y=n.doc.nodeSize;n=n.insert(m,a);const w=n.doc.nodeSize;u+=y-w}const f=n.doc.nodeSize,g=n.doc.resolve(m-u);g.node().type.name==="blockGroup"&&g.node(g.depth-1).type.name!=="doc"&&g.node().childCount===1?n=n.delete(g.before(),g.after()):n=n.delete(m-u,m-u+p.nodeSize);const b=n.doc.nodeSize;return u+=f-b,!1}),r.size>0){const p=[...r].join(`
|
|
9
|
+
`);throw Error("Blocks with the following IDs could not be found in the editor: "+p)}e.dispatch(n);const c=[];for(const p of a)c.push(E(p,e.schema.blockSchema,e.schema.inlineContentSchema,e.schema.styleSchema,e.blockCache));return{insertedBlocks:c,removedBlocks:s}}function $n(e,t,o){return xo(e,t,o)}function Wn(e,t){return xo(e,t,[]).removedBlocks}function Kn(e,t,o,i={updateSelection:!0}){const n=o._tiptapEditor.state.tr;let{from:a,to:r}=typeof e=="number"?{from:e,to:e}:{from:e.from,to:e.to},s=!0,l=!0,u="";if(t.forEach(c=>{c.check(),s&&c.isText&&c.marks.length===0?u+=c.text:s=!1,l=l?c.isBlock:!1}),a===r&&l){const{parent:c}=n.doc.resolve(a);c.isTextblock&&!c.type.spec.code&&!c.childCount&&(a-=1,r+=1)}return s?n.insertText(u,a,r):n.replaceWith(a,r,t),i.updateSelection&&k.selectionToInsertionEnd(n,n.steps.length-1,-1),o.dispatch(n),!0}function qn(e){const{bnBlock:t}=C(e._tiptapEditor.state),o=e._tiptapEditor.state.doc.resolve(t.beforePos),i=o.nodeBefore,n=e._tiptapEditor.state.doc.resolve(t.afterPos).nodeAfter;let a;return o.depth>1&&(a=o.node(),a.type.isInGroup("bnBlock")||(a=o.node(o.depth-1))),{block:E(t.node,e.schema.blockSchema,e.schema.inlineContentSchema,e.schema.styleSchema,e.blockCache),prevBlock:i===null?void 0:E(i,e.schema.blockSchema,e.schema.inlineContentSchema,e.schema.styleSchema,e.blockCache),nextBlock:n===null?void 0:E(n,e.schema.blockSchema,e.schema.inlineContentSchema,e.schema.styleSchema,e.blockCache),parentBlock:a===void 0?void 0:E(a,e.schema.blockSchema,e.schema.inlineContentSchema,e.schema.styleSchema,e.blockCache)}}function Eo(e,t,o="start"){const i=typeof t=="string"?t:t.id,n=P(i,e._tiptapEditor.state.doc);if(!n)throw new Error(`Block with ID ${i} not found`);const a=F(n),r=e.schema.blockSchema[a.blockNoteType].content;if(a.isBlockContainer){const s=a.blockContent;if(r==="none"){e._tiptapEditor.commands.setNodeSelection(s.beforePos);return}if(r==="inline")o==="start"?e._tiptapEditor.commands.setTextSelection(s.beforePos+1):e._tiptapEditor.commands.setTextSelection(s.afterPos-1);else if(r==="table")o==="start"?e._tiptapEditor.commands.setTextSelection(s.beforePos+4):e._tiptapEditor.commands.setTextSelection(s.afterPos-4);else throw new j(r)}else{const s=o==="start"?a.childContainer.node.firstChild:a.childContainer.node.lastChild;Eo(e,s.attrs.id,o)}}function Xn(e){const t=e._tiptapEditor.state;if(t.selection.empty||"node"in t.selection)return;const o=t.doc.resolve(z(t.doc,t.selection.from).posBeforeNode),i=t.doc.resolve(z(t.doc,t.selection.to).posBeforeNode),n=(u,c)=>{const p=o.posAtIndex(u,c),m=t.doc.resolve(p).nodeAfter;if(!m)throw new Error(`Error getting selection - node not found at position ${p}`);return E(m,e.schema.blockSchema,e.schema.inlineContentSchema,e.schema.styleSchema,e.blockCache)},a=[],r=o.sharedDepth(i.pos),s=o.index(r),l=i.index(r);if(o.depth>r){a.push(E(o.nodeAfter,e.schema.blockSchema,e.schema.inlineContentSchema,e.schema.styleSchema,e.blockCache));for(let u=o.depth;u>r;u--)if(o.node(u).type.isInGroup("childContainer")){const p=o.index(u)+1,m=o.node(u).childCount;for(let f=p;f<m;f++)a.push(n(f,u))}}else a.push(n(s,r));for(let u=s+1;u<=l;u++)a.push(n(u,r));if(a.length===0)throw new Error(`Error getting selection - selection doesn't span any blocks (${t.selection})`);return{blocks:a}}function Zn(e,t,o){const i=typeof t=="string"?t:t.id,n=typeof o=="string"?o:o.id;if(i===n)throw new Error(`Attempting to set selection with the same anchor and head blocks (id ${i})`);const a=e._tiptapEditor.state.doc,r=P(i,a);if(!r)throw new Error(`Block with ID ${i} not found`);const s=P(n,a);if(!s)throw new Error(`Block with ID ${n} not found`);const l=F(r),u=F(s),c=e.schema.blockSchema[l.blockNoteType],p=e.schema.blockSchema[u.blockNoteType];if(!l.isBlockContainer||c.content==="none")throw new Error(`Attempting to set selection anchor in block without content (id ${i})`);if(!u.isBlockContainer||p.content==="none")throw new Error(`Attempting to set selection anchor in block without content (id ${n})`);let m,f;if(c.content==="table"){const g=U.TableMap.get(l.blockContent.node);m=l.blockContent.beforePos+g.positionAt(0,0,l.blockContent.node)+1+2}else m=l.blockContent.beforePos+1;if(p.content==="table"){const g=U.TableMap.get(u.blockContent.node),b=u.blockContent.beforePos+g.positionAt(g.height-1,g.width-1,u.blockContent.node)+1,y=a.resolve(b).nodeAfter.nodeSize;f=b+y-2}else f=u.blockContent.afterPos-1;e._tiptapEditor.dispatch(e._tiptapEditor.state.tr.setSelection(_.TextSelection.create(e._tiptapEditor.state.doc,m,f)))}d.esmDependencies=void 0;async function we(){if(d.esmDependencies)return d.esmDependencies;const e=await Promise.all([import("rehype-parse"),import("rehype-stringify"),import("unified"),import("hast-util-from-dom"),import("rehype-remark"),import("remark-gfm"),import("remark-stringify"),import("remark-parse"),import("remark-rehype"),import("rehype-format")]);return d.esmDependencies={rehypeParse:e[0],rehypeStringify:e[1],unified:e[2],hastUtilFromDom:e[3],rehypeRemark:e[4],remarkGfm:e[5],remarkStringify:e[6],remarkParse:e[7],remarkRehype:e[8],rehypeFormat:e[9]},d.esmDependencies}function Jn(){const e=t=>{let o=t.children.length;for(let i=0;i<o;i++){const n=t.children[i];if(n.type==="element"&&(e(n),n.tagName==="u"))if(n.children.length>0){t.children.splice(i,1,...n.children);const a=n.children.length-1;o+=a,i+=a}else t.children.splice(i,1),o--,i--}};return e}function Yn(){const e=d.esmDependencies;if(!e)throw new Error("addSpacesToCheckboxes requires ESM dependencies to be initialized");const t=o=>{var i;if(o.children&&"length"in o.children&&o.children.length)for(let n=o.children.length-1;n>=0;n--){const a=o.children[n],r=n+1<o.children.length?o.children[n+1]:void 0;a.type==="element"&&a.tagName==="input"&&((i=a.properties)==null?void 0:i.type)==="checkbox"&&(r==null?void 0:r.type)==="element"&&r.tagName==="p"?(r.tagName="span",r.children.splice(0,0,e.hastUtilFromDom.fromDom(document.createTextNode(" ")))):t(a)}};return t}function ve(e){const t=d.esmDependencies;if(!t)throw new Error("cleanHTMLToMarkdown requires ESM dependencies to be initialized");return t.unified.unified().use(t.rehypeParse.default,{fragment:!0}).use(Jn).use(Yn).use(t.rehypeRemark.default).use(t.remarkGfm.default).use(t.remarkStringify.default,{handlers:{text:i=>i.value}}).processSync(e).value}async function So(e,t,o,i){await we();const a=re(t,o).exportBlocks(e,i);return ve(a)}function Qn(e){return Array.prototype.indexOf.call(e.parentElement.childNodes,e)}function ea(e){return e.nodeType===3&&!/\S/.test(e.nodeValue||"")}function ta(e){e.querySelectorAll("li > ul, li > ol").forEach(t=>{const o=Qn(t),i=t.parentElement,n=Array.from(i.childNodes).slice(o+1);t.remove(),n.forEach(a=>{a.remove()}),i.insertAdjacentElement("afterend",t),n.reverse().forEach(a=>{if(ea(a))return;const r=document.createElement("li");r.append(a),t.insertAdjacentElement("afterend",r)}),i.childNodes.length===0&&i.remove()})}function oa(e){e.querySelectorAll("li + ul, li + ol").forEach(t=>{var a,r;const o=t.previousElementSibling,i=document.createElement("div");o.insertAdjacentElement("afterend",i),i.append(o);const n=document.createElement("div");for(n.setAttribute("data-node-type","blockGroup"),i.append(n);((a=i.nextElementSibling)==null?void 0:a.nodeName)==="UL"||((r=i.nextElementSibling)==null?void 0:r.nodeName)==="OL";)n.append(i.nextElementSibling)})}let Bo=null;function ia(){return Bo||(Bo=document.implementation.createHTMLDocument("title"))}function To(e){if(typeof e=="string"){const t=ia().createElement("div");t.innerHTML=e,e=t}return ta(e),oa(e),e}async function Je(e,t,o,i,n){const a=To(e),s=v.DOMParser.fromSchema(n).parse(a,{topNode:n.nodes.blockGroup.create()}),l=[];for(let u=0;u<s.childCount;u++)l.push(E(s.child(u),t,o,i));return l}function na(e,t){const o=t.value?t.value:"",i={};t.lang&&(i["data-language"]=t.lang);let n={type:"element",tagName:"code",properties:i,children:[{type:"text",value:o}]};return t.meta&&(n.data={meta:t.meta}),e.patch(t,n),n=e.applyData(t,n),n={type:"element",tagName:"pre",properties:{},children:[n]},e.patch(t,n),n}async function Mo(e,t,o,i,n){const a=await we(),r=a.unified.unified().use(a.remarkParse.default).use(a.remarkGfm.default).use(a.remarkRehype.default,{handlers:{...a.remarkRehype.defaultHandlers,code:na}}).use(a.rehypeStringify.default).processSync(e);return Je(r.value,t,o,i,n)}const Ye=["vscode-editor-data","blocknote/html","text/html","text/plain","Files"];function aa(e,t){if(!e.startsWith(".")||!t.startsWith("."))throw new Error("The strings provided are not valid file extensions.");return e===t}function ra(e,t){const o=e.split("/"),i=t.split("/");if(o.length!==2)throw new Error(`The string ${e} is not a valid MIME type.`);if(i.length!==2)throw new Error(`The string ${t} is not a valid MIME type.`);return o[1]==="*"||i[1]==="*"?o[0]===i[0]:(o[0]==="*"||i[0]==="*"||o[0]===i[0])&&o[1]===i[1]}async function Io(e,t){var r;if(!t.uploadFile){console.warn("Attempted ot insert file, but uploadFile is not set in the BlockNote editor options");return}const o="dataTransfer"in e?e.dataTransfer:e.clipboardData;if(o===null)return;let i=null;for(const s of Ye)if(o.types.includes(s)){i=s;break}if(i!=="Files")return;const n=o.items;if(!n)return;e.preventDefault();const a=Object.values(t.schema.blockSchema).filter(s=>s.isFileBlock);for(let s=0;s<n.length;s++){let l="file";for(const c of a)for(const p of c.fileBlockAccept||[]){const m=p.startsWith("."),f=n[s].getAsFile();if(f&&(!m&&f.type&&ra(n[s].type,p)||m&&aa("."+f.name.split(".").pop(),p))){l=c.type;break}}const u=n[s].getAsFile();if(u){const c={type:l,props:{name:u.name}};let p;if(e.type==="paste")p=t.insertBlocks([c],t.getTextCursorPosition().block,"after")[0].id;else if(e.type==="drop"){const g={left:e.clientX,top:e.clientY},b=(r=t.prosemirrorView)==null?void 0:r.posAtCoords(g);if(!b)return;const y=z(t._tiptapEditor.state.doc,b.pos),w=F(y);p=t.insertBlocks([c],w.bnBlock.node.attrs.id,"after")[0].id}else return;const m=await t.uploadFile(u,p),f=typeof m=="string"?{props:{url:m}}:{...m};t.updateBlock(p,f)}}}const sa=e=>k.Extension.create({name:"dropFile",addProseMirrorPlugins(){return[new _.Plugin({props:{handleDOMEvents:{drop(t,o){if(!e.isEditable)return;let i=null;for(const n of Ye)if(o.dataTransfer.types.includes(n)){i=n;break}return i===null?!0:i==="Files"?(Io(o,e),!0):!1}}}})]}});async function la(e,t){const{schema:o}=t.state;if(!e.clipboardData)return!1;const i=e.clipboardData.getData("text/plain");if(!i)return!1;if(!o.nodes.codeBlock)return t.pasteText(i),!0;const n=e.clipboardData.getData("vscode-editor-data"),a=n?JSON.parse(n):void 0,r=a==null?void 0:a.mode;return r?(t.pasteHTML(`<pre><code class="language-${r}">${i.replace(/\r\n?/g,`
|
|
10
|
+
`)}</code></pre>`),!0):!1}const da=e=>k.Extension.create({name:"pasteFromClipboard",addProseMirrorPlugins(){return[new _.Plugin({props:{handleDOMEvents:{paste(t,o){if(o.preventDefault(),!e.isEditable)return;let i;for(const a of Ye)if(o.clipboardData.types.includes(a)){i=a;break}if(!i)return!0;if(i==="vscode-editor-data")return la(o,t),!0;if(i==="Files")return Io(o,e),!0;let n=o.clipboardData.getData(i);return i==="blocknote/html"?(t.pasteHTML(n),!0):i==="text/html"?(n=To(n.trim()).innerHTML,t.pasteHTML(n),!0):(t.pasteText(n),!0)}}}})]}});function Lo(e,t){const o=[];return e.descendants(i=>{var n,a;return i.type.name==="blockContainer"&&((n=i.firstChild)==null?void 0:n.type.name)==="blockGroup"?!0:i.type.name==="columnList"&&i.childCount===1?((a=i.firstChild)==null||a.forEach(r=>{o.push(E(r,t.blockSchema,t.inlineContentSchema,t.styleSchema))}),!1):i.type.isInGroup("bnBlock")?(o.push(E(i,t.blockSchema,t.inlineContentSchema,t.styleSchema)),!1):!0}),o}function ca(e,t,o){var s;let i=!1;const n=e.state.selection instanceof U.CellSelection;if(!n){const l=e.state.doc.slice(e.state.selection.from,e.state.selection.to,!1).content,u=[];for(let c=0;c<l.childCount;c++)u.push(l.child(c));i=u.find(c=>c.type.isInGroup("bnBlock")||c.type.name==="blockGroup"||c.type.spec.group==="blockContent")===void 0,i&&(t=l)}let a;const r=re(e.state.schema,o);if(n){((s=t.firstChild)==null?void 0:s.type.name)==="table"&&(t=t.firstChild.content);const l=Oe(t,o.schema.inlineContentSchema,o.schema.styleSchema);a=`<table>${r.exportInlineContent(l,{})}</table>`}else if(i){const l=ce(t,o.schema.inlineContentSchema,o.schema.styleSchema);a=r.exportInlineContent(l,{})}else{const l=Lo(t,o.schema);a=r.exportBlocks(l,{})}return a}function Po(e,t){"node"in e.state.selection&&e.state.selection.node.type.spec.group==="blockContent"&&t.dispatch(t._tiptapEditor.state.tr.setSelection(new _.NodeSelection(e.state.doc.resolve(e.state.selection.from-1))));const o=st.__serializeForClipboard(e,e.state.selection.content()).dom.innerHTML,i=e.state.selection.content().content,n=ca(e,i,t),a=ve(n);return{clipboardHTML:o,externalHTML:n,markdown:a}}const Ao=(e,t,o)=>{o.preventDefault(),o.clipboardData.clearData();const{clipboardHTML:i,externalHTML:n,markdown:a}=Po(t,e);o.clipboardData.setData("blocknote/html",i),o.clipboardData.setData("text/html",n),o.clipboardData.setData("text/plain",a)},ua=e=>k.Extension.create({name:"copyToClipboard",addProseMirrorPlugins(){return[new _.Plugin({props:{handleDOMEvents:{copy(t,o){return Ao(e,t,o),!0},cut(t,o){return Ao(e,t,o),t.editable&&t.dispatch(t.state.tr.deleteSelection()),!0},dragstart(t,o){if(!("node"in t.state.selection)||t.state.selection.node.type.spec.group!=="blockContent")return;e.dispatch(e._tiptapEditor.state.tr.setSelection(new _.NodeSelection(t.state.doc.resolve(t.state.selection.from-1)))),o.preventDefault(),o.dataTransfer.clearData();const{clipboardHTML:i,externalHTML:n,markdown:a}=Po(t,e);return o.dataTransfer.setData("blocknote/html",i),o.dataTransfer.setData("text/html",n),o.dataTransfer.setData("text/plain",a),!0}}}})]}}),pa=k.Extension.create({name:"blockBackgroundColor",addGlobalAttributes(){return[{types:["blockContainer"],attributes:{backgroundColor:{default:S.backgroundColor.default,parseHTML:e=>e.hasAttribute("data-background-color")?e.getAttribute("data-background-color"):S.backgroundColor.default,renderHTML:e=>e.backgroundColor===S.backgroundColor.default?{}:{"data-background-color":e.backgroundColor}}}}]}});class ee{constructor(){h(this,"callbacks",{})}on(t,o){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(o),()=>this.off(t,o)}emit(t,...o){const i=this.callbacks[t];i&&i.forEach(n=>n.apply(this,o))}off(t,o){const i=this.callbacks[t];i&&(o?this.callbacks[t]=i.filter(n=>n!==o):delete this.callbacks[t])}removeAllListeners(){this.callbacks={}}}class No{constructor(t,o,i,n){h(this,"state");h(this,"emitUpdate");h(this,"mouseDownHandler",()=>{var t;(t=this.state)!=null&&t.show&&(this.state.show=!1,this.emitUpdate())});h(this,"dragstartHandler",()=>{var t;(t=this.state)!=null&&t.show&&(this.state.show=!1,this.emitUpdate())});h(this,"scrollHandler",()=>{var t;if((t=this.state)!=null&&t.show){const o=this.pmView.root.querySelector(`[data-node-type="blockContainer"][data-id="${this.state.block.id}"]`);if(!o)return;this.state.referencePos=o.getBoundingClientRect(),this.emitUpdate()}});h(this,"closeMenu",()=>{var t;(t=this.state)!=null&&t.show&&(this.state.show=!1,this.emitUpdate())});this.editor=t,this.pluginKey=o,this.pmView=i,this.emitUpdate=()=>{if(!this.state)throw new Error("Attempting to update uninitialized file panel");n(this.state)},i.dom.addEventListener("mousedown",this.mouseDownHandler),i.dom.addEventListener("dragstart",this.dragstartHandler),i.root.addEventListener("scroll",this.scrollHandler,!0)}update(t,o){var n,a;const i=this.pluginKey.getState(t.state);if(!((n=this.state)!=null&&n.show)&&i.block&&this.editor.isEditable){const r=this.pmView.root.querySelector(`[data-node-type="blockContainer"][data-id="${i.block.id}"]`);if(!r)return;this.state={show:!0,referencePos:r.getBoundingClientRect(),block:i.block},this.emitUpdate();return}(!t.state.selection.eq(o.selection)||!t.state.doc.eq(o.doc)||!this.editor.isEditable)&&(a=this.state)!=null&&a.show&&(this.state.show=!1,this.emitUpdate())}destroy(){this.pmView.dom.removeEventListener("mousedown",this.mouseDownHandler),this.pmView.dom.removeEventListener("dragstart",this.dragstartHandler),this.pmView.root.removeEventListener("scroll",this.scrollHandler,!0)}}const Qe=new _.PluginKey("FilePanelPlugin");class Do extends ee{constructor(o){super();h(this,"view");h(this,"plugin");h(this,"closeMenu",()=>{var o;return(o=this.view)==null?void 0:o.closeMenu()});this.plugin=new _.Plugin({key:Qe,view:i=>(this.view=new No(o,Qe,i,n=>{this.emit("update",n)}),this.view),props:{handleKeyDown:(i,n)=>{var a;return n.key==="Escape"&&this.shown?((a=this.view)==null||a.closeMenu(),!0):!1}},state:{init:()=>({block:void 0}),apply:i=>{var a;return{block:(a=i.getMeta(Qe))==null?void 0:a.block}}}})}get shown(){var o,i;return((i=(o=this.view)==null?void 0:o.state)==null?void 0:i.show)||!1}onUpdate(o){return this.on("update",o)}}class jo{constructor(t,o,i){h(this,"state");h(this,"emitUpdate");h(this,"preventHide",!1);h(this,"preventShow",!1);h(this,"shouldShow",({state:t,from:o,to:i,view:n})=>{const{doc:a,selection:r}=t,{empty:s}=r,l=!a.textBetween(o,i).length&&k.isTextSelection(t.selection);return r.$from.parent.type.spec.code||k.isNodeSelection(r)&&r.node.type.spec.code?!1:!(!n.hasFocus()||s||l)});h(this,"blurHandler",t=>{var i;if(this.preventHide){this.preventHide=!1;return}const o=this.pmView.dom.parentElement;t&&t.relatedTarget&&(o===t.relatedTarget||o.contains(t.relatedTarget)||t.relatedTarget.matches(".bn-ui-container, .bn-ui-container *"))||(i=this.state)!=null&&i.show&&(this.state.show=!1,this.emitUpdate())});h(this,"viewMousedownHandler",()=>{this.preventShow=!0});h(this,"viewMouseupHandler",()=>{this.preventShow=!1,setTimeout(()=>this.update(this.pmView))});h(this,"dragHandler",()=>{var t;(t=this.state)!=null&&t.show&&(this.state.show=!1,this.emitUpdate())});h(this,"scrollHandler",()=>{var t;(t=this.state)!=null&&t.show&&(this.state.referencePos=this.getSelectionBoundingBox(),this.emitUpdate())});h(this,"closeMenu",()=>{var t;(t=this.state)!=null&&t.show&&(this.state.show=!1,this.emitUpdate())});this.editor=t,this.pmView=o,this.emitUpdate=()=>{if(!this.state)throw new Error("Attempting to update uninitialized formatting toolbar");i(this.state)},o.dom.addEventListener("mousedown",this.viewMousedownHandler),o.dom.addEventListener("mouseup",this.viewMouseupHandler),o.dom.addEventListener("dragstart",this.dragHandler),o.dom.addEventListener("dragover",this.dragHandler),o.dom.addEventListener("blur",this.blurHandler),o.root.addEventListener("scroll",this.scrollHandler,!0)}update(t,o){var p,m;const{state:i,composing:n}=t,{selection:a}=i,r=o&&o.selection.from===i.selection.from&&o.selection.to===i.selection.to;if(n||r)return;const{ranges:s}=a,l=Math.min(...s.map(f=>f.$from.pos)),u=Math.max(...s.map(f=>f.$to.pos)),c=(p=this.shouldShow)==null?void 0:p.call(this,{view:t,state:i,from:l,to:u});if(!this.preventShow&&(c||this.preventHide)){this.state={show:!0,referencePos:this.getSelectionBoundingBox()},this.emitUpdate();return}if((m=this.state)!=null&&m.show&&!this.preventHide&&(!c||this.preventShow||!this.editor.isEditable)){this.state.show=!1,this.emitUpdate();return}}destroy(){this.pmView.dom.removeEventListener("mousedown",this.viewMousedownHandler),this.pmView.dom.removeEventListener("mouseup",this.viewMouseupHandler),this.pmView.dom.removeEventListener("dragstart",this.dragHandler),this.pmView.dom.removeEventListener("dragover",this.dragHandler),this.pmView.dom.removeEventListener("blur",this.blurHandler),this.pmView.root.removeEventListener("scroll",this.scrollHandler,!0)}getSelectionBoundingBox(){const{state:t}=this.pmView,{selection:o}=t,{ranges:i}=o,n=Math.min(...i.map(r=>r.$from.pos)),a=Math.max(...i.map(r=>r.$to.pos));if(k.isNodeSelection(o)){const r=this.pmView.nodeDOM(n);if(r)return r.getBoundingClientRect()}return k.posToDOMRect(this.pmView,n,a)}}const Ho=new _.PluginKey("FormattingToolbarPlugin");class Oo extends ee{constructor(o){super();h(this,"view");h(this,"plugin");h(this,"closeMenu",()=>this.view.closeMenu());this.plugin=new _.Plugin({key:Ho,view:i=>(this.view=new jo(o,i,n=>{this.emit("update",n)}),this.view),props:{handleKeyDown:(i,n)=>n.key==="Escape"&&this.shown?(this.view.closeMenu(),!0):!1}})}get shown(){var o,i;return((i=(o=this.view)==null?void 0:o.state)==null?void 0:i.show)||!1}onUpdate(o){return this.on("update",o)}}const Uo=(e,t)=>{const o=e.resolve(t);if(o.depth<=1)return;const i=o.posAtIndex(o.index(o.depth-1),o.depth-1);return Q(e.resolve(i))},et=(e,t)=>{const o=e.resolve(t),i=o.index();if(i===0)return;const n=o.posAtIndex(i-1);return Q(e.resolve(n))},Ro=(e,t)=>{for(;t.childContainer;){const o=t.childContainer.node,i=e.resolve(t.childContainer.beforePos+1).posAtIndex(o.childCount-1);t=Q(e.resolve(i))}return t},ha=(e,t)=>e.isBlockContainer&&e.blockContent.node.type.spec.content==="inline*"&&e.blockContent.node.childCount>0&&t.isBlockContainer&&t.blockContent.node.type.spec.content==="inline*",ma=(e,t,o,i)=>{if(!i.isBlockContainer)throw new Error(`Attempted to merge block at position ${i.bnBlock.beforePos} into previous block at position ${o.bnBlock.beforePos}, but next block is not a block container`);if(i.childContainer){const n=e.doc.resolve(i.childContainer.beforePos+1),a=e.doc.resolve(i.childContainer.afterPos-1),r=n.blockRange(a);if(t){const s=e.doc.resolve(i.bnBlock.beforePos);e.tr.lift(r,s.depth)}}if(t){if(!o.isBlockContainer)throw new Error(`Attempted to merge block at position ${i.bnBlock.beforePos} into previous block at position ${o.bnBlock.beforePos}, but previous block is not a block container`);t(e.tr.delete(o.blockContent.afterPos-1,i.blockContent.beforePos+1))}return!0},Vo=e=>({state:t,dispatch:o})=>{const i=t.doc.resolve(e),n=Q(i),a=et(t.doc,n.bnBlock.beforePos);if(!a)return!1;const r=Ro(t.doc,a);return ha(r,n)?ma(t,o,r,n):!1},fa=k.Extension.create({priority:50,addKeyboardShortcuts(){return{Backspace:()=>this.editor.commands.first(({chain:i,commands:n})=>[()=>n.deleteSelection(),()=>n.undoInputRule(),()=>n.command(({state:a})=>{const r=C(a);if(!r.isBlockContainer)return!1;const s=a.selection.from===r.blockContent.beforePos+1,l=r.blockContent.node.type.name==="paragraph";return s&&!l?n.command(T(this.options.editor,r.bnBlock.beforePos,{type:"paragraph",props:{}})):!1}),()=>n.command(({state:a})=>{const r=C(a);if(!r.isBlockContainer)return!1;const{blockContent:s}=r;return a.selection.from===s.beforePos+1?n.liftListItem("blockContainer"):!1}),()=>n.command(({state:a})=>{const r=C(a);if(!r.isBlockContainer)return!1;const{bnBlock:s,blockContent:l}=r,u=a.selection.from===l.beforePos+1,c=a.selection.empty,p=s.beforePos;return u&&c?i().command(Vo(p)).scrollIntoView().run():!1}),()=>n.command(({state:a,dispatch:r})=>{const s=C(a);if(!s.isBlockContainer||!(a.selection.from===s.blockContent.beforePos+1)||et(a.doc,s.bnBlock.beforePos))return!1;const c=Uo(a.doc,s.bnBlock.beforePos);if((c==null?void 0:c.blockNoteType)!=="column")return!1;const p=c,m=Uo(a.doc,p.bnBlock.beforePos);if((m==null?void 0:m.blockNoteType)!=="columnList")throw new Error("parent of column is not a column list");const f=p.childContainer.node.childCount===1,g=f&&m.childContainer.node.childCount===2,b=m.childContainer.node.firstChild===p.bnBlock.node;if(r){const y=a.doc.slice(s.bnBlock.beforePos,s.bnBlock.afterPos,!1);if(g)if(b){a.tr.step(new fe.ReplaceAroundStep(m.bnBlock.beforePos,m.bnBlock.afterPos,p.bnBlock.afterPos+1,m.bnBlock.afterPos-2,y,y.size,!1));const w=a.tr.doc.resolve(p.bnBlock.beforePos);a.tr.setSelection(_.TextSelection.between(w,w))}else{a.tr.step(new fe.ReplaceAroundStep(m.bnBlock.beforePos,m.bnBlock.afterPos,m.bnBlock.beforePos+2,p.bnBlock.beforePos-1,y,0,!1));const w=a.tr.doc.resolve(a.tr.mapping.map(p.bnBlock.beforePos-1));a.tr.setSelection(_.TextSelection.between(w,w))}else if(f)if(b){a.tr.delete(p.bnBlock.beforePos,p.bnBlock.afterPos),a.tr.insert(m.bnBlock.beforePos,y.content);const w=a.tr.doc.resolve(m.bnBlock.beforePos);a.tr.setSelection(_.TextSelection.between(w,w))}else a.tr.delete(p.bnBlock.beforePos-1,p.bnBlock.beforePos+1);else{a.tr.delete(s.bnBlock.beforePos,s.bnBlock.afterPos),b?a.tr.insert(m.bnBlock.beforePos-1,y.content):a.tr.insert(p.bnBlock.beforePos-1,y.content);const w=a.tr.doc.resolve(p.bnBlock.beforePos-1);a.tr.setSelection(_.TextSelection.between(w,w))}}return!0}),()=>n.command(({state:a})=>{const r=C(a);if(!r.isBlockContainer)throw new Error("todo");const s=a.selection.from===r.blockContent.beforePos+1,l=a.selection.empty,u=et(a.doc,r.bnBlock.beforePos);if(u&&s&&l){const c=Ro(a.doc,u);if(!c.isBlockContainer)throw new Error("todo");if(c.blockContent.node.type.spec.content===""||c.blockContent.node.type.spec.content==="inline*"&&c.blockContent.node.childCount===0)return i().cut({from:r.bnBlock.beforePos,to:r.bnBlock.afterPos},c.bnBlock.afterPos).deleteRange({from:c.bnBlock.beforePos,to:c.bnBlock.afterPos}).run()}return!1})]),Delete:()=>this.editor.commands.first(({commands:i})=>[()=>i.deleteSelection(),()=>i.command(({state:n})=>{const a=C(n);if(!a.isBlockContainer)return!1;const{bnBlock:r,blockContent:s,childContainer:l}=a,{depth:u}=n.doc.resolve(r.beforePos),c=r.afterPos===n.doc.nodeSize-3,p=n.selection.from===s.afterPos-1,m=n.selection.empty;if(!c&&p&&m&&!(l!==void 0)){let g=u,b=r.afterPos+1,y=n.doc.resolve(b).depth;for(;y<g;)g=y,b+=2,y=n.doc.resolve(b).depth;return i.command(Vo(b-1))}return!1})]),Enter:()=>this.editor.commands.first(({commands:i})=>[()=>i.command(({state:n})=>{const a=C(n);if(!a.isBlockContainer)return!1;const{bnBlock:r,blockContent:s}=a,{depth:l}=n.doc.resolve(r.beforePos),u=n.selection.$anchor.parentOffset===0,c=n.selection.anchor===n.selection.head,p=s.node.childCount===0,m=l>1;return u&&c&&p&&m?i.liftListItem("blockContainer"):!1}),()=>i.command(({state:n,dispatch:a})=>{const r=C(n);if(!r.isBlockContainer)return!1;const{bnBlock:s,blockContent:l}=r,u=n.selection.$anchor.parentOffset===0,c=n.selection.anchor===n.selection.head,p=l.node.childCount===0;if(u&&c&&p){const m=s.afterPos,f=m+2;if(a){const g=n.schema.nodes.blockContainer.createAndFill();n.tr.insert(m,g).scrollIntoView(),n.tr.setSelection(new _.TextSelection(n.doc.resolve(f)))}return!0}return!1}),()=>i.command(({state:n,chain:a})=>{const r=C(n);if(!r.isBlockContainer)return!1;const{blockContent:s}=r,l=n.selection.$anchor.parentOffset===0;return s.node.childCount===0?!1:(a().deleteSelection().command(ho(n.selection.from,l,l)).run(),!0)})]),Tab:()=>{var i,n,a;return this.options.tabBehavior!=="prefer-indent"&&((i=this.options.editor.formattingToolbar)!=null&&i.shown||(n=this.options.editor.linkToolbar)!=null&&n.shown||(a=this.options.editor.filePanel)!=null&&a.shown)?!1:Co(this.options.editor)},"Shift-Tab":()=>{var i,n,a;return this.options.tabBehavior!=="prefer-indent"&&((i=this.options.editor.formattingToolbar)!=null&&i.shown||(n=this.options.editor.linkToolbar)!=null&&n.shown||(a=this.options.editor.filePanel)!=null&&a.shown)?!1:(this.editor.commands.liftListItem("blockContainer"),!0)},"Shift-Mod-ArrowUp":()=>(this.options.editor.moveBlocksUp(),!0),"Shift-Mod-ArrowDown":()=>(this.options.editor.moveBlocksDown(),!0)}}});class ga{constructor(t,o,i){h(this,"state");h(this,"emitUpdate");h(this,"menuUpdateTimer");h(this,"startMenuUpdateTimer");h(this,"stopMenuUpdateTimer");h(this,"mouseHoveredLinkMark");h(this,"mouseHoveredLinkMarkRange");h(this,"keyboardHoveredLinkMark");h(this,"keyboardHoveredLinkMarkRange");h(this,"linkMark");h(this,"linkMarkRange");h(this,"mouseOverHandler",t=>{if(this.mouseHoveredLinkMark=void 0,this.mouseHoveredLinkMarkRange=void 0,this.stopMenuUpdateTimer(),t.target instanceof HTMLAnchorElement&&t.target.nodeName==="A"){const o=t.target,i=this.pmView.posAtDOM(o,0)+1,n=this.pmView.state.doc.resolve(i),a=n.marks();for(const r of a)if(r.type.name===this.pmView.state.schema.mark("link").type.name){this.mouseHoveredLinkMark=r,this.mouseHoveredLinkMarkRange=k.getMarkRange(n,r.type,r.attrs)||void 0;break}}return this.startMenuUpdateTimer(),!1});h(this,"clickHandler",t=>{var i;const o=this.pmView.dom.parentElement;this.linkMark&&t&&t.target&&!(o===t.target||o.contains(t.target))&&(i=this.state)!=null&&i.show&&(this.state.show=!1,this.emitUpdate())});h(this,"scrollHandler",()=>{var t;this.linkMark!==void 0&&(t=this.state)!=null&&t.show&&(this.state.referencePos=k.posToDOMRect(this.pmView,this.linkMarkRange.from,this.linkMarkRange.to),this.emitUpdate())});h(this,"closeMenu",()=>{var t;(t=this.state)!=null&&t.show&&(this.state.show=!1,this.emitUpdate())});this.editor=t,this.pmView=o,this.emitUpdate=()=>{if(!this.state)throw new Error("Attempting to update uninitialized link toolbar");i(this.state)},this.startMenuUpdateTimer=()=>{this.menuUpdateTimer=setTimeout(()=>{this.update(this.pmView)},250)},this.stopMenuUpdateTimer=()=>(this.menuUpdateTimer&&(clearTimeout(this.menuUpdateTimer),this.menuUpdateTimer=void 0),!1),this.pmView.dom.addEventListener("mouseover",this.mouseOverHandler),this.pmView.root.addEventListener("click",this.clickHandler,!0),this.pmView.root.addEventListener("scroll",this.scrollHandler,!0)}editLink(t,o){var n;const i=this.pmView.state.tr.insertText(o,this.linkMarkRange.from,this.linkMarkRange.to);i.addMark(this.linkMarkRange.from,this.linkMarkRange.from+o.length,this.pmView.state.schema.mark("link",{href:t})),this.editor.dispatch(i),this.pmView.focus(),(n=this.state)!=null&&n.show&&(this.state.show=!1,this.emitUpdate())}deleteLink(){var t;this.editor.dispatch(this.pmView.state.tr.removeMark(this.linkMarkRange.from,this.linkMarkRange.to,this.linkMark.type).setMeta("preventAutolink",!0)),this.pmView.focus(),(t=this.state)!=null&&t.show&&(this.state.show=!1,this.emitUpdate())}update(t,o){var r;const{state:i}=t;if(o&&o.selection.from===i.selection.from&&o.selection.to===i.selection.to||!this.pmView.hasFocus())return;const a=this.linkMark;if(this.linkMark=void 0,this.linkMarkRange=void 0,this.keyboardHoveredLinkMark=void 0,this.keyboardHoveredLinkMarkRange=void 0,this.pmView.state.selection.empty){const s=this.pmView.state.selection.$from.marks();for(const l of s)if(l.type.name===this.pmView.state.schema.mark("link").type.name){this.keyboardHoveredLinkMark=l,this.keyboardHoveredLinkMarkRange=k.getMarkRange(this.pmView.state.selection.$from,l.type,l.attrs)||void 0;break}}if(this.mouseHoveredLinkMark&&(this.linkMark=this.mouseHoveredLinkMark,this.linkMarkRange=this.mouseHoveredLinkMarkRange),this.keyboardHoveredLinkMark&&(this.linkMark=this.keyboardHoveredLinkMark,this.linkMarkRange=this.keyboardHoveredLinkMarkRange),this.linkMark&&this.editor.isEditable){this.state={show:!0,referencePos:k.posToDOMRect(this.pmView,this.linkMarkRange.from,this.linkMarkRange.to),url:this.linkMark.attrs.href,text:this.pmView.state.doc.textBetween(this.linkMarkRange.from,this.linkMarkRange.to)},this.emitUpdate();return}if((r=this.state)!=null&&r.show&&a&&(!this.linkMark||!this.editor.isEditable)){this.state.show=!1,this.emitUpdate();return}}destroy(){this.pmView.dom.removeEventListener("mouseover",this.mouseOverHandler),this.pmView.root.removeEventListener("scroll",this.scrollHandler,!0),this.pmView.root.removeEventListener("click",this.clickHandler,!0)}}const zo=new _.PluginKey("LinkToolbarPlugin");class Fo extends ee{constructor(o){super();h(this,"view");h(this,"plugin");h(this,"editLink",(o,i)=>{this.view.editLink(o,i)});h(this,"deleteLink",()=>{this.view.deleteLink()});h(this,"startHideTimer",()=>{this.view.startMenuUpdateTimer()});h(this,"stopHideTimer",()=>{this.view.stopMenuUpdateTimer()});h(this,"closeMenu",()=>this.view.closeMenu());this.plugin=new _.Plugin({key:zo,view:i=>(this.view=new ga(o,i,n=>{this.emit("update",n)}),this.view),props:{handleKeyDown:(i,n)=>n.key==="Escape"&&this.shown?(this.view.closeMenu(),!0):!1}})}onUpdate(o){return this.on("update",o)}get shown(){var o,i;return((i=(o=this.view)==null?void 0:o.state)==null?void 0:i.show)||!1}}const Go=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"],$o="https",ba=new _.PluginKey("node-selection-keyboard");class ka{constructor(){h(this,"plugin");this.plugin=new _.Plugin({key:ba,props:{handleKeyDown:(t,o)=>{if("node"in t.state.selection){if(o.ctrlKey||o.metaKey)return!1;if(o.key.length===1)return o.preventDefault(),!0;if(o.key==="Enter"&&!o.shiftKey&&!o.altKey&&!o.ctrlKey&&!o.metaKey){const i=t.state.tr;return t.dispatch(i.insert(t.state.tr.selection.$to.after(),t.state.schema.nodes.paragraph.createChecked()).setSelection(new _.TextSelection(i.doc.resolve(t.state.tr.selection.$to.after()+1)))),!0}}return!1}}})}}const _a=new _.PluginKey("blocknote-placeholder");class ya{constructor(t,o){h(this,"plugin");this.plugin=new _.Plugin({key:_a,view:()=>{var l,u;const i=document.createElement("style"),n=t._tiptapEditor.options.injectNonce;n&&i.setAttribute("nonce",n),((l=t.prosemirrorView)==null?void 0:l.root)instanceof ShadowRoot?t.prosemirrorView.root.append(i):(u=t.prosemirrorView)==null||u.root.head.appendChild(i);const a=i.sheet,r=(c="")=>`.bn-block-content${c} .bn-inline-content:has(> .ProseMirror-trailingBreak:only-child):before`,s=(c,p=!0)=>{const m=p?"[data-is-empty-and-focused]":"";if(c==="default")return r(m);const f=`[data-content-type="${c}"]`;return r(m+f)};for(const[c,p]of Object.entries(o)){const m=c==="default";try{a.insertRule(`${s(c,m)} { content: ${JSON.stringify(p)}; }`),m||a.insertRule(`${s(c,!0)} { content: ${JSON.stringify(p)}; }`)}catch(f){console.warn("Failed to insert placeholder CSS rule - this is likely due to the browser not supporting certain CSS pseudo-element selectors (:has, :only-child:, or :before)",f)}}return{destroy:()=>{var c,p;((c=t.prosemirrorView)==null?void 0:c.root)instanceof ShadowRoot?t.prosemirrorView.root.removeChild(i):(p=t.prosemirrorView)==null||p.root.head.removeChild(i)}}},props:{decorations:i=>{const{doc:n,selection:a}=i;if(!t.isEditable||!a.empty||a.$from.parent.type.spec.code)return;const r=a.$anchor,s=r.parent;if(s.content.size>0)return null;const l=r.before(),u=L.Decoration.node(l,l+s.nodeSize,{"data-is-empty-and-focused":"true"});return L.DecorationSet.create(n,[u])}}})}}const Wo=new _.PluginKey("previous-blocks"),wa={index:"index",level:"level",type:"type",depth:"depth","depth-change":"depth-change"};class va{constructor(){h(this,"plugin");let t;this.plugin=new _.Plugin({key:Wo,view(o){return{update:async(i,n)=>{var a;((a=this.key)==null?void 0:a.getState(i.state).updatedBlocks.size)>0&&(t=setTimeout(()=>{i.dispatch(i.state.tr.setMeta(Wo,{clearUpdate:!0}))},0))},destroy:()=>{t&&clearTimeout(t)}}},state:{init(){return{prevTransactionOldBlockAttrs:{},currentTransactionOldBlockAttrs:{},updatedBlocks:new Set}},apply(o,i,n,a){if(i.currentTransactionOldBlockAttrs={},i.updatedBlocks.clear(),!o.docChanged||n.doc.eq(a.doc))return i;const r={},s=k.findChildren(n.doc,c=>c.attrs.id),l=new Map(s.map(c=>[c.node.attrs.id,c])),u=k.findChildren(a.doc,c=>c.attrs.id);for(const c of u){const p=l.get(c.node.attrs.id),m=p==null?void 0:p.node.firstChild,f=c.node.firstChild;if(p&&m&&f){const g={index:f.attrs.index,level:f.attrs.level,type:f.type.name,depth:a.doc.resolve(c.pos).depth};let b={index:m.attrs.index,level:m.attrs.level,type:m.type.name,depth:n.doc.resolve(p.pos).depth};r[c.node.attrs.id]=b,o.getMeta("numberedListIndexing")&&(c.node.attrs.id in i.prevTransactionOldBlockAttrs&&(b=i.prevTransactionOldBlockAttrs[c.node.attrs.id]),g.type==="numberedListItem"&&(b.index=g.index)),i.currentTransactionOldBlockAttrs[c.node.attrs.id]=b,JSON.stringify(b)!==JSON.stringify(g)&&(b["depth-change"]=b.depth-g.depth,i.updatedBlocks.add(c.node.attrs.id))}}return i.prevTransactionOldBlockAttrs=r,i}},props:{decorations(o){const i=this.getState(o);if(i.updatedBlocks.size===0)return;const n=[];return o.doc.descendants((a,r)=>{if(!a.attrs.id||!i.updatedBlocks.has(a.attrs.id))return;const s=i.currentTransactionOldBlockAttrs[a.attrs.id],l={};for(const[c,p]of Object.entries(s))l["data-prev-"+wa[c]]=p||"none";const u=L.Decoration.node(r,r+a.nodeSize,{...l});n.push(u)}),L.DecorationSet.create(o.doc,n)}}})}}function Ko(e,t){var o,i;for(;e&&e.parentElement&&e.parentElement!==t.dom&&((o=e.getAttribute)==null?void 0:o.call(e,"data-node-type"))!=="blockContainer";)e=e.parentElement;if(((i=e.getAttribute)==null?void 0:i.call(e,"data-node-type"))==="blockContainer")return{node:e,id:e.getAttribute("data-id")}}class te extends _.Selection{constructor(o,i){super(o,i);h(this,"nodes");const n=o.node();this.nodes=[],o.doc.nodesBetween(o.pos,i.pos,(a,r,s)=>{if(s!==null&&s.eq(n))return this.nodes.push(a),!1})}static create(o,i,n=i){return new te(o.resolve(i),o.resolve(n))}content(){return new v.Slice(v.Fragment.from(this.nodes),0,0)}eq(o){if(!(o instanceof te)||this.nodes.length!==o.nodes.length||this.from!==o.from||this.to!==o.to)return!1;for(let i=0;i<this.nodes.length;i++)if(!this.nodes[i].eq(o.nodes[i]))return!1;return!0}map(o,i){const n=i.mapResult(this.from),a=i.mapResult(this.to);return a.deleted?_.Selection.near(o.resolve(n.pos)):n.deleted?_.Selection.near(o.resolve(a.pos)):new te(o.resolve(n.pos),o.resolve(a.pos))}toJSON(){return{type:"node",anchor:this.anchor,head:this.head}}}let V;function Ca(e,t){let o,i;const n=t.resolve(e.from).node().type.spec.group==="blockContent",a=t.resolve(e.to).node().type.spec.group==="blockContent",r=Math.min(e.$anchor.depth,e.$head.depth);if(n&&a){const s=e.$from.start(r-1),l=e.$to.end(r-1);o=t.resolve(s-1).pos,i=t.resolve(l+1).pos}else o=e.from,i=e.to;return{from:o,to:i}}function qo(e,t,o=t){t===o&&(o+=e.state.doc.resolve(t+1).node().nodeSize);const i=e.domAtPos(t).node.cloneNode(!0),n=e.domAtPos(t).node,a=(c,p)=>Array.prototype.indexOf.call(c.children,p),r=a(n,e.domAtPos(t+1).node.parentElement),s=a(n,e.domAtPos(o-1).node.parentElement);for(let c=n.childElementCount-1;c>=0;c--)(c>s||c<r)&&i.removeChild(i.children[c]);Xo(e.root),V=i;const u=e.dom.className.split(" ").filter(c=>c!=="ProseMirror"&&c!=="bn-root"&&c!=="bn-editor").join(" ");V.className=V.className+" bn-drag-preview "+u,e.root instanceof ShadowRoot?e.root.appendChild(V):e.root.body.appendChild(V)}function Xo(e){V!==void 0&&(e instanceof ShadowRoot?e.removeChild(V):e.body.removeChild(V),V=void 0)}function xa(e,t,o){if(!e.dataTransfer)return;const i=o.prosemirrorView;if(!i)return;const n=P(t.id,i.state.doc);if(!n)throw new Error(`Block with ID ${t.id} not found`);const a=n.posBeforeNode;if(a!=null){const r=i.state.selection,s=i.state.doc,{from:l,to:u}=Ca(r,s),c=l<=a&&a<u,p=r.$anchor.node()!==r.$head.node()||r instanceof te;c&&p?(i.dispatch(i.state.tr.setSelection(te.create(s,l,u))),qo(i,l,u)):(i.dispatch(i.state.tr.setSelection(_.NodeSelection.create(i.state.doc,a))),qo(i,a));const m=i.state.selection.content(),f=o.pmSchema,g=st.__serializeForClipboard(i,m).dom.innerHTML,b=re(f,o),y=Lo(m.content,o.schema),w=b.exportBlocks(y,{}),M=ve(w);e.dataTransfer.clearData(),e.dataTransfer.setData("blocknote/html",g),e.dataTransfer.setData("text/html",w),e.dataTransfer.setData("text/plain",M),e.dataTransfer.effectAllowed="move",e.dataTransfer.setDragImage(V,0,0),i.dragging={slice:m,move:!0}}}const he=.1;function tt(e,t,o=!0){const i=e.root.elementsFromPoint(t.left,t.top);for(const n of i)if(e.dom.contains(n))return o&&n.closest("[data-node-type=columnList]")?tt(e,{left:t.left+50,top:t.top},!1):Ko(n,e)}function Ea(e,t){if(!t.dom.firstChild)return;const o=t.dom.firstChild.getBoundingClientRect(),i={left:e.x,top:e.y},n=i.left<o.left,a=i.left>o.right;n&&(i.left=o.left+10),a&&(i.left=o.right-10);let r=tt(t,i);if(!a&&r){const s=r.node.getBoundingClientRect();i.left=s.right-10,r=tt(t,i,!1)}return r}class Zo{constructor(t,o,i){h(this,"state");h(this,"emitUpdate");h(this,"mousePos");h(this,"hoveredBlock");h(this,"menuFrozen",!1);h(this,"updateState",t=>{this.state=t,this.emitUpdate(this.state)});h(this,"updateStateFromMousePos",()=>{var i,n,a,r;if(this.menuFrozen||!this.mousePos)return;const t=Ea(this.mousePos,this.pmView);if(!t||!this.editor.isEditable){(i=this.state)!=null&&i.show&&(this.state.show=!1,this.updateState(this.state));return}if((n=this.state)!=null&&n.show&&((a=this.hoveredBlock)!=null&&a.hasAttribute("data-id"))&&((r=this.hoveredBlock)==null?void 0:r.getAttribute("data-id"))===t.id)return;this.hoveredBlock=t.node;const o=t.node.firstChild;if(o&&this.editor.isEditable){const s=o.getBoundingClientRect(),l=t.node.closest("[data-node-type=column]");this.updateState({show:!0,referencePos:new DOMRect(l?l.firstElementChild.getBoundingClientRect().x:this.pmView.dom.firstChild.getBoundingClientRect().x,s.y,s.width,s.height),block:this.editor.getBlock(this.hoveredBlock.getAttribute("data-id"))})}});h(this,"onDrop",t=>{var i;if(this.editor._tiptapEditor.commands.blur(),t.synthetic||!((i=t.dataTransfer)!=null&&i.types.includes("blocknote/html")))return;const o=this.pmView.posAtCoords({left:t.clientX,top:t.clientY});if(!o||o.inside===-1){const n=this.createSyntheticEvent(t);this.pmView.dom.dispatchEvent(n)}});h(this,"onDragOver",t=>{var i;if(t.synthetic||!((i=t.dataTransfer)!=null&&i.types.includes("blocknote/html")))return;const o=this.pmView.posAtCoords({left:t.clientX,top:t.clientY});if(!o||o.inside===-1&&this.pmView.dom.firstChild){const n=this.createSyntheticEvent(t);this.pmView.dom.dispatchEvent(n)}});h(this,"onKeyDown",t=>{var o;(o=this.state)!=null&&o.show&&this.editor.isFocused()&&(this.state.show=!1,this.emitUpdate(this.state))});h(this,"onMouseMove",t=>{var a;if(this.menuFrozen)return;this.mousePos={x:t.clientX,y:t.clientY};const o=this.pmView.dom.getBoundingClientRect(),i=this.mousePos.x>o.left&&this.mousePos.x<o.right&&this.mousePos.y>o.top&&this.mousePos.y<o.bottom,n=this.pmView.dom.parentElement;if(i&&t&&t.target&&!(n===t.target||n.contains(t.target))){(a=this.state)!=null&&a.show&&(this.state.show=!1,this.emitUpdate(this.state));return}this.updateStateFromMousePos()});this.editor=t,this.pmView=o,this.emitUpdate=()=>{if(!this.state)throw new Error("Attempting to update uninitialized side menu");i(this.state)},this.pmView.root.addEventListener("drop",this.onDrop,!0),this.pmView.root.addEventListener("dragover",this.onDragOver),we(),this.pmView.root.addEventListener("mousemove",this.onMouseMove,!0),this.pmView.root.addEventListener("keydown",this.onKeyDown,!0)}createSyntheticEvent(t){const o=new Event(t.type,t),i=this.pmView.dom.firstChild.getBoundingClientRect();return o.clientX=t.clientX,o.clientY=t.clientY,t.clientX<i.left&&t.clientX>i.left-i.width*he?o.clientX=i.left+i.width*he/2:t.clientX>i.right&&t.clientX<i.right+i.width*he?o.clientX=i.right-i.width*he/2:(t.clientX<i.left||t.clientX>i.right)&&(o.clientX=i.left+he*i.width*2),o.clientY=Math.min(Math.max(t.clientY,i.top),i.top+i.height),o.dataTransfer=t.dataTransfer,o.preventDefault=()=>t.preventDefault(),o.synthetic=!0,o}update(t,o){var n;!o.doc.eq(this.pmView.state.doc)&&((n=this.state)!=null&&n.show)&&this.updateStateFromMousePos()}destroy(){var t;(t=this.state)!=null&&t.show&&(this.state.show=!1,this.emitUpdate(this.state)),this.pmView.root.removeEventListener("mousemove",this.onMouseMove,!0),this.pmView.root.removeEventListener("dragover",this.onDragOver),this.pmView.root.removeEventListener("drop",this.onDrop,!0),this.pmView.root.removeEventListener("keydown",this.onKeyDown,!0)}}const Jo=new _.PluginKey("SideMenuPlugin");class Yo extends ee{constructor(o){super();h(this,"view");h(this,"plugin");h(this,"blockDragStart",(o,i)=>{xa(o,i,this.editor)});h(this,"blockDragEnd",()=>{this.editor.prosemirrorView&&Xo(this.editor.prosemirrorView.root)});h(this,"freezeMenu",()=>{this.view.menuFrozen=!0,this.view.state.show=!0,this.view.emitUpdate(this.view.state)});h(this,"unfreezeMenu",()=>{this.view.menuFrozen=!1,this.view.state.show=!1,this.view.emitUpdate(this.view.state)});this.editor=o,this.plugin=new _.Plugin({key:Jo,view:i=>(this.view=new Zo(o,i,n=>{this.emit("update",n)}),this.view)})}onUpdate(o){return this.on("update",o)}}const Sa=k.findParentNode(e=>e.type.name==="blockContainer");class Ba{constructor(t,o){h(this,"state");h(this,"emitUpdate");h(this,"rootEl");h(this,"pluginState");h(this,"handleScroll",()=>{var t,o;if((t=this.state)!=null&&t.show){const i=(o=this.rootEl)==null?void 0:o.querySelector(`[data-decoration-id="${this.pluginState.decorationId}"]`);if(!i)return;this.state.referencePos=i.getBoundingClientRect(),this.emitUpdate(this.pluginState.triggerCharacter)}});h(this,"closeMenu",()=>{this.editor.dispatch(this.editor._tiptapEditor.state.tr.setMeta(oe,null))});h(this,"clearQuery",()=>{this.pluginState!==void 0&&this.editor._tiptapEditor.chain().focus().deleteRange({from:this.pluginState.queryStartPos-(this.pluginState.deleteTriggerCharacter?this.pluginState.triggerCharacter.length:0),to:this.editor._tiptapEditor.state.selection.from}).run()});var i,n;this.editor=t,this.pluginState=void 0,this.emitUpdate=a=>{var r;if(!this.state)throw new Error("Attempting to update uninitialized suggestions menu");o(a,{...this.state,ignoreQueryLength:(r=this.pluginState)==null?void 0:r.ignoreQueryLength})},this.rootEl=(i=this.editor.prosemirrorView)==null?void 0:i.root,(n=this.rootEl)==null||n.addEventListener("scroll",this.handleScroll,!0)}update(t,o){var u;const i=oe.getState(o),n=oe.getState(t.state),a=i===void 0&&n!==void 0,r=i!==void 0&&n===void 0;if(!a&&!(i!==void 0&&n!==void 0)&&!r)return;if(this.pluginState=r?i:n,r||!this.editor.isEditable){this.state.show=!1,this.emitUpdate(this.pluginState.triggerCharacter);return}const l=(u=this.rootEl)==null?void 0:u.querySelector(`[data-decoration-id="${this.pluginState.decorationId}"]`);this.editor.isEditable&&l&&(this.state={show:!0,referencePos:l.getBoundingClientRect(),query:this.pluginState.query},this.emitUpdate(this.pluginState.triggerCharacter))}destroy(){var t;(t=this.rootEl)==null||t.removeEventListener("scroll",this.handleScroll,!0)}}const oe=new _.PluginKey("SuggestionMenuPlugin");class Qo extends ee{constructor(o){super();h(this,"view");h(this,"plugin");h(this,"triggerCharacters",[]);h(this,"addTriggerCharacter",o=>{this.triggerCharacters.push(o)});h(this,"removeTriggerCharacter",o=>{this.triggerCharacters=this.triggerCharacters.filter(i=>i!==o)});h(this,"closeMenu",()=>this.view.closeMenu());h(this,"clearQuery",()=>this.view.clearQuery());const i=this.triggerCharacters;this.plugin=new _.Plugin({key:oe,view:()=>(this.view=new Ba(o,(n,a)=>{this.emit(`update ${n}`,a)}),this.view),state:{init(){},apply(n,a,r,s){if(n.getMeta("orderedListIndexing")!==void 0||n.selection.$from.parent.type.spec.code)return a;const l=n.getMeta(oe);if(typeof l=="object"&&l!==null&&a===void 0)return{triggerCharacter:l.triggerCharacter,deleteTriggerCharacter:l.deleteTriggerCharacter!==!1,queryStartPos:s.selection.from,query:"",decorationId:`id_${Math.floor(Math.random()*4294967295)}`,ignoreQueryLength:l==null?void 0:l.ignoreQueryLength};if(a===void 0)return a;if(s.selection.from!==s.selection.to||l===null||n.getMeta("focus")||n.getMeta("blur")||n.getMeta("pointer")||a.triggerCharacter!==void 0&&s.selection.from<a.queryStartPos)return;const u={...a};return u.query=s.doc.textBetween(a.queryStartPos,s.selection.from),u}},props:{handleTextInput(n,a,r,s){const l=this.getState(n.state);return i.includes(s)&&l===void 0?(n.dispatch(n.state.tr.insertText(s).scrollIntoView().setMeta(oe,{triggerCharacter:s})),!0):!1},decorations(n){const a=this.getState(n);if(a===void 0)return null;if(!a.deleteTriggerCharacter){const r=Sa(n.selection);if(r)return L.DecorationSet.create(n.doc,[L.Decoration.node(r.pos,r.pos+r.node.nodeSize,{nodeName:"span",class:"bn-suggestion-decorator","data-decoration-id":a.decorationId})])}return L.DecorationSet.create(n.doc,[L.Decoration.inline(a.queryStartPos-a.triggerCharacter.length,a.queryStartPos,{nodeName:"span",class:"bn-suggestion-decorator","data-decoration-id":a.decorationId})])}}})}onUpdate(o,i){return this.triggerCharacters.includes(o)||this.addTriggerCharacter(o),this.on(`update ${o}`,i)}get shown(){var o,i;return((i=(o=this.view)==null?void 0:o.state)==null?void 0:i.show)||!1}}function Ta(e,t){e.suggestionMenus.addTriggerCharacter(t)}let N;function ei(e){N||(N=document.createElement("div"),N.innerHTML="_",N.style.opacity="0",N.style.height="1px",N.style.width="1px",e instanceof Document?e.body.appendChild(N):e.appendChild(N))}function Ma(e){N&&(e instanceof Document?e.body.removeChild(N):e.removeChild(N),N=void 0)}function Ce(e){return Array.prototype.indexOf.call(e.parentElement.childNodes,e)}function Ia(e){let t=e;for(;t&&t.nodeName!=="TD"&&t.nodeName!=="TH"&&!t.classList.contains("tableWrapper");){if(t.classList.contains("ProseMirror"))return;const o=t.parentNode;if(!o||!(o instanceof Element))return;t=o}return t.nodeName==="TD"||t.nodeName==="TH"?{type:"cell",domNode:t,tbodyNode:t.closest("tbody")}:{type:"wrapper",domNode:t,tbodyNode:t.querySelector("tbody")}}function La(e,t){const o=t.querySelectorAll(e);for(let i=0;i<o.length;i++)o[i].style.visibility="hidden"}class ti{constructor(t,o,i){h(this,"state");h(this,"emitUpdate");h(this,"tableId");h(this,"tablePos");h(this,"tableElement");h(this,"menuFrozen",!1);h(this,"mouseState","up");h(this,"prevWasEditable",null);h(this,"viewMousedownHandler",()=>{this.mouseState="down"});h(this,"mouseUpHandler",t=>{this.mouseState="up",this.mouseMoveHandler(t)});h(this,"mouseMoveHandler",t=>{var u,c,p,m;if(this.menuFrozen||this.mouseState==="selecting"||!(t.target instanceof Element)||!this.pmView.dom.contains(t.target))return;const o=Ia(t.target);if((o==null?void 0:o.type)==="cell"&&this.mouseState==="down"&&!((u=this.state)!=null&&u.draggingState)){this.mouseState="selecting",(c=this.state)!=null&&c.show&&(this.state.show=!1,this.state.showAddOrRemoveRowsButton=!1,this.state.showAddOrRemoveColumnsButton=!1,this.emitUpdate());return}if(!o||!this.editor.isEditable){(p=this.state)!=null&&p.show&&(this.state.show=!1,this.state.showAddOrRemoveRowsButton=!1,this.state.showAddOrRemoveColumnsButton=!1,this.emitUpdate());return}if(!o.tbodyNode)return;const i=o.tbodyNode.getBoundingClientRect(),n=Ko(o.domNode,this.pmView);if(!n)return;this.tableElement=n.node;let a;const r=P(n.id,this.editor._tiptapEditor.state.doc);if(!r)throw new Error(`Block with ID ${n.id} not found`);const s=E(r.node,this.editor.schema.blockSchema,this.editor.schema.inlineContentSchema,this.editor.schema.styleSchema,this.editor.blockCache);if(bo("table",s,this.editor)&&(this.tablePos=r.posBeforeNode+1,a=s),!a)return;this.tableId=n.id;const l=(m=o.domNode.closest(".tableWrapper"))==null?void 0:m.querySelector(".table-widgets-container");if((o==null?void 0:o.type)==="wrapper"){const f=t.clientY>=i.bottom-1&&t.clientY<i.bottom+20,g=t.clientX>=i.right-1&&t.clientX<i.right+20,b=t.clientX>i.right||t.clientY>i.bottom;this.state={...this.state,show:!0,showAddOrRemoveRowsButton:f,showAddOrRemoveColumnsButton:g,referencePosTable:i,block:a,widgetContainer:l,colIndex:b?void 0:this.state.colIndex,rowIndex:b?void 0:this.state.rowIndex,referencePosCell:b?void 0:this.state.referencePosCell}}else{const f=Ce(o.domNode),g=Ce(o.domNode.parentElement),b=o.domNode.getBoundingClientRect();if(this.state!==void 0&&this.state.show&&this.tableId===n.id&&this.state.rowIndex===g&&this.state.colIndex===f)return;this.state={show:!0,showAddOrRemoveColumnsButton:f===a.content.rows[0].cells.length-1,showAddOrRemoveRowsButton:g===a.content.rows.length-1,referencePosTable:i,block:a,draggingState:void 0,referencePosCell:b,colIndex:f,rowIndex:g,widgetContainer:l}}return this.emitUpdate(),!1});h(this,"dragOverHandler",t=>{var m;if(((m=this.state)==null?void 0:m.draggingState)===void 0)return;t.preventDefault(),t.dataTransfer.dropEffect="move",La(".prosemirror-dropcursor-block, .prosemirror-dropcursor-inline",this.pmView.root);const o={left:Math.min(Math.max(t.clientX,this.state.referencePosTable.left+1),this.state.referencePosTable.right-1),top:Math.min(Math.max(t.clientY,this.state.referencePosTable.top+1),this.state.referencePosTable.bottom-1)},i=this.pmView.root.elementsFromPoint(o.left,o.top).filter(f=>f.tagName==="TD"||f.tagName==="TH");if(i.length===0)throw new Error("Could not find table cell element that the mouse cursor is hovering over.");const n=i[0];let a=!1;const r=Ce(n.parentElement),s=Ce(n),l=this.state.draggingState.draggedCellOrientation==="row"?this.state.rowIndex:this.state.colIndex,c=(this.state.draggingState.draggedCellOrientation==="row"?r:s)!==l;(this.state.rowIndex!==r||this.state.colIndex!==s)&&(this.state.rowIndex=r,this.state.colIndex=s,this.state.referencePosCell=n.getBoundingClientRect(),a=!0);const p=this.state.draggingState.draggedCellOrientation==="row"?o.top:o.left;this.state.draggingState.mousePos!==p&&(this.state.draggingState.mousePos=p,a=!0),a&&this.emitUpdate(),c&&this.editor.dispatch(this.pmView.state.tr.setMeta(ie,!0))});h(this,"dropHandler",t=>{if(this.mouseState="up",this.state===void 0||this.state.draggingState===void 0)return;if(this.state.rowIndex===void 0||this.state.colIndex===void 0)throw new Error("Attempted to drop table row or column, but no table block was hovered prior.");t.preventDefault();const{draggingState:o,colIndex:i,rowIndex:n}=this.state,a=this.state.block.content.rows;if(o.draggedCellOrientation==="row"){const r=a[o.originalIndex];a.splice(o.originalIndex,1),a.splice(n,0,r)}else{const r=a.map(s=>s.cells[o.originalIndex]);a.forEach((s,l)=>{s.cells.splice(o.originalIndex,1),s.cells.splice(i,0,r[l])})}this.editor.updateBlock(this.state.block,{type:"table",content:{type:"tableContent",rows:a}}),this.editor.setTextCursorPosition(this.state.block.id)});this.editor=t,this.pmView=o,this.emitUpdate=()=>{if(!this.state)throw new Error("Attempting to update uninitialized image toolbar");i(this.state)},o.dom.addEventListener("mousemove",this.mouseMoveHandler),o.dom.addEventListener("mousedown",this.viewMousedownHandler),window.addEventListener("mouseup",this.mouseUpHandler),o.root.addEventListener("dragover",this.dragOverHandler),o.root.addEventListener("drop",this.dropHandler)}update(){if(!this.state||!this.state.show)return;if(this.state.block=this.editor.getBlock(this.state.block.id),!this.state.block){this.state.show=!1,this.state.showAddOrRemoveRowsButton=!1,this.state.showAddOrRemoveColumnsButton=!1,this.emitUpdate();return}const t=this.state.block.content.rows.length,o=this.state.block.content.rows[0].cells.length;this.state.rowIndex!==void 0&&this.state.colIndex!==void 0&&(this.state.rowIndex>=t&&(this.state.rowIndex=t-1),this.state.colIndex>=o&&(this.state.colIndex=o-1));const i=this.tableElement.querySelector("tbody");if(!i)throw new Error("Table block does not contain a 'tbody' HTML element. This should never happen.");if(this.state.rowIndex!==void 0&&this.state.colIndex!==void 0){const a=i.children[this.state.rowIndex].children[this.state.colIndex];this.state.referencePosCell=a.getBoundingClientRect()}this.state.referencePosTable=i.getBoundingClientRect(),this.emitUpdate()}destroy(){this.pmView.dom.removeEventListener("mousemove",this.mouseMoveHandler),window.removeEventListener("mouseup",this.mouseUpHandler),this.pmView.dom.removeEventListener("mousedown",this.viewMousedownHandler),this.pmView.root.removeEventListener("dragover",this.dragOverHandler),this.pmView.root.removeEventListener("drop",this.dropHandler)}}const ie=new _.PluginKey("TableHandlesPlugin");class oi extends ee{constructor(o){super();h(this,"view");h(this,"plugin");h(this,"colDragStart",o=>{if(this.view.state===void 0||this.view.state.colIndex===void 0)throw new Error("Attempted to drag table column, but no table block was hovered prior.");if(this.view.state.draggingState={draggedCellOrientation:"col",originalIndex:this.view.state.colIndex,mousePos:o.clientX},this.view.emitUpdate(),this.editor.dispatch(this.editor._tiptapEditor.state.tr.setMeta(ie,{draggedCellOrientation:this.view.state.draggingState.draggedCellOrientation,originalIndex:this.view.state.colIndex,newIndex:this.view.state.colIndex,tablePos:this.view.tablePos})),!this.editor.prosemirrorView)throw new Error("Editor view not initialized.");ei(this.editor.prosemirrorView.root),o.dataTransfer.setDragImage(N,0,0),o.dataTransfer.effectAllowed="move"});h(this,"rowDragStart",o=>{if(this.view.state===void 0||this.view.state.rowIndex===void 0)throw new Error("Attempted to drag table row, but no table block was hovered prior.");if(this.view.state.draggingState={draggedCellOrientation:"row",originalIndex:this.view.state.rowIndex,mousePos:o.clientY},this.view.emitUpdate(),this.editor.dispatch(this.editor._tiptapEditor.state.tr.setMeta(ie,{draggedCellOrientation:this.view.state.draggingState.draggedCellOrientation,originalIndex:this.view.state.rowIndex,newIndex:this.view.state.rowIndex,tablePos:this.view.tablePos})),!this.editor.prosemirrorView)throw new Error("Editor view not initialized.");ei(this.editor.prosemirrorView.root),o.dataTransfer.setDragImage(N,0,0),o.dataTransfer.effectAllowed="copyMove"});h(this,"dragEnd",()=>{if(this.view.state===void 0)throw new Error("Attempted to drag table row, but no table block was hovered prior.");if(this.view.state.draggingState=void 0,this.view.emitUpdate(),this.editor.dispatch(this.editor._tiptapEditor.state.tr.setMeta(ie,null)),!this.editor.prosemirrorView)throw new Error("Editor view not initialized.");Ma(this.editor.prosemirrorView.root)});h(this,"freezeHandles",()=>{this.view.menuFrozen=!0});h(this,"unfreezeHandles",()=>{this.view.menuFrozen=!1});this.editor=o,this.plugin=new _.Plugin({key:ie,view:i=>(this.view=new ti(o,i,n=>{this.emit("update",n)}),this.view),props:{decorations:i=>{if(this.view===void 0||this.view.state===void 0||this.view.state.draggingState===void 0||this.view.tablePos===void 0)return;const n=this.view.state.draggingState.draggedCellOrientation==="row"?this.view.state.rowIndex:this.view.state.colIndex;if(n===void 0)return;const a=[];if(n===this.view.state.draggingState.originalIndex)return L.DecorationSet.create(i.doc,a);const r=i.doc.resolve(this.view.tablePos+1),s=r.node();if(this.view.state.draggingState.draggedCellOrientation==="row"){const l=i.doc.resolve(r.posAtIndex(n)+1),u=l.node();for(let c=0;c<u.childCount;c++){const p=i.doc.resolve(l.posAtIndex(c)+1),m=p.node(),f=p.pos+(n>this.view.state.draggingState.originalIndex?m.nodeSize-2:0);a.push(L.Decoration.widget(f,()=>{const g=document.createElement("div");return g.className="bn-table-drop-cursor",g.style.left="0",g.style.right="0",n>this.view.state.draggingState.originalIndex?g.style.bottom="-2px":g.style.top="-3px",g.style.height="4px",g}))}}else for(let l=0;l<s.childCount;l++){const u=i.doc.resolve(r.posAtIndex(l)+1),c=i.doc.resolve(u.posAtIndex(n)+1),p=c.node(),m=c.pos+(n>this.view.state.draggingState.originalIndex?p.nodeSize-2:0);a.push(L.Decoration.widget(m,()=>{const f=document.createElement("div");return f.className="bn-table-drop-cursor",f.style.top="0",f.style.bottom="0",n>this.view.state.draggingState.originalIndex?f.style.right="-2px":f.style.left="-3px",f.style.width="4px",f}))}return L.DecorationSet.create(i.doc,a)}}})}onUpdate(o){return this.on("update",o)}}const Pa=k.Extension.create({name:"textAlignment",addGlobalAttributes(){return[{types:["paragraph","heading","bulletListItem","numberedListItem","checkListItem"],attributes:{textAlignment:{default:"left",parseHTML:e=>e.getAttribute("data-text-alignment"),renderHTML:e=>e.textAlignment==="left"?{}:{"data-text-alignment":e.textAlignment}}}}]}}),Aa=k.Extension.create({name:"blockTextColor",addGlobalAttributes(){return[{types:["blockContainer"],attributes:{textColor:{default:S.textColor.default,parseHTML:e=>e.hasAttribute("data-text-color")?e.getAttribute("data-text-color"):S.textColor.default,renderHTML:e=>e.textColor===S.textColor.default?{}:{"data-text-color":e.textColor}}}}]}}),Na=k.Extension.create({name:"trailingNode",addProseMirrorPlugins(){const e=new _.PluginKey(this.name);return[new _.Plugin({key:e,appendTransaction:(t,o,i)=>{const{doc:n,tr:a,schema:r}=i,s=e.getState(i),l=n.content.size-2,u=r.nodes.blockContainer,c=r.nodes.paragraph;if(s)return a.insert(l,u.create(void 0,c.create()))},state:{init:(t,o)=>{},apply:(t,o)=>{if(!t.docChanged)return o;let i=t.doc.lastChild;if(!i||i.type.name!=="blockGroup")throw new Error("Expected blockGroup");if(i=i.lastChild,!i||i.type.name!=="blockContainer")return!0;const n=i.firstChild;if(!n)throw new Error("Expected blockContent");return i.nodeSize>4||n.type.spec.content!=="inline*"}}})]}}),Da={blockColor:"data-block-color",blockStyle:"data-block-style",id:"data-id",depth:"data-depth",depthChange:"data-depth-change"},ja=k.Node.create({name:"blockContainer",group:"blockGroupChild bnBlock",content:"blockContent blockGroup?",priority:50,defining:!0,parseHTML(){return[{tag:"div",getAttrs:e=>{if(typeof e=="string")return!1;const t={};for(const[o,i]of Object.entries(Da))e.getAttribute(i)&&(t[o]=e.getAttribute(i));return e.getAttribute("data-node-type")==="blockContainer"?t:!1}}]},renderHTML({HTMLAttributes:e}){var n;const t=document.createElement("div");t.className="bn-block-outer",t.setAttribute("data-node-type","blockOuter");for(const[a,r]of Object.entries(e))a!=="class"&&t.setAttribute(a,r);const o={...((n=this.options.domAttributes)==null?void 0:n.block)||{},...e},i=document.createElement("div");i.className=$("bn-block",o.class),i.setAttribute("data-node-type",this.name);for(const[a,r]of Object.entries(o))a!=="class"&&i.setAttribute(a,r);return t.appendChild(i),{dom:t,contentDOM:i}}}),Ha=k.Node.create({name:"blockGroup",group:"childContainer",content:"blockGroupChild+",parseHTML(){return[{tag:"div",getAttrs:e=>typeof e=="string"?!1:e.getAttribute("data-node-type")==="blockGroup"?null:!1}]},renderHTML({HTMLAttributes:e}){var i;const t={...((i=this.options.domAttributes)==null?void 0:i.blockGroup)||{},...e},o=document.createElement("div");o.className=$("bn-block-group",t.class),o.setAttribute("data-node-type","blockGroup");for(const[n,a]of Object.entries(t))n!=="class"&&o.setAttribute(n,a);return{dom:o,contentDOM:o}}}),Oa=k.Node.create({name:"doc",topNode:!0,content:"blockGroup"}),ii=e=>{const t={},o=Ua(e);for(const n of o)t[n.name]=n;t.formattingToolbar=new Oo(e.editor),t.linkToolbar=new Fo(e.editor),t.sideMenu=new Yo(e.editor),t.suggestionMenus=new Qo(e.editor),t.filePanel=new Do(e.editor),t.placeholder=new ya(e.editor,e.placeholders),(e.animations??!0)&&(t.animations=new va),e.tableHandles&&(t.tableHandles=new oi(e.editor)),t.dropCursor={plugin:e.dropCursor({width:5,color:"#ddeeff",editor:e.editor})},t.nodeSelectionKeyboard=new ka;const i=e.disableExtensions||[];for(const n of i)delete t[n];return t},Ua=e=>{var o;const t=[k.extensions.ClipboardTextSerializer,k.extensions.Commands,k.extensions.Editable,k.extensions.FocusEvents,k.extensions.Tabindex,yi.Gapcursor,J.configure({types:["blockContainer","columnList","column"],setIdAttribute:e.setIdAttribute}),wi.HardBreak.extend({priority:10}),xi.Text,Ci.Link.extend({inclusive:!1}).configure({defaultProtocol:$o,protocols:Go}),...Object.values(e.styleSpecs).map(i=>i.implementation.mark),Aa,pa,Pa,k.Extension.create({name:"OverrideEscape",addKeyboardShortcuts(){return{Escape:()=>e.editor.suggestionMenus.shown?!1:this.editor.commands.blur()}}}),Oa,ja.configure({editor:e.editor,domAttributes:e.domAttributes}),fa.configure({editor:e.editor,tabBehavior:e.tabBehavior}),Ha.configure({domAttributes:e.domAttributes}),...Object.values(e.inlineContentSpecs).filter(i=>i.config!=="link"&&i.config!=="text").map(i=>i.implementation.node.configure({editor:e.editor})),...Object.values(e.blockSpecs).flatMap(i=>[...(i.implementation.requiredExtensions||[]).map(n=>n.configure({editor:e.editor,domAttributes:e.domAttributes})),i.implementation.node.configure({editor:e.editor,domAttributes:e.domAttributes})]),ua(e.editor),da(e.editor),sa(e.editor),...e.trailingBlock===void 0||e.trailingBlock?[Na]:[]];if(e.collaboration){if(t.push(Pi.default.configure({fragment:e.collaboration.fragment})),(o=e.collaboration.provider)!=null&&o.awareness){const i=n=>{const a=document.createElement("span");a.classList.add("collaboration-cursor__caret"),a.setAttribute("style",`border-color: ${n.color}`);const r=document.createElement("span");r.classList.add("collaboration-cursor__label"),r.setAttribute("style",`background-color: ${n.color}`),r.insertBefore(document.createTextNode(n.name),null);const s=document.createTextNode(""),l=document.createTextNode("");return a.insertBefore(s,null),a.insertBefore(r,null),a.insertBefore(l,null),a};t.push(Ai.default.configure({user:e.collaboration.user,render:e.collaboration.renderCursor||i,provider:e.collaboration.provider}))}}else t.push(vi.History);return t};function Ra(e,t){const o=[];return e.forEach((i,n,a)=>{a!==t&&o.push(i)}),v.Fragment.from(o)}function Va(e,t){const o=[];for(let i=0;i<e.childCount;i++)if(e.child(i).type.name==="tableRow")if(o.length>0&&o[o.length-1].type.name==="table"){const n=o[o.length-1],a=n.copy(n.content.addToEnd(e.child(i)));o[o.length-1]=a}else{const n=t.nodes.table.createChecked(void 0,e.child(i));o.push(n)}else o.push(e.child(i));return e=v.Fragment.from(o),e}function za(e,t){let o=v.Fragment.from(e.content);o=Va(o,t.state.schema);for(let i=0;i<o.childCount;i++)if(o.child(i).type.spec.group==="blockContent"){const n=[o.child(i)];if(i+1<o.childCount&&o.child(i+1).type.name==="blockGroup"){const r=o.child(i+1).child(0).child(0);(r.type.name==="bulletListItem"||r.type.name==="numberedListItem"||r.type.name==="checkListItem")&&(n.push(o.child(i+1)),o=Ra(o,i+1))}const a=t.state.schema.nodes.blockContainer.createChecked(void 0,n);o=o.replaceChild(i,a)}return new v.Slice(o,e.openStart,e.openEnd)}function ot(e){return e&&Object.fromEntries(Object.entries(e).filter(([,t])=>t!==void 0))}class xe{constructor(t){h(this,"blockSpecs");h(this,"inlineContentSpecs");h(this,"styleSpecs");h(this,"blockSchema");h(this,"inlineContentSchema");h(this,"styleSchema");h(this,"BlockNoteEditor","only for types");h(this,"Block","only for types");h(this,"PartialBlock","only for types");this.blockSpecs=ot(t==null?void 0:t.blockSpecs)||Ke,this.inlineContentSpecs=ot(t==null?void 0:t.inlineContentSpecs)||Xe,this.styleSpecs=ot(t==null?void 0:t.styleSpecs)||qe,this.blockSchema=He(this.blockSpecs),this.inlineContentSchema=Re(this.inlineContentSpecs),this.styleSchema=ze(this.styleSpecs)}static create(t){return new xe(t)}}const Be=class Be extends k.Editor{constructor(o,i){super({...o,content:void 0});h(this,"_state");h(this,"_creating",!1);h(this,"mount",o=>{o?(this.options.element=o,this.createViewAlternative()):(this.destroy(),this._creating=!1)});const n=this.schema;let a;const r=n.nodes.doc.createAndFill;n.nodes.doc.createAndFill=(...l)=>{if(a)return a;const u=r.apply(n.nodes.doc,l),c=JSON.parse(JSON.stringify(u.toJSON()));return c.content[0].content[0].attrs.id="initialBlockId",a=v.Node.fromJSON(n,c),a};let s;try{const l=o==null?void 0:o.content.map(u=>q(u,this.schema,i).toJSON());s=k.createDocument({type:"doc",content:[{type:"blockGroup",content:l}]},this.schema,this.options.parseOptions)}catch(l){throw console.error("Error creating document from blocks passed as `initialContent`. Caused by exception: ",l),new Error("Error creating document from blocks passed as `initialContent`:\n"+ +JSON.stringify(o.content))}this._state=_.EditorState.create({doc:s,schema:this.schema})}get state(){return this.view&&(this._state=this.view.state),this._state}dispatch(o){this.view?this.view.dispatch(o):this._state=this.state.apply(o)}createViewAlternative(){this._creating=!0,queueMicrotask(()=>{if(!this._creating)return;this.view=new L.EditorView({mount:this.options.element},{...this.options.editorProps,dispatchTransaction:this.dispatchTransaction.bind(this),state:this.state});const o=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(o),this.createNodeViews(),this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0,this._creating=!1})}};h(Be,"create",(o,i)=>{var a,r;const n=(a=globalThis==null?void 0:globalThis.window)==null?void 0:a.setTimeout;typeof((r=globalThis==null?void 0:globalThis.window)==null?void 0:r.setTimeout)<"u"&&(globalThis.window.setTimeout=()=>0);try{return new Be(o,i)}finally{n&&(globalThis.window.setTimeout=n)}});let Ee=Be;Ee.prototype.createView=function(){this.options.onPaste=this.options.onDrop=void 0};const Fa={enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!1};class it{constructor(t){h(this,"_pmSchema");h(this,"extensions",{});h(this,"headless",!1);h(this,"_tiptapEditor");h(this,"elementRenderer",null);h(this,"blockCache",new WeakMap);h(this,"dictionary");h(this,"schema");h(this,"blockImplementations");h(this,"inlineContentImplementations");h(this,"styleImplementations");h(this,"formattingToolbar");h(this,"linkToolbar");h(this,"sideMenu");h(this,"suggestionMenus");h(this,"filePanel");h(this,"tableHandles");h(this,"uploadFile");h(this,"onUploadStartCallbacks",[]);h(this,"onUploadEndCallbacks",[]);h(this,"resolveFileUrl");h(this,"mount",t=>{this._tiptapEditor.mount(t)});var s,l,u,c,p,m,f;this.options=t;const o=t;if(o.onEditorContentChange)throw new Error("onEditorContentChange initialization option is deprecated, use <BlockNoteView onChange={...} />, the useEditorChange(...) hook, or editor.onChange(...)");if(o.onTextCursorPositionChange)throw new Error("onTextCursorPositionChange initialization option is deprecated, use <BlockNoteView onSelectionChange={...} />, the useEditorSelectionChange(...) hook, or editor.onSelectionChange(...)");if(o.onEditorReady)throw new Error("onEditorReady is deprecated. Editor is immediately ready for use after creation.");if(o.editable)throw new Error("editable initialization option is deprecated, use <BlockNoteView editable={true/false} />, or alternatively editor.isEditable = true/false");this.dictionary=t.dictionary||lt;const i={defaultStyles:!0,schema:t.schema||xe.create(),_headless:!1,...t,placeholders:{...this.dictionary.placeholders,...t.placeholders}};if(this.schema=i.schema,this.blockImplementations=i.schema.blockSpecs,this.inlineContentImplementations=i.schema.inlineContentSpecs,this.styleImplementations=i.schema.styleSpecs,this.extensions=ii({editor:this,domAttributes:i.domAttributes||{},blockSpecs:this.schema.blockSpecs,styleSpecs:this.schema.styleSpecs,inlineContentSpecs:this.schema.inlineContentSpecs,collaboration:i.collaboration,trailingBlock:i.trailingBlock,disableExtensions:i.disableExtensions,setIdAttribute:i.setIdAttribute,animations:i.animations??!0,tableHandles:A("table",this),dropCursor:this.options.dropCursor??Ei.dropCursor,placeholders:i.placeholders,tabBehavior:i.tabBehavior}),(((s=i._tiptapOptions)==null?void 0:s.extensions)||[]).forEach(g=>{this.extensions[g.name]=g}),Object.entries(i._extensions||{}).forEach(([g,b])=>{this.extensions[g]=b}),this.formattingToolbar=this.extensions.formattingToolbar,this.linkToolbar=this.extensions.linkToolbar,this.sideMenu=this.extensions.sideMenu,this.suggestionMenus=this.extensions.suggestionMenus,this.filePanel=this.extensions.filePanel,this.tableHandles=this.extensions.tableHandles,i.uploadFile){const g=i.uploadFile;this.uploadFile=async(b,y)=>{this.onUploadStartCallbacks.forEach(w=>w.apply(this,[y]));try{return await g(b,y)}finally{this.onUploadEndCallbacks.forEach(w=>w.apply(this,[y]))}}}this.resolveFileUrl=i.resolveFileUrl,this.headless=i._headless,i.collaboration&&i.initialContent&&console.warn("When using Collaboration, initialContent might cause conflicts, because changes should come from the collaboration provider");const n=i.initialContent||(t.collaboration?[{type:"paragraph",id:"initialBlockId"}]:[{type:"paragraph",id:J.options.generateID()}]);if(!Array.isArray(n)||n.length===0)throw new Error("initialContent must be a non-empty array of blocks, received: "+n);const a=[...Object.entries(this.extensions).map(([g,b])=>{if(b instanceof k.Extension||b instanceof k.Node||b instanceof k.Mark)return b;if(!b.plugin)throw new Error("Extension should either be a TipTap extension or a ProseMirror plugin in a plugin property");return k.Extension.create({name:g,addProseMirrorPlugins:()=>[b.plugin]})})],r={...Fa,...i._tiptapOptions,content:n,extensions:a,editorProps:{...(l=i._tiptapOptions)==null?void 0:l.editorProps,attributes:{tabIndex:"0",...(c=(u=i._tiptapOptions)==null?void 0:u.editorProps)==null?void 0:c.attributes,...(p=i.domAttributes)==null?void 0:p.editor,class:$("bn-editor",i.defaultStyles?"bn-default-styles":"",((f=(m=i.domAttributes)==null?void 0:m.editor)==null?void 0:f.class)||"")},transformPasted:za}};this.headless?this._pmSchema=k.getSchema(r.extensions):(this._tiptapEditor=Ee.create(r,this.schema.styleSchema),this._pmSchema=this._tiptapEditor.schema)}get pmSchema(){return this._pmSchema}static create(t={}){return new it(t)}dispatch(t){this._tiptapEditor.dispatch(t)}get prosemirrorView(){return this._tiptapEditor.view}get domElement(){var t;return(t=this.prosemirrorView)==null?void 0:t.dom}isFocused(){var t;return((t=this.prosemirrorView)==null?void 0:t.hasFocus())||!1}focus(){var t;(t=this.prosemirrorView)==null||t.focus()}onUploadStart(t){return this.onUploadStartCallbacks.push(t),()=>{const o=this.onUploadStartCallbacks.indexOf(t);o>-1&&this.onUploadStartCallbacks.splice(o,1)}}onUploadEnd(t){return this.onUploadEndCallbacks.push(t),()=>{const o=this.onUploadEndCallbacks.indexOf(t);o>-1&&this.onUploadEndCallbacks.splice(o,1)}}get topLevelBlocks(){return this.document}get document(){const t=[];return this._tiptapEditor.state.doc.firstChild.descendants(o=>(t.push(E(o,this.schema.blockSchema,this.schema.inlineContentSchema,this.schema.styleSchema,this.blockCache)),!1)),t}getBlock(t){return Pn(this,t)}getPrevBlock(t){return An(this,t)}getNextBlock(t){return Nn(this,t)}getParentBlock(t){return Dn(this,t)}forEachBlock(t,o=!1){const i=this.document.slice();o&&i.reverse();function n(a){for(const r of a){if(t(r)===!1)return!1;const s=o?r.children.slice().reverse():r.children;if(!n(s))return!1}return!0}n(i)}onEditorContentChange(t){this._tiptapEditor.on("update",t)}onEditorSelectionChange(t){this._tiptapEditor.on("selectionUpdate",t)}getTextCursorPosition(){return qn(this)}setTextCursorPosition(t,o="start"){Eo(this,t,o)}getSelection(){return Xn(this)}setSelection(t,o){Zn(this,t,o)}get isEditable(){if(!this._tiptapEditor){if(!this.headless)throw new Error("no editor, but also not headless?");return!1}return this._tiptapEditor.isEditable===void 0?!0:this._tiptapEditor.isEditable}set isEditable(t){if(!this._tiptapEditor){if(!this.headless)throw new Error("no editor, but also not headless?");return}this._tiptapEditor.options.editable!==t&&this._tiptapEditor.setEditable(t)}insertBlocks(t,o,i="before"){return jn(this,t,o,i)}updateBlock(t,o){return po(this,t,o)}removeBlocks(t){return Wn(this,t)}replaceBlocks(t,o){return $n(this,t,o)}insertInlineContent(t){const o=H(t,this.pmSchema,this.schema.styleSchema);Kn({from:this._tiptapEditor.state.selection.from,to:this._tiptapEditor.state.selection.to},o,this)}getActiveStyles(){const t={},o=this._tiptapEditor.state.selection.$to.marks();for(const i of o){const n=this.schema.styleSchema[i.type.name];if(!n){i.type.name!=="link"&&console.warn("mark not found in styleschema",i.type.name);continue}n.propSchema==="boolean"?t[n.type]=!0:t[n.type]=i.attrs.stringValue}return t}addStyles(t){for(const[o,i]of Object.entries(t)){const n=this.schema.styleSchema[o];if(!n)throw new Error(`style ${o} not found in styleSchema`);if(n.propSchema==="boolean")this._tiptapEditor.commands.setMark(o);else if(n.propSchema==="string")this._tiptapEditor.commands.setMark(o,{stringValue:i});else throw new j(n.propSchema)}}removeStyles(t){for(const o of Object.keys(t))this._tiptapEditor.commands.unsetMark(o)}toggleStyles(t){for(const[o,i]of Object.entries(t)){const n=this.schema.styleSchema[o];if(!n)throw new Error(`style ${o} not found in styleSchema`);if(n.propSchema==="boolean")this._tiptapEditor.commands.toggleMark(o);else if(n.propSchema==="string")this._tiptapEditor.commands.toggleMark(o,{stringValue:i});else throw new j(n.propSchema)}}getSelectedText(){return this._tiptapEditor.state.doc.textBetween(this._tiptapEditor.state.selection.from,this._tiptapEditor.state.selection.to)}getSelectedLinkUrl(){return this._tiptapEditor.getAttributes("link").href}createLink(t,o){if(t==="")return;const{from:i,to:n}=this._tiptapEditor.state.selection;o||(o=this._tiptapEditor.state.doc.textBetween(i,n));const a=this.pmSchema.mark("link",{href:t});this.dispatch(this._tiptapEditor.state.tr.insertText(o,i,n).addMark(i,i+o.length,a))}canNestBlock(){return Fn(this)}nestBlock(){Co(this)}canUnnestBlock(){return Gn(this)}unnestBlock(){zn(this)}moveBlocksUp(){Un(this)}moveBlocksDown(){Rn(this)}async blocksToHTMLLossy(t=this.document){return re(this.pmSchema,this).exportBlocks(t,{})}async blocksToFullHTML(t){return gt(this.pmSchema,this).serializeBlocks(t,{})}async tryParseHTMLToBlocks(t){return Je(t,this.schema.blockSchema,this.schema.inlineContentSchema,this.schema.styleSchema,this.pmSchema)}async blocksToMarkdownLossy(t=this.document){return So(t,this.pmSchema,this,{})}async tryParseMarkdownToBlocks(t){return Mo(t,this.schema.blockSchema,this.schema.inlineContentSchema,this.schema.styleSchema,this.pmSchema)}updateCollaborationUserInfo(t){if(!this.options.collaboration)throw new Error("Cannot update collaboration user info when collaboration is disabled.");this._tiptapEditor.commands.updateUser(t)}onChange(t){if(this.headless)return;const o=()=>{t(this)};return this._tiptapEditor.on("update",o),()=>{this._tiptapEditor.off("update",o)}}onSelectionChange(t){if(this.headless)return;const o=()=>{t(this)};return this._tiptapEditor.on("selectionUpdate",o),()=>{this._tiptapEditor.off("selectionUpdate",o)}}openSuggestionMenu(t,o){var a;const i=(a=this.prosemirrorView)==null?void 0:a.state.tr;if(!i)return;const n=o&&o.deleteTriggerCharacter?i.insertText(t):i;this.prosemirrorView.focus(),this.prosemirrorView.dispatch(n.scrollIntoView().setMeta(this.suggestionMenus.plugin,{triggerCharacter:t,deleteTriggerCharacter:(o==null?void 0:o.deleteTriggerCharacter)||!1,ignoreQueryLength:(o==null?void 0:o.ignoreQueryLength)||!1}))}}const Ga={gray:{text:"#9b9a97",background:"#ebeced"},brown:{text:"#64473a",background:"#e9e5e3"},red:{text:"#e03e3e",background:"#fbe4e4"},orange:{text:"#d9730d",background:"#f6e9d9"},yellow:{text:"#dfab01",background:"#fbf3db"},green:{text:"#4d6461",background:"#ddedea"},blue:{text:"#0b6e99",background:"#ddebf1"},purple:{text:"#6940a5",background:"#eae4f2"},pink:{text:"#ad1a72",background:"#f4dfeb"}},$a={gray:{text:"#bebdb8",background:"#9b9a97"},brown:{text:"#8e6552",background:"#64473a"},red:{text:"#ec4040",background:"#be3434"},orange:{text:"#e3790d",background:"#b7600a"},yellow:{text:"#dfab01",background:"#b58b00"},green:{text:"#6b8b87",background:"#4d6461"},blue:{text:"#0e87bc",background:"#0b6e99"},purple:{text:"#8552d7",background:"#6940a5"},pink:{text:"#da208f",background:"#ad1a72"}};class Wa{constructor(t,o,i){this.mappings=o,this.options=i}async resolveFile(t){var i;if(!((i=this.options)!=null&&i.resolveFileUrl))return(await fetch(t)).blob();const o=await this.options.resolveFileUrl(t);return o instanceof Blob?o:(await fetch(o)).blob()}mapStyles(t){return Object.entries(t).map(([i,n])=>this.mappings.styleMapping[i](n,this))}mapInlineContent(t){return this.mappings.inlineContentMapping[t.type](t,this)}transformInlineContent(t){return t.map(o=>this.mapInlineContent(o))}async mapBlock(t,o,i){return this.mappings.blockMapping[t.type](t,this,o,i)}}function Ka(e){return{createBlockMapping:t=>t,createInlineContentMapping:t=>t,createStyleMapping:t=>t}}let Se,nt;async function qa(e,t){if(!go("text",e))return[];if(!Se){Se=import("@emoji-mart/data"),nt=await import("emoji-mart");const n=(await Se).default;await nt.init({data:n})}const o=(await Se).default;return(t.trim()===""?Object.values(o.emojis):await nt.SearchIndex.search(t)).map(n=>({id:n.skins[0].native,onItemClick:()=>e.insertInlineContent(n.skins[0].native+" ")}))}function Xa(e){let t=e.getTextCursorPosition().block,o=e.schema.blockSchema[t.type].content;for(;o==="none";)t=e.getTextCursorPosition().nextBlock,o=e.schema.blockSchema[t.type].content,e.setTextCursorPosition(t,"end")}function D(e,t){const o=e.getTextCursorPosition().block;if(o.content===void 0)throw new Error("Slash Menu open in a block that doesn't contain content.");let i;return Array.isArray(o.content)&&(o.content.length===1&&Y(o.content[0])&&o.content[0].type==="text"&&o.content[0].text==="/"||o.content.length===0)?(i=e.updateBlock(o,t),e.setTextCursorPosition(i)):(i=e.insertBlocks([t],o,"after")[0],e.setTextCursorPosition(e.getTextCursorPosition().nextBlock)),Xa(e),i}function Za(e){const t=[];return A("heading",e)&&t.push({onItemClick:()=>{D(e,{type:"heading",props:{level:1}})},badge:G("Mod-Alt-1"),key:"heading",...e.dictionary.slash_menu.heading},{onItemClick:()=>{D(e,{type:"heading",props:{level:2}})},badge:G("Mod-Alt-2"),key:"heading_2",...e.dictionary.slash_menu.heading_2},{onItemClick:()=>{D(e,{type:"heading",props:{level:3}})},badge:G("Mod-Alt-3"),key:"heading_3",...e.dictionary.slash_menu.heading_3}),A("numberedListItem",e)&&t.push({onItemClick:()=>{D(e,{type:"numberedListItem"})},badge:G("Mod-Shift-7"),key:"numbered_list",...e.dictionary.slash_menu.numbered_list}),A("bulletListItem",e)&&t.push({onItemClick:()=>{D(e,{type:"bulletListItem"})},badge:G("Mod-Shift-8"),key:"bullet_list",...e.dictionary.slash_menu.bullet_list}),A("checkListItem",e)&&t.push({onItemClick:()=>{D(e,{type:"checkListItem"})},badge:G("Mod-Shift-9"),key:"check_list",...e.dictionary.slash_menu.check_list}),A("paragraph",e)&&t.push({onItemClick:()=>{D(e,{type:"paragraph"})},badge:G("Mod-Alt-0"),key:"paragraph",...e.dictionary.slash_menu.paragraph}),A("codeBlock",e)&&t.push({onItemClick:()=>{D(e,{type:"codeBlock"})},badge:G("Mod-Alt-c"),key:"code_block",...e.dictionary.slash_menu.code_block}),A("table",e)&&t.push({onItemClick:()=>{D(e,{type:"table",content:{type:"tableContent",rows:[{cells:["","",""]},{cells:["","",""]}]}})},badge:void 0,key:"table",...e.dictionary.slash_menu.table}),A("image",e)&&t.push({onItemClick:()=>{const o=D(e,{type:"image"});e.dispatch(e._tiptapEditor.state.tr.setMeta(e.filePanel.plugin,{block:o}))},key:"image",...e.dictionary.slash_menu.image}),A("video",e)&&t.push({onItemClick:()=>{const o=D(e,{type:"video"});e.dispatch(e._tiptapEditor.state.tr.setMeta(e.filePanel.plugin,{block:o}))},key:"video",...e.dictionary.slash_menu.video}),A("audio",e)&&t.push({onItemClick:()=>{const o=D(e,{type:"audio"});e.dispatch(e._tiptapEditor.state.tr.setMeta(e.filePanel.plugin,{block:o}))},key:"audio",...e.dictionary.slash_menu.audio}),A("file",e)&&t.push({onItemClick:()=>{const o=D(e,{type:"file"});e.dispatch(e._tiptapEditor.state.tr.setMeta(e.filePanel.plugin,{block:o}))},key:"file",...e.dictionary.slash_menu.file}),t.push({onItemClick:()=>{e.openSuggestionMenu(":",{deleteTriggerCharacter:!0,ignoreQueryLength:!0})},key:"emoji",...e.dictionary.slash_menu.emoji}),t}function Ja(e,t){return e.filter(({title:o,aliases:i})=>o.toLowerCase().includes(t.toLowerCase())||i&&i.filter(n=>n.toLowerCase().includes(t.toLowerCase())).length!==0)}function Ya(e,...t){const o=[...e];for(const i of t)for(const n of i){const a=o.findLastIndex(r=>r.group===n.group);a===-1?o.push(n):o.splice(a+1,0,n)}return o}function at(e=""){return typeof e=="string"?[{type:"text",text:e,styles:{}}]:e}function me(e){return typeof e=="string"?at(e):Array.isArray(e)?e.flatMap(t=>typeof t=="string"?at(t):Le(t)?{...t,content:at(t.content)}:Y(t)?t:{props:{},...t,content:me(t.content)}):(e==null?void 0:e.type)==="tableContent"?{type:"tableContent",columnWidths:e.columnWidths,rows:e.rows.map(t=>({...t,cells:t.cells.map(o=>me(o))}))}:e}function Qa(e,t){return t.map(o=>rt(e.blockSchema,o))}function rt(e,t){var n;const o=e[t.type].content,i={id:"",type:t.type,props:{},content:o==="inline"?[]:o==="table"?{type:"tableContent",columnWidths:[],rows:[]}:void 0,children:[],...t};if(Object.entries(e[t.type].propSchema).forEach(([a,r])=>{i.props[a]===void 0&&(i.props[a]=r.default)}),o==="inline"){const a=i.content;i.content=me(a)}else if(o==="table"){const a=i.content;i.content={type:"tableContent",columnWidths:(a==null?void 0:a.columnWidths)||((n=a==null?void 0:a.rows[0])==null?void 0:n.cells.map(()=>{}))||[],rows:(a==null?void 0:a.rows.map(r=>({cells:r.cells.map(s=>me(s))})))||[]}}return{...i,content:me(i.content),children:i.children.map(a=>rt(e,a))}}function ni(e){e.id||(e.id=J.options.generateID()),e.children&&ai(e.children)}function ai(e){for(const t of e)ni(t)}d.AudioBlock=Ot,d.BlockNoteEditor=it,d.BlockNoteSchema=xe,d.COLORS_DARK_MODE_DEFAULT=$a,d.COLORS_DEFAULT=Ga,d.CodeBlock=Vt,d.DEFAULT_LINK_PROTOCOL=$o,d.EMPTY_CELL_HEIGHT=Yi,d.EMPTY_CELL_WIDTH=$e,d.Exporter=Wa,d.FILE_AUDIO_ICON_SVG=Pt,d.FILE_ICON_SVG=Mt,d.FILE_IMAGE_ICON_SVG=Xt,d.FILE_VIDEO_ICON_SVG=io,d.FileBlock=Kt,d.FilePanelProsemirrorPlugin=Do,d.FilePanelView=No,d.FormattingToolbarProsemirrorPlugin=Oo,d.FormattingToolbarView=jo,d.HTMLToBlocks=Je,d.ImageBlock=to,d.LinkToolbarProsemirrorPlugin=Fo,d.SideMenuProsemirrorPlugin=Yo,d.SideMenuView=Zo,d.SuggestionMenuProseMirrorPlugin=Qo,d.TableHandlesProsemirrorPlugin=oi,d.TableHandlesView=ti,d.UniqueID=J,d.UnreachableCaseError=j,d.VALID_LINK_PROTOCOLS=Go,d.VideoBlock=co,d.addIdsToBlock=ni,d.addIdsToBlocks=ai,d.addInlineContentAttributes=Ue,d.addInlineContentKeyboardShortcuts=wt,d.addStyleAttributes=St,d.applyNonSelectableBlockFix=_t,d.assertEmpty=Hi,d.audioBlockConfig=Nt,d.audioParse=jt,d.audioPropSchema=At,d.audioRender=Dt,d.audioToExternalHTML=Ht,d.blockToNode=q,d.blocksToMarkdown=So,d.camelToDataKebab=se,d.checkBlockHasDefaultProp=Ln,d.checkBlockIsDefaultType=bo,d.checkBlockIsFileBlock=Tn,d.checkBlockIsFileBlockWithPlaceholder=In,d.checkBlockIsFileBlockWithPreview=Mn,d.checkBlockTypeHasDefaultProp=ko,d.checkDefaultBlockTypeInSchema=A,d.checkDefaultInlineContentTypeInSchema=go,d.cleanHTMLToMarkdown=ve,d.combineByGroup=Ya,d.contentNodeToInlineContent=ce,d.contentNodeToTableContent=Oe,d.createAddFileButton=Tt,d.createBlockSpec=de,d.createBlockSpecFromStronglyTypedTiptapNode=K,d.createDefaultBlockDOMOutputSpec=R,d.createExternalHTMLExporter=re,d.createFigureWithCaption=_e,d.createFileBlockWrapper=ke,d.createFileNameWithIcon=It,d.createInlineContentSpec=Ki,d.createInlineContentSpecFromTipTapNode=Ct,d.createInternalBlockSpec=je,d.createInternalHTMLSerializer=gt,d.createInternalInlineContentSpec=vt,d.createInternalStyleSpec=Ve,d.createLinkWithCaption=pe,d.createResizableFileBlockWrapper=Ge,d.createStronglyTypedTiptapNode=W,d.createStyleSpec=qi,d.createStyleSpecFromTipTapMark=X,d.createSuggestionMenu=Ta,d.customizeCodeBlock=Xi,d.defaultBlockSchema=mo,d.defaultBlockSpecs=Ke,d.defaultBlockToHTML=Ae,d.defaultCodeBlockPropSchema=ye,d.defaultInlineContentSchema=fo,d.defaultInlineContentSpecs=Xe,d.defaultProps=S,d.defaultStyleSchema=Bn,d.defaultStyleSpecs=qe,d.fileBlockConfig=Ft,d.fileParse=$t,d.filePropSchema=zt,d.fileRender=Gt,d.fileToExternalHTML=Wt,d.filenameFromURL=Wi,d.filterSuggestionItems=Ja,d.formatKeyboardShortcut=G,d.formattingToolbarPluginKey=Ho,d.getBlockFromPos=kt,d.getBlockInfo=F,d.getBlockInfoFromResolvedPos=Q,d.getBlockInfoFromSelection=C,d.getBlockInfoWithManualOffset=ge,d.getBlockNoteExtensions=ii,d.getBlockSchemaFromSpecs=He,d.getDefaultEmojiPickerItems=qa,d.getDefaultSlashMenuItems=Za,d.getInlineContentParseRules=xt,d.getInlineContentSchemaFromSpecs=Re,d.getNearestBlockPos=z,d.getNodeById=P,d.getParseRules=yt,d.getStyleParseRules=Bt,d.getStyleSchemaFromSpecs=ze,d.imageBlockConfig=Jt,d.imageParse=Qt,d.imagePropSchema=Zt,d.imageRender=Yt,d.imageToExternalHTML=eo,d.inheritedProps=Ne,d.initializeESMDependencies=we,d.inlineContentToNodes=H,d.insertOrUpdateBlock=D,d.isAppleOS=bt,d.isLinkInlineContent=Ie,d.isPartialLinkInlineContent=Le,d.isSafari=$i,d.isStyledTextInlineContent=Y,d.linkToolbarPluginKey=zo,d.locales=ji,d.mappingFactory=Ka,d.markdownToBlocks=Mo,d.mergeCSSClasses=$,d.nodeToBlock=E,d.nodeToCustomInlineContent=be,d.parseEmbedElement=Fe,d.parseFigureElement=ue,d.partialBlockToBlockForTesting=rt,d.partialBlocksToBlocksForTesting=Qa,d.propsToAttributes=De,d.sideMenuPluginKey=Jo,d.stylePropsToAttributes=Et,d.tableContentToNodes=ae,d.tableHandlesPluginKey=ie,d.updateBlock=po,d.updateBlockCommand=T,d.uploadToTmpFilesDotOrg_DEV_ONLY=Zi,d.videoBlockConfig=ao,d.videoParse=so,d.videoPropSchema=no,d.videoRender=ro,d.videoToExternalHTML=lo,d.wrapInBlockStructure=le,Object.defineProperty(d,Symbol.toStringTag,{value:"Module"})});
|
|
11
11
|
//# sourceMappingURL=blocknote.umd.cjs.map
|