reactjs-tiptap-editor 0.1.0 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,152 +0,0 @@
1
- "use strict";var Gn=Object.create;var ct=Object.defineProperty;var Kn=Object.getOwnPropertyDescriptor;var Zn=Object.getOwnPropertyNames;var Xn=Object.getPrototypeOf,Jn=Object.prototype.hasOwnProperty;var Yn=(e,t,i)=>t in e?ct(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i;var Qn=(e,t,i,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of Zn(t))!Jn.call(e,a)&&a!==i&&ct(e,a,{get:()=>t[a],enumerable:!(r=Kn(t,a))||r.enumerable});return e};var Ft=(e,t,i)=>(i=e!=null?Gn(Xn(e)):{},Qn(t||!e||!e.__esModule?ct(i,"default",{value:e,enumerable:!0}):i,e));var re=(e,t,i)=>Yn(e,typeof t!="symbol"?t+"":t,i);const n=require("react/jsx-runtime"),l=require("react");require("@radix-ui/react-toast");const _=require("lucide-react"),f=require("./tiptap-CRe0XXRC.cjs"),v=require("./vendor-BzT-edVs.cjs"),$e=require("shiki"),b=require("./locales-DgiqaWhF.cjs"),ei=require("@radix-ui/react-select"),Tt=require("@radix-ui/react-slot"),nt=require("tippy.js"),Te=require("react-dom"),ti=require("react-image-crop"),Ie=require("valtio"),ni=require("@radix-ui/react-checkbox"),At=require("scroll-into-view-if-needed"),ii=require("@radix-ui/react-tabs"),se=require("prosemirror-docx"),ri=require("docx"),tt=require("mermaid"),ai=require("@radix-ui/react-dialog"),Lt=require("katex"),oi=require("@radix-ui/react-popover"),si=require("@radix-ui/react-label"),hn=require("re-resizable"),ci=require("@radix-ui/react-separator"),li=require("react-colorful"),Ze=require("@radix-ui/react-icons"),di=require("@radix-ui/react-switch"),hi=require("@radix-ui/react-dropdown-menu"),ui=require("@radix-ui/react-tooltip"),mi=require("@radix-ui/react-toggle");function Y(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const i in e)if(i!=="default"){const r=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(t,i,r.get?r:{enumerable:!0,get:()=>e[i]})}}return t.default=e,Object.freeze(t)}const B=Y(l),q=Y(ei),bt=Y(ni),we=Y(ii),J=Y(ai),Fe=Y(oi),un=Y(si),mn=Y(ci),pt=Y(di),W=Y(hi),Ve=Y(ui),xn=Y(mi);let lt;function dt(){return lt===void 0&&(lt=navigator.platform.includes("Mac")),lt}function it(e){return`${e}`.toLowerCase()==="mod"?dt()?"⌘":"Ctrl":`${e}`.toLowerCase()==="alt"?dt()?"⌥":"Alt":`${e}`.toLowerCase()==="shift"?dt()?"⇧":"Shift":e}function rt(e){return e.map(it).join(" ")}function P(...e){return v.twMerge(v.clsx(e))}const j=l.forwardRef((e,t)=>{const{icon:i=void 0,tooltip:r=void 0,disabled:a=!1,customClass:o="",shortcutKeys:s=void 0,tooltipOptions:c={},action:u=void 0,isActive:d=void 0,children:h,asChild:m=!1,upload:x=!1,...g}=e,p=Ke[i],w=m?Tt.Slot:Ge;return n.jsxs(Re,{children:[n.jsx(He,{asChild:!0,children:n.jsxs(w,{ref:t,size:"sm",className:P("richtext-w-[32px] richtext-h-[32px]",o),disabled:a,onClick:u,"data-state":d!=null&&d()?"on":"off",...g,children:[p&&n.jsx(p,{className:"richtext-w-4 richtext-h-4"}),h]})}),r&&n.jsx(ye,{...c,children:n.jsxs("div",{className:"richtext-flex richtext-flex-col richtext-items-center richtext-text-center richtext-max-w-24",children:[n.jsx("div",{children:r}),!!(s!=null&&s.length)&&n.jsx("span",{children:rt(s)})]})})]})}),Mt=l.forwardRef(({asChild:e,...t},i)=>{var o;const r=Ke[t.icon],a=e?Tt.Slot:F;return n.jsxs(Re,{children:[n.jsx(He,{asChild:!0,children:n.jsx(a,{ref:i,className:"richtext-h-[32px] richtext-px-[5px] richtext-py-0 richtext-min-w-24 richtext-overflow-hidden",variant:"ghost",disabled:t==null?void 0:t.disabled,...t,children:n.jsxs("div",{className:"richtext-flex richtext-items-center richtext-h-full richtext-font-normal",children:[(t==null?void 0:t.title)&&n.jsx("div",{className:"richtext-flex-grow richtext-text-sm richtext-text-left richtext-truncate",children:t==null?void 0:t.title}),r&&n.jsx(r,{className:"richtext-flex-shrink-0 richtext-w-3 richtext-h-3 richtext-ml-1 richtext-text-zinc-500"})]})})}),n.jsx(ye,{children:n.jsxs("div",{className:"richtext-flex richtext-flex-col richtext-items-center richtext-text-center richtext-max-w-24",children:[(t==null?void 0:t.tooltip)&&n.jsx("div",{children:t==null?void 0:t.tooltip}),n.jsx("div",{className:"richtext-flex",children:!!((o=t==null?void 0:t.shortcutKeys)!=null&&o.length)&&n.jsx("span",{children:rt(t==null?void 0:t.shortcutKeys)})})]})})]})});function Ue(e,t){const{state:i}=t,r=i.selection.$anchor;let a=!1;if(r.depth)for(let o=r.depth;o>0;o--)r.node(o).type.name===e&&(t.dispatchTransaction&&t.dispatchTransaction(i.tr.delete(r.before(o),r.after(o)).scrollIntoView()),a=!0);else{const o=i.selection.node;o&&o.type.name===e&&(t.chain().deleteSelection().run(),a=!0)}if(!a){const o=r.pos;if(o){const s=i.tr.doc.nodeAt(o);s&&s.type.name===e&&(t.dispatchTransaction&&t.dispatchTransaction(i.tr.delete(o,o+s.nodeSize)),a=!0)}}return a}function xi(e){return e}function We(e,t,i,r){const a=xi,[o,s]=l.useState(a(i)),c=l.useRef(o);return l.useEffect(()=>{const u=()=>{const d={...i,...e.getAttributes(t)};Object.keys(d).forEach(m=>{(d[m]===null||d[m]===void 0)&&(d[m]=i?i[m]:null)});const h=a(d);v.deepEqual(c.current,h)||(s(h),c.current=h)};return e.on("selectionUpdate",u),e.on("transaction",u),()=>{e.off("selectionUpdate",u),e.off("transaction",u)}},[e,i,t,a]),o}const qe=B.forwardRef(({className:e,...t},i)=>n.jsx("textarea",{className:P("richtext-flex richtext-min-h-[80px] richtext-w-full richtext-rounded-md !richtext-border richtext-border-input richtext-bg-background richtext-px-3 richtext-py-2 richtext-text-sm richtext-ring-offset-background placeholder:richtext-text-muted-foreground focus-visible:richtext-outline-none focus-visible:richtext-ring-2 focus-visible:richtext-ring-ring focus-visible:richtext-ring-offset-2 disabled:richtext-cursor-not-allowed disabled:richtext-opacity-50",e),ref:i,...t}));qe.displayName="Textarea";const fi=v.cva("richtext-inline-flex richtext-items-center richtext-justify-center richtext-whitespace-nowrap richtext-rounded-md richtext-text-sm richtext-font-medium richtext-ring-offset-background richtext-transition-colors focus-visible:richtext-outline-none focus-visible:richtext-ring-2 focus-visible:richtext-ring-ring focus-visible:richtext-ring-offset-2 disabled:richtext-pointer-events-none disabled:richtext-opacity-50",{variants:{variant:{default:"!richtext-bg-primary !richtext-text-primary-foreground hover:!richtext-bg-primary/90",destructive:"richtext-bg-destructive richtext-text-destructive-foreground hover:richtext-bg-destructive/90",outline:"richtext-border richtext-border-input richtext-bg-background hover:richtext-bg-accent hover:richtext-text-accent-foreground",secondary:"richtext-bg-secondary richtext-text-secondary-foreground hover:richtext-bg-secondary/80",ghost:"hover:richtext-bg-accent hover:richtext-text-accent-foreground",link:"richtext-text-primary richtext-underline-offset-4 hover:richtext-underline"},size:{default:"richtext-h-10 richtext-px-4 richtext-py-2",sm:"richtext-h-9 richtext-rounded-md richtext-px-3",lg:"richtext-h-11 richtext-rounded-md richtext-px-8",icon:"richtext-h-10 richtext-w-10"}},defaultVariants:{variant:"default",size:"default"}}),F=B.forwardRef(({className:e,variant:t,size:i,asChild:r=!1,...a},o)=>{const s=r?Tt.Slot:"button";return n.jsx(s,{className:P(fi({variant:t,size:i,className:e})),ref:o,...a})});F.displayName="Button";const le=W.Root,de=W.Trigger,Vt=W.Portal,Ut=W.Sub,_t=B.forwardRef(({className:e,inset:t,children:i,...r},a)=>n.jsxs(W.SubTrigger,{ref:a,className:P("richtext-flex richtext-cursor-default richtext-select-none richtext-items-center richtext-rounded-sm richtext-px-2 richtext-py-1.5 richtext-text-sm richtext-outline-none focus:richtext-bg-accent data-[state=open]:richtext-bg-accent",t&&"richtext-pl-8",e),...r,children:[i,n.jsx(_.ChevronRight,{className:"richtext-ml-auto richtext-h-4 richtext-w-4"})]}));_t.displayName=W.SubTrigger.displayName;const wt=B.forwardRef(({className:e,...t},i)=>n.jsx(W.SubContent,{ref:i,className:P("richtext-z-50 richtext-min-w-[8rem] richtext-overflow-hidden richtext-rounded-md !richtext-border richtext-bg-popover richtext-p-1 richtext-text-popover-foreground richtext-shadow-lg data-[state=open]:richtext-animate-in data-[state=closed]:richtext-animate-out data-[state=closed]:richtext-fade-out-0 data-[state=open]:richtext-fade-in-0 data-[state=closed]:richtext-zoom-out-95 data-[state=open]:richtext-zoom-in-95 data-[side=bottom]:richtext-slide-in-from-top-2 data-[side=left]:richtext-slide-in-from-right-2 data-[side=right]:richtext-slide-in-from-left-2 data-[side=top]:richtext-slide-in-from-bottom-2",e),...t}));wt.displayName=W.SubContent.displayName;const ce=B.forwardRef(({className:e,sideOffset:t=4,...i},r)=>n.jsx(W.Portal,{children:n.jsx(W.Content,{ref:r,sideOffset:t,className:P("richtext-z-50 richtext-min-w-[8rem] richtext-overflow-hidden richtext-rounded-md !richtext-border richtext-bg-popover richtext-p-1 richtext-text-popover-foreground richtext-shadow-md data-[state=open]:richtext-animate-in data-[state=closed]:richtext-animate-out data-[state=closed]:richtext-fade-out-0 data-[state=open]:richtext-fade-in-0 data-[state=closed]:richtext-zoom-out-95 data-[state=open]:richtext-zoom-in-95 data-[side=bottom]:richtext-slide-in-from-top-2 data-[side=left]:richtext-slide-in-from-right-2 data-[side=right]:richtext-slide-in-from-left-2 data-[side=top]:richtext-slide-in-from-bottom-2",e),...i})}));ce.displayName=W.Content.displayName;const ee=B.forwardRef(({className:e,inset:t,...i},r)=>n.jsx(W.Item,{ref:r,className:P("richtext-relative richtext-flex richtext-cursor-default richtext-select-none richtext-items-center richtext-rounded-sm richtext-px-2 richtext-py-1.5 richtext-text-sm richtext-outline-none richtext-transition-colors focus:richtext-bg-accent focus:richtext-text-accent-foreground data-[disabled]:richtext-pointer-events-none data-[disabled]:richtext-opacity-50",t&&"richtext-pl-8",e),...i}));ee.displayName=W.Item.displayName;const ve=B.forwardRef(({className:e,children:t,checked:i,...r},a)=>n.jsxs(W.CheckboxItem,{ref:a,className:P("richtext-relative richtext-flex richtext-cursor-default richtext-select-none richtext-items-center richtext-rounded-sm richtext-py-1.5 richtext-pl-8 richtext-pr-2 richtext-text-sm richtext-outline-none richtext-transition-colors focus:richtext-bg-accent focus:richtext-text-accent-foreground data-[disabled]:richtext-pointer-events-none data-[disabled]:richtext-opacity-50",e),checked:i,...r,children:[n.jsx("span",{className:"richtext-absolute richtext-left-2 richtext-flex richtext-h-3.5 richtext-w-3.5 richtext-items-center richtext-justify-center",children:n.jsx(W.ItemIndicator,{children:n.jsx(_.Check,{className:"richtext-h-4 richtext-w-4"})})}),t]}));ve.displayName=W.CheckboxItem.displayName;const gi=B.forwardRef(({className:e,children:t,...i},r)=>n.jsxs(W.RadioItem,{ref:r,className:P("richtext-relative richtext-flex richtext-cursor-default richtext-select-none richtext-items-center richtext-rounded-sm richtext-py-1.5 richtext-pl-8 richtext-pr-2 richtext-text-sm richtext-outline-none richtext-transition-colors focus:richtext-bg-accent focus:richtext-text-accent-foreground data-[disabled]:richtext-pointer-events-none data-[disabled]:richtext-opacity-50",e),...i,children:[n.jsx("span",{className:"richtext-absolute richtext-left-2 richtext-flex richtext-h-3.5 richtext-w-3.5 richtext-items-center richtext-justify-center",children:n.jsx(W.ItemIndicator,{children:n.jsx(_.Circle,{className:"richtext-h-2 richtext-w-2 richtext-fill-current"})})}),t]}));gi.displayName=W.RadioItem.displayName;const bi=B.forwardRef(({className:e,inset:t,...i},r)=>n.jsx(W.Label,{ref:r,className:P("richtext-px-2 richtext-py-1.5 richtext-text-sm richtext-font-semibold",t&&"richtext-pl-8",e),...i}));bi.displayName=W.Label.displayName;const at=B.forwardRef(({className:e,...t},i)=>n.jsx(W.Separator,{ref:i,className:P("richtext--mx-1 richtext-my-1 richtext-h-px richtext-bg-muted",e),...t}));at.displayName=W.Separator.displayName;function fn({className:e,...t}){return n.jsx("span",{className:P("richtext-ml-auto richtext-text-xs richtext-tracking-widest richtext-opacity-60",e),...t})}fn.displayName="DropdownMenuShortcut";const Z=B.forwardRef(({className:e,type:t,...i},r)=>n.jsx("input",{type:t,className:P("richtext-flex richtext-h-10 richtext-w-full richtext-rounded-md !richtext-border richtext-border-input richtext-bg-background richtext-px-3 richtext-py-2 richtext-text-sm richtext-ring-offset-background file:richtext-border-0 file:richtext-bg-transparent file:richtext-text-sm file:richtext-font-medium placeholder:richtext-text-muted-foreground focus-visible:richtext-outline-none disabled:richtext-cursor-not-allowed disabled:richtext-opacity-50",e),ref:r,...i}));Z.displayName="Input";const pi=v.cva("richtext-text-sm richtext-font-medium richtext-leading-none peer-disabled:richtext-cursor-not-allowed peer-disabled:richtext-opacity-70"),X=B.forwardRef(({className:e,...t},i)=>n.jsx(un.Root,{ref:i,className:P(pi(),e),...t}));X.displayName=un.Root.displayName;const ne=Fe.Root,ie=Fe.Trigger,Q=B.forwardRef(({className:e,align:t="center",sideOffset:i=4,...r},a)=>n.jsx(Fe.Portal,{children:n.jsx(Fe.Content,{ref:a,align:t,sideOffset:i,className:P("richtext-z-50 richtext-w-72 richtext-rounded-md !richtext-border richtext-bg-popover richtext-p-4 richtext-text-popover-foreground richtext-shadow-md richtext-outline-none data-[state=open]:richtext-animate-in data-[state=closed]:richtext-animate-out data-[state=closed]:richtext-fade-out-0 data-[state=open]:richtext-fade-in-0 data-[state=closed]:richtext-zoom-out-95 data-[state=open]:richtext-zoom-in-95 data-[side=bottom]:richtext-slide-in-from-top-2 data-[side=left]:richtext-slide-in-from-right-2 data-[side=right]:richtext-slide-in-from-left-2 data-[side=top]:richtext-slide-in-from-bottom-2",e),...r})}));Q.displayName=Fe.Content.displayName;const te=B.forwardRef(({className:e,orientation:t="horizontal",decorative:i=!0,...r},a)=>n.jsx(mn.Root,{ref:a,decorative:i,orientation:t,className:P("richtext-shrink-0 richtext-bg-border",t==="horizontal"?"richtext-h-[1px] richtext-w-full":"richtext-h-full richtext-w-[1px]",e),...r}));te.displayName=mn.Root.displayName;const Et=B.forwardRef(({className:e,...t},i)=>n.jsx(pt.Root,{className:P("richtext-peer richtext-inline-flex richtext-h-6 richtext-w-11 richtext-shrink-0 richtext-cursor-pointer richtext-items-center richtext-rounded-full richtext-border-2 richtext-border-transparent richtext-transition-colors focus-visible:richtext-outline-none focus-visible:richtext-ring-2 focus-visible:richtext-ring-ring focus-visible:richtext-ring-offset-2 focus-visible:richtext-ring-offset-background disabled:richtext-cursor-not-allowed disabled:richtext-opacity-50 data-[state=checked]:richtext-bg-primary data-[state=unchecked]:richtext-bg-input",e),...t,ref:i,children:n.jsx(pt.Thumb,{className:P("richtext-pointer-events-none richtext-block richtext-h-5 richtext-w-5 richtext-rounded-full richtext-bg-background richtext-shadow-lg richtext-ring-0 richtext-transition-transform data-[state=checked]:richtext-translate-x-5 data-[state=unchecked]:richtext-translate-x-0")})}));Et.displayName=pt.Root.displayName;const It=we.Root,ot=B.forwardRef(({className:e,...t},i)=>n.jsx(we.List,{ref:i,className:P("richtext-inline-flex richtext-h-10 richtext-items-center richtext-justify-center richtext-rounded-md richtext-bg-muted richtext-p-1 richtext-text-muted-foreground",e),...t}));ot.displayName=we.List.displayName;const Ae=B.forwardRef(({className:e,...t},i)=>n.jsx(we.Trigger,{ref:i,className:P("richtext-inline-flex richtext-items-center richtext-justify-center richtext-whitespace-nowrap richtext-rounded-sm richtext-px-3 richtext-py-1.5 richtext-text-sm richtext-font-medium richtext-ring-offset-background richtext-transition-all focus-visible:richtext-outline-none focus-visible:richtext-ring-2 focus-visible:richtext-ring-ring focus-visible:richtext-ring-offset-2 disabled:richtext-pointer-events-none disabled:richtext-opacity-50 data-[state=active]:richtext-bg-background data-[state=active]:richtext-text-foreground data-[state=active]:richtext-shadow-sm",e),...t}));Ae.displayName=we.Trigger.displayName;const Le=B.forwardRef(({className:e,...t},i)=>n.jsx(we.Content,{ref:i,className:P("richtext-mt-2 richtext-ring-offset-background focus-visible:richtext-outline-none focus-visible:richtext-ring-2 focus-visible:richtext-ring-ring focus-visible:richtext-ring-offset-2",e),...t}));Le.displayName=we.Content.displayName;const _i=v.cva("richtext-inline-flex richtext-items-center richtext-justify-center richtext-rounded-md richtext-text-sm richtext-font-medium richtext-ring-offset-background richtext-transition-colors hover:richtext-bg-muted hover:richtext-text-muted-foreground focus-visible:richtext-outline-none focus-visible:richtext-ring-2 focus-visible:richtext-ring-ring focus-visible:richtext-ring-offset-2 disabled:richtext-pointer-events-none disabled:richtext-opacity-50 data-[state=on]:richtext-bg-accent data-[state=on]:richtext-text-accent-foreground",{variants:{variant:{default:"richtext-bg-transparent",outline:"richtext-border richtext-border-input richtext-bg-transparent hover:richtext-bg-accent hover:richtext-text-accent-foreground"},size:{default:"richtext-h-10 richtext-px-3",sm:"richtext-h-9 richtext-px-2",lg:"richtext-h-11 richtext-px-5"}},defaultVariants:{variant:"default",size:"default"}}),Ge=B.forwardRef(({className:e,variant:t,size:i,...r},a)=>n.jsx(xn.Root,{ref:a,className:P(_i({variant:t,size:i,className:e})),...r}));Ge.displayName=xn.Root.displayName;const wi=Ve.Provider,Re=Ve.Root,He=Ve.Trigger,ye=B.forwardRef(({className:e,sideOffset:t=4,...i},r)=>n.jsx(Ve.Content,{ref:r,sideOffset:t,className:P("richtext-z-50 richtext-overflow-hidden richtext-rounded-md !richtext-border richtext-bg-popover richtext-px-3 richtext-py-1.5 richtext-text-sm richtext-text-popover-foreground richtext-shadow-md richtext-animate-in richtext-fade-in-0 richtext-zoom-in-95 data-[state=closed]:richtext-animate-out data-[state=closed]:richtext-fade-out-0 data-[state=closed]:richtext-zoom-out-95 data-[side=bottom]:richtext-slide-in-from-top-2 data-[side=left]:richtext-slide-in-from-right-2 data-[side=right]:richtext-slide-in-from-left-2 data-[side=top]:richtext-slide-in-from-bottom-2",e),...i}));ye.displayName=Ve.Content.displayName;const vi=q.Root,yi=q.Value,gn=B.forwardRef(({className:e,children:t,...i},r)=>n.jsxs(q.Trigger,{ref:r,className:P("richtext-flex richtext-h-10 richtext-w-full richtext-items-center richtext-justify-between richtext-rounded-md richtext-border richtext-border-input richtext-bg-background richtext-px-3 richtext-py-2 richtext-text-sm richtext-ring-offset-background placeholder:richtext-text-muted-foreground focus:richtext-outline-none focus:richtext-ring-2 focus:richtext-ring-ring focus:richtext-ring-offset-2 disabled:richtext-cursor-not-allowed disabled:richtext-opacity-50 [&>span]:richtext-line-clamp-1",e),...i,children:[t,n.jsx(q.Icon,{asChild:!0,children:n.jsx(_.ChevronDown,{className:"richtext-h-4 richtext-w-4 richtext-opacity-50"})})]}));gn.displayName=q.Trigger.displayName;const bn=B.forwardRef(({className:e,...t},i)=>n.jsx(q.ScrollUpButton,{ref:i,className:P("richtext-flex richtext-cursor-default richtext-items-center richtext-justify-center richtext-py-1",e),...t,children:n.jsx(_.ChevronUp,{className:"richtext-h-4 richtext-w-4"})}));bn.displayName=q.ScrollUpButton.displayName;const pn=B.forwardRef(({className:e,...t},i)=>n.jsx(q.ScrollDownButton,{ref:i,className:P("richtext-flex richtext-cursor-default richtext-items-center richtext-justify-center richtext-py-1",e),...t,children:n.jsx(_.ChevronDown,{className:"richtext-h-4 richtext-w-4"})}));pn.displayName=q.ScrollDownButton.displayName;const _n=B.forwardRef(({className:e,children:t,position:i="popper",...r},a)=>n.jsx(q.Portal,{children:n.jsxs(q.Content,{ref:a,className:P("richtext-relative richtext-z-50 richtext-max-h-60 richtext-overflow-y-auto richtext-min-w-[8rem] richtext-overflow-hidden richtext-rounded-md richtext-border richtext-bg-popover richtext-text-popover-foreground richtext-shadow-md data-[state=open]:richtext-animate-in data-[state=closed]:richtext-animate-out data-[state=closed]:richtext-fade-out-0 data-[state=open]:richtext-fade-in-0 data-[state=closed]:richtext-zoom-out-95 data-[state=open]:richtext-zoom-in-95 data-[side=bottom]:richtext-slide-in-from-top-2 data-[side=left]:richtext-slide-in-from-right-2 data-[side=right]:richtext-slide-in-from-left-2 data-[side=top]:richtext-slide-in-from-bottom-2",i==="popper"&&"data-[side=bottom]:richtext-translate-y-1 data-[side=left]:richtext--translate-x-1 data-[side=right]:richtext-translate-x-1 data-[side=top]:richtext--translate-y-1",e),position:i,...r,children:[n.jsx(bn,{}),n.jsx(q.Viewport,{className:P("richtext-p-1",i==="popper"&&"richtext-h-[var(--radix-select-trigger-height)] richtext-w-full richtext-min-w-[var(--radix-select-trigger-width)]"),children:t}),n.jsx(pn,{})]})}));_n.displayName=q.Content.displayName;const ji=B.forwardRef(({className:e,...t},i)=>n.jsx(q.Label,{ref:i,className:P("richtext-py-1.5 richtext-pl-8 richtext-pr-2 richtext-text-sm richtext-font-semibold",e),...t}));ji.displayName=q.Label.displayName;const vt=B.forwardRef(({className:e,children:t,...i},r)=>n.jsxs(q.Item,{ref:r,className:P("richtext-relative richtext-flex richtext-w-full richtext-cursor-default richtext-select-none richtext-items-center richtext-rounded-sm richtext-py-1.5 richtext-pl-8 richtext-pr-2 richtext-text-sm richtext-outline-none focus:richtext-bg-accent focus:richtext-text-accent-foreground data-[disabled]:richtext-pointer-events-none data-[disabled]:richtext-opacity-50",e),...i,children:[n.jsx("span",{className:"richtext-absolute richtext-left-2 richtext-flex richtext-h-3.5 richtext-w-3.5 richtext-items-center richtext-justify-center",children:n.jsx(q.ItemIndicator,{children:n.jsx(_.Check,{className:"richtext-h-4 richtext-w-4"})})}),n.jsx(q.ItemText,{children:t})]}));vt.displayName=q.Item.displayName;const ki=B.forwardRef(({className:e,...t},i)=>n.jsx(q.Separator,{ref:i,className:P("richtext--mx-1 richtext-my-1 richtext-h-px richtext-bg-muted",e),...t}));ki.displayName=q.Separator.displayName;const wn=B.forwardRef(({className:e,...t},i)=>n.jsx(bt.Root,{ref:i,className:P("!richtext-peer !richtext-h-4 !richtext-w-4 !richtext-p-0 !richtext-shrink-0 !richtext-rounded-sm !richtext-border !richtext-border-primary !richtext-ring-offset-background focus-visible:!richtext-outline-none focus-visible:!richtext-ring-2 focus-visible:!richtext-ring-ring focus-visible:!richtext-ring-offset-2 disabled:!richtext-cursor-not-allowed disabled:!richtext-opacity-50 data-[state=checked]:!richtext-bg-primary data-[state=checked]:!richtext-text-primary-foreground",e),...t,children:n.jsx(bt.Indicator,{className:P("!richtext-flex !richtext-p-0 !richtext-items-center !richtext-justify-center !richtext-text-current"),children:n.jsx(_.Check,{className:"!richtext-h-4 !richtext-w-4"})})}));wn.displayName=bt.Root.displayName;function Ci({editor:e,...t}){const i=We(e,_e.name,{text:"",defaultShowPicker:!1}),{text:r,defaultShowPicker:a}=i,[o,s]=l.useState(""),[c,u]=l.useState(!1),d=l.useCallback(()=>e.isActive(_e.name),[e]),h=l.useCallback(()=>Ue(_e.name,e),[e]),m=l.useCallback(()=>{e.chain().focus().setKatex({text:o}).run(),u(!1)},[e,o]);l.useEffect(()=>{a&&(u(!0),e.chain().updateAttributes(_e.name,{defaultShowPicker:!1}).focus().run())},[e,a,u]),l.useEffect(()=>{c&&s(r||"")},[c]);const x=l.useMemo(()=>{try{return Lt.renderToString(`${o}`)}catch{return o}},[o]),g=l.useMemo(()=>`${o}`.trim()?n.jsx("span",{contentEditable:!1,dangerouslySetInnerHTML:{__html:x||""}}):null,[o,x]);return n.jsx(f.BubbleMenu,{editor:e,pluginKey:"Katex-bubble-menu",shouldShow:d,tippyOptions:{popperOptions:{modifiers:[{name:"flip",enabled:!1}]},placement:"bottom-start",offset:[-2,16],zIndex:9999,onHidden:()=>{u(!1)}},children:t!=null&&t.disabled?n.jsx(n.Fragment,{}):n.jsx("div",{className:"richtext-p-2 richtext-bg-white !richtext-border richtext-rounded-lg richtext-shadow-sm dark:richtext-bg-black richtext-border-neutral-200 dark:richtext-border-neutral-800",children:c?n.jsxs(n.Fragment,{children:[n.jsx(qe,{value:o,onChange:p=>s(p.target.value),autoFocus:!0,placeholder:"Formula text",rows:3,defaultValue:r,style:{marginBottom:8}}),g&&n.jsx("div",{className:"richtext-my-[10px] richtext-p-[10px] richtext-rounded-[6px] !richtext-border-[1px] richtext-whitespace-nowrap richtext-overflow-auto",children:g}),n.jsxs("div",{className:"richtext-flex richtext-items-center richtext-justify-between richtext-gap-[6px]",children:[n.jsx(F,{onClick:m,className:"richtext-flex-1",children:"Submit"}),n.jsx("a",{href:"https://katex.org/docs/supported",target:"_blank",rel:"noreferrer noopener",children:n.jsx(_.HelpCircle,{size:16})})]})]}):n.jsxs("div",{className:"richtext-flex richtext-items-center richtext-justify-center richtext-gap-[6px]",children:[n.jsx(j,{tooltip:"Edit",action:()=>u(!c),children:n.jsx(_.Pencil,{size:16})}),n.jsx(j,{tooltip:"Delete",action:h,children:n.jsx(_.Trash2,{size:16})})]})})})}function vn(e){return e=e||new Map,{all:e,on(t,i){const r=e.get(t);r?r.push(i):e.set(t,[i])},off(t,i){const r=e.get(t);r&&(i?r.splice(r.indexOf(i)>>>0,1):e.set(t,[]))},emit(t,i){let r=e.get(t);r&&[...r].map(a=>{a(i)}),r=e.get("*"),r&&[...r].map(a=>{a(t,i)})}}}const Ni={padding:"0 12px 12px"},yn=({width:e,maxWidth:t,height:i,onOk:r,children:a})=>{const{t:o}=b.useLocale(),[s,c]=l.useState({width:"",height:"",maxWidth:""});l.useEffect(()=>{c({width:e,height:i,maxWidth:t})},[i,t,e]);function u(d){d.preventDefault(),r(s)}return n.jsxs(ne,{modal:!0,children:[n.jsx(ie,{asChild:!0,children:a}),n.jsx(Q,{children:n.jsx("div",{style:Ni,children:n.jsxs("form",{className:"richtext-flex richtext-flex-col richtext-gap-2",onSubmit:u,children:[n.jsx(X,{className:"mb-[6px]",children:"Width"}),n.jsx("div",{className:"richtext-flex richtext-w-full richtext-max-w-sm richtext-items-center richtext-gap-1.5",children:n.jsx("div",{className:"richtext-relative richtext-items-center richtext-w-full richtext-max-w-sm",children:n.jsx(Z,{type:"number",value:s.width,required:!0,onChange:d=>c({...s,width:d.target.value})})})}),n.jsx(X,{className:"mb-[6px]",children:"Max Width"}),n.jsx("div",{className:"richtext-flex richtext-w-full richtext-max-w-sm richtext-items-center richtext-gap-1.5",children:n.jsx("div",{className:"richtext-relative richtext-items-center richtext-w-full richtext-max-w-sm",children:n.jsx(Z,{type:"number",value:s.maxWidth,required:!0,onChange:d=>c({...s,maxWidth:d.target.value})})})}),n.jsx(X,{className:"mb-[6px]",children:"Height"}),n.jsx("div",{className:"richtext-flex richtext-w-full richtext-max-w-sm richtext-items-center richtext-gap-1.5",children:n.jsx("div",{className:"richtext-relative richtext-items-center richtext-w-full richtext-max-w-sm",children:n.jsx(Z,{type:"number",value:s.height,required:!0,onChange:d=>c({...s,height:d.target.value})})})}),n.jsx(F,{type:"submit",className:"richtext-self-end richtext-mt-2",children:o("editor.link.dialog.button.apply")})]})})})]})},Si="_wrap_15k3c_1",Ti="_renderWrap_15k3c_7",Ai="_title_15k3c_14",Li="_icon_15k3c_20",Mi="_handlerWrap_15k3c_30",Oe={wrap:Si,renderWrap:Ti,title:Ai,icon:Li,handlerWrap:Mi};function jn(e,t,i){return e<t?t:e>i?i:e}const Ei=e=>typeof e=="number",Ii=e=>typeof e=="string",Ri=e=>typeof e=="function";function Hi(e,t="px"){if(!e)return e;const i=Ei(e)?String(e):e,r=Number.parseFloat(i),a=i.match(/[a-z%]+$/i),o=a?a[0]:t;return Number.isNaN(r)?e:r+o}function kn(e,t){if(!e)return!1;const{extensions:i=[]}=(e==null?void 0:e.extensionManager)??{};return!!i.find(a=>a.name===t)}function yt(e){return e.map(t=>Ii(t)?{value:t,name:t}:t)}const zi=10,Oi=200,Wt=15,qt={width:"100%",height:"100%",maxWidth:"100%"};function Pi({editor:e,node:t,updateAttributes:i}){const r=l.useRef(null),a=e.isActive(ge.name),{data:o,width:s,height:c}=t.attrs,[u,d]=l.useState(null),[h,m]=l.useState(!0),[x,g]=l.useState(null),[p,w]=l.useState(!1),[S,I]=l.useState(100),k=l.useCallback(T=>{T&&w(!0)},[w]),y=l.useCallback(T=>()=>{I(E=>jn(T==="minus"?E-Wt:E+Wt,zi,Oi))},[]);l.useEffect(()=>{let T=!1;return import("@excalidraw/excalidraw").then(E=>{T||(r.current=E.exportToSvg)}).catch(E=>!T&&g(E)).finally(()=>!T&&m(!1)),()=>{T=!0}},[m,o]),l.useEffect(()=>{let T=!1;return(async()=>{if(T||h||x||!p||!o)return;const O=await r.current(o);T||(O.setAttribute("width","100%"),O.setAttribute("height","100%"),O.setAttribute("display","block"),d(O))})(),()=>{T=!0}},[o,h,x,p]);const C=T=>{i({width:T.width,height:T.height})};return n.jsx(f.NodeViewWrapper,{className:v.clsx(Oe.wrap,a&&Oe.isActive),children:n.jsx(v.VisibilitySensor,{onChange:k,children:n.jsx(hn.Resizable,{size:{width:Number.parseInt(s),height:Number.parseInt(c)},onResizeStop:(T,E,O,M)=>{C({width:Number.parseInt(s)+M.width,height:Number.parseInt(c)+M.height})},children:n.jsxs("div",{className:v.clsx(Oe.renderWrap,"render-wrapper"),style:{...qt,overflow:"hidden"},children:[x&&n.jsx("div",{style:qt,children:n.jsx("p",{children:x.message||x})}),h&&n.jsx("p",{children:"Loading..."}),!h&&!x&&p&&n.jsx("div",{style:{height:"100%",maxHeight:"100%",padding:24,overflow:"hidden",display:"flex",justifyContent:"center",alignItems:"center",transform:`scale(${S/100})`,transition:"all ease-in-out .3s"},dangerouslySetInnerHTML:{__html:(u==null?void 0:u.outerHTML)??""}}),n.jsx("div",{className:Oe.title}),n.jsxs("div",{className:Oe.handlerWrap,children:[n.jsx(j,{icon:"ZoomOut",action:y("minus"),tooltip:"Zoom Out"}),n.jsx(j,{icon:"ZoomIn",action:y("plus"),tooltip:"Zoom In"})]})]})})})})}const Di=l.memo(Pi,(e,t)=>!!v.deepEqual(e.node.attrs,t.node.attrs));function Bi(e,t="{}"){try{return JSON.stringify(e)}catch{return t}}function $i(e){try{return JSON.stringify(e)}catch{return JSON.stringify({})}}function G(e,t=!1){return i=>{const r=e.startsWith("data-")?e:`data-${e}`;let a=decodeURIComponent(i.getAttribute(r));if(a==null||typeof a=="string"&&a==="null")try{const c=i.outerHTML.match(/([\s\S])+?="([\s\S])+?"/g);c&&c.length&&(a=(c.map(d=>d.trim()).reduce((d,h)=>{const m=h.indexOf("="),x=[h.slice(0,m),h.slice(m+1).slice(1,-1)];return d[x[0]]=x[1],d},{})[e.toLowerCase()]||"").replaceAll("&quot;",'"'))}catch(s){console.error("Error getDatasetAttribute ",s.message,i)}if(t)try{return JSON.parse(a)}catch{return{}}if(a.includes("%")||a.includes("auto"))return a;const o=Number.parseInt(a);return o!==o?a:o}}function Fi(e){const{attrs:t}=e;return Object.keys(t).reduce((i,r)=>{const a=t[r];if(a==null)return i;let o="";return typeof a=="object"?o=$i(a):o=a,i[r]=o,i},Object.create(null))}const je=J.Root,ke=J.Trigger,Vi=J.Portal,Cn=B.forwardRef(({className:e,...t},i)=>n.jsx(J.Overlay,{ref:i,className:P("richtext-fixed richtext-inset-0 richtext-z-50 richtext-bg-black/80 richtext- data-[state=open]:richtext-animate-in data-[state=closed]:richtext-animate-out data-[state=closed]:richtext-fade-out-0 data-[state=open]:richtext-fade-in-0",e),...t}));Cn.displayName=J.Overlay.displayName;const he=B.forwardRef(({className:e,children:t,...i},r)=>n.jsxs(Vi,{children:[n.jsx(Cn,{}),n.jsxs(J.Content,{ref:r,className:P("richtext-dialog-content richtext-fixed richtext-left-[50%] richtext-top-[50%] richtext-z-50 richtext-grid richtext-w-full richtext-max-w-lg richtext-translate-x-[-50%] richtext-translate-y-[-50%] richtext-gap-4 richtext-border richtext-bg-background richtext-p-6 richtext-shadow-lg richtext-duration-200 data-[state=open]:richtext-animate-in data-[state=closed]:richtext-animate-out data-[state=closed]:richtext-fade-out-0 data-[state=open]:richtext-fade-in-0 data-[state=closed]:richtext-zoom-out-95 data-[state=open]:richtext-zoom-in-95 data-[state=closed]:richtext-slide-out-to-left-1/2 data-[state=closed]:richtext-slide-out-to-top-[48%] data-[state=open]:richtext-slide-in-from-left-1/2 data-[state=open]:richtext-slide-in-from-top-[48%] sm:richtext-rounded-lg",e),...i,children:[t,n.jsxs(J.Close,{className:"richtext-absolute richtext-right-4 richtext-top-4 richtext-rounded-sm richtext-opacity-70 richtext-ring-offset-background richtext-transition-opacity hover:richtext-opacity-100 focus:richtext-outline-none focus:richtext-ring-2 focus:richtext-ring-ring focus:richtext-ring-offset-2 disabled:richtext-pointer-events-none data-[state=open]:richtext-bg-accent data-[state=open]:richtext-text-muted-foreground",children:[n.jsx(_.X,{className:"richtext-h-4 richtext-w-4"}),n.jsx("span",{className:"richtext-sr-only",children:"Close"})]})]})]}));he.displayName=J.Content.displayName;function Nn({className:e,...t}){return n.jsx("div",{className:P("richtext-flex richtext-flex-col richtext-space-y-1.5 richtext-text-center sm:richtext-text-left",e),...t})}Nn.displayName="DialogHeader";function ze({className:e,...t}){return n.jsx("div",{className:P("richtext-flex richtext-flex-col-reverse sm:richtext-flex-row sm:richtext-justify-end sm:richtext-space-x-2",e),...t})}ze.displayName="DialogFooter";const ue=B.forwardRef(({className:e,...t},i)=>n.jsx(J.Title,{ref:i,className:P("richtext-text-lg richtext-font-semibold richtext-leading-none richtext-tracking-tight",e),...t}));ue.displayName=J.Title.displayName;const Ui=B.forwardRef(({className:e,...t},i)=>n.jsx(J.Description,{ref:i,className:P("richtext-text-sm richtext-text-muted-foreground",e),...t}));Ui.displayName=J.Description.displayName;let ht;function Rt(){try{return ht||(ht=vn()),ht}catch{throw new Error("Error EventEmitter")}}const jt="OPEN_EXCALIDRAW_SETTING_MODAL";function Wi(e,t){Rt().on(e,t)}function qi(e,t){Rt().off(e,t)}function Gi(e){Rt().emit(jt,e)}const Ki=({editor:e})=>{const[t,i]=l.useState(null),[r,a]=l.useState({}),[o,s]=l.useState({elements:[],appState:{isLoading:!1},files:null}),[c,u]=l.useState(!1),[d,h]=l.useState(!0),[m,x]=l.useState(null),g=l.useCallback(I=>{I&&import("@excalidraw/excalidraw").then(k=>{i(k.Excalidraw)}).catch(x).finally(()=>h(!1))},[h]),p=l.useCallback(I=>{setTimeout(()=>{I.refresh()})},[]),w=l.useCallback((I,k,y)=>{a({elements:I,appState:{isLoading:!1},files:y})},[]),S=l.useCallback(()=>{if(!t){u(!1);return}e.chain().focus().setExcalidraw({data:r}).run(),u(!1)},[t,e,r,u]);return l.useEffect(()=>{const I=k=>{u(!0),k&&s(k.data)};return Wi(jt,I),()=>{qi(jt,I)}},[e,u]),n.jsxs(je,{open:c,onOpenChange:u,children:[n.jsx(ke,{asChild:!0,children:n.jsx(j,{icon:"Excalidraw",tooltip:"Excalidraw",action:()=>u(!0)})}),n.jsxs(he,{className:"!richtext-max-w-[1300px] richtext-z-[99999]",children:[n.jsx(ue,{children:"Excalidraw"}),n.jsxs("div",{style:{height:"100%",borderWidth:1},children:[d&&n.jsx("p",{children:"Loading..."}),m&&n.jsx("p",{children:m&&m.message||"Error"}),n.jsx("div",{style:{width:"100%",height:600},ref:g,children:!d&&!m&&t?n.jsx(t,{ref:p,onChange:w,langCode:"en",initialData:o}):null})]}),n.jsx(ze,{children:n.jsx(F,{type:"button",onClick:S,children:"Save changes"})})]})]})},Gt={elements:[]},ge=f.Node.create({name:"excalidraw",group:"block",selectable:!0,atom:!0,draggable:!0,inline:!1,addAttributes(){return{defaultShowPicker:{default:!1},createUser:{default:null},width:{default:"100%",parseHTML:G("width")},height:{default:240,parseHTML:G("height")},data:{default:Gt,parseHTML:G("data",!0)}}},addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),HTMLAttributes:{class:"excalidraw"},button:({editor:t})=>({component:Ki,componentProps:{editor:t}})}},parseHTML(){return[{tag:"div[class=excalidraw]"}]},renderHTML({HTMLAttributes:e,node:t}){return["div",f.mergeAttributes(this.options.HTMLAttributes,e,Fi(t))]},addCommands(){return{setExcalidraw:e=>({tr:t,commands:i,chain:r})=>{var a,o,s;return e=e||{},e.data=e.data||Gt,((s=(o=(a=t.selection)==null?void 0:a.node)==null?void 0:o.type)==null?void 0:s.name)==this.name?i.updateAttributes(this.name,e):r().insertContent({type:this.name,attrs:e}).run()}}},addNodeView(){return f.ReactNodeViewRenderer(Di)},addInputRules(){return[f.nodeInputRule({find:/^\$excalidraw\$$/,type:this.type,getAttributes:()=>({width:"100%"})})]}}),me=new Map;function Zi(e){const t=e.options.element;me.has("width")||me.set("width",t.clientWidth),me.has("width")&&me.get("width")<=0&&me.set("width",t.clientWidth);const i={attributes:!0,childList:!0,subtree:!0},r=function(){me.set("width",t.clientWidth)},a=new MutationObserver(r);return a.observe(t,i),e.on("destroy",()=>{a.disconnect()}),{width:me.get("width")}}function Xi({editor:e}){const{t}=b.useLocale(),{width:i}=Zi(e),r=We(e,ge.name,{defaultShowPicker:!1,createUser:"",width:0,height:0}),{defaultShowPicker:a,createUser:o,width:s,height:c}=r,u=l.useCallback(x=>{e.chain().updateAttributes(ge.name,x).setNodeSelection(e.state.selection.from).focus().run()},[e]),d=l.useCallback(()=>{Gi(r)},[e,r]),h=l.useCallback(()=>e.isActive(ge.name),[e]),m=l.useCallback(()=>Ue(ge.name,e),[e]);return l.useEffect(()=>{a&&(d(),e.chain().updateAttributes(ge.name,{defaultShowPicker:!1}).focus().run())},[o,a,e,d]),n.jsx(f.BubbleMenu,{className:"bubble-menu",editor:e,pluginKey:"excalidraw-bubble-menu",shouldShow:h,tippyOptions:{popperOptions:{modifiers:[{name:"flip",enabled:!1}]},placement:"bottom-start",offset:[-2,16],zIndex:9999},children:n.jsxs("div",{className:"richtext-w-auto richtext-px-3 richtext-py-2 richtext-transition-all !richtext-border richtext-rounded-sm richtext-shadow-sm richtext-pointer-events-auto richtext-select-none richtext-border-neutral-200 dark:richtext-border-neutral-800 richtext-bg-background",children:[n.jsx(j,{icon:"Pencil",action:d,tooltip:t("editor.edit")}),n.jsx(yn,{width:s,maxWidth:i,height:c,onOk:u,children:n.jsx(j,{icon:"Settings",tooltip:t("editor.settings")})}),n.jsx(j,{icon:"Trash2",action:m,tooltip:t("editor.delete")})]})})}const Ji="_wrap_5y04w_1",Yi="_handlerWrap_5y04w_11",Qi="_innerWrap_5y04w_15",er="_emptyWrap_5y04w_23",Kt={wrap:Ji,handlerWrap:Yi,innerWrap:Qi,emptyWrap:er};function tr({editor:e,node:t,updateAttributes:i}){const r=e.isEditable,{url:a,width:o,height:s}=t.attrs,[c,u]=l.useState("");function d(){c&&e.chain().updateAttributes(be.name,{url:c}).setNodeSelection(e.state.selection.from).focus().run()}const h=l.useCallback(m=>{i({width:m.width,height:m.height})},[i]);return n.jsxs(f.NodeViewWrapper,{children:[!a&&n.jsxs("div",{className:"richtext-max-w-[600px] richtext-mx-[auto] richtext-my-[12px] richtext-flex richtext-items-center richtext-justify-center richtext-gap-[10px] richtext-p-[10px] richtext-border-[1px] richtext-border-solid richtext-border-[#ccc] richtext-rounded-[12px]",children:[n.jsx(Z,{value:c,onInput:m=>u(m.target.value),type:"url",className:"richtext-flex-1",autoFocus:!0,placeholder:"Enter link"}),n.jsx(F,{className:"richtext-w-[60px]",onClick:d,children:"OK"})]}),a&&n.jsx(hn.Resizable,{size:{width:Number.parseInt(o),height:Number.parseInt(s)},onResizeStop:(m,x,g,p)=>{h({width:Number.parseInt(o)+p.width,height:Number.parseInt(s)+p.height})},children:n.jsx("div",{className:v.clsx(Kt.wrap,"render-wrapper"),children:n.jsx("div",{className:Kt.innerWrap,style:{pointerEvents:r?"none":"auto"},children:n.jsx("iframe",{src:a,className:"richtext-my-[12px] "})})})})]})}const be=f.Node.create({name:"iframe",content:"",marks:"",group:"block",selectable:!0,atom:!0,draggable:!0,addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),HTMLAttributes:{class:"iframe"},button:({editor:t,extension:i,t:r})=>({component:j,componentProps:{action:a=>t.commands.setIframe(a),upload:i.options.upload,disabled:!t.can().setIframe({}),icon:"Iframe",tooltip:r("editor.iframe.tooltip")}})}},addAttributes(){return{width:{default:600,parseHTML:G("width")},height:{default:300,parseHTML:G("height")},url:{default:null,parseHTML:G("url")},defaultShowPicker:{default:!1},frameborder:{default:0},allowfullscreen:{default:this.options.allowFullscreen,parseHTML:()=>this.options.allowFullscreen}}},parseHTML(){return[{tag:"iframe"}]},renderHTML({HTMLAttributes:e}){return["iframe",f.mergeAttributes(this.options.HTMLAttributes,e)]},addCommands(){return{setIframe:e=>({tr:t,commands:i,chain:r})=>{var o,s,c;if(((c=(s=(o=t.selection)==null?void 0:o.node)==null?void 0:s.type)==null?void 0:c.name)==this.name)return i.updateAttributes(this.name,e);const a=e||{url:""};return r().insertContent({type:this.name,attrs:a}).run()}}},addInputRules(){return[f.nodeInputRule({find:/^\$iframe\$$/,type:this.type,getAttributes:()=>({width:"100%"})})]},addNodeView(){return f.ReactNodeViewRenderer(tr)}});function nr({editor:e}){const{t}=b.useLocale(),{width:i,height:r,url:a}=We(e,be.name,{width:0,height:0,url:"",defaultShowPicker:!1}),[o,s]=l.useState(!1),[c,u]=l.useState(""),d=l.useCallback(()=>{s(!1)},[s]);l.useEffect(()=>{o&&u(a)},[o,a]);const h=l.useCallback(()=>{e.chain().updateAttributes(be.name,{url:c}).setNodeSelection(e.state.selection.from).focus().run(),s(!1)},[e,c,s]),m=l.useCallback(()=>{window.open(a,"_blank")},[a]),x=l.useCallback(()=>{s(!0)},[s]),g=l.useCallback(S=>{e.chain().updateAttributes(be.name,S).setNodeSelection(e.state.selection.from).focus().run()},[e]),p=l.useCallback(()=>e.isActive(be.name)&&!a,[e,a]),w=l.useCallback(()=>Ue(be.name,e),[e]);return n.jsxs(n.Fragment,{children:[n.jsx(f.BubbleMenu,{className:"bubble-menu",editor:e,pluginKey:"iframe-bubble-menu",shouldShow:p,tippyOptions:{popperOptions:{modifiers:[{name:"flip",enabled:!1}]},placement:"bottom-start",offset:[-2,16],zIndex:9999},children:n.jsxs("div",{className:"richtext-w-auto richtext-px-3 richtext-py-2 richtext-transition-all !richtext-border richtext-rounded-sm richtext-shadow-sm richtext-pointer-events-auto richtext-select-none richtext-border-neutral-200 dark:richtext-border-neutral-800 richtext-bg-background",children:[n.jsx(j,{action:m,icon:"Eye",tooltip:"Visit Link"}),n.jsx(j,{action:x,icon:"Pencil",tooltip:"Open Edit Link"}),n.jsx(yn,{width:i,height:r,onOk:g,children:n.jsx(j,{icon:"Settings",tooltip:t("editor.settings")})}),n.jsx(j,{action:w,icon:"Trash2",tooltip:t("editor.delete")})]})}),n.jsxs(je,{open:o,onOpenChange:s,children:[n.jsx(ke,{}),n.jsxs(he,{children:[n.jsx(Nn,{children:n.jsx(ue,{children:"Edit Link Iframe"})}),n.jsx(Z,{value:c,onInput:S=>u(S.target.value),type:"url",autoFocus:!0,placeholder:"Enter link"}),n.jsxs(ze,{children:[n.jsx(F,{onClick:d,children:"Cancel"}),n.jsx(F,{onClick:h,children:"OK"})]})]})]})]})}function Sn(e=8){return Math.random().toString(36).substring(2,e+2)}function ir(e){return e.replace(/^.*\/|\..+$/g,"")}function rr(e){return e.split(".").pop()}function ar(e){return e<1024?`${e} Byte`:e<1024*1024?`${(e/1024).toFixed(2)} KB`:`${(e/1024/1024).toFixed(2)} MB`}function or(e){return e?e==="application/pdf"?"pdf":e.startsWith("application/")&&[".document","word"].some(t=>e.includes(t))?"word":e.startsWith("application/")&&["presentation"].some(t=>e.includes(t))?"excel":e.startsWith("application/")&&["sheet"].some(t=>e.includes(t))?"ppt":e.startsWith("image")?"image":e.startsWith("audio")?"audio":e.startsWith("video")?"video":"file":"file"}function sr(e){return new Promise(t=>{const i=new FileReader;i.addEventListener("load",()=>{t({alt:e.name,src:i.result})},!1),i.readAsDataURL(e)})}function Ht(e,t){const i=e.split(","),r=i[0].match(/:(.*?);/)[1],a=atob(i[i.length-1]);let o=a.length;const s=new Uint8Array(o);for(;o--;)s[o]=a.charCodeAt(o);return new File([s],t,{type:r})}const Zt=`graph TB
2
- a-->b`,cr=({editor:e,attrs:t,extension:i})=>{const{alt:r,align:a}=t,[o,s]=l.useState(decodeURIComponent(r??Zt)),[c,u]=l.useState(""),[d,h]=l.useState(!1),m=l.useRef(null),x=i==null?void 0:i.options.upload,g=async S=>{try{const{svg:I}=await tt.render("mermaid-svg",S);u(I)}catch{u("")}},p=()=>{tt.initialize({darkMode:!1,startOnLoad:!1,fontSize:12,theme:"base"}),g(o)};l.useEffect(()=>{d&&p()},[d]),l.useEffect(()=>{d&&g(o)},[o]);const w=async()=>{if(o!==""){if(o){const S=m.current.querySelector("svg"),{width:I,height:k}=S.getBoundingClientRect(),y=`mermaid-${Sn()}.svg`;let C=v.i(S.outerHTML);if(x){const T=Ht(C,y);C=await x(T)}e==null||e.chain().focus().setMermaid({type:"mermaid",src:C,alt:encodeURIComponent(o),width:I,height:k},!!o).run(),e==null||e.commands.setAlignImageMermaid(a)}h(!1)}};return n.jsxs(je,{open:d,onOpenChange:h,children:[n.jsx(ke,{asChild:!0,children:n.jsx(j,{icon:"Pencil",tooltip:"Edit Mermaid",action:()=>h(!0)})}),n.jsxs(he,{className:"!richtext-max-w-[1300px] richtext-z-[99999]",children:[n.jsx(ue,{children:"Edit Mermaid"}),n.jsx("div",{style:{height:"100%",border:"1px solid hsl(var(--border))"},children:n.jsxs("div",{className:"richtext-flex richtext-gap-[10px] richtext-rounded-[10px] richtext-p-[10px]",children:[n.jsx(qe,{className:"richtext-flex-1",value:o,onChange:S=>s(S.target.value),autoFocus:!0,required:!0,rows:10,defaultValue:Zt,placeholder:"Text",style:{color:"hsl(var(--richtext-foreground))"}}),n.jsx("div",{className:"richtext-flex-1 richtext-flex richtext-items-center richtext-justify-center richtext-rounded-[10px] richtext-p-[10px]",style:{height:"100%",border:"1px solid hsl(var(--border))",minHeight:500,background:"#fff"},ref:m,dangerouslySetInnerHTML:{__html:c}})]})}),n.jsx(ze,{children:n.jsx(F,{type:"button",onClick:w,children:"Save changes"})})]})]})};function lr(e,t){const[i,r]=l.useState(void 0);return l.useEffect(()=>{const a=()=>{const o=e.extensionManager.extensions.find(s=>s.name===t);o&&r(o)};return e.on("selectionUpdate",a),e.on("transaction",a),()=>{e.off("selectionUpdate",a),e.off("transaction",a)}},[e,t]),i}const dr={maxWidth:"auto",zIndex:20,appendTo:"parent",moveTransition:"transform 0.1s ease-out"};function hr({item:e,disabled:t,editor:i}){var a;const r=e.component;return r?n.jsx(l.Fragment,{children:e.type==="divider"?n.jsx(te,{orientation:"vertical",className:"!richtext-mx-1 !richtext-my-2 !richtext-h-[16px]"}):n.jsx(r,{...e.componentProps,editor:i,disabled:t||((a=e==null?void 0:e.componentProps)==null?void 0:a.disabled)})}):n.jsx(n.Fragment,{})}function ur(e){return e.type.name==="mermaid"}function mr(e){const{lang:t}=b.useLocale(),i=We(e.editor,St.name),r=lr(e.editor,St.name),a=({editor:s})=>{const{selection:c}=s.view.state,{$from:u,to:d}=c;let h=!1;return s.view.state.doc.nodesBetween(u.pos,d,m=>{if(ur(m))return h=!0,!1}),h},o=l.useMemo(()=>e.disabled?[]:ta(e.editor),[e.disabled,e.editor,t]);return n.jsx(n.Fragment,{children:n.jsx(f.BubbleMenu,{shouldShow:a,editor:e==null?void 0:e.editor,tippyOptions:dr,children:o!=null&&o.length?n.jsx("div",{className:"richtext-w-auto richtext-px-3 richtext-py-2 richtext-transition-all !richtext-border richtext-rounded-sm richtext-shadow-sm richtext-pointer-events-auto richtext-select-none richtext-border-neutral-200 dark:richtext-border-neutral-800 richtext-bg-background",children:n.jsx("div",{className:"richtext-flex richtext-items-center richtext-flex-nowrap richtext-whitespace-nowrap richtext-h-[26px] richtext-justify-start richtext-relative",children:o==null?void 0:o.map((s,c)=>s.type==="edit"&&(i!=null&&i.src)?n.jsx(cr,{editor:e.editor,attrs:i,extension:r},`bubbleMenu-mermaid-${c}`):n.jsx(hr,{item:s,disabled:e.disabled,editor:e.editor},`bubbleMenu-mermaid-${c}`))})}):n.jsx(n.Fragment,{})})})}function xr({editor:e,disabled:t,bubbleMenu:i}){const r=e.extensionManager.extensions.map(o=>o.name),a=()=>{var o,s,c,u,d,h,m,x,g,p,w,S;return[r.includes("columns")&&!((o=i==null?void 0:i.columnConfig)!=null&&o.hidden)?n.jsx(wa,{editor:e},"columns"):null,r.includes("table")&&!((s=i==null?void 0:i.tableConfig)!=null&&s.hidden)?n.jsx(ha,{editor:e},"table"):null,r.includes("link")&&!((c=i==null?void 0:i.linkConfig)!=null&&c.hidden)?n.jsx(ma,{editor:e,disabled:t},"link"):null,r.includes("image")&&!((u=i==null?void 0:i.imageConfig)!=null&&u.hidden)?n.jsx(ba,{editor:e,disabled:t},"image"):null,r.includes(Dt.name)&&!((d=i==null?void 0:i.imageGifConfig)!=null&&d.hidden)?n.jsx(pa,{editor:e,disabled:t},"imageGif"):null,r.includes("video")&&!((h=i==null?void 0:i.videoConfig)!=null&&h.hidden)?n.jsx(_a,{editor:e,disabled:t},"video"):null,r.includes("katex")&&!((m=i==null?void 0:i.katexConfig)!=null&&m.hidden)?n.jsx(Ci,{editor:e,disabled:t},"katex"):null,r.includes("excalidraw")&&!((x=i==null?void 0:i.excalidrawConfig)!=null&&x.hidden)?n.jsx(Xi,{editor:e,disabled:t},"excalidraw"):null,r.includes("mermaid")&&!((g=i==null?void 0:i.mermaidConfig)!=null&&g.hidden)?n.jsx(mr,{editor:e,disabled:t},"mermaid"):null,r.includes("iframe")&&!((p=i==null?void 0:i.iframeConfig)!=null&&p.hidden)?n.jsx(nr,{editor:e,disabled:t},"iframe"):null,(w=i==null?void 0:i.floatingMenuConfig)!=null&&w.hidden?null:n.jsx(oa,{editor:e,disabled:t},"content"),(S=i==null?void 0:i.textConfig)!=null&&S.hidden?null:n.jsx(la,{editor:e,disabled:t},"text")]};return i!=null&&i.render?i.render({editor:e,disabled:t||!1,bubbleMenu:i},a()):a().filter(Boolean)}function Xt(){return n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",children:n.jsx("path",{fill:"currentColor",d:"M18 14c0-4-6-10.8-6-10.8s-1.33 1.51-2.73 3.52l8.59 8.59c.09-.42.14-.86.14-1.31m-.88 3.12L12.5 12.5L5.27 5.27L4 6.55l3.32 3.32C6.55 11.32 6 12.79 6 14c0 3.31 2.69 6 6 6c1.52 0 2.9-.57 3.96-1.5l2.63 2.63l1.27-1.27z"})})}function Tn(e){const{t}=b.useLocale(),{highlight:i=!1,disabled:r=!1,selectedColor:a,setSelectedColor:o,onChange:s,colors:c=b.COLORS_LIST}=e,u=l.useMemo(()=>{const g=c,p=[];for(let w=0;w<g.length;w+=10)p.push(g.slice(w,w+10));return p},[c]),[d,h]=l.useState([]),m=g=>{const p=[...d],w=p.indexOf(g);w!==-1&&p.splice(w,1),p.unshift(g),p.length>10&&p.pop(),h(p)};function x(g){if(g===void 0){o==null||o(g),s==null||s(g);return}/^#([\da-f]{3}){1,2}$/i.test(g)&&(o==null||o(g),s==null||s(g),m(g))}return n.jsxs(ne,{modal:!0,children:[n.jsx(ie,{className:"!richtext-p-0",disabled:r,asChild:!0,children:e==null?void 0:e.children}),n.jsx(Q,{hideWhenDetached:!0,className:"richtext-w-full richtext-h-full richtext-p-2",align:"start",side:"bottom",children:n.jsxs("div",{className:"richtext-flex richtext-flex-col",children:[i?n.jsxs("div",{className:"richtext-flex richtext-items-center richtext-p-1 richtext-cursor-pointer rd-1 richtext-gap-[4px] hover:richtext-bg-accent",onClick:()=>x(void 0),children:[n.jsx(Xt,{}),n.jsx("span",{className:"richtext-ml-1 richtext-text-sm",children:t("editor.nofill")})]}):n.jsxs("div",{className:"richtext-flex richtext-items-center richtext-p-1 richtext-cursor-pointer rd-1 richtext-gap-[4px] hover:richtext-bg-accent",onClick:()=>{x(void 0)},children:[n.jsx(Xt,{}),n.jsx("span",{className:"richtext-ml-1 richtext-text-sm",children:t("editor.default")})]}),u.map((g,p)=>n.jsx("span",{className:"richtext-relative richtext-flex richtext-w-full richtext-h-auto richtext-p-0 last:richtext-pb-2",children:g.map((w,S)=>n.jsx("span",{className:"richtext-w-6 richtext-h-6 richtext-p-0.5 richtext-inline-block richtext-rounded-sm !richtext-border richtext-border-transparent richtext-flex-[0_0_auto] richtext-cursor-pointer hover:richtext-border-border hover:richtext-shadow-sm",onClick:()=>x(w),children:n.jsx("span",{style:{backgroundColor:w},className:"richtext-relative richtext-w-[18px] richtext-h-[18px] richtext-block richtext-rounded-[2px] richtext-border-transparent",children:w===a?n.jsx("svg",{className:"richtext-absolute richtext-block richtext-top-[-1px] richtext-left-[1px] richtext-w-3 richtext-h-3",viewBox:"0 0 18 18",style:{fill:"rgb(255, 255, 255)"},children:n.jsx("path",{d:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"})}):n.jsx("svg",{viewBox:"0 0 18 18",style:{fill:"rgb(255, 255, 255)",display:"none"},children:n.jsx("path",{d:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"})})})},`sub-color-${S}`))},p)),n.jsxs("div",{children:[n.jsx("div",{className:"richtext-my-1 richtext-text-sm",children:t("editor.recent")}),n.jsx("span",{className:"richtext-relative richtext-flex richtext-w-full richtext-h-auto richtext-p-0 last:richtext-pb-2",children:d==null?void 0:d.map((g,p)=>n.jsx("span",{className:"richtext-w-6 richtext-h-6 richtext-p-0.5 richtext-inline-block richtext-rounded-sm !richtext-border richtext-border-transparent richtext-flex-[0_0_auto] richtext-cursor-pointer hover:richtext-border-border hover:richtext-shadow-sm",onClick:()=>x(g),children:n.jsx("span",{className:"richtext-relative richtext-w-[18px] richtext-h-[18px] richtext-block richtext-rounded-[2px] richtext-border-transparent",style:{backgroundColor:g},children:n.jsx("svg",{viewBox:"0 0 18 18",style:{fill:"rgb(255, 255, 255)",display:"none"},children:n.jsx("path",{d:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"})})})},`sub-color-recent-${p}`))})]}),n.jsx(fr,{setColor:x})]})})]})}function fr({setColor:e}){const[t,i]=l.useState("#000000"),[r,a]=l.useState(!1),{t:o}=b.useLocale();return l.useEffect(()=>()=>{a(!1)},[]),n.jsxs(ne,{open:r,children:[n.jsx(ie,{asChild:!0,children:n.jsxs("div",{onClick:s=>{s.preventDefault(),a(!0)},className:"richtext-text-sm hover:richtext-cursor-pointer hover:richtext-bg-accent richtext-py-1.5 richtext-px-1.5",children:[o("editor.color.more"),"..."]})}),n.jsxs(Q,{children:[n.jsxs("div",{className:"richtext-flex richtext-flex-col richtext-items-center richtext-justify-center",children:[n.jsx(li.HexColorPicker,{color:t,onChange:i}),n.jsx(Z,{className:"richtext-mt-[8px] richtext-w-full",type:"text",onChange:s=>{s.preventDefault(),i(`#${s.target.value}`)},value:t.slice(1)})]}),n.jsx(te,{className:"richtext-my-[10px]"}),n.jsx(F,{onClick:s=>{s.preventDefault(),e(t),a(!1)},className:"richtext-w-full",children:n.jsx(_.Plus,{size:16})})]})]})}const gr=`
3
- .reactjs-tiptap-editor, .richtext-dialog-content {
4
- button,
5
- input:where([type=button]),
6
- input:where([type=reset]),
7
- input:where([type=submit]) {
8
- -webkit-appearance: button;
9
- background-color: transparent;
10
- background-image: none
11
- }
12
-
13
- input,
14
- optgroup,
15
- select,
16
- textarea {
17
- font-family: inherit;
18
- font-feature-settings: inherit;
19
- font-variation-settings: inherit;
20
- font-size: 100%;
21
- font-weight: inherit;
22
- line-height: inherit;
23
- letter-spacing: inherit;
24
- color: inherit;
25
- }
26
-
27
- button {
28
- font-family: inherit;
29
- font-feature-settings: inherit;
30
- font-variation-settings: inherit;
31
- font-size: 100%;
32
- font-weight: inherit;
33
- line-height: inherit;
34
- letter-spacing: inherit;
35
- color: inherit;
36
- }
37
- }
38
-
39
- .reactjs-tiptap-editor,
40
- .richtext-dialog-content,
41
- div[data-radix-popper-content-wrapper],
42
- div[data-tippy-root] {
43
- *,
44
- :before,
45
- :after {
46
- box-sizing: border-box;
47
- border-width: 0;
48
- border-style: solid;
49
- border-color: hsl(var(--richtext-border));
50
- }
51
-
52
- background-color: hsl(var(--richtext-background));
53
- color: hsl(var(--richtext-foreground));
54
-
55
-
56
- html,
57
- :host {
58
- line-height: 1.5;
59
- -webkit-text-size-adjust: 100%;
60
- -moz-tab-size: 4;
61
- tab-size: 4;
62
- font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", Segoe UI Symbol, "Noto Color Emoji";
63
- font-feature-settings: normal;
64
- font-variation-settings: normal;
65
- -webkit-tap-highlight-color: transparent
66
- }
67
-
68
- hr {
69
- height: 0;
70
- color: inherit;
71
- border-top-width: 1px
72
- }
73
-
74
- a {
75
- color: inherit;
76
- text-decoration: inherit
77
- }
78
-
79
- b,
80
- strong {
81
- font-weight: bolder
82
- }
83
-
84
- code,
85
- kbd,
86
- samp,
87
- pre {
88
- font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, Courier New, monospace;
89
- font-feature-settings: normal;
90
- font-variation-settings: normal;
91
- font-size: 1em
92
- }
93
-
94
- table {
95
- text-indent: 0;
96
- border-color: inherit;
97
- border-collapse: collapse
98
- }
99
-
100
- input, textarea {
101
- border-width: 1px;
102
- }
103
-
104
- textarea {
105
- resize: vertical
106
- }
107
-
108
- input::placeholder,
109
- textarea::placeholder {
110
- opacity: 1;
111
- color: #9ca3af
112
- }
113
-
114
- button, input, textarea {
115
- cursor: pointer;
116
- color: inherit;
117
- }
118
-
119
- img,
120
- svg,
121
- video,
122
- canvas,
123
- audio,
124
- iframe,
125
- embed,
126
- object {
127
- display: block;
128
- vertical-align: middle
129
- }
130
-
131
- img,
132
- video {
133
- max-width: 100%;
134
- height: auto
135
- }
136
- }
137
- `,An=Ie.proxy({theme:"light"});function br(){return Ie.useSnapshot(An).theme}const pr={setTheme:e=>{An.theme=e}},Jt="data-rc-order",Yt="data-rc-priority",_r="rc-util-key",kt=new Map;function wr(e,t){if(!e)return!1;if(e.contains)return e.contains(t);let i=t;for(;i;){if(i===e)return!0;i=i.parentNode}return!1}function Ln({mark:e}={}){return e?e.startsWith("data-")?e:`data-${e}`:_r}function zt(e){return e.attachTo?e.attachTo:document.querySelector("head")||document.body}function vr(e){return e==="queue"?"prependQueue":e?"prepend":"append"}function Mn(e){return[...(kt.get(e)||e).children].filter(t=>t.tagName==="STYLE")}function En(e,t={}){const{csp:i,prepend:r,priority:a=0}=t,o=vr(r),s=o==="prependQueue",c=document.createElement("style");c.setAttribute(Jt,o),s&&a&&c.setAttribute(Yt,`${a}`),i!=null&&i.nonce&&(c.nonce=i==null?void 0:i.nonce),c.innerHTML=e;const u=zt(t),{firstChild:d}=u;if(r){if(s){const h=Mn(u).filter(m=>{if(!["prepend","prependQueue"].includes(m.getAttribute(Jt)))return!1;const x=Number(m.getAttribute(Yt)||0);return a>=x});if(h.length>0)return u.insertBefore(c,h.at(-1).nextSibling),c}d.before(c)}else u.append(c);return c}function In(e,t={}){const i=zt(t);return Mn(i).find(r=>r.getAttribute(Ln(t))===e)}function yr(e,t={}){const i=In(e,t);i&&i.remove()}function jr(e,t){const i=kt.get(e);if(!i||!wr(document,i)){const r=En("",t),{parentNode:a}=r;kt.set(e,a),r.remove()}}function kr(e,t,i={}){var s,c,u;const r=zt(i);jr(r,i);const a=In(t,i);if(a)return(s=i.csp)!=null&&s.nonce&&a.nonce!==((c=i.csp)==null?void 0:c.nonce)&&(a.nonce=(u=i.csp)==null?void 0:u.nonce),a.innerHTML!==e&&(a.innerHTML=e),a;const o=En(e,i);return o.setAttribute(Ln(i),t),o}function Cr({editor:e,extensions:t}){const{t:i}=b.useLocale(),r=l.useMemo(()=>{var a,o,s;return(s=(o=(a=t==null?void 0:t.find(c=>c.name==="base-kit"))==null?void 0:a.options)==null?void 0:o.characterCount)==null?void 0:s.limit},[t]);return r?n.jsx("div",{className:"richtext-flex richtext-items-center richtext-justify-between richtext-p-3 richtext-border-t",children:n.jsx("div",{className:"richtext-flex richtext-flex-col",children:n.jsx("div",{className:"richtext-flex richtext-justify-end richtext-gap-3 richtext-text-sm",children:n.jsxs("span",{children:[e.storage.characterCount.characters(),"/",r," ",i("editor.characters")]})})})}):n.jsx("div",{className:"richtext-flex richtext-items-center richtext-justify-between richtext-p-3 richtext-border-t",children:n.jsx("div",{className:"richtext-flex richtext-flex-col",children:n.jsx("div",{className:"richtext-flex richtext-justify-end richtext-gap-3 richtext-text-sm",children:n.jsxs("span",{children:[e.storage.characterCount.characters()," ",i("editor.characters")]})})})})}function Nr(e,t){const{content:i,extensions:r,useEditorOptions:a={}}=e,o=l.useMemo(()=>{const h=v.differenceBy(r,r,"name");return[...r.map(x=>{const g=r.find(p=>p.name===x.name);return g?x.configure(g.options):x}),...h].map((x,g)=>x.configure({sort:g}))},[r]),s=v.throttle(h=>{var x;const m=u(h,e.output);(x=e==null?void 0:e.onChangeContent)==null||x.call(e,m)},b.EDITOR_UPDATE_WATCH_THROTTLE_WAIT_TIME),c=f.useEditor({extensions:o,content:i,onUpdate:({editor:h})=>{s&&s(h)},...a});l.useImperativeHandle(t,()=>({editor:c})),l.useEffect(()=>{document.documentElement.classList.toggle("dark",e.dark),pr.setTheme(e.dark?"dark":"light")},[e.dark]),l.useEffect(()=>{c==null||c.setEditable(!(e!=null&&e.disabled))},[c,e==null?void 0:e.disabled]),l.useEffect(()=>((e==null?void 0:e.resetCSS)!==!1&&kr(gr,"react-tiptap-reset"),()=>{yr("react-tiptap-reset")}),[e==null?void 0:e.resetCSS]);function u(h,m){return e!=null&&e.removeDefaultWrapper?m==="html"?h.isEmpty?"":h.getHTML():m==="json"?h.isEmpty?{}:h.getJSON():m==="text"?h.isEmpty?"":h.getText():"":m==="html"?h.getHTML():m==="json"?h.getJSON():m==="text"?h.getText():""}l.useEffect(()=>()=>{var h;(h=c==null?void 0:c.destroy)==null||h.call(c)},[]);const d=kn(c,"characterCount");return c?n.jsx("div",{className:"reactjs-tiptap-editor",children:n.jsx(wi,{delayDuration:0,disableHoverableContent:!0,children:n.jsx("div",{className:"richtext-rounded-[0.5rem] richtext-bg-background richtext-shadow richtext-overflow-hidden richtext-outline richtext-outline-1",children:n.jsxs("div",{className:"richtext-flex richtext-flex-col richtext-w-full richtext-max-h-full",children:[!(e!=null&&e.hideToolbar)&&n.jsx(Tr,{editor:c,disabled:!!(e!=null&&e.disabled)}),n.jsx(f.EditorContent,{className:`richtext-relative ${(e==null?void 0:e.contentClass)||""}`,editor:c}),d&&n.jsx(Cr,{editor:c,extensions:r}),!(e!=null&&e.hideBubble)&&n.jsx(xr,{bubbleMenu:e==null?void 0:e.bubbleMenu,editor:c,disabled:e==null?void 0:e.disabled})]})})})}):n.jsx(n.Fragment,{})}const Sr=l.forwardRef(Nr);function Tr({editor:e,disabled:t}){const{t:i,lang:r}=b.useLocale(),a=l.useMemo(()=>{const s=[...e.extensionManager.extensions].sort((u,d)=>{const h=u.options.sort??-1,m=d.options.sort??-1;return h-m});let c=[];for(const u of s){const{button:d,divider:h=!1,spacer:m=!1,toolbar:x=!0}=u.options;if(!d||!Ri(d)||!x)continue;const g=d({editor:e,extension:u,t:i});if(Array.isArray(g)){const p=g.map((w,S)=>({button:w,divider:S===g.length-1?h:!1,spacer:S===0?m:!1}));c=[...c,...p];continue}c.push({button:g,divider:h,spacer:m})}return c},[e,i,r]);return n.jsx("div",{className:"richtext-px-1 richtext-py-2 !richtext-border-b",style:{pointerEvents:t?"none":"auto",opacity:t?.5:1},children:n.jsx("div",{className:"richtext-relative richtext-flex richtext-flex-wrap richtext-h-auto richtext-gap-y-1 richtext-gap-x-1",children:a.map((o,s)=>{var u,d;const c=o.button.component;return n.jsxs("div",{className:"richtext-flex richtext-items-center",children:[(o==null?void 0:o.spacer)&&n.jsx(te,{orientation:"vertical",className:"!richtext-h-[16px] !richtext-mx-[10px]"}),n.jsx(c,{...o.button.componentProps,disabled:t||((d=(u=o==null?void 0:o.button)==null?void 0:u.componentProps)==null?void 0:d.disabled)}),(o==null?void 0:o.divider)&&n.jsx(te,{orientation:"vertical",className:"!richtext-h-auto !richtext-mx-2"})]},`toolbar-item-${s}`)})})})}function Ar(e){return n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:n.jsx("path",{fill:"currentColor",d:"M19 12h-2v3h-3v2h5zM7 9h3V7H5v5h2zm14-6H3a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h18a2 2 0 0 0 2-2V5a2 2 0 0 0-2-2m0 16H3V5h18z"})})}function Lr(e){return n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:n.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M6 15h15m0 4H6m9-8h6m0-4h-6M9 9h1a1 1 0 1 1-1 1V7.5a2 2 0 0 1 2-2M3 9h1a1 1 0 1 1-1 1V7.5a2 2 0 0 1 2-2"})})}function Mr(){return n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",className:"richtext-w-4 richtext-h-4",width:"1em",height:"1em",viewBox:"0 0 24 24",children:n.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M5.5 3c1.404 0 2.107 0 2.611.38c.219.164.406.375.552.62C9 4.568 9 5.358 9 6.938v10.125c0 1.58 0 2.37-.337 2.937a2.1 2.1 0 0 1-.552.621c-.504.38-1.207.38-2.611.38s-2.107 0-2.611-.38a2.1 2.1 0 0 1-.552-.62C2 19.432 2 18.642 2 17.062V6.938c0-1.58 0-2.37.337-2.938a2.1 2.1 0 0 1 .552-.62C3.393 3 4.096 3 5.5 3M20 11.938v5.124c0 1.58 0 2.37-.337 2.938a2.1 2.1 0 0 1-.552.62c-.504.38-1.207.38-2.611.38s-2.107 0-2.611-.38a2.1 2.1 0 0 1-.552-.62C13 19.433 13 18.642 13 17.063V6.938c0-1.58 0-2.37.337-2.938M22 9l-6-6m6 0l-6 6",color:"currentColor"})})}function Er(){return n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",className:"richtext-w-4 richtext-h-4",width:"1em",height:"1em",viewBox:"0 0 24 24",children:n.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M21 18.5c0 1.404 0 2.107-.38 2.611a2.1 2.1 0 0 1-.62.552c-.567.337-1.358.337-2.937.337H6.938c-1.58 0-2.37 0-2.938-.337a2.1 2.1 0 0 1-.62-.552C3 20.607 3 19.904 3 18.5s0-2.107.38-2.611c.163-.218.374-.406.62-.552C4.567 15 5.357 15 6.938 15h10.125c1.58 0 2.37 0 2.937.337c.246.146.457.334.62.552c.38.504.38 1.207.38 2.611M12.063 4H6.937C5.358 4 4.568 4 4 4.337a2.1 2.1 0 0 0-.62.552C3 5.393 3 6.096 3 7.5s0 2.107.38 2.611c.163.218.374.406.62.552C4.567 11 5.357 11 6.938 11h10.125c1.58 0 2.37 0 2.937-.337M21 8l-6-6m6 0l-6 6",color:"currentColor"})})}function Ir(e){return n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:n.jsx("path",{fill:"currentColor",d:"M14 2H6a2 2 0 0 0-2 2v16c0 1.11.89 2 2 2h12c1.11 0 2-.89 2-2V8zm4 18H6V4h7v5h5zm-.65-10l-2.1 9h-1.4l-1.8-6.79l-1.8 6.79h-1.4l-2.2-9h1.5l1.4 6.81l1.8-6.81h1.3l1.8 6.81l1.4-6.81z"})})}function $(e){const t=Ke[e.name];return t?n.jsx(t,{onClick:e==null?void 0:e.onClick,className:`richtext-w-4 richtext-h-4 ${(e==null?void 0:e.className)||""}`}):null}function Rr(e){return n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:n.jsx("path",{fill:"currentColor",d:"M21 22H3v-2h18zm0-18H3V2h18zm-11 9.7h4l-2-5.4zM11.2 6h1.7l4.7 12h-2l-.9-2.6H9.4L8.5 18h-2z"})})}function Rn(e){return n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 48 48",...e,children:n.jsx("path",{fill:"currentColor",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:4,d:"M36 19L24 31L12 19z"})})}function Hr(e){return n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:n.jsx("path",{fill:"currentColor",d:"M9 7v10h6v-2h-4V7z"})})}function zr(e){return n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:n.jsx("path",{fill:"currentColor",d:"M9 7c-1.1 0-2 .9-2 2v8h2V9h2v7h2V9h2v8h2V9a2 2 0 0 0-2-2z"})})}function Or(e){return n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:n.jsx("path",{fill:"currentColor",d:"M11 7c-1.1 0-2 .9-2 2v2a2 2 0 0 0 2 2h2v2H9v2h4c1.11 0 2-.89 2-2v-2a2 2 0 0 0-2-2h-2V9h4V7z"})})}function Pr(){return n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",children:n.jsx("path",{fill:"currentColor",d:"M14 2H6a2 2 0 0 0-2 2v16c0 1.11.89 2 2 2h12c1.11 0 2-.89 2-2V8zm4 18H6V4h7v5h5zm-.65-10l-2.1 9h-1.4l-1.8-6.79l-1.8 6.79h-1.4l-2.2-9h1.5l1.4 6.81l1.8-6.81h1.3l1.8 6.81l1.4-6.81z"})})}function Hn(){return n.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 32 32",children:[n.jsx("path",{fill:"currentColor",d:"M30 18v-2h-6v10h2v-4h3v-2h-3v-2zm-11 8h-4V16h4a3.003 3.003 0 0 1 3 3v4a3.003 3.003 0 0 1-3 3m-2-2h2a1 1 0 0 0 1-1v-4a1 1 0 0 0-1-1h-2zm-6-8H6v10h2v-3h3a2.003 2.003 0 0 0 2-2v-3a2 2 0 0 0-2-2m-3 5v-3h3l.001 3z"}),n.jsx("path",{fill:"currentColor",d:"M22 14v-4a.91.91 0 0 0-.3-.7l-7-7A.9.9 0 0 0 14 2H4a2.006 2.006 0 0 0-2 2v24a2 2 0 0 0 2 2h16v-2H4V4h8v6a2.006 2.006 0 0 0 2 2h6v2Zm-8-4V4.4l5.6 5.6Z"})]})}function zn(){return n.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",className:"icon",viewBox:"0 0 1024 1024",children:[n.jsx("path",{fill:"currentColor",d:"M679.253 402.364 618.77 561.015l-60.348-158.651a30.04 30.04 0 0 0-30.447-18.637 29.76 29.76 0 0 0-30.447 18.637l-60.416 158.651-60.416-158.651a30.515 30.515 0 0 0-38.843-17.272 28.945 28.945 0 0 0-17.954 37.547l88.815 233.267c4.369 11.469 15.7 19.115 28.398 19.115a30.31 30.31 0 0 0 28.468-19.115l62.395-163.908 62.396 163.84c4.437 11.605 15.701 19.183 28.4 19.183a30.31 30.31 0 0 0 28.466-19.115l88.747-233.267a28.945 28.945 0 0 0-17.886-37.547 30.447 30.447 0 0 0-38.912 17.272zm219.478 395.605-51.883-29.218c-28.672-16.18-52.224-3.072-52.224 29.082v.273H643.209a29.833 29.833 0 0 0-30.31 29.354c0 16.18 13.584 29.218 30.31 29.218h151.825c1.092 30.516 24.03 43.077 52.224 27.648l51.063-27.989c29.013-15.906 29.15-42.189.41-58.368"}),n.jsx("path",{fill:"currentColor",d:"m810.667 913.135-.478.068H201.796c-19.865 0-36.727-11.673-36.727-25.6v-618.36h154.965c51.268 0 92.911-39.39 92.911-87.858v-87.86H810.19c19.797 0 36.522 11.742 36.522 25.669V739.26h61.987V119.262c0-46.421-44.169-84.241-98.51-84.241H328.364l-225.28 194.56v658.09c0 46.285 44.236 84.105 98.713 84.105H810.19c43.759 0 80.554-24.713 93.32-58.573h-92.842zM350.89 94.89v86.562c0 16.11-13.858 29.286-30.925 29.286H216.815L350.959 94.891z"})]})}function Dr(){return n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",children:n.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M14 4h4a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1h-4a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1m-9 8h4m-2-2v4"})})}function Br(){return n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",children:n.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M6 4h4a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1m9 8h4m-2-2v4"})})}function $r(){return n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",children:n.jsx("path",{fill:"currentColor",d:"M23.943 19.806a.2.2 0 0 0-.168-.034c-1.26-1.855-2.873-3.61-4.419-5.315l-.252-.284c-.001-.073-.067-.12-.134-.15l-.084-.084c-.05-.1-.169-.167-.286-.1c-.47.234-.907.585-1.327.919c-.554.434-1.109.87-1.63 1.354a5 5 0 0 0-.588.618c-.084.117-.017.217.084.267c-.37.368-.74.736-1.109 1.12a.2.2 0 0 0-.05.134c0 .05.033.1.067.117l.655.502v.016c.924.92 2.554 2.173 4.285 3.527c.251.201.52.402.773.602c.117.134.234.285.335.418c.05.066.169.084.236.033c.033.034.084.067.118.1a.24.24 0 0 0 .1.034a.15.15 0 0 0 .135-.066a.24.24 0 0 0 .033-.1c.017 0 .017.016.034.016a.2.2 0 0 0 .134-.05l3.058-3.327c.12-.116.014-.267 0-.267m-7.628-.134l-1.546-1.17l-.15-.1c-.035-.017-.068-.05-.102-.067l-.117-.1c.66-.66 1.33-1.308 2-1.956c-.488.484-1.463 1.906-1.261 2.373c.002 0 .018.042.067.084zm4.1 3.126l-1.277-.97a27 27 0 0 0-1.58-1.504c.69.518 1.277.97 1.361 1.053c.673.585.638.485 1.093.87l.554.4c-.074.103-.151.148-.151.151m.336.25l-.034-.016a1 1 0 0 0 .152-.117zM.588 3.476c.033.217.084.435.117.636c.201 1.103.403 2.106.772 2.858l.152.568c.05.217.134.485.219.552a67 67 0 0 0 3.578 2.942a.18.18 0 0 0 .219 0s0 .016.016.016a.15.15 0 0 0 .118.05a.2.2 0 0 0 .134-.05c1.798-1.989 3.142-3.627 4.1-4.998c.068-.066.084-.167.084-.25c.067-.067.118-.151.185-.201c.067-.067.067-.184 0-.235l-.017-.016c0-.033-.017-.084-.05-.1c-.42-.401-.722-.685-1.042-.986a94 94 0 0 1-2.352-2.273c-.017-.017-.034-.034-.067-.034c-.336-.117-1.025-.234-1.882-.385c-1.277-.216-3.008-.517-4.57-.986c0 0-.101 0-.118.017l-.05.05C.05.714.022.707 0 .718c.017.1.017.167.05.284c0 .033.068.301.068.334zm7.19 4.78l-.033.034a.036.036 0 0 1 .033-.034M6.553 2.238c.101.1.521.502.622.585c-.437-.2-1.529-.702-2.034-.869c.505.1 1.194.201 1.412.284M.79 1.403c.252.434.454 1.939.655 3.41c-.118-.469-.201-.936-.302-1.372C.992 2.673.84 1.988.638 1.386c.124 0 .152.021.152.017m-.286-.369c0-.016 0-.033-.017-.033c.085 0 .135.017.202.05c0 .006-.145-.017-.185-.017m23.17-.217c.017-.066-.336-.367-.219-.384c.253-.017.253-.401 0-.401c-.335.017-.688.1-1.008.15c-.587.117-1.192.234-1.78.367a80 80 0 0 0-3.949.937c-.403.117-.857.2-1.243.401c-.135.067-.118.2-.05.284c-.034.017-.051.017-.085.034c-.117.017-.218.034-.335.05c-.102.017-.152.1-.135.2c0 .017.017.05.017.067c-.706.936-1.496 1.923-2.353 2.976c-.84.969-1.73 1.989-2.62 3.042c-2.84 3.31-6.05 7.07-9.594 10.38a.16.16 0 0 0 0 .234c.016.016.033.033.05.033c-.05.05-.101.085-.152.134q-.05.05-.05.1a.4.4 0 0 0-.067.084c-.067.067-.067.184.017.234c.067.066.185.066.235-.017c.017-.017.017-.033.033-.033a.265.265 0 0 1 .37 0c.202.217.404.435.588.618l-.42-.35c-.067-.067-.184-.05-.234.016c-.068.066-.051.184.016.234l4.469 3.727c.034.034.067.034.118.034a.15.15 0 0 0 .117-.05l.101-.1c.017.016.05.016.067.016c.05 0 .084-.016.118-.05c6.049-6.05 10.922-10.614 16.5-14.693c.05-.033.067-.1.067-.15c.067 0 .118-.05.15-.117c1.026-3.125 1.228-5.9 1.295-7.27c0-.059.016-.038.016-.068c.017-.033.017-.05.017-.05a.98.98 0 0 0-.067-.619m-10.82 4.915c.268-.301.537-.619.806-.903c-1.73 2.273-4.603 5.767-8.67 9.929c2.773-3.059 5.562-6.218 7.864-9.026M5.14 23.466c-.016-.017-.016-.017 0-.017zm2.504-2.156c.135-.15.27-.284.42-.434c0 0 0 .016.017.016c-.224.198-.433.418-.437.418m.69-.668c.099-.1.14-.173.284-.318c.992-1.02 2.017-2.04 3.059-3.076l.016-.016c.252-.2.555-.418.824-.619a228 228 0 0 0-4.184 4.029M14.852 3.91c-.554.719-1.176 1.671-1.697 2.423c-1.646 2.374-6.94 8.174-7.057 8.274a1190 1190 0 0 1-4.839 4.597l-.1.1c-.085-.1-.085-.25.016-.334C8.652 11.966 13.19 6.133 15.021 3.576c-.05.116-.084.216-.168.334zm2.906 3.427c-.671-.386-.99-.987-.806-1.572l.05-.2a.8.8 0 0 1 .085-.167a1.9 1.9 0 0 1 .756-.703c.016 0 .033 0 .05-.016c-.017-.034-.017-.084-.017-.134c.017-.1.085-.167.202-.167c.202 0 .824.184 1.059.384c.067.05.134.117.202.184c.084.1.218.268.285.401c.034.017.067.184.118.268c.033.134.067.284.05.418c-.017.016 0 .116-.017.116a1.6 1.6 0 0 1-.218.619c-.03.03.006.012-.05.067a1.2 1.2 0 0 1-.32.334a1.49 1.49 0 0 1-1.26.234a2 2 0 0 0-.169-.066m4.37 1.403c0 .017-.017.05 0 .067c-.034 0-.05.017-.085.034a110 110 0 0 0-3.915 3.025c1.11-.986 2.218-1.989 3.378-2.975c.336-.301.571-.686.638-1.12l.168-1.003v-.033c.085-.201.404-.118.353.1c-.004-.001-.173.795-.537 1.905"})})}function Fr(){return n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",children:n.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 21v-4m0-4V9m0-4V3m-2 18h4M8 5v4h11l2-2l-2-2zm6 8v4H6l-2-2l2-2z"})})}function Vr(){return n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 20 20",children:n.jsx("path",{fill:"currentColor",d:"M6.5 3a.75.75 0 0 1 .697.471l3 7.5a.75.75 0 0 1-1.393.557L7.992 9.5H5.008l-.811 2.028a.75.75 0 0 1-1.393-.556l3-7.5A.75.75 0 0 1 6.5 3m0 2.77L5.608 8h1.784zm8.28-1.55a.75.75 0 1 0-1.06 1.06l.72.72h-3.69a.75.75 0 0 0 0 1.5h3.69l-.72.72a.75.75 0 0 0 1.06 1.06l2-2a.75.75 0 0 0 0-1.06zm0 7.5a.75.75 0 1 0-1.06 1.06l.72.72H3.75a.75.75 0 0 0 0 1.5h10.69l-.72.72a.75.75 0 1 0 1.06 1.06l2-2a.75.75 0 0 0 0-1.06z"})})}function Ur(){return n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 20 20",children:n.jsx("path",{fill:"currentColor",d:"M13.5 3a.75.75 0 0 0-.697.471l-3 7.5a.75.75 0 0 0 1.393.557l.812-2.028h2.984l.811 2.028a.75.75 0 0 0 1.393-.556l-3-7.5A.75.75 0 0 0 13.5 3m0 2.77L14.392 8h-1.784zM5.22 4.22a.75.75 0 0 1 1.06 1.06L5.56 6h3.69a.75.75 0 0 1 0 1.5H5.56l.72.72a.75.75 0 0 1-1.06 1.06l-2-2a.75.75 0 0 1 0-1.06zm0 7.5a.75.75 0 0 1 1.06 1.06l-.72.72h10.69a.75.75 0 0 1 0 1.5H5.56l.72.72a.75.75 0 1 1-1.06 1.06l-2-2a.75.75 0 0 1 0-1.06z"})})}function Wr(){return n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",children:n.jsxs("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",color:"currentColor",children:[n.jsx("path",{d:"M14.86 22h-4.312c-3.291 0-4.937 0-6.08-.798a4.2 4.2 0 0 1-.863-.805c-.855-1.066-.855-2.6-.855-5.67v-2.545c0-2.963 0-4.445.473-5.628c.761-1.903 2.37-3.403 4.41-4.113C8.9 2 10.49 2 13.667 2c1.816 0 2.723 0 3.448.252c1.166.406 2.085 1.263 2.52 2.35c.27.676.27 1.523.27 3.216V10"}),n.jsx("path",{d:"M2.75 12c0-1.84 1.506-3.333 3.364-3.333c.672 0 1.464.116 2.117-.057a1.67 1.67 0 0 0 1.19-1.179c.174-.647.057-1.432.057-2.098C9.478 3.493 10.984 2 12.84 2m.002 16h2.523m-4.949-4.15c-.126-.8-.281-.801-1.61-.85h-1.01c-.557 0-1.009.448-1.009 1v3c0 .552.452 1 1.01 1h1.816c.39 0 .803-.313.803-.7v-1.1c0-.11-.113-.304-.224-.304H9.068M12.842 13h1.261m0 0h1.262m-1.262 0v4.875M21.251 13h-2.523c-.557 0-1.009.448-1.009 1v1.5m0 0V18m0-2.5h2.523"})]})})}function qr(){return n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 48 48",children:n.jsxs("g",{fill:"none",stroke:"currentColor",strokeWidth:"4",children:[n.jsx("circle",{cx:"10",cy:"24",r:"4"}),n.jsx("circle",{cx:"38",cy:"10",r:"4"}),n.jsx("circle",{cx:"38",cy:"24",r:"4"}),n.jsx("circle",{cx:"38",cy:"38",r:"4"}),n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M34 38H22V10h12M14 24h20"})]})})}const Ke={Bold:_.Bold,LoaderCircle:_.LoaderCircle,Italic:_.Italic,Underline:_.Underline,Quote:_.Quote,TextQuote:Lr,Strikethrough:_.Strikethrough,Minus:_.Minus,Eraser:_.Eraser,PaintRoller:_.PaintRoller,Redo2:_.Redo2,Undo2:_.Undo2,AlignCenter:Ze.TextAlignCenterIcon,AlignJustify:Ze.TextAlignJustifyIcon,AlignLeft:Ze.TextAlignLeftIcon,AlignRight:Ze.TextAlignRightIcon,ChevronDown:_.ChevronDown,Subscript:_.Subscript,Superscript:_.Superscript,Code:_.Code,Code2:_.CodeXml,Type:_.Type,IndentIncrease:_.IndentIncrease,IndentDecrease:_.IndentDecrease,List:_.List,ListOrdered:_.ListOrdered,ListTodo:_.ListTodo,Link:_.Link,ImageUp:_.ImageUp,Video:_.Video,Maximize:_.Maximize,Minimize:_.Minimize,Table:_.Table,Sparkles:_.Sparkles,Pencil:_.Pencil,Unlink:_.Unlink,BetweenHorizonalEnd:_.BetweenHorizonalEnd,BetweenHorizonalStart:_.BetweenHorizonalStart,BetweenVerticalStart:_.BetweenVerticalStart,BetweenVerticalEnd:_.BetweenVerticalEnd,TableCellsMerge:_.TableCellsMerge,TableCellsSplit:_.TableCellsSplit,Trash2:_.Trash2,Trash:_.Trash,Replace:_.Replace,ChevronsUpDown:_.ChevronsUpDown,LineHeight:Rr,Word:Ir,Heading1:_.Heading1,Heading2:_.Heading2,Heading3:_.Heading3,Heading4:_.Heading4,Heading5:_.Heading5,Heading6:_.Heading6,Columns2:_.Columns2,Columns3:_.Columns3,Columns4:_.Columns4,Plus:_.Plus,Grip:_.GripVertical,Copy:_.Copy,Clipboard:_.Clipboard,PanelLeft:_.PanelLeft,PanelRight:_.PanelRight,Columns:_.Columns2,Iframe:_.Frame,MenuDown:Rn,SizeS:Or,SizeM:zr,SizeL:Hr,AspectRatio:Ar,Emoji:_.SmilePlus,DeleteColumn:Mr,DeleteRow:Er,SearchAndReplace:_.Replace,EmojiIcon:_.SmilePlusIcon,KatexIcon:_.Sigma,ExportPdf:Hn,ExportWord:zn,ImportWord:Pr,ColumnAddLeft:Dr,ColumnAddRight:Br,BookMarked:_.BookMarked,Excalidraw:$r,ZoomIn:_.ZoomIn,ZoomOut:_.ZoomOut,Settings:_.Settings,Eye:_.Eye,TextDirection:Fr,LeftToRight:Vr,RightToLeft:Ur,Attachment:_.Paperclip,GifIcon:Wr,ChevronUp:_.ChevronUp,Crop:_.CropIcon,Mermaid:qr};function Gr(e){const t=["size-small","size-medium","size-large"],i=["SizeS","SizeM","SizeL"];return t.map((r,a)=>({type:`image-${r}`,component:j,componentProps:{tooltip:b.localeActions.t(`editor.${r.replace("-",".")}.tooltip`),icon:i[a],action:()=>e.commands.updateImage({width:b.IMAGE_SIZE[r]}),isActive:()=>e.isActive("image",{width:b.IMAGE_SIZE[r]})}}))}function Kr(e){const t=["size-small","size-medium","size-large"],i=["SizeS","SizeM","SizeL"];return t.map((r,a)=>({type:`image-${r}`,component:j,componentProps:{tooltip:b.localeActions.t(`editor.${r.replace("-",".")}.tooltip`),icon:i[a],action:()=>e.commands.updateImageGif({width:b.IMAGE_SIZE[r]}),isActive:()=>e.isActive("image",{width:b.IMAGE_SIZE[r]})}}))}function Zr(e){const t=["left","center","right"],i={left:"AlignLeft",center:"AlignCenter",right:"AlignRight"};return t.map(r=>({type:`image-${r}`,component:j,componentProps:{tooltip:b.localeActions.t(`editor.textalign.${r}.tooltip`),icon:i[r],action:()=>{var a,o;return(o=(a=e.commands)==null?void 0:a.setAlignImage)==null?void 0:o.call(a,r)},isActive:()=>e.isActive({align:r})||!1,disabled:!1}}))}function Xr(e){const t=["left","center","right"],i={left:"AlignLeft",center:"AlignCenter",right:"AlignRight"};return t.map(r=>({type:`image-${r}`,component:j,componentProps:{tooltip:b.localeActions.t(`editor.textalign.${r}.tooltip`),icon:i[r],action:()=>{var a,o;return(o=(a=e.commands)==null?void 0:a.setAlignImageGif)==null?void 0:o.call(a,r)},isActive:()=>e.isActive({align:r})||!1,disabled:!1}}))}function Jr(e){const t=["left","center","right"],i={left:"AlignLeft",center:"AlignCenter",right:"AlignRight"};return t.map(r=>({type:`image-${r}`,component:j,componentProps:{tooltip:b.localeActions.t(`editor.textalign.${r}.tooltip`),icon:i[r],action:()=>{var a,o;return(o=(a=e.commands)==null?void 0:a.setAlignImageMermaid)==null?void 0:o.call(a,r)},isActive:()=>e.isActive({align:r})||!1,disabled:!1}}))}function Yr(e){const t=["size-small","size-medium","size-large"],i=["SizeS","SizeM","SizeL"];return t.map((r,a)=>({type:`video-${r}`,component:j,componentProps:{tooltip:b.localeActions.t(`editor.${r.replace("-",".")}.tooltip`),icon:i[a],action:()=>e.commands.updateVideo({width:b.VIDEO_SIZE[r]}),isActive:()=>e.isActive("video",{width:b.VIDEO_SIZE[r]})}}))}function Qr(e){return[...Gr(e),...Zr(e),{type:"remove",component:j,componentProps:{editor:e,tooltip:b.localeActions.t("editor.remove"),icon:"Trash2",action:()=>{const{state:t,dispatch:i}=e.view;v.deleteSelection(t,i)}}}]}function ea(e){return[...Kr(e),...Xr(e),{type:"remove",component:j,componentProps:{editor:e,tooltip:b.localeActions.t("editor.remove"),icon:"Trash2",action:()=>{const{state:t,dispatch:i}=e.view;v.deleteSelection(t,i)}}}]}function ta(e){return[...Jr(e),{type:"edit",component:j,componentProps:{editor:e,tooltip:b.localeActions.t("editor.edit"),icon:"Pencil",action:()=>{}}},{type:"remove",component:j,componentProps:{editor:e,tooltip:b.localeActions.t("editor.remove"),icon:"Trash2",action:()=>{const{state:t,dispatch:i}=e.view;v.deleteSelection(t,i)}}}]}function na(e){return[...Yr(e),{type:"remove",component:j,componentProps:{editor:e,tooltip:b.localeActions.t("editor.remove"),icon:"Trash2",action:()=>{const{state:t,dispatch:i}=e.view;v.deleteSelection(t,i)}}}]}function ia(e,t){return b.BUBBLE_TEXT_LIST.reduce((i,r)=>{if(r==="divider"&&i.length>0)return[...i,{type:"divider",component:void 0,componentProps:{}}];const a=e.extensionManager.extensions.find(o=>o.name===r);return a?[...i,a.configure().options.button({editor:e,t,extension:a})]:i},[])}var pe=(e=>(e[e.max=7]="max",e[e.min=0]="min",e[e.more=1]="more",e[e.less=-1]="less",e))(pe||{});function ra(e,t,i){return e<t?t:e>i?i:e}function aa(e,t,i,r){const{doc:a,selection:o}=e;if(!a||!o||!(o instanceof v.TextSelection||o instanceof v.AllSelection))return e;const{from:s,to:c}=o;return a.nodesBetween(s,c,(u,d)=>{const h=u.type;return i.includes(h.name)?(e=Ct(e,d,t),!1):!f.isList(u.type.name,r.extensionManager.extensions)}),e}function Ct(e,t,i){if(!e.doc)return e;const r=e.doc.nodeAt(t);if(!r)return e;const s=ra((r.attrs.indent||0)+i,0,7);if(s===r.attrs.indent)return e;const c={...r.attrs,indent:s};return e.setNodeMarkup(t,r.type,c,r.marks)}function Qt({delta:e,types:t}){return({state:i,dispatch:r,editor:a})=>{const{selection:o}=i;let{tr:s}=i;return s=s.setSelection(o),s=aa(s,e,t,a),s.docChanged?(r&&r(s),!0):!1}}function oa(e){var M,L,A;const{pluginKey:t=f.dragHandlePluginDefaultKey}=e,{t:i}=b.useLocale(),[r,a]=l.useState(null),[o,s]=l.useState(-1),c=l.useRef(null),u=l.useRef(null),[d,h]=l.useState(!1),m=e.editor.extensionManager.extensions.some(N=>N.name==="textAlign"),x=e.editor.extensionManager.extensions.some(N=>N.name==="indent"),g=e.editor.extensionManager.extensions.some(N=>N.name==="clear");l.useEffect(()=>{c.current&&!e.editor.isDestroyed&&(u.current=f.DragHandlePlugin({editor:e.editor,element:c.current,pluginKey:"ContentItemMenu",tippyOptions:{offset:[-2,16],zIndex:99,moveTransition:"transform 0.15s ease-out"},onNodeChange:T}),e.editor.registerPlugin(u.current))},[e.editor,c]);function p(){const N=e.editor.chain();N.setNodeSelection(o).unsetAllMarks(),(r==null?void 0:r.type.name)!=="paragraph"&&N.setParagraph(),N.run()}function w(){e.editor.chain().focus().setNodeSelection(o).run(),document.execCommand("copy")}function S(){e.editor.commands.setNodeSelection(o);const{$anchor:N}=e.editor.state.selection,D=N.node(1)||e.editor.state.selection.node;e.editor.chain().setMeta("hideDragHandle",!0).insertContentAt(o+((r==null?void 0:r.nodeSize)||0),D.toJSON()).run()}function I(N){e.editor.commands.setTextAlign(N)}function k(){const N=Ct(e.editor.state.tr,o,1);N.setMeta("hideDragHandle",!0),e.editor.view.dispatch&&e.editor.view.dispatch(N)}function y(){const N=Ct(e.editor.state.tr,o,-1);e.editor.view.dispatch&&e.editor.view.dispatch(N)}function C(){e.editor.chain().setMeta("hideDragHandle",!0).setNodeSelection(o).deleteSelection().run()}function T(N){N.node&&a(N.node),s(N.pos)}function E(){var N;if(o!==-1){const D=(r==null?void 0:r.nodeSize)||0,z=o+D,R=(r==null?void 0:r.type.name)==="paragraph"&&((N=r==null?void 0:r.content)==null?void 0:N.size)===0,H=R?o+2:z+2;e.editor.chain().command(({dispatch:U,tr:K,state:oe})=>U?(R?K.insertText("/",o,o+1):K.insert(z,oe.schema.nodes.paragraph.create(null,[oe.schema.text("/")])),U(K)):!0).focus(H).run()}}l.useEffect(()=>(d?e.editor.commands.setMeta("lockDragHandle",!0):e.editor.commands.setMeta("lockDragHandle",!1),()=>{e.editor.commands.setMeta("lockDragHandle",!1)}),[d]),l.useEffect(()=>()=>{u.current&&(e.editor.unregisterPlugin(t),u.current=null)},[]),l.useEffect(()=>{var N;(N=e.editor)!=null&&N.isDestroyed&&u.current&&(e.editor.unregisterPlugin(t),u.current=null)},[(M=e.editor)==null?void 0:M.isDestroyed]);const O=N=>{e!=null&&e.disabled||h(N)};return n.jsx("div",{className:`drag-handle [transition-property:top,_left] richtext-ease-in-out richtext-duration-200 ${e==null?void 0:e.className}`,style:{opacity:e!=null&&e.disabled?0:1},ref:c,children:n.jsxs("div",{className:"richtext-flex richtext-items-center richtext-gap-0.5 [transition-property:top,_left] richtext-ease-in-out richtext-duration-200",children:[n.jsx(F,{variant:"ghost",size:"icon",className:"richtext-w-7 richtext-h-7 richtext-cursor-grab",disabled:e==null?void 0:e.disabled,onClick:E,type:"button",children:n.jsx($,{name:"Plus",className:"richtext-text-lg richtext-text-neutral-600 dark:richtext-text-neutral-200"})}),n.jsxs(le,{open:d,onOpenChange:O,children:[n.jsxs("div",{className:"richtext-relative richtext-flex richtext-flex-col",children:[n.jsxs(Re,{children:[n.jsx(He,{asChild:!0,disabled:e==null?void 0:e.disabled,children:n.jsx(F,{variant:"ghost",size:"icon",className:"richtext-w-7 richtext-h-7 richtext-cursor-grab richtext-relative richtext-z-[1]",disabled:e==null?void 0:e.disabled,onMouseUp:N=>{N.preventDefault(),!(e!=null&&e.disabled)&&h(!0)},type:"button",children:n.jsx($,{name:"Grip",className:"richtext-text-sm dark:richtext-text-neutral-200 richtext-text-neutral-600"})})}),n.jsx(ye,{children:i("editor.draghandle.tooltip")})]}),n.jsx(de,{className:"richtext-absolute richtext-top-0 richtext-left-0 richtext-w-[28px] richtext-h-[28px] richtext-z-0"})]}),n.jsxs(ce,{className:"richtext-w-48",align:"start",side:"bottom",sideOffset:0,children:[n.jsxs(ee,{onClick:C,className:"richtext-flex richtext-gap-3 focus:richtext-text-red-500 focus:richtext-bg-red-400 hover:richtext-bg-red-400 dark:hover:richtext-text-red-500 richtext-bg-opacity-10 hover:richtext-bg-opacity-20 focus:richtext-bg-opacity-30 dark:hover:richtext-bg-opacity-20",children:[n.jsx($,{name:"Trash2"}),n.jsx("span",{children:i("editor.remove")})]}),g?n.jsxs(ee,{className:"richtext-flex richtext-gap-3",onClick:p,children:[n.jsx($,{name:"PaintRoller"}),n.jsx("span",{children:i("editor.clear.tooltip")})]}):null,n.jsxs(ee,{className:"richtext-flex richtext-gap-3",onClick:w,children:[n.jsx($,{name:"Clipboard"}),n.jsx("span",{children:i("editor.copyToClipboard")})]}),n.jsxs(ee,{className:"richtext-flex richtext-gap-3",onClick:S,children:[n.jsx($,{name:"Copy"}),n.jsx("span",{children:i("editor.copy")})]}),m||x?n.jsx(at,{}):null,m?n.jsxs(Ut,{children:[n.jsxs(_t,{className:"richtext-flex richtext-gap-3",children:[n.jsx($,{name:"AlignCenter"}),n.jsx("span",{children:i("editor.textalign.tooltip")})]}),n.jsx(Vt,{children:n.jsxs(wt,{children:[n.jsxs(ee,{className:"richtext-flex richtext-gap-3",onClick:()=>I("left"),children:[n.jsx($,{name:"AlignLeft"}),n.jsx("span",{children:i("editor.textalign.left.tooltip")})]}),n.jsxs(ee,{className:"richtext-flex richtext-gap-3",onClick:()=>I("center"),children:[n.jsx($,{name:"AlignCenter"}),n.jsx("span",{children:i("editor.textalign.center.tooltip")})]}),n.jsxs(ee,{className:"richtext-flex richtext-gap-3",onClick:()=>I("right"),children:[n.jsx($,{name:"AlignRight"}),n.jsx("span",{children:i("editor.textalign.right.tooltip")})]})]})})]}):null,x?n.jsxs(Ut,{children:[n.jsxs(_t,{className:"richtext-flex richtext-gap-3",children:[n.jsx($,{name:"IndentIncrease"}),n.jsx("span",{children:i("editor.indent")})]}),n.jsx(Vt,{children:n.jsxs(wt,{children:[n.jsxs(ee,{className:"richtext-flex richtext-gap-3",onClick:k,disabled:((L=r==null?void 0:r.attrs)==null?void 0:L.indent)>=pe.max,children:[n.jsx($,{name:"IndentIncrease"}),n.jsx("span",{children:i("editor.indent.tooltip")})]}),n.jsxs(ee,{className:"richtext-flex richtext-gap-3",onClick:y,disabled:((A=r==null?void 0:r.attrs)==null?void 0:A.indent)<=pe.min,children:[n.jsx($,{name:"IndentDecrease"}),n.jsx("span",{children:i("editor.outdent.tooltip")})]})]})})]}):null]})]})]})})}const sa={maxWidth:"auto",zIndex:20,appendTo:"parent",moveTransition:"transform 0.1s ease-out"};function ca({item:e,disabled:t,editor:i}){var a;const r=e.component;return r?n.jsx(r,{...e.componentProps,editor:i,disabled:t||((a=e==null?void 0:e.componentProps)==null?void 0:a.disabled)}):n.jsx(n.Fragment,{})}function la(e){const{t,lang:i}=b.useLocale(),r=({editor:o})=>{const{selection:s}=o.view.state,{$from:c,to:u}=s;return c.pos===u?!1:s instanceof v.TextSelection},a=l.useMemo(()=>e.disabled||!(e!=null&&e.editor)?[]:ia(e.editor,t),[e.disabled,e.editor,i,t]);return n.jsx(f.BubbleMenu,{shouldShow:r,editor:e==null?void 0:e.editor,tippyOptions:sa,children:a!=null&&a.length?n.jsx("div",{className:"richtext-w-auto richtext-px-3 richtext-py-2 richtext-transition-all !richtext-border richtext-rounded-sm richtext-shadow-sm richtext-pointer-events-auto richtext-select-none richtext-border-neutral-200 dark:richtext-border-neutral-800 richtext-bg-background",children:n.jsx("div",{className:"richtext-flex richtext-items-center richtext-gap-[4px] richtext-flex-nowrap richtext-whitespace-nowrap richtext-h-[26px] richtext-justify-start richtext-relative",children:a==null?void 0:a.map((o,s)=>(o==null?void 0:o.type)==="divider"?n.jsx(te,{orientation:"vertical",className:"!richtext-mx-1 !richtext-my-2 !richtext-h-[16px]"},`bubbleMenu-divider-${s}`):n.jsx(ca,{item:o,disabled:e.disabled,editor:e.editor},`bubbleMenu-text-${s}`))})}):n.jsx(n.Fragment,{})})}function da({fill:e}){return n.jsx("svg",{width:"18px",height:"18px",viewBox:"0 0 256 256",version:"1.1",xmlns:"http://www.w3.org/2000/svg",children:n.jsx("g",{id:"icon/填充色",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",children:n.jsxs("g",{id:"icon/背景颜色",children:[n.jsx("g",{id:"编组",fill:"currentColor",children:n.jsxs("g",{transform:"translate(119.502295, 137.878331) rotate(-135.000000) translate(-119.502295, -137.878331) translate(48.002295, 31.757731)",id:"矩形",children:[n.jsx("path",{d:"M100.946943,60.8084699 L43.7469427,60.8084699 C37.2852111,60.8084699 32.0469427,66.0467383 32.0469427,72.5084699 L32.0469427,118.70847 C32.0469427,125.170201 37.2852111,130.40847 43.7469427,130.40847 L100.946943,130.40847 C107.408674,130.40847 112.646943,125.170201 112.646943,118.70847 L112.646943,72.5084699 C112.646943,66.0467383 107.408674,60.8084699 100.946943,60.8084699 Z M93.646,79.808 L93.646,111.408 L51.046,111.408 L51.046,79.808 L93.646,79.808 Z",fillRule:"nonzero"}),n.jsx("path",{d:"M87.9366521,16.90916 L87.9194966,68.2000001 C87.9183543,69.4147389 86.9334998,70.399264 85.7187607,70.4 L56.9423078,70.4 C55.7272813,70.4 54.7423078,69.4150264 54.7423078,68.2 L54.7423078,39.4621057 C54.7423078,37.2523513 55.5736632,35.1234748 57.0711706,33.4985176 L76.4832996,12.4342613 C78.9534987,9.75382857 83.1289108,9.5834005 85.8093436,12.0535996 C87.1658473,13.303709 87.9372691,15.0644715 87.9366521,16.90916 Z",fillRule:"evenodd"}),n.jsx("path",{d:"M131.3,111.241199 L11.7,111.241199 C5.23826843,111.241199 0,116.479467 0,122.941199 L0,200.541199 C0,207.002931 5.23826843,212.241199 11.7,212.241199 L131.3,212.241199 C137.761732,212.241199 143,207.002931 143,200.541199 L143,122.941199 C143,116.479467 137.761732,111.241199 131.3,111.241199 Z M124,130.241 L124,193.241 L19,193.241 L19,130.241 L124,130.241 Z",fillRule:"nonzero"})]})}),n.jsx("path",{d:"M51,218 L205,218 C211.075132,218 216,222.924868 216,229 C216,235.075132 211.075132,240 205,240 L51,240 C44.9248678,240 40,235.075132 40,229 C40,222.924868 44.9248678,218 51,218 Z",id:"矩形",fill:e||"#FBDE28"})]})})})}function On(e){const[t,i]=l.useState(void 0);function r(s){var c;(c=e.action)==null||c.call(e,s)}function a(){var s;(s=e.action)==null||s.call(e,t)}const o=l.useCallback(v.debounce(s=>{i(s)},350),[]);return n.jsxs("div",{className:"richtext-flex richtext-items-center richtext-h-[32px]",children:[n.jsx(j,{tooltip:e==null?void 0:e.tooltip,disabled:e==null?void 0:e.disabled,action:a,tooltipOptions:e==null?void 0:e.tooltipOptions,shortcutKeys:e==null?void 0:e.shortcutKeys,children:n.jsx("span",{className:"richtext-flex richtext-items-center richtext-justify-center richtext-text-sm",children:n.jsx(da,{fill:t})})}),n.jsx(Tn,{selectedColor:t,setSelectedColor:o,onChange:r,highlight:!0,disabled:e==null?void 0:e.disabled,children:n.jsx(F,{variant:"ghost",size:"icon",className:"!richtext-w-3 !richtext-h-[32px]",disabled:e==null?void 0:e.disabled,children:n.jsx($,{className:"!richtext-w-3 !richtext-h-3 richtext-text-zinc-500",name:"MenuDown"})})})]})}function ha({editor:e}){var p,w,S,I,k,y,C,T,E,O,M,L,A,N,D,z,R,H;const t=({editor:U})=>f.isActive(U.view.state,"table"),{t:i}=b.useLocale();function r(){e.chain().focus().addColumnBefore().run()}function a(){e.chain().focus().addColumnAfter().run()}function o(){e.chain().focus().deleteColumn().run()}function s(){e.chain().focus().addRowBefore().run()}function c(){e.chain().focus().addRowAfter().run()}function u(){e.chain().focus().deleteRow().run()}function d(){e.chain().focus().mergeCells().run()}function h(){e==null||e.chain().focus().splitCell().run()}function m(){e.chain().focus().deleteTable().run()}function x(U){e.chain().focus().setTableCellBackground(U).run()}const g=()=>{var $t;const{view:U,state:{selection:{from:K}}}=e,oe=U.domAtPos(K).node;if(!oe)return new DOMRect(-1e3,-1e3,0,0);const Bt=($t=oe==null?void 0:oe.closest)==null?void 0:$t.call(oe,".tableWrapper");return Bt?Bt.getBoundingClientRect():new DOMRect(-1e3,-1e3,0,0)};return n.jsx(f.BubbleMenu,{editor:e,pluginKey:"table",shouldShow:t,updateDelay:0,tippyOptions:{offset:[0,8],popperOptions:{modifiers:[{name:"flip",enabled:!1}]},maxWidth:"auto",getReferenceClientRect:g,plugins:[nt.sticky],sticky:"popper"},children:n.jsxs("div",{className:"richtext-min-w-32 richtext-flex richtext-flex-row richtext-h-full richtext-items-center richtext-leading-none richtext-gap-0.5 richtext-p-2 richtext-w-full richtext-bg-background richtext-rounded-lg richtext-shadow-sm !richtext-border richtext-border-border",children:[n.jsx(j,{icon:"BetweenHorizonalEnd",tooltip:i("editor.table.menu.insertColumnBefore"),action:r,"tooltip-options":{sideOffset:15},disabled:!((w=(p=e==null?void 0:e.can())==null?void 0:p.addColumnBefore)!=null&&w.call(p))}),n.jsx(j,{icon:"BetweenHorizonalStart",tooltip:i("editor.table.menu.insertColumnAfter"),action:a,"tooltip-options":{sideOffset:15},disabled:!((I=(S=e==null?void 0:e.can())==null?void 0:S.addColumnAfter)!=null&&I.call(S))}),n.jsx(j,{icon:"DeleteColumn",action:o,tooltip:i("editor.table.menu.deleteColumn"),"tooltip-options":{sideOffset:15},disabled:!((y=e==null?void 0:(k=e.can()).deleteColumn)!=null&&y.call(k))}),n.jsx(te,{orientation:"vertical",className:"!richtext-mx-1 !richtext-my-2 !richtext-h-[16px]"}),n.jsx(j,{icon:"BetweenVerticalEnd",action:s,tooltip:i("editor.table.menu.insertRowAbove"),"tooltip-options":{sideOffset:15},disabled:!((T=e==null?void 0:(C=e.can()).addRowBefore)!=null&&T.call(C))}),n.jsx(j,{icon:"BetweenVerticalStart",action:c,tooltip:i("editor.table.menu.insertRowBelow"),"tooltip-options":{sideOffset:15},disabled:!((O=(E=e==null?void 0:e.can())==null?void 0:E.addRowAfter)!=null&&O.call(E))}),n.jsx(j,{icon:"DeleteRow",action:u,tooltip:i("editor.table.menu.deleteRow"),"tooltip-options":{sideOffset:15},disabled:!((L=(M=e==null?void 0:e.can())==null?void 0:M.deleteRow)!=null&&L.call(M))}),n.jsx(te,{orientation:"vertical",className:"!richtext-mx-1 !richtext-my-2 !richtext-h-[16px]"}),n.jsx(j,{icon:"TableCellsMerge",action:d,tooltip:i("editor.table.menu.mergeCells"),"tooltip-options":{sideOffset:15},disabled:!((N=(A=e==null?void 0:e.can())==null?void 0:A.mergeCells)!=null&&N.call(A))}),n.jsx(j,{icon:"TableCellsSplit",action:h,tooltip:i("editor.table.menu.splitCells"),"tooltip-options":{sideOffset:15},disabled:!((z=(D=e==null?void 0:e.can())==null?void 0:D.splitCell)!=null&&z.call(D))}),n.jsx(te,{orientation:"vertical",className:"!richtext-mx-1 !richtext-my-2 !richtext-h-[16px]"}),n.jsx(On,{editor:e,tooltip:i("editor.table.menu.setCellsBgColor"),action:x,tooltipOptions:{sideOffset:15}}),n.jsx(j,{icon:"Trash2",tooltip:i("editor.table.menu.deleteTable"),action:m,"tooltip-options":{sideOffset:15},disabled:!((H=(R=e==null?void 0:e.can())==null?void 0:R.deleteTable)!=null&&H.call(R))})]})})}function Pn(e){const{t}=b.useLocale(),[i,r]=l.useState({text:"",link:""}),[a,o]=l.useState(!1);l.useEffect(()=>{var c;if(e!=null&&e.editor){const{href:u,target:d}=(c=e.editor)==null?void 0:c.getAttributes("link"),{from:h,to:m}=e.editor.state.selection,x=e.editor.state.doc.textBetween(h,m," ");r({link:u,text:x}),o(d==="_blank")}},[e==null?void 0:e.editor]);function s(c){c.preventDefault(),e==null||e.onSetLink(i.link,i.text,a)}return n.jsx("div",{className:"richtext-p-2 richtext-bg-white !richtext-border richtext-rounded-lg richtext-shadow-sm dark:richtext-bg-black border-neutral-200 dark:richtext-border-neutral-800",children:n.jsxs("form",{className:"richtext-flex richtext-flex-col richtext-gap-2",onSubmit:s,children:[n.jsx(X,{className:"mb-[6px]",children:t("editor.link.dialog.text")}),n.jsx("div",{className:"richtext-flex richtext-w-full richtext-max-w-sm richtext-items-center richtext-gap-1.5 richtext-mb-[10px]",children:n.jsx("div",{className:"richtext-relative richtext-items-center richtext-w-full richtext-max-w-sm",children:n.jsx(Z,{type:"text",value:i.text,required:!0,className:"richtext-w-80",placeholder:"Text",onChange:c=>r({...i,text:c.target.value})})})}),n.jsx(X,{className:"mb-[6px]",children:t("editor.link.dialog.link")}),n.jsx("div",{className:"richtext-flex richtext-w-full richtext-max-w-sm richtext-items-center richtext-gap-1.5",children:n.jsxs("div",{className:"richtext-relative richtext-items-center richtext-w-full richtext-max-w-sm",children:[n.jsx(Z,{type:"url",value:i.link,required:!0,className:"richtext-pl-10",onChange:c=>r({...i,link:c.target.value})}),n.jsx("span",{className:"richtext-absolute richtext-inset-y-0 richtext-flex richtext-items-center richtext-justify-center richtext-px-2 richtext-start-0",children:n.jsx($,{className:"richtext-size-5 richtext-text-muted-foreground",name:"Link"})})]})}),n.jsxs("div",{className:"richtext-flex richtext-items-center richtext-space-x-2",children:[n.jsx(X,{children:t("editor.link.dialog.openInNewTab")}),n.jsx(Et,{checked:a,onCheckedChange:c=>{o(c)}})]}),n.jsx(F,{type:"submit",className:"richtext-self-end richtext-mt-2",children:t("editor.link.dialog.button.apply")})]})})}function ua(e){const{t}=b.useLocale();return n.jsxs("div",{className:"richtext-flex richtext-items-center richtext-gap-2 richtext-p-2 richtext-bg-white !richtext-border richtext-rounded-lg richtext-shadow-sm dark:richtext-bg-black richtext-border-neutral-200 dark:richtext-border-neutral-800",children:[n.jsx("a",{href:e==null?void 0:e.link,target:"_blank",rel:"noopener noreferrer",className:"richtext-text-sm richtext-underline richtext-break-all",children:v.truncate(e==null?void 0:e.link,{length:50,omission:"…"})}),(e==null?void 0:e.link)&&n.jsx(te,{orientation:"vertical",className:"!richtext-h-4"}),n.jsxs("div",{className:"richtext-flex richtext-flex-nowrap",children:[n.jsx(j,{icon:"Pencil",tooltip:t("editor.link.edit.tooltip"),action:()=>{e==null||e.onEdit()},tooltipOptions:{sideOffset:15}}),n.jsx(j,{icon:"Unlink",tooltip:t("editor.link.unlink.tooltip"),action:()=>{e==null||e.onClear()},tooltipOptions:{sideOffset:15}})]})]})}function ma({editor:e,disabled:t}){const[i,r]=l.useState(!1),a=l.useMemo(()=>{const{href:u}=e.getAttributes("link");return u},[e]),o=l.useCallback(({editor:u})=>u.isActive("link"),[]),s=(u,d,h)=>{e.chain().extendMarkRange("link").insertContent({type:"text",text:d,marks:[{type:"link",attrs:{href:u,target:h?"_blank":""}}]}).setLink({href:u}).focus().run(),r(!1)},c=l.useCallback(()=>{e.chain().extendMarkRange("link").unsetLink().focus().run(),r(!1)},[e]);return n.jsx(n.Fragment,{children:n.jsx(f.BubbleMenu,{editor:e,shouldShow:o,tippyOptions:{popperOptions:{modifiers:[{name:"flip",enabled:!1}]},placement:"bottom-start",offset:[-2,16],zIndex:9999,onHidden:()=>{r(!1)}},children:t?n.jsx(n.Fragment,{}):n.jsx(n.Fragment,{children:i?n.jsx(Pn,{onSetLink:s,editor:e}):n.jsx(ua,{editor:e,onClear:c,onEdit:()=>{r(!0)},link:a})})})})}const Ot={maxWidth:"auto",zIndex:20,appendTo:"parent",moveTransition:"transform 0.1s ease-out"};function Pt({item:e,disabled:t,editor:i}){var a;const r=e.component;return r?n.jsx(l.Fragment,{children:e.type==="divider"?n.jsx(te,{orientation:"vertical",className:"!richtext-mx-1 !richtext-my-2 !richtext-h-[16px]"}):n.jsx(r,{...e.componentProps,editor:i,disabled:t||((a=e==null?void 0:e.componentProps)==null?void 0:a.disabled)})}):n.jsx(n.Fragment,{})}function xa(e){return e.type.name==="image"}function fa(e){return e.type.name===Dt.name}function ga(e){return e.type.name==="video"}function ba(e){const{lang:t}=b.useLocale(),i=({editor:a})=>{const{selection:o}=a.view.state,{$from:s,to:c}=o;let u=!1;return a.view.state.doc.nodesBetween(s.pos,c,d=>{if(xa(d))return u=!0,!1}),u},r=l.useMemo(()=>e.disabled?[]:Qr(e.editor),[e.disabled,e.editor,t]);return n.jsx(n.Fragment,{children:n.jsx(f.BubbleMenu,{shouldShow:i,editor:e==null?void 0:e.editor,tippyOptions:Ot,children:r!=null&&r.length?n.jsx("div",{className:"richtext-w-auto richtext-px-3 richtext-py-2 richtext-transition-all !richtext-border richtext-rounded-sm richtext-shadow-sm richtext-pointer-events-auto richtext-select-none richtext-border-neutral-200 dark:richtext-border-neutral-800 richtext-bg-background",children:n.jsx("div",{className:"richtext-flex richtext-items-center richtext-flex-nowrap richtext-whitespace-nowrap richtext-h-[26px] richtext-justify-start richtext-relative",children:r==null?void 0:r.map((a,o)=>n.jsx(Pt,{item:a,disabled:e.disabled,editor:e.editor},`bubbleMenu-image-${o}`))})}):n.jsx(n.Fragment,{})})})}function pa(e){const{lang:t}=b.useLocale(),i=({editor:a})=>{const{selection:o}=a.view.state,{$from:s,to:c}=o;let u=!1;return a.view.state.doc.nodesBetween(s.pos,c,d=>{if(fa(d))return u=!0,!1}),u},r=l.useMemo(()=>e.disabled?[]:ea(e.editor),[e.disabled,e.editor,t]);return n.jsx(n.Fragment,{children:n.jsx(f.BubbleMenu,{shouldShow:i,editor:e==null?void 0:e.editor,tippyOptions:Ot,children:r!=null&&r.length?n.jsx("div",{className:"richtext-w-auto richtext-px-3 richtext-py-2 richtext-transition-all !richtext-border richtext-rounded-sm richtext-shadow-sm richtext-pointer-events-auto richtext-select-none richtext-border-neutral-200 dark:richtext-border-neutral-800 richtext-bg-background",children:n.jsx("div",{className:"richtext-flex richtext-items-center richtext-flex-nowrap richtext-whitespace-nowrap richtext-h-[26px] richtext-justify-start richtext-relative",children:r==null?void 0:r.map((a,o)=>n.jsx(Pt,{item:a,disabled:e.disabled,editor:e.editor},`bubbleMenu-image-gif-${o}`))})}):n.jsx(n.Fragment,{})})})}function _a(e){const{lang:t}=b.useLocale(),i=({editor:a})=>{const{selection:o}=a.view.state,{$from:s,to:c}=o;let u=!1;return a.view.state.doc.nodesBetween(s.pos,c,d=>{if(ga(d))return u=!0,!1}),u},r=l.useMemo(()=>e.disabled?[]:na(e.editor),[e.editor,e.disabled,t]);return n.jsx(n.Fragment,{children:n.jsx(f.BubbleMenu,{shouldShow:i,editor:e==null?void 0:e.editor,tippyOptions:Ot,children:r!=null&&r.length?n.jsx("div",{className:"richtext-w-auto richtext-px-3 richtext-py-2 richtext-transition-all !richtext-border richtext-rounded-sm richtext-shadow-sm richtext-pointer-events-auto richtext-select-none richtext-border-neutral-200 dark:richtext-border-neutral-800 richtext-bg-background",children:n.jsx("div",{className:"richtext-flex richtext-items-center richtext-flex-nowrap richtext-whitespace-nowrap richtext-h-[26px] richtext-justify-start richtext-relative",children:r==null?void 0:r.map((a,o)=>n.jsx(Pt,{item:a,disabled:e.disabled,editor:e.editor},`bubbleMenu-video-${o}`))})}):n.jsx(n.Fragment,{})})})}function wa({editor:e}){const{t}=b.useLocale(),i=l.useCallback(()=>e.isActive(Me.name),[e]),r=l.useCallback(()=>Ue(Me.name,e),[e]),a=l.useCallback(()=>e.chain().focus().addColBefore().run(),[e]),o=l.useCallback(()=>e.chain().focus().addColAfter().run(),[e]),s=l.useCallback(()=>e.chain().focus().deleteCol().run(),[e]);return n.jsx(f.BubbleMenu,{pluginKey:"columns-bubble-menu",editor:e,shouldShow:i,tippyOptions:{popperOptions:{modifiers:[{name:"flip",enabled:!1}]},placement:"bottom-start",offset:[-2,16],zIndex:9999},children:n.jsxs("div",{className:"richtext-w-auto richtext-px-3 richtext-py-2 richtext-transition-all !richtext-border richtext-rounded-sm richtext-shadow-sm richtext-pointer-events-auto richtext-select-none richtext-border-neutral-200 dark:richtext-border-neutral-800 richtext-bg-background",children:[n.jsx(j,{action:a,icon:"ColumnAddLeft",tooltip:t("editor.table.menu.insertColumnBefore")}),n.jsx(j,{action:o,icon:"ColumnAddRight",tooltip:t("editor.table.menu.insertColumnAfter")}),n.jsx(j,{action:s,icon:"DeleteColumn",tooltip:t("editor.table.menu.deleteColumn")}),n.jsx(j,{action:r,icon:"Trash2",tooltip:t("editor.table.menu.delete_column")})]})})}const va=f.Bold.extend({addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),button:({editor:t,t:i})=>({component:j,componentProps:{action:()=>t.commands.toggleBold(),isActive:()=>t.isActive("bold")||!1,disabled:!t.can().toggleBold(),icon:"Bold",shortcutKeys:["mod","B"],tooltip:i("editor.bold.tooltip")}})}}}),ya=f.Italic.extend({addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),button({editor:t,t:i}){return{component:j,componentProps:{action:()=>t.commands.toggleItalic(),isActive:()=>t.isActive("italic")||!1,disabled:!t.can().toggleItalic(),shortcutKeys:["mod","I"],icon:"Italic",tooltip:i("editor.italic.tooltip")}}}}}}),ja=f.Underline.extend({addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),button({editor:t,t:i}){return{component:j,componentProps:{action:()=>t.commands.toggleUnderline(),isActive:()=>t.isActive("underline")||!1,disabled:!t.can().toggleUnderline(),icon:"Underline",shortcutKeys:["mod","U"],tooltip:i("editor.underline.tooltip")}}}}}}),ka=f.Strike.extend({addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),button:({editor:t,t:i})=>({component:j,componentProps:{action:()=>t.commands.toggleStrike(),isActive:()=>t.isActive("strike")||!1,disabled:!t.can().toggleStrike(),icon:"Strikethrough",shortcutKeys:["shift","mod","X"],tooltip:i("editor.strike.tooltip")}})}}}),Ca=f.Code.extend({addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),button:({editor:t,t:i})=>({component:j,componentProps:{action:()=>t.commands.toggleCode(),isActive:()=>t.isActive("code")||!1,disabled:!t.can().toggleCode(),icon:"Code",shortcutKeys:["mod","E"],tooltip:i("editor.code.tooltip")}})}}});let ae,Pe;const ut=new Set,mt=new Set;function Na(){return ae}function Sa(e){if(!ae&&!Pe){const t=e.themes.filter(r=>!!r&&r in $e.bundledThemes),i=e.languages.filter(r=>!!r&&r in $e.bundledLanguages);return Pe=$e.createHighlighter({themes:t,langs:i}).then(r=>{ae=r}),Pe}if(Pe)return Pe}async function Dn(e){return ae&&!ae.getLoadedThemes().includes(e)&&!mt.has(e)&&e in $e.bundledThemes?(mt.add(e),await ae.loadTheme(e),mt.delete(e),!0):!1}async function Bn(e){return ae&&!ae.getLoadedLanguages().includes(e)&&!ut.has(e)&&e in $e.bundledLanguages?(ut.add(e),await ae.loadLanguage(e),ut.delete(e),!0):!1}async function Ta({doc:e,name:t,defaultTheme:i,defaultLanguage:r}){const a=f.findChildren(e,c=>c.type.name===t),o=[...a.map(c=>c.node.attrs.theme),i],s=[...a.map(c=>c.node.attrs.language),r];ae?await Promise.all([...o.flatMap(c=>Dn(c)),...s.flatMap(c=>!!c&&Bn(c))]):await Sa({languages:s,themes:o})}function en({doc:e,name:t,defaultTheme:i,defaultLanguage:r}){const a=[];return f.findChildren(e,s=>s.type.name===t).forEach(s=>{let c=s.pos+1,u=s.node.attrs.language||r;const d=s.node.attrs.theme||i,h=Na();if(!h)return;h.getLoadedLanguages().includes(u)||(u="plaintext");const m=h.getLoadedThemes().includes(d)?d:h.getLoadedThemes()[0],x=h.codeToTokensBase(s.node.textContent,{lang:u,theme:m});for(const g of x){for(const p of g){const w=c+p.content.length,S=v.Decoration.inline(c,w,{style:`color: ${p.color}`});a.push(S),c=w}c+=1}}),v.DecorationSet.create(e,a)}function Aa({name:e,defaultLanguage:t,defaultTheme:i}){const r=new v.Plugin({key:new v.PluginKey("shiki"),view(a){class o{constructor(){this.initDecorations()}update(){this.checkUndecoratedBlocks()}destroy(){}async initDecorations(){const c=a.state.doc;await Ta({doc:c,name:e,defaultLanguage:t,defaultTheme:i});const u=a.state.tr.setMeta("shikiPluginForceDecoration",!0);a.dispatch(u)}async checkUndecoratedBlocks(){const c=f.findChildren(a.state.doc,h=>h.type.name===e);if((await Promise.all(c.flatMap(h=>[Dn(h.node.attrs.theme),Bn(h.node.attrs.language)]))).includes(!0)){const h=a.state.tr.setMeta("shikiPluginForceDecoration",!0);a.dispatch(h)}}}return new o},state:{init:(a,{doc:o})=>en({doc:o,name:e,defaultLanguage:t,defaultTheme:i}),apply:(a,o,s,c)=>{const u=s.selection.$head.parent.type.name,d=c.selection.$head.parent.type.name,h=f.findChildren(s.doc,g=>g.type.name===e),m=f.findChildren(c.doc,g=>g.type.name===e),x=a.docChanged&&([u,d].includes(e)||m.length!==h.length||a.steps.some(g=>g.from!==void 0&&g.to!==void 0&&h.some(p=>p.pos>=g.from&&p.pos+p.node.nodeSize<=g.to)));return a.getMeta("shikiPluginForceDecoration")||x?en({doc:a.doc,name:e,defaultLanguage:t,defaultTheme:i}):o.map(a.mapping,a.doc)}},props:{decorations(a){return r.getState(a)}}});return r}function La({action:e,languages:t,...i}){const r=o=>{e(o)},a=l.useMemo(()=>t==null?void 0:t.map(o=>({title:b.MAP_LANGUAGE_CODE_LABELS[o]||o,language:o})),[t]);return n.jsxs(le,{children:[n.jsx(de,{disabled:i==null?void 0:i.disabled,asChild:!0,children:n.jsx(j,{tooltip:i==null?void 0:i.tooltip,disabled:i==null?void 0:i.disabled,icon:i==null?void 0:i.icon})}),n.jsx(ce,{className:"richtext-w-full !richtext-max-h-[180px] !richtext-overflow-y-scroll",children:a==null?void 0:a.map(o=>n.jsx(ee,{onClick:()=>r(o.language),children:n.jsx("div",{className:"richtext-h-full richtext-ml-1",children:o.title})},`codeblock-${o.title}`))})]})}const Ma="_wrap_17npv_1",Ea="_maxHeight_17npv_10",Ia="_btnCopy_17npv_13",Ra="_btnDelete_17npv_14",Ha="_blockInfo_17npv_18",za="_selectLang_17npv_28",Oa="_copied_17npv_54",xe={wrap:Ma,maxHeight:Ea,btnCopy:Ia,btnDelete:Ra,blockInfo:Ha,selectLang:za,"richtext-SelectContent":"_richtext-SelectContent_17npv_42",copied:Oa};function Pa(){const[e,t]=l.useState(!1);return{isCopied:e,copyToClipboard:async r=>{try{await navigator.clipboard.writeText(r),t(!0),setTimeout(()=>t(!1),2e3)}catch(a){console.error("Failed to copy text: ",a),t(!1)}}}}function Da({editor:e,node:{attrs:t},updateAttributes:i,extension:r}){var x,g;const{isCopied:a,copyToClipboard:o}=Pa(),s=l.useMemo(()=>{var p;return(p=r.options.languages)!=null&&p.length?r.options.languages:b.DEFAULT_LANGUAGE_CODE_BLOCK},[r.options.languages]),c=e.isEditable,u=(g=(x=e==null?void 0:e.options)==null?void 0:x.editorProps)==null?void 0:g.print,{language:d}=t,h=l.useRef(),m=l.useCallback(()=>Ue($n.name,e),[e]);return n.jsxs(f.NodeViewWrapper,{className:v.clsx(xe.wrap,!u&&xe.maxHeight,"render-wrapper"),children:[n.jsxs("div",{className:xe.blockInfo,children:[n.jsx("span",{onClick:()=>o(h.current.innerText),className:v.clsx(xe.btnCopy,a&&xe.copied),children:a?n.jsx(_.CopyCheck,{size:16}):n.jsx(_.Copy,{size:16})}),n.jsx("span",{onClick:m,className:xe.btnDelete,children:n.jsx($,{name:"Trash2"})}),n.jsx("div",{className:xe.selectLang,children:n.jsxs(vi,{defaultValue:d||"auto",disabled:!c,onValueChange:p=>i({language:p}),children:[n.jsx(gn,{children:n.jsx(yi,{placeholder:"Language"})}),n.jsxs(_n,{className:"richtext-max-h-60 richtext-overflow-y-auto",children:[n.jsx(vt,{value:"auto",children:"Auto"}),s.map((p,w)=>n.jsx(vt,{value:p,children:p.charAt(0).toUpperCase()+p.slice(1)},`code-lang-${w}`))]})]})})]}),n.jsx("pre",{ref:h,children:n.jsx(f.NodeViewContent,{as:"code"})})]})}const $n=f.CodeBlock.extend({addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),languages:[],button:({editor:t,t:i,extension:r})=>{var o,s,c;const a=(s=(o=r==null?void 0:r.options)==null?void 0:o.languages)!=null&&s.length?(c=r==null?void 0:r.options)==null?void 0:c.languages:b.DEFAULT_LANGUAGE_CODE_BLOCK;return{component:La,componentProps:{action:(u="js")=>t.commands.setCodeBlock({language:u}),isActive:()=>t.isActive("codeBlock")||!1,disabled:!t.can().toggleCodeBlock(),icon:"Code2",tooltip:i("editor.codeblock.tooltip"),languages:a}}}}},addNodeView(){return f.ReactNodeViewRenderer(Da)},addProseMirrorPlugins(){var e;return[...((e=this.parent)==null?void 0:e.call(this))||[],Aa({name:this.name,defaultLanguage:null,defaultTheme:this.options.defaultTheme})]}});function Ba(e){var a,o,s;const{t,lang:i}=b.useLocale(),r=l.useMemo(()=>{var d;const c=(d=e==null?void 0:e.items)==null?void 0:d.find(h=>h.isActive());return c&&!c.default?{...c}:{title:e.tooltip,font:t("editor.fontFamily.default.tooltip"),isActive:()=>!1,disabled:!1,action:()=>e.editor.chain().focus().unsetFontFamily().run()}},[t,i,e]);return n.jsxs(le,{children:[n.jsx(de,{disabled:e==null?void 0:e.disabled,asChild:!0,children:n.jsx(Mt,{title:((a=r==null?void 0:r.font)==null?void 0:a.length)>7?`${(o=r==null?void 0:r.font)==null?void 0:o.slice(0,6)}...`:r==null?void 0:r.font,tooltip:e==null?void 0:e.tooltip,disabled:e==null?void 0:e.disabled,icon:"MenuDown"})}),n.jsx(ce,{className:"richtext-w-full",children:(s=e==null?void 0:e.items)==null?void 0:s.map((c,u)=>{const d=c.font===t("editor.fontFamily.default.tooltip")?{}:{fontFamily:c.font};return n.jsxs(l.Fragment,{children:[n.jsx(ve,{checked:(r==null?void 0:r.font)===c.font,onClick:c.action,children:n.jsx("div",{className:"richtext-h-full richtext-ml-1",style:d,children:c.font})}),c.font===t("editor.fontFamily.default.tooltip")&&n.jsx(at,{})]},`font-family-${u}`)})})]})}const $a=f.FontFamily.extend({addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),fontFamilyList:b.DEFAULT_FONT_FAMILY_LIST,button({editor:t,extension:i,t:r}){var d;const{extensions:a=[]}=t.extensionManager??[],o=yt(((d=i==null?void 0:i.options)==null?void 0:d.fontFamilyList)||[]),s=a.find(h=>h.name==="base-kit"),c=o.map(h=>({action:()=>{t.chain().focus().setFontFamily(h.value).run()},isActive:()=>t.isActive("textStyle",{fontFamily:h.value})||!1,disabled:!t.can().setFontFamily(h.value),title:h.name,font:h.value}));s&&s.options.textStyle!==!1&&c.unshift({action:()=>t.chain().focus().unsetFontFamily().run(),isActive:()=>!1,disabled:!1,font:r("editor.fontFamily.default.tooltip"),title:r("editor.fontFamily.tooltip")});const u=c.filter(h=>h.disabled).length===c.length;return{component:Ba,componentProps:{tooltip:r("editor.fontFamily.tooltip"),disabled:u,items:c,editor:t}}}}}});function Fa(e){var i;const t=l.useMemo(()=>{var o;const r=(o=e==null?void 0:e.items)==null?void 0:o.find(s=>s.isActive());return r&&!r.default?{...r}:{title:e.tooltip,level:0,isActive:()=>!1}},[e]);return n.jsxs(le,{children:[n.jsx(de,{disabled:e==null?void 0:e.disabled,asChild:!0,children:n.jsx(Mt,{title:t==null?void 0:t.title,tooltip:e==null?void 0:e.tooltip,disabled:e==null?void 0:e.disabled,icon:"MenuDown"})}),n.jsx(ce,{className:"richtext-w-full",children:(i=e==null?void 0:e.items)==null?void 0:i.map((r,a)=>{var o,s;return n.jsxs(l.Fragment,{children:[n.jsxs(ve,{checked:(t==null?void 0:t.title)===r.title,onClick:r.action,children:[n.jsx("div",{className:`richtext-ml-1 richtext-h-full heading-${r.level}`,children:r.title}),!!((o=r==null?void 0:r.shortcutKeys)!=null&&o.length)&&n.jsx(fn,{className:"richtext-pl-4",children:(s=r==null?void 0:r.shortcutKeys)==null?void 0:s.map(c=>it(c)).join(" ")})]}),r.level===0&&n.jsx(at,{})]},`heading-k-${a}`)})})]})}const Va=f.Heading.extend({addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),levels:[1,2,3,4,5,6],button({editor:t,extension:i,t:r}){var d;const{extensions:a=[]}=t.extensionManager??[],o=((d=i.options)==null?void 0:d.levels)||[],s=a.find(h=>h.name==="base-kit"),c=o.map(h=>({action:()=>t.commands.toggleHeading({level:h}),isActive:()=>t.isActive("heading",{level:h})||!1,disabled:!t.can().toggleHeading({level:h}),title:r(`editor.heading.h${h}.tooltip`),level:h,shortcutKeys:["alt","mod",`${h}`]}));s&&s.options.paragraph!==!1&&c.unshift({action:()=>t.commands.setParagraph(),isActive:()=>t.isActive("paragraph")||!1,disabled:!t.can().setParagraph(),level:0,title:r("editor.paragraph.tooltip"),shortcutKeys:["alt","mod","0"]});const u=c.filter(h=>h.disabled).length===c.length;return{component:Fa,componentProps:{tooltip:r("editor.heading.tooltip"),disabled:u,items:c,editor:t}}}}}});function Ua(e){var i;const t=l.useMemo(()=>{var o;const r=(o=e==null?void 0:e.items)==null?void 0:o.find(s=>s.isActive());return r&&!r.default?{...r,icon:r.icon?r.icon:e.icon}:{title:e==null?void 0:e.tooltip,icon:e.icon,isActive:()=>!1}},[e]);return n.jsxs(ne,{modal:!0,children:[n.jsx(ie,{disabled:e==null?void 0:e.disabled,asChild:!0,children:n.jsx(j,{customClass:"!richtext-w-12 richtext-h-12",icon:e==null?void 0:e.icon,tooltip:e==null?void 0:e.tooltip,disabled:e==null?void 0:e.disabled,children:n.jsx($,{className:"richtext-w-3 richtext-h-3 richtext-ml-1 richtext-text-zinc-500",name:"MenuDown"})})}),n.jsx(Q,{className:"richtext-min-w-4 richtext-w-full !richtext-p-[4px] richtext-flex richtext-flex-row richtext-gap-1",align:"start",side:"bottom",children:(i=e==null?void 0:e.items)==null?void 0:i.map((r,a)=>{var o,s;return n.jsxs(Re,{children:[n.jsx(He,{asChild:!0,children:n.jsx(Ge,{size:"sm",onClick:r==null?void 0:r.action,className:"richtext-p-1 richtext-w-7 richtext-h-7",pressed:t.title===r.title,"data-state":t.title===r.title?"on":"off",children:(r==null?void 0:r.icon)&&n.jsx($,{name:r.icon})})}),n.jsxs(ye,{className:"richtext-flex richtext-flex-col richtext-items-center",children:[n.jsx("span",{children:r.title}),!!((o=r.shortcutKeys)!=null&&o.length)&&n.jsx("span",{children:(s=r.shortcutKeys)==null?void 0:s.map(c=>it(c)).join(" ")})]})]},`text-align-${a}`)})})]})}const Wa=f.TextAlign.extend({addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),types:["heading","paragraph","list_item","title"],button({editor:t,extension:i,t:r}){var d;const a=((d=i.options)==null?void 0:d.alignments)||[],o={left:["mod","Shift","L"],center:["mod","Shift","E"],right:["mod","Shift","R"],justify:["mod","Shift","J"]},s={left:"AlignLeft",center:"AlignCenter",right:"AlignRight",justify:"AlignJustify"},c=a.map(h=>{var m,x,g;return{title:r(`editor.textalign.${h}.tooltip`),icon:s[h],shortcutKeys:o[h],isActive:()=>t.isActive({textAlign:h})||!1,action:()=>{var p,w;return(w=(p=t.commands)==null?void 0:p.setTextAlign)==null?void 0:w.call(p,h)},disabled:!((g=(x=(m=t==null?void 0:t.can)==null?void 0:m.call(t))==null?void 0:x.setTextAlign)!=null&&g.call(x,h))}}),u=c.filter(h=>h.disabled).length===c.length;return{component:Ua,componentProps:{icon:"AlignJustify",tooltip:r("editor.textalign.tooltip"),disabled:u,items:c}}}}}});function qa(e){var r;const{t}=b.useLocale(),i=l.useMemo(()=>{const a=(e.items||[]).find(s=>s.isActive());return a||{title:t("editor.fontSize.default.tooltip"),isActive:()=>!1}},[e]);return n.jsxs(le,{children:[n.jsx(de,{disabled:e==null?void 0:e.disabled,asChild:!0,children:n.jsx(Mt,{title:i==null?void 0:i.title,tooltip:`${e==null?void 0:e.tooltip}`,disabled:e==null?void 0:e.disabled,icon:"MenuDown"})}),n.jsx(ce,{className:"richtext-w-32 richtext-overflow-y-auto richtext-max-h-96",children:(r=e==null?void 0:e.items)==null?void 0:r.map((a,o)=>n.jsx(ve,{checked:i.title===a.title,onClick:a.action,children:n.jsx("div",{className:"richtext-h-full richtext-ml-1",children:a.title})},`font-size-${o}`))})]})}const Ga=f.Extension.create({name:"fontSize",addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),types:["textStyle"],fontSizes:[...b.DEFAULT_FONT_SIZE_LIST],button({editor:t,extension:i,t:r}){var u;const a=yt(((u=i.options)==null?void 0:u.fontSizes)||b.DEFAULT_FONT_SIZE_VALUE),o=yt([b.DEFAULT_FONT_SIZE_VALUE])[0],s=a.map(d=>({title:d.value===o.value?r("editor.fontSize.default.tooltip"):String(d.name),isActive:()=>{const{fontSize:h}=t.getAttributes("textStyle");return d.value===o.value&&h===void 0?!0:t.isActive({fontSize:String(d.value)})||!1},action:()=>{if(d.value===o.value){t.commands.unsetFontSize();return}t.commands.setFontSize(String(d.value))},disabled:!t.can().setFontSize(String(d.value)),divider:d.value===o.value||!1,default:d.value===o.value||!1})),c=s.filter(d=>d.disabled).length===s.length;return{component:qa,componentProps:{editor:t,tooltip:r("editor.fontSize.tooltip"),disabled:c,items:s,maxHeight:280}}}}},addGlobalAttributes(){return[{types:this.options.types,attributes:{fontSize:{default:null,parseHTML:e=>e.style.fontSize.replaceAll(/["']+/g,""),renderHTML:e=>e.fontSize?{style:`font-size: ${e.fontSize}`}:{}}}}]},addCommands(){return{setFontSize:e=>({chain:t})=>t().setMark("textStyle",{fontSize:e}).run(),unsetFontSize:()=>({chain:e})=>e().setMark("textStyle",{fontSize:null}).removeEmptyTextStyle().run()}}});function Ka({fill:e}){return n.jsx("svg",{width:"18px",height:"18px",viewBox:"0 0 240 240",version:"1.1",xmlns:"http://www.w3.org/2000/svg",children:n.jsx("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",children:n.jsx("g",{transform:"translate(0.000000, 0.500000)",children:n.jsxs("g",{transform:"translate(39.000000, 17.353553)",children:[n.jsx("path",{d:"M11,201.146447 L167,201.146447 C173.075132,201.146447 178,206.071314 178,212.146447 C178,218.221579 173.075132,223.146447 167,223.146447 L11,223.146447 C4.92486775,223.146447 7.43989126e-16,218.221579 0,212.146447 C-7.43989126e-16,206.071314 4.92486775,201.146447 11,201.146447 Z",id:"矩形",fill:e||"#DF2A3F",fillRule:"evenodd"}),n.jsx("path",{d:"M72.3425855,16.8295583 C75.799482,7.50883712 86.1577877,2.75526801 95.4785089,6.21216449 C100.284516,7.99463061 104.096358,11.7387855 105.968745,16.4968188 L106.112518,16.8745422 L159.385152,161.694068 C161.291848,166.877345 158.635655,172.624903 153.452378,174.531599 C148.358469,176.405421 142.719567,173.872338 140.716873,168.864661 L140.614848,168.598825 L89.211,28.86 L37.3759214,168.623816 C35.4885354,173.712715 29.8981043,176.351047 24.7909589,174.617647 L24.5226307,174.522368 C19.4337312,172.634982 16.7953993,167.044551 18.5287999,161.937406 L18.6240786,161.669077 L72.3425855,16.8295583 Z",id:"路径-21",fill:"currentColor",fillRule:"nonzero"}),n.jsx("path",{d:"M121,103.146447 C126.522847,103.146447 131,107.623599 131,113.146447 C131,118.575687 126.673329,122.994378 121.279905,123.142605 L121,123.146447 L55,123.146447 C49.4771525,123.146447 45,118.669294 45,113.146447 C45,107.717207 49.3266708,103.298515 54.7200952,103.150288 L55,103.146447 L121,103.146447 Z",id:"路径-22",fill:"currentColor",fillRule:"nonzero"})]})})})})}function Za(e){const[t,i]=l.useState(void 0);function r(s){var c;(c=e.action)==null||c.call(e,s)}function a(){var s;(s=e.action)==null||s.call(e,t)}const o=l.useCallback(v.debounce(s=>{i(s)},350),[]);return n.jsxs("div",{className:"richtext-flex richtext-items-center richtext-h-[32px]",children:[n.jsx(j,{tooltip:e==null?void 0:e.tooltip,disabled:e==null?void 0:e.disabled,action:a,children:n.jsx("span",{className:"richtext-flex richtext-items-center richtext-justify-center richtext-text-sm",children:n.jsx(Ka,{fill:t})})}),n.jsx(Tn,{selectedColor:t,setSelectedColor:o,onChange:r,disabled:e==null?void 0:e.disabled,colors:e==null?void 0:e.colors,defaultColor:e==null?void 0:e.defaultColor,children:n.jsx(F,{variant:"ghost",size:"icon",className:"r!ichtext-h-[32px] !richtext-w-3",disabled:e==null?void 0:e.disabled,children:n.jsx($,{className:"!richtext-w-3 !richtext-h-3 richtext-text-zinc-500",name:"MenuDown"})})})]})}const Xa=f.Color.extend({addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),button({editor:t,t:i,extension:r}){return{component:Za,componentProps:{colors:r.options.colors,defaultColor:r.options.defaultColor,action:a=>{a===void 0&&t.chain().focus().unsetColor().run(),typeof a=="string"&&t.chain().focus().setColor(a).run()},isActive:()=>{const{color:a}=t.getAttributes("textStyle");return a&&t.isActive({color:a})||!1},editor:t,disabled:!t.can().setColor(""),tooltip:i("editor.color.tooltip")}}}}}}),Ja=f.Highlight.extend({addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),multicolor:!0,button:({editor:t,t:i})=>({component:On,componentProps:{action:r=>{typeof r=="string"&&t.chain().focus().setHighlight({color:r}).run(),r===void 0&&t.chain().focus().unsetHighlight().run()},editor:t,isActive:()=>t.isActive("highlight")||!1,disabled:!t.can().setHighlight(),shortcutKeys:["⇧","mod","H"],tooltip:i("editor.highlight.tooltip")}})}}}),Ya=f.BulletList.extend({addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),button:({editor:t,t:i})=>({component:j,componentProps:{action:()=>t.commands.toggleBulletList(),isActive:()=>t.isActive("bulletList")||!1,disabled:!1,shortcutKeys:["shift","mod","8"],icon:"List",tooltip:i("editor.bulletlist.tooltip")}})}}}),Qa=f.Node.create({name:"clear",addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),button:({editor:t,t:i})=>({component:j,componentProps:{action:()=>t.chain().focus().clearNodes().unsetAllMarks().run(),disabled:!t.can().chain().focus().clearNodes().unsetAllMarks().run(),icon:"Eraser",tooltip:i("editor.clear.tooltip")}})}}}),eo=f.OrderedList.extend({addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),button:({editor:t,t:i})=>({component:j,componentProps:{action:()=>t.commands.toggleOrderedList(),isActive:()=>t.isActive("orderedList")||!1,disabled:!1,icon:"ListOrdered",shortcutKeys:["mod","shift","7"],tooltip:i("editor.orderedlist.tooltip")}})}}}),to=f.TaskList.extend({addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),HTMLAttributes:{class:"task-list"},taskItem:{HTMLAttributes:{class:"task-list-item"}},button:({editor:t,t:i})=>({component:j,componentProps:{action:()=>t.commands.toggleTaskList(),isActive:()=>t.isActive("taskList")||!1,disabled:!1,icon:"ListTodo",shortcutKeys:["shift","mod","9"],tooltip:i("editor.tasklist.tooltip")}})}},addExtensions(){return[f.TaskItem.configure(this.options.taskItem)]}}),no=f.Blockquote.extend({addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),HTMLAttributes:{class:"blockquote"},button:({editor:t,t:i})=>({component:j,componentProps:{action:()=>t.commands.toggleBlockquote(),isActive:()=>t.isActive("blockquote")||!1,disabled:!t.can().toggleBlockquote(),icon:"TextQuote",shortcutKeys:["shift","mod","B"],tooltip:i("editor.blockquote.tooltip")}})}}});function io(e){function t(i,r,a){e.action&&e.action({link:i,text:r,openInNewTab:a})}return n.jsxs(ne,{modal:!0,children:[n.jsx(ie,{disabled:e==null?void 0:e.disabled,asChild:!0,children:n.jsx(j,{tooltip:e==null?void 0:e.tooltip,isActive:e==null?void 0:e.isActive,disabled:e==null?void 0:e.disabled,children:n.jsx($,{name:e==null?void 0:e.icon})})}),n.jsx(Q,{hideWhenDetached:!0,className:"richtext-w-full",align:"start",side:"bottom",children:n.jsx(Pn,{editor:e.editor,onSetLink:t})})]})}const ro=f.Link.extend({inclusive:!1,parseHTML(){return[{tag:'a[href]:not([data-type="button"]):not([href *= "javascript:" i])'}]},renderHTML({HTMLAttributes:e}){return["a",f.mergeAttributes(this.options.HTMLAttributes,e,{class:"link"}),0]},addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),openOnClick:!0,button:({editor:t,t:i})=>({component:io,componentProps:{editor:t,action:r=>{const{link:a,text:o,openInNewTab:s}=r;t.chain().extendMarkRange("link").insertContent({type:"text",text:o,marks:[{type:"link",attrs:{href:a,target:s?"_blank":""}}]}).setLink({href:a}).focus().run()},id:"linkk",isActive:()=>t.isActive("link")||!1,disabled:!t.can().setLink({href:""}),icon:"Link",tooltip:i("editor.link.tooltip")}})}},addProseMirrorPlugins(){return[new v.Plugin({props:{handleClick:(e,t)=>{const{schema:i,doc:r,tr:a}=e.state,o=f.getMarkRange(r.resolve(t),i.marks.link);if(!o)return!1;const s=r.resolve(o.from),c=r.resolve(o.to),u=a.setSelection(new v.TextSelection(s,c));e.dispatch(u)}}})]}}),ao=f.HorizontalRule.extend({renderHTML(){return["div",f.mergeAttributes(this.options.HTMLAttributes,{"data-type":this.name}),["hr"]]},addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),button:({editor:t,t:i})=>({component:j,componentProps:{action:()=>t.commands.setHorizontalRule(),disabled:!t.can().setHorizontalRule(),icon:"Minus",shortcutKeys:["mod","alt","S"],tooltip:i("editor.horizontalrule.tooltip")}})}},addKeyboardShortcuts(){return{"Mod-Alt-s":()=>this.editor.commands.setHorizontalRule()}}});function oo(e){var d;const{icon:t=void 0,tooltip:i=void 0,customClass:r="",tooltipOptions:a={},action:o=void 0,isActive:s=void 0,children:c}=e,u=Ke[t];return n.jsxs(Re,{children:[n.jsx(He,{asChild:!0,children:n.jsxs(Ge,{size:"sm",className:`richtext-w-[32px] richtext-h-[32px] ${r}`,disabled:s==null?void 0:s(),onClick:o,children:[u&&n.jsx(u,{className:"richtext-w-4 richtext-h-4"}),c&&n.jsx(n.Fragment,{children:c})]})}),i&&n.jsx(ye,{...a,children:n.jsxs("div",{className:"richtext-flex richtext-flex-col richtext-items-center richtext-text-center richtext-max-w-24",children:[n.jsx("div",{children:i}),!!((d=e==null?void 0:e.shortcutKeys)!=null&&d.length)&&n.jsx("span",{children:rt(e==null?void 0:e.shortcutKeys)})]})})]})}const so=["undo","redo"],co=f.History.extend({addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),depth:100,newGroupDelay:500,button:({editor:t,t:i})=>so.map(r=>({component:oo,componentProps:{action:()=>{r==="undo"&&t.chain().focus().undo().run(),r==="redo"&&t.chain().focus().redo().run()},shortcutKeys:r==="undo"?["mod","Z"]:["shift","mod","Z"],disabled:r==="undo"?!t.can().undo():!t.can().redo(),isActive:()=>r==="undo"?!t.can().undo():!t.can().redo(),icon:r==="undo"?"Undo2":"Redo2",tooltip:i(`editor.${r}.tooltip`)}}))}}}),lo=f.Document.extend({content:"(block|columns)+"});function ho(e,t,i=null){return i?e.createChecked({index:t},i):e.createAndFill({index:t})}function uo(e){if(e.cached.columnsNodeTypes)return e.cached.columnsNodeTypes;const t={columns:e.nodes.columns,column:e.nodes.column};return e.cached.columnsNodeTypes=t,t}function mo(e,t,i=null){const r=uo(e),a=[];for(let o=0;o<t;o+=1){const s=ho(r.column,o,i);s&&a.push(s)}return r.columns.createChecked({cols:t},a)}function xt({state:e,dispatch:t,type:i}){const r=f.findParentNode(o=>o.type.name===Me.name)(e.selection),a=f.findParentNode(o=>o.type.name===st.name)(e.selection);if(t&&r&&a){const o=r.node,s=a.node.attrs.index,c=o.toJSON();let u=s;i==="delete"?(u=s-1,c.content.splice(s,1)):(u=i==="addBefore"?s:s+1,c.content.splice(u,0,{type:"column",attrs:{index:s},content:[{type:"paragraph"}]})),c.attrs.cols=c.content.length,c.content.forEach((x,g)=>{x.attrs.index=g});const d=v.Node.fromJSON(e.schema,c);let h=r.pos;d.content.forEach((x,g,p)=>{p<u&&(h+=x.nodeSize)});const m=e.tr.setTime(Date.now());m.replaceWith(r.pos,r.pos+r.node.nodeSize,d).setSelection(v.TextSelection.near(m.doc.resolve(h))),t(m)}return!0}function tn({state:e,dispatch:t,type:i}){const r=f.findParentNode(o=>o.type.name===Me.name)(e.selection),a=f.findParentNode(o=>o.type.name===st.name)(e.selection);if(t&&r&&a){const o=r.node,s=a.node.attrs.index;let c=0;i==="before"?c=(s-1+o.attrs.cols)%o.attrs.cols:c=(s+1)%o.attrs.cols;let u=r.pos;o.content.forEach((h,m,x)=>{x<c&&(u+=h.nodeSize)});const d=e.tr.setTime(Date.now());return d.setSelection(v.TextSelection.near(d.doc.resolve(u))),t(d),!0}return!1}const xo=200,Me=f.Node.create({name:"columns",group:"block",defining:!0,isolating:!0,allowGapCursor:!1,content:"column{1,}",priority:xo,addOptions(){return{HTMLAttributes:{class:"columns"}}},addAttributes(){return{cols:{default:2,parseHTML:e=>e.getAttribute("cols")}}},parseHTML(){return[{tag:"div[class=grid]"}]},renderHTML({HTMLAttributes:e}){return["div",f.mergeAttributes(this.options.HTMLAttributes,e),0]},addCommands(){return{insertColumns:e=>({tr:t,dispatch:i,editor:r})=>{const a=mo(r.schema,e&&e.cols||3);if(i){const o=t.selection.anchor+1;t.replaceSelectionWith(a).scrollIntoView().setSelection(v.TextSelection.near(t.doc.resolve(o)))}return!0},addColBefore:()=>({dispatch:e,state:t})=>xt({dispatch:e,state:t,type:"addBefore"}),addColAfter:()=>({dispatch:e,state:t})=>xt({dispatch:e,state:t,type:"addAfter"}),deleteCol:()=>({dispatch:e,state:t})=>xt({dispatch:e,state:t,type:"delete"})}},addKeyboardShortcuts(){return{"Mod-Alt-G":()=>this.editor.commands.insertColumns(),Tab:()=>tn({state:this.editor.state,dispatch:this.editor.view.dispatch,type:"after"}),"Shift-Tab":()=>tn({state:this.editor.state,dispatch:this.editor.view.dispatch,type:"before"})}}}),st=f.Node.create({name:"column",content:"block+",isolating:!0,addOptions(){return{HTMLAttributes:{class:"column"}}},addAttributes(){return{index:{default:0,parseHTML:e=>e.getAttribute("index")}}},parseHTML(){return[{tag:"div[class=column]"}]},renderHTML({HTMLAttributes:e}){return["div",f.mergeAttributes(this.options.HTMLAttributes,e),0]}}),fo=f.Extension.create({name:"columnActionButton",addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),button:({editor:t,t:i})=>({component:j,componentProps:{action:()=>{t.chain().focus().insertColumns({cols:2}).run()},icon:"Columns",tooltip:i("editor.columns.tooltip")}})}}}),go=f.Extension.create({name:"selection",addProseMirrorPlugins(){const{editor:e}=this;return[new v.Plugin({key:new v.PluginKey("selection"),props:{decorations(t){return t.selection.empty||e.isFocused===!0?null:v.DecorationSet.create(t.doc,[v.Decoration.inline(t.selection.from,t.selection.to,{class:"selection"})])}}})]}});function bo(e){const{t}=b.useLocale(),i=l.useMemo(()=>[{name:"paragraph",label:t("editor.paragraph.tooltip"),iconName:"Heading1",isActive:()=>e.editor.isActive("paragraph")&&!e.editor.isActive("orderedList")&&!e.editor.isActive("bulletList")&&!e.editor.isActive("taskList"),action:()=>e.editor.chain().focus().clearNodes().run()},{name:"heading1",label:t("editor.heading.h1.tooltip"),isActive:()=>e.editor.isActive("heading",{level:1}),iconName:"Heading1",action:()=>e.editor.chain().focus().clearNodes().toggleHeading({level:1}).run()},{name:"heading2",label:t("editor.heading.h2.tooltip"),isActive:()=>e.editor.isActive("heading",{level:2}),iconName:"Heading2",action:()=>e.editor.chain().focus().clearNodes().toggleHeading({level:2}).run()},{name:"heading3",label:t("editor.heading.h3.tooltip"),isActive:()=>e.editor.isActive("heading",{level:3}),iconName:"Heading3",action:()=>e.editor.chain().focus().clearNodes().toggleHeading({level:3}).run()},{name:"bulletList",label:t("editor.bulletlist.tooltip"),isActive:()=>e.editor.isActive("bulletList"),iconName:"List",action:()=>e.editor.chain().focus().clearNodes().toggleBulletList().run()},{name:"numberedList",label:t("editor.orderedlist.tooltip"),isActive:()=>e.editor.isActive("orderedList"),iconName:"ListOrdered",action:()=>e.editor.chain().focus().clearNodes().toggleOrderedList().run()},{name:"taskList",label:t("editor.tasklist.tooltip"),isActive:()=>e.editor.isActive("taskList"),iconName:"ListTodo",action:()=>e.editor.chain().focus().clearNodes().toggleTaskList().run()},{name:"blockquote",label:t("editor.blockquote.tooltip"),isActive:()=>e.editor.isActive("blockquote"),iconName:"TextQuote",action:()=>e.editor.chain().focus().clearNodes().toggleBlockquote().run()},{name:"codeBlock",label:t("editor.codeblock.tooltip"),isActive:()=>e.editor.isActive("codeBlock"),iconName:"Code2",action:()=>e.editor.chain().focus().clearNodes().toggleCodeBlock().run()}],[e.editor,t]),r=l.useMemo(()=>i.filter(a=>a.isActive()).pop()??{label:"Empty"},[i]);return n.jsxs(le,{children:[n.jsx(de,{asChild:!0,children:n.jsxs(F,{variant:"ghost",className:"richtext-h-[32px] richtext-flex richtext-gap-1 richtext-px-1.5",children:[n.jsxs("span",{className:"richtext-text-sm richtext-font-normal richtext-whitespace-nowrap",children:[" ",r==null?void 0:r.label]}),n.jsx(_.ChevronDown,{className:"richtext-w-4 richtext-h-4"})]})}),n.jsx(ce,{hideWhenDetached:!0,className:"richtext-w-full richtext-p-1",align:"start",sideOffset:5,children:i.map((a,o)=>{var c;const s=Ke[a.iconName];return n.jsx(ve,{checked:((c=a.isActive)==null?void 0:c.call(a))||!1,onClick:()=>a.action(),className:"richtext-cursor-pointer",children:n.jsxs("div",{className:"richtext-flex richtext-items-center richtext-gap-2 richtext-px-2",children:[n.jsx(s,{className:"richtext-w-3 richtext-h3"}),n.jsxs("span",{children:[" ",a.label]})]})},`text-bubble-${o}`)})})]})}const po=f.Extension.create({name:"text-bubble",addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),toolbar:!1,button:()=>({component:bo,componentProps:{}})}}});function nn({types:e,node:t}){return Array.isArray(e)&&e.includes(t.type)||t.type===e}const _o=f.Extension.create({name:"trailingNode",addOptions(){return{node:"paragraph",notAfter:["paragraph"]}},addProseMirrorPlugins(){const e=new v.PluginKey(this.name),t=Object.entries(this.editor.schema.nodes).map(([,i])=>i).filter(i=>this.options.notAfter.includes(i.name));return[new v.Plugin({key:e,appendTransaction:(i,r,a)=>{const{doc:o,tr:s,schema:c}=a,u=e.getState(a),d=o.content.size,h=c.nodes[this.options.node];if(u)return s.insert(d,h.create())},state:{init:(i,r)=>{const a=r.tr.doc.lastChild;return!nn({node:a,types:t})},apply:(i,r)=>{if(!i.docChanged)return r;const a=i.doc.lastChild;return!nn({node:a,types:t})}}})]}}),wo=f.Extension.create({name:"base-kit",addExtensions(){const e=[];return this.options.document!==!1&&e.push(lo.configure()),this.options.placeholder!==!1&&e.push(f.Placeholder.configure({placeholder:({node:t,pos:i,editor:r})=>{var a,o,s,c,u;return((a=t==null?void 0:t.type)==null?void 0:a.name)==="columns"||((o=t==null?void 0:t.content)==null?void 0:o.size)!==0?"":((s=t==null?void 0:t.type)==null?void 0:s.name)==="heading"?`${b.localeActions.t(`editor.heading.h${t.attrs.level}.tooltip`)}`:((c=t==null?void 0:t.type)==null?void 0:c.name)==="codeBlock"||((u=t==null?void 0:t.type)==null?void 0:u.name)==="table"?"":r.extensionManager.extensions.some(d=>d.name==="slashCommand")?b.localeActions.t("editor.slash"):b.localeActions.t("editor.content")},...this.options.placeholder})),this.options.focus!==!1&&e.push(f.FocusClasses.configure({className:"focus",...this.options.focus})),this.options.text!==!1&&e.push(f.Text.configure()),this.options.textBubble!==!1&&e.push(po.configure()),this.options.gapcursor!==!1&&e.push(f.Gapcursor.configure()),this.options.dropcursor!==!1&&e.push(f.Dropcursor.configure({...this.options.dropcursor,width:2,class:"ProseMirror-dropcursor border-black"})),this.options.characterCount!==!1&&e.push(f.CharacterCount.configure(this.options.characterCount)),this.options.paragraph!==!1&&e.push(f.Paragraph.configure(this.options.paragraph)),this.options.hardBreak!==!1&&e.push(f.HardBreak.configure(this.options.hardBreak)),this.options.listItem!==!1&&e.push(f.ListItem.configure(this.options.listItem)),this.options.textStyle!==!1&&e.push(f.TextStyle.configure(this.options.textStyle)),this.options.trailingNode!==!1&&e.push(_o.configure(this.options.trailingNode)),this.options.selection!==!1&&e.push(go),this.options.multiColumn!==!1&&(e.push(st),e.push(Me)),e}}),vo=f.Extension.create({name:"subAndSuperScript",addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),button:({editor:t,extension:i,t:r})=>{const a=i.options.subscript,o=i.options.superscript,s={component:j,componentProps:{action:()=>t.commands.toggleSubscript(),isActive:()=>t.isActive("subscript")||!1,disabled:!t.can().toggleSubscript(),icon:"Subscript",tooltip:r("editor.subscript.tooltip")}},c={component:j,componentProps:{action:()=>t.commands.toggleSuperscript(),isActive:()=>t.isActive("superscript")||!1,disabled:!t.can().toggleSuperscript(),icon:"Superscript",tooltip:r("editor.superscript.tooltip")}},u=[];return a!==!1&&u.push(s),o!==!1&&u.push(c),u}}},addExtensions(){const e=[];return this.options.subscript!==!1&&e.push(f.Subscript.configure(this.options.subscript)),this.options.superscript!==!1&&e.push(f.Superscript.configure(this.options.superscript)),e}});function yo(e){var i;const t=l.useMemo(()=>{var o;const r=(o=e==null?void 0:e.items)==null?void 0:o.find(s=>s.isActive());return r&&!r.default?{...r,icon:r!=null&&r.icon?r==null?void 0:r.icon:e==null?void 0:e.icon}:{title:e.tooltip,icon:e.icon,isActive:()=>!1}},[e]);return n.jsxs(le,{children:[n.jsx(de,{disabled:e==null?void 0:e.disabled,asChild:!0,children:n.jsx(j,{customClass:"!richtext-w-12 richtext-h-12",icon:e==null?void 0:e.icon,tooltip:e==null?void 0:e.tooltip,disabled:e==null?void 0:e.disabled,children:n.jsx(Rn,{className:"richtext-w-3 richtext-h-3 richtext-text-gray-500"})})}),n.jsx(ce,{className:"w-full",children:(i=e==null?void 0:e.items)==null?void 0:i.map((r,a)=>n.jsxs(ve,{checked:t.title===r.title,onClick:r.action,className:"richtext-flex richtext-items-center richtext-gap-3",children:[n.jsx($,{name:r==null?void 0:r.icon}),n.jsx("span",{className:"richtext-ml-1",children:r.title}),!!(r!=null&&r.shortcutKeys)&&n.jsx("span",{className:"richtext-ml-auto richtext-text-xs richtext-tracking-widest richtext-opacity-60",children:rt(r.shortcutKeys)})]},`more-mark-${a}`))})]})}const jo=f.Extension.create({name:"moreMark",addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),button({editor:t,extension:i,t:r}){const a=i.options.subscript,o=i.options.superscript,s={action:()=>t.commands.toggleSubscript(),isActive:()=>t.isActive("subscript")||!1,disabled:!t.can().toggleSubscript(),icon:"Subscript",title:r("editor.subscript.tooltip"),shortcutKeys:["mod","."]},c={action:()=>t.commands.toggleSuperscript(),isActive:()=>t.isActive("superscript")||!1,disabled:!t.can().toggleSuperscript(),icon:"Superscript",title:r("editor.superscript.tooltip"),shortcutKeys:["mod",","]},u=[];return a!==!1&&u.push(s),o!==!1&&u.push(c),{component:yo,componentProps:{icon:"Type",tooltip:r("editor.moremark"),disabled:!t.isEditable,items:u}}}}},addExtensions(){const e=[];return this.options.subscript!==!1&&e.push(f.Subscript.configure(this.options.subscript)),this.options.superscript!==!1&&e.push(f.Superscript.configure(this.options.superscript)),e}}),ko=f.Extension.create({name:"indent",addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),types:["paragraph","heading","blockquote"],minIndent:pe.min,maxIndent:pe.max,button({editor:t,t:i}){return[{component:j,componentProps:{action:()=>{t.commands.indent()},shortcutKeys:["Tab"],icon:"IndentIncrease",tooltip:i("editor.indent.tooltip")}},{component:j,componentProps:{action:()=>{t.commands.outdent()},shortcutKeys:["Shift","Tab"],icon:"IndentDecrease",tooltip:i("editor.outdent.tooltip")}}]}}},addGlobalAttributes(){return[{types:this.options.types,attributes:{indent:{default:0,parseHTML:e=>{const t=e.dataset.indent;return(t?Number.parseInt(t,10):0)||0},renderHTML:e=>e.indent?{"data-indent":e.indent}:{}}}}]},addCommands(){return{indent:()=>Qt({delta:pe.more,types:this.options.types}),outdent:()=>Qt({delta:pe.less,types:this.options.types})}},addKeyboardShortcuts(){return{Tab:()=>this.editor.commands.indent(),"Shift-Tab":()=>this.editor.commands.outdent()}}});function Co(e){return Number.parseFloat(e.replace("%",""))/100}function No(e){const{t}=b.useLocale(),[i,r]=l.useState("default");function a(s){s==="default"?e.editor.commands.unsetLineHeight():e.editor.commands.setLineHeight(s),r(s)}const o=l.useMemo(()=>{const u=e.editor.extensionManager.extensions.find(d=>d.name==="lineHeight").options.lineHeights.map(d=>({label:Co(d),value:d}));return u.unshift({label:t("editor.default"),value:"default"}),u},[e]);return n.jsxs(le,{children:[n.jsx(de,{disabled:e==null?void 0:e.disabled,asChild:!0,children:n.jsx(j,{customClass:"!richtext-w-12 richtext-h-12",icon:"LineHeight",tooltip:e==null?void 0:e.tooltip,disabled:e==null?void 0:e.disabled,children:n.jsx($,{className:"richtext-w-3 richtext-h-3 richtext-ml-1 richtext-text-zinc-500",name:"MenuDown"})})}),n.jsx(ce,{className:"richtext-min-w-24",children:o==null?void 0:o.map((s,c)=>n.jsx(ve,{checked:s.value===i,onClick:()=>a(s.value),children:s.label},`lineHeight-${c}`))})]})}const So=["paragraph","heading","list_item","todo_item"];function To(e,t){const{selection:i,doc:r}=e;if(!i||!r||!(i instanceof v.TextSelection||i instanceof v.AllSelection))return e;const{from:a,to:o}=i,s=[],c=t&&t!==b.DEFAULT_LINE_HEIGHT?t:null;if(r.nodesBetween(a,o,(u,d)=>{const h=u.type;return So.includes(h.name)?((u.attrs.lineHeight||null)!==c&&s.push({node:u,pos:d,nodeType:h}),h.name!=="list_item"&&h.name!=="todo_item"):!0}),s.length===0)return e;for(const u of s){const{node:d,pos:h,nodeType:m}=u;let{attrs:x}=d;x={...x,lineHeight:c},e=e.setNodeMarkup(h,m,x,d.marks)}return e}function Ao(e){return({state:t,dispatch:i})=>{const{selection:r}=t;let{tr:a}=t;return a=a.setSelection(r),a=To(a,e),a.docChanged?(i&&i(a),!0):!1}}const Lo=f.Extension.create({name:"lineHeight",addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),types:["paragraph","heading","list_item","todo_item"],lineHeights:b.DEFAULT_LINE_HEIGHT_LIST,defaultHeight:b.DEFAULT_LINE_HEIGHT,button({editor:t,t:i}){return{component:No,componentProps:{editor:t,tooltip:i("editor.lineheight.tooltip")}}}}},addGlobalAttributes(){return[{types:this.options.types,attributes:{lineHeight:{default:null,parseHTML:e=>e.style.lineHeight||this.options.defaultHeight,renderHTML:e=>e.lineHeight===this.options.defaultHeight||!e.lineHeight?{}:{style:`line-height: ${e.lineHeight}`}}}}]},addCommands(){return{setLineHeight:e=>Ao(e),unsetLineHeight:()=>({commands:e})=>this.options.types.every(t=>e.resetAttributes(t,"lineHeight"))}}}),Fn=Ie.proxy({isOpen:!1});function Mo(){return Ie.useSnapshot(Fn)}const Se={setOpen:e=>{Fn.isOpen=e}},Vn=Ie.proxy({isOpen:!1});function Eo(){return Ie.useSnapshot(Vn)}const Be={setOpen:e=>{Vn.isOpen=e}};function Io(e){const t=[{name:"format",title:b.localeActions.t("editor.slash.format"),commands:[]},{name:"insert",title:b.localeActions.t("editor.slash.insert"),commands:[]}];return e.forEach(i=>{i.name.toLowerCase()==="heading"&&i.options.levels.forEach(r=>{t[0].commands.push({name:`heading${r}`,label:b.localeActions.t(`editor.heading.h${r}.tooltip`),aliases:[`h${r}`,"bt",`bt${r}`],iconName:`Heading${r}`,action:({editor:a,range:o})=>{a.chain().focus().deleteRange(o).setHeading({level:r}).run()}})}),i.name.toLowerCase()==="bulletlist"&&t[0].commands.push({name:"bulletList",label:b.localeActions.t("editor.bulletlist.tooltip"),aliases:["ul","yxlb"],iconName:"List",action:({editor:r,range:a})=>{r.chain().focus().deleteRange(a).toggleBulletList().run()}}),i.name.toLowerCase()==="orderedlist"&&t[0].commands.push({name:"numberedList",label:b.localeActions.t("editor.orderedlist.tooltip"),aliases:["ol","yxlb"],iconName:"ListOrdered",action:({editor:r,range:a})=>{r.chain().focus().deleteRange(a).toggleOrderedList().run()}}),i.name.toLowerCase()==="tasklist"&&t[0].commands.push({name:"taskList",label:b.localeActions.t("editor.tasklist.tooltip"),iconName:"ListTodo",description:"Task list with todo items",aliases:["todo"],action:({editor:r,range:a})=>{r.chain().focus().deleteRange(a).toggleTaskList().run()}}),i.name.toLowerCase()==="blockquote"&&t[0].commands.push({name:"blockquote",label:b.localeActions.t("editor.blockquote.tooltip"),description:"插入引入格式",aliases:["yr"],iconName:"TextQuote",action:({editor:r,range:a})=>{r.chain().focus().deleteRange(a).setBlockquote().run()}}),i.name.toLowerCase()==="codeblock"&&t[0].commands.push({name:"codeBlock",label:b.localeActions.t("editor.codeblock.tooltip"),iconName:"Code2",description:"Code block with syntax highlighting",shouldBeHidden:r=>r.isActive("columns"),action:({editor:r,range:a})=>{r.chain().focus().deleteRange(a).setCodeBlock().run()}}),i.name.toLowerCase()==="image"&&t[1].commands.push({name:"image",label:b.localeActions.t("editor.image.tooltip"),iconName:"ImageUp",description:"Insert a image",aliases:["image","tp","tupian"],shouldBeHidden:r=>r.isActive("columns"),action:({editor:r,range:a})=>{r.chain().focus().deleteRange(a).run(),Se.setOpen(!0)}}),i.name.toLowerCase()==="video"&&t[1].commands.push({name:"video",label:b.localeActions.t("editor.video.tooltip"),iconName:"Video",description:"Insert a video",aliases:["video","sp","shipin"],shouldBeHidden:r=>r.isActive("columns"),action:({editor:r,range:a})=>{r.chain().focus().deleteRange(a).run(),Be.setOpen(!0)}}),i.name.toLowerCase()==="table"&&t[1].commands.push({name:"table",label:b.localeActions.t("editor.table.tooltip"),iconName:"Table",description:"Insert a table",aliases:["table","bg","biaoge","biao"],shouldBeHidden:r=>r.isActive("columns"),action:({editor:r,range:a})=>{r.chain().focus().deleteRange(a).insertTable({rows:3,cols:3,withHeaderRow:!1}).run()}}),i.name.toLowerCase()==="horizontalrule"&&t[1].commands.push({name:"horizontalRule",label:b.localeActions.t("editor.horizontalrule.tooltip"),iconName:"Minus",description:"Insert a horizontal divider",aliases:["hr","fgx","fg"],action:({editor:r,range:a})=>{r.chain().focus().deleteRange(a).setHorizontalRule().run()}}),i.name.toLowerCase()==="columns"&&t[1].commands.push({name:"columns",label:b.localeActions.t("editor.columns.tooltip"),iconName:"Columns2",description:"Add two column content",action:({editor:r})=>{r.chain().focus().insertColumns({cols:2}).run()}})}),t}function Ro(e,t){var S,I;const[i,r]=l.useState(0),[a,o]=l.useState(0),s=l.useRef(null),{t:c}=b.useLocale(),u=l.useRef([]);l.useImperativeHandle(t,()=>({onKeyDown:d})),l.useEffect(()=>{if(!s.current)return;const k=a*1e3+i,y=u.current[k];y&&y.scrollIntoView({behavior:"smooth",block:"nearest"})},[i,a]);function d({event:k}){return k.key==="ArrowUp"?(h(),!0):k.key==="ArrowDown"?(m(),!0):k.key==="Enter"?(x(),!0):!1}function h(){var C;if(e.items.length===0)return!1;let k=i-1,y=a;k<0&&(y=a-1,k=((C=e.items[y])==null?void 0:C.commands.length)-1||0),y<0&&(y=e.items.length-1,k=e.items[y].commands.length-1),r(k),o(y)}function m(){if(e.items.length===0)return!1;const k=e.items[a].commands;let y=i+1,C=a;k.length-1<y&&(y=0,C=a+1),e.items.length-1<C&&(C=0),r(y),o(C)}function x(){if(e.items.length===0||a===-1||i===-1)return!1;g(a,i)}function g(k,y){const C=e.items[k].commands[y];e.command(C)}function p(k,y){g(k,y)}function w(k,y,C){u.current[k*1e3+y]=C}return n.jsx("div",{className:"!richtext-bg-white richtext-rounded-lg dark:!richtext-bg-black richtext-shadow-sm !richtext-border !richtext-border-neutral-200 dark:!richtext-border-neutral-800 !richtext-text-black richtext-max-h-[min(80vh,24rem)] richtext-overflow-auto richtext-flex-wrap richtext-mb-8 richtext-p-1",ref:s,children:(S=e==null?void 0:e.items)!=null&&S.length?n.jsx("div",{className:"richtext-grid richtext-grid-cols-1 richtext-gap-0.5 richtext-min-w-48",children:(I=e==null?void 0:e.items)==null?void 0:I.map((k,y)=>n.jsxs(l.Fragment,{children:[n.jsx("div",{className:"!richtext-text-neutral-500 richtext-text-[0.65rem] richtext-col-[1/-1] richtext-mx-2 richtext-mt-2 richtext-font-semibold richtext-tracking-wider richtext-select-none richtext-uppercase first:richtext-mt-0.5",children:k.title}),k.commands.map((C,T)=>n.jsxs("button",{className:P("richtext-flex richtext-items-center richtext-gap-3 richtext-px-2 richtext-py-1.5 richtext-text-sm !richtext-text-neutral-800 dark:!richtext-text-neutral-200 richtext-text-left richtext-w-full richtext-rounded-sm richtext-outline-none richtext-transition-colors !richtext-bg-transparent hover:!richtext-bg-accent ",{"slash-command-active":a===y&&i===T}),ref:E=>w(y,T,E),onClick:()=>p(y,T),children:[C.iconUrl&&n.jsx("img",{className:"richtext-w-6 richtext-h-6",src:C.iconUrl,alt:""}),C.iconName&&n.jsx($,{name:C.iconName,className:"!richtext-mr-1 !richtext-text-lg"}),C.label]},`command-${T}`))]},`slash-${k.title}`))}):n.jsx("div",{className:"richtext-p-3",children:n.jsx("span",{className:"richtext-text-xs richtext-text-gray-800 dark:richtext-text-gray-100",children:c("editor.slash.empty")})})})}const Ho=l.forwardRef(Ro),fe="slashCommand";let V;const zo=f.Extension.create({name:fe,priority:200,onCreate(){V=nt("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[f.Suggestion({editor:this.editor,char:"/",allowSpaces:!0,startOfLine:!0,pluginKey:new v.PluginKey(fe),allow:({state:e,range:t})=>{var d,h,m;const i=e.doc.resolve(t.from),r=i.depth===1,a=i.parent.type.name==="paragraph",o=((d=i.parent.textContent)==null?void 0:d.charAt(0))==="/",s=this.editor.isActive("column"),c=(m=i.parent.textContent)==null?void 0:m.slice(Math.max(0,(h=i.parent.textContent)==null?void 0:h.indexOf("/"))),u=!(c!=null&&c.endsWith(" "));return(r&&a&&o||s&&a&&o)&&u},command:({editor:e,range:t,props:i})=>{const{view:r}=e;i.action({editor:e,range:t}),r.focus()},items:({query:e,editor:t})=>Io(t.extensionManager.extensions).map(s=>({...s,commands:s.commands.filter(c=>{const u=c.label.toLowerCase().trim(),d=e.toLowerCase().trim();if(c.aliases){const h=c.aliases.map(g=>g.toLowerCase().trim()),m=u.match(d),x=h.some(g=>g.match(d));return m||x}return u.match(d)}).filter(c=>c.shouldBeHidden?!c.shouldBeHidden(this.editor):!0)})).filter(s=>s.commands.length>0).map(s=>({...s,commands:s.commands.map(c=>({...c,isEnabled:!0}))})),render:()=>{let e,t=null;return{onStart:i=>{var o;e=new f.ReactRenderer(Ho,{props:i,editor:i.editor});const{view:r}=i.editor,a=()=>{if(!i.clientRect)return i.editor.storage[fe].rect;const s=i.clientRect();if(!s)return i.editor.storage[fe].rect;let c=s.y;if(s.top+e.element.offsetHeight+40>window.innerHeight){const u=s.top+e.element.offsetHeight-window.innerHeight+40;c=s.y-u}return new DOMRect(s.x,c,s.width,s.height)};t=()=>{V==null||V[0].setProps({getReferenceClientRect:a})},(o=r.dom.parentElement)==null||o.addEventListener("scroll",t),V==null||V[0].setProps({getReferenceClientRect:a,appendTo:()=>document.body,content:e.element}),V==null||V[0].show()},onUpdate(i){var s;e.updateProps(i);const{view:r}=i.editor,a=()=>{if(!i.clientRect)return i.editor.storage[fe].rect;const c=i.clientRect();return c?new DOMRect(c.x,c.y,c.width,c.height):i.editor.storage[fe].rect},o=()=>{V==null||V[0].setProps({getReferenceClientRect:a})};(s=r.dom.parentElement)==null||s.addEventListener("scroll",o),i.editor.storage[fe].rect=i.clientRect?a():{width:0,height:0,left:0,top:0,right:0,bottom:0},V==null||V[0].setProps({getReferenceClientRect:a})},onKeyDown(i){var r;return i.event.key==="Escape"?(V==null||V[0].hide(),!0):(V!=null&&V[0].state.isShown||V==null||V[0].show(),(r=e.ref)==null?void 0:r.onKeyDown(i))},onExit(i){var r;if(V==null||V[0].hide(),t){const{view:a}=i.editor;(r=a.dom.parentElement)==null||r.removeEventListener("scroll",t)}e.destroy()}}}})]},addStorage(){return{rect:{width:0,height:0,left:0,top:0,right:0,bottom:0}}}}),Xe={TOP_LEFT:"tl",TOP_RIGHT:"tr",BOTTOM_LEFT:"bl",BOTTOM_RIGHT:"br"};function Oo(e){var O,M;const[t,i]=l.useState({width:b.IMAGE_MAX_SIZE,height:b.IMAGE_MAX_SIZE}),[r,a]=l.useState({width:0,height:0}),[o]=l.useState([Xe.TOP_LEFT,Xe.TOP_RIGHT,Xe.BOTTOM_LEFT,Xe.BOTTOM_RIGHT]),[s,c]=l.useState(!1),[u,d]=l.useState({x:0,y:0,w:0,h:0,dir:""}),{align:h,inline:m}=(O=e==null?void 0:e.node)==null?void 0:O.attrs,x=l.useMemo(()=>{var H;const{src:L,alt:A,width:N,height:D}=(H=e==null?void 0:e.node)==null?void 0:H.attrs,z=v.isNumber(N)?`${N}px`:N,R=v.isNumber(D)?`${D}px`:D;return{src:L||void 0,alt:A||void 0,style:{width:z||void 0,height:R||void 0}}},[(M=e==null?void 0:e.node)==null?void 0:M.attrs]),g=l.useMemo(()=>{const{style:{width:L}}=x;return{width:L==="100%"?L:void 0}},[x]);function p(L){a({width:L.target.width,height:L.target.height})}function w(){const{editor:L,getPos:A}=e;L.commands.setNodeSelection(A())}const S=l.useCallback(v.throttle(()=>{const{editor:L}=e,{width:A}=getComputedStyle(L.view.dom);i(N=>({...N,width:Number.parseInt(A,10)}))},b.IMAGE_THROTTLE_WAIT_TIME),[e==null?void 0:e.editor]);function I(L,A){L.preventDefault(),L.stopPropagation();const N=r.width,D=r.height,z=N/D;let R=Number(e.node.attrs.width),H=Number(e.node.attrs.height);const U=t.width;R&&!H?(R=R>U?U:R,H=Math.round(R/z)):H&&!R?(R=Math.round(H*z),R=R>U?U:R):!R&&!H?(R=N>U?U:N,H=Math.round(R/z)):R=R>U?U:R,Te.flushSync(()=>{c(!0),d({x:L.clientX,y:L.clientY,w:R,h:H,dir:A})})}const k=l.useCallback(v.throttle(L=>{if(L.preventDefault(),L.stopPropagation(),!s)return;const{x:A,w:N,dir:D}=u,z=(L.clientX-A)*(/l/.test(D)?-1:1),R=v.clamp(N+z,b.IMAGE_MIN_SIZE,t.width);e.updateAttributes({width:R,height:null})},b.IMAGE_THROTTLE_WAIT_TIME),[s,u,t,e.updateAttributes]),y=l.useCallback(L=>{L.preventDefault(),L.stopPropagation(),s&&(Te.flushSync(()=>{d({x:0,y:0,w:0,h:0,dir:""}),c(!1)}),w())},[s,w]),C=l.useCallback(()=>{document==null||document.addEventListener("mousemove",k,!0),document==null||document.addEventListener("mouseup",y,!0)},[k,y]),T=l.useCallback(()=>{document==null||document.removeEventListener("mousemove",k,!0),document==null||document.removeEventListener("mouseup",y,!0)},[k,y]);l.useEffect(()=>(s?C():T(),()=>{T()}),[s,C,T]);const E=l.useMemo(()=>new ResizeObserver(()=>S()),[S]);return l.useEffect(()=>(E.observe(e.editor.view.dom),()=>{E.disconnect()}),[e.editor.view.dom,E]),n.jsx(f.NodeViewWrapper,{className:"image-view",style:{...g,textAlign:h,display:m?"inline":"block"},as:m?"span":"div",children:n.jsxs("div",{draggable:"true","data-drag-handle":!0,className:`image-view__body ${e!=null&&e.selected?"image-view__body--focused":""} ${s?"image-view__body--resizing":""}`,style:g,children:[n.jsx("img",{src:x.src,alt:x.alt,style:x.style,height:"auto",className:"image-view__body__image block",onLoad:p,onClick:w}),(e==null?void 0:e.editor.view.editable)&&((e==null?void 0:e.selected)||s)&&n.jsx("div",{className:"image-resizer",children:o==null?void 0:o.map(L=>n.jsx("span",{className:`image-resizer__handler image-resizer__handler--${L}`,onMouseDown:A=>I(A,L)},`image-dir-${L}`))})]})})}function Po({editor:e,imageInline:t,onClose:i}){const{t:r}=b.useLocale(),[a,o]=l.useState(!1),s=l.useRef(null),[c,u]=l.useState(),[d,h]=l.useState(""),m=l.useRef(null),[x,g]=l.useState({src:"",file:null});function p(y){if(s.current&&y.width&&y.height){const C=w(s.current,y);h(C)}}function w(y,C){const T=document.createElement("canvas"),E=y.naturalWidth/y.width,O=y.naturalHeight/y.height;T.width=C.width*E,T.height=C.height*O;const M=T.getContext("2d");return M&&(M.imageSmoothingEnabled=!1,M.drawImage(y,C.x*E,C.y*O,C.width*E,C.height*O,0,0,C.width*E,C.height*O)),T.toDataURL("image/png",1)}async function S(){var y,C;try{const T=await Ht(d,((y=x==null?void 0:x.file)==null?void 0:y.name)||"image.png"),E=(C=e.extensionManager.extensions.find(M=>M.name==="image"))==null?void 0:C.options;let O="";E.upload?O=await E.upload(T):O=URL.createObjectURL(T),e.chain().focus().setImageInline({src:O,inline:t}).run(),o(!1),g({src:"",file:null}),i()}catch(T){console.log("Error cropping image",T)}}function I(y){var C;y.preventDefault(),(C=m.current)==null||C.click()}const k=async y=>{var O;const C=(O=y==null?void 0:y.target)==null?void 0:O.files;if(!e||e.isDestroyed||C.length===0)return;const T=C[0],E=await sr(T);o(!0),g({src:E.src,file:T})};return n.jsxs(n.Fragment,{children:[n.jsx(F,{className:"richtext-w-full richtext-mt-1",size:"sm",onClick:I,children:r("editor.image.dialog.tab.uploadCrop")}),n.jsxs(je,{open:a,children:[n.jsx(ke,{}),n.jsxs(he,{children:[n.jsx(ue,{children:r("editor.image.dialog.tab.uploadCrop")}),n.jsx("div",{children:x.src&&n.jsx(ti,{crop:c,onChange:y=>u(y),onComplete:y=>p(y),className:"richtext-w-full",children:n.jsx("img",{ref:s,alt:"Crop me",src:x.src})})}),n.jsxs(ze,{children:[n.jsxs(F,{onClick:()=>{o(!1),g({src:"",file:null})},children:[r("editor.imageUpload.cancel"),n.jsx($,{name:"Trash2",className:"richtext-ml-[4px]"})]}),n.jsxs(F,{className:"richtext-w-fit",onClick:S,children:[r("editor.imageUpload.crop"),n.jsx($,{name:"Crop",className:"richtext-ml-[4px]"})]})]})]})]}),n.jsx("input",{type:"file",accept:"image/*",ref:m,multiple:!0,style:{display:"none"},onChange:k})]})}function Do(e){const{t}=b.useLocale(),i=Mo(),[r,a]=l.useState(""),o=l.useRef(null),[s,c]=l.useState(!1);async function u(m){var S,I;const x=(S=m==null?void 0:m.target)==null?void 0:S.files;if(!e.editor||e.editor.isDestroyed||x.length===0)return;const g=x[0],p=(I=e.editor.extensionManager.extensions.find(k=>k.name==="image"))==null?void 0:I.options;let w="";p.upload?w=await p.upload(g):w=URL.createObjectURL(g),e.editor.chain().focus().setImageInline({src:w,inline:s}).run(),Se.setOpen(!1),c(!1)}function d(m){m.preventDefault(),e.editor.chain().focus().setImageInline({src:r,inline:s}).run(),Se.setOpen(!1),c(!1)}function h(m){var x;m.preventDefault(),(x=o.current)==null||x.click()}return n.jsxs(je,{open:i.isOpen,onOpenChange:Se.setOpen,children:[n.jsx(ke,{asChild:!0,children:n.jsx(j,{icon:e.icon,action:()=>Se.setOpen(!0),tooltip:e.tooltip})}),n.jsxs(he,{children:[n.jsx(ue,{children:t("editor.image.dialog.title")}),n.jsxs(It,{defaultValue:"upload",activationMode:"manual",children:[n.jsxs(ot,{className:"richtext-grid richtext-w-full richtext-grid-cols-2",children:[n.jsxs(Ae,{value:"upload",children:[t("editor.image.dialog.tab.upload")," "]}),n.jsxs(Ae,{value:"link",children:[" ",t("editor.image.dialog.tab.url")," "]})]}),n.jsxs("div",{className:"richtext-flex richtext-items-center richtext-gap-[4px] richtext-my-[10px]",children:[n.jsx(wn,{checked:s,onCheckedChange:m=>{c(m)}}),n.jsx(X,{children:t("editor.link.dialog.inline")})]}),n.jsxs(Le,{value:"upload",children:[n.jsxs("div",{className:"richtext-flex richtext-items-center richtext-gap-[10px]",children:[n.jsx(F,{className:"richtext-w-full richtext-mt-1",size:"sm",onClick:h,children:t("editor.image.dialog.tab.upload")}),n.jsx(Po,{editor:e.editor,imageInline:s,onClose:()=>Se.setOpen(!1)})]}),n.jsx("input",{type:"file",accept:"image/*",ref:o,multiple:!0,style:{display:"none"},onChange:u})]}),n.jsx(Le,{value:"link",children:n.jsx("form",{onSubmit:d,children:n.jsxs("div",{className:"richtext-flex richtext-items-center richtext-gap-2",children:[n.jsx(Z,{type:"url",autoFocus:!0,value:r,onChange:m=>a(m.target.value),required:!0,placeholder:t("editor.image.dialog.placeholder")}),n.jsx(F,{type:"submit",children:t("editor.image.dialog.button.apply")})]})})})]})]})]})}const Bo=f.Image.extend({group:"inline",inline:!0,defining:!0,draggable:!0,selectable:!0,addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),upload:()=>Promise.reject("Image Upload Function"),button:({editor:t,extension:i,t:r})=>{var a,o;return{component:Do,componentProps:{action:()=>{},upload:i.options.upload,disabled:!((o=(a=t.can()).setImage)!=null&&o.call(a,{})),icon:"ImageUp",tooltip:r("editor.image.tooltip"),editor:t}}}}},addAttributes(){var e;return{...(e=this.parent)==null?void 0:e.call(this),width:{default:null,parseHTML:t=>{const i=t.style.width||t.getAttribute("width")||null;return i?Number.parseInt(i,10):null},renderHTML:t=>({width:t.width})},align:{default:"center",parseHTML:t=>t.getAttribute("align"),renderHTML:t=>({align:t.align})},inline:{default:!1,parseHTML:t=>!!t.getAttribute("inline"),renderHTML:t=>({inline:t.inline})}}},addNodeView(){return f.ReactNodeViewRenderer(Oo)},addCommands(){var e;return{...(e=this.parent)==null?void 0:e.call(this),setImageInline:t=>({commands:i})=>i.insertContent({type:this.name,attrs:t}),updateImage:t=>({commands:i})=>i.updateAttributes(this.name,t),setAlignImage:t=>({commands:i})=>i.updateAttributes(this.name,{align:t})}},renderHTML({HTMLAttributes:e}){const{align:t,inline:i}=e,r=t?`text-align: ${t};`:"";return[i?"span":"div",{style:r,class:"image"},["img",f.mergeAttributes({height:"auto"},this.options.HTMLAttributes,e)]]},parseHTML(){return[{tag:"span[class=image]",getAttrs:e=>{const t=e.querySelector("img"),i=t==null?void 0:t.getAttribute("width");return{src:t==null?void 0:t.getAttribute("src"),alt:t==null?void 0:t.getAttribute("alt"),caption:t==null?void 0:t.getAttribute("caption"),width:i?Number.parseInt(i,10):null,align:(t==null?void 0:t.getAttribute("align"))||e.style.textAlign||null,inline:(t==null?void 0:t.getAttribute("inline"))||!1}}},{tag:"div[class=image]",getAttrs:e=>{const t=e.querySelector("img"),i=t==null?void 0:t.getAttribute("width");return{src:t==null?void 0:t.getAttribute("src"),alt:t==null?void 0:t.getAttribute("alt"),caption:t==null?void 0:t.getAttribute("caption"),width:i?Number.parseInt(i,10):null,align:(t==null?void 0:t.getAttribute("align"))||e.style.textAlign||null,inline:(t==null?void 0:t.getAttribute("inline"))||!1}}}]}});function $o(e){const{t}=b.useLocale(),[i,r]=l.useState(""),a=l.useRef(null),o=Eo();async function s(d){var p,w;const h=(p=d==null?void 0:d.target)==null?void 0:p.files;if(!e.editor||e.editor.isDestroyed||h.length===0)return;const m=h[0],x=(w=e.editor.extensionManager.extensions.find(S=>S.name==="video"))==null?void 0:w.options;let g="";x.upload?g=await x.upload(m):g=URL.createObjectURL(m),e.editor.chain().setVideo({src:g,width:"100%"}).focus().run(),Be.setOpen(!1)}function c(d){d.preventDefault(),e.editor.chain().setVideo({src:i,width:"100%"}).focus().run(),Be.setOpen(!1)}function u(d){var h;d.preventDefault(),(h=a.current)==null||h.click()}return n.jsxs(je,{open:o.isOpen,onOpenChange:Be.setOpen,children:[n.jsx(ke,{asChild:!0,children:n.jsx(j,{icon:e.icon,action:()=>Be.setOpen(!0),tooltip:e.tooltip})}),n.jsxs(he,{children:[n.jsx(ue,{children:t("editor.video.dialog.title")}),n.jsxs(It,{defaultValue:"upload",activationMode:"manual",children:[n.jsxs(ot,{className:"richtext-grid richtext-w-full richtext-grid-cols-2",children:[n.jsxs(Ae,{value:"upload",children:[t("editor.video.dialog.tab.upload")," "]}),n.jsxs(Ae,{value:"link",children:[" ",t("editor.video.dialog.link")," "]})]}),n.jsxs(Le,{value:"upload",children:[n.jsx("div",{className:"richtext-flex richtext-items-center richtext-gap-[10px]",children:n.jsx(F,{className:"richtext-w-full richtext-mt-1",size:"sm",onClick:u,children:t("editor.video.dialog.tab.upload")})}),n.jsx("input",{type:"file",accept:"video/*",ref:a,multiple:!0,style:{display:"none"},onChange:s})]}),n.jsx(Le,{value:"link",children:n.jsx("form",{onSubmit:c,children:n.jsxs("div",{className:"richtext-flex richtext-items-center richtext-gap-2",children:[n.jsx(Z,{type:"url",autoFocus:!0,value:i,onChange:d=>r(d.target.value),required:!0,placeholder:t("editor.video.dialog.placeholder")}),n.jsx(F,{type:"submit",children:t("editor.video.dialog.button.apply")})]})})})]})]})]})}function Fo(e){return e=e.replace("https://youtu.be/","https://www.youtube.com/watch?v=").replace("watch?v=","embed/"),e=e.replace("https://vimeo.com/","https://player.vimeo.com/video/"),/^https?:\/\/www.bilibili.com\/video\/.*/i.test(e)&&(e=e.replace(/\?.*$/,"").replace("https://www.bilibili.com/video/","https://player.bilibili.com/player.html?bvid=")),e.includes("drive.google.com")&&(e=e.replace("/view","/preview")),e}const Vo=f.Node.create({name:"video",group:"block",atom:!0,draggable:!0,addOptions(){return{divider:!1,spacer:!1,allowFullscreen:!0,upload:void 0,frameborder:!1,width:b.VIDEO_SIZE["size-medium"],HTMLAttributes:{class:"iframe-wrapper",style:"display: flex;justify-content: center;"},button:({editor:e,t})=>{var i,r;return{component:$o,componentProps:{action:()=>{},isActive:()=>e.isActive("video")||!1,disabled:!((r=(i=e.can()).setVideo)!=null&&r.call(i,{})),icon:"Video",tooltip:t("editor.video.tooltip"),editor:e}}}}},addAttributes(){return{src:{default:null,renderHTML:({src:e})=>({src:e?Fo(e):null})},width:{default:this.options.width,renderHTML:({width:e})=>({width:Hi(e)})},frameborder:{default:this.options.frameborder?1:0,parseHTML:()=>this.options.frameborder?1:0},allowfullscreen:{default:this.options.allowFullscreen,parseHTML:()=>this.options.allowFullscreen}}},parseHTML(){return[{tag:"div[data-video] iframe"}]},renderHTML({HTMLAttributes:e}){const{width:t="100%"}=e??{},i={...e,width:"100%",height:"100%"},r=`position: relative;overflow: hidden;display: flex;flex: 1;max-width: ${t};`,a=`flex: 1;padding-bottom: ${9/16*100}%;`,c=["div",{style:r},["div",{style:a}],["iframe",i]];return["div",{...this.options.HTMLAttributes,"data-video":""},c]},addCommands(){return{setVideo:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e}),updateVideo:e=>({commands:t})=>t.updateAttributes(this.name,e)}}});function Uo(e,t,i){if(!e.doc)return e;const r=e.doc.nodeAt(t);if(!r||i===r.attrs.backgroundColor)return e;const a={...r.attrs,backgroundColor:i};return e.setNodeMarkup(t,r.type,a,r.marks)}function Wo(e,t,i){const{doc:r,selection:a}=e;return!r||!a||!(a instanceof v.CellSelection)||a.forEachCell((o,s)=>{e=Uo(e,s,i)}),e}function rn(e,t){return({tr:i,state:r,dispatch:a})=>{const{selection:o}=r;return i=i.setSelection(o),i=Wo(i,t,e),i.docChanged?(a==null||a(i),!0):!1}}const qo=f.Extension.create({name:"tableCellBackground",addOptions(){return{types:["tableCell"],HTMLAttributes:{}}},addGlobalAttributes(){return[{types:this.options.types,attributes:{backgroundColor:{parseHTML:e=>e.style.backgroundColor||"",renderHTML:e=>!e.backgroundColor||e.backgroundColor===""?{}:{style:`background-color: ${e.backgroundColor}`}}}}]},addCommands(){return{setTableCellBackground:e=>rn(e,this.options),unsetTableCellBackground:()=>rn("",this.options)}}}),Go=/(android|bb\d+|meego).+mobile|armv7l|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series[46]0|samsungbrowser.*mobile|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,Ko=/CrOS/,Zo=/android|ipad|playbook|silk/i;function an(e={}){let t=e.ua||typeof navigator<"u"&&navigator.userAgent;return t&&typeof t=="object"&&t.headers&&typeof t.headers["user-agent"]=="string"&&(t=t.headers["user-agent"]),typeof t!="string"?!1:!!(Go.test(t)&&!Ko.test(t)||e.tablet&&Zo.test(t)||e.tablet&&e.featureDetect&&navigator&&navigator.maxTouchPoints>1&&t.includes("Macintosh")&&t.includes("Safari"))}const on=e=>Array.from({length:e}).map((t,i)=>i+1);function Xo(e){var h;const[t,i]=l.useState(!0),[r,a]=l.useState({rows:an()?b.TABLE_MAX_GRID_SIZE:b.TABLE_INIT_GRID_SIZE,cols:an()?b.TABLE_MAX_GRID_SIZE:b.TABLE_INIT_GRID_SIZE}),[o,s]=l.useState({rows:b.TABLE_DEFAULT_SELECTED_GRID_SIZE,cols:b.TABLE_DEFAULT_SELECTED_GRID_SIZE});function c(m,x){m===r.rows&&a(g=>({...g,rows:Math.min(m+1,b.TABLE_MAX_GRID_SIZE)})),x===r.cols&&a(g=>({...g,cols:Math.min(x+1,b.TABLE_MAX_GRID_SIZE)})),s({rows:m,cols:x})}function u(m,x){e==null||e.createTable({rows:m,cols:x,withHeaderRow:t}),d()}function d(){i(!1),a({rows:b.TABLE_INIT_GRID_SIZE,cols:b.TABLE_INIT_GRID_SIZE}),s({rows:b.TABLE_DEFAULT_SELECTED_GRID_SIZE,cols:b.TABLE_DEFAULT_SELECTED_GRID_SIZE})}return n.jsxs(ne,{modal:!0,children:[n.jsx(ie,{asChild:!0,children:e==null?void 0:e.children}),n.jsx(Q,{className:"richtext-w-full !richtext-p-2",align:"start",side:"bottom",children:n.jsxs("div",{className:"richtext-p-0 table-grid-size-editor",children:[n.jsx("div",{className:"richtext-flex richtext-flex-col richtext-flex-wrap richtext-justify-between richtext-gap-1",children:(h=on(r==null?void 0:r.rows))==null?void 0:h.map(m=>{var x;return n.jsx("div",{className:"richtext-flex richtext-gap-1",children:(x=on(r==null?void 0:r.cols))==null?void 0:x.map(g=>n.jsx("div",{className:`richtext-cursor-pointer richtext-border-border ${g<=o.cols&&m<=o.rows&&"!richtext-bg-foreground tableCellActive"}`,onMouseOver:()=>c(m,g),onMouseDown:()=>u(m,g),children:n.jsx("div",{className:"richtext-w-4 richtext-h-4 richtext-p-1 !richtext-border richtext-rounded-[2px] richtext-box-border richtext-border-solid !richtext-border-border"})},`c-${g}`))},`r-${m}`)})}),n.jsxs("div",{className:"richtext-mt-2 richtext-text-sm richtext-text-center richtext-text-zinc-600",children:[o.rows," ","x",o.cols]})]})})]})}function Jo(e){function t(i){e.disabled||e.editor.chain().focus().insertTable({...i,withHeaderRow:!1}).run()}return n.jsx(Xo,{createTable:t,children:n.jsx(j,{icon:e==null?void 0:e.icon,tooltip:e==null?void 0:e.tooltip,disabled:e==null?void 0:e.disabled,color:e==null?void 0:e.color,action:e==null?void 0:e.action,isActive:e==null?void 0:e.isActive})})}const Yo=f.Table.extend({addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),resizable:!0,lastColumnResizable:!0,allowTableNodeSelection:!1,button:({editor:t,t:i})=>({component:Jo,componentProps:{disabled:t.isActive("table")||!1,icon:"Table",tooltip:i("editor.table.tooltip"),editor:t}})}},addExtensions(){return[f.TableRow.configure(this.options.tableRow),f.TableHeader.configure(this.options.tableHeader),f.TableCell.configure(this.options.tableCell),qo.configure(this.options.tableCellBackground)]}}),Qo=f.Extension.create({name:"painter",addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),button:({editor:t,t:i})=>({component:j,componentProps:{action:()=>{t.commands.setPainter(t==null?void 0:t.state.selection.$head.marks())},icon:"PaintRoller",tooltip:i("editor.format")}})}},addCommands(){return{setPainter:e=>({view:{dispatch:t,state:{tr:i},dom:r}})=>{const s=`url("data:image/svg+xml;utf8,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="#000" d="M9 22v-6H4V7q0-1.65 1.175-2.825T8 3h12v13h-5v6zM6 10h12V5h-1v4h-2V5h-1v2h-2V5H8q-.825 0-1.412.588T6 7zm0 4h12v-2H6zm0 0v-2z"/></svg>')}"), auto`;return r.style.cursor=s,t(i.setMeta("painterAction",{type:"start",marks:e})),!0}}},addProseMirrorPlugins(){return[new v.Plugin({key:new v.PluginKey("format-painter"),state:{init:()=>[],apply:(e,t)=>{const i=e.getMeta("painterAction");return i&&i.type==="start"?t=i.marks:i&&i.type==="end"&&(t=[]),t}},props:{handleDOMEvents:{mousedown(e,t){const i=this.getState(e.state);if(!i||i.length===0)return e.dom.style.cursor="",!1;const r=()=>{document.removeEventListener("mouseup",r);let{dispatch:a,state:{tr:o,selection:s},dom:c}=e;c.style.cursor="",o=o.removeMark(s.from,s.to);for(const u of i)u.type.name!=="link"&&(o=o.addMark(s.from,s.to,u));a(o.setMeta("painterAction",{type:"end"}))};return document.addEventListener("mouseup",r),!0}}}})]}});function es({editor:e,...t}){const{t:i}=b.useLocale(),[r,a]=l.useState(-1),[o,s]=l.useState([]),[c,u]=l.useState(""),[d,h]=l.useState(""),[m,x]=l.useState(!1),[g,p]=l.useState(!1);return l.useEffect(()=>{m||(u(""),h(""),a(-1),s([]),e.commands.setSearchTerm(""),e.commands.setReplaceTerm(""))},[e,m]),l.useEffect(()=>{m&&e&&e.commands&&e.commands.setSearchTerm&&e.commands.setSearchTerm(c)},[m,c,e]),l.useEffect(()=>{m&&e&&e.commands&&e.commands.setReplaceTerm&&e.commands.setReplaceTerm(d)},[m,d,e]),l.useEffect(()=>{if(!e)return;const w=e.extensionManager.extensions.find(I=>I.name===Un.name);if(!w)return;const S=()=>{if(!m)return;const I=w?w.storage.currentIndex:-1,k=w?w.storage.results:[];a(y=>y!==I?I:y),s(y=>v.deepEqual(y,k)?y:k)};return window.addEventListener(Nt,S),()=>{w&&window.removeEventListener(Nt,S)}},[m,e]),n.jsxs(ne,{open:m,onOpenChange:x,children:[n.jsx(ie,{disabled:t==null?void 0:t.disabled,asChild:!0,children:n.jsx(j,{tooltip:t==null?void 0:t.tooltip,isActive:t==null?void 0:t.isActive,disabled:t==null?void 0:t.disabled,children:n.jsx($,{name:t==null?void 0:t.icon})})}),n.jsxs(Q,{hideWhenDetached:!0,className:"richtext-w-full",align:"start",side:"bottom",children:[n.jsxs("div",{className:"richtext-mb-[6px] richtext-flex richtext-items-center richtext-justify-between",children:[n.jsx(X,{children:i("editor.search.dialog.text")}),n.jsx("span",{className:"richtext-font-semibold",children:o.length?`${r+1}/${o.length}`:"0/0"})]}),n.jsxs("div",{className:"richtext-flex richtext-w-full richtext-max-w-sm richtext-items-center richtext-gap-1.5 richtext-mb-[10px]",children:[n.jsx(Z,{type:"text",required:!0,className:"richtext-w-full",placeholder:"Text",autoFocus:!0,value:c,onChange:w=>u(w.target.value)}),n.jsx(F,{disabled:!o.length,className:"richtext-flex-1",onClick:e.commands.goToPrevSearchResult,children:n.jsx($,{name:"ChevronUp"})}),n.jsx(F,{disabled:!o.length,className:"richtext-flex-1",onClick:e.commands.goToNextSearchResult,children:n.jsx($,{name:"ChevronDown"})})]}),n.jsx(X,{className:"richtext-mb-[6px]",children:i("editor.replace.dialog.text")}),n.jsx("div",{className:"richtext-flex richtext-w-full richtext-max-w-sm richtext-items-center richtext-gap-1.5 richtext-mb-[5px]",children:n.jsx("div",{className:"richtext-relative richtext-items-center richtext-w-full richtext-max-w-sm",children:n.jsx(Z,{type:"text",required:!0,className:"richtext-w-80",placeholder:"Text",value:d,onChange:w=>h(w.target.value)})})}),n.jsxs("div",{className:"richtext-flex richtext-items-center richtext-space-x-2 richtext-mb-[10px]",children:[n.jsx(Et,{checked:g,onCheckedChange:w=>{p(w),e.commands.setCaseSensitive(w)}}),n.jsx(X,{children:i("editor.replace.caseSensitive")})]}),n.jsxs("div",{className:"richtext-flex richtext-items-center richtext-gap-[10px]",children:[n.jsx(F,{disabled:!o.length,className:"richtext-flex-1",onClick:e.commands.replace,children:i("editor.replace.dialog.text")}),n.jsx(F,{disabled:!o.length,className:"richtext-flex-1",onClick:e.commands.replaceAll,children:i("editor.replaceAll.dialog.text")})]})]})]})}const De=(e,t)=>t(e.tr);function ts(e,t,i){return RegExp(t?e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"):e,i?"gu":"gui")}function ns(e,t,i){const r=[];let a=[];const o=[];let s=0;if(!t)return{decorationsToReturn:[],results:[]};e==null||e.descendants((c,u)=>{c.isText?a[s]?a[s]={text:a[s].text+c.text,pos:a[s].pos}:a[s]={text:`${c.text}`,pos:u}:s+=1}),a=a.filter(Boolean);for(let c=0;c<a.length;c+=1){const{text:u,pos:d}=a[c],h=[...u.matchAll(t)];for(let m=0;m<h.length;m+=1){const x=h[m];if(x[0]==="")break;x.index!==void 0&&o.push({from:d+x.index,to:d+x.index+x[0].length})}}for(let c=0;c<o.length;c+=1){const u=o[c];r.push(v.Decoration.inline(u.from,u.to,{class:i}))}return{decorationsToReturn:r,results:o}}function sn(e,t,{state:i,dispatch:r}){if(!t[0])return;const{from:o,to:s}=t[0];r&&r(i.tr.insertText(e,o,s))}function is(e,t,i,r){const a=t+1;if(!r[a])return null;const{from:o,to:s}=r[t],c=s-o-e.length+i,{from:u,to:d}=r[a];return r[a]={to:d-c,from:u-c},[c,r]}function rs(e,t,{tr:i,dispatch:r}){let a=0,o=t.slice();if(!o.length)return!1;for(let s=0;s<o.length;s+=1){const{from:c,to:u}=o[s];i.insertText(e,c,u);const d=is(e,s,a,o);d&&(a=d[0],o=d[1])}return r(i),!0}function cn({view:e,tr:t,searchResults:i,searchResultCurrentClass:r,gotoIndex:a}){const o=i[a];if(o){const s=t.setMeta("directDecoration",{fromPos:o.from,toPos:o.to,attrs:{class:r}});return e==null||e.dispatch(s),setTimeout(()=>{const c=window.document.querySelector(`.${r}`);c&&At(c,{behavior:"smooth",scrollMode:"if-needed"})},0),!0}return!1}const Nt="ON_SEARCH_RESULTS",Ce=new CustomEvent(Nt),Un=f.Extension.create({name:"search",addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),searchTerm:"",replaceTerm:"",results:[],currentIndex:0,searchResultClass:"search-result",searchResultCurrentClass:"search-result-current",caseSensitive:!1,disableRegex:!1,onChange:()=>{},button:({editor:t,t:i})=>({component:es,componentProps:{action:()=>{},icon:"SearchAndReplace",tooltip:i("editor.searchAndReplace.tooltip"),isActive:()=>!1,disabled:!1,editor:t}})}},addStorage(){return{results:[],currentIndex:-1}},addCommands(){return{setSearchTerm:e=>({state:t,dispatch:i})=>(this.options.searchTerm=e,this.storage.results=[],this.storage.currentIndex=0,window.dispatchEvent(Ce),De(t,i),!1),setReplaceTerm:e=>({state:t,dispatch:i})=>(this.options.replaceTerm=e,De(t,i),!1),setCaseSensitive:e=>({state:t,dispatch:i})=>(this.options.caseSensitive=e,De(t,i),!1),replace:()=>({state:e,dispatch:t})=>{const{replaceTerm:i}=this.options,{currentIndex:r,results:a}=this.storage,o=a[r];return o?(sn(i,[o],{state:e,dispatch:t}),this.storage.results.splice(r,1)):(sn(i,a,{state:e,dispatch:t}),this.storage.results.shift()),window.dispatchEvent(Ce),De(e,t),!1},replaceAll:()=>({state:e,tr:t,dispatch:i})=>{const{replaceTerm:r}=this.options,{results:a}=this.storage;return rs(r,a,{tr:t,dispatch:i}),this.storage.currentIndex=-1,this.storage.results=[],window.dispatchEvent(Ce),De(e,i),!1},goToPrevSearchResult:()=>({view:e,tr:t})=>{const{searchResultCurrentClass:i}=this.options,{currentIndex:r,results:a}=this.storage,o=(r+a.length-1)%a.length;return this.storage.currentIndex=o,window.dispatchEvent(Ce),cn({view:e,tr:t,searchResults:a,searchResultCurrentClass:i,gotoIndex:o})},goToNextSearchResult:()=>({view:e,tr:t})=>{const{searchResultCurrentClass:i}=this.options,{currentIndex:r,results:a}=this.storage,o=(r+1)%a.length;return this.storage.currentIndex=o,this.options.onChange&&this.options.onChange(),window.dispatchEvent(Ce),cn({view:e,tr:t,searchResults:a,searchResultCurrentClass:i,gotoIndex:o})}}},addProseMirrorPlugins(){const e=this;return[new v.Plugin({key:new v.PluginKey("search"),state:{init(){return v.DecorationSet.empty},apply(t){const{doc:i,docChanged:r}=t,{searchTerm:a,searchResultClass:o,searchResultCurrentClass:s,disableRegex:c,caseSensitive:u}=e.options;if(r||a){const{decorationsToReturn:d,results:h}=ns(i,ts(a,c,u),o);if(e.storage.results=h,e.storage.currentIndex>h.length-1&&(e.storage.currentIndex=0),window.dispatchEvent(Ce),t.getMeta("directDecoration")){const{fromPos:m,toPos:x,attrs:g}=t.getMeta("directDecoration");d.push(v.Decoration.inline(m,x,g))}else h.length&&(d[0]=v.Decoration.inline(h[0].from,h[0].to,{class:s}));return v.DecorationSet.create(i,d)}return v.DecorationSet.empty}},props:{decorations(t){return this.getState(t)}}})]}}),Ee={100:"💯",1234:"🔢",grinning:"😀",smiley:"😃",smile:"😄",grin:"😁",laughing:"😆",satisfied:"😆",sweat_smile:"😅",rofl:"🤣",joy:"😂",slightly_smiling_face:"🙂",upside_down_face:"🙃",wink:"😉",blush:"😊",innocent:"😇",smiling_face_with_three_hearts:"🥰",heart_eyes:"😍",star_struck:"🤩",kissing_heart:"😘",kissing:"😗",relaxed:"☺️",kissing_closed_eyes:"😚",kissing_smiling_eyes:"😙",smiling_face_with_tear:"🥲",yum:"😋",stuck_out_tongue:"😛",stuck_out_tongue_winking_eye:"😜",zany_face:"🤪",stuck_out_tongue_closed_eyes:"😝",money_mouth_face:"🤑",hugs:"🤗",hand_over_mouth:"🤭",shushing_face:"🤫",thinking:"🤔",zipper_mouth_face:"🤐",raised_eyebrow:"🤨",neutral_face:"😐",expressionless:"😑",no_mouth:"😶",smirk:"😏",unamused:"😒",roll_eyes:"🙄",grimacing:"😬",lying_face:"🤥",relieved:"😌",pensive:"😔",sleepy:"😪",drooling_face:"🤤",sleeping:"😴",mask:"😷",face_with_thermometer:"🤒",face_with_head_bandage:"🤕",nauseated_face:"🤢",vomiting_face:"🤮",sneezing_face:"🤧",hot_face:"🥵",cold_face:"🥶",woozy_face:"🥴",dizzy_face:"😵",exploding_head:"🤯",cowboy_hat_face:"🤠",partying_face:"🥳",disguised_face:"🥸",sunglasses:"😎",nerd_face:"🤓",monocle_face:"🧐",confused:"😕",worried:"😟",slightly_frowning_face:"🙁",frowning_face:"☹️",open_mouth:"😮",hushed:"😯",astonished:"😲",flushed:"😳",pleading_face:"🥺",frowning:"😦",anguished:"😧",fearful:"😨",cold_sweat:"😰",disappointed_relieved:"😥",cry:"😢",sob:"😭",scream:"😱",confounded:"😖",persevere:"😣",disappointed:"😞",sweat:"😓",weary:"😩",tired_face:"😫",yawning_face:"🥱",triumph:"😤",rage:"😡",pout:"😡",angry:"😠",cursing_face:"🤬",smiling_imp:"😈",imp:"👿",skull:"💀",skull_and_crossbones:"☠️",hankey:"💩",poop:"💩",shit:"💩",clown_face:"🤡",japanese_ogre:"👹",japanese_goblin:"👺",ghost:"👻",alien:"👽",space_invader:"👾",robot:"🤖",smiley_cat:"😺",smile_cat:"😸",joy_cat:"😹",heart_eyes_cat:"😻",smirk_cat:"😼",kissing_cat:"😽",scream_cat:"🙀",crying_cat_face:"😿",pouting_cat:"😾",see_no_evil:"🙈",hear_no_evil:"🙉",speak_no_evil:"🙊",kiss:"💋",love_letter:"💌",cupid:"💘",gift_heart:"💝",sparkling_heart:"💖",heartpulse:"💗",heartbeat:"💓",revolving_hearts:"💞",two_hearts:"💕",heart_decoration:"💟",heavy_heart_exclamation:"❣️",broken_heart:"💔",heart:"❤️",orange_heart:"🧡",yellow_heart:"💛",green_heart:"💚",blue_heart:"💙",purple_heart:"💜",brown_heart:"🤎",black_heart:"🖤",white_heart:"🤍",anger:"💢",boom:"💥",collision:"💥",dizzy:"💫",sweat_drops:"💦",dash:"💨",hole:"🕳️",bomb:"💣",speech_balloon:"💬",eye_speech_bubble:"👁️‍🗨️",left_speech_bubble:"🗨️",right_anger_bubble:"🗯️",thought_balloon:"💭",zzz:"💤",wave:"👋",raised_back_of_hand:"🤚",raised_hand_with_fingers_splayed:"🖐️",hand:"✋",raised_hand:"✋",vulcan_salute:"🖖",ok_hand:"👌",pinched_fingers:"🤌",pinching_hand:"🤏",v:"✌️",crossed_fingers:"🤞",love_you_gesture:"🤟",metal:"🤘",call_me_hand:"🤙",point_left:"👈",point_right:"👉",point_up_2:"👆",middle_finger:"🖕",fu:"🖕",point_down:"👇",point_up:"☝️","+1":"👍",thumbsup:"👍","-1":"👎",thumbsdown:"👎",fist_raised:"✊",fist:"✊",fist_oncoming:"👊",facepunch:"👊",punch:"👊",fist_left:"🤛",fist_right:"🤜",clap:"👏",raised_hands:"🙌",open_hands:"👐",palms_up_together:"🤲",handshake:"🤝",pray:"🙏",writing_hand:"✍️",nail_care:"💅",selfie:"🤳",muscle:"💪",mechanical_arm:"🦾",mechanical_leg:"🦿",leg:"🦵",foot:"🦶",ear:"👂",ear_with_hearing_aid:"🦻",nose:"👃",brain:"🧠",anatomical_heart:"🫀",lungs:"🫁",tooth:"🦷",bone:"🦴",eyes:"👀",eye:"👁️",tongue:"👅",lips:"👄",baby:"👶",child:"🧒",boy:"👦",girl:"👧",adult:"🧑",blond_haired_person:"👱",man:"👨",bearded_person:"🧔",red_haired_man:"👨‍🦰",curly_haired_man:"👨‍🦱",white_haired_man:"👨‍🦳",bald_man:"👨‍🦲",woman:"👩",red_haired_woman:"👩‍🦰",person_red_hair:"🧑‍🦰",curly_haired_woman:"👩‍🦱",person_curly_hair:"🧑‍🦱",white_haired_woman:"👩‍🦳",person_white_hair:"🧑‍🦳",bald_woman:"👩‍🦲",person_bald:"🧑‍🦲",blond_haired_woman:"👱‍♀️",blonde_woman:"👱‍♀️",blond_haired_man:"👱‍♂️",older_adult:"🧓",older_man:"👴",older_woman:"👵",frowning_person:"🙍",frowning_man:"🙍‍♂️",frowning_woman:"🙍‍♀️",pouting_face:"🙎",pouting_man:"🙎‍♂️",pouting_woman:"🙎‍♀️",no_good:"🙅",no_good_man:"🙅‍♂️",ng_man:"🙅‍♂️",no_good_woman:"🙅‍♀️",ng_woman:"🙅‍♀️",ok_person:"🙆",ok_man:"🙆‍♂️",ok_woman:"🙆‍♀️",tipping_hand_person:"💁",information_desk_person:"💁",tipping_hand_man:"💁‍♂️",sassy_man:"💁‍♂️",tipping_hand_woman:"💁‍♀️",sassy_woman:"💁‍♀️",raising_hand:"🙋",raising_hand_man:"🙋‍♂️",raising_hand_woman:"🙋‍♀️",deaf_person:"🧏",deaf_man:"🧏‍♂️",deaf_woman:"🧏‍♀️",bow:"🙇",bowing_man:"🙇‍♂️",bowing_woman:"🙇‍♀️",facepalm:"🤦",man_facepalming:"🤦‍♂️",woman_facepalming:"🤦‍♀️",shrug:"🤷",man_shrugging:"🤷‍♂️",woman_shrugging:"🤷‍♀️",health_worker:"🧑‍⚕️",man_health_worker:"👨‍⚕️",woman_health_worker:"👩‍⚕️",student:"🧑‍🎓",man_student:"👨‍🎓",woman_student:"👩‍🎓",teacher:"🧑‍🏫",man_teacher:"👨‍🏫",woman_teacher:"👩‍🏫",judge:"🧑‍⚖️",man_judge:"👨‍⚖️",woman_judge:"👩‍⚖️",farmer:"🧑‍🌾",man_farmer:"👨‍🌾",woman_farmer:"👩‍🌾",cook:"🧑‍🍳",man_cook:"👨‍🍳",woman_cook:"👩‍🍳",mechanic:"🧑‍🔧",man_mechanic:"👨‍🔧",woman_mechanic:"👩‍🔧",factory_worker:"🧑‍🏭",man_factory_worker:"👨‍🏭",woman_factory_worker:"👩‍🏭",office_worker:"🧑‍💼",man_office_worker:"👨‍💼",woman_office_worker:"👩‍💼",scientist:"🧑‍🔬",man_scientist:"👨‍🔬",woman_scientist:"👩‍🔬",technologist:"🧑‍💻",man_technologist:"👨‍💻",woman_technologist:"👩‍💻",singer:"🧑‍🎤",man_singer:"👨‍🎤",woman_singer:"👩‍🎤",artist:"🧑‍🎨",man_artist:"👨‍🎨",woman_artist:"👩‍🎨",pilot:"🧑‍✈️",man_pilot:"👨‍✈️",woman_pilot:"👩‍✈️",astronaut:"🧑‍🚀",man_astronaut:"👨‍🚀",woman_astronaut:"👩‍🚀",firefighter:"🧑‍🚒",man_firefighter:"👨‍🚒",woman_firefighter:"👩‍🚒",police_officer:"👮",cop:"👮",policeman:"👮‍♂️",policewoman:"👮‍♀️",detective:"🕵️",male_detective:"🕵️‍♂️",female_detective:"🕵️‍♀️",guard:"💂",guardsman:"💂‍♂️",guardswoman:"💂‍♀️",ninja:"🥷",construction_worker:"👷",construction_worker_man:"👷‍♂️",construction_worker_woman:"👷‍♀️",prince:"🤴",princess:"👸",person_with_turban:"👳",man_with_turban:"👳‍♂️",woman_with_turban:"👳‍♀️",man_with_gua_pi_mao:"👲",woman_with_headscarf:"🧕",person_in_tuxedo:"🤵",man_in_tuxedo:"🤵‍♂️",woman_in_tuxedo:"🤵‍♀️",person_with_veil:"👰",man_with_veil:"👰‍♂️",woman_with_veil:"👰‍♀️",bride_with_veil:"👰‍♀️",pregnant_woman:"🤰",breast_feeding:"🤱",woman_feeding_baby:"👩‍🍼",man_feeding_baby:"👨‍🍼",person_feeding_baby:"🧑‍🍼",angel:"👼",santa:"🎅",mrs_claus:"🤶",mx_claus:"🧑‍🎄",superhero:"🦸",superhero_man:"🦸‍♂️",superhero_woman:"🦸‍♀️",supervillain:"🦹",supervillain_man:"🦹‍♂️",supervillain_woman:"🦹‍♀️",mage:"🧙",mage_man:"🧙‍♂️",mage_woman:"🧙‍♀️",fairy:"🧚",fairy_man:"🧚‍♂️",fairy_woman:"🧚‍♀️",vampire:"🧛",vampire_man:"🧛‍♂️",vampire_woman:"🧛‍♀️",merperson:"🧜",merman:"🧜‍♂️",mermaid:"🧜‍♀️",elf:"🧝",elf_man:"🧝‍♂️",elf_woman:"🧝‍♀️",genie:"🧞",genie_man:"🧞‍♂️",genie_woman:"🧞‍♀️",zombie:"🧟",zombie_man:"🧟‍♂️",zombie_woman:"🧟‍♀️",massage:"💆",massage_man:"💆‍♂️",massage_woman:"💆‍♀️",haircut:"💇",haircut_man:"💇‍♂️",haircut_woman:"💇‍♀️",walking:"🚶",walking_man:"🚶‍♂️",walking_woman:"🚶‍♀️",standing_person:"🧍",standing_man:"🧍‍♂️",standing_woman:"🧍‍♀️",kneeling_person:"🧎",kneeling_man:"🧎‍♂️",kneeling_woman:"🧎‍♀️",person_with_probing_cane:"🧑‍🦯",man_with_probing_cane:"👨‍🦯",woman_with_probing_cane:"👩‍🦯",person_in_motorized_wheelchair:"🧑‍🦼",man_in_motorized_wheelchair:"👨‍🦼",woman_in_motorized_wheelchair:"👩‍🦼",person_in_manual_wheelchair:"🧑‍🦽",man_in_manual_wheelchair:"👨‍🦽",woman_in_manual_wheelchair:"👩‍🦽",runner:"🏃",running:"🏃",running_man:"🏃‍♂️",running_woman:"🏃‍♀️",woman_dancing:"💃",dancer:"💃",man_dancing:"🕺",business_suit_levitating:"🕴️",dancers:"👯",dancing_men:"👯‍♂️",dancing_women:"👯‍♀️",sauna_person:"🧖",sauna_man:"🧖‍♂️",sauna_woman:"🧖‍♀️",climbing:"🧗",climbing_man:"🧗‍♂️",climbing_woman:"🧗‍♀️",person_fencing:"🤺",horse_racing:"🏇",skier:"⛷️",snowboarder:"🏂",golfing:"🏌️",golfing_man:"🏌️‍♂️",golfing_woman:"🏌️‍♀️",surfer:"🏄",surfing_man:"🏄‍♂️",surfing_woman:"🏄‍♀️",rowboat:"🚣",rowing_man:"🚣‍♂️",rowing_woman:"🚣‍♀️",swimmer:"🏊",swimming_man:"🏊‍♂️",swimming_woman:"🏊‍♀️",bouncing_ball_person:"⛹️",bouncing_ball_man:"⛹️‍♂️",basketball_man:"⛹️‍♂️",bouncing_ball_woman:"⛹️‍♀️",basketball_woman:"⛹️‍♀️",weight_lifting:"🏋️",weight_lifting_man:"🏋️‍♂️",weight_lifting_woman:"🏋️‍♀️",bicyclist:"🚴",biking_man:"🚴‍♂️",biking_woman:"🚴‍♀️",mountain_bicyclist:"🚵",mountain_biking_man:"🚵‍♂️",mountain_biking_woman:"🚵‍♀️",cartwheeling:"🤸",man_cartwheeling:"🤸‍♂️",woman_cartwheeling:"🤸‍♀️",wrestling:"🤼",men_wrestling:"🤼‍♂️",women_wrestling:"🤼‍♀️",water_polo:"🤽",man_playing_water_polo:"🤽‍♂️",woman_playing_water_polo:"🤽‍♀️",handball_person:"🤾",man_playing_handball:"🤾‍♂️",woman_playing_handball:"🤾‍♀️",juggling_person:"🤹",man_juggling:"🤹‍♂️",woman_juggling:"🤹‍♀️",lotus_position:"🧘",lotus_position_man:"🧘‍♂️",lotus_position_woman:"🧘‍♀️",bath:"🛀",sleeping_bed:"🛌",people_holding_hands:"🧑‍🤝‍🧑",two_women_holding_hands:"👭",couple:"👫",two_men_holding_hands:"👬",couplekiss:"💏",couplekiss_man_woman:"👩‍❤️‍💋‍👨",couplekiss_man_man:"👨‍❤️‍💋‍👨",couplekiss_woman_woman:"👩‍❤️‍💋‍👩",couple_with_heart:"💑",couple_with_heart_woman_man:"👩‍❤️‍👨",couple_with_heart_man_man:"👨‍❤️‍👨",couple_with_heart_woman_woman:"👩‍❤️‍👩",family:"👪",family_man_woman_boy:"👨‍👩‍👦",family_man_woman_girl:"👨‍👩‍👧",family_man_woman_girl_boy:"👨‍👩‍👧‍👦",family_man_woman_boy_boy:"👨‍👩‍👦‍👦",family_man_woman_girl_girl:"👨‍👩‍👧‍👧",family_man_man_boy:"👨‍👨‍👦",family_man_man_girl:"👨‍👨‍👧",family_man_man_girl_boy:"👨‍👨‍👧‍👦",family_man_man_boy_boy:"👨‍👨‍👦‍👦",family_man_man_girl_girl:"👨‍👨‍👧‍👧",family_woman_woman_boy:"👩‍👩‍👦",family_woman_woman_girl:"👩‍👩‍👧",family_woman_woman_girl_boy:"👩‍👩‍👧‍👦",family_woman_woman_boy_boy:"👩‍👩‍👦‍👦",family_woman_woman_girl_girl:"👩‍👩‍👧‍👧",family_man_boy:"👨‍👦",family_man_boy_boy:"👨‍👦‍👦",family_man_girl:"👨‍👧",family_man_girl_boy:"👨‍👧‍👦",family_man_girl_girl:"👨‍👧‍👧",family_woman_boy:"👩‍👦",family_woman_boy_boy:"👩‍👦‍👦",family_woman_girl:"👩‍👧",family_woman_girl_boy:"👩‍👧‍👦",family_woman_girl_girl:"👩‍👧‍👧",speaking_head:"🗣️",bust_in_silhouette:"👤",busts_in_silhouette:"👥",people_hugging:"🫂",footprints:"👣",monkey_face:"🐵",monkey:"🐒",gorilla:"🦍",orangutan:"🦧",dog:"🐶",dog2:"🐕",guide_dog:"🦮",service_dog:"🐕‍🦺",poodle:"🐩",wolf:"🐺",fox_face:"🦊",raccoon:"🦝",cat:"🐱",cat2:"🐈",black_cat:"🐈‍⬛",lion:"🦁",tiger:"🐯",tiger2:"🐅",leopard:"🐆",horse:"🐴",racehorse:"🐎",unicorn:"🦄",zebra:"🦓",deer:"🦌",bison:"🦬",cow:"🐮",ox:"🐂",water_buffalo:"🐃",cow2:"🐄",pig:"🐷",pig2:"🐖",boar:"🐗",pig_nose:"🐽",ram:"🐏",sheep:"🐑",goat:"🐐",dromedary_camel:"🐪",camel:"🐫",llama:"🦙",giraffe:"🦒",elephant:"🐘",mammoth:"🦣",rhinoceros:"🦏",hippopotamus:"🦛",mouse:"🐭",mouse2:"🐁",rat:"🐀",hamster:"🐹",rabbit:"🐰",rabbit2:"🐇",chipmunk:"🐿️",beaver:"🦫",hedgehog:"🦔",bat:"🦇",bear:"🐻",polar_bear:"🐻‍❄️",koala:"🐨",panda_face:"🐼",sloth:"🦥",otter:"🦦",skunk:"🦨",kangaroo:"🦘",badger:"🦡",feet:"🐾",paw_prints:"🐾",turkey:"🦃",chicken:"🐔",rooster:"🐓",hatching_chick:"🐣",baby_chick:"🐤",hatched_chick:"🐥",bird:"🐦",penguin:"🐧",dove:"🕊️",eagle:"🦅",duck:"🦆",swan:"🦢",owl:"🦉",dodo:"🦤",feather:"🪶",flamingo:"🦩",peacock:"🦚",parrot:"🦜",frog:"🐸",crocodile:"🐊",turtle:"🐢",lizard:"🦎",snake:"🐍",dragon_face:"🐲",dragon:"🐉",sauropod:"🦕","t-rex":"🦖",whale:"🐳",whale2:"🐋",dolphin:"🐬",flipper:"🐬",seal:"🦭",fish:"🐟",tropical_fish:"🐠",blowfish:"🐡",shark:"🦈",octopus:"🐙",shell:"🐚",snail:"🐌",butterfly:"🦋",bug:"🐛",ant:"🐜",bee:"🐝",honeybee:"🐝",beetle:"🪲",lady_beetle:"🐞",cricket:"🦗",cockroach:"🪳",spider:"🕷️",spider_web:"🕸️",scorpion:"🦂",mosquito:"🦟",fly:"🪰",worm:"🪱",microbe:"🦠",bouquet:"💐",cherry_blossom:"🌸",white_flower:"💮",rosette:"🏵️",rose:"🌹",wilted_flower:"🥀",hibiscus:"🌺",sunflower:"🌻",blossom:"🌼",tulip:"🌷",seedling:"🌱",potted_plant:"🪴",evergreen_tree:"🌲",deciduous_tree:"🌳",palm_tree:"🌴",cactus:"🌵",ear_of_rice:"🌾",herb:"🌿",shamrock:"☘️",four_leaf_clover:"🍀",maple_leaf:"🍁",fallen_leaf:"🍂",leaves:"🍃",grapes:"🍇",melon:"🍈",watermelon:"🍉",tangerine:"🍊",orange:"🍊",mandarin:"🍊",lemon:"🍋",banana:"🍌",pineapple:"🍍",mango:"🥭",apple:"🍎",green_apple:"🍏",pear:"🍐",peach:"🍑",cherries:"🍒",strawberry:"🍓",blueberries:"🫐",kiwi_fruit:"🥝",tomato:"🍅",olive:"🫒",coconut:"🥥",avocado:"🥑",eggplant:"🍆",potato:"🥔",carrot:"🥕",corn:"🌽",hot_pepper:"🌶️",bell_pepper:"🫑",cucumber:"🥒",leafy_green:"🥬",broccoli:"🥦",garlic:"🧄",onion:"🧅",mushroom:"🍄",peanuts:"🥜",chestnut:"🌰",bread:"🍞",croissant:"🥐",baguette_bread:"🥖",flatbread:"🫓",pretzel:"🥨",bagel:"🥯",pancakes:"🥞",waffle:"🧇",cheese:"🧀",meat_on_bone:"🍖",poultry_leg:"🍗",cut_of_meat:"🥩",bacon:"🥓",hamburger:"🍔",fries:"🍟",pizza:"🍕",hotdog:"🌭",sandwich:"🥪",taco:"🌮",burrito:"🌯",tamale:"🫔",stuffed_flatbread:"🥙",falafel:"🧆",egg:"🥚",fried_egg:"🍳",shallow_pan_of_food:"🥘",stew:"🍲",fondue:"🫕",bowl_with_spoon:"🥣",green_salad:"🥗",popcorn:"🍿",butter:"🧈",salt:"🧂",canned_food:"🥫",bento:"🍱",rice_cracker:"🍘",rice_ball:"🍙",rice:"🍚",curry:"🍛",ramen:"🍜",spaghetti:"🍝",sweet_potato:"🍠",oden:"🍢",sushi:"🍣",fried_shrimp:"🍤",fish_cake:"🍥",moon_cake:"🥮",dango:"🍡",dumpling:"🥟",fortune_cookie:"🥠",takeout_box:"🥡",crab:"🦀",lobster:"🦞",shrimp:"🦐",squid:"🦑",oyster:"🦪",icecream:"🍦",shaved_ice:"🍧",ice_cream:"🍨",doughnut:"🍩",cookie:"🍪",birthday:"🎂",cake:"🍰",cupcake:"🧁",pie:"🥧",chocolate_bar:"🍫",candy:"🍬",lollipop:"🍭",custard:"🍮",honey_pot:"🍯",baby_bottle:"🍼",milk_glass:"🥛",coffee:"☕",teapot:"🫖",tea:"🍵",sake:"🍶",champagne:"🍾",wine_glass:"🍷",cocktail:"🍸",tropical_drink:"🍹",beer:"🍺",beers:"🍻",clinking_glasses:"🥂",tumbler_glass:"🥃",cup_with_straw:"🥤",bubble_tea:"🧋",beverage_box:"🧃",mate:"🧉",ice_cube:"🧊",chopsticks:"🥢",plate_with_cutlery:"🍽️",fork_and_knife:"🍴",spoon:"🥄",hocho:"🔪",knife:"🔪",amphora:"🏺",earth_africa:"🌍",earth_americas:"🌎",earth_asia:"🌏",globe_with_meridians:"🌐",world_map:"🗺️",japan:"🗾",compass:"🧭",mountain_snow:"🏔️",mountain:"⛰️",volcano:"🌋",mount_fuji:"🗻",camping:"🏕️",beach_umbrella:"🏖️",desert:"🏜️",desert_island:"🏝️",national_park:"🏞️",stadium:"🏟️",classical_building:"🏛️",building_construction:"🏗️",bricks:"🧱",rock:"🪨",wood:"🪵",hut:"🛖",houses:"🏘️",derelict_house:"🏚️",house:"🏠",house_with_garden:"🏡",office:"🏢",post_office:"🏣",european_post_office:"🏤",hospital:"🏥",bank:"🏦",hotel:"🏨",love_hotel:"🏩",convenience_store:"🏪",school:"🏫",department_store:"🏬",factory:"🏭",japanese_castle:"🏯",european_castle:"🏰",wedding:"💒",tokyo_tower:"🗼",statue_of_liberty:"🗽",church:"⛪",mosque:"🕌",hindu_temple:"🛕",synagogue:"🕍",shinto_shrine:"⛩️",kaaba:"🕋",fountain:"⛲",tent:"⛺",foggy:"🌁",night_with_stars:"🌃",cityscape:"🏙️",sunrise_over_mountains:"🌄",sunrise:"🌅",city_sunset:"🌆",city_sunrise:"🌇",bridge_at_night:"🌉",hotsprings:"♨️",carousel_horse:"🎠",ferris_wheel:"🎡",roller_coaster:"🎢",barber:"💈",circus_tent:"🎪",steam_locomotive:"🚂",railway_car:"🚃",bullettrain_side:"🚄",bullettrain_front:"🚅",train2:"🚆",metro:"🚇",light_rail:"🚈",station:"🚉",tram:"🚊",monorail:"🚝",mountain_railway:"🚞",train:"🚋",bus:"🚌",oncoming_bus:"🚍",trolleybus:"🚎",minibus:"🚐",ambulance:"🚑",fire_engine:"🚒",police_car:"🚓",oncoming_police_car:"🚔",taxi:"🚕",oncoming_taxi:"🚖",car:"🚗",red_car:"🚗",oncoming_automobile:"🚘",blue_car:"🚙",pickup_truck:"🛻",truck:"🚚",articulated_lorry:"🚛",tractor:"🚜",racing_car:"🏎️",motorcycle:"🏍️",motor_scooter:"🛵",manual_wheelchair:"🦽",motorized_wheelchair:"🦼",auto_rickshaw:"🛺",bike:"🚲",kick_scooter:"🛴",skateboard:"🛹",roller_skate:"🛼",busstop:"🚏",motorway:"🛣️",railway_track:"🛤️",oil_drum:"🛢️",fuelpump:"⛽",rotating_light:"🚨",traffic_light:"🚥",vertical_traffic_light:"🚦",stop_sign:"🛑",construction:"🚧",anchor:"⚓",boat:"⛵",sailboat:"⛵",canoe:"🛶",speedboat:"🚤",passenger_ship:"🛳️",ferry:"⛴️",motor_boat:"🛥️",ship:"🚢",airplane:"✈️",small_airplane:"🛩️",flight_departure:"🛫",flight_arrival:"🛬",parachute:"🪂",seat:"💺",helicopter:"🚁",suspension_railway:"🚟",mountain_cableway:"🚠",aerial_tramway:"🚡",artificial_satellite:"🛰️",rocket:"🚀",flying_saucer:"🛸",bellhop_bell:"🛎️",luggage:"🧳",hourglass:"⌛",hourglass_flowing_sand:"⏳",watch:"⌚",alarm_clock:"⏰",stopwatch:"⏱️",timer_clock:"⏲️",mantelpiece_clock:"🕰️",clock12:"🕛",clock1230:"🕧",clock1:"🕐",clock130:"🕜",clock2:"🕑",clock230:"🕝",clock3:"🕒",clock330:"🕞",clock4:"🕓",clock430:"🕟",clock5:"🕔",clock530:"🕠",clock6:"🕕",clock630:"🕡",clock7:"🕖",clock730:"🕢",clock8:"🕗",clock830:"🕣",clock9:"🕘",clock930:"🕤",clock10:"🕙",clock1030:"🕥",clock11:"🕚",clock1130:"🕦",new_moon:"🌑",waxing_crescent_moon:"🌒",first_quarter_moon:"🌓",moon:"🌔",waxing_gibbous_moon:"🌔",full_moon:"🌕",waning_gibbous_moon:"🌖",last_quarter_moon:"🌗",waning_crescent_moon:"🌘",crescent_moon:"🌙",new_moon_with_face:"🌚",first_quarter_moon_with_face:"🌛",last_quarter_moon_with_face:"🌜",thermometer:"🌡️",sunny:"☀️",full_moon_with_face:"🌝",sun_with_face:"🌞",ringed_planet:"🪐",star:"⭐",star2:"🌟",stars:"🌠",milky_way:"🌌",cloud:"☁️",partly_sunny:"⛅",cloud_with_lightning_and_rain:"⛈️",sun_behind_small_cloud:"🌤️",sun_behind_large_cloud:"🌥️",sun_behind_rain_cloud:"🌦️",cloud_with_rain:"🌧️",cloud_with_snow:"🌨️",cloud_with_lightning:"🌩️",tornado:"🌪️",fog:"🌫️",wind_face:"🌬️",cyclone:"🌀",rainbow:"🌈",closed_umbrella:"🌂",open_umbrella:"☂️",umbrella:"☔",parasol_on_ground:"⛱️",zap:"⚡",snowflake:"❄️",snowman_with_snow:"☃️",snowman:"⛄",comet:"☄️",fire:"🔥",droplet:"💧",ocean:"🌊",jack_o_lantern:"🎃",christmas_tree:"🎄",fireworks:"🎆",sparkler:"🎇",firecracker:"🧨",sparkles:"✨",balloon:"🎈",tada:"🎉",confetti_ball:"🎊",tanabata_tree:"🎋",bamboo:"🎍",dolls:"🎎",flags:"🎏",wind_chime:"🎐",rice_scene:"🎑",red_envelope:"🧧",ribbon:"🎀",gift:"🎁",reminder_ribbon:"🎗️",tickets:"🎟️",ticket:"🎫",medal_military:"🎖️",trophy:"🏆",medal_sports:"🏅","1st_place_medal":"🥇","2nd_place_medal":"🥈","3rd_place_medal":"🥉",soccer:"⚽",baseball:"⚾",softball:"🥎",basketball:"🏀",volleyball:"🏐",football:"🏈",rugby_football:"🏉",tennis:"🎾",flying_disc:"🥏",bowling:"🎳",cricket_game:"🏏",field_hockey:"🏑",ice_hockey:"🏒",lacrosse:"🥍",ping_pong:"🏓",badminton:"🏸",boxing_glove:"🥊",martial_arts_uniform:"🥋",goal_net:"🥅",golf:"⛳",ice_skate:"⛸️",fishing_pole_and_fish:"🎣",diving_mask:"🤿",running_shirt_with_sash:"🎽",ski:"🎿",sled:"🛷",curling_stone:"🥌",dart:"🎯",yo_yo:"🪀",kite:"🪁","8ball":"🎱",crystal_ball:"🔮",magic_wand:"🪄",nazar_amulet:"🧿",video_game:"🎮",joystick:"🕹️",slot_machine:"🎰",game_die:"🎲",jigsaw:"🧩",teddy_bear:"🧸",pinata:"🪅",nesting_dolls:"🪆",spades:"♠️",hearts:"♥️",diamonds:"♦️",clubs:"♣️",chess_pawn:"♟️",black_joker:"🃏",mahjong:"🀄",flower_playing_cards:"🎴",performing_arts:"🎭",framed_picture:"🖼️",art:"🎨",thread:"🧵",sewing_needle:"🪡",yarn:"🧶",knot:"🪢",eyeglasses:"👓",dark_sunglasses:"🕶️",goggles:"🥽",lab_coat:"🥼",safety_vest:"🦺",necktie:"👔",shirt:"👕",tshirt:"👕",jeans:"👖",scarf:"🧣",gloves:"🧤",coat:"🧥",socks:"🧦",dress:"👗",kimono:"👘",sari:"🥻",one_piece_swimsuit:"🩱",swim_brief:"🩲",shorts:"🩳",bikini:"👙",womans_clothes:"👚",purse:"👛",handbag:"👜",pouch:"👝",shopping:"🛍️",school_satchel:"🎒",thong_sandal:"🩴",mans_shoe:"👞",shoe:"👞",athletic_shoe:"👟",hiking_boot:"🥾",flat_shoe:"🥿",high_heel:"👠",sandal:"👡",ballet_shoes:"🩰",boot:"👢",crown:"👑",womans_hat:"👒",tophat:"🎩",mortar_board:"🎓",billed_cap:"🧢",military_helmet:"🪖",rescue_worker_helmet:"⛑️",prayer_beads:"📿",lipstick:"💄",ring:"💍",gem:"💎",mute:"🔇",speaker:"🔈",sound:"🔉",loud_sound:"🔊",loudspeaker:"📢",mega:"📣",postal_horn:"📯",bell:"🔔",no_bell:"🔕",musical_score:"🎼",musical_note:"🎵",notes:"🎶",studio_microphone:"🎙️",level_slider:"🎚️",control_knobs:"🎛️",microphone:"🎤",headphones:"🎧",radio:"📻",saxophone:"🎷",accordion:"🪗",guitar:"🎸",musical_keyboard:"🎹",trumpet:"🎺",violin:"🎻",banjo:"🪕",drum:"🥁",long_drum:"🪘",iphone:"📱",calling:"📲",phone:"☎️",telephone:"☎️",telephone_receiver:"📞",pager:"📟",fax:"📠",battery:"🔋",electric_plug:"🔌",computer:"💻",desktop_computer:"🖥️",printer:"🖨️",keyboard:"⌨️",computer_mouse:"🖱️",trackball:"🖲️",minidisc:"💽",floppy_disk:"💾",cd:"💿",dvd:"📀",abacus:"🧮",movie_camera:"🎥",film_strip:"🎞️",film_projector:"📽️",clapper:"🎬",tv:"📺",camera:"📷",camera_flash:"📸",video_camera:"📹",vhs:"📼",mag:"🔍",mag_right:"🔎",candle:"🕯️",bulb:"💡",flashlight:"🔦",izakaya_lantern:"🏮",lantern:"🏮",diya_lamp:"🪔",notebook_with_decorative_cover:"📔",closed_book:"📕",book:"📖",open_book:"📖",green_book:"📗",blue_book:"📘",orange_book:"📙",books:"📚",notebook:"📓",ledger:"📒",page_with_curl:"📃",scroll:"📜",page_facing_up:"📄",newspaper:"📰",newspaper_roll:"🗞️",bookmark_tabs:"📑",bookmark:"🔖",label:"🏷️",moneybag:"💰",coin:"🪙",yen:"💴",dollar:"💵",euro:"💶",pound:"💷",money_with_wings:"💸",credit_card:"💳",receipt:"🧾",chart:"💹",envelope:"✉️",email:"📧","e-mail":"📧",incoming_envelope:"📨",envelope_with_arrow:"📩",outbox_tray:"📤",inbox_tray:"📥",package:"📦",mailbox:"📫",mailbox_closed:"📪",mailbox_with_mail:"📬",mailbox_with_no_mail:"📭",postbox:"📮",ballot_box:"🗳️",pencil2:"✏️",black_nib:"✒️",fountain_pen:"🖋️",pen:"🖊️",paintbrush:"🖌️",crayon:"🖍️",memo:"📝",pencil:"📝",briefcase:"💼",file_folder:"📁",open_file_folder:"📂",card_index_dividers:"🗂️",date:"📅",calendar:"📆",spiral_notepad:"🗒️",spiral_calendar:"🗓️",card_index:"📇",chart_with_upwards_trend:"📈",chart_with_downwards_trend:"📉",bar_chart:"📊",clipboard:"📋",pushpin:"📌",round_pushpin:"📍",paperclip:"📎",paperclips:"🖇️",straight_ruler:"📏",triangular_ruler:"📐",scissors:"✂️",card_file_box:"🗃️",file_cabinet:"🗄️",wastebasket:"🗑️",lock:"🔒",unlock:"🔓",lock_with_ink_pen:"🔏",closed_lock_with_key:"🔐",key:"🔑",old_key:"🗝️",hammer:"🔨",axe:"🪓",pick:"⛏️",hammer_and_pick:"⚒️",hammer_and_wrench:"🛠️",dagger:"🗡️",crossed_swords:"⚔️",gun:"🔫",boomerang:"🪃",bow_and_arrow:"🏹",shield:"🛡️",carpentry_saw:"🪚",wrench:"🔧",screwdriver:"🪛",nut_and_bolt:"🔩",gear:"⚙️",clamp:"🗜️",balance_scale:"⚖️",probing_cane:"🦯",link:"🔗",chains:"⛓️",hook:"🪝",toolbox:"🧰",magnet:"🧲",ladder:"🪜",alembic:"⚗️",test_tube:"🧪",petri_dish:"🧫",dna:"🧬",microscope:"🔬",telescope:"🔭",satellite:"📡",syringe:"💉",drop_of_blood:"🩸",pill:"💊",adhesive_bandage:"🩹",stethoscope:"🩺",door:"🚪",elevator:"🛗",mirror:"🪞",window:"🪟",bed:"🛏️",couch_and_lamp:"🛋️",chair:"🪑",toilet:"🚽",plunger:"🪠",shower:"🚿",bathtub:"🛁",mouse_trap:"🪤",razor:"🪒",lotion_bottle:"🧴",safety_pin:"🧷",broom:"🧹",basket:"🧺",roll_of_paper:"🧻",bucket:"🪣",soap:"🧼",toothbrush:"🪥",sponge:"🧽",fire_extinguisher:"🧯",shopping_cart:"🛒",smoking:"🚬",coffin:"⚰️",headstone:"🪦",funeral_urn:"⚱️",moyai:"🗿",placard:"🪧",atm:"🏧",put_litter_in_its_place:"🚮",potable_water:"🚰",wheelchair:"♿",mens:"🚹",womens:"🚺",restroom:"🚻",baby_symbol:"🚼",wc:"🚾",passport_control:"🛂",customs:"🛃",baggage_claim:"🛄",left_luggage:"🛅",warning:"⚠️",children_crossing:"🚸",no_entry:"⛔",no_entry_sign:"🚫",no_bicycles:"🚳",no_smoking:"🚭",do_not_litter:"🚯","non-potable_water":"🚱",no_pedestrians:"🚷",no_mobile_phones:"📵",underage:"🔞",radioactive:"☢️",biohazard:"☣️",arrow_up:"⬆️",arrow_upper_right:"↗️",arrow_right:"➡️",arrow_lower_right:"↘️",arrow_down:"⬇️",arrow_lower_left:"↙️",arrow_left:"⬅️",arrow_upper_left:"↖️",arrow_up_down:"↕️",left_right_arrow:"↔️",leftwards_arrow_with_hook:"↩️",arrow_right_hook:"↪️",arrow_heading_up:"⤴️",arrow_heading_down:"⤵️",arrows_clockwise:"🔃",arrows_counterclockwise:"🔄",back:"🔙",end:"🔚",on:"🔛",soon:"🔜",top:"🔝",place_of_worship:"🛐",atom_symbol:"⚛️",om:"🕉️",star_of_david:"✡️",wheel_of_dharma:"☸️",yin_yang:"☯️",latin_cross:"✝️",orthodox_cross:"☦️",star_and_crescent:"☪️",peace_symbol:"☮️",menorah:"🕎",six_pointed_star:"🔯",aries:"♈",taurus:"♉",gemini:"♊",cancer:"♋",leo:"♌",virgo:"♍",libra:"♎",scorpius:"♏",sagittarius:"♐",capricorn:"♑",aquarius:"♒",pisces:"♓",ophiuchus:"⛎",twisted_rightwards_arrows:"🔀",repeat:"🔁",repeat_one:"🔂",arrow_forward:"▶️",fast_forward:"⏩",next_track_button:"⏭️",play_or_pause_button:"⏯️",arrow_backward:"◀️",rewind:"⏪",previous_track_button:"⏮️",arrow_up_small:"🔼",arrow_double_up:"⏫",arrow_down_small:"🔽",arrow_double_down:"⏬",pause_button:"⏸️",stop_button:"⏹️",record_button:"⏺️",eject_button:"⏏️",cinema:"🎦",low_brightness:"🔅",high_brightness:"🔆",signal_strength:"📶",vibration_mode:"📳",mobile_phone_off:"📴",female_sign:"♀️",male_sign:"♂️",transgender_symbol:"⚧️",heavy_multiplication_x:"✖️",heavy_plus_sign:"➕",heavy_minus_sign:"➖",heavy_division_sign:"➗",infinity:"♾️",bangbang:"‼️",interrobang:"⁉️",question:"❓",grey_question:"❔",grey_exclamation:"❕",exclamation:"❗",heavy_exclamation_mark:"❗",wavy_dash:"〰️",currency_exchange:"💱",heavy_dollar_sign:"💲",medical_symbol:"⚕️",recycle:"♻️",fleur_de_lis:"⚜️",trident:"🔱",name_badge:"📛",beginner:"🔰",o:"⭕",white_check_mark:"✅",ballot_box_with_check:"☑️",heavy_check_mark:"✔️",x:"❌",negative_squared_cross_mark:"❎",curly_loop:"➰",loop:"➿",part_alternation_mark:"〽️",eight_spoked_asterisk:"✳️",eight_pointed_black_star:"✴️",sparkle:"❇️",copyright:"©️",registered:"®️",tm:"™️",hash:"#️⃣",asterisk:"*️⃣",zero:"0️⃣",one:"1️⃣",two:"2️⃣",three:"3️⃣",four:"4️⃣",five:"5️⃣",six:"6️⃣",seven:"7️⃣",eight:"8️⃣",nine:"9️⃣",keycap_ten:"🔟",capital_abcd:"🔠",abcd:"🔡",symbols:"🔣",abc:"🔤",a:"🅰️",ab:"🆎",b:"🅱️",cl:"🆑",cool:"🆒",free:"🆓",information_source:"ℹ️",id:"🆔",m:"Ⓜ️",new:"🆕",ng:"🆖",o2:"🅾️",ok:"🆗",parking:"🅿️",sos:"🆘",up:"🆙",vs:"🆚",koko:"🈁",sa:"🈂️",ideograph_advantage:"🉐",accept:"🉑",congratulations:"㊗️",secret:"㊙️",u6e80:"🈵",red_circle:"🔴",orange_circle:"🟠",yellow_circle:"🟡",green_circle:"🟢",large_blue_circle:"🔵",purple_circle:"🟣",brown_circle:"🟤",black_circle:"⚫",white_circle:"⚪",red_square:"🟥",orange_square:"🟧",yellow_square:"🟨",green_square:"🟩",blue_square:"🟦",purple_square:"🟪",brown_square:"🟫",black_large_square:"⬛",white_large_square:"⬜",black_medium_square:"◼️",white_medium_square:"◻️",black_medium_small_square:"◾",white_medium_small_square:"◽",black_small_square:"▪️",white_small_square:"▫️",large_orange_diamond:"🔶",large_blue_diamond:"🔷",small_orange_diamond:"🔸",small_blue_diamond:"🔹",small_red_triangle:"🔺",small_red_triangle_down:"🔻",diamond_shape_with_a_dot_inside:"💠",radio_button:"🔘",white_square_button:"🔳",black_square_button:"🔲",checkered_flag:"🏁",triangular_flag_on_post:"🚩",crossed_flags:"🎌",black_flag:"🏴",white_flag:"🏳️",rainbow_flag:"🏳️‍🌈",transgender_flag:"🏳️‍⚧️",pirate_flag:"🏴‍☠️",ascension_island:"🇦🇨",andorra:"🇦🇩",united_arab_emirates:"🇦🇪",afghanistan:"🇦🇫",antigua_barbuda:"🇦🇬",anguilla:"🇦🇮",albania:"🇦🇱",armenia:"🇦🇲",angola:"🇦🇴",antarctica:"🇦🇶",argentina:"🇦🇷",american_samoa:"🇦🇸",austria:"🇦🇹",australia:"🇦🇺",aruba:"🇦🇼",aland_islands:"🇦🇽",azerbaijan:"🇦🇿",bosnia_herzegovina:"🇧🇦",barbados:"🇧🇧",bangladesh:"🇧🇩",belgium:"🇧🇪",burkina_faso:"🇧🇫",bulgaria:"🇧🇬",bahrain:"🇧🇭",burundi:"🇧🇮",benin:"🇧🇯",st_barthelemy:"🇧🇱",bermuda:"🇧🇲",brunei:"🇧🇳",bolivia:"🇧🇴",caribbean_netherlands:"🇧🇶",brazil:"🇧🇷",bahamas:"🇧🇸",bhutan:"🇧🇹",bouvet_island:"🇧🇻",botswana:"🇧🇼",belarus:"🇧🇾",belize:"🇧🇿",canada:"🇨🇦",cocos_islands:"🇨🇨",congo_kinshasa:"🇨🇩",central_african_republic:"🇨🇫",congo_brazzaville:"🇨🇬",switzerland:"🇨🇭",cote_divoire:"🇨🇮",cook_islands:"🇨🇰",chile:"🇨🇱",cameroon:"🇨🇲",cn:"🇨🇳",colombia:"🇨🇴",clipperton_island:"🇨🇵",costa_rica:"🇨🇷",cuba:"🇨🇺",cape_verde:"🇨🇻",curacao:"🇨🇼",christmas_island:"🇨🇽",cyprus:"🇨🇾",czech_republic:"🇨🇿",de:"🇩🇪",diego_garcia:"🇩🇬",djibouti:"🇩🇯",denmark:"🇩🇰",dominica:"🇩🇲",dominican_republic:"🇩🇴",algeria:"🇩🇿",ceuta_melilla:"🇪🇦",ecuador:"🇪🇨",estonia:"🇪🇪",egypt:"🇪🇬",western_sahara:"🇪🇭",eritrea:"🇪🇷",es:"🇪🇸",ethiopia:"🇪🇹",eu:"🇪🇺",european_union:"🇪🇺",finland:"🇫🇮",fiji:"🇫🇯",falkland_islands:"🇫🇰",micronesia:"🇫🇲",faroe_islands:"🇫🇴",fr:"🇫🇷",gabon:"🇬🇦",gb:"🇬🇧",uk:"🇬🇧",grenada:"🇬🇩",georgia:"🇬🇪",french_guiana:"🇬🇫",guernsey:"🇬🇬",ghana:"🇬🇭",gibraltar:"🇬🇮",greenland:"🇬🇱",gambia:"🇬🇲",guinea:"🇬🇳",guadeloupe:"🇬🇵",equatorial_guinea:"🇬🇶",greece:"🇬🇷",south_georgia_south_sandwich_islands:"🇬🇸",guatemala:"🇬🇹",guam:"🇬🇺",guinea_bissau:"🇬🇼",guyana:"🇬🇾",hong_kong:"🇭🇰",heard_mcdonald_islands:"🇭🇲",honduras:"🇭🇳",croatia:"🇭🇷",haiti:"🇭🇹",hungary:"🇭🇺",canary_islands:"🇮🇨",indonesia:"🇮🇩",ireland:"🇮🇪",israel:"🇮🇱",isle_of_man:"🇮🇲",india:"🇮🇳",british_indian_ocean_territory:"🇮🇴",iraq:"🇮🇶",iran:"🇮🇷",iceland:"🇮🇸",it:"🇮🇹",jersey:"🇯🇪",jamaica:"🇯🇲",jordan:"🇯🇴",jp:"🇯🇵",kenya:"🇰🇪",kyrgyzstan:"🇰🇬",cambodia:"🇰🇭",kiribati:"🇰🇮",comoros:"🇰🇲",st_kitts_nevis:"🇰🇳",north_korea:"🇰🇵",kr:"🇰🇷",kuwait:"🇰🇼",cayman_islands:"🇰🇾",kazakhstan:"🇰🇿",laos:"🇱🇦",lebanon:"🇱🇧",st_lucia:"🇱🇨",liechtenstein:"🇱🇮",sri_lanka:"🇱🇰",liberia:"🇱🇷",lesotho:"🇱🇸",lithuania:"🇱🇹",luxembourg:"🇱🇺",latvia:"🇱🇻",libya:"🇱🇾",morocco:"🇲🇦",monaco:"🇲🇨",moldova:"🇲🇩",montenegro:"🇲🇪",st_martin:"🇲🇫",madagascar:"🇲🇬",marshall_islands:"🇲🇭",macedonia:"🇲🇰",mali:"🇲🇱",myanmar:"🇲🇲",mongolia:"🇲🇳",macau:"🇲🇴",northern_mariana_islands:"🇲🇵",martinique:"🇲🇶",mauritania:"🇲🇷",montserrat:"🇲🇸",malta:"🇲🇹",mauritius:"🇲🇺",maldives:"🇲🇻",malawi:"🇲🇼",mexico:"🇲🇽",malaysia:"🇲🇾",mozambique:"🇲🇿",namibia:"🇳🇦",new_caledonia:"🇳🇨",niger:"🇳🇪",norfolk_island:"🇳🇫",nigeria:"🇳🇬",nicaragua:"🇳🇮",netherlands:"🇳🇱",norway:"🇳🇴",nepal:"🇳🇵",nauru:"🇳🇷",niue:"🇳🇺",new_zealand:"🇳🇿",oman:"🇴🇲",panama:"🇵🇦",peru:"🇵🇪",french_polynesia:"🇵🇫",papua_new_guinea:"🇵🇬",philippines:"🇵🇭",pakistan:"🇵🇰",poland:"🇵🇱",st_pierre_miquelon:"🇵🇲",pitcairn_islands:"🇵🇳",puerto_rico:"🇵🇷",palestinian_territories:"🇵🇸",portugal:"🇵🇹",palau:"🇵🇼",paraguay:"🇵🇾",qatar:"🇶🇦",reunion:"🇷🇪",romania:"🇷🇴",serbia:"🇷🇸",ru:"🇷🇺",rwanda:"🇷🇼",saudi_arabia:"🇸🇦",solomon_islands:"🇸🇧",seychelles:"🇸🇨",sudan:"🇸🇩",sweden:"🇸🇪",singapore:"🇸🇬",st_helena:"🇸🇭",slovenia:"🇸🇮",svalbard_jan_mayen:"🇸🇯",slovakia:"🇸🇰",sierra_leone:"🇸🇱",san_marino:"🇸🇲",senegal:"🇸🇳",somalia:"🇸🇴",suriname:"🇸🇷",south_sudan:"🇸🇸",sao_tome_principe:"🇸🇹",el_salvador:"🇸🇻",sint_maarten:"🇸🇽",syria:"🇸🇾",swaziland:"🇸🇿",tristan_da_cunha:"🇹🇦",turks_caicos_islands:"🇹🇨",chad:"🇹🇩",french_southern_territories:"🇹🇫",togo:"🇹🇬",thailand:"🇹🇭",tajikistan:"🇹🇯",tokelau:"🇹🇰",timor_leste:"🇹🇱",turkmenistan:"🇹🇲",tunisia:"🇹🇳",tonga:"🇹🇴",tr:"🇹🇷",trinidad_tobago:"🇹🇹",tuvalu:"🇹🇻",taiwan:"🇹🇼",tanzania:"🇹🇿",ukraine:"🇺🇦",uganda:"🇺🇬",us_outlying_islands:"🇺🇲",united_nations:"🇺🇳",us:"🇺🇸",uruguay:"🇺🇾",uzbekistan:"🇺🇿",vatican_city:"🇻🇦",st_vincent_grenadines:"🇻🇨",venezuela:"🇻🇪",british_virgin_islands:"🇻🇬",us_virgin_islands:"🇻🇮",vietnam:"🇻🇳",vanuatu:"🇻🇺",wallis_futuna:"🇼🇫",samoa:"🇼🇸",kosovo:"🇽🇰",yemen:"🇾🇪",mayotte:"🇾🇹",south_africa:"🇿🇦",zambia:"🇿🇲",zimbabwe:"🇿🇼",england:"🏴󠁧󠁢󠁥󠁮󠁧󠁿",scotland:"🏴󠁧󠁢󠁳󠁣󠁴󠁿",wales:"🏴󠁧󠁢󠁷󠁬󠁳󠁿"};Object.keys(Ee).reduce((e,t)=>{const i=Ee[t];return e[i]=t,e},{});const as=Object.keys(Ee).map(e=>e);Object.keys(Ee).map(e=>Ee[e]);function os(e){return as.filter(t=>t.startsWith(e)).map(t=>({name:t,emoji:Ee[t]}))}const Wn=l.forwardRef((e,t)=>{const i=l.useRef(),[r,a]=l.useState(0),{t:o}=b.useLocale(),s=h=>{const m=e.items[h];m&&e.command(m)},c=()=>{a((r+e.items.length-1)%e.items.length)},u=()=>{a((r+1)%e.items.length)},d=()=>{s(r)};return l.useEffect(()=>a(0),[e.items]),l.useEffect(()=>{if(Number.isNaN(r+1))return;const h=i.current.querySelector(`span:nth-of-type(${r+1})`);h&&At(h,{behavior:"smooth",scrollMode:"if-needed"})},[r]),l.useImperativeHandle(t,()=>({onKeyDown:({event:h})=>h.key==="ArrowUp"?(c(),!0):h.key==="ArrowDown"?(u(),!0):h.key==="Enter"?(d(),!0):!1})),n.jsx("div",{className:"richtext-w-[200px] richtext-max-h-[320px] richtext-overflow-x-hidden richtext-overflow-y-auto richtext-rounded-sm !richtext-border richtext-bg-popover richtext-p-1 richtext-text-popover-foreground richtext-shadow-md richtext-outline-none",children:n.jsx("div",{ref:i,children:e.items.length?e.items.map((h,m)=>n.jsxs("span",{className:v.clsx(" richtext-flex richtext-relative richtext-cursor-default richtext-select-none richtext-items-center richtext-rounded-sm richtext-px-2 richtext-py-1.5 richtext-text-sm richtext-outline-none richtext-transition-colors focus:richtext-bg-accent focus:richtext-text-accent-foreground hover:richtext-bg-accent",m===r?"bg-accent":""),onClick:()=>s(m),children:[h.fallbackImage?n.jsx("img",{src:h.fallbackImage,className:"richtext-w-[1em] richtext-h-[1em]"}):h.emoji,":",h.name,":"]},`emoji-list-code-${m}`)):n.jsx("div",{className:"richtext-flex richtext-relative richtext-cursor-default richtext-select-none richtext-items-center richtext-rounded-sm richtext-px-2 richtext-py-1.5 richtext-text-sm richtext-outline-none richtext-transition-colors",children:n.jsx("span",{children:o("no_result_found")})})})})});Wn.displayName="EmojiList";const ss=["😀","😃","😄","😁","😆","😅","😂","🤣","🥲","😊","😇","🙂","🙃","😉","😌","😍","🥰","😘","😗","😙","😚","😋","😛","😝","😜","🤪","🤨","🧐","🤓","😎","🥸","🤩","🥳","😏","😒","😞","😔","😟","😕","🙁","😣","😖","😫","😩","🥺","😢","😭","😤","😠","😡","🤬","🤯","😳","🥵","🥶","😱","😨","😰","😥","😓","🤗","🤔","🤭","🤫","🤥","😶","😐","😑","😬","🙄","😯","😦","😧","😮","😲","🥱","😴","🤤","😪","😵","🤐","🥴","🤢","🤮","🤧","😷","🤒","🤕","🤑","🤠","😈","👿","👹","👺","🤡","💩","👻","💀","☠️","👽","👾","🤖","🎃","😺","😸","😹","😻","😼","😽","🙀","😿","😾","👋","🤚","🖐","✋","🖖","👌","🤌","🤏","✌️","🤞","🤟","🤘","🤙","👈","👉","👆","🖕","👇","☝️","👍","👎","✊","👊","🤛","🤜","👏","🙌","👐","🤲","🤝","🙏","✍️","💅","🤳","💪","🦾","🦵","🦿","🦶","👣","👂","🦻","👃","🫀","🫁","🧠","🦷","🦴","👀","👁","👅","👄","💋","🩸","💋","💌","💘","💝","💖","💗","💓","💞","💕","💟","❣️","❣","💔","❤️‍🔥","❤‍🔥","❤️‍🩹","❤‍🩹","❤️","❤","🧡","💛","💚","💙","💜","🤎","🖤","🤍","💯","💢","💥","💫","💦","💨","🕳️","🕳","💣","💬","👁️‍🗨️","👁‍🗨️","👁️‍🗨","👁‍🗨","🗨️","🗨","🗯️","🗯","💭","💤"],cs=["🏧","🚮","🚰","♿","🚹","🚺","🚻","🚼","🚾","🛂","🛃","🛄","🛅","⚠️","⚠","🚸","⛔","🚫","🚳","🚭","🚯","🚱","🚷","📵","🔞","☢️","☢","☣️","☣","⬆️","⬆","↗️","↗","➡️","➡","↘️","↘","⬇️","⬇","↙️","↙","⬅️","⬅","↖️","↖","↕️","↕","↔️","↔","↩️","↩","↪️","↪","⤴️","⤴","⤵️","⤵","🔃","🔄","🔙","🔚","🔛","🔜","🔝","🛐","⚛️","⚛","🕉️","🕉","✡️","✡","☸️","☸","☯️","☯","✝️","✝","☦️","☦","☪️","☪","☮️","☮","🕎","🔯","♈","♉","♊","♋","♌","♍","♎","♏","♐","♑","♒","♓","⛎","🔀","🔁","🔂","▶️","▶","⏩","⏭️","⏭","⏯️","⏯","◀️","◀","⏪","⏮️","⏮","🔼","⏫","🔽","⏬","⏸️","⏸","⏹️","⏹","⏺️","⏺","⏏️","⏏","🎦","🔅","🔆","📶","📳","📴","♀️","♀","♂️","♂","⚧️","⚧","✖️","✖","➕","➖","➗","♾️","♾","‼️","‼","⁉️","⁉","❓","❔","❕","❗","〰️","〰","💱","💲","⚕️","⚕","♻️","♻","⚜️","⚜","🔱","📛","🔰","⭕","✅","☑️","☑","✔️","✔","❌","❎","➰","➿","〽️","〽","✳️","✳","✴️","✴","❇️","❇","©️","©","®️","®","™️","™","#️⃣","#⃣","*️⃣","*⃣","0️⃣","0⃣","1️⃣","1⃣","2️⃣","2⃣","3️⃣","3⃣","4️⃣","4⃣","5️⃣","5⃣","6️⃣","6⃣","7️⃣","7⃣","8️⃣","8⃣","9️⃣","9⃣","🔟","🔠","🔡","🔢","🔣","🔤","🅰️","🅰","🆎","🅱️","🅱","🆑","🆒","🆓","ℹ️","ℹ","🆔","Ⓜ️","Ⓜ","🆕","🆖","🅾️","🅾","🆗","🅿️","🅿","🆘","🆙","🆚","🈁","🈂️","🈂","🈷️","🈷","🈶","🈯","🉐","🈹","🈚","🈲","🉑","🈸","🈴","🈳","㊗️","㊗","㊙️","㊙","🈺","🈵","🔴","🟠","🟡","🟢","🔵","🟣","🟤","⚫","⚪","🟥","🟧","🟨","🟩","🟦","🟪","🟫","⬛","⬜","◼️","◼","◻️","◻","◾","◽","▪️","▪","▫️","▫","🔶","🔷","🔸","🔹","🔺","🔻","💠","🔘","🔳","🔲"],ls=["👓","🕶️","🕶","🥽","🥼","🦺","👔","👕","👖","🧣","🧤","🧥","🧦","👗","👘","🥻","🩱","🩲","🩳","👙","👚","👛","👜","👝","🛍️","🛍","🎒","🩴","👞","👟","🥾","🥿","👠","👡","🩰","👢","👑","👒","🎩","🎓","🧢","🪖","⛑️","⛑","📿","💄","💍","💎","🔇","🔈","🔉","🔊","📢","📣","📯","🔔","🔕","🎼","🎵","🎶","🎙️","🎙","🎚️","🎚","🎛️","🎛","🎤","🎧","📻","🎷","🪗","🎸","🎹","🎺","🎻","🪕","🥁","🪘","📱","📲","☎️","☎","📞","📟","📠","🔋","🔌","💻","🖥️","🖥","🖨️","🖨","⌨️","⌨","🖱️","🖱","🖲️","🖲","💽","💾","💿","📀","🧮","🎥","🎞️","🎞","📽️","📽","🎬","📺","📷","📸","📹","📼","🔍","🔎","🕯️","🕯","💡","🔦","🏮","🪔","📔","📕","📖","📗","📘","📙","📚","📓","📒","📃","📜","📄","📰","🗞️","🗞","📑","🔖","🏷️","🏷","💰","🪙","💴","💵","💶","💷","💸","💳","🧾","💹","✉️","✉","📧","📨","📩","📤","📥","📦","📫","📪","📬","📭","📮","🗳️","🗳","✏️","✏","✒️","✒","🖋️","🖋","🖊️","🖊","🖌️","🖌","🖍️","🖍","📝","💼","📁","📂","🗂️","🗂","📅","📆","🗒️","🗒","🗓️","🗓","📇","📈","📉","📊","📋","📌","📍","📎","🖇️","🖇","📏","📐","✂️","✂","🗃️","🗃","🗄️","🗄","🗑️","🗑","🔒","🔓","🔏","🔐","🔑","🗝️","🗝","🔨","🪓","⛏️","⛏","⚒️","⚒","🛠️","🛠","🗡️","🗡","⚔️","⚔","🔫","🪃","🏹","🛡️","🛡","🪚","🔧","🪛","🔩","⚙️","⚙","🗜️","🗜","⚖️","⚖","🦯","🔗","⛓️","⛓","🪝","🧰","🧲","🪜","⚗️","⚗","🧪","🧫","🧬","🔬","🔭","📡","💉","🩸","💊","🩹","🩺","🚪","🛗","🪞","🪟","🛏️","🛏","🛋️","🛋","🪑","🚽","🪠","🚿","🛁","🪤","🪒","🧴","🧷","🧹","🧺","🧻","🪣","🧼","🪥","🧽","🧯","🛒","🚬","⚰️","⚰","🪦","⚱️","⚱","🗿","🪧"],ds=["🎃","🎄","🎆","🎇","🧨","✨","🎈","🎉","🎊","🎋","🎍","🎎","🎏","🎐","🎑","🧧","🎀","🎁","🎗️","🎗","🎟️","🎟","🎫","🎖️","🎖","🏆","🏅","🥇","🥈","🥉","⚽","⚾","🥎","🏀","🏐","🏈","🏉","🎾","🥏","🎳","🏏","🏑","🏒","🥍","🏓","🏸","🥊","🥋","🥅","⛳","⛸️","⛸","🎣","🤿","🎽","🎿","🛷","🥌","🎯","🪀","🪁","🎱","🔮","🪄","🧿","🎮","🕹️","🕹","🎰","🎲","🧩","🧸","🪅","🪆","♠️","♠","♥️","♥","♦️","♦","♣️","♣","♟️","♟","🃏","🀄","🎴","🎭","🖼️","🖼","🎨","🧵","🪡","🧶","🪢"],hs=["🌍","🌎","🌏","🌐","🗺️","🗺","🗾","🧭","🏔️","🏔","⛰️","⛰","🌋","🗻","🏕️","🏕","🏖️","🏖","🏜️","🏜","🏝️","🏝","🏞️","🏞","🏟️","🏟","🏛️","🏛","🏗️","🏗","🧱","🪨","🪵","🛖","🏘️","🏘","🏚️","🏚","🏠","🏡","🏢","🏣","🏤","🏥","🏦","🏨","🏩","🏪","🏫","🏬","🏭","🏯","🏰","💒","🗼","🗽","⛪","🕌","🛕","🕍","⛩️","⛩","🕋","⛲","⛺","🌁","🌃","🏙️","🏙","🌄","🌅","🌆","🌇","🌉","♨️","♨","🎠","🎡","🎢","💈","🎪","🚂","🚃","🚄","🚅","🚆","🚇","🚈","🚉","🚊","🚝","🚞","🚋","🚌","🚍","🚎","🚐","🚑","🚒","🚓","🚔","🚕","🚖","🚗","🚘","🚙","🛻","🚚","🚛","🚜","🏎️","🏎","🏍️","🏍","🛵","🦽","🦼","🛺","🚲","🛴","🛹","🛼","🚏","🛣️","🛣","🛤️","🛤","🛢️","🛢","⛽","🚨","🚥","🚦","🛑","🚧","⚓","⛵","🛶","🚤","🛳️","🛳","⛴️","⛴","🛥️","🛥","🚢","✈️","✈","🛩️","🛩","🛫","🛬","🪂","💺","🚁","🚟","🚠","🚡","🛰️","🛰","🚀","🛸","🛎️","🛎","🧳","⌛","⏳","⌚","⏰","⏱️","⏱","⏲️","⏲","🕰️","🕰","🕛","🕧","🕐","🕜","🕑","🕝","🕒","🕞","🕓","🕟","🕔","🕠","🕕","🕡","🕖","🕢","🕗","🕣","🕘","🕤","🕙","🕥","🕚","🕦","🌑","🌒","🌓","🌔","🌕","🌖","🌗","🌘","🌙","🌚","🌛","🌜","🌡️","🌡","☀️","☀","🌝","🌞","🪐","⭐","🌟","🌠","🌌","☁️","☁","⛅","⛈️","⛈","🌤️","🌤","🌥️","🌥","🌦️","🌦","🌧️","🌧","🌨️","🌨","🌩️","🌩","🌪️","🌪","🌫️","🌫","🌬️","🌬","🌀","🌈","🌂","☂️","☂","☔","⛱️","⛱","⚡","❄️","❄","☃️","☃","⛄","☄️","☄","🔥","💧","🌊"],us=["🏁","🚩","🎌","🏴","🏳️","🏳","🏳️‍🌈","🏳‍🌈","🏳️‍⚧️","🏳‍⚧️","🏳️‍⚧","🏳‍⚧","🏴‍☠️","🏴‍☠","🇦🇨","🇦🇩","🇦🇪","🇦🇫","🇦🇬","🇦🇮","🇦🇱","🇦🇲","🇦🇴","🇦🇶","🇦🇷","🇦🇸","🇦🇹","🇦🇺","🇦🇼","🇦🇽","🇦🇿","🇧🇦","🇧🇧","🇧🇩","🇧🇪","🇧🇫","🇧🇬","🇧🇭","🇧🇮","🇧🇯","🇧🇱","🇧🇲","🇧🇳","🇧🇴","🇧🇶","🇧🇷","🇧🇸","🇧🇹","🇧🇻","🇧🇼","🇧🇾","🇧🇿","🇨🇦","🇨🇨","🇨🇩","🇨🇫","🇨🇬","🇨🇭","🇨🇮","🇨🇰","🇨🇱","🇨🇲","🇨🇳","🇨🇴","🇨🇵","🇨🇷","🇨🇺","🇨🇻","🇨🇼","🇨🇽","🇨🇾","🇨🇿","🇩🇪","🇩🇬","🇩🇯","🇩🇰","🇩🇲","🇩🇴","🇩🇿","🇪🇦","🇪🇨","🇪🇪","🇪🇬","🇪🇭","🇪🇷","🇪🇸","🇪🇹","🇪🇺","🇫🇮","🇫🇯","🇫🇰","🇫🇲","🇫🇴","🇫🇷","🇬🇦","🇬🇧","🇬🇩","🇬🇪","🇬🇫","🇬🇬","🇬🇭","🇬🇮","🇬🇱","🇬🇲","🇬🇳","🇬🇵","🇬🇶","🇬🇷","🇬🇸","🇬🇹","🇬🇺","🇬🇼","🇬🇾","🇭🇰","🇭🇲","🇭🇳","🇭🇷","🇭🇹","🇭🇺","🇮🇨","🇮🇩","🇮🇪","🇮🇱","🇮🇲","🇮🇳","🇮🇴","🇮🇶","🇮🇷","🇮🇸","🇮🇹","🇯🇪","🇯🇲","🇯🇴","🇯🇵","🇰🇪","🇰🇬","🇰🇭","🇰🇮","🇰🇲","🇰🇳","🇰🇵","🇰🇷","🇰🇼","🇰🇾","🇰🇿","🇱🇦","🇱🇧","🇱🇨","🇱🇮","🇱🇰","🇱🇷","🇱🇸","🇱🇹","🇱🇺","🇱🇻","🇱🇾","🇲🇦","🇲🇨","🇲🇩","🇲🇪","🇲🇫","🇲🇬","🇲🇭","🇲🇰","🇲🇱","🇲🇲","🇲🇳","🇲🇴","🇲🇵","🇲🇶","🇲🇷","🇲🇸","🇲🇹","🇲🇺","🇲🇻","🇲🇼","🇲🇽","🇲🇾","🇲🇿","🇳🇦","🇳🇨","🇳🇪","🇳🇫","🇳🇬","🇳🇮","🇳🇱","🇳🇴","🇳🇵","🇳🇷","🇳🇺","🇳🇿","🇴🇲","🇵🇦","🇵🇪","🇵🇫","🇵🇬","🇵🇭","🇵🇰","🇵🇱","🇵🇲","🇵🇳","🇵🇷","🇵🇸","🇵🇹","🇵🇼","🇵🇾","🇶🇦","🇷🇪","🇷🇴","🇷🇸","🇷🇺","🇷🇼","🇸🇦","🇸🇧","🇸🇨","🇸🇩","🇸🇪","🇸🇬","🇸🇭","🇸🇮","🇸🇯","🇸🇰","🇸🇱","🇸🇲","🇸🇳","🇸🇴","🇸🇷","🇸🇸","🇸🇹","🇸🇻","🇸🇽","🇸🇾","🇸🇿","🇹🇦","🇹🇨","🇹🇩","🇹🇫","🇹🇬","🇹🇭","🇹🇯","🇹🇰","🇹🇱","🇹🇲","🇹🇳","🇹🇴","🇹🇷","🇹🇹","🇹🇻","🇹🇼","🇹🇿","🇺🇦","🇺🇬","🇺🇲","🇺🇳","🇺🇸","🇺🇾","🇺🇿","🇻🇦","🇻🇨","🇻🇪","🇻🇬","🇻🇮","🇻🇳","🇻🇺","🇼🇫","🇼🇸","🇽🇰","🇾🇪","🇾🇹","🇿🇦","🇿🇲","🇿🇼","🏴󠁧󠁢󠁥󠁮󠁧󠁿","🏴󠁧󠁢󠁳󠁣󠁴󠁿","🏴󠁧󠁢󠁷󠁬󠁳󠁿"],ms=["🐵","🐒","🦍","🦧","🐶","🐕","🦮","🐕‍🦺","🐩","🐺","🦊","🦝","🐱","🐈","🐈‍⬛","🦁","🐯","🐅","🐆","🐴","🐎","🦄","🦓","🦌","🦬","🐮","🐂","🐃","🐄","🐷","🐖","🐗","🐽","🐏","🐑","🐐","🐪","🐫","🦙","🦒","🐘","🦣","🦏","🦛","🐭","🐁","🐀","🐹","🐰","🐇","🐿️","🐿","🦫","🦔","🦇","🐻","🐻‍❄️","🐻‍❄","🐨","🐼","🦥","🦦","🦨","🦘","🦡","🐾","🦃","🐔","🐓","🐣","🐤","🐥","🐦","🐧","🕊️","🕊","🦅","🦆","🦢","🦉","🦤","🪶","🦩","🦚","🦜","🐸","🐊","🐢","🦎","🐍","🐲","🐉","🦕","🦖","🐳","🐋","🐬","🦭","🐟","🐠","🐡","🦈","🐙","🐚","🐌","🦋","🐛","🐜","🐝","🪲","🐞","🦗","🪳","🕷️","🕷","🕸️","🕸","🦂","🦟","🪰","🪱","🦠","💐","🌸","💮","🏵️","🏵","🌹","🥀","🌺","🌻","🌼","🌷","🌱","🪴","🌲","🌳","🌴","🌵","🌾","🌿","☘️","☘","🍀","🍁","🍂","🍃"],xs=["🍇","🍈","🍉","🍊","🍋","🍌","🍍","🥭","🍎","🍏","🍐","🍑","🍒","🍓","🫐","🥝","🍅","🫒","🥥","🥑","🍆","🥔","🥕","🌽","🌶️","🌶","🫑","🥒","🥬","🥦","🧄","🧅","🍄","🥜","🌰","🍞","🥐","🥖","🫓","🥨","🥯","🥞","🧇","🧀","🍖","🍗","🥩","🥓","🍔","🍟","🍕","🌭","🥪","🌮","🌯","🫔","🥙","🧆","🥚","🍳","🥘","🍲","🫕","🥣","🥗","🍿","🧈","🧂","🥫","🍱","🍘","🍙","🍚","🍛","🍜","🍝","🍠","🍢","🍣","🍤","🍥","🥮","🍡","🥟","🥠","🥡","🦀","🦞","🦐","🦑","🦪","🍦","🍧","🍨","🍩","🍪","🎂","🍰","🧁","🥧","🍫","🍬","🍭","🍮","🍯","🍼","🥛","☕","🫖","🍵","🍶","🍾","🍷","🍸","🍹","🍺","🍻","🥂","🥃","🥤","🧋","🧃","🧉","🧊","🥢","🍽️","🍽","🍴","🥄","🔪","🏺"];function fs(){return n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"1em",height:"1em",children:n.jsx("path",{d:"M12 0C5.373 0 0 5.372 0 12c0 6.627 5.373 12 12 12 6.628 0 12-5.373 12-12 0-6.628-5.372-12-12-12m9.949 11H17.05c.224-2.527 1.232-4.773 1.968-6.113A9.966 9.966 0 0 1 21.949 11M13 11V2.051a9.945 9.945 0 0 1 4.432 1.564c-.858 1.491-2.156 4.22-2.392 7.385H13zm-2 0H8.961c-.238-3.165-1.536-5.894-2.393-7.385A9.95 9.95 0 0 1 11 2.051V11zm0 2v8.949a9.937 9.937 0 0 1-4.432-1.564c.857-1.492 2.155-4.221 2.393-7.385H11zm4.04 0c.236 3.164 1.534 5.893 2.392 7.385A9.92 9.92 0 0 1 13 21.949V13h2.04zM4.982 4.887C5.718 6.227 6.726 8.473 6.951 11h-4.9a9.977 9.977 0 0 1 2.931-6.113M2.051 13h4.9c-.226 2.527-1.233 4.771-1.969 6.113A9.972 9.972 0 0 1 2.051 13m16.967 6.113c-.735-1.342-1.744-3.586-1.968-6.113h4.899a9.961 9.961 0 0 1-2.931 6.113",fill:"currentColor"})})}function gs(){return n.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"1em",height:"1em",children:[n.jsx("path",{d:"M15.5 8a1.5 1.5 0 1 0 .001 3.001A1.5 1.5 0 0 0 15.5 8M8.5 8a1.5 1.5 0 1 0 .001 3.001A1.5 1.5 0 0 0 8.5 8",fill:"currentColor"}),n.jsx("path",{d:"M18.933 0h-.027c-.97 0-2.138.787-3.018 1.497-1.274-.374-2.612-.51-3.887-.51-1.285 0-2.616.133-3.874.517C7.245.79 6.069 0 5.093 0h-.027C3.352 0 .07 2.67.002 7.026c-.039 2.479.276 4.238 1.04 5.013.254.258.882.677 1.295.882.191 3.177.922 5.238 2.536 6.38.897.637 2.187.949 3.2 1.102C8.04 20.6 8 20.795 8 21c0 1.773 2.35 3 4 3 1.648 0 4-1.227 4-3 0-.201-.038-.393-.072-.586 2.573-.385 5.435-1.877 5.925-7.587.396-.22.887-.568 1.104-.788.763-.774 1.079-2.534 1.04-5.013C23.929 2.67 20.646 0 18.933 0M3.223 9.135c-.237.281-.837 1.155-.884 1.238-.15-.41-.368-1.349-.337-3.291.051-3.281 2.478-4.972 3.091-5.031.256.015.731.27 1.265.646-1.11 1.171-2.275 2.915-2.352 5.125-.133.546-.398.858-.783 1.313M12 22c-.901 0-1.954-.693-2-1 0-.654.475-1.236 1-1.602V20a1 1 0 1 0 2 0v-.602c.524.365 1 .947 1 1.602-.046.307-1.099 1-2 1m3-3.48v.02a4.752 4.752 0 0 0-1.262-1.02c1.092-.516 2.239-1.334 2.239-2.217 0-1.842-1.781-2.195-3.977-2.195-2.196 0-3.978.354-3.978 2.195 0 .883 1.148 1.701 2.238 2.217A4.8 4.8 0 0 0 9 18.539v-.025c-1-.076-2.182-.281-2.973-.842-1.301-.92-1.838-3.045-1.853-6.478l.023-.041c.496-.826 1.49-1.45 1.804-3.102 0-2.047 1.357-3.631 2.362-4.522C9.37 3.178 10.555 3 11.948 3c1.447 0 2.685.192 3.733.57 1 .9 2.316 2.465 2.316 4.48.313 1.651 1.307 2.275 1.803 3.102.035.058.068.117.102.178-.059 5.967-1.949 7.01-4.902 7.19m6.628-8.202c-.037-.065-.074-.13-.113-.195a7.587 7.587 0 0 0-.739-.987c-.385-.455-.648-.768-.782-1.313-.076-2.209-1.241-3.954-2.353-5.124.531-.376 1.004-.63 1.261-.647.636.071 3.044 1.764 3.096 5.031.027 1.81-.347 3.218-.37 3.235",fill:"currentColor"})]})}function bs(){return n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"1em",height:"1em",children:n.jsx("path",{d:"M0 0l6.084 24H8L1.916 0zM21 5h-4l-1-4H4l3 12h3l1 4h13L21 5zM6.563 3h7.875l2 8H8.563l-2-8zm8.832 10l-2.856 1.904L12.063 13h3.332zM19 13l-1.5-6h1.938l2 8H16l3-2z",fill:"currentColor"})})}function ps(){return n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"1em",height:"1em",children:n.jsx("path",{d:"M17 4.978c-1.838 0-2.876.396-3.68.934.513-1.172 1.768-2.934 4.68-2.934a1 1 0 0 0 0-2c-2.921 0-4.629 1.365-5.547 2.512-.064.078-.119.162-.18.244C11.73 1.838 10.798.023 9.207.023 8.579.022 7.85.306 7 .978 5.027 2.54 5.329 3.902 6.492 4.999 3.609 5.222 0 7.352 0 12.969c0 4.582 4.961 11.009 9 11.009 1.975 0 2.371-.486 3-1 .629.514 1.025 1 3 1 4.039 0 9-6.418 9-11 0-5.953-4.055-8-7-8M8.242 2.546c.641-.508.943-.523.965-.523.426.169.975 1.405 1.357 3.055-1.527-.629-2.741-1.352-2.98-1.846.059-.112.241-.356.658-.686M15 21.978c-1.08 0-1.21-.109-1.559-.402l-.176-.146c-.367-.302-.816-.452-1.266-.452s-.898.15-1.266.452l-.176.146c-.347.292-.477.402-1.557.402-2.813 0-7-5.389-7-9.009 0-5.823 4.488-5.991 5-5.991 1.939 0 2.484.471 3.387 1.251l.323.276a1.995 1.995 0 0 0 2.58 0l.323-.276c.902-.78 1.447-1.251 3.387-1.251.512 0 5 .168 5 6 0 3.617-4.187 9-7 9",fill:"currentColor"})})}function _s(){return n.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"1em",height:"1em",children:[n.jsx("path",{d:"M12 0a9 9 0 0 0-5 16.482V21s2.035 3 5 3 5-3 5-3v-4.518A9 9 0 0 0 12 0zm0 2c3.86 0 7 3.141 7 7s-3.14 7-7 7-7-3.141-7-7 3.14-7 7-7zM9 17.477c.94.332 1.946.523 3 .523s2.06-.19 3-.523v.834c-.91.436-1.925.689-3 .689a6.924 6.924 0 0 1-3-.69v-.833zm.236 3.07A8.854 8.854 0 0 0 12 21c.965 0 1.888-.167 2.758-.451C14.155 21.173 13.153 22 12 22c-1.102 0-2.117-.789-2.764-1.453z",fill:"currentColor"}),n.jsx("path",{d:"M14.745 12.449h-.004c-.852-.024-1.188-.858-1.577-1.824-.421-1.061-.703-1.561-1.182-1.566h-.009c-.481 0-.783.497-1.235 1.537-.436.982-.801 1.811-1.636 1.791l-.276-.043c-.565-.171-.853-.691-1.284-1.794-.125-.313-.202-.632-.27-.913-.051-.213-.127-.53-.195-.634C7.067 9.004 7.039 9 6.99 9A1 1 0 0 1 7 7h.01c1.662.017 2.015 1.373 2.198 2.134.486-.981 1.304-2.058 2.797-2.075 1.531.018 2.28 1.153 2.731 2.141l.002-.008C14.944 8.424 15.327 7 16.979 7h.032A1 1 0 1 1 17 9h-.011c-.149.076-.256.474-.319.709a6.484 6.484 0 0 1-.311.951c-.429.973-.79 1.789-1.614 1.789",fill:"currentColor"})]})}function ws(){return n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"1em",height:"1em",children:n.jsx("path",{d:"M0 0h11v2H0zM4 11h3V6h4V4H0v2h4zM15.5 17c1.381 0 2.5-1.116 2.5-2.493s-1.119-2.493-2.5-2.493S13 13.13 13 14.507 14.119 17 15.5 17m0-2.986c.276 0 .5.222.5.493 0 .272-.224.493-.5.493s-.5-.221-.5-.493.224-.493.5-.493M21.5 19.014c-1.381 0-2.5 1.116-2.5 2.493S20.119 24 21.5 24s2.5-1.116 2.5-2.493-1.119-2.493-2.5-2.493m0 2.986a.497.497 0 0 1-.5-.493c0-.271.224-.493.5-.493s.5.222.5.493a.497.497 0 0 1-.5.493M22 13l-9 9 1.513 1.5 8.99-9.009zM17 11c2.209 0 4-1.119 4-2.5V2s.985-.161 1.498.949C23.01 4.055 23 6 23 6s1-1.119 1-3.135C24-.02 21 0 21 0h-2v6.347A5.853 5.853 0 0 0 17 6c-2.209 0-4 1.119-4 2.5s1.791 2.5 4 2.5M10.297 20.482l-1.475-1.585a47.54 47.54 0 0 1-1.442 1.129c-.307-.288-.989-1.016-2.045-2.183.902-.836 1.479-1.466 1.729-1.892s.376-.871.376-1.336c0-.592-.273-1.178-.818-1.759-.546-.581-1.329-.871-2.349-.871-1.008 0-1.79.293-2.344.879-.556.587-.832 1.181-.832 1.784 0 .813.419 1.748 1.256 2.805-.847.614-1.444 1.208-1.794 1.784a3.465 3.465 0 0 0-.523 1.833c0 .857.308 1.56.924 2.107.616.549 1.423.823 2.42.823 1.173 0 2.444-.379 3.813-1.137L8.235 24h2.819l-2.09-2.383 1.333-1.135zm-6.736-6.389a1.02 1.02 0 0 1 .73-.286c.31 0 .559.085.747.254a.849.849 0 0 1 .283.659c0 .518-.419 1.112-1.257 1.784-.536-.651-.805-1.231-.805-1.742a.901.901 0 0 1 .302-.669M3.74 22c-.427 0-.778-.116-1.057-.349-.279-.232-.418-.487-.418-.766 0-.594.509-1.288 1.527-2.083.968 1.134 1.717 1.946 2.248 2.438-.921.507-1.686.76-2.3.76",fill:"currentColor"})})}function vs(){return n.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"1em",height:"1em",children:[n.jsx("path",{d:"M6.5 12C5.122 12 4 13.121 4 14.5S5.122 17 6.5 17 9 15.879 9 14.5 7.878 12 6.5 12m0 3c-.275 0-.5-.225-.5-.5s.225-.5.5-.5.5.225.5.5-.225.5-.5.5M17.5 12c-1.378 0-2.5 1.121-2.5 2.5s1.122 2.5 2.5 2.5 2.5-1.121 2.5-2.5-1.122-2.5-2.5-2.5m0 3c-.275 0-.5-.225-.5-.5s.225-.5.5-.5.5.225.5.5-.225.5-.5.5",fill:"currentColor"}),n.jsx("path",{d:"M22.482 9.494l-1.039-.346L21.4 9h.6c.552 0 1-.439 1-.992 0-.006-.003-.008-.003-.008H23c0-1-.889-2-1.984-2h-.642l-.731-1.717C19.262 3.012 18.091 2 16.764 2H7.236C5.909 2 4.738 3.012 4.357 4.283L3.626 6h-.642C1.889 6 1 7 1 8h.003S1 8.002 1 8.008C1 8.561 1.448 9 2 9h.6l-.043.148-1.039.346a2.001 2.001 0 0 0-1.359 2.097l.751 7.508a1 1 0 0 0 .994.901H3v1c0 1.103.896 2 2 2h2c1.104 0 2-.897 2-2v-1h6v1c0 1.103.896 2 2 2h2c1.104 0 2-.897 2-2v-1h1.096a.999.999 0 0 0 .994-.901l.751-7.508a2.001 2.001 0 0 0-1.359-2.097M6.273 4.857C6.402 4.43 6.788 4 7.236 4h9.527c.448 0 .834.43.963.857L19.313 9H4.688l1.585-4.143zM7 21H5v-1h2v1zm12 0h-2v-1h2v1zm2.189-3H2.811l-.662-6.607L3 11h18l.852.393L21.189 18z",fill:"currentColor"})]})}function ys(e,t=null){if(typeof window>"u")throw new Error;const i=localStorage.getItem(e);if(!i)return t;try{return JSON.parse(i)}catch{return i}}function js(e,t){window.localStorage.setItem(e,`${t}`)}class ft{constructor(t,i){re(this,"key");re(this,"value");re(this,"prev");re(this,"next");this.key=t,this.value=i,this.prev=null,this.next=null}}class ks{constructor(t){re(this,"capacity");re(this,"usedCapacity");re(this,"head");re(this,"tail");re(this,"store");this.capacity=t||20,this.usedCapacity=0,this.store={},this.head=new ft("fakeHeadNode","fakeHeadNode"),this.tail=new ft("fakeTailNode","fakeTailNode"),this.head.next=this.tail,this.tail.prev=this.head}removeNode(t){t.prev.next=t.next,t.next.prev=t.prev}addToHead(t){t.prev=this.head,t.next=this.head.next,this.head.next.prev=t,this.head.next=t}moveToHead(t){this.removeNode(t),this.addToHead(t)}removeTail(){const t=this.tail.prev;return this.removeNode(t),t}get(t){if(t in this.store){const i=this.store[t];return this.moveToHead(i),i.value}return-1}put(t,i){if(t in this.store){const r=this.store[t];r.value=i,this.moveToHead(r)}else{const r=new ft(t,i);if(this.addToHead(r),this.store[t]=r,this.usedCapacity+=1,this.usedCapacity>this.capacity){const a=this.removeTail();delete this.store[a.key],this.usedCapacity-=1}}}keys(){const t=[];let i=this.head;for(;i;)t.push(i.key),i=i.next;return t.slice(1,-1)}values(){const t=[];let i=this.head;for(;i;)t.push(i.value),i=i.next;return t.slice(1,-1)}toJSON(){return this.store}}function Cs(e,t){const i=new ks(t);return{syncFromStorage(){(ys(e)||[]).slice().reverse().forEach(o=>{i.put(o,o)})},syncToStorage(){js(e,Bi(i.keys()))},put(a){i.put(a,a),this.syncToStorage()},get(a){return a?i.get(a):i.keys()}}}const Ne=Cs("EMOJI_PICKER",20),ln=[{title:"Smileys & People",data:ss,icon:_.Laugh},{title:"Animals & Nature",data:ms,icon:gs},{title:"Food & Drink",data:xs,icon:ps},{title:"Activity",data:ds,icon:fs},{title:"Travel & Places",data:hs,icon:vs},{title:"Object",data:ls,icon:_s},{title:"Symbol",data:cs,icon:ws},{title:"Flags",data:us,icon:bs}],Ns=["😀","😃","😄","😁","😆","😅","😂","🤣"];function Ss({onSelectEmoji:e,children:t}){const[i,r]=l.useState([]),{t:a}=b.useLocale(),o=l.useMemo(()=>i.length?[{title:"Frequently used",icon:_.Clock3,data:i},...ln]:ln,[i]),s=l.useCallback(c=>{Ne.put(c),r(Ne.get()),e&&e(c)},[e]);return l.useEffect(()=>{Ne.syncFromStorage();const c=Ne.get();c!=null&&c.length||Ns.forEach(d=>{Ne.put(d)});const u=Ne.get();r(u)},[]),n.jsxs(ne,{modal:!0,children:[n.jsx(ie,{asChild:!0,children:t}),n.jsx(Q,{hideWhenDetached:!0,className:"richtext-w-full richtext-h-full richtext-p-2",align:"start",side:"bottom",children:n.jsxs(It,{defaultValue:"Frequently used",children:[n.jsx(ot,{className:"richtext-flex richtext-items-center richtext-gap-[4px]",children:o.map(c=>n.jsx(Ae,{value:c.title,className:"!richtext-p-[6px] richtext-bg-accent hover:richtext-text-accent-foreground",children:c.icon&&n.jsx(c.icon,{size:16})},`emoji-picker-title-${c.title}`))}),o.map(c=>n.jsxs(Le,{value:c.title,children:[n.jsx("p",{className:"richtext-mb-[6px] richtext-font-semibold",children:a(c.title)}),n.jsx("div",{className:"richtext-max-h-[280px] richtext-overflow-y-auto",children:n.jsx("div",{className:"richtext-grid richtext-grid-cols-8 richtext-gap-1 ",children:(c.data||[]).map(u=>n.jsx("div",{onClick:()=>s(u),className:"richtext-text-center richtext-cursor-pointer",children:u},`emoji-picker-${u}`))})})]},`emoji-picker-content-${c.title}`))]})})]})}function Ts({editor:e,icon:t,...i}){const r=l.useCallback(a=>{const{selection:o}=e.state,{$anchor:s}=o;return e.chain().insertContentAt(s.pos,a).run()},[e]);return n.jsx(Ss,{onSelectEmoji:r,children:n.jsx(j,{tooltip:i==null?void 0:i.tooltip,icon:t})})}const As=200,Ls=new v.PluginKey("emoji"),Ms=f.Node.create({name:"emoji",content:"text*",priority:As,addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),HTMLAttributes:{},suggestion:{char:":",pluginKey:Ls,command:({editor:t,range:i,props:r})=>{t.chain().focus().insertContentAt(i,`${r.emoji} `).run()}},button:({editor:t,t:i})=>({component:Ts,componentProps:{editor:t,action:()=>{},isActive:()=>!1,disabled:!1,icon:"EmojiIcon",tooltip:i("editor.emoji.tooltip")}})}},addCommands(){return{setEmoji:e=>({commands:t})=>t.insertContent(`${e.emoji} `)}},addProseMirrorPlugins(){return[f.Suggestion({editor:this.editor,...this.options.suggestion})]}}).configure({suggestion:{items:({query:e})=>os(e),render:()=>{let e,t,i;return{onStart:r=>{i=r.editor.isEditable,i&&(e=new f.ReactRenderer(Wn,{props:r,editor:r.editor}),t=nt("body",{getReferenceClientRect:r.clientRect,appendTo:()=>document.body,content:e.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start"}))},onUpdate(r){i&&(e.updateProps(r),t[0].setProps({getReferenceClientRect:r.clientRect}))},onKeyDown(r){var a;if(i)return r.event.key==="Escape"?(t[0].hide(),!0):(a=e.ref)==null?void 0:a.onKeyDown(r)},onExit(){i&&(t[0].destroy(),e.destroy())}}}}});function Es({editor:e,...t}){const{t:i}=b.useLocale(),r=We(e,_e.name,{text:"",defaultShowPicker:!1}),{text:a,defaultShowPicker:o}=r,[s,c]=l.useState(""),u=l.useCallback(()=>{e.chain().focus().setKatex({text:s}).run(),c("")},[e,s]);l.useEffect(()=>{o&&e.chain().updateAttributes(_e.name,{defaultShowPicker:!1}).focus().run()},[e,o]);const d=l.useMemo(()=>{try{return Lt.renderToString(`${s}`)}catch{return s}},[s]),h=l.useMemo(()=>`${s}`.trim()?n.jsx("span",{contentEditable:!1,dangerouslySetInnerHTML:{__html:d||""}}):null,[s,d]);return n.jsxs(ne,{modal:!0,children:[n.jsx(ie,{asChild:!0,children:n.jsx(j,{tooltip:t==null?void 0:t.tooltip,icon:t==null?void 0:t.icon})}),n.jsxs(Q,{hideWhenDetached:!0,className:"richtext-w-full richtext-h-full richtext-p-2",align:"start",side:"bottom",children:[n.jsx(X,{className:"richtext-mb-[6px]",children:i("editor.formula.dialog.text")}),n.jsx("div",{className:"richtext-flex richtext-w-full richtext-max-w-sm richtext-items-center richtext-gap-1.5 richtext-mb-[16px]",children:n.jsx("div",{className:"richtext-relative richtext-w-full richtext-max-w-sm",children:n.jsx(qe,{value:s,onChange:m=>c(m.target.value),autoFocus:!0,required:!0,rows:3,defaultValue:a,className:"richtext-w-full",placeholder:"Text"})})}),h&&n.jsx("div",{className:"richtext-my-[10px] richtext-p-[10px] richtext-rounded-[6px] !richtext-border-[1px] richtext-max-w-[286px] richtext-whitespace-nowrap richtext-overflow-auto",children:h}),n.jsxs("div",{className:"richtext-flex richtext-items-center richtext-justify-between richtext-gap-[6px]",children:[n.jsx(F,{onClick:u,className:"richtext-flex-1",children:"Submit"}),n.jsx("a",{href:"https://katex.org/docs/supported",target:"_blank",rel:"noreferrer noopener",children:n.jsx(_.HelpCircle,{size:16})})]})]})]})}function Is(e,t=1){let i=0,r=0,a=0;if(e.startsWith("rgb")){const o=e.replace(/\s/g,"").match(/rgb\((.*)\)$/)[1].split(",");i=+o[0],r=+o[1],a=+o[2]}else if(e.startsWith("#")){let o=e.replace("#","");o.length===3&&(o=`${o[0]}${o[0]}${o[1]}${o[1]}${o[2]}${o[2]}`),i=Number.parseInt(o.substring(0,2),16),r=Number.parseInt(o.substring(2,4),16),a=Number.parseInt(o.substring(4,6),16)}else return e;return t>1&&t<=100&&(t=t/100),`rgba(${i},${r},${a},${t})`}function Rs({node:e}){const t=br(),{text:i}=e.attrs,r=l.useMemo(()=>{const s="rgb(254, 242, 237)";return t==="dark"?Is(s,.75):s},[t]),a=l.useMemo(()=>{try{return Lt.renderToString(`${i}`)}catch{return i}},[i]),o=l.useMemo(()=>i.trim()?n.jsx("span",{contentEditable:!1,dangerouslySetInnerHTML:{__html:a}}):n.jsx("span",{contentEditable:!1,children:"Not enter a formula"}),[i,a]);return n.jsx(f.NodeViewWrapper,{style:{display:"inline-block",backgroundColor:r},as:"span",children:o})}function Hs(e){return t=>t.getAttribute(e)}const _e=f.Node.create({name:"katex",group:"inline",inline:!0,defining:!0,draggable:!0,selectable:!0,addOptions(){return{HTMLAttributes:{class:"katex"},button:({editor:e,t})=>({component:Es,componentProps:{editor:e,action:()=>{},isActive:()=>!1,disabled:!1,icon:"KatexIcon",tooltip:t("editor.katex.tooltip")}})}},addAttributes(){return{text:{default:"",parseHTML:Hs("text")},defaultShowPicker:{default:!1}}},parseHTML(){return[{tag:"span.katex"}]},renderHTML({HTMLAttributes:e}){return["span",f.mergeAttributes(this.options&&this.options.HTMLAttributes||{},e)]},addCommands(){return{setKatex:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e})}},addInputRules(){return[f.nodeInputRule({find:/^\$katex\$$/,type:this.type,getAttributes:()=>({defaultShowPicker:!0})})]},addNodeView(){return f.ReactNodeViewRenderer(Rs)}});function zs(e){const t=document.createElement("iframe");t.setAttribute("style","position: absolute; width: 0; height: 0; top: 0; left: 0;"),document.body.appendChild(t),t.textContent=`
138
- <!DOCTYPE html>
139
- <html lang="en">
140
- <head>
141
- <title>Echo Editor</title>
142
- <meta charset="UTF-8">
143
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
144
- </head>
145
- <body class="is-print">
146
- <div class="tiptap ProseMirror" translate="no" aria-expanded="false">
147
- ${e}
148
- </div>
149
- </body>
150
- </html>
151
- `;const i=t.contentWindow,r=t.contentDocument||t.contentWindow&&t.contentWindow.document,a=document.createElement("link");a.rel="stylesheet",a.href="https://cdn.jsdelivr.net/npm/reactjs-tiptap-editor@latest/lib/style.css",r.head.appendChild(a),r&&(r.open(),r.write(e),r.close()),i&&(t.onload=function(){try{setTimeout(()=>{i.focus();try{i.document.execCommand("print",!1)||i.print()}catch{i.print()}i.close()},10)}catch(o){console.error(o)}setTimeout(()=>{document.body.removeChild(t)},100)})}function Os(e){const t=e.getHTML();return t?(zs(t),!0):!1}const Ps=f.Extension.create({name:"exportPdf",addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),button:({editor:t,t:i})=>({component:j,componentProps:{action:()=>{Os(t)},icon:"ExportPdf",tooltip:i("editor.exportPdf.tooltip"),isActive:()=>!1,disabled:!1}})}}});function Ds(e,t){const i=atob(e.split(",")[1]),r=Array.from({length:i.length});for(let o=0;o<i.length;o++)r[o]=i.charCodeAt(o);const a=new Uint8Array(r);return new Blob([a],{type:t})}function Bs(e,t){return new File([e],t,{type:e.type})}function $s(e){const[t,i]=l.useState(!1),[r,a]=l.useState(),o=l.useRef();function s(){o.current.click()}function c(m){const x=m.target.files[0];a(x),x&&d()}async function u(m){var S;const g=new DOMParser().parseFromString(m,"text/html"),p=g.querySelectorAll("img");if(!p.length)return g.body.innerHTML;if(kn(e.editor,"image")){const I=(S=e.editor.extensionManager.extensions.find(k=>k.name==="importWord"))==null?void 0:S.options;if(I&&typeof I.upload=="function"){const k=[];for(const C of p){const T=C.getAttribute("src"),E=Ds(T,"image/jpeg"),O=Bs(E,"image.jpeg");k.push(O)}const y=await I.upload(k);for(let C=0;C<p.length;C++){const T=p[C];T.setAttribute("src",y[C].src);const E=T.parentElement;(E==null?void 0:E.tagName)==="P"&&(E.insertAdjacentElement("beforebegin",T),!E.hasChildNodes()&&E.textContent===""&&E.remove())}return g.body.innerHTML}else return console.warn("Image Upload method found, skip image conversion"),g.body.innerHTML}else return console.error("Image extension not found, unable to convert image"),g.body.innerHTML}async function d(){if(e.convert){const m=await e.convert(r);h(m)}else{const m=new FormData,x=JSON.stringify({collaboration_features:{comments:!0,user_id:"e3",track_changes:!0},formatting:{resets:"none",defaults:"inline",styles:"inline",comments:"basic"}});m.append("config",x),m.append("file",r),i(!0),fetch("https://docx-converter.cke-cs.com/v2/convert/docx-html",{method:"POST",body:m}).then(g=>g.json()).then(async g=>{h(g.html)}).catch(g=>{console.error("Error:",g),i(!1)})}}async function h(m){const x=await u(m);e.editor.chain().setContent(x,!0).run(),i(!1)}return n.jsxs("div",{children:[n.jsx(j,{loading:t,disabled:e==null?void 0:e.disabled,icon:e==null?void 0:e.icon,tooltip:e==null?void 0:e.tooltip,action:s}),n.jsx("input",{type:"file",accept:".docx",ref:o,style:{display:"none"},onChange:c})]})}const Fs=f.Extension.create({name:"importWord",addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),upload:void 0,convert:void 0,button:({editor:t,extension:i,t:r})=>{const{convert:a}=i.options;return{component:$s,componentProps:{convert:a,action:()=>t.commands.setHorizontalRule(),disabled:!t.can().setHorizontalRule(),icon:"Word",shortcutKeys:["alt","mod","S"],tooltip:r("editor.importWrod.tooltip")}}}}}}),Vs=typeof window<"u";function Us(e,t){if(Vs){const i=window.URL.createObjectURL(e),r=document.createElement("a");return r.href=i,r.download=t,r.click(),window.URL.revokeObjectURL(i),Promise.resolve()}return console.error("Download is not supported in Node.js"),Promise.resolve()}const Ws={...se.defaultNodes,hardBreak:se.defaultNodes.hard_break,codeBlock:se.defaultNodes.code_block,orderedList:se.defaultNodes.ordered_list,listItem:se.defaultNodes.list_item,bulletList:se.defaultNodes.bullet_list,horizontalRule:se.defaultNodes.horizontal_rule,image(e,t){e.renderInline(t),e.closeBlock(t)}},qs=new se.DocxSerializer(Ws,se.defaultMarks),Gs=f.Extension.create({name:"exportWord",addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),button:({editor:t,t:i})=>({component:j,componentProps:{icon:"ExportWord",action:()=>{t==null||t.commands.exportToWord()},tooltip:i("editor.exportWord.tooltip"),isActive:()=>!1,disabled:!1}})}},addCommands(){return{exportToWord:()=>async({editor:e})=>{const t={getImageBuffer:async r=>{const o=await(await fetch(r)).arrayBuffer();return new Uint8Array(o)}},i=qs.serialize(e.state.doc,t);return ri.Packer.toBlob(i).then(r=>Us(new Blob([r]),"export-document.docx")),!0}}}}),Ks="_toc_aag8a_1",Zs="_visible_aag8a_7",Xs="_list_aag8a_11",Js="_item_aag8a_16",Je={toc:Ks,visible:Zs,list:Xs,item:Js,"item--3":"_item--3_aag8a_19","item--4":"_item--4_aag8a_22","item--5":"_item--5_aag8a_25","item--6":"_item--6_aag8a_28"};function Ys(e){const t=[],i=[t];return e.forEach(r=>{let a=-1,o=i[r.level+a];for(;!o;)a-=1,o=i[r.level+a];o.push({...r,children:i[r.level]=[]})}),t}function Qs({editor:e}){const t=e.isEditable,[i,r]=l.useState([]),{t:a}=b.useLocale(),o=l.useCallback(()=>{const s=[],c=e.state.tr;e.state.doc.descendants((u,d)=>{if(u.type.name==="heading"){const h=`heading-${s.length+1}`;u.attrs.id!==h&&c.setNodeMarkup(d,void 0,{...u.attrs,id:h}),s.push({level:u.attrs.level,text:u.textContent,id:h})}}),c.setMeta("addToHistory",!1),c.setMeta("preventUpdate",!0),e.view.dispatch(c),r(s),e.eventEmitter&&e.eventEmitter.emit("TableOfContents",Ys(s))},[e]);return l.useEffect(()=>{if(e){if(!e.options.editable){o();return}return e.on("update",o),()=>{e.off("update",o)}}},[e,o]),l.useEffect(()=>{o()},[]),n.jsx(f.NodeViewWrapper,{className:v.clsx("tableOfContent",Je.toc,t&&Je.visible),children:t?n.jsxs("div",{style:{position:"relative"},children:[n.jsx("p",{className:"richtext-mb-[8px] text-[20px] richtext-font-semibold",children:a("editor.table_of_content")}),n.jsx("ul",{className:Je.list,children:i.map((s,c)=>n.jsx("li",{className:Je.item,style:{paddingLeft:`${s.level-2}rem`},children:n.jsx("a",{href:`#${s.id}`,children:s.text})},`table-of-content-${c}`))})]}):null})}function ec(e){return e&&e.type.name==="title"}function tc(e,t){const r=[e.getJSON()],a=[];for(;r.length;){const o=r.shift();o.type===t&&a.push(o),o.content&&o.content.length&&r.push(...o.content)}return a}function nc(e,...t){const[i,r]=l.useState(!1);return l.useEffect(()=>{const a=()=>{r(e.isActive.apply(e,t))};return e.on("selectionUpdate",a),e.on("transaction",a),()=>{e.off("selectionUpdate",a),e.off("transaction",a)}},[e,t,r]),i}function ic({editor:e,icon:t,tooltip:i}){const r=nc(e,qn.name),a=l.useCallback(()=>{if(r){e.chain().focus().removeTableOfContents().run();return}e.chain().focus().setTableOfContents().run()},[e,r]);return n.jsx(j,{action:a,isActive:()=>r||!1,icon:t,tooltip:i})}const qn=f.Node.create({name:"tableOfContents",group:"block",atom:!0,addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),onHasOneBeforeInsert:()=>{},resizable:!0,lastColumnResizable:!0,allowTableNodeSelection:!1,button:({editor:t,t:i})=>({component:ic,componentProps:{disabled:!1,icon:"BookMarked",tooltip:i("editor.table.tooltip"),editor:t}})}},parseHTML(){return[{tag:"toc"}]},renderHTML({HTMLAttributes:e}){return["toc",f.mergeAttributes(e)]},addNodeView(){return f.ReactNodeViewRenderer(Qs)},addCommands(){return{setTableOfContents:()=>({commands:e,editor:t,view:i})=>{if(tc(t,this.name).length){this.options.onHasOneBeforeInsert();return}const a=i.props.state.doc.content.firstChild;if(ec(a)){const o=(a.firstChild&&a.firstChild.nodeSize||0)+1;return e.insertContentAt(o,{type:this.name})}return e.insertContent({type:this.name})},removeTableOfContents:()=>({state:e,dispatch:t})=>{const{tr:i}=e,r=e.schema.nodes.tableOfContents;return e.doc.descendants((a,o)=>{if(a.type===r){const s=o,c=o+a.nodeSize;i.delete(s,c)}}),i.docChanged?(t(i),!0):!1}}},addGlobalAttributes(){return[{types:["heading"],attributes:{id:{default:null}}}]}});function rc(e){var i;const t=l.useMemo(()=>{var o;const r=(o=e==null?void 0:e.items)==null?void 0:o.find(s=>s.isActive());return r&&!r.default?{...r,icon:r.icon?r.icon:e.icon}:{title:e==null?void 0:e.tooltip,icon:e.icon,isActive:()=>!1}},[e]);return n.jsxs(ne,{modal:!0,children:[n.jsx(ie,{disabled:e==null?void 0:e.disabled,asChild:!0,children:n.jsx(j,{customClass:"!richtext-w-12 richtext-h-12",icon:e==null?void 0:e.icon,tooltip:e==null?void 0:e.tooltip,disabled:e==null?void 0:e.disabled,children:n.jsx($,{className:"richtext-w-3 richtext-h-3 richtext-ml-1 richtext-text-zinc-500",name:"MenuDown"})})}),n.jsx(Q,{className:"richtext-min-w-4 richtext-w-full !richtext-p-[4px] richtext-flex richtext-flex-row richtext-gap-1",align:"start",side:"bottom",children:(i=e==null?void 0:e.items)==null?void 0:i.map((r,a)=>{var o,s;return n.jsxs(Re,{children:[n.jsx(He,{asChild:!0,children:n.jsx(Ge,{size:"sm",onClick:r==null?void 0:r.action,className:"richtext-p-1 richtext-w-7 richtext-h-7",pressed:t.title===r.title,"data-state":t.title===r.title?"on":"off",children:(r==null?void 0:r.icon)&&n.jsx($,{name:r.icon})})}),n.jsxs(ye,{className:"richtext-flex richtext-flex-col richtext-items-center",children:[n.jsx("span",{children:r.title}),!!((o=r.shortcutKeys)!=null&&o.length)&&n.jsx("span",{children:(s=r.shortcutKeys)==null?void 0:s.map(c=>it(c)).join(" ")})]})]},`text-align-${a}`)})})]})}const ac=f.Extension.create({name:"text-direction",addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),types:["heading","paragraph"],directions:["auto","ltr","rtl"],defaultDirection:"auto",button({editor:t,extension:i,t:r}){var u;const a=((u=i.options)==null?void 0:u.directions)||[],o={auto:"TextDirection",ltr:"LeftToRight",rtl:"RightToLeft"},s=a.map(d=>({title:r(`editor.textDirection.${d}.tooltip`),icon:o[d],isActive:()=>!1,action:()=>{var h,m,x,g;if(d==="auto"){(m=(h=t.commands)==null?void 0:h.unsetTextDirection)==null||m.call(h);return}(g=(x=t.commands)==null?void 0:x.setTextDirection)==null||g.call(x,d)},disabled:!1})),c=s.filter(d=>d.disabled).length===s.length;return{component:rc,componentProps:{icon:"TextDirection",tooltip:r("editor.textDirection.tooltip"),disabled:c,items:s}}}}},addGlobalAttributes(){return[{types:this.options.types,attributes:{dir:{default:this.options.defaultDirection,parseHTML:e=>e.attributes.dir&&this.options.directions.includes(e.attributes.dir)?e.attributes.dir.value:this.options.defaultDirection,renderHTML:e=>({dir:e.dir})}}}]},addCommands(){return{setTextDirection:e=>({commands:t})=>this.options.directions.includes(e)?this.options.types.every(i=>t.updateAttributes(i,{dir:e})):!1,unsetTextDirection:()=>({commands:e})=>this.options.types.every(t=>e.resetAttributes(t,"dir"))}}}),oc="_listUsers_en3pm_1",sc="_itemUser_en3pm_10",cc="_selectedUser_en3pm_31",Ye={listUsers:oc,itemUser:sc,selectedUser:cc},lc=l.forwardRef((e,t)=>{const i=l.useRef(),[r,a]=l.useState(0),o=d=>{const h=e.items[d];h&&e.command({id:h,label:h})},s=()=>{a((r+e.items.length-1)%e.items.length)},c=()=>{a((r+1)%e.items.length)},u=()=>{o(r)};return l.useEffect(()=>a(0),[e.items]),l.useEffect(()=>{if(Number.isNaN(r+1))return;const d=i.current.querySelector(`span:nth-of-type(${r+1})`);d&&At(d,{behavior:"smooth",scrollMode:"if-needed"})},[r]),l.useImperativeHandle(t,()=>({onKeyDown:({event:d})=>d.key==="ArrowUp"?(s(),!0):d.key==="ArrowDown"?(c(),!0):d.key==="Enter"?(u(),!0):!1})),n.jsx("div",{className:v.clsx("listUsers",Ye.listUsers),children:n.jsx("div",{ref:i,children:e.items.length?e.items.map((d,h)=>n.jsx("span",{className:v.clsx("itemUser",Ye.itemUser,h===r?Ye.selectedUser:""),onClick:()=>o(h),children:d},h)):n.jsx("div",{className:v.clsx("itemUserEmpty",Ye.itemUser),children:"Empty"})})})}),dc=[{id:"1",name:"John Doe"},{id:"2",name:"Jane Doe"},{id:"3",name:"Alice"},{id:"4",name:"Bob"}],hc={items:async({query:e})=>dc.map(i=>i.name).filter(i=>i.toLowerCase().startsWith(e.toLowerCase())),render:()=>{let e,t;return{onStart:i=>{e=new f.ReactRenderer(lc,{props:i,editor:i.editor}),t=nt("body",{getReferenceClientRect:i.clientRect,appendTo:()=>document.body,content:e.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start"})},onUpdate(i){e.updateProps(i),t[0].setProps({getReferenceClientRect:i.clientRect})},onKeyDown(i){var r;return i.event.key==="Escape"?(t[0].hide(),!0):(r=e.ref)==null?void 0:r.onKeyDown(i)},onExit(){t[0].destroy(),e.destroy()}}}},uc=f.Mention.extend({addAttributes(){return{id:{default:"",parseHTML:G("id")},label:{default:"",parseHTML:G("label")}}}}).configure({HTMLAttributes:{class:"mention"},suggestion:hc});function mc(e){switch(or(e)){case"audio":return n.jsx(_.LucideAudioLines,{});case"video":return n.jsx(_.LucideVideo,{});case"file":return n.jsx(_.LucideFile,{});case"image":return n.jsx(_.LucideImage,{});case"pdf":return n.jsx(Hn,{});case"word":return n.jsx(zn,{});case"excel":return n.jsx(_.LucideSheet,{});case"ppt":return n.jsx(_.LucideTableProperties,{});default:return n.jsx(n.Fragment,{})}}const xc="_wrap_gpqtf_1",gt={wrap:xc};function fc({editor:e,node:t,updateAttributes:i,deleteNode:r,extension:a}){var T;const o=l.useRef(),s=e.isEditable,{hasTrigger:c,fileName:u,fileSize:d,fileExt:h,fileType:m,url:x,error:g}=t.attrs,[p,w]=l.useState(!1),{t:S}=b.useLocale(),I=(T=a==null?void 0:a.options)==null?void 0:T.upload,k=l.useCallback(()=>{!s||x||s&&o.current.click()},[s,x]),y=l.useCallback(async E=>{const O=E.target.files&&E.target.files[0];if(!O)return;const M={fileName:ir(O.name),fileSize:O.size,fileType:O.type,fileExt:rr(O.name)};w(!0);try{const L=await I(O);i({...M,url:L}),w(!1)}catch(L){i({error:`File upload fail: ${L&&L.message}`||"Unknown error"}),w(!1),o.current.value=""}},[w,i]);l.useEffect(()=>{!x&&!c&&(k(),i({hasTrigger:!0}))},[x,c,k,i]);const C=l.useCallback(()=>r(),[e]);return s&&!x?n.jsx(f.NodeViewWrapper,{children:n.jsxs("div",{className:v.clsx(gt.wrap,"render-wrapper"),children:[n.jsx("p",{style:{cursor:"pointer"},onClick:k,children:p?n.jsx("span",{children:S("editor.attachment.uploading")}):n.jsx("span",{children:S("editor.attachment.please_upload")})}),n.jsx("input",{ref:o,type:"file",hidden:!0,onChange:y})]})}):x?n.jsx(f.NodeViewWrapper,{children:n.jsxs("div",{className:v.clsx(gt.wrap,"render-wrapper"),onClick:k,children:[n.jsxs("div",{className:"richtext-flex richtext-items-center richtext-gap-[4px]",children:[n.jsx("span",{children:mc(m)}),n.jsxs("span",{children:[u,".",h]}),n.jsxs("span",{children:["(",ar(d),")"]})]}),n.jsx(j,{icon:"Trash2",action:C,tooltip:S("editor.delete")})]})}):g!=="null"?n.jsx(f.NodeViewWrapper,{children:n.jsx("div",{className:v.clsx(gt.wrap,"render-wrapper"),onClick:k,children:n.jsx("p",{children:g})})}):n.jsx(n.Fragment,{})}const gc=f.Node.create({name:"attachment",content:"",marks:"",group:"block",selectable:!0,atom:!0,draggable:!0,addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),HTMLAttributes:{class:"attachment"},button:({editor:t,t:i})=>({component:j,componentProps:{action:()=>t.chain().focus().setAttachment().run(),isActive:()=>!1,disabled:!1,icon:"Attachment",tooltip:i("editor.attachment.tooltip")}})}},parseHTML(){return[{tag:"div[class=attachment]"}]},renderHTML({HTMLAttributes:e}){return["div",f.mergeAttributes(this.options.HTMLAttributes,e)]},addAttributes(){return{fileName:{default:null,parseHTML:G("filename")},fileSize:{default:null,parseHTML:G("filesize")},fileType:{default:null,parseHTML:G("filetype")},fileExt:{default:null,parseHTML:G("fileext")},url:{default:null,parseHTML:G("url")},hasTrigger:{default:!1,parseHTML:e=>G("hastrigger")(e)==="true"},error:{default:null,parseHTML:G("error")}}},addCommands(){return{setAttachment:(e={})=>({chain:t})=>t().insertContent({type:this.name,attrs:e}).run()}},addNodeView(){return f.ReactNodeViewRenderer(fc)}}),Qe={TOP_LEFT:"tl",TOP_RIGHT:"tr",BOTTOM_LEFT:"bl",BOTTOM_RIGHT:"br"};function bc(e){var E,O;const[t,i]=l.useState({width:b.IMAGE_MAX_SIZE,height:b.IMAGE_MAX_SIZE}),[r,a]=l.useState({width:0,height:0}),[o]=l.useState([Qe.TOP_LEFT,Qe.TOP_RIGHT,Qe.BOTTOM_LEFT,Qe.BOTTOM_RIGHT]),[s,c]=l.useState(!1),[u,d]=l.useState({x:0,y:0,w:0,h:0,dir:""}),{align:h}=(E=e==null?void 0:e.node)==null?void 0:E.attrs,m=l.useMemo(()=>{var R;const{src:M,alt:L,width:A,height:N}=(R=e==null?void 0:e.node)==null?void 0:R.attrs,D=v.isNumber(A)?`${A}px`:A,z=v.isNumber(N)?`${N}px`:N;return{src:M||void 0,alt:L||void 0,style:{width:D||void 0,height:z||void 0}}},[(O=e==null?void 0:e.node)==null?void 0:O.attrs]),x=l.useMemo(()=>{const{style:{width:M}}=m;return{width:M==="100%"?M:void 0}},[m]);function g(M){a({width:M.target.width,height:M.target.height})}function p(){const{editor:M,getPos:L}=e;M.commands.setNodeSelection(L())}const w=l.useCallback(v.throttle(()=>{const{editor:M}=e,{width:L}=getComputedStyle(M.view.dom);i(A=>({...A,width:Number.parseInt(L,10)}))},b.IMAGE_THROTTLE_WAIT_TIME),[e==null?void 0:e.editor]);function S(M,L){M.preventDefault(),M.stopPropagation();const A=r.width,N=r.height,D=A/N;let z=Number(e.node.attrs.width),R=Number(e.node.attrs.height);const H=t.width;z&&!R?(z=z>H?H:z,R=Math.round(z/D)):R&&!z?(z=Math.round(R*D),z=z>H?H:z):!z&&!R?(z=A>H?H:A,R=Math.round(z/D)):z=z>H?H:z,Te.flushSync(()=>{c(!0),d({x:M.clientX,y:M.clientY,w:z,h:R,dir:L})})}const I=l.useCallback(v.throttle(M=>{if(M.preventDefault(),M.stopPropagation(),!s)return;const{x:L,w:A,dir:N}=u,D=(M.clientX-L)*(/l/.test(N)?-1:1),z=v.clamp(A+D,b.IMAGE_MIN_SIZE,t.width);e.updateAttributes({width:z,height:null})},b.IMAGE_THROTTLE_WAIT_TIME),[s,u,t,e.updateAttributes]),k=l.useCallback(M=>{M.preventDefault(),M.stopPropagation(),s&&(Te.flushSync(()=>{d({x:0,y:0,w:0,h:0,dir:""}),c(!1)}),p())},[s,p]),y=l.useCallback(()=>{document==null||document.addEventListener("mousemove",I,!0),document==null||document.addEventListener("mouseup",k,!0)},[I,k]),C=l.useCallback(()=>{document==null||document.removeEventListener("mousemove",I,!0),document==null||document.removeEventListener("mouseup",k,!0)},[I,k]);l.useEffect(()=>(s?y():C(),()=>{C()}),[s,y,C]);const T=l.useMemo(()=>new ResizeObserver(()=>w()),[w]);return l.useEffect(()=>(T.observe(e.editor.view.dom),()=>{T.disconnect()}),[e.editor.view.dom,T]),n.jsx(f.NodeViewWrapper,{className:"image-view",style:{...x,width:"100%",textAlign:h},children:n.jsxs("div",{draggable:"true","data-drag-handle":!0,className:`image-view__body ${e!=null&&e.selected?"image-view__body--focused":""} ${s?"image-view__body--resizing":""}`,style:x,children:[n.jsx("img",{src:m.src,alt:m.alt,style:m.style,height:"auto",className:"image-view__body__image block",onLoad:g,onClick:p}),(e==null?void 0:e.editor.view.editable)&&((e==null?void 0:e.selected)||s)&&n.jsx("div",{className:"image-resizer",children:o==null?void 0:o.map(M=>n.jsx("span",{className:`image-resizer__handler image-resizer__handler--${M}`,onMouseDown:L=>S(L,M)},`image-dir-${M}`))})]})})}function pc({selectImage:e,giphyApiKey:t,children:i}){const[r,a]=l.useState([]),[o]=l.useState(15),s=l.useRef(null),c=(d,h="search")=>{if(!t)return;const x=`${h==="search"?`https://api.giphy.com/v1/gifs/search?q=${d}`:`https://api.giphy.com/v1/gifs/trending?q=${d}`}&limit=${o}&api_key=${t}`;fetch(x).then(g=>g.json()).then(g=>{a(g.data)}).catch(g=>{console.log(g)})};l.useEffect(()=>{c("","trend")},[]);const u=l.useCallback(v.debounce(d=>{if(!d.target.value){c("","trend");return}c(d.target.value)},350),[]);return n.jsxs(ne,{modal:!0,children:[n.jsx(ie,{asChild:!0,children:i}),n.jsx(Q,{hideWhenDetached:!0,className:"richtext-w-full richtext-h-full richtext-p-2",align:"start",side:"bottom",children:t?n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"richtext-w-full richtext-mb-[10px]",children:n.jsx(Z,{ref:s,type:"text",placeholder:"Search GIF",onChange:u})}),n.jsx("div",{className:"richtext-max-h-[280px] richtext-overflow-y-auto",children:n.jsx("div",{className:"richtext-grid richtext-grid-cols-2 richtext-gap-1 ",children:r!=null&&r.length?r==null?void 0:r.map(d=>n.jsx("img",{alt:"giphy",className:"richtext-text-center richtext-cursor-pointer",onClick:h=>e(d),height:d.images.fixed_width_downsampled.height,width:d.images.fixed_width_downsampled.width,src:d.images.fixed_width_downsampled.url},`giphy-${d.id}`)):n.jsx("p",{children:"No GIFs found"})})})]}):n.jsx("div",{children:n.jsx("p",{children:"Missing Giphy API Key"})})})]})}function _c({editor:e,icon:t,giphyApiKey:i,...r}){const a=o=>{const{url:s}=o.images.original;e.chain().focus().setImageGif({src:s}).run()};return n.jsx(pc,{selectImage:a,giphyApiKey:i,children:n.jsx(j,{tooltip:r==null?void 0:r.tooltip,icon:t})})}const Dt=f.Image.extend({name:"imageGif",addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),inline:!1,content:"",marks:"",group:"block",GIPHY_API_KEY:"",draggable:!1,selectable:!0,atom:!0,button:({editor:t,extension:i,t:r})=>{var o;const a=((o=i==null?void 0:i.options)==null?void 0:o.GIPHY_API_KEY)||"";return{component:_c,componentProps:{editor:t,action:()=>{},isActive:()=>!1,disabled:!1,icon:"GifIcon",tooltip:r("editor.imageGif.tooltip"),giphyApiKey:a}}}}},addAttributes(){var e;return{...(e=this.parent)==null?void 0:e.call(this),width:{default:null,parseHTML:t=>{const i=t.style.width||t.getAttribute("width")||"10";return i===void 0?null:Number.parseInt(`${i}`,10)},renderHTML:t=>({width:t.width})},align:{default:"center",parseHTML:t=>t.getAttribute("align"),renderHTML:t=>({align:t.align})}}},addNodeView(){return f.ReactNodeViewRenderer(bc)},addCommands(){var e;return{...(e=this.parent)==null?void 0:e.call(this),setImageGif:t=>({commands:i})=>i.insertContent({type:this.name,attrs:t}),updateImageGif:t=>({commands:i})=>i.updateAttributes(this.name,t),setAlignImageGif:t=>({commands:i})=>i.updateAttributes(this.name,{align:t})}},renderHTML({HTMLAttributes:e}){const{align:t}=e;return["div",{style:t?`text-align: ${t};`:"",class:"imageGIf"},["img",f.mergeAttributes({height:"auto"},this.options.HTMLAttributes,e)]]},parseHTML(){return[{tag:"div[class=imageGIf]",getAttrs:e=>{const t=e.querySelector("img"),i=t==null?void 0:t.getAttribute("width");return{src:t==null?void 0:t.getAttribute("src"),alt:t==null?void 0:t.getAttribute("alt"),title:t==null?void 0:t.getAttribute("title"),width:i?Number.parseInt(i,10):null,align:(t==null?void 0:t.getAttribute("align"))||e.style.textAlign||null}}}]}}),dn=`graph TB
152
- a-->b`,wc=({editor:e,upload:t})=>{const[i,r]=l.useState(dn),[a,o]=l.useState(""),[s,c]=l.useState(!1),u=l.useRef(null),d=async x=>{try{const{svg:g}=await tt.render("mermaid-svg",x);o(g)}catch{o("")}},h=()=>{tt.initialize({darkMode:!1,startOnLoad:!1,fontSize:12,theme:"base"}),d(i)};l.useEffect(()=>{s&&h()},[s]),l.useEffect(()=>{s&&d(i)},[i]);const m=async()=>{if(i!==""){if(i){const x=u.current.querySelector("svg"),{width:g,height:p}=x.getBoundingClientRect(),w=`mermaid-${Sn()}.svg`;let S=v.i(x.outerHTML);if(t){const I=Ht(S,w);S=await t(I)}e==null||e.chain().focus().setMermaid({type:"mermaid",src:S,alt:encodeURIComponent(i),width:g,height:p},!!i).run()}c(!1)}};return n.jsxs(je,{open:s,onOpenChange:c,children:[n.jsx(ke,{asChild:!0,children:n.jsx(j,{icon:"Mermaid",tooltip:"Mermaid",action:()=>c(!0)})}),n.jsxs(he,{className:"!richtext-max-w-[1300px] richtext-z-[99999]",children:[n.jsx(ue,{children:"Mermaid"}),n.jsx("div",{style:{height:"100%",borderWidth:1},children:n.jsxs("div",{className:"richtext-flex richtext-gap-[10px] richtext-rounded-[10px] richtext-p-[10px]",children:[n.jsx(qe,{className:"richtext-flex-1",value:i,onChange:x=>r(x.target.value),autoFocus:!0,required:!0,rows:10,defaultValue:dn,placeholder:"Text",style:{color:"hsl(var(--richtext-foreground))"}}),n.jsx("div",{className:"richtext-flex-1 richtext-flex richtext-items-center richtext-justify-center richtext-rounded-[10px] richtext-p-[10px]",style:{height:"100%",borderWidth:1,minHeight:500,background:"#fff"},ref:u,dangerouslySetInnerHTML:{__html:a}})]})}),n.jsx(ze,{children:n.jsx(F,{type:"button",onClick:m,children:"Save changes"})})]})]})},et={TOP_LEFT:"tl",TOP_RIGHT:"tr",BOTTOM_LEFT:"bl",BOTTOM_RIGHT:"br"};function vc({editor:e,node:t,updateAttributes:i,getPos:r,selected:a}){const[o,s]=l.useState({width:b.IMAGE_MAX_SIZE,height:b.IMAGE_MAX_SIZE}),[c,u]=l.useState({width:0,height:0}),[d]=l.useState([et.TOP_LEFT,et.TOP_RIGHT,et.BOTTOM_LEFT,et.BOTTOM_RIGHT]),[h,m]=l.useState(!1),[x,g]=l.useState({x:0,y:0,w:0,h:0,dir:""}),{align:p}=t==null?void 0:t.attrs,w=l.useMemo(()=>{const{src:A,alt:N,width:D,height:z}=t==null?void 0:t.attrs,R=f.isNumber(D)?`${D}px`:D,H=f.isNumber(z)?`${z}px`:z;return{src:A||void 0,alt:N||void 0,style:{width:R||void 0,height:H||void 0}}},[t==null?void 0:t.attrs]),S=l.useMemo(()=>{const{style:{width:A}}=w;return{width:A==="100%"?A:void 0}},[w]);function I(A){u({width:A.target.width,height:A.target.height})}function k(){e.commands.setNodeSelection(r())}const y=l.useCallback(v.throttle(()=>{const{width:A}=getComputedStyle(e.view.dom);s(N=>({...N,width:Number.parseInt(A,10)}))},b.IMAGE_THROTTLE_WAIT_TIME),[e]);function C(A,N){A.preventDefault(),A.stopPropagation();const D=c.width,z=c.height,R=D/z;let H=Number(t.attrs.width),U=Number(t.attrs.height);const K=o.width;H&&!U?(H=H>K?K:H,U=Math.round(H/R)):U&&!H?(H=Math.round(U*R),H=H>K?K:H):!H&&!U?(H=D>K?K:D,U=Math.round(H/R)):H=H>K?K:H,Te.flushSync(()=>{m(!0),g({x:A.clientX,y:A.clientY,w:H,h:U,dir:N})})}const T=l.useCallback(v.throttle(A=>{if(A.preventDefault(),A.stopPropagation(),!h)return;const{x:N,w:D,dir:z}=x,R=(A.clientX-N)*(/l/.test(z)?-1:1),H=jn(D+R,b.IMAGE_MIN_SIZE,o.width);i({width:H,height:null})},b.IMAGE_THROTTLE_WAIT_TIME),[h,x,o,i]),E=l.useCallback(A=>{A.preventDefault(),A.stopPropagation(),h&&(Te.flushSync(()=>{g({x:0,y:0,w:0,h:0,dir:""}),m(!1)}),k())},[h,k]),O=l.useCallback(()=>{document==null||document.addEventListener("mousemove",T,!0),document==null||document.addEventListener("mouseup",E,!0)},[T,E]),M=l.useCallback(()=>{document==null||document.removeEventListener("mousemove",T,!0),document==null||document.removeEventListener("mouseup",E,!0)},[T,E]);l.useEffect(()=>(h?O():M(),()=>{M()}),[h,O,M]);const L=l.useMemo(()=>new ResizeObserver(()=>y()),[y]);return l.useEffect(()=>(L.observe(e.view.dom),()=>{L.disconnect()}),[e.view.dom,L]),n.jsx(f.NodeViewWrapper,{className:"image-view",style:{...S,width:"100%",textAlign:p},children:n.jsxs("div",{draggable:"true","data-drag-handle":!0,className:`image-view__body ${a?"image-view__body--focused":""} ${h?"image-view__body--resizing":""}`,style:{...S,background:"#fff"},children:[n.jsx("img",{src:w.src,alt:w.alt,style:w.style,height:"auto",className:"image-view__body__image block",onLoad:I,onClick:k}),e.view.editable&&(a||h)&&n.jsx("div",{className:"image-resizer",children:d==null?void 0:d.map(A=>n.jsx("span",{className:`image-resizer__handler image-resizer__handler--${A}`,onMouseDown:N=>C(N,A)},`image-dir-${A}`))})]})})}const St=f.Image.extend({name:"mermaid",addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),inline:!1,content:"",marks:"",group:"block",draggable:!1,selectable:!0,atom:!0,HTMLAttributes:{class:"mermaid"},button:({editor:t,t:i,extension:r})=>{var a;return{component:wc,componentProps:{action:()=>{},isActive:()=>!1,disabled:!1,editor:t,icon:"Mermaid",tooltip:i("editor.mermaid.tooltip"),upload:(a=r==null?void 0:r.options)==null?void 0:a.upload}}}}},addAttributes(){var e;return{...(e=this.parent)==null?void 0:e.call(this),width:{default:null,parseHTML:t=>{const i=t.style.width||t.getAttribute("width")||"10";return i===void 0?null:Number.parseInt(`${i}`,10)},renderHTML:t=>({width:t.width})},height:{default:null,parseHTML:t=>{const i=t.style.height||t.getAttribute("height")||"10";return i===void 0?null:Number.parseInt(`${i}`,10)},renderHTML:t=>({height:t.height})},align:{default:"center",parseHTML:t=>t.getAttribute("align"),renderHTML:t=>({align:t.align})}}},addNodeView(){return f.ReactNodeViewRenderer(vc)},addCommands(){return{setMermaid:(e,t)=>({commands:i,editor:r})=>t?i.insertContent({type:this.name,attrs:e}):i.insertContentAt(r.state.selection.anchor,{type:this.name,attrs:e}),setAlignImageMermaid:e=>({commands:t})=>t.updateAttributes(this.name,{align:e})}},renderHTML({HTMLAttributes:e}){const{align:t}=e;return["div",{style:t?`text-align: ${t};`:"",class:"imageMermaid"},["img",f.mergeAttributes(this.options.HTMLAttributes,e)]]},parseHTML(){return[{tag:"div[class=imageMermaid]",getAttrs:e=>{const t=e.querySelector("img"),i=t==null?void 0:t.getAttribute("width"),r=t==null?void 0:t.getAttribute("height");return{src:t==null?void 0:t.getAttribute("src"),alt:t==null?void 0:t.getAttribute("alt"),width:i?Number.parseInt(i,10):null,height:r?Number.parseInt(r,10):null,align:(t==null?void 0:t.getAttribute("align"))||e.style.textAlign||null}}}]}});exports.Attachment=gc;exports.BaseKit=wo;exports.Blockquote=no;exports.Bold=va;exports.BulletList=Ya;exports.Clear=Qa;exports.Code=Ca;exports.CodeBlock=$n;exports.Color=Xa;exports.Column=st;exports.ColumnActionButton=fo;exports.Emoji=Ms;exports.Excalidraw=ge;exports.ExportPdf=Ps;exports.ExportWord=Gs;exports.FontFamily=$a;exports.FontSize=Ga;exports.FormatPainter=Qo;exports.Heading=Va;exports.Highlight=Ja;exports.History=co;exports.HorizontalRule=ao;exports.Iframe=be;exports.Image=Bo;exports.ImageGif=Dt;exports.ImportWord=Fs;exports.Indent=ko;exports.Italic=ya;exports.Katex=_e;exports.LineHeight=Lo;exports.Link=ro;exports.Mention=uc;exports.Mermaid=St;exports.MoreMark=jo;exports.MultiColumn=Me;exports.OrderedList=eo;exports.RichTextEditor=Sr;exports.SearchAndReplace=Un;exports.SlashCommand=zo;exports.Strike=ka;exports.SubAndSuperScript=vo;exports.Table=Yo;exports.TableOfContents=qn;exports.TaskList=to;exports.TextAlign=Wa;exports.TextDirection=ac;exports.Underline=ja;exports.Video=Vo;exports.mitt=vn;