@blocknote/shadcn
Version:
A "Notion-style" block-based extensible text editor built on top of Prosemirror and Tiptap.
2 lines • 46.1 kB
JavaScript
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,s)=>(s=n==null?{}:e(i(n)),o(r||!n||!n.__esModule||!a.call(n,`default`)?t(s,`default`,{value:n,enumerable:!0}):s,n));let c=require("@blocknote/core"),l=require("@blocknote/react"),u=require("react");u=s(u,1);let d=require("react/jsx-runtime"),f=require("@base-ui/react/avatar"),p=require("clsx"),m=require("tailwind-merge"),h=require("@base-ui/react/merge-props"),g=require("@base-ui/react/use-render"),_=require("class-variance-authority"),v=require("@base-ui/react/button"),y=require("@base-ui/react/menu"),b=require("lucide-react"),x=require("@base-ui/react/input"),S=require("@base-ui/react/popover"),C=require("@base-ui/react/select"),w=require("@base-ui/react/tabs"),ee=require("@base-ui/react/toggle"),T=require("@base-ui/react/tooltip");var te=e=>{let{children:t,onSubmit:n,submitButton:r,...i}=e;return(0,c.assertEmpty)(i),(0,d.jsxs)(`form`,{className:`bn-form`,onSubmit:e=>{e.preventDefault(),n?.()},children:[t,r===`none`?null:r]})};function E(...e){return(0,m.twMerge)((0,p.clsx)(e))}function ne({className:e,size:t=`default`,...n}){return(0,d.jsx)(f.Avatar.Root,{"data-slot":`avatar`,"data-size":t,className:E(`group/avatar relative flex size-8 shrink-0 rounded-full select-none after:absolute after:inset-0 after:rounded-full after:border after:border-border after:mix-blend-darken data-[size=lg]:size-10 data-[size=sm]:size-6 dark:after:mix-blend-lighten`,e),...n})}function re({className:e,...t}){return(0,d.jsx)(f.Avatar.Image,{"data-slot":`avatar-image`,className:E(`aspect-square size-full rounded-full object-cover`,e),...t})}function ie({className:e,...t}){return(0,d.jsx)(f.Avatar.Fallback,{"data-slot":`avatar-fallback`,className:E(`flex size-full items-center justify-center rounded-full bg-muted text-sm text-muted-foreground group-data-[size=sm]/avatar:text-xs`,e),...t})}var ae=(0,_.cva)(`group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!`,{variants:{variant:{default:`bg-primary text-primary-foreground [a]:hover:bg-primary/80`,secondary:`bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80`,destructive:`bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20`,outline:`border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground`,ghost:`hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50`,link:`text-primary underline-offset-4 hover:underline`}},defaultVariants:{variant:`default`}});function oe({className:e,variant:t=`default`,render:n,...r}){return(0,g.useRender)({defaultTagName:`span`,props:(0,h.mergeProps)({className:E(ae({variant:t}),e)},r),render:n,state:{slot:`badge`,variant:t}})}var se=(0,_.cva)(`group/button inline-flex shrink-0 items-center justify-center rounded-md border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary/80`,outline:`border-border bg-background shadow-xs hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50`,secondary:`bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground`,ghost:`hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50`,destructive:`bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-9 gap-1.5 px-2.5 in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,xs:`h-6 gap-1 rounded-[min(var(--radius-md),8px)] px-2 text-xs in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3`,sm:`h-8 gap-1 rounded-[min(var(--radius-md),10px)] px-2.5 in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5`,lg:`h-10 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,icon:`size-9`,"icon-xs":`size-6 rounded-[min(var(--radius-md),8px)] in-data-[slot=button-group]:rounded-md [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-8 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-md`,"icon-lg":`size-10`}},defaultVariants:{variant:`default`,size:`default`}});function ce({className:e,variant:t=`default`,size:n=`default`,...r}){return(0,d.jsx)(v.Button,{"data-slot":`button`,className:E(se({variant:t,size:n,className:e})),...r})}function le({className:e,size:t=`default`,...n}){return(0,d.jsx)(`div`,{"data-slot":`card`,"data-size":t,className:E(`group/card flex flex-col gap-(--card-spacing) overflow-hidden rounded-xl bg-card py-(--card-spacing) text-sm text-card-foreground shadow-xs ring-1 ring-foreground/10 [--card-spacing:--spacing(6)] has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(4)] *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl`,e),...n})}function ue({className:e,...t}){return(0,d.jsx)(`div`,{"data-slot":`card-content`,className:E(`px-(--card-spacing)`,e),...t})}function de({...e}){return(0,d.jsx)(y.Menu.Root,{"data-slot":`dropdown-menu`,...e})}function fe({...e}){return(0,d.jsx)(y.Menu.Trigger,{"data-slot":`dropdown-menu-trigger`,...e})}function D({align:e=`start`,alignOffset:t=0,side:n=`bottom`,sideOffset:r=4,className:i,container:a,...o}){return(0,d.jsx)(y.Menu.Portal,{container:a,children:(0,d.jsx)(y.Menu.Positioner,{className:`isolate z-50 outline-none`,align:e,alignOffset:t,side:n,sideOffset:r,children:(0,d.jsx)(y.Menu.Popup,{"data-slot":`dropdown-menu-content`,className:E(`z-50 max-h-(--available-height) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-md bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:overflow-hidden data-closed:fade-out-0 data-closed:zoom-out-95`,i),...o})})})}function O({...e}){return(0,d.jsx)(y.Menu.Group,{"data-slot":`dropdown-menu-group`,...e})}function k({className:e,inset:t,...n}){return(0,d.jsx)(y.Menu.GroupLabel,{"data-slot":`dropdown-menu-label`,"data-inset":t,className:E(`px-2 py-1.5 text-xs font-medium text-muted-foreground data-inset:pl-8`,e),...n})}function A({className:e,inset:t,variant:n=`default`,...r}){return(0,d.jsx)(y.Menu.Item,{"data-slot":`dropdown-menu-item`,"data-inset":t,"data-variant":n,className:E(`group/dropdown-menu-item relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-8 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive`,e),...r})}function j({...e}){return(0,d.jsx)(y.Menu.SubmenuRoot,{"data-slot":`dropdown-menu-sub`,...e})}function M({className:e,inset:t,children:n,...r}){return(0,d.jsxs)(y.Menu.SubmenuTrigger,{"data-slot":`dropdown-menu-sub-trigger`,"data-inset":t,className:E(`flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-8 data-popup-open:bg-accent data-popup-open:text-accent-foreground data-open:bg-accent data-open:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...r,children:[n,(0,d.jsx)(b.ChevronRightIcon,{className:`ml-auto`})]})}function N({align:e=`start`,alignOffset:t=-3,side:n=`right`,sideOffset:r=0,className:i,...a}){return(0,d.jsx)(D,{"data-slot":`dropdown-menu-sub-content`,className:E(`w-auto min-w-[96px] rounded-md bg-popover p-1 text-popover-foreground shadow-lg ring-1 ring-foreground/10 duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,i),align:e,alignOffset:t,side:n,sideOffset:r,...a})}function P({className:e,children:t,checked:n,inset:r,...i}){return(0,d.jsxs)(y.Menu.CheckboxItem,{"data-slot":`dropdown-menu-checkbox-item`,"data-inset":r,className:E(`relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-8 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),checked:n,...i,children:[(0,d.jsx)(`span`,{className:`pointer-events-none absolute right-2 flex items-center justify-center`,"data-slot":`dropdown-menu-checkbox-item-indicator`,children:(0,d.jsx)(y.Menu.CheckboxItemIndicator,{children:(0,d.jsx)(b.CheckIcon,{})})}),t]})}function F({className:e,...t}){return(0,d.jsx)(y.Menu.Separator,{"data-slot":`dropdown-menu-separator`,className:E(`-mx-1 my-1 h-px bg-border`,e),...t})}function I({className:e,type:t,...n}){return(0,d.jsx)(x.Input,{type:t,"data-slot":`input`,className:E(`h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-2.5 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40`,e),...n})}function L({className:e,...t}){return(0,d.jsx)(`label`,{"data-slot":`label`,className:E(`flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50`,e),...t})}function R({...e}){return(0,d.jsx)(S.Popover.Root,{"data-slot":`popover`,...e})}function z({...e}){return(0,d.jsx)(S.Popover.Trigger,{"data-slot":`popover-trigger`,...e})}function B({className:e,align:t=`center`,alignOffset:n=0,side:r=`bottom`,sideOffset:i=4,container:a,...o}){return(0,d.jsx)(S.Popover.Portal,{container:a,children:(0,d.jsx)(S.Popover.Positioner,{align:t,alignOffset:n,side:r,sideOffset:i,className:`isolate z-50`,children:(0,d.jsx)(S.Popover.Popup,{"data-slot":`popover-content`,className:E(`z-50 flex w-72 origin-(--transform-origin) flex-col gap-4 rounded-md bg-popover p-4 text-sm text-popover-foreground shadow-md ring-1 ring-foreground/10 outline-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...o})})})}var V=C.Select.Root;function pe({className:e,...t}){return(0,d.jsx)(C.Select.Value,{"data-slot":`select-value`,className:E(`flex flex-1 text-left`,e),...t})}function me({className:e,size:t=`default`,children:n,...r}){return(0,d.jsxs)(C.Select.Trigger,{"data-slot":`select-trigger`,"data-size":t,className:E(`flex w-fit items-center justify-between gap-1.5 rounded-md border border-input bg-transparent py-2 pr-2 pl-2.5 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...r,children:[n,(0,d.jsx)(C.Select.Icon,{render:(0,d.jsx)(b.ChevronDownIcon,{className:`text-muted-foreground pointer-events-none size-4`})})]})}function he({className:e,children:t,side:n=`bottom`,sideOffset:r=4,align:i=`center`,alignOffset:a=0,alignItemWithTrigger:o=!0,container:s,...c}){return(0,d.jsx)(C.Select.Portal,{container:s,children:(0,d.jsx)(C.Select.Positioner,{side:n,sideOffset:r,align:i,alignOffset:a,alignItemWithTrigger:o,className:`isolate z-50`,children:(0,d.jsxs)(C.Select.Popup,{"data-slot":`select-content`,"data-align-trigger":o,className:E(`relative isolate z-50 max-h-(--available-height) w-(--anchor-width) min-w-36 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-md bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[align-trigger=true]:animate-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...c,children:[(0,d.jsx)(_e,{}),(0,d.jsx)(C.Select.List,{children:t}),(0,d.jsx)(ve,{})]})})})}function ge({className:e,children:t,...n}){return(0,d.jsxs)(C.Select.Item,{"data-slot":`select-item`,className:E(`relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2`,e),...n,children:[(0,d.jsx)(C.Select.ItemText,{className:`flex flex-1 shrink-0 gap-2 whitespace-nowrap`,children:t}),(0,d.jsx)(C.Select.ItemIndicator,{render:(0,d.jsx)(`span`,{className:`pointer-events-none absolute right-2 flex size-4 items-center justify-center`}),children:(0,d.jsx)(b.CheckIcon,{className:`pointer-events-none`})})]})}function _e({className:e,...t}){return(0,d.jsx)(C.Select.ScrollUpArrow,{"data-slot":`select-scroll-up-button`,className:E(`top-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4`,e),...t,children:(0,d.jsx)(b.ChevronUpIcon,{})})}function ve({className:e,...t}){return(0,d.jsx)(C.Select.ScrollDownArrow,{"data-slot":`select-scroll-down-button`,className:E(`bottom-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4`,e),...t,children:(0,d.jsx)(b.ChevronDownIcon,{})})}function ye({className:e,...t}){return(0,d.jsx)(`div`,{"data-slot":`skeleton`,className:E(`animate-pulse rounded-md bg-muted`,e),...t})}function be({className:e,orientation:t=`horizontal`,...n}){return(0,d.jsx)(w.Tabs.Root,{"data-slot":`tabs`,"data-orientation":t,className:E(`group/tabs flex gap-2 data-[orientation=horizontal]:flex-col`,e),...n})}var xe=(0,_.cva)(`group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-[orientation=horizontal]/tabs:h-9 group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col data-[variant=line]:rounded-none`,{variants:{variant:{default:`bg-muted`,line:`gap-1 bg-transparent`}},defaultVariants:{variant:`default`}});function Se({className:e,variant:t=`default`,...n}){return(0,d.jsx)(w.Tabs.List,{"data-slot":`tabs-list`,"data-variant":t,className:E(xe({variant:t}),e),...n})}function Ce({className:e,...t}){return(0,d.jsx)(w.Tabs.Tab,{"data-slot":`tabs-trigger`,className:E(`relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-disabled:pointer-events-none aria-disabled:opacity-50 dark:text-muted-foreground dark:hover:text-foreground group-data-[variant=default]/tabs-list:data-active:shadow-sm group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,`group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent`,`data-active:bg-background data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 dark:data-active:text-foreground`,`after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100`,e),...t})}function we({className:e,...t}){return(0,d.jsx)(w.Tabs.Panel,{"data-slot":`tabs-content`,className:E(`flex-1 text-sm outline-none`,e),...t})}var Te=(0,_.cva)(`group/toggle inline-flex items-center justify-center gap-1 rounded-md text-sm font-medium whitespace-nowrap transition-[color,box-shadow] outline-none hover:bg-muted hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 aria-pressed:bg-muted dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-transparent`,outline:`border border-input bg-transparent shadow-xs hover:bg-muted`},size:{default:`h-9 min-w-9 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,sm:`h-8 min-w-8 px-2.5 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5`,lg:`h-10 min-w-10 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`}},defaultVariants:{variant:`default`,size:`default`}});function Ee({className:e,variant:t=`default`,size:n=`default`,...r}){return(0,d.jsx)(ee.Toggle,{"data-slot":`toggle`,className:E(Te({variant:t,size:n,className:e})),...r})}function De({delay:e=0,...t}){return(0,d.jsx)(T.Tooltip.Provider,{"data-slot":`tooltip-provider`,delay:e,...t})}function Oe({...e}){return(0,d.jsx)(T.Tooltip.Root,{"data-slot":`tooltip`,...e})}function ke({...e}){return(0,d.jsx)(T.Tooltip.Trigger,{"data-slot":`tooltip-trigger`,...e})}function Ae({className:e,side:t=`top`,sideOffset:n=4,align:r=`center`,alignOffset:i=0,children:a,container:o,...s}){return(0,d.jsx)(T.Tooltip.Portal,{container:o,children:(0,d.jsx)(T.Tooltip.Positioner,{align:r,alignOffset:i,side:t,sideOffset:n,className:`isolate z-50`,children:(0,d.jsxs)(T.Tooltip.Popup,{"data-slot":`tooltip-content`,className:E(`z-50 inline-flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...s,children:[a,(0,d.jsx)(T.Tooltip.Arrow,{className:`bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px] data-[side=bottom]:top-1 data-[side=inline-end]:top-1/2! data-[side=inline-end]:-left-1 data-[side=inline-end]:-translate-y-1/2 data-[side=inline-start]:top-1/2! data-[side=inline-start]:-right-1 data-[side=inline-start]:-translate-y-1/2 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5`})]})})})}var H={Avatar:{Avatar:ne,AvatarFallback:ie,AvatarImage:re},Badge:{Badge:oe},Button:{Button:ce},Card:{Card:le,CardContent:ue},DropdownMenu:{DropdownMenu:de,DropdownMenuCheckboxItem:P,DropdownMenuContent:D,DropdownMenuGroup:O,DropdownMenuItem:A,DropdownMenuLabel:k,DropdownMenuSeparator:F,DropdownMenuSub:j,DropdownMenuSubContent:N,DropdownMenuSubTrigger:M,DropdownMenuTrigger:fe},Input:{Input:I},Label:{Label:L},Popover:{Popover:R,PopoverContent:B,PopoverTrigger:z},Select:{Select:V,SelectContent:he,SelectItem:ge,SelectTrigger:me,SelectValue:pe},Skeleton:{Skeleton:ye},Tabs:{Tabs:be,TabsContent:we,TabsList:Se,TabsTrigger:Ce},Toggle:{Toggle:Ee},Tooltip:{Tooltip:Oe,TooltipContent:Ae,TooltipProvider:De,TooltipTrigger:ke}},U=(0,u.createContext)(void 0);function W(){return(0,u.useContext)(U)}var je=(0,u.forwardRef)((e,t)=>{let{className:n,name:r,label:i,variant:a,icon:o,value:s,autoFocus:u,placeholder:f,disabled:p,onKeyDown:m,onChange:h,autoComplete:g,"aria-activedescendant":_,rightSection:v,...y}=e;(0,c.assertEmpty)(y);let b=(0,l.useAutoFocus)(u),x=(0,l.useMergeRefs)([b,t]),S=W();return(0,d.jsxs)(`div`,{className:E(n,`border-input bg-background ring-offset-background placeholder:text-muted-foreground focus-visible:ring-ring flex h-10 w-full rounded-md border px-3 py-2 text-sm file:border-0 file:bg-transparent file:text-sm file:font-medium focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50`,`text-foreground items-center gap-2`),children:[o,(0,d.jsxs)(`div`,{className:`flex-1`,children:[i&&(0,d.jsx)(S.Label.Label,{htmlFor:i,children:i}),(0,d.jsx)(S.Input.Input,{className:E(n,`h-auto border-none p-0`),id:i,name:r,placeholder:f,disabled:p,value:s,onKeyDown:m,onChange:h,ref:x,"aria-activedescendant":_})]}),v]})});function G(e){return e?{onFocusCapture(e){let t=e.relatedTarget;t instanceof HTMLElement&&!e.currentTarget.contains(t)&&t.focus({preventScroll:!0})}}:{}}var K=(0,u.createContext)({portalElement:null,preventFocusOnOpen:!1}),Me=e=>{let{children:t,onOpenChange:n,position:r,portalElement:i,preventFocusOnOpen:a,sub:o,...s}=e;(0,c.assertEmpty)(s);let l=W(),u={portalElement:i,preventFocusOnOpen:a??!1};return o?(0,d.jsx)(l.DropdownMenu.DropdownMenuSub,{onOpenChange:n,children:(0,d.jsx)(K.Provider,{value:u,children:t})}):(0,d.jsx)(l.DropdownMenu.DropdownMenu,{modal:!1,onOpenChange:n,children:(0,d.jsx)(K.Provider,{value:u,children:t})})},Ne=e=>{let{children:t,sub:n,...r}=e;(0,c.assertEmpty)(r);let i=W();return n?(0,d.jsx)(i.DropdownMenu.DropdownMenuSubTrigger,{children:t}):(0,d.jsx)(i.DropdownMenu.DropdownMenuTrigger,{render:t})},Pe=(0,u.forwardRef)((e,t)=>{let{className:n,children:r,sub:i,...a}=e;(0,c.assertEmpty)(a);let o=W(),{portalElement:s,preventFocusOnOpen:l}=(0,u.useContext)(K);return i?(0,d.jsx)(o.DropdownMenu.DropdownMenuSubContent,{className:n,container:s,ref:t,children:r}):(0,d.jsx)(o.DropdownMenu.DropdownMenuContent,{className:n,container:s,ref:t,...G(l),children:r})}),Fe=(0,u.forwardRef)((e,t)=>{let{className:n,children:r,icon:i,checked:a,subTrigger:o,onClick:s,...u}=e;(0,c.assertEmpty)(u);let f=W();return o?(0,d.jsxs)(d.Fragment,{children:[i,r]}):a===void 0?(0,d.jsxs)(f.DropdownMenu.DropdownMenuItem,{className:n,ref:t,onClick:s,onMouseDown:l.preventFocusOnTap,...u,children:[i,r,o&&(0,d.jsx)(b.ChevronRight,{className:`ml-auto h-4 w-4`})]}):(0,d.jsxs)(f.DropdownMenu.DropdownMenuCheckboxItem,{className:E(n,`gap-1`,a?``:`px-2`),ref:t,checked:a,onClick:s,onMouseDown:l.preventFocusOnTap,...u,children:[i,r]})}),Ie=(0,u.forwardRef)((e,t)=>{let{className:n,...r}=e;(0,c.assertEmpty)(r);let i=W();return(0,d.jsx)(i.DropdownMenu.DropdownMenuSeparator,{className:n,ref:t})}),Le=(0,u.forwardRef)((e,t)=>{let{className:n,children:r,...i}=e;(0,c.assertEmpty)(i);let a=W();return(0,d.jsx)(a.DropdownMenu.DropdownMenuGroup,{children:(0,d.jsx)(a.DropdownMenu.DropdownMenuLabel,{className:n,ref:t,children:r})})}),Re=(0,u.forwardRef)((e,t)=>{let{className:n,children:r,icon:i,onClick:a,onDragEnd:o,onDragStart:s,draggable:l,label:u,...f}=e;(0,c.assertEmpty)(f,!1);let p=W();return(0,d.jsxs)(p.Button.Button,{variant:`ghost`,className:E(n,`text-gray-400`),ref:t,"aria-label":u,onClick:a,onDragStart:s,onDragEnd:o,draggable:l,...f,children:[i,r]})}),ze=(0,u.forwardRef)((e,t)=>{let{className:n,tabs:r,defaultOpenTab:i,openTab:a,setOpenTab:o,loading:s,...l}=e;(0,c.assertEmpty)(l);let u=W();return(0,d.jsxs)(u.Tabs.Tabs,{className:E(n,`bg-popover max-w-screen rounded-lg p-2`),ref:t,value:a,defaultValue:i,onValueChange:o,children:[(0,d.jsx)(u.Tabs.TabsList,{children:r.map(e=>(0,d.jsx)(u.Tabs.TabsTrigger,{value:e.name,children:e.name},e.name))}),r.map(e=>(0,d.jsx)(u.Tabs.TabsContent,{value:e.name,children:(0,d.jsx)(u.Card.Card,{children:(0,d.jsx)(u.Card.CardContent,{className:`p-4`,children:e.tabPanel})})},e.name))]})}),Be=(0,u.forwardRef)((e,t)=>{let{className:n,children:r,...i}=e;return(0,c.assertEmpty)(i),(0,d.jsx)(`div`,{className:E(n,`flex flex-col items-start justify-center gap-2`),ref:t,children:r})}),Ve=(0,u.forwardRef)((e,t)=>{let{className:n,value:r,placeholder:i,onKeyDown:a,onChange:o,...s}=e;(0,c.assertEmpty)(s);let l=W();return(0,d.jsx)(l.Input.Input,{"data-test":`embed-input`,className:E(n,`w-80 max-w-full`),ref:t,value:r,placeholder:i,onKeyDown:a,onChange:o})}),q=(0,u.createContext)(null),He=e=>{let{children:t,open:n,onOpenChange:r,position:i,portalElement:a,...o}=e;(0,c.assertEmpty)(o);let s=W();return(0,d.jsx)(s.Popover.Popover,{open:n,onOpenChange:r,children:(0,d.jsx)(q.Provider,{value:a,children:t})})},Ue=(0,u.forwardRef)((e,t)=>{let{children:n,...r}=e;(0,c.assertEmpty)(r);let i=W();return(0,d.jsx)(i.Popover.PopoverTrigger,{ref:t,render:n})}),We=(0,u.forwardRef)((e,t)=>{let{className:n,variant:r,children:i,...a}=e;(0,c.assertEmpty)(a);let o=W(),s=(0,u.useContext)(q);return(0,d.jsx)(o.Popover.PopoverContent,{sideOffset:8,container:s,initialFocus:!1,className:E(n,`flex flex-col gap-2`,r===`panel-popover`?`w-fit max-w-none border-none p-0 shadow-none`:``),ref:t,children:i})}),Ge=(0,u.forwardRef)((e,t)=>{let{className:n,children:r,...i}=e;return(0,c.assertEmpty)(i,!1),(0,d.jsx)(`div`,{className:n,ref:t,...i,children:r})}),Ke=(0,u.forwardRef)((e,t)=>{let{className:n,children:r,icon:i,onClick:a,onDragEnd:o,onDragStart:s,draggable:l,label:u,...f}=e;(0,c.assertEmpty)(f,!1);let p=W();return(0,d.jsxs)(p.Button.Button,{variant:`ghost`,className:E(n,`text-gray-400`),ref:t,"aria-label":u,onClick:a,onDragStart:s,onDragEnd:o,draggable:l,...f,children:[i,r]})}),qe=(0,u.forwardRef)((e,t)=>{let{className:n,children:r,id:i,columns:a,...o}=e;return(0,c.assertEmpty)(o),(0,d.jsx)(`div`,{className:E(`bg-popover text-popover-foreground z-50 min-w-32 overflow-x-hidden overflow-y-auto rounded-md p-1 shadow-md ring-1 ring-foreground/10`,`grid`,n),style:{gridTemplateColumns:`repeat(${a}, 1fr)`},ref:t,id:i,role:`grid`,children:r})}),Je=(0,u.forwardRef)((e,t)=>{let{className:n,children:r,columns:i,...a}=e;return(0,c.assertEmpty)(a),(0,d.jsx)(`div`,{className:n,style:{gridColumn:`1 / ${i+1}`},ref:t,children:r})}),Ye=(0,u.forwardRef)((e,t)=>{let{className:n,children:r,id:i,...a}=e;return(0,c.assertEmpty)(a),(0,d.jsx)(`div`,{id:i,role:`listbox`,className:E(`bg-popover text-popover-foreground z-50 min-w-32 overflow-x-hidden overflow-y-auto rounded-md p-1 shadow-md ring-1 ring-foreground/10`,n),ref:t,children:r})}),Xe=(0,u.forwardRef)((e,t)=>{let{className:n,children:r,...i}=e;return(0,c.assertEmpty)(i),(0,d.jsx)(`div`,{className:E(`focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*=text-])]:text-muted-foreground outline-hidden relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm data-[disabled]:pointer-events-none data-[inset]:pl-8 data-[disabled]:opacity-50 [&_svg:not([class*=size-])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0`,`hover:bg-accent hover:text-accent-foreground data-[variant=destructive]:hover:bg-destructive/10 dark:data-[variant=destructive]:hover:bg-destructive/20 data-[variant=destructive]:hover:text-destructive`,`aria-selected:bg-accent aria-selected:text-accent-foreground data-[variant=destructive]:aria-selected:bg-destructive/10 dark:data-[variant=destructive]:aria-selected:bg-destructive/20 data-[variant=destructive]:aria-selected:text-destructive`,n),ref:t,children:(0,d.jsx)(`div`,{children:r})})}),Ze=(0,u.forwardRef)((e,t)=>{let n=W(),{className:r,item:i,isSelected:a,onClick:o,id:s,...f}=e;(0,c.assertEmpty)(f);let p=(0,u.useRef)(null);return(0,u.useEffect)(()=>{!p.current||!a||(0,l.elementOverflow)(p.current,p.current.closest(`.bn-suggestion-menu, #ai-suggestion-menu`))!==`none`&&p.current.scrollIntoView({block:`nearest`})},[a]),(0,d.jsxs)(`div`,{className:E(`focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*=text-])]:text-muted-foreground outline-hidden relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm data-[disabled]:pointer-events-none data-[inset]:pl-8 data-[disabled]:opacity-50 [&_svg:not([class*=size-])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0`,`hover:bg-accent hover:text-accent-foreground data-[variant=destructive]:hover:bg-destructive/10 dark:data-[variant=destructive]:hover:bg-destructive/20 data-[variant=destructive]:hover:text-destructive`,`aria-selected:bg-accent aria-selected:text-accent-foreground data-[variant=destructive]:aria-selected:bg-destructive/10 dark:data-[variant=destructive]:aria-selected:bg-destructive/20 data-[variant=destructive]:aria-selected:text-destructive`,e.item.size===`small`?`gap-3 py-1`:``,r),"data-highlighted":!0,ref:(0,l.mergeRefs)([t,p]),id:s,onMouseDown:e=>e.preventDefault(),onClick:o,role:`option`,"aria-selected":a||void 0,children:[i.icon&&(0,d.jsx)(`div`,{className:E(`p-3`,e.item.size===`small`?`p-0`:``,r),"data-position":`left`,children:i.icon}),(0,d.jsxs)(`div`,{className:`flex-1`,children:[(0,d.jsx)(`div`,{className:E(`text-base`,e.item.size===`small`?`text-sm`:``,r),children:i.title}),(0,d.jsx)(`div`,{className:E(`text-xs`,e.item.size===`small`?`hidden`:``,r),children:i.subtext})]}),i.badge&&(0,d.jsx)(`div`,{"data-position":`right`,className:`text-xs`,children:(0,d.jsx)(n.Badge.Badge,{variant:`secondary`,children:i.badge})})]})}),Qe=(0,u.forwardRef)((e,t)=>{let{className:n,children:r,...i}=e;return(0,c.assertEmpty)(i),(0,d.jsx)(`div`,{className:E(`px-2 py-1.5 text-sm font-medium data-[inset]:pl-8`,n),ref:t,children:r})}),$e=(0,u.forwardRef)((e,t)=>{let{className:n,...r}=e;return(0,c.assertEmpty)(r),(0,d.jsx)(`div`,{className:E(n,`animate-spin`),ref:t,children:(0,d.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,height:`1em`,viewBox:`0 -960 960 960`,width:`1em`,fill:`#e8eaed`,children:(0,d.jsx)(`path`,{d:`M480-80q-82 0-155-31.5t-127.5-86Q143-252 111.5-325T80-480q0-83 31.5-155.5t86-127Q252-817 325-848.5T480-880q17 0 28.5 11.5T520-840q0 17-11.5 28.5T480-800q-133 0-226.5 93.5T160-480q0 133 93.5 226.5T480-160q133 0 226.5-93.5T800-480q0-17 11.5-28.5T840-520q17 0 28.5 11.5T880-480q0 82-31.5 155t-86 127.5q-54.5 54.5-127 86T480-80Z`})})})}),et=(0,u.forwardRef)((e,t)=>{let{className:n,markClassName:r,backgroundColor:i,children:a,...o}=e;return(0,c.assertEmpty)(o),(0,d.jsx)(`span`,{className:E(n,r),style:r?void 0:{backgroundColor:i},ref:t,children:a})}),tt=(0,u.forwardRef)((e,t)=>{let{className:n,children:r,onMouseDown:i,onClick:a,...o}=e;(0,c.assertEmpty)(o,!1);let s=W();return(0,d.jsx)(s.Button.Button,{variant:`ghost`,className:E(n,`h-full w-full p-0 text-gray-400`,n?.includes(`extend-button-add-remove-columns`)?`ml-1`:`mt-1`,n?.includes(`extend-button-editing`)?`bg-accent text-accent-foreground`:``),ref:t,onClick:a,onMouseDown:i,...o,children:r})}),nt=(0,u.forwardRef)((e,t)=>{let{className:n,children:r,draggable:i,onDragStart:a,onDragEnd:o,style:s,label:l,...u}=e;(0,c.assertEmpty)(u,!1);let f=W();return(0,d.jsx)(f.Button.Button,{variant:`ghost`,className:E(n,`h-fit w-fit p-0 text-gray-400`),ref:t,"aria-label":l,draggable:i,onDragStart:a,onDragEnd:o,style:s,...u,children:r})}),J=(0,u.forwardRef)((e,t)=>{let{className:n,children:r,onMouseEnter:i,onMouseLeave:a,variant:o,...s}=e;(0,c.assertEmpty)(s);let l=W();return(0,d.jsx)(l.Tooltip.TooltipProvider,{delay:0,children:(0,d.jsx)(`div`,{className:E(n,`bg-popover text-popover-foreground flex h-fit gap-1 rounded-lg border p-1 shadow-md`,o===`action-toolbar`?`w-fit`:``),ref:t,onMouseEnter:i,onMouseLeave:a,children:r})})}),Y=(0,u.forwardRef)((e,t)=>{let{className:n,children:r,mainTooltip:i,secondaryTooltip:a,icon:o,isSelected:s,isDisabled:u,onClick:f,label:p,variant:m,onMouseDown:h,...g}=e;(0,c.assertEmpty)(g,!1);let _=W(),v=(0,l.usePortalElement)(),y=e=>{(0,l.preventFocusOnTap)(e),h?.(e)},b=s===void 0?(0,d.jsxs)(_.Button.Button,{className:E(n,m===`compact`?`h-6 min-w-6 p-0`:``),variant:`ghost`,size:m===`compact`?`sm`:`default`,disabled:u,onClick:f,ref:t,"aria-label":p,...g,onMouseDown:y,children:[o,r]}):(0,d.jsxs)(_.Toggle.Toggle,{className:E(n,`aria-expanded:bg-accent aria-expanded:text-accent-foreground`,m===`compact`?`h-6 min-w-6 p-0`:``),size:m===`compact`?`sm`:`default`,"aria-label":p,onClick:f,pressed:s,disabled:u,ref:t,...g,onMouseDown:y,children:[o,r]});return(0,d.jsxs)(_.Tooltip.Tooltip,{children:[(0,d.jsx)(_.Tooltip.TooltipTrigger,{render:b}),(0,d.jsxs)(_.Tooltip.TooltipContent,{container:v,className:`flex flex-col items-center whitespace-pre-wrap`,children:[(0,d.jsx)(`span`,{children:i}),a&&(0,d.jsx)(`span`,{children:a})]})]})}),X=(0,u.forwardRef)((e,t)=>{let{className:n,items:r,isDisabled:i,portalElement:a,preventFocusOnOpen:o,...s}=e;(0,c.assertEmpty)(s);let u=W(),f=e=>(0,d.jsxs)(`div`,{className:`flex items-center gap-1`,children:[e.icon,e.text]}),p=r.filter(e=>e.isSelected)[0];return p?(0,d.jsxs)(u.Select.Select,{value:p.text,onValueChange:e=>r.find(t=>t.text===e).onClick?.(),disabled:i,children:[(0,d.jsx)(u.Select.SelectTrigger,{className:`border-none`,onMouseDown:l.preventFocusOnTap,children:(0,d.jsx)(u.Select.SelectValue,{})}),(0,d.jsx)(u.Select.SelectContent,{className:n,container:a,alignItemWithTrigger:!1,ref:t,...G(o??!1),children:r.map(e=>(0,d.jsx)(u.Select.SelectItem,{disabled:e.isDisabled,value:e.text,onMouseDown:l.preventFocusOnTap,children:(0,d.jsx)(f,{...e})},e.text))})]}):null}),rt=(0,u.forwardRef)((e,t)=>{let{className:n,children:r,selected:i,headerText:a,onFocus:o,onBlur:s,tabIndex:l,...u}=e;(0,c.assertEmpty)(u);let f=W();return(0,d.jsxs)(f.Card.Card,{className:E(n,`w-[300px]`,i?`bg-accent text-accent-foreground`:``),onFocus:o,onBlur:s,tabIndex:l,ref:t,children:[a&&(0,d.jsx)(`div`,{className:`px-4 pt-4 text-sm italic`,children:a}),r]})}),it=(0,u.forwardRef)((e,t)=>{let{className:n,children:r,...i}=e;return(0,c.assertEmpty)(i),(0,d.jsx)(`div`,{className:E(n,`p-4`,n?.includes(`thread-comments`)?`flex flex-col gap-6 border-b`:``),ref:t,children:r})}),at=(0,u.forwardRef)((e,t)=>{let{className:n,children:r,...i}=e;(0,c.assertEmpty)(i,!1);let a=W();return(0,d.jsx)(a.Button.Button,{className:E(n,`text-foreground w-fit bg-transparent p-0 hover:bg-transparent`),ref:t,children:r})}),ot=(0,u.forwardRef)((e,t)=>{let{authorInfo:n,timeString:r,edited:i,...a}=e,o=(0,l.useDictionary)();(0,c.assertEmpty)(a,!1);let s=W();return n===`loading`?(0,d.jsxs)(`div`,{className:`flex flex-row flex-nowrap items-center gap-4`,children:[(0,d.jsx)(s.Skeleton.Skeleton,{className:`size-7 animate-pulse rounded-full bg-neutral-400`}),(0,d.jsx)(s.Skeleton.Skeleton,{className:`h-3 w-32 animate-pulse rounded-full bg-neutral-400`})]}):(0,d.jsxs)(`div`,{className:`flex flex-row flex-nowrap items-center gap-4`,children:[(0,d.jsxs)(s.Avatar.Avatar,{children:[(0,d.jsx)(s.Avatar.AvatarImage,{src:n.avatarUrl,alt:n.username,className:`h-7 rounded-full`}),(0,d.jsx)(s.Avatar.AvatarFallback,{children:n.username[0]})]}),(0,d.jsxs)(`div`,{className:`flex flex-row flex-nowrap items-center gap-2`,children:[(0,d.jsx)(`span`,{className:`text-sm font-bold`,children:n.username}),(0,d.jsxs)(`span`,{className:`text-xs`,children:[r,` `,i&&`(${o.comments.edited})`]})]})]})}),Z=(0,u.forwardRef)((e,t)=>{let{className:n,showActions:r,authorInfo:i,timeString:a,actions:o,edited:s,emojiPickerOpen:f,children:p,...m}=e;(0,c.assertEmpty)(m);let[h,g]=(0,u.useState)(!1),{focused:_,ref:v}=(0,l.useFocusWithin)(),y=o&&(r===!0||r===void 0||r===`hover`&&h||_||f);return(0,d.jsxs)(`div`,{ref:t,className:E(n,`relative flex flex-col gap-2`),onMouseEnter:()=>g(!0),onMouseLeave:()=>g(!1),children:[y?(0,d.jsx)(`div`,{className:`absolute top-0 right-0 z-10`,ref:v,children:o}):null,(0,d.jsx)(ot,{...e}),p]})}),st=(0,u.forwardRef)((e,t)=>{let{className:n,onFocus:r,onBlur:i,autoFocus:a,editor:o,editable:s,...u}=e;(0,c.assertEmpty)(u);let f=(0,l.useBlockNoteContext)();return(0,d.jsx)($,{autoFocus:a,className:E(n,``),theme:f?.colorSchemePreference,editor:e.editor,sideMenu:!1,slashMenu:!1,tableHandles:!1,filePanel:!1,formattingToolbar:!1,editable:s,ref:t,onFocus:r,onBlur:i,children:(0,d.jsx)(l.FormattingToolbarController,{formattingToolbar:ct})})}),ct=()=>{let e=(0,l.getFormattingToolbarItems)([]).filter(e=>e.key!==`nestBlockButton`&&e.key!==`unnestBlockButton`);return(0,d.jsx)(l.FormattingToolbar,{blockTypeSelectItems:[],children:e})},lt=(0,u.forwardRef)((e,t)=>{let{className:n,text:r,icon:i,isSelected:a,mainTooltip:o,secondaryTooltip:s,onClick:u,onMouseEnter:f,...p}=e;(0,c.assertEmpty)(p,!1);let m=W(),h=(0,l.usePortalElement)(),g=(0,d.jsxs)(m.Button.Button,{variant:a?`secondary`:`outline`,className:E(n,`flex h-7 items-center gap-1 rounded-full px-2.5`),onClick:u,onMouseEnter:f,ref:t,children:[(0,d.jsx)(`span`,{children:i}),(0,d.jsx)(`span`,{children:r})]});return o?(0,d.jsxs)(m.Tooltip.Tooltip,{children:[(0,d.jsx)(m.Tooltip.TooltipTrigger,{render:g}),(0,d.jsxs)(m.Tooltip.TooltipContent,{container:h,className:`flex flex-col items-center whitespace-pre-wrap`,children:[(0,d.jsx)(`span`,{children:o}),s&&(0,d.jsx)(`span`,{children:s})]})]}):g}),ut=(0,u.forwardRef)((e,t)=>{let{className:n,children:r,...i}=e;(0,c.assertEmpty)(i);let a=W();return(0,d.jsx)(a.Tooltip.TooltipProvider,{delay:0,children:(0,d.jsx)(`div`,{className:E(n,`flex w-full flex-row flex-wrap gap-1`),ref:t,children:r})})}),dt=(0,u.forwardRef)((e,t)=>{let{className:n,children:r,...i}=e;return(0,c.assertEmpty)(i,!1),(0,d.jsx)(`div`,{className:E(n),ref:t,children:r})}),ft=(0,u.forwardRef)((e,t)=>{let{className:n,selected:r,comparing:i,onClick:a,actions:o,children:s,...l}=e;(0,c.assertEmpty)(l,!1);let u=W();return(0,d.jsxs)(u.Card.Card,{className:E(n,r?`selected`:``,i?`comparing`:``,`gap-0 rounded-lg py-0 shadow-none`),onClick:a,ref:t,children:[s,o&&(0,d.jsx)(`div`,{className:`bn-snapshot-menu`,onClick:e=>e.stopPropagation(),children:o})]})}),pt=(0,u.forwardRef)((e,t)=>{let{className:n,children:r,type:i,onClick:a,label:o,...s}=e;(0,c.assertEmpty)(s);let l=W();return(0,d.jsx)(l.Button.Button,{type:i,className:n,"aria-label":o,ref:t,onClick:a,children:r})}),mt=(0,u.forwardRef)((e,t)=>{let{className:n,accept:r,value:i,placeholder:a,onChange:o,...s}=e;(0,c.assertEmpty)(s);let l=W();return(0,d.jsx)(l.Input.Input,{type:`file`,className:n,ref:t,accept:r,value:i?i.name:void 0,onChange:async e=>o?.(e.target.files[0]),placeholder:a})}),ht=(0,u.forwardRef)((e,t)=>{let{className:n,isSelected:r,onClick:i,item:a,id:o,...s}=e;(0,c.assertEmpty)(s);let f=(0,u.useRef)(null);return(0,u.useEffect)(()=>{!f.current||!r||(0,l.elementOverflow)(f.current,f.current.closest(`.bn-grid-suggestion-menu`))!==`none`&&f.current.scrollIntoView({block:`nearest`})},[r]),(0,d.jsx)(`div`,{className:E(`focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*=text-])]:text-muted-foreground outline-hidden relative flex cursor-default select-none items-center gap-2 rounded-sm p-2 text-sm data-[disabled]:pointer-events-none data-[inset]:pl-8 data-[disabled]:opacity-50 [&_svg:not([class*=size-])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0`,`hover:bg-accent hover:text-accent-foreground data-[variant=destructive]:hover:bg-destructive/10 dark:data-[variant=destructive]:hover:bg-destructive/20 data-[variant=destructive]:hover:text-destructive`,`aria-selected:bg-accent aria-selected:text-accent-foreground data-[variant=destructive]:aria-selected:bg-destructive/10 dark:data-[variant=destructive]:aria-selected:bg-destructive/20 data-[variant=destructive]:aria-selected:text-destructive`,`text-base!`,n),ref:(0,l.mergeRefs)([t,f]),id:o,role:`option`,onClick:i,"aria-selected":r||void 0,children:a.icon})}),gt=(0,u.forwardRef)((e,t)=>{let{className:n,children:r,columns:i,...a}=e;return(0,c.assertEmpty)(a),(0,d.jsx)(`div`,{className:n,style:{gridColumn:`1 / ${i+1}`},ref:t,children:r})}),Q={FormattingToolbar:{Root:J,Button:Y,Select:X},FilePanel:{Root:ze,Button:pt,FileInput:mt,TabPanel:Be,TextInput:Ve},LinkToolbar:{Root:J,Button:Y,Select:X},SideMenu:{Root:Ge,Button:Ke},SuggestionMenu:{Root:Ye,Item:Ze,EmptyItem:Xe,Label:Qe,Loader:$e},GridSuggestionMenu:{Root:qe,Item:ht,EmptyItem:Je,Loader:gt},TableHandle:{Root:nt,ExtendButton:tt},Comments:{Comment:Z,Editor:st,Card:rt,CardSection:it,ExpandSectionsPrompt:at},Versioning:{Sidebar:dt,Snapshot:ft},AttributionTooltip:{Root:et},Generic:{Badge:{Root:lt,Group:ut},Toolbar:{Root:J,Button:Y,Select:X},Form:{Root:te,TextInput:je},Menu:{Root:Me,Trigger:Ne,Dropdown:Pe,Divider:Ie,Label:Le,Item:Fe,Button:Re},Popover:{Root:He,Trigger:Ue,Content:We}}},$=e=>{let{className:t,shadCNComponents:n,...r}=e,i=(0,u.useMemo)(()=>({...H,...n}),[n]);return(0,d.jsx)(U.Provider,{value:i,children:(0,d.jsx)(l.ComponentsContext.Provider,{value:Q,children:(0,d.jsx)(l.BlockNoteViewRaw,{className:(0,c.mergeCSSClasses)(`bn-shadcn`,t||``),...r})})})};exports.BlockNoteView=$,exports.ShadCNComponentsContext=U,exports.ShadCNDefaultComponents=H,exports.components=Q,exports.useShadCNComponentsContext=W;
//# sourceMappingURL=blocknote-shadcn.cjs.map