UNPKG

tiptap-editor-react

Version:

A modern WYSIWYG rich text editor based on tiptap and shadcn ui for React

1,055 lines 182 kB
import { jsxs as u, jsx as i, Fragment as _ } from "react/jsx-runtime"; import * as E from "react"; import Re, { useState as w, useCallback as C, useEffect as I, useRef as nt, useMemo as P, Fragment as Oe, forwardRef as ki, useImperativeHandle as Si } from "react"; import { f as Rt, N as ht, m as it, i as Ai, a as ut, R as xt, n as ne, I as _e, b as xe, c as Mi, B as Y, d as Li, D as Ii, e as Ei, u as zi, E as Ri } from "./tiptap-DXj1s_xP.js"; import { u as V, m as Oi, I as Ot, f as _t, g as He, C as _i, h as Z, B as Hi, i as Ht, V as me, E as Pi } from "./index-BUxFK1y_.js"; import * as Pe from "@radix-ui/react-separator"; import { ap as Di, aq as Pt, ao as De, ar as Be, as as $t, at as $e, T as bt, N as Bi, A as $i, au as Ve, av as Vi, aw as fe, ax as wt, ay as Wi, az as We, aA as ji, H as Vt, aB as Fi, aC as Gi } from "./vendor-DIvoV5tx.js"; import * as X from "@radix-ui/react-toast"; import { ChevronRight as Ui, Check as Ki, Circle as Zi, X as je, FlipHorizontal as Xi, FlipVertical as qi, CropIcon as Yi, ChevronUp as Ji, Paperclip as Qi, Eye as tr, Settings as er, ZoomOut as ir, ZoomIn as rr, BookMarked as nr, Sigma as cr, SmilePlusIcon as ar, Replace as ge, SmilePlus as or, Frame as sr, Columns2 as pe, PanelRight as lr, PanelLeft as dr, Clipboard as hr, Copy as ur, GripVertical as xr, Plus as Fe, Columns4 as mr, Columns3 as fr, Heading6 as gr, Heading5 as pr, Heading4 as wr, Heading3 as vr, Heading2 as br, Heading1 as yr, ChevronsUpDown as Cr, Trash as Nr, Trash2 as Ge, TableCellsSplit as Tr, TableCellsMerge as kr, BetweenVerticalEnd as Sr, BetweenVerticalStart as Ar, BetweenHorizonalStart as Mr, BetweenHorizonalEnd as Lr, Unlink as Ir, Pencil as Ue, Sparkles as Er, Table as zr, Minimize as Rr, Maximize as Or, Video as _r, ImageUp as Hr, Link as Pr, ListTodo as Dr, ListOrdered as Br, List as $r, IndentDecrease as Vr, IndentIncrease as Wr, Type as jr, CodeXml as Fr, Code as Gr, Superscript as Ur, Subscript as Kr, ChevronDown as Zr, Undo2 as Xr, Redo2 as qr, PaintRoller as Yr, Eraser as Jr, Minus as Qr, Strikethrough as tn, Quote as en, Underline as rn, Italic as nn, LoaderCircle as cn, Bold as an, HelpCircle as Ke } from "lucide-react"; import * as yt from "@radix-ui/react-tooltip"; import ce from "katex"; import { Slot as Ze } from "@radix-ui/react-slot"; import * as Xe from "@radix-ui/react-toggle"; import { TextAlignRightIcon as on, TextAlignLeftIcon as sn, TextAlignJustifyIcon as ln, TextAlignCenterIcon as dn } from "@radix-ui/react-icons"; import * as vt from "@radix-ui/react-popover"; import * as qe from "@radix-ui/react-label"; import * as q from "@radix-ui/react-dialog"; import { Resizable as Ye } from "re-resizable"; import Dt from "mermaid"; import { sticky as hn } from "tippy.js"; import { HexColorPicker as un } from "react-colorful"; import * as qt from "@radix-ui/react-switch"; import * as D from "@radix-ui/react-dropdown-menu"; function L(...t) { return Di(Pt(t)); } let Ft; function Gt() { return Ft === void 0 && (Ft = navigator.platform.includes("Mac")), Ft; } function xn(t) { return `${t}`.toLowerCase() === "mod" ? Gt() ? "⌘" : "Ctrl" : `${t}`.toLowerCase() === "alt" ? Gt() ? "⌥" : "Alt" : `${t}`.toLowerCase() === "shift" ? Gt() ? "⇧" : "Shift" : t; } function mn(t) { return t.map(xn).join(" "); } const v = Re.forwardRef( (t, e) => { const { icon: r = void 0, // title = undefined, tooltip: n = void 0, disabled: c = !1, customClass: a = "", // color = undefined, loading: o = void 0, shortcutKeys: s = void 0, tooltipOptions: l = {}, action: d = void 0, isActive: h = void 0, children: x, asChild: m = !1, upload: f = !1, ...p } = t, b = hi[r]; return /* @__PURE__ */ u(li, { children: [ /* @__PURE__ */ i(di, { asChild: !0, children: /* @__PURE__ */ u( m ? Ze : si, { "data-state": h != null && h() ? "on" : "off", onClick: d, ref: e, size: "sm", className: L("richtext-w-[32px] richtext-h-[32px]", a), disabled: c, ...p, children: [ b && /* @__PURE__ */ i(b, { className: "richtext-size-4" }), x ] } ) }), n && /* @__PURE__ */ i(ae, { ...l, children: /* @__PURE__ */ u("div", { className: "richtext-flex richtext-max-w-24 richtext-flex-col richtext-items-center richtext-text-center", children: [ /* @__PURE__ */ i("div", { children: n }), !!(s != null && s.length) && /* @__PURE__ */ i("span", { children: mn(s) }) ] }) }) ] }); } ), Je = De(!1); function fn() { return Be(Je); } const gn = { setDisable: (t) => { Je(t); } }; function Ct(t, e) { const { state: r } = e, n = r.selection.$anchor; let c = !1; if (n.depth) for (let a = n.depth; a > 0; a--) n.node(a).type.name === t && (e.dispatchTransaction && e.dispatchTransaction(r.tr.delete(n.before(a), n.after(a)).scrollIntoView()), c = !0); else { const a = r.selection.node; a && a.type.name === t && (e.chain().deleteSelection().run(), c = !0); } if (!c) { const a = n.pos; if (a) { const o = r.tr.doc.nodeAt(a); o && o.type.name === t && (e.dispatchTransaction && e.dispatchTransaction(r.tr.delete(a, a + o.nodeSize)), c = !0); } } return c; } function Qe(t, e, r) { return t < e ? e : t > r ? r : t; } const pn = (t) => typeof t == "number", wn = (t) => typeof t == "string", vn = (t) => typeof t == "function"; function ho(t, e = "px") { if (!t) return t; const r = pn(t) ? String(t) : t, n = Number.parseFloat(r), c = r.match(/[%a-z]+$/i), a = c ? c[0] : e; return Number.isNaN(n) ? t : n + a; } function bn(t, e) { if (!t) return !1; const { extensions: r = [] } = (t == null ? void 0 : t.extensionManager) ?? {}; return !!r.find((c) => c.name === e); } function uo(t) { return t.map((e) => wn(e) ? { value: e, name: e } : e); } const yn = $t( "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" } } ), U = E.forwardRef( ({ className: t, variant: e, size: r, asChild: n = !1, ...c }, a) => /* @__PURE__ */ i( n ? Ze : "button", { className: L(yn({ variant: e, size: r, className: t })), ref: a, ...c } ) ); U.displayName = "Button"; const Cn = D.Root, Nn = D.Trigger, we = D.Portal, ve = D.Sub, Yt = E.forwardRef(({ className: t, inset: e, children: r, ...n }, c) => /* @__PURE__ */ u( D.SubTrigger, { ref: c, className: L( "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", e && "richtext-pl-8", t ), ...n, children: [ r, /* @__PURE__ */ i(Ui, { className: "richtext-ml-auto richtext-h-4 richtext-w-4" }) ] } )); Yt.displayName = D.SubTrigger.displayName; const Jt = E.forwardRef(({ className: t, ...e }, r) => /* @__PURE__ */ i( D.SubContent, { ref: r, className: L( "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", t ), ...e } )); Jt.displayName = D.SubContent.displayName; const ti = E.forwardRef(({ className: t, sideOffset: e = 4, ...r }, n) => /* @__PURE__ */ i(D.Portal, { children: /* @__PURE__ */ i( D.Content, { ref: n, sideOffset: e, className: L( "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", t ), ...r } ) })); ti.displayName = D.Content.displayName; const tt = E.forwardRef(({ className: t, inset: e, ...r }, n) => /* @__PURE__ */ i( D.Item, { ref: n, className: L( "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", e && "richtext-pl-8", t ), ...r } )); tt.displayName = D.Item.displayName; const Tn = E.forwardRef(({ className: t, children: e, checked: r, ...n }, c) => /* @__PURE__ */ u( D.CheckboxItem, { ref: c, className: L( "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", t ), checked: r, ...n, children: [ /* @__PURE__ */ i("span", { className: "richtext-absolute richtext-left-2 richtext-flex richtext-h-3.5 richtext-w-3.5 richtext-items-center richtext-justify-center", children: /* @__PURE__ */ i(D.ItemIndicator, { children: /* @__PURE__ */ i(Ki, { className: "richtext-h-4 richtext-w-4" }) }) }), e ] } )); Tn.displayName = D.CheckboxItem.displayName; const kn = E.forwardRef(({ className: t, children: e, ...r }, n) => /* @__PURE__ */ u( D.RadioItem, { ref: n, className: L( "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", t ), ...r, children: [ /* @__PURE__ */ i("span", { className: "richtext-absolute richtext-left-2 richtext-flex richtext-h-3.5 richtext-w-3.5 richtext-items-center richtext-justify-center", children: /* @__PURE__ */ i(D.ItemIndicator, { children: /* @__PURE__ */ i(Zi, { className: "richtext-h-2 richtext-w-2 richtext-fill-current" }) }) }), e ] } )); kn.displayName = D.RadioItem.displayName; const Sn = E.forwardRef(({ className: t, inset: e, ...r }, n) => /* @__PURE__ */ i( D.Label, { ref: n, className: L( "richtext-px-2 richtext-py-1.5 richtext-text-sm richtext-font-semibold", e && "richtext-pl-8", t ), ...r } )); Sn.displayName = D.Label.displayName; const ei = E.forwardRef(({ className: t, ...e }, r) => /* @__PURE__ */ i( D.Separator, { ref: r, className: L("richtext--mx-1 richtext-my-1 richtext-h-px richtext-bg-muted", t), ...e } )); ei.displayName = D.Separator.displayName; function An({ className: t, ...e }) { return /* @__PURE__ */ i( "span", { className: L("richtext-ml-auto richtext-text-xs richtext-tracking-widest richtext-opacity-60", t), ...e } ); } An.displayName = "DropdownMenuShortcut"; const J = E.forwardRef( ({ className: t, type: e, ...r }, n) => /* @__PURE__ */ i( "input", { type: e, className: L( "richtext-flex richtext-h-10 richtext-w-full richtext-rounded-md !richtext-border richtext-border-input richtext-bg-background richtext-px-3 richtext-py-2 richtext-text-sm richtext-ring-offset-background file:richtext-border-0 file:richtext-bg-transparent file:richtext-text-sm file:richtext-font-medium placeholder:richtext-text-muted-foreground focus-visible:richtext-outline-none disabled:richtext-cursor-not-allowed disabled:richtext-opacity-50", t ), ref: n, ...r } ) ); J.displayName = "Input"; const Mn = $t( "richtext-text-sm richtext-font-medium richtext-leading-none peer-disabled:richtext-cursor-not-allowed peer-disabled:richtext-opacity-70" ), et = E.forwardRef(({ className: t, ...e }, r) => /* @__PURE__ */ i( qe.Root, { ref: r, className: L(Mn(), t), ...e } )); et.displayName = qe.Root.displayName; const mt = vt.Root, ft = vt.Trigger, ct = E.forwardRef(({ className: t, align: e = "center", sideOffset: r = 4, ...n }, c) => /* @__PURE__ */ i(vt.Portal, { children: /* @__PURE__ */ i( vt.Content, { ref: c, align: e, sideOffset: r, className: L( "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", t ), ...n } ) })); ct.displayName = vt.Content.displayName; const Q = E.forwardRef( ({ className: t, orientation: e = "horizontal", decorative: r = !0, ...n }, c) => /* @__PURE__ */ i( Pe.Root, { ref: c, decorative: r, orientation: e, className: L( "richtext-shrink-0 richtext-bg-border", e === "horizontal" ? "richtext-h-[1px] richtext-w-full" : "richtext-h-full richtext-w-[1px]", t ), ...n } ) ); Q.displayName = Pe.Root.displayName; const ii = E.forwardRef(({ className: t, ...e }, r) => /* @__PURE__ */ i( qt.Root, { className: L( "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", t ), ...e, ref: r, children: /* @__PURE__ */ i( qt.Thumb, { className: L( "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" ) } ) } )); ii.displayName = qt.Root.displayName; const Ln = X.Provider, ri = E.forwardRef(({ className: t, ...e }, r) => /* @__PURE__ */ i( X.Viewport, { ref: r, className: L( "richtext-fixed richtext-top-0 richtext-z-[100] richtext-flex richtext-max-h-screen richtext-w-full richtext-flex-col-reverse richtext-p-4 sm:richtext-bottom-0 sm:richtext-right-0 sm:richtext-top-auto sm:richtext-flex-col md:richtext-max-w-[420px]", t ), ...e } )); ri.displayName = X.Viewport.displayName; const In = $t( "richtext-group richtext-pointer-events-auto richtext-relative richtext-flex richtext-w-full richtext-items-center richtext-justify-between richtext-space-x-4 richtext-overflow-hidden richtext-rounded-md !richtext-border richtext-p-6 richtext-pr-8 richtext-shadow-lg richtext-transition-all data-[swipe=cancel]:richtext-translate-x-0 data-[swipe=end]:richtext-translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:richtext-translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:richtext-transition-none data-[state=open]:richtext-animate-in data-[state=closed]:richtext-animate-out data-[swipe=end]:richtext-animate-out data-[state=closed]:richtext-fade-out-80 data-[state=closed]:richtext-slide-out-to-right-full data-[state=open]:richtext-slide-in-from-top-full data-[state=open]:sm:richtext-slide-in-from-bottom-full", { variants: { variant: { default: "richtext-border richtext-bg-background richtext-text-foreground", destructive: "richtext-destructive richtext-group richtext-border-destructive richtext-bg-destructive richtext-text-destructive-foreground" } }, defaultVariants: { variant: "default" } } ), ni = E.forwardRef(({ className: t, variant: e, ...r }, n) => /* @__PURE__ */ i( X.Root, { ref: n, className: L(In({ variant: e }), t), ...r } )); ni.displayName = X.Root.displayName; const En = E.forwardRef(({ className: t, ...e }, r) => /* @__PURE__ */ i( X.Action, { ref: r, className: L( "richtext-inline-flex richtext-h-8 richtext-shrink-0 richtext-items-center richtext-justify-center richtext-rounded-md !richtext-border richtext-bg-transparent richtext-px-3 richtext-text-sm richtext-font-medium richtext-ring-offset-background richtext-transition-colors hover:richtext-bg-secondary focus:richtext-outline-none focus:richtext-ring-2 focus:richtext-ring-ring focus:richtext-ring-offset-2 disabled:richtext-pointer-events-none disabled:richtext-opacity-50 group-[.destructive]:richtext-border-muted/40 group-[.destructive]:hover:richtext-border-destructive/30 group-[.destructive]:hover:richtext-bg-destructive group-[.destructive]:hover:richtext-text-destructive-foreground group-[.destructive]:focus:richtext-ring-destructive", t ), ...e } )); En.displayName = X.Action.displayName; const ci = E.forwardRef(({ className: t, ...e }, r) => /* @__PURE__ */ i( X.Close, { ref: r, className: L( "richtext-absolute richtext-right-2 richtext-top-2 richtext-rounded-md richtext-p-1 richtext-text-foreground/50 richtext-opacity-0 richtext-transition-opacity hover:richtext-text-foreground focus:richtext-opacity-100 focus:richtext-outline-none focus:richtext-ring-2 group-hover:richtext-opacity-100 group-[.destructive]:richtext-text-red-300 group-[.destructive]:hover:richtext-text-red-50 group-[.destructive]:focus:richtext-ring-red-400 group-[.destructive]:focus:richtext-ring-offset-red-600", t ), "toast-close": "", ...e, children: /* @__PURE__ */ i(je, { className: "richtext-h-4 richtext-w-4" }) } )); ci.displayName = X.Close.displayName; const ai = E.forwardRef(({ className: t, ...e }, r) => /* @__PURE__ */ i( X.Title, { ref: r, className: L("richtext-text-sm richtext-font-semibold", t), ...e } )); ai.displayName = X.Title.displayName; const oi = E.forwardRef(({ className: t, ...e }, r) => /* @__PURE__ */ i( X.Description, { ref: r, className: L("richtext-text-sm richtext-opacity-90", t), ...e } )); oi.displayName = X.Description.displayName; const zn = $t( "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" } } ), si = E.forwardRef(({ className: t, variant: e, size: r, ...n }, c) => /* @__PURE__ */ i( Xe.Root, { ref: c, className: L(zn({ variant: e, size: r, className: t })), ...n } )); si.displayName = Xe.Root.displayName; const Rn = yt.Provider, li = yt.Root, di = yt.Trigger, ae = E.forwardRef(({ className: t, sideOffset: e = 4, ...r }, n) => /* @__PURE__ */ i( yt.Content, { ref: n, sideOffset: e, className: L( "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-[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", t ), ...r } )); ae.displayName = yt.Content.displayName; const On = 1, _n = 1e6; let Ut = 0; function Hn() { return Ut = (Ut + 1) % Number.MAX_SAFE_INTEGER, Ut.toString(); } const Kt = /* @__PURE__ */ new Map(); function be(t) { if (Kt.has(t)) return; const e = setTimeout(() => { Kt.delete(t), pt({ type: "REMOVE_TOAST", toastId: t }); }, _n); Kt.set(t, e); } function Pn(t, e) { switch (e.type) { case "ADD_TOAST": return { ...t, toasts: [e.toast, ...t.toasts].slice(0, On) }; case "UPDATE_TOAST": return { ...t, toasts: t.toasts.map( (r) => r.id === e.toast.id ? { ...r, ...e.toast } : r ) }; case "DISMISS_TOAST": { const { toastId: r } = e; return r ? be(r) : t.toasts.forEach((n) => { be(n.id); }), { ...t, toasts: t.toasts.map( (n) => n.id === r || r === void 0 ? { ...n, open: !1 } : n ) }; } case "REMOVE_TOAST": return e.toastId === void 0 ? { ...t, toasts: [] } : { ...t, toasts: t.toasts.filter((r) => r.id !== e.toastId) }; } } const Et = []; let zt = { toasts: [] }; function pt(t) { zt = Pn(zt, t), Et.forEach((e) => { e(zt); }); } function Dn({ ...t }) { const e = Hn(), r = (c) => pt({ type: "UPDATE_TOAST", toast: { ...c, id: e } }), n = () => pt({ type: "DISMISS_TOAST", toastId: e }); return pt({ type: "ADD_TOAST", toast: { ...t, id: e, open: !0, onOpenChange: (c) => { c || n(); } } }), { id: e, dismiss: n, update: r }; } function Bn() { const [t, e] = E.useState(zt); return E.useEffect(() => (Et.push(e), () => { const r = Et.indexOf(e); r > -1 && Et.splice(r, 1); }), [t]), { ...t, toast: Dn, dismiss: (r) => pt({ type: "DISMISS_TOAST", toastId: r }) }; } function $n(t) { return /* @__PURE__ */ i("svg", { xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", viewBox: "0 0 24 24", ...t, children: /* @__PURE__ */ i( "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 Vn(t) { return /* @__PURE__ */ i("svg", { xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", viewBox: "0 0 24 24", ...t, children: /* @__PURE__ */ i( "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 Wn() { return /* @__PURE__ */ i( "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: /* @__PURE__ */ i( "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 jn() { return /* @__PURE__ */ i( "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: /* @__PURE__ */ i( "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 Fn(t) { return /* @__PURE__ */ i("svg", { xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", viewBox: "0 0 24 24", ...t, children: /* @__PURE__ */ i( "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 G(t) { const e = hi[t.name]; return e ? /* @__PURE__ */ i(e, { onClick: t == null ? void 0 : t.onClick, className: `richtext-w-4 richtext-h-4 ${(t == null ? void 0 : t.className) || ""}` }) : null; } function Gn(t) { return /* @__PURE__ */ i("svg", { xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", viewBox: "0 0 24 24", ...t, children: /* @__PURE__ */ i( "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 Un(t) { return /* @__PURE__ */ i( "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", ...t, children: /* @__PURE__ */ i( "path", { fill: "currentColor", stroke: "currentColor", strokeLinejoin: "round", strokeWidth: 4, d: "M36 19L24 31L12 19z" } ) } ); } function Kn(t) { return /* @__PURE__ */ i("svg", { xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", viewBox: "0 0 24 24", ...t, children: /* @__PURE__ */ i("path", { fill: "currentColor", d: "M9 7v10h6v-2h-4V7z" }) }); } function Zn(t) { return /* @__PURE__ */ i("svg", { xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", viewBox: "0 0 24 24", ...t, children: /* @__PURE__ */ i( "path", { fill: "currentColor", d: "M9 7c-1.1 0-2 .9-2 2v8h2V9h2v7h2V9h2v8h2V9a2 2 0 0 0-2-2z" } ) }); } function Xn(t) { return /* @__PURE__ */ i("svg", { xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", viewBox: "0 0 24 24", ...t, children: /* @__PURE__ */ i( "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 qn() { return /* @__PURE__ */ i( "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: /* @__PURE__ */ i( "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 Yn() { return /* @__PURE__ */ u("svg", { xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", viewBox: "0 0 32 32", children: [ /* @__PURE__ */ i("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" }), /* @__PURE__ */ i("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 Jn() { return /* @__PURE__ */ u( "svg", { xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", className: "icon", viewBox: "0 0 1024 1024", children: [ /* @__PURE__ */ i( "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" } ), /* @__PURE__ */ i( "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 Qn() { return /* @__PURE__ */ i("svg", { xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", viewBox: "0 0 24 24", children: /* @__PURE__ */ i("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 tc() { return /* @__PURE__ */ i("svg", { xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", viewBox: "0 0 24 24", children: /* @__PURE__ */ i("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 ec() { return /* @__PURE__ */ i("svg", { xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", viewBox: "0 0 24 24", children: /* @__PURE__ */ i("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 ic() { return /* @__PURE__ */ i("svg", { xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", viewBox: "0 0 24 24", children: /* @__PURE__ */ i("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 rc() { return /* @__PURE__ */ i("svg", { xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", viewBox: "0 0 20 20", children: /* @__PURE__ */ i("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 nc() { return /* @__PURE__ */ i("svg", { xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", viewBox: "0 0 20 20", children: /* @__PURE__ */ i("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 cc() { return /* @__PURE__ */ i("svg", { xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", viewBox: "0 0 24 24", children: /* @__PURE__ */ u("g", { fill: "none", stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "1.5", color: "currentColor", children: [ /* @__PURE__ */ i("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" }), /* @__PURE__ */ i("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 ac() { return /* @__PURE__ */ i("svg", { xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", viewBox: "0 0 48 48", children: /* @__PURE__ */ u("g", { fill: "none", stroke: "currentColor", strokeWidth: "4", children: [ /* @__PURE__ */ i("circle", { cx: "10", cy: "24", r: "4" }), /* @__PURE__ */ i("circle", { cx: "38", cy: "10", r: "4" }), /* @__PURE__ */ i("circle", { cx: "38", cy: "24", r: "4" }), /* @__PURE__ */ i("circle", { cx: "38", cy: "38", r: "4" }), /* @__PURE__ */ i("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M34 38H22V10h12M14 24h20" }) ] }) }); } function oc() { return /* @__PURE__ */ i("svg", { xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", viewBox: "0 0 24 24", children: /* @__PURE__ */ i("path", { fill: "none", stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "1.5", d: "m3 21l7.548-7.548M21 3l-7.548 7.548m0 0L8 3H3l7.548 10.452m2.904-2.904L21 21h-5l-5.452-7.548", color: "currentColor" }) }); } function sc() { return /* @__PURE__ */ u( "svg", { fill: "none", height: "1em", viewBox: "0 0 16 17", width: "1em", xmlns: "http://www.w3.org/2000/svg", children: [ /* @__PURE__ */ i( "path", { d: "M5.46558 13.8356C4.54472 13.8356 3.79822 13.0891 3.79822 12.1682V10.1674C3.79822 9.72516 3.62255 9.30106 3.30986 8.98837C2.99717 8.67568 2.57307 8.50001 2.13086 8.50001C2.57307 8.50001 2.99717 8.32435 3.30986 8.01166C3.62255 7.69896 3.79822 7.27487 3.79822 6.83265V4.83182C3.79822 3.91096 4.54472 3.16446 5.46558 3.16446", stroke: "#323232", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "1.25" } ), /* @__PURE__ */ i( "path", { d: "M10.5352 3.16446C11.456 3.16446 12.2025 3.91096 12.2025 4.83182V6.83265C12.2025 7.75351 12.949 8.50001 13.8699 8.50001C12.949 8.50001 12.2025 9.24652 12.2025 10.1674V12.1682C12.2025 13.0891 11.456 13.8356 10.5352 13.8356", stroke: "#323232", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "1.25" } ) ] } ); } const hi = { Bold: an, LoaderCircle: cn, Italic: nn, Underline: rn, Quote: en, CodeIcon: sc, TextQuote: Vn, Strikethrough: tn, Minus: Qr, Eraser: Jr, PaintRoller: Yr, Redo2: qr, Undo2: Xr, AlignCenter: dn, AlignJustify: ln, AlignLeft: sn, AlignRight: on, ChevronDown: Zr, Subscript: Kr, Superscript: Ur, Code: Gr, Code2: Fr, Type: jr, IndentIncrease: Wr, IndentDecrease: Vr, List: $r, ListOrdered: Br, ListTodo: Dr, Link: Pr, ImageUp: Hr, Video: _r, Maximize: Or, Minimize: Rr, Table: zr, Sparkles: Er, Pencil: Ue, Unlink: Ir, BetweenHorizonalEnd: Lr, BetweenHorizonalStart: Mr, BetweenVerticalStart: Ar, BetweenVerticalEnd: Sr, TableCellsMerge: kr, TableCellsSplit: Tr, Trash2: Ge, Trash: Nr, Replace: ge, ChevronsUpDown: Cr, LineHeight: Gn, Word: Fn, Heading1: yr, Heading2: br, Heading3: vr, Heading4: wr, Heading5: pr, Heading6: gr, Columns2: pe, Columns3: fr, Columns4: mr, Plus: Fe, Grip: xr, Copy: ur, Clipboard: hr, PanelLeft: dr, PanelRight: lr, Columns: pe, Iframe: sr, MenuDown: Un, SizeS: Xn, SizeM: Zn, SizeL: Kn, AspectRatio: $n, Emoji: or, DeleteColumn: Wn, DeleteRow: jn, SearchAndReplace: ge, EmojiIcon: ar, KatexIcon: cr, ExportPdf: Yn, ExportWord: Jn, ImportWord: qn, ColumnAddLeft: Qn, ColumnAddRight: tc, BookMarked: nr, Excalidraw: ec, ZoomIn: rr, ZoomOut: ir, Settings: er, Eye: tr, TextDirection: ic, LeftToRight: rc, RightToLeft: nc, Attachment: Qi, GifIcon: cc, ChevronUp: Ji, Crop: Yi, Mermaid: ac, Twitter: oc, FlipX: qi, FlipY: Xi }; function lc({ fill: t }) { return /* @__PURE__ */ i( "svg", { width: "18px", height: "18px", viewBox: "0 0 256 256", version: "1.1", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ i("g", { id: "icon/填充色", stroke: "none", strokeWidth: 1, fill: "none", fillRule: "evenodd", children: /* @__PURE__ */ u("g", { id: "icon/背景颜色", children: [ /* @__PURE__ */ i("g", { id: "编组", fill: "currentColor", children: /* @__PURE__ */ u( "g", { transform: "translate(119.502295, 137.878331) rotate(-135.000000) translate(-119.502295, -137.878331) translate(48.002295, 31.757731)", id: "矩形", children: [ /* @__PURE__ */ i( "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" } ), /* @__PURE__ */ i( "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" } ), /* @__PURE__ */ i( "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" } ) ] } ) }), /* @__PURE__ */ i( "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: t || "#FBDE28" } ) ] }) }) } ); } function dc(t) { const [e, r] = w(void 0); function n(o) { var s; (s = t.action) == null || s.call(t, o); } function c() { var o; (o = t.action) == null || o.call(t, e); } const a = C( $e((o) => { r(o); }, 350), [] ); return /* @__PURE__ */ u("div", { className: "richtext-flex richtext-items-center richtext-h-[32px]", children: [ /* @__PURE__ */ i( v, { tooltip: t == null ? void 0 : t.tooltip, disabled: t == null ? void 0 : t.disabled, action: c, tooltipOptions: t == null ? void 0 : t.tooltipOptions, shortcutKeys: t == null ? void 0 : t.shortcutKeys, children: /* @__PURE__ */ i("span", { className: "richtext-flex richtext-items-center richtext-justify-center richtext-text-sm", children: /* @__PURE__ */ i(lc, { fill: e }) }) } ), /* @__PURE__ */ i( ua, { selectedColor: e, setSelectedColor: a, onChange: n, highlight: !0, disabled: t == null ? void 0 : t.disabled, children: /* @__PURE__ */ i(U, { variant: "ghost", size: "icon", className: "!richtext-w-3 !richtext-h-[32px]", disabled: t == null ? void 0 : t.disabled, children: /* @__PURE__ */ i(G, { className: "!richtext-w-3 !richtext-h-3 richtext-text-zinc-500", name: "MenuDown" }) }) } ) ] }); } function hc(t) { const { t: e } = V(), [r, n] = w({ text: "", link: "" }), [c, a] = w(!1); I(() => { var s; if (t != null && t.editor) { const { href: l, target: d } = (s = t.editor) == null ? void 0 : s.getAttributes("link"), { from: h, to: x } = t.editor.state.selection, m = t.editor.state.doc.textBetween(h, x, " "); n({ link: l, text: m }), a(d === "_blank"); } }, [t == null ? void 0 : t.editor]); function o(s) { s.preventDefault(), s.stopPropagation(), t == null || t.onSetLink(r.link, r.text, c); } return /* @__PURE__ */ i("div", { className: "border-neutral-200 richtext-rounded-lg !richtext-border richt