@start-base/block-editor
Version:
The tsup-template is a project or template designed to facilitate the creation of React components by providing certain features. Here's an explanation of its key features:
1 lines • 105 kB
JavaScript
import e,{forwardRef as t,createElement as n,memo as o,useRef as a,useState as r,useEffect as i,useCallback as l,useImperativeHandle as c,Fragment as s,useMemo as d,createContext as u,useLayoutEffect as m}from"react";import{ReactRenderer as p,Node as h,ReactNodeViewRenderer as g,BubbleMenu as f,NodeViewWrapper as y,EditorContent as v,useEditor as k}from"@tiptap/react";import{StarterKit as b}from"@tiptap/starter-kit";import{Highlight as E}from"@tiptap/extension-highlight";import{CharacterCount as C}from"@tiptap/extension-character-count";import{Underline as S}from"@tiptap/extension-underline";import{Placeholder as x}from"@tiptap/extension-placeholder";import{TextAlign as w}from"@tiptap/extension-text-align";import{TextStyle as I}from"@tiptap/extension-text-style";import{FontFamily as M}from"@tiptap/extension-font-family";import{Typography as N}from"@tiptap/extension-typography";import{Color as A}from"@tiptap/extension-color";import{FocusClasses as U}from"@tiptap/extension-focus";import{Dropcursor as L}from"@tiptap/extension-dropcursor";import{Subscript as T}from"@tiptap/extension-subscript";import{Superscript as H}from"@tiptap/extension-superscript";import{CodeBlock as B}from"@tiptap/extension-code-block";import{TaskItem as P}from"@tiptap/extension-task-item";import{TaskList as R}from"@tiptap/extension-task-list";import{ListKeymap as D}from"@tiptap/extension-list-keymap";import{Image as z}from"@tiptap/extension-image";import{Youtube as O}from"@tiptap/extension-youtube";import{Emoji as V}from"@tiptap-pro/extension-emoji";import{TableOfContents as j}from"@tiptap-pro/extension-table-of-contents";import{FileHandler as q}from"@tiptap-pro/extension-file-handler";import{Details as _}from"@tiptap-pro/extension-details";import{DetailsContent as F}from"@tiptap-pro/extension-details-content";import{DetailsSummary as $}from"@tiptap-pro/extension-details-summary";import{Extension as K,Node as W,mergeAttributes as Y,findParentNode as J,isTextSelection as G}from"@tiptap/core";import{Plugin as Q,PluginKey as Z}from"@tiptap/pm/state";import{DecorationSet as X,Decoration as ee}from"@tiptap/pm/view";import te from"@tiptap/extension-table";import{TableMap as ne,CellSelection as oe}from"@tiptap/pm/tables";import ae from"@tiptap/extension-table-row";import re from"@tiptap/extension-table-header";import ie from"@tiptap/extension-horizontal-rule";import le from"@tiptap/extension-heading";import{Document as ce}from"@tiptap/extension-document";import se from"@tiptap/suggestion";import de,{sticky as ue}from"tippy.js";import me from"clsx";import pe from"@tiptap/extension-link";import{Slot as he}from"@radix-ui/react-slot";import ge from"@tippyjs/react/headless";import*as fe from"@radix-ui/react-popover";import*as ye from"@radix-ui/react-dropdown-menu";import ve from"crypto";import ke from"@tiptap-pro/extension-drag-handle-react";var be=Object.defineProperty,Ee=Object.defineProperties,Ce=Object.getOwnPropertyDescriptors,Se=Object.getOwnPropertySymbols,xe=Object.prototype.hasOwnProperty,we=Object.prototype.propertyIsEnumerable,Ie=(e,t,n)=>t in e?be(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Me=(e,t)=>{for(var n in t||(t={}))xe.call(t,n)&&Ie(e,n,t[n]);if(Se)for(var n of Se(t))we.call(t,n)&&Ie(e,n,t[n]);return e},Ne=(e,t)=>Ee(e,Ce(t)),Ae=(e,t)=>{var n={};for(var o in e)xe.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&Se)for(var o of Se(e))t.indexOf(o)<0&&we.call(e,o)&&(n[o]=e[o]);return n},Ue=(e,t,n)=>new Promise(((o,a)=>{var r=e=>{try{l(n.next(e))}catch(e){a(e)}},i=e=>{try{l(n.throw(e))}catch(e){a(e)}},l=e=>e.done?o(e.value):Promise.resolve(e.value).then(r,i);l((n=n.apply(e,t)).next())})),Le=(...e)=>e.filter(((e,t,n)=>Boolean(e)&&n.indexOf(e)===t)).join(" "),Te={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},He=t(((e,t)=>{var o=e,{color:a="currentColor",size:r=24,strokeWidth:i=2,absoluteStrokeWidth:l,className:c="",children:s,iconNode:d}=o,u=Ae(o,["color","size","strokeWidth","absoluteStrokeWidth","className","children","iconNode"]);return n("svg",Me(Ne(Me({ref:t},Te),{width:r,height:r,stroke:a,strokeWidth:l?24*Number(i)/Number(r):i,className:Le("lucide",c)}),u),[...d.map((([e,t])=>n(e,t))),...Array.isArray(s)?s:[s]])})),Be=(e,o)=>{const a=t(((t,a)=>{var r,i=t,{className:l}=i,c=Ae(i,["className"]);return n(He,Me({ref:a,iconNode:o,className:Le(`lucide-${r=e,r.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,l)},c))}));return a.displayName=`${e}`,a},Pe=Be("AlignCenter",[["line",{x1:"21",x2:"3",y1:"6",y2:"6",key:"1fp77t"}],["line",{x1:"17",x2:"7",y1:"12",y2:"12",key:"rsh8ii"}],["line",{x1:"19",x2:"5",y1:"18",y2:"18",key:"1t0tuv"}]]),Re=Be("AlignHorizontalDistributeCenter",[["rect",{width:"6",height:"14",x:"4",y:"5",rx:"2",key:"1wwnby"}],["rect",{width:"6",height:"10",x:"14",y:"7",rx:"2",key:"1fe6j6"}],["path",{d:"M17 22v-5",key:"4b6g73"}],["path",{d:"M17 7V2",key:"hnrr36"}],["path",{d:"M7 22v-3",key:"1r4jpn"}],["path",{d:"M7 5V2",key:"liy1u9"}]]),De=Be("AlignHorizontalDistributeEnd",[["rect",{width:"6",height:"14",x:"4",y:"5",rx:"2",key:"1wwnby"}],["rect",{width:"6",height:"10",x:"14",y:"7",rx:"2",key:"1fe6j6"}],["path",{d:"M10 2v20",key:"uyc634"}],["path",{d:"M20 2v20",key:"1tx262"}]]),ze=Be("AlignHorizontalDistributeStart",[["rect",{width:"6",height:"14",x:"4",y:"5",rx:"2",key:"1wwnby"}],["rect",{width:"6",height:"10",x:"14",y:"7",rx:"2",key:"1fe6j6"}],["path",{d:"M4 2v20",key:"gtpd5x"}],["path",{d:"M14 2v20",key:"tg6bpw"}]]),Oe=Be("AlignJustify",[["line",{x1:"3",x2:"21",y1:"6",y2:"6",key:"4m8b97"}],["line",{x1:"3",x2:"21",y1:"12",y2:"12",key:"10d38w"}],["line",{x1:"3",x2:"21",y1:"18",y2:"18",key:"kwyyxn"}]]),Ve=Be("AlignLeft",[["line",{x1:"21",x2:"3",y1:"6",y2:"6",key:"1fp77t"}],["line",{x1:"15",x2:"3",y1:"12",y2:"12",key:"v6grx8"}],["line",{x1:"17",x2:"3",y1:"18",y2:"18",key:"1awlsn"}]]),je=Be("AlignRight",[["line",{x1:"21",x2:"3",y1:"6",y2:"6",key:"1fp77t"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}],["line",{x1:"21",x2:"7",y1:"18",y2:"18",key:"1g9eri"}]]),qe=Be("ArrowDownToLine",[["path",{d:"M12 17V3",key:"1cwfxf"}],["path",{d:"m6 11 6 6 6-6",key:"12ii2o"}],["path",{d:"M19 21H5",key:"150jfl"}]]),_e=Be("ArrowLeftToLine",[["path",{d:"M3 19V5",key:"rwsyhb"}],["path",{d:"m13 6-6 6 6 6",key:"1yhaz7"}],["path",{d:"M7 12h14",key:"uoisry"}]]),Fe=Be("ArrowRightToLine",[["path",{d:"M17 12H3",key:"8awo09"}],["path",{d:"m11 18 6-6-6-6",key:"8c2y43"}],["path",{d:"M21 5v14",key:"nzette"}]]),$e=Be("ArrowUpToLine",[["path",{d:"M5 3h14",key:"7usisc"}],["path",{d:"m18 13-6-6-6 6",key:"1kf1n9"}],["path",{d:"M12 7v14",key:"1akyts"}]]),Ke=Be("Bold",[["path",{d:"M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8",key:"mg9rjx"}]]),We=Be("Book",[["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",key:"k3hazp"}]]),Ye=Be("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]),Je=Be("Clipboard",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}]]),Ge=Be("CodeXml",[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]]),Qe=Be("Columns2",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M12 3v18",key:"108xh3"}]]),Ze=Be("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]),Xe=Be("EllipsisVertical",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]]),et=Be("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]),tt=Be("Heading1",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"m17 12 3-2v8",key:"1hhhft"}]]),nt=Be("Heading2",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1",key:"9jr5yi"}]]),ot=Be("Heading3",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M17.5 10.5c1.7-1 3.5 0 3.5 1.5a2 2 0 0 1-2 2",key:"68ncm8"}],["path",{d:"M17 17.5c2 1.5 4 .3 4-1.5a2 2 0 0 0-2-2",key:"1ejuhz"}]]),at=Be("Heading4",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M17 10v4h4",key:"13sv97"}],["path",{d:"M21 10v8",key:"1kdml4"}]]),rt=Be("Heading5",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M17 13v-3h4",key:"1nvgqp"}],["path",{d:"M17 17.7c.4.2.8.3 1.3.3 1.5 0 2.7-1.1 2.7-2.5S19.8 13 18.3 13H17",key:"2nebdn"}]]),it=Be("Heading6",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["circle",{cx:"19",cy:"16",r:"2",key:"15mx69"}],["path",{d:"M20 10c-2 2-3 3.5-3 6",key:"f35dl0"}]]),lt=Be("Highlighter",[["path",{d:"m9 11-6 6v3h9l3-3",key:"1a3l36"}],["path",{d:"m22 12-4.6 4.6a2 2 0 0 1-2.8 0l-5.2-5.2a2 2 0 0 1 0-2.8L14 4",key:"14a9rk"}]]),ct=Be("ImageUp",[["path",{d:"M10.3 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v10l-3.1-3.1a2 2 0 0 0-2.814.014L6 21",key:"9csbqa"}],["path",{d:"m14 19.5 3-3 3 3",key:"9vmjn0"}],["path",{d:"M17 22v-5.5",key:"1aa6fl"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}]]),st=Be("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]),dt=Be("Italic",[["line",{x1:"19",x2:"10",y1:"4",y2:"4",key:"15jd3p"}],["line",{x1:"14",x2:"5",y1:"20",y2:"20",key:"bu0au3"}],["line",{x1:"15",x2:"9",y1:"4",y2:"20",key:"uljnxc"}]]),ut=Be("Link",[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]),mt=Be("ListCollapse",[["path",{d:"m3 10 2.5-2.5L3 5",key:"i6eama"}],["path",{d:"m3 19 2.5-2.5L3 14",key:"w2gmor"}],["path",{d:"M10 6h11",key:"c7qv1k"}],["path",{d:"M10 12h11",key:"6m4ad9"}],["path",{d:"M10 18h11",key:"11hvi2"}]]),pt=Be("ListOrdered",[["line",{x1:"10",x2:"21",y1:"6",y2:"6",key:"76qw6h"}],["line",{x1:"10",x2:"21",y1:"12",y2:"12",key:"16nom4"}],["line",{x1:"10",x2:"21",y1:"18",y2:"18",key:"u3jurt"}],["path",{d:"M4 6h1v4",key:"cnovpq"}],["path",{d:"M4 10h2",key:"16xx2s"}],["path",{d:"M6 18H4c0-1 2-2 2-3s-1-1.5-2-1",key:"m9a95d"}]]),ht=Be("ListTodo",[["rect",{x:"3",y:"5",width:"6",height:"6",rx:"1",key:"1defrl"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]]),gt=Be("List",[["line",{x1:"8",x2:"21",y1:"6",y2:"6",key:"7ey8pc"}],["line",{x1:"8",x2:"21",y1:"12",y2:"12",key:"rjfblc"}],["line",{x1:"8",x2:"21",y1:"18",y2:"18",key:"c3b1m8"}],["line",{x1:"3",x2:"3.01",y1:"6",y2:"6",key:"1g7gq3"}],["line",{x1:"3",x2:"3.01",y1:"12",y2:"12",key:"1pjlvk"}],["line",{x1:"3",x2:"3.01",y1:"18",y2:"18",key:"28t2mc"}]]),ft=Be("Mic",[["path",{d:"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z",key:"131961"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}]]),yt=Be("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]),vt=Be("Palette",[["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["path",{d:"M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.554C21.965 6.012 17.461 2 12 2z",key:"12rzf8"}]]),kt=Be("PanelLeft",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]),bt=Be("PanelRight",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}]]),Et=Be("Pen",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]]),Ct=Be("Pilcrow",[["path",{d:"M13 4v16",key:"8vvj80"}],["path",{d:"M17 4v16",key:"7dpous"}],["path",{d:"M19 4H9.5a4.5 4.5 0 0 0 0 9H13",key:"sh4n9v"}]]),St=Be("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]),xt=Be("Quote",[["path",{d:"M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"rib7q0"}],["path",{d:"M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"1ymkrd"}]]),wt=Be("RemoveFormatting",[["path",{d:"M4 7V4h16v3",key:"9msm58"}],["path",{d:"M5 20h6",key:"1h6pxn"}],["path",{d:"M13 4 8 20",key:"kqq6aj"}],["path",{d:"m15 15 5 5",key:"me55sn"}],["path",{d:"m20 15-5 5",key:"11p7ol"}]]),It=Be("SprayCan",[["path",{d:"M3 3h.01",key:"159qn6"}],["path",{d:"M7 5h.01",key:"1hq22a"}],["path",{d:"M11 7h.01",key:"1osv80"}],["path",{d:"M3 7h.01",key:"1xzrh3"}],["path",{d:"M7 9h.01",key:"19b3jx"}],["path",{d:"M3 11h.01",key:"1eifu7"}],["rect",{width:"4",height:"4",x:"15",y:"5",key:"mri9e4"}],["path",{d:"m19 9 2 2v10c0 .6-.4 1-1 1h-6c-.6 0-1-.4-1-1V11l2-2",key:"aib6hk"}],["path",{d:"m13 14 8-2",key:"1d7bmk"}],["path",{d:"m13 19 8-2",key:"1y2vml"}]]),Mt=Be("SquareCode",[["path",{d:"M10 9.5 8 12l2 2.5",key:"3mjy60"}],["path",{d:"m14 9.5 2 2.5-2 2.5",key:"1bir2l"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]),Nt=Be("Strikethrough",[["path",{d:"M16 4H9a3 3 0 0 0-2.83 4",key:"43sutm"}],["path",{d:"M14 12a4 4 0 0 1 0 8H6",key:"nlfj13"}],["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}]]),At=Be("Subscript",[["path",{d:"m4 5 8 8",key:"1eunvl"}],["path",{d:"m12 5-8 8",key:"1ah0jp"}],["path",{d:"M20 19h-4c0-1.5.44-2 1.5-2.5S20 15.33 20 14c0-.47-.17-.93-.48-1.29a2.11 2.11 0 0 0-2.62-.44c-.42.24-.74.62-.9 1.07",key:"e8ta8j"}]]),Ut=Be("Superscript",[["path",{d:"m4 19 8-8",key:"hr47gm"}],["path",{d:"m12 19-8-8",key:"1dhhmo"}],["path",{d:"M20 12h-4c0-1.5.442-2 1.5-2.5S20 8.334 20 7.002c0-.472-.17-.93-.484-1.29a2.105 2.105 0 0 0-2.617-.436c-.42.239-.738.614-.899 1.06",key:"1dfcux"}]]),Lt=Be("Table",[["path",{d:"M12 3v18",key:"108xh3"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}]]),Tt=Be("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]),Ht=Be("Trash",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}]]),Bt=Be("Underline",[["path",{d:"M6 4v6a6 6 0 0 0 12 0V4",key:"9kb039"}],["line",{x1:"4",x2:"20",y1:"20",y2:"20",key:"nun2al"}]]),Pt=Be("Undo",[["path",{d:"M3 7v6h6",key:"1v2h90"}],["path",{d:"M21 17a9 9 0 0 0-9-9 9 9 0 0 0-6 2.3L3 13",key:"1r6uu6"}]]),Rt=Be("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]),Dt=Be("Youtube",[["path",{d:"M2.5 17a24.12 24.12 0 0 1 0-10 2 2 0 0 1 1.4-1.4 49.56 49.56 0 0 1 16.2 0A2 2 0 0 1 21.5 7a24.12 24.12 0 0 1 0 10 2 2 0 0 1-1.4 1.4 49.55 49.55 0 0 1-16.2 0A2 2 0 0 1 2.5 17",key:"1q2vi4"}],["path",{d:"m10 15 5-3-5-3z",key:"1jp15x"}]]),zt=e=>{const t=l((()=>e.chain().focus().toggleBold().run()),[e]),n=l((()=>e.chain().focus().toggleItalic().run()),[e]),o=l((()=>e.chain().focus().startSpeechRecognition().run()),[e]),a=l((()=>e.chain().focus().stopSpeechRecognition().run()),[e]),r=l((()=>e.chain().focus().toggleStrike().run()),[e]),i=l((()=>e.chain().focus().toggleUnderline().run()),[e]),c=l((()=>e.chain().focus().toggleCode().run()),[e]),s=l((()=>e.chain().focus().toggleCodeBlock().run()),[e]),d=l((()=>e.chain().focus().toggleSubscript().run()),[e]),u=l((()=>e.chain().focus().toggleSuperscript().run()),[e]),m=l((()=>e.chain().focus().setTextAlign("left").run()),[e]),p=l((()=>e.chain().focus().setTextAlign("center").run()),[e]),h=l((()=>e.chain().focus().setTextAlign("right").run()),[e]),g=l((()=>e.chain().focus().setTextAlign("justify").run()),[e]),f=l((t=>e.chain().setColor(t).run()),[e]),y=l((()=>e.chain().focus().unsetColor().run()),[e]),v=l((t=>e.chain().setHighlight({color:t}).run()),[e]),k=l((()=>e.chain().focus().unsetHighlight().run()),[e]),b=l(((t,n)=>e.chain().focus().setLink({href:t,target:n?"_blank":""}).run()),[e]);return{onBold:t,onItalic:n,onStrike:r,onUnderline:i,startSpeechRecognition:o,stopSpeechRecognition:a,onCode:c,onImage:t=>e.chain().setImageBlock({src:t}).focus().run(),onVideo:t=>e.commands.setYoutubeVideo({src:t,width:640,height:480}),onCodeBlock:s,onSubscript:d,onSuperscript:u,onAlignLeft:m,onAlignCenter:p,onAlignRight:h,onAlignJustify:g,onChangeColor:f,onClearColor:y,onChangeHighlight:v,onClearHighlight:k,onSetFont:l((t=>t&&0!==t.length?e.chain().focus().setFontFamily(t).run():e.chain().focus().unsetFontFamily().run()),[e]),onSetFontSize:l((t=>t&&0!==t.length?e.chain().focus().setFontSize(t).run():e.chain().focus().unsetFontSize().run()),[e]),onLink:b}},Ot=(e,t)=>{const{view:n,state:{selection:{from:o}}}=e,a=document.querySelectorAll(".has-focus"),r=a[a.length-1];if(r&&r.getAttribute("data-type")&&r.getAttribute("data-type")===t||r&&r.classList&&r.classList.contains(t))return r;const i=n.domAtPos(o).node;let l=i;for(l.tagName||(l=i.parentElement);l&&(!l.getAttribute("data-type")||l.getAttribute("data-type")!==t)&&!l.classList.contains(t);)l=l.parentElement;return l},Vt=K.create({name:"selection",addProseMirrorPlugins(){const{editor:e}=this;return[new Q({key:new Z("selection"),props:{decorations:t=>t.selection.empty||!0===e.isFocused?null:X.create(t.doc,[ee.inline(t.selection.from,t.selection.to,{class:"selection"})])}})]}}),jt=te.configure({resizable:!0,lastColumnResizable:!1}),qt=e=>t=>{const n=ne.get(t.$anchorCell.node(-1)),o=t.$anchorCell.start(-1),a=n.cellsInRect(e),r=n.cellsInRect(n.rectBetween(t.$anchorCell.pos-o,t.$headCell.pos-o));for(let e=0,t=a.length;e<t;e+=1)if(-1===r.indexOf(a[e]))return!1;return!0},_t=e=>J((e=>e.type.spec.tableRole&&"table"===e.type.spec.tableRole))(e),Ft=e=>e instanceof oe,$t=e=>{if(Ft(e)){const t=ne.get(e.$anchorCell.node(-1));return qt({left:0,right:t.width,top:0,bottom:t.height})(e)}return!1},Kt=e=>t=>n=>{const o=_t(n.selection),a="row"===e;if(o){const e=ne.get(o.node);if(t>=0&&t<(a?e.height:e.width)){const r=a?0:t,i=a?t:0,l=a?e.width:t+1,c=a?t+1:e.height,s=e.cellsInRect({left:r,top:i,right:a?l:r+1,bottom:a?i+1:c}),d=c-i==1?s:e.cellsInRect({left:a?r:l-1,top:a?c-1:i,right:l,bottom:c}),u=o.start+s[0],m=o.start+d[d.length-1],p=n.doc.resolve(u),h=n.doc.resolve(m);return n.setSelection(new oe(h,p))}}return n},Wt=Kt("column"),Yt=Kt("row"),Jt=W.create({name:"tableCell",content:"block+",tableRole:"cell",isolating:!0,addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"td"}],renderHTML({HTMLAttributes:e}){return["td",Y(this.options.HTMLAttributes,e),0]},addAttributes:()=>({colspan:{default:1,parseHTML:e=>{const t=e.getAttribute("colspan");return t?parseInt(t,10):1}},rowspan:{default:1,parseHTML:e=>{const t=e.getAttribute("rowspan");return t?parseInt(t,10):1}},colwidth:{default:null,parseHTML:e=>{const t=e.getAttribute("colwidth");return t?[parseInt(t,10)]:null}},style:{default:null}}),addProseMirrorPlugins(){const{isEditable:e}=this.editor;return[new Q({props:{decorations:t=>{if(!e)return X.empty;const{doc:n,selection:o}=t,a=[],r=(i=0,e=>{const t=_t(e);if(t){const e=ne.get(t.node);return(Array.isArray(i)?i:Array.from([i])).reduce(((n,o)=>{if(o>=0&&o<=e.width-1){const a=e.cellsInRect({left:o,right:o+1,top:0,bottom:e.height});return n.concat(a.map((e=>{const n=t.node.nodeAt(e),o=e+t.start;return{pos:o,start:o+1,node:n}})))}return n}),[])}return null})(o);var i;return r&&r.forEach((({pos:e},t)=>{a.push(ee.widget(e+1,(()=>{const e=(n=t,e=>{if(Ft(e)){const t=ne.get(e.$anchorCell.node(-1));return qt({left:0,right:t.width,top:n,bottom:n+1})(e)}return!1})(o);var n;let a="grip-row";e&&(a+=" selected"),0===t&&(a+=" first"),t===r.length-1&&(a+=" last");const i=document.createElement("a");return i.className=a,i.addEventListener("mousedown",(e=>{e.preventDefault(),e.stopImmediatePropagation(),this.editor.view.dispatch(Yt(t)(this.editor.state.tr))})),i})))})),X.create(n,a)}}})]}}),Gt=ae.extend({allowGapCursor:!1,content:"tableCell*"}),Qt=re.extend({addAttributes:()=>({colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:e=>{const t=e.getAttribute("colwidth");return t?t.split(",").map((e=>parseInt(e,10))):null}},style:{default:null}}),addProseMirrorPlugins(){const{isEditable:e}=this.editor;return[new Q({props:{decorations:t=>{if(!e)return X.empty;const{doc:n,selection:o}=t,a=[],r=(i=0,e=>{const t=_t(e);if(t){const e=ne.get(t.node);return(Array.isArray(i)?i:Array.from([i])).reduce(((n,o)=>{if(o>=0&&o<=e.height-1){const a=e.cellsInRect({left:0,right:e.width,top:o,bottom:o+1});return n.concat(a.map((e=>{const n=t.node.nodeAt(e),o=e+t.start;return{pos:o,start:o+1,node:n}})))}return n}),[])}return null})(o);var i;return r&&r.forEach((({pos:e},t)=>{a.push(ee.widget(e+1,(()=>{const e=(n=t,e=>{if(Ft(e)){const t=ne.get(e.$anchorCell.node(-1));return qt({left:n,right:n+1,top:0,bottom:t.height})(e)}return!1})(o);var n;let a="grip-column";e&&(a+=" selected"),0===t&&(a+=" first"),t===r.length-1&&(a+=" last");const i=document.createElement("a");return i.className=a,i.addEventListener("mousedown",(e=>{e.preventDefault(),e.stopImmediatePropagation(),this.editor.view.dispatch(Wt(t)(this.editor.state.tr))})),i})))})),X.create(n,a)}}})]}}),Zt=ie.extend({renderHTML(){return["div",Y(this.options.HTMLAttributes,{"data-type":this.name}),["hr"]]}}),Xt=le.extend({renderHTML({node:e,HTMLAttributes:t}){const n=parseInt(e.attrs.level,10);return[`h${this.options.levels.includes(n)?n:this.options.levels[0]}`,Y(this.options.HTMLAttributes,t),0]}}),en=ce.extend({content:"(block|columns)+"}),tn=({types:e,node:t})=>Array.isArray(e)&&e.includes(t.type)||t.type===e,nn=K.create({name:"trailingNode",addOptions:()=>({node:"paragraph",notAfter:["paragraph"]}),addProseMirrorPlugins(){const e=new Z(this.name),t=Object.entries(this.editor.schema.nodes).map((([,e])=>e)).filter((e=>this.options.notAfter.includes(e.name)));return[new Q({key:e,appendTransaction:(t,n,o)=>{const{doc:a,tr:r,schema:i}=o,l=e.getState(o),c=a.content.size,s=i.nodes[this.options.node];if(l)return r.insert(c,s.create())},state:{init:(e,n)=>{const o=n.tr.doc.lastChild;return!tn({node:o,types:t})},apply:(e,n)=>{if(!e.docChanged)return n;const o=e.doc.lastChild;return!tn({node:o,types:t})}}})]}}),on="SUI-DropdownButton-module-button-Qe-Xu",an="SUI-DropdownButton-module-active-BmUZB",rn="SUI-DropdownButton-module-disabled-VjzN1",ln=({children:t,isActive:n,onClick:o,disabled:a,className:r})=>{const i=me(on,{[an]:n&&!a,[rn]:a},r);return e.createElement("button",{className:i,disabled:a,onClick:o,type:"button"},t)},cn="SUI-Icon-module-icon-Mgrce",sn=o((({icon:t,className:n})=>{const o=t||null;return o?e.createElement(o,{className:me(cn,n),strokeWidth:2}):null}));sn.displayName="Icon";var dn="SUI-Surface-module-surface-oWG5n",un="SUI-Surface-module-shadow-ij-9A",mn="SUI-Surface-module-border-7RQCr",pn=t(((t,n)=>{var o=t,{children:a,className:r,withShadow:i=!0,withBorder:l=!0}=o,c=Ae(o,["children","className","withShadow","withBorder"]);const s=me(dn,i&&un,l&&mn,r);return e.createElement("div",Ne(Me({className:s},c),{ref:n}),a)}));pn.displayName="Surface";var hn="SUI-MenuList-module-scrollContainer-kAWsA",gn="SUI-MenuList-module-gridContainer-FXmgX",fn="SUI-MenuList-module-groupTitle-vj-9m",yn="SUI-MenuList-module-icon-IDHEc",vn=t(((t,n)=>{const o=a(null),d=a(null),[u,m]=r(0),[p,h]=r(0);i((()=>{m(0),h(0)}),[t.items]);const g=l(((e,n)=>{const o=t.items[e].commands[n];t.command(o)}),[t]);c(n,(()=>({onKeyDown:({event:e})=>{var n;if("ArrowDown"===e.key){if(!t.items.length)return!1;const e=t.items[u].commands;let n=p+1,o=u;return e.length-1<n&&(n=0,o=u+1),t.items.length-1<o&&(o=0),h(n),m(o),!0}if("ArrowUp"===e.key){if(!t.items.length)return!1;let e=p-1,o=u;return e<0&&(o=u-1,e=(null==(n=t.items[o])?void 0:n.commands.length)-1||0),o<0&&(o=t.items.length-1,e=t.items[o].commands.length-1),h(e),m(o),!0}return"Enter"===e.key&&(!(!t.items.length||-1===u||-1===p)&&(g(u,p),!0))}}))),i((()=>{if(d.current&&o.current){const e=d.current.offsetTop,t=d.current.offsetHeight;o.current.scrollTop=e-t}}),[p,u]);const f=l(((e,t)=>()=>{g(e,t)}),[g]);return t.items.length?e.createElement(pn,{ref:o,className:hn},e.createElement("div",{className:gn},t.items.map(((t,n)=>e.createElement(s,{key:`${t.title}-wrapper`},e.createElement("div",{className:fn,key:`${t.title}`},t.title),t.commands.map(((t,o)=>e.createElement(ln,{key:`${t.label}`,isActive:u===n&&p===o,onClick:f(n,o)},e.createElement(sn,{icon:t.icon,className:yn}),t.label)))))))):null}));vn.displayName="MenuList";var kn,bn=[{name:"format",title:"Format",commands:[{name:"heading1",label:"Heading 1",iconName:tt,description:"High priority section title",aliases:["h1"],action:e=>{e.chain().focus().setHeading({level:1}).run()}},{name:"heading2",label:"Heading 2",iconName:nt,description:"Medium priority section title",aliases:["h2"],action:e=>{e.chain().focus().setHeading({level:2}).run()}},{name:"heading3",label:"Heading 3",iconName:ot,description:"Low priority section title",aliases:["h3"],action:e=>{e.chain().focus().setHeading({level:3}).run()}},{name:"heading4",label:"Heading 4",iconName:at,description:"Low priority section title",aliases:["h4"],action:e=>{e.chain().focus().setHeading({level:4}).run()}},{name:"heading5",label:"Heading 5",iconName:rt,description:"Low priority section title",aliases:["h5"],action:e=>{e.chain().focus().setHeading({level:4}).run()}},{name:"heading6",label:"Heading 6",iconName:it,description:"Low priority section title",aliases:["h6"],action:e=>{e.chain().focus().setHeading({level:4}).run()}},{name:"bulletList",label:"Bullet List",iconName:gt,description:"Unordered list of items",aliases:["ul"],action:e=>{e.chain().focus().toggleBulletList().run()}},{name:"numberedList",label:"Numbered List",iconName:pt,description:"Ordered list of items",aliases:["ol"],action:e=>{e.chain().focus().toggleOrderedList().run()}},{name:"taskList",label:"Task List",iconName:ht,description:"Task list with todo items",aliases:["todo"],action:e=>{e.chain().focus().toggleTaskList().run()}},{name:"blockquote",label:"Blockquote",iconName:xt,description:"Element for quoting",action:e=>{e.chain().focus().setBlockquote().run()}},{name:"codeBlock",label:"Code Block",iconName:Ge,description:"Code block with syntax highlighting",shouldBeHidden:e=>e.isActive("columns"),action:e=>{e.chain().focus().setCodeBlock().run()}}]},{name:"multimedia",title:"Multimedia",commands:[{name:"uploadImage",label:"Upload Image",iconName:ct,description:"Upload image",aliases:["upImg"],action:e=>{e.chain().focus().setImageUpload().run()}}]},{name:"insert",title:"Insert",commands:[{name:"table",label:"Table",iconName:Lt,description:"Insert a table",shouldBeHidden:e=>e.isActive("columns"),action:e=>{e.chain().focus().insertTable({rows:3,cols:3,withHeaderRow:!1}).run()}},{name:"columns",label:"Columns",iconName:Qe,description:"Add two column content",aliases:["cols"],shouldBeHidden:e=>e.isActive("columns"),action:e=>{e.chain().focus().setColumns().focus(e.state.selection.head-1).run()}},{name:"collapsible",label:"Collapsible",iconName:mt,description:"Add collapsible content",aliases:["collapse"],action:e=>{e.chain().focus().setDetails().run()}},{name:"horizontalRule",label:"Horizontal Rule",iconName:yt,description:"Insert a horizontal divider",aliases:["hr"],action:e=>{e.chain().focus().setHorizontalRule().run()}},{name:"toc",label:"Table of Contents",iconName:We,aliases:["outline"],description:"Insert a table of contents",shouldBeHidden:e=>e.isActive("columns"),action:e=>{e.chain().focus().insertTableOfContents().run()}}]}],En="slashCommand",Cn=K.create({name:En,priority:200,onCreate(){kn=de("body",{interactive:!0,trigger:"manual",placement:"bottom-start",theme:"slash-command",maxWidth:"16rem",offset:[16,8],popperOptions:{strategy:"fixed",modifiers:[{name:"flip",enabled:!1}]}})},addProseMirrorPlugins(){return[se({editor:this.editor,char:"/",allowSpaces:!0,startOfLine:!0,pluginKey:new Z(En),allow:({state:e,range:t})=>{var n,o,a;const r=e.doc.resolve(t.from),i=1===r.depth,l="paragraph"===r.parent.type.name,c="/"===(null==(n=r.parent.textContent)?void 0:n.charAt(0)),s=this.editor.isActive("column"),d=null==(a=r.parent.textContent)?void 0:a.substring(null==(o=r.parent.textContent)?void 0:o.indexOf("/")),u=!(null==d?void 0:d.endsWith(" "));return(i&&l&&c||s&&l&&c)&&u},command:({editor:e,props:t})=>{var n,o,a;const{view:r,state:i}=e,{$head:l,$from:c}=r.state.selection,s=c.pos,d=(null==l?void 0:l.nodeBefore)?s-(null!=(a=null==(o=l.nodeBefore.text)?void 0:o.substring(null==(n=l.nodeBefore.text)?void 0:n.indexOf("/")).length)?a:0):c.start(),u=i.tr.deleteRange(d,s);r.dispatch(u),t.action(e),r.focus()},items:({query:e})=>bn.map((t=>Ne(Me({},t),{commands:t.commands.filter((t=>{const n=t.label.toLowerCase().trim(),o=e.toLowerCase().trim();if(t.aliases){const e=t.aliases.map((e=>e.toLowerCase().trim()));return n.includes(o)||e.includes(o)}return n.includes(o)})).filter((e=>!e.shouldBeHidden||!e.shouldBeHidden(this.editor)))}))).filter((e=>e.commands.length>0)).map((e=>Ne(Me({},e),{commands:e.commands.map((e=>Ne(Me({},e),{isEnabled:!0})))}))),render:()=>{let e,t=null;return{onStart:n=>{var o;e=new p(vn,{props:n,editor:n.editor});const{view:a}=n.editor,r=()=>{if(!n.clientRect)return n.editor.storage[En].rect;const t=n.clientRect();if(!t)return n.editor.storage[En].rect;let o=t.y;if(t.top+e.element.offsetHeight+40>window.innerHeight){const n=t.top+e.element.offsetHeight-window.innerHeight+40;o=t.y-n}return new DOMRect(t.x,o,t.width,t.height)};t=()=>{null==kn||kn[0].setProps({getReferenceClientRect:r})},null==(o=a.dom.parentElement)||o.addEventListener("scroll",t),null==kn||kn[0].setProps({getReferenceClientRect:r,appendTo:()=>document.body,content:e.element}),null==kn||kn[0].show()},onUpdate(t){var n;e.updateProps(t);const{view:o}=t.editor,a=()=>{if(!t.clientRect)return t.editor.storage[En].rect;const e=t.clientRect();return e?new DOMRect(e.x,e.y,e.width,e.height):t.editor.storage[En].rect};null==(n=o.dom.parentElement)||n.addEventListener("scroll",(()=>{null==kn||kn[0].setProps({getReferenceClientRect:a})})),t.editor.storage[En].rect=t.clientRect?a():{width:0,height:0,left:0,top:0,right:0,bottom:0},null==kn||kn[0].setProps({getReferenceClientRect:a})},onKeyDown(t){var n;return"Escape"===t.event.key?(null==kn||kn[0].hide(),!0):((null==kn?void 0:kn[0].state.isShown)||null==kn||kn[0].show(),null==(n=e.ref)?void 0:n.onKeyDown(t))},onExit(n){var o;if(null==kn||kn[0].hide(),t){const{view:e}=n.editor;null==(o=e.dom.parentElement)||o.removeEventListener("scroll",t)}e.destroy()}}}})]},addStorage:()=>({rect:{width:0,height:0,left:0,top:0,right:0,bottom:0}})}),Sn=K.create({name:"fontSize",addOptions:()=>({types:["textStyle"]}),addGlobalAttributes(){return[{types:["paragraph"],attributes:{class:{}}},{types:this.options.types,attributes:{fontSize:{parseHTML:e=>e.style.fontSize.replace(/['"]+/g,""),renderHTML:e=>e.fontSize?{style:`font-size: ${e.fontSize}`}:{}}}}]},addCommands:()=>({setFontSize:e=>({chain:t})=>t().setMark("textStyle",{fontSize:e}).run(),unsetFontSize:()=>({chain:e})=>e().setMark("textStyle",{fontSize:null}).removeEmptyTextStyle().run()})}),xn=W.create({name:"figure",addOptions:()=>({HTMLAttributes:{}}),group:"block",content:"block figcaption",draggable:!0,defining:!0,selectable:!0,parseHTML(){return[{tag:`figure[data-type="${this.name}"]`}]},renderHTML({HTMLAttributes:e}){return["figure",Y(e,{"data-type":this.name}),0]},addProseMirrorPlugins(){return[new Q({props:{handleDOMEvents:{dragstart:(e,t)=>{if(t.target){const n=e.posAtDOM(t.target,0);e.state.doc.resolve(n).parent.type.name===this.type.name&&t.preventDefault()}return!1}}}})]}}),wn=z.extend({group:"block"}),In=W.create({name:"figcaption",addOptions:()=>({HTMLAttributes:{}}),content:"inline*",selectable:!1,draggable:!1,marks:"link",parseHTML:()=>[{tag:"figcaption"}],addKeyboardShortcuts(){return{Enter:({editor:e})=>{const{state:{selection:{$from:t,empty:n}}}=e;if(!n||t.parent.type!==this.type)return!1;if(!(t.parentOffset===t.parent.nodeSize-2))return!1;const o=e.state.selection.$from.end();return e.chain().focus(o).insertContentAt(o,{type:"paragraph"}).run()},Backspace:({editor:e})=>{const{state:{selection:{$from:t,empty:n}}}=e;if(!n||t.parent.type!==this.type)return!1;if(!(0===t.parentOffset))return!1;const o=e.state.doc.nodeAt(t.pos-2);return(null==o?void 0:o.type.name)===wn.name}}},renderHTML:({HTMLAttributes:e})=>["figcaption",Y(e),0]}),Mn=W.create({name:"quote",content:"paragraph+",defining:!0,marks:"",parseHTML:()=>[{tag:"blockquote"}],renderHTML:({HTMLAttributes:e})=>["blockquote",e,0],addKeyboardShortcuts:()=>({Backspace:()=>!1})}),Nn=W.create({name:"quoteCaption",group:"block",content:"text*",defining:!0,isolating:!0,parseHTML:()=>[{tag:"figcaption"}],renderHTML:({HTMLAttributes:e})=>["figcaption",e,0],addKeyboardShortcuts(){return{Enter:({editor:e})=>{const{state:{selection:{$from:t,empty:n}}}=e;if(!n||t.parent.type!==this.type)return!1;if(!(t.parentOffset===t.parent.nodeSize-2))return!1;const o=e.state.selection.$from.end();return e.chain().focus(o).insertContentAt(o,{type:"paragraph"}).run()}}}}),An=xn.extend({name:"blockquoteFigure",group:"block",content:"quote quoteCaption",isolating:!0,addExtensions:()=>[Mn,Nn],renderHTML({HTMLAttributes:e}){return["figure",Y(e,{"data-type":this.name}),["div",{},0]]},addKeyboardShortcuts:()=>({Enter:()=>!1}),addAttributes(){var e;return Me({},null==(e=this.parent)?void 0:e.call(this))},addCommands(){return{setBlockquote:()=>({state:e,chain:t})=>{const n=e.selection.$from.start(),o=e.selection.content();return t().focus().insertContent({type:this.name,content:[{type:"quote",content:o.content.toJSON()||[{type:"paragraph",attrs:{textAlign:"left"}}]},{type:"quoteCaption"}]}).focus(n+1).run()}}}}),Un=pe.extend({inclusive:!1,parseHTML:()=>[{tag:'a[href]:not([data-type="button"]):not([href *= "javascript:" i])'}],renderHTML({HTMLAttributes:e}){return["a",Y(this.options.HTMLAttributes,e,{class:"link"}),0]},addProseMirrorPlugins(){var e;const{editor:t}=this;return[...(null==(e=this.parent)?void 0:e.call(this))||[],new Q({props:{handleKeyDown:(e,n)=>{const{selection:o}=t.state;return"Escape"===n.key&&!0!==o.empty&&t.commands.focus(o.to,{scrollIntoView:!1}),!1}}})]}}),Ln={button:"SUI-Button-module-button-lVonu",disabled:"SUI-Button-module-disabled-AFjHE",primary:"SUI-Button-module-primary-N-IFt",ghost:"SUI-Button-module-ghost-LVd4a",active:"SUI-Button-module-active-SUlai",icon:"SUI-Button-module-icon-JvwsO"},Tn=t(((t,n)=>{var o=t,{active:a,buttonSize:r="small",children:i,disabled:l,variant:c="primary",className:s}=o,d=Ae(o,["active","buttonSize","children","disabled","variant","className"]);const u=me(Ln.button,Ln[c],Ln[r],{[Ln.active]:a,[Ln.disabled]:l},s);return e.createElement("div",Me({ref:n,className:u},d),i)}));Tn.displayName="Button";var Hn="SUI-Spinner-module-spinner-T2M3o",Bn=t(((t,n)=>{var o=t,{className:a}=o,r=Ae(o,["className"]);const i=me(Hn,a);return e.createElement("div",Me({className:i,ref:n},r))}));Bn.displayName="Spinner";var Pn="SUI-ImageUploader-module-uploaderWrapper-wDUDh",Rn="SUI-ImageUploader-module-spinner-G5xTl",Dn="SUI-ImageUploader-module-wrapper-bAnYc",zn="SUI-ImageUploader-module-wrapperDragged-Zpnfg",On="SUI-ImageUploader-module-icon-gjZ9a",Vn="SUI-ImageUploader-module-textContainer-RM70g",jn="SUI-ImageUploader-module-text-rxaru",qn="SUI-ImageUploader-module-hiddenInput-lEpqX",_n=({onUpload:t,upload:n})=>{const{loading:o,uploadFile:c}=(({onUpload:e,upload:t})=>{const[n,o]=r(!1);return{loading:n,uploadFile:l((n=>Ue(void 0,null,(function*(){var a,r;o(!0);try{const o=yield t(n);e(o)}catch(e){console.log((null==(r=null==(a=null==e?void 0:e.response)?void 0:a.data)?void 0:r.error)||"Something went wrong")}o(!1)}))),[e,t])}})({onUpload:t,upload:n}),{handleUploadClick:s,ref:d}=(()=>{const e=a(null),t=l((()=>{var t;null==(t=e.current)||t.click()}),[]);return{ref:e,handleUploadClick:t}})(),{draggedInside:u,onDrop:m,onDragEnter:p,onDragLeave:h}=(({uploader:e})=>{const[t,n]=r(!1),[o,a]=r(!1);return i((()=>{const e=()=>{n(!0)},t=()=>{n(!1)};return document.body.addEventListener("dragstart",e),document.body.addEventListener("dragend",t),()=>{document.body.removeEventListener("dragstart",e),document.body.removeEventListener("dragend",t)}}),[]),{isDragging:t,draggedInside:o,onDragEnter:()=>{a(!0)},onDragLeave:()=>{a(!1)},onDrop:l((t=>{if(a(!1),0===t.dataTransfer.files.length)return;const n=t.dataTransfer.files,o=[];for(let e=0;e<n.length;e+=1){const t=n.item(e);t&&o.push(t)}if(o.some((e=>-1===e.type.indexOf("image"))))return;t.preventDefault();const r=o.filter((e=>-1!==e.type.indexOf("image"))),i=r.length>0?r[0]:void 0;i&&e(i)}),[e])}})({uploader:c}),g=l((e=>e.target.files?c(e.target.files[0]):null),[c]);if(o)return e.createElement("div",{className:Pn},e.createElement(Bn,{className:Rn,size:1.5}));const f=me(Dn,u&&zn);return e.createElement("button",{type:"button",className:f,onDrop:m,onDragOver:p,onDragLeave:h,contentEditable:!1},e.createElement(sn,{icon:st,className:On}),e.createElement("div",{className:Vn},e.createElement("div",{className:jn},u?"Drop image here":"Drag and drop or"),e.createElement("div",null,e.createElement(Tn,{disabled:u,onClick:s},e.createElement(sn,{icon:Rt}),"Upload an image"))),e.createElement("input",{className:qn,ref:d,type:"file",accept:".jpg,.jpeg,.png,.webp,.gif",onChange:g}))},Fn="SUI-ImageUpload-module-container-aAlYd",$n=({editor:t,upload:n})=>{const o=l((e=>{e&&t.chain().setImageBlock({src:e}).focus().run()}),[t]);return e.createElement(y,null,e.createElement("div",{className:Fn,"data-drag-handle":!0},e.createElement(_n,{onUpload:o,upload:n})))},Kn=h.create({name:"imageUpload",isolating:!0,defining:!0,group:"block",draggable:!0,selectable:!0,inline:!1,parseHTML(){return[{tag:`div[data-type="${this.name}"]`}]},renderHTML(){return["div",{"data-type":this.name}]},addCommands(){return{setImageUpload:()=>({commands:e})=>e.insertContent(`<div data-type="${this.name}"></div>`)}},addNodeView(){return g((({props:t})=>e.createElement($n,Me({upload:this.options.upload,editor:this.editor},t))))}}),Wn="SUI-ImageBlockView-module-left-Y8ciB",Yn="SUI-ImageBlockView-module-right-dsCsE",Jn="SUI-ImageBlockView-module-center-GDpg2",Gn="SUI-ImageBlockView-module-image-xYi3M",Qn="SUI-ImageBlockView-module-root-yJlsH",Zn=t=>{const{editor:n,getPos:o,node:r}=t,i=a(null),{src:c}=r.attrs,s=me(Qn,"left"===r.attrs.align&&Wn,"right"===r.attrs.align&&Yn,"center"===r.attrs.align&&Jn),d=l((()=>{n.commands.setNodeSelection(o())}),[o,n.commands]);return e.createElement(y,{className:s},e.createElement("div",{style:{width:r.attrs.width}},e.createElement("button",{contentEditable:!1,ref:i,onClick:d},e.createElement("img",{className:Gn,src:c,alt:""}))))},Xn=wn.extend({name:"imageBlock",group:"block",defining:!0,isolating:!0,addAttributes:()=>({src:{default:"",parseHTML:e=>e.getAttribute("src"),renderHTML:e=>({src:e.src})},width:{default:"100%",parseHTML:e=>e.getAttribute("data-width"),renderHTML:e=>({"data-width":e.width})},align:{default:"center",parseHTML:e=>e.getAttribute("data-align"),renderHTML:e=>({"data-align":e.align})},alt:{default:void 0,parseHTML:e=>e.getAttribute("alt"),renderHTML:e=>({alt:e.alt})}}),parseHTML:()=>[{tag:'img[src*="tiptap.dev"]:not([src^="data:"]), img[src*="windows.net"]:not([src^="data:"])'}],renderHTML({HTMLAttributes:e}){return["img",Y(this.options.HTMLAttributes,e)]},addCommands:()=>({setImageBlock:e=>({commands:t})=>t.insertContent({type:"imageBlock",attrs:{src:e.src}}),setImageBlockAt:e=>({commands:t})=>t.insertContentAt(e.pos,{type:"imageBlock",attrs:{src:e.src}}),setImageBlockAlign:e=>({commands:t})=>t.updateAttributes("imageBlock",{align:e}),setImageBlockWidth:e=>({commands:t})=>t.updateAttributes("imageBlock",{width:`${Math.max(0,Math.min(100,e))}%`})}),addNodeView:()=>g(Zn)}),eo="sidebar-left",to="sidebar-right",no="two-column",oo=W.create({name:"columns",group:"columns",content:"column column",defining:!0,isolating:!0,addAttributes:()=>({layout:{default:no}}),addCommands:()=>({setColumns:()=>({commands:e})=>e.insertContent('<div data-type="columns"><div data-type="column" data-position="left"><p></p></div><div data-type="column" data-position="right"><p></p></div></div>'),setLayout:e=>({commands:t})=>t.updateAttributes("columns",{layout:e})}),renderHTML:({HTMLAttributes:e})=>["div",{"data-type":"columns",class:`layout-${e.layout}`},0],parseHTML:()=>[{tag:'div[data-type="columns"]'}]}),ao=W.create({name:"column",content:"block+",isolating:!0,addAttributes:()=>({position:{default:"",parseHTML:e=>e.getAttribute("data-position"),renderHTML:e=>({"data-position":e.position})}}),renderHTML:({HTMLAttributes:e})=>["div",Y(e,{"data-type":"column"}),0],parseHTML:()=>[{tag:'div[data-type="column"]'}]}),ro="SUI-Panel-module-panel-YtFA7",io="SUI-Panel-module-panelSmall-PdWqF",lo="SUI-Panel-module-divider-DRLI9",co="SUI-Panel-module-header-TYHxD",so="SUI-Panel-module-section-6hcQQ",uo="SUI-Panel-module-headline-nAp62",mo="SUI-Panel-module-footer-5BzzM",po=t(((t,n)=>{var o=t,{asChild:a,className:r,children:i,spacing:l,noShadow:c}=o,s=Ae(o,["asChild","className","children","spacing","noShadow"]);const d=me(ro,"small"===l&&io,r),u=a?he:"div";return e.createElement(u,Me({ref:n},s),e.createElement(pn,{className:d,withShadow:!c},i))}));po.displayName="Panel",t(((t,n)=>{var o=t,{asChild:a,className:r,children:i}=o,l=Ae(o,["asChild","className","children"]);const c=me(lo,r),s=a?he:"div";return e.createElement(s,Ne(Me({className:c},l),{ref:n}),i)})).displayName="PanelDivider",t(((t,n)=>{var o=t,{asChild:a,className:r,children:i}=o,l=Ae(o,["asChild","className","children"]);const c=me(co,r),s=a?he:"div";return e.createElement(s,Ne(Me({className:c},l),{ref:n}),i)})).displayName="PanelHeader",t(((t,n)=>{var o=t,{asChild:a,className:r,children:i}=o,l=Ae(o,["asChild","className","children"]);const c=me(so,r),s=a?he:"div";return e.createElement(s,Ne(Me({className:c},l),{ref:n}),i)})).displayName="PanelSection",t(((t,n)=>{var o=t,{asChild:a,className:r,children:i}=o,l=Ae(o,["asChild","className","children"]);const c=me(uo,r),s=a?he:"div";return e.createElement(s,Ne(Me({className:c},l),{ref:n}),i)})).displayName="PanelHeadline",t(((t,n)=>{var o=t,{asChild:a,className:r,children:i}=o,l=Ae(o,["asChild","className","children"]);const c=me(mo,r),s=a?he:"div";return e.createElement(s,Ne(Me({className:c},l),{ref:n}),i)})).displayName="PanelFooter";var ho="SUI-EmojiList-module-panel-NN6Px",go="SUI-EmojiList-module-button-lC5wi",fo="SUI-EmojiList-module-img-rC18Z",yo="SUI-EmojiList-module-truncate-EIBcR",vo=t(((t,n)=>{const[o,a]=r(0);i((()=>a(0)),[t.items]);const s=l((e=>{const n=t.items[e];n&&t.command({name:n.name})}),[t]);c(n,(()=>{const e=e=>{const n=t.items[e];if(n){const e=document.querySelector(`[data-emoji-name="${n.name}"]`);e&&e.scrollIntoView({block:"nearest"})}};return{onKeyDown:({event:n})=>"ArrowUp"===n.key?((()=>{const n=(o+t.items.length-1)%t.items.length;a(n),e(n)})(),!0):"ArrowDown"===n.key?((()=>{const n=(o+1)%t.items.length;a(n),e(n)})(),!0):"Enter"===n.key&&(s(o),!0)}}),[t,o,s]);const d=l((e=>()=>s(e)),[s]);return t.items&&t.items.length?e.createElement(po,{className:ho},t.items.map(((t,n)=>e.createElement(Tn,{active:n===o,variant:"ghost",className:go,key:t.name,onClick:d(n),"data-emoji-name":t.name},t.fallbackImage?e.createElement("img",{src:t.fallbackImage,className:fo,alt:"emoji"}):t.emoji," ",e.createElement("span",{className:yo},":",t.name,":"))))):null}));vo.displayName="EmojiList";var ko=vo,bo={items:({editor:e,query:t})=>e.storage.emoji.emojis.filter((({shortcodes:e,tags:n})=>e.find((e=>e.startsWith(t.toLowerCase())))||n.find((e=>e.startsWith(t.toLowerCase()))))).slice(0,250),allowSpaces:!1,render:()=>{let e,t;return{onStart:n=>{e=new p(ko,{props:n,editor:n.editor}),t=de("body",{getReferenceClientRect:n.clientRect,appendTo:()=>document.body,content:e.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start"})},onUpdate(n){e.updateProps(n),t[0].setProps({getReferenceClientRect:n.clientRect})},onKeyDown(n){var o;return"Escape"===n.event.key?(t[0].hide(),e.destroy(),!0):null==(o=e.ref)?void 0:o.onKeyDown(n)},onExit(){t[0].destroy(),e.destroy()}}}},Eo="SUI-TableOfContents-module-root-U1Pbf",Co="SUI-TableOfContents-module-container-Y3n-s",So="SUI-TableOfContents-module-contents-auRDq",xo="SUI-TableOfContents-module-link-lPmnt",wo="SUI-TableOfContents-module-linkActive--5RSi",Io="SUI-TableOfContents-module-empty--nYtj",Mo=o((({editor:t,onItemClick:n})=>{const[o,a]=r(null);return i((()=>{const e=({editor:e})=>{a(Me({},e.extensionStorage.tableOfContents))};return e({editor:t}),t.on("update",e),t.on("selectionUpdate",e),()=>{t.off("update",e),t.off("selectionUpdate",e)}}),[t]),e.createElement("div",{className:Eo},e.createElement("div",{className:Co},"Table of contents"),o&&o.content.length>0?e.createElement("div",{className:So},o.content.map((t=>e.createElement("a",{key:t.id,href:`#${t.id}`,style:{marginLeft:1*t.level-1+"rem"},onClick:n,className:me(xo,t.isActive&&wo)},t.itemIndex,". ",t.textContent)))):e.createElement("div",{className:Io},"Start adding headlines to your document …"))}));Mo.displayName="TableOfContents";var No="SUI-TableOfContentsNode-module-nodeWrapper-xbh8w",Ao=t=>{const{editor:n}=t;return e.createElement(y,null,e.createElement("div",{className:No,contentEditable:!1},e.createElement(Mo,{editor:n})))},Uo=W.create({name:"tableOfContentsNode",group:"block",atom:!0,selectable:!0,draggable:!0,inline:!1,parseHTML:()=>[{tag:'div[data-type="table-of-content"]'}],renderHTML:({HTMLAttributes:e})=>["div",Ne(Me({},e),{"data-type":"table-of-content"})],addNodeView:()=>g(Ao),addCommands(){return{insertTableOfContents:()=>({commands:e})=>e.insertContent({type:this.name})}}}),Lo=e=>{var t,n,o,a;const r=l((({view:t,from:n})=>{if(!t)return!1;const o=t.domAtPos(n||0).node,a=t.nodeDOM(n||0);return!((e,t)=>[Zt.name,Kn.name,B.name,Xn.name,Un.name,In.name,Uo.name].some((t=>e.isActive(t)))||(e=>{let t=e;for(;t&&!["TD","TH"].includes(t.tagName);)t=t.parentElement;const n=t&&t.querySelector&&t.querySelector("a.grip-column.selected"),o=t&&t.querySelector&&t.querySelector("a.grip-row.selected");return!(!n&&!o)})(t))(e,a||o)&&(({editor:e})=>{const{state:{doc:t,selection:n,selection:{empty:o,from:a,to:r}}}=e,i=!t.textBetween(a,r).length&&G(n);return!(o||i||!e.isEditable)})({editor:e})}),[e]);return{isBold:e.isActive("bold"),isItalic:e.isActive("italic"),isStrike:e.isActive("strike"),isUnderline:e.isActive("underline"),isCode:e.isActive("code"),isSubscript:e.isActive("subscript"),isSuperscript:e.isActive("superscript"),isAlignLeft:e.isActive({textAlign:"left"}),isAlignCenter:e.isActive({textAlign:"center"}),isAlignRight:e.isActive({textAlign:"right"}),isAlignJustify:e.isActive({textAlign:"justify"}),currentColor:(null==(t=e.getAttributes("textStyle"))?void 0:t.color)||void 0,currentHighlight:(null==(n=e.getAttributes("highlight"))?void 0:n.color)||void 0,currentFont:(null==(o=e.getAttributes("textStyle"))?void 0:o.fontFamily)||void 0,currentSize:(null==(a=e.getAttributes("textStyle"))?void 0:a.fontSize)||void 0,shouldShow:r}},To="SUI-Tooltip-module-shortcutKey-9YABp",Ho="SUI-Tooltip-module-tooltip-xxavp",Bo="SUI-Tooltip-module-tooltipTitle-WDW14",Po="SUI-Tooltip-module-shortcutContainer-m9Zdi",Ro="undefined"!=typeof window&&navigator.platform.toUpperCase().indexOf("MAC")>=0,Do=({children:t})=>{const n=To;return"Mod"===t?e.createElement("kbd",{className:n},Ro?"⌘":"Ctrl"):"Shift"===t?e.createElement("kbd",{className:n},"⇧"):"Alt"===t?e.createElement("kbd",{className:n},Ro?"⌥":"Alt"):e.createElement("kbd",{className:n},t)},zo=({children:t,enabled:n=!0,title:o,shortcut:a,tippyOptions:r={}})=>{const i=l((t=>e.createElement("span",{className:Ho,tabIndex:-1,"data-placement":t["data-placement"],"data-reference-hidden":t["data-reference-hidden"],"data-escaped":t["data-escaped"]},o&&e.createElement("span",{className:Bo},o),a&&e.createElement("span",{className:Po},a.map((t=>e.createElement(Do,{key:t},t)))))),[a,o]);return n?e.createElement(ge,Ne(Me({delay:500,offset:[0,8],touch:!1,zIndex:99999,appendTo:document.body},r),{render:i}),e.createElement("span",null,t)):e.createElement(e.Fragment,null,t)},Oo="SUI-Toolbar-module-toolbar-KVGNY",Vo="SUI-Toolbar-module-vertical-heRFl",jo="SUI-Toolbar-module-horizontal-21esf",qo="SUI-Toolbar-module-divider-Q1VtN",_o="SUI-Toolbar-module-horizontalDivider-z6VXR",Fo="SUI-Toolbar-module-verticalDivider-8TYkV",$o="SUI-Toolbar-module-button-nx8vO",Ko=t(((t,n)=>{var o=t,{shouldShowContent:a=!0,children:r,isVertical:i=!1,className:l}=o,c=Ae(o,["shouldShowContent","children","isVertical","className"]);const s=me(Oo,i?Vo:jo,l);return a&&e.createElement(pn,Ne(Me({classN