@flexkit/studio 0.0.29 → 0.0.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunk-MC6VZLKC.js +2 -0
- package/dist/chunk-MC6VZLKC.js.map +1 -0
- package/dist/index.css +714 -12
- package/dist/index.d.ts +2 -2
- package/dist/index.js +140 -140
- package/dist/index.js.map +1 -1
- package/dist/{types.d-6y0oZ2Hh.d.ts → types.d-CX3kDxFZ.d.ts} +18 -9
- package/dist/ui.d.ts +455 -4
- package/dist/ui.js +6 -1
- package/dist/ui.js.map +1 -1
- package/package.json +16 -2
- package/dist/chunk-7MSX5T2Z.js +0 -2
- package/dist/chunk-7MSX5T2Z.js.map +0 -1
package/dist/ui.js
CHANGED
|
@@ -1,2 +1,7 @@
|
|
|
1
|
-
import'./index.css';export{p as InsufficientPermissionsTooltipContent,q as PermissionTooltip,g as Separator,h as Table,j as TableBody,o as TableCaption,n as TableCell,k as TableFooter,m as TableHead,i as TableHeader,l as TableRow,f as Toaster,b as Toggle,c as ToggleGroup,d as ToggleGroupItem,e as toast,a as toggleVariants}from'./chunk-7MSX5T2Z.js';export{a as Input}from'./chunk-7GBAYC7G.js';export{a as Textarea}from'./chunk-OEWYLKO7.js';import {a as a$1,b as b$1,c,e}from'./chunk-YW2EEXMV.js';export{b as Tooltip,e as TooltipContent,d as TooltipPortal,a as TooltipProvider,c as TooltipTrigger}from'./chunk-YW2EEXMV.js';export{a as Select,e as SelectContent,b as SelectGroup,g as SelectItem,f as SelectLabel,j as SelectScrollDownButton,i as SelectScrollUpButton,h as SelectSeparator,d as SelectTrigger,c as SelectValue}from'./chunk-XU2JGXYC.js';export{b as Badge,m as Command,n as CommandDialog,q as CommandEmpty,r as CommandGroup,o as CommandInput,t as CommandItem,p as CommandList,s as CommandSeparator,u as CommandShortcut,c as Dialog,f as DialogClose,h as DialogContent,l as DialogDescription,j as DialogFooter,i as DialogHeader,g as DialogOverlay,e as DialogPortal,k as DialogTitle,d as DialogTrigger,v as ScrollArea,w as ScrollBar,a as badgeVariants}from'./chunk-LL2Z4TD3.js';export{a as Avatar,c as AvatarFallback,b as AvatarImage}from'./chunk-2FFSI7IK.js';export{c as DropdownMenu,i as DropdownMenuCheckboxItem,f as DropdownMenuContent,g as DropdownMenuGroup,h as DropdownMenuItem,l as DropdownMenuLabel,d as DropdownMenuPortal,j as DropdownMenuRadioGroup,k as DropdownMenuRadioItem,m as DropdownMenuSeparator,n as DropdownMenuShortcut,o as DropdownMenuSub,q as DropdownMenuSubContent,p as DropdownMenuSubTrigger,e as DropdownMenuTrigger,r as Skeleton}from'./chunk-IXO2LU47.js';import {b}from'./chunk-EYGOJ2ZN.js';export{b as Button,a as buttonVariants}from'./chunk-EYGOJ2ZN.js';export{a as Switch}from'./chunk-KGYH74NA.js';export{j as Checkbox,b as Form,g as FormControl,h as FormDescription,c as FormField,e as FormItem,f as FormLabel,i as FormMessage,a as Label,d as useFormField}from'./chunk-FVFRTCEB.js';import {a}from'./chunk-O2QMYUPS.js';import*as E from'lucide-react';import {SquareArrowOutUpRight,GripVerticalIcon,XIcon,PanelLeftIcon}from'lucide-react';import {jsx,jsxs}from'react/jsx-runtime';import*as h from'react-resizable-panels';import {Dialog,Slot,Tabs}from'radix-ui';import*as d from'react';import {createElement}from'react';import da from'fuse.js';import {NavLink}from'react-router-dom';import {cva}from'class-variance-authority';import {groupBy}from'ramda';function Ht({href:e,children:t}){return jsx(b,{asChild:true,className:"fk:h-6 fk:px-1! fk:py-0 fk:text-sm fk:font-light fk:text-link",size:"sm",variant:"link",children:jsxs("a",{href:e,target:"_blank",children:[t," ",jsx(SquareArrowOutUpRight,{className:"fk:size-3",strokeWidth:3})]})})}function jt({className:e,...t}){return jsx(h.Group,{"data-slot":"resizable-panel-group",className:a("fk:flex fk:h-full fk:w-full fk:aria-[orientation=vertical]:flex-col",e),...t})}function Kt({...e}){return jsx(h.Panel,{"data-slot":"resizable-panel",...e})}function Wt({withHandle:e,className:t,...a$1}){return jsx(h.Separator,{"data-slot":"resizable-handle",className:a("fk:relative fk:flex fk:w-px fk:items-center fk:justify-center fk:bg-border fk:after:absolute fk:after:inset-y-0 fk:after:left-1/2 fk:after:w-1 fk:after:-translate-x-1/2 fk:focus-visible:ring-1 fk:focus-visible:ring-ring fk:focus-visible:ring-offset-1 fk:focus-visible:outline-hidden fk:aria-[orientation=horizontal]:h-px fk:aria-[orientation=horizontal]:w-full fk:aria-[orientation=horizontal]:after:left-0 fk:aria-[orientation=horizontal]:after:h-1 fk:aria-[orientation=horizontal]:after:w-full fk:aria-[orientation=horizontal]:after:translate-x-0 fk:aria-[orientation=horizontal]:after:-translate-y-1/2 fk:[&[aria-orientation=horizontal]>div]:rotate-90",t),...a$1,children:e&&jsx("div",{className:"fk:z-10 fk:flex fk:h-8 fk:w-3 fk:items-center fk:justify-center fk:rounded-xs fk:border fk:bg-border",children:jsx(GripVerticalIcon,{className:"fk:size-2.5"})})})}function F({...e}){return jsx(Dialog.Root,{"data-slot":"sheet",...e})}function qt({...e}){return jsx(Dialog.Trigger,{"data-slot":"sheet-trigger",...e})}function Jt({...e}){return jsx(Dialog.Close,{"data-slot":"sheet-close",...e})}function Q({...e}){return jsx(Dialog.Portal,{"data-slot":"sheet-portal",...e})}function ee({className:e,...t}){return jsx(Dialog.Overlay,{"data-slot":"sheet-overlay",className:a("fk:fixed fk:inset-0 fk:z-50 fk:bg-black/50 fk:data-[state=closed]:animate-out fk:data-[state=closed]:fade-out-0 fk:data-[state=open]:animate-in fk:data-[state=open]:fade-in-0",e),...t})}function $({className:e,children:t,side:a$1="right",showCloseButton:f=true,...s}){return jsxs(Q,{children:[jsx(ee,{}),jsxs(Dialog.Content,{"data-slot":"sheet-content",className:a("fk:fixed fk:z-50 fk:flex fk:flex-col fk:gap-4 fk:bg-background fk:shadow-lg fk:transition fk:ease-in-out fk:data-[state=closed]:animate-out fk:data-[state=closed]:duration-300 fk:data-[state=open]:animate-in fk:data-[state=open]:duration-500",a$1==="right"&&"fk:inset-y-0 fk:right-0 fk:h-full fk:w-3/4 fk:border-l fk:data-[state=closed]:slide-out-to-right fk:data-[state=open]:slide-in-from-right fk:sm:max-w-sm",a$1==="left"&&"fk:inset-y-0 fk:left-0 fk:h-full fk:w-3/4 fk:border-r fk:data-[state=closed]:slide-out-to-left fk:data-[state=open]:slide-in-from-left fk:sm:max-w-sm",a$1==="top"&&"fk:inset-x-0 fk:top-0 fk:h-auto fk:border-b fk:data-[state=closed]:slide-out-to-top fk:data-[state=open]:slide-in-from-top",a$1==="bottom"&&"fk:inset-x-0 fk:bottom-0 fk:h-auto fk:border-t fk:data-[state=closed]:slide-out-to-bottom fk:data-[state=open]:slide-in-from-bottom",e),...s,children:[t,f&&jsxs(Dialog.Close,{className:"fk:absolute fk:top-4 fk:right-4 fk:rounded-xs fk:opacity-70 fk:ring-offset-background fk:transition-opacity fk:hover:opacity-100 fk:focus:ring-2 fk:focus:ring-ring fk:focus:ring-offset-2 fk:focus:outline-hidden fk:disabled:pointer-events-none fk:data-[state=open]:bg-secondary",children:[jsx(XIcon,{className:"fk:size-4"}),jsx("span",{className:"fk:sr-only",children:"Close"})]})]})]})}function j({className:e,...t}){return jsx("div",{"data-slot":"sheet-header",className:a("fk:flex fk:flex-col fk:gap-1.5 fk:p-4",e),...t})}function Ut({className:e,...t}){return jsx("div",{"data-slot":"sheet-footer",className:a("fk:mt-auto fk:flex fk:flex-col fk:gap-2 fk:p-4",e),...t})}function K({className:e,...t}){return jsx(Dialog.Title,{"data-slot":"sheet-title",className:a("fk:font-semibold fk:text-foreground",e),...t})}function W({className:e,...t}){return jsx(Dialog.Description,{"data-slot":"sheet-description",className:a("fk:text-sm fk:text-muted-foreground",e),...t})}var X=768;function te(){let[e,t]=d.useState(void 0);return d.useEffect(()=>{let a=window.matchMedia(`(max-width: ${X-1}px)`),f=()=>{t(window.innerWidth<X);};return a.addEventListener("change",f),t(window.innerWidth<X),()=>a.removeEventListener("change",f)},[]),!!e}var Qt="flexkit:sidebar:state",ea=3600*24*7,ta="16rem",aa="18rem",oa="2rem",ra="b",oe=d.createContext(null);function w(){let e=d.useContext(oe);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}function ia({defaultOpen:e=true,open:t,onOpenChange:a$2,className:f,style:s,children:u,...r}){let n=te(),[g,b]=d.useState(false),[R,fe]=d.useState(e),v=t??R,y=d.useCallback(c=>{let m=typeof c=="function"?c(v):c;a$2?a$2(m):fe(m),document.cookie=`${Qt}=${m}; path=/; max-age=${ea}`;},[a$2,v]),T=d.useCallback(()=>n?b(c=>!c):y(c=>!c),[n,y,b]);d.useEffect(()=>{let c=m=>{m.key===ra&&(m.metaKey||m.ctrlKey)&&(m.preventDefault(),T());};return window.addEventListener("keydown",c),()=>window.removeEventListener("keydown",c)},[T]);let Y=v?"expanded":"collapsed",de=d.useMemo(()=>({state:Y,open:v,setOpen:y,isMobile:n,openMobile:g,setOpenMobile:b,toggleSidebar:T}),[Y,v,y,n,g,b,T]);return jsx(oe.Provider,{value:de,children:jsx(a$1,{delayDuration:0,children:jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":ta,"--sidebar-width-icon":oa,...s},className:a("fk:group/sidebar-wrapper fk:flex fk:w-full fk:has-data-[variant=inset]:bg-sidebar fk:overflow-hidden",f),...r,children:u})})})}function q({side:e="left",variant:t="sidebar",collapsible:a$1="offcanvas",className:f,children:s,...u}){let{isMobile:r,state:n,openMobile:g,setOpenMobile:b}=w();return a$1==="none"?jsx("div",{"data-slot":"sidebar",className:a("fk:flex fk:h-full fk:w-(--sidebar-width) fk:flex-col fk:bg-sidebar fk:text-sidebar-foreground",f),...u,children:s}):r?jsx(F,{open:g,onOpenChange:b,...u,children:jsxs($,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"fk:w-(--sidebar-width) fk:bg-sidebar fk:p-0 fk:text-sidebar-foreground fk:[&>button]:hidden",style:{"--sidebar-width":aa},side:e,children:[jsxs(j,{className:"fk:sr-only",children:[jsx(K,{children:"Sidebar"}),jsx(W,{children:"Displays the mobile sidebar."})]}),jsx("div",{className:"fk:flex fk:h-full fk:w-full fk:flex-col",children:s})]})}):jsxs("div",{className:"fk:group fk:peer fk:hidden fk:text-sidebar-foreground fk:md:block","data-state":n,"data-collapsible":n==="collapsed"?a$1:"","data-variant":t,"data-side":e,"data-slot":"sidebar",children:[jsx("div",{"data-slot":"sidebar-gap",className:a("fk:relative fk:w-(--sidebar-width) fk:bg-transparent fk:transition-[width] fk:duration-200 fk:ease-linear","fk:group-data-[collapsible=offcanvas]:w-0","fk:group-data-[side=right]:rotate-180",t==="floating"||t==="inset"?"fk:group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"fk:group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),jsx("div",{"data-slot":"sidebar-container",className:a("fk:relative fk:inset-y-0 fk:z-10 fk:hidden fk:h-[calc(100svh-3.5rem)] fk:w-(--sidebar-width) fk:transition-[left,right,width] fk:duration-200 fk:ease-linear fk:md:flex",e==="left"?"fk:left-0 fk:group-data-[collapsible=offcanvas]:-left-(--sidebar-width)":"fk:right-0 k:group-data-[collapsible=offcanvas]:-right-(--sidebar-width)",t==="floating"||t==="inset"?"fk:group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)] fk:group-data-[side=left]:border-r":"fk:group-data-[collapsible=icon]:w-(--sidebar-width-icon) fk:group-data-[side=left]:border-r fk:group-data-[side=right]:border-l",f),...u,children:jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"fk:flex fk:h-full fk:w-full fk:flex-col fk:bg-sidebar fk:group-data-[variant=floating]:rounded-lg fk:group-data-[variant=floating]:border fk:group-data-[variant=floating]:border-sidebar-border fk:group-data-[variant=floating]:shadow-sm",children:s})})]})}function na({className:e,onClick:t,...a$1}){let{toggleSidebar:f}=w();return jsxs(b,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon",className:a("fk:size-7",e),onClick:s=>{t?.(s),f();},...a$1,children:[jsx(PanelLeftIcon,{}),jsx("span",{className:"fk:sr-only",children:"Toggle Sidebar"})]})}function J({className:e,...t}){let{toggleSidebar:a$1}=w();return jsx("button",{"data-sidebar":"rail","data-slot":"sidebar-rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:a$1,title:"Toggle Sidebar",className:a("fk:absolute fk:inset-y-0 fk:z-20 fk:hidden fk:w-4 fk:-translate-x-1/2 fk:transition-all fk:ease-linear fk:group-data-[side=left]:-right-4 fk:group-data-[side=right]:left-0 fk:after:absolute fk:after:inset-y-0 fk:after:left-1/2 fk:after:w-[2px] fk:hover:after:bg-sidebar-border fk:sm:flex","fk:in-data-[side=left]:cursor-w-resize fk:in-data-[side=right]:cursor-e-resize","fk:[[data-side=left][data-state=collapsed]_&]:cursor-e-resize fk:[[data-side=right][data-state=collapsed]_&]:cursor-w-resize","fk:group-data-[collapsible=offcanvas]:translate-x-0 fk:group-data-[collapsible=offcanvas]:after:left-full fk:hover:group-data-[collapsible=offcanvas]:bg-sidebar","fk:[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","fk:[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",e),...t})}function sa({className:e,...t}){return jsx("main",{"data-slot":"sidebar-inset",className:a("fk:relative fk:flex fk:flex-1 fk:flex-col fk:bg-background fk:overflow-hidden fk:peer-data-[variant=inset]:h-[calc(100svh-3.625rem)]",e),...t})}function U({className:e,...t}){return jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:a("fk:flex fk:min-h-0 fk:flex-1 fk:flex-col fk:overflow-auto fk:group-data-[collapsible=icon]:overflow-hidden",e),...t})}function z({className:e,...t}){return jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:a("fk:relative fk:flex fk:w-full fk:min-w-0 fk:flex-col fk:p-2",e),...t})}function re({className:e,asChild:t=false,...a$1}){let f=t?Slot.Root:"div";return jsx(f,{"data-slot":"sidebar-group-label","data-sidebar":"group-label",className:a("fk:flex fk:h-8 fk:shrink-0 fk:items-center fk:rounded-md fk:px-2 fk:text-xs fk:font-medium fk:text-sidebar-foreground/70 fk:ring-sidebar-ring fk:outline-hidden fk:transition-[margin,opacity] fk:duration-200 fk:ease-linear fk:focus-visible:ring-2 fk:[&>svg]:size-4 fk:[&>svg]:shrink-0","fk:group-data-[collapsible=icon]:-mt-8 fk:group-data-[collapsible=icon]:opacity-0",e),...a$1})}function N({className:e,...t}){return jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:a("fk:flex fk:w-full fk:min-w-0 fk:flex-col fk:gap-1",e),...t})}function I({className:e,...t}){return jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:a("fk:group/menu-item fk:relative",e),...t})}var fa=cva("fk:peer/menu-button fk:flex fk:w-full fk:items-center fk:gap-2 fk:overflow-hidden fk:rounded-md fk:p-2 fk:text-left fk:text-sm fk:ring-sidebar-ring fk:outline-hidden fk:transition-[width,height,padding] fk:group-has-data-[sidebar=menu-action]/menu-item:pr-8 fk:group-data-[collapsible=icon]:size-8! fk:group-data-[collapsible=icon]:p-2! fk:hover:bg-sidebar-accent fk:hover:text-sidebar-accent-foreground fk:focus-visible:ring-2 fk:active:bg-sidebar-accent fk:active:text-sidebar-accent-foreground fk:disabled:pointer-events-none fk:disabled:opacity-50 fk:aria-disabled:pointer-events-none fk:aria-disabled:opacity-50 fk:data-[active=true]:bg-sidebar-accent fk:data-[active=true]:font-medium fk:data-[active=true]:text-sidebar-accent-foreground fk:data-[state=open]:hover:bg-sidebar-accent fk:data-[state=open]:hover:text-sidebar-accent-foreground fk:[&>span:last-child]:truncate fk:[&>svg]:size-4 fk:[&>svg]:shrink-0",{variants:{variant:{default:"fk:hover:bg-sidebar-accent fk:hover:text-sidebar-accent-foreground",outline:"fk:bg-background fk:shadow-[0_0_0_1px_hsl(var(--sidebar-border))] fk:hover:bg-sidebar-accent fk:hover:text-sidebar-accent-foreground fk:hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"fk:h-8 fk:text-sm",sm:"fk:h-7 fk:text-xs",lg:"fk:h-12 fk:text-sm fk:group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function D({asChild:e$1=false,isActive:t=false,variant:a$1="default",size:f="default",tooltip:s,className:u,...r}){let n=e$1?Slot.Root:"button",{isMobile:g,state:b}=w(),R=jsx(n,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":f,"data-active":t,className:a(fa({variant:a$1,size:f}),u),...r});return s?(typeof s=="string"&&(s={children:s}),jsxs(b$1,{children:[jsx(c,{asChild:true,children:R}),jsx(e,{side:"right",align:"center",hidden:b!=="collapsed"||g,...s})]})):R}var ne=NavLink,ca=Object.keys(E).map(e=>({name:e,icon:E[e]})),ua=new da(ca,{keys:["name"],threshold:.5});function pa({className:e,menuGroups:t,schema:a}){let f=a.filter(r=>!(r.menu&&"hidden"in r.menu)),s=groupBy(r=>r.menu?.group&&t?.find(n=>n.name===r.menu?.group)?.name||"ungrouped",f),u=t?.filter(r=>s[r.name]?.length);return jsxs(q,{className:e,collapsible:"icon",variant:"inset",children:[jsxs(U,{children:[u?.map(r=>jsxs(z,{children:[jsx(re,{children:r.title}),jsx(N,{children:s[r.name]?.map(n=>jsx(I,{children:jsx(D,{asChild:true,isActive:location.pathname.includes(`/list/${n.plural}`),tooltip:B(n.menu?.label??n.plural),children:jsxs(ne,{to:`list/${n.plural}`,children:[n.menu?.icon??createElement(E[se(n.name)],{className:"fk:h-4 fk:w-4 fk:mr-2",strokeWidth:2}),jsx("span",{children:B(n.menu?.label??n.plural)})]})})},n.plural))})]},r.name)),jsx(z,{children:jsx(N,{children:s.ungrouped?.map(r=>jsx(I,{children:jsx(D,{asChild:true,isActive:location.pathname.includes(`/list/${r.plural}`),tooltip:B(r.menu?.label??r.plural),children:jsxs(ne,{to:`list/${r.plural}`,children:[createElement(E[se(r.name)],{className:"fk:h-4 fk:w-4 fk:mr-2",strokeWidth:2}),jsx("span",{children:B(r.menu?.label??r.plural)})]})})},r.plural))})})]}),jsx(J,{})]})}function B(e){let t=e.replace(/([A-Z])/g," $1");return t.charAt(0).toUpperCase()+t.slice(1).trim()}function se(e){let t=ua.search(e);return t.length>0?t[0].item.name:"Dock"}function ma({className:e,orientation:t="horizontal",...a$1}){return jsx(Tabs.Root,{"data-slot":"tabs","data-orientation":t,orientation:t,className:a("fk:group/tabs fk:flex fk:data-[orientation=horizontal]:flex-col",e),...a$1})}var ga=cva("fk:group/tabs-list fk:inline-flex fk:w-fit fk:items-center fk:justify-center fk:rounded-lg fk:p-[3px] fk:text-muted-foreground fk:group-data-[orientation=horizontal]/tabs:h-9 fk:group-data-[orientation=vertical]/tabs:h-fit fk:group-data-[orientation=vertical]/tabs:flex-col fk:data-[variant=line]:rounded-none",{variants:{variant:{default:"fk:bg-muted",line:"fk:gap-1 fk:bg-transparent"}},defaultVariants:{variant:"default"}});function ha({className:e,variant:t="default",...a$1}){return jsx(Tabs.List,{"data-slot":"tabs-list","data-variant":t,className:a(ga({variant:t}),e),...a$1})}function va({className:e,...t}){return jsx(Tabs.Trigger,{"data-slot":"tabs-trigger",className:a("fk:relative fk:inline-flex fk:h-[calc(100%-1px)] fk:flex-1 fk:items-center fk:justify-center fk:gap-1.5 fk:rounded-md fk:border fk:border-transparent! fk:px-4 fk:py-1 fk:text-sm fk:font-medium fk:whitespace-nowrap fk:text-foreground/60 fk:transition-all fk:group-data-[orientation=vertical]/tabs:w-full fk:group-data-[orientation=vertical]/tabs:justify-start fk:hover:text-foreground fk:focus-visible:border-ring! fk:focus-visible:ring-[3px] fk:focus-visible:ring-ring/50 fk:focus-visible:outline-1 fk:focus-visible:outline-ring fk:disabled:pointer-events-none fk:disabled:opacity-50 fk:group-data-[variant=default]/tabs-list:data-[state=active]:shadow-sm fk:group-data-[variant=line]/tabs-list:data-[state=active]:shadow-none fk:dark:text-muted-foreground fk:dark:hover:text-foreground fk:[&_svg]:pointer-events-none fk:[&_svg]:shrink-0 fk:[&_svg:not([class*='size-'])]:size-4","fk:group-data-[variant=line]/tabs-list:bg-transparent fk:group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent fk:dark:group-data-[variant=line]/tabs-list:data-[state=active]:border-transparent! fk:dark:group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent","fk:data-[state=active]:bg-background fk:data-[state=active]:text-foreground fk:dark:data-[state=active]:border-muted-foreground/75! fk:dark:data-[state=active]:bg-input/30 fk:dark:data-[state=active]:text-foreground","fk:after:absolute fk:after:bg-foreground fk:after:opacity-0 fk:after:transition-opacity fk:group-data-[orientation=horizontal]/tabs:after:inset-x-0 fk:group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] fk:group-data-[orientation=horizontal]/tabs:after:h-0.5 fk:group-data-[orientation=vertical]/tabs:after:inset-y-0 fk:group-data-[orientation=vertical]/tabs:after:-right-1 fk:group-data-[orientation=vertical]/tabs:after:w-0.5 fk:group-data-[variant=line]/tabs-list:data-[state=active]:after:opacity-100",e),...t})}function xa({className:e,...t}){return jsx(Tabs.Content,{"data-slot":"tabs-content",className:a("fk:flex-1 fk:outline-none fk:gap-2 fk:flex fk:flex-col",e),...t})}export{Ht as ExternalLink,Wt as ResizableHandle,Kt as ResizablePanel,jt as ResizablePanelGroup,F as Sheet,Jt as SheetClose,$ as SheetContent,W as SheetDescription,Ut as SheetFooter,j as SheetHeader,ee as SheetOverlay,Q as SheetPortal,K as SheetTitle,qt as SheetTrigger,pa as Sidebar,U as SidebarContent,z as SidebarGroup,sa as SidebarInset,N as SidebarMenu,D as SidebarMenuButton,I as SidebarMenuItem,q as SidebarPanel,ia as SidebarProvider,J as SidebarRail,na as SidebarTrigger,ma as Tabs,xa as TabsContent,ha as TabsList,va as TabsTrigger,w as useSidebar};//# sourceMappingURL=ui.js.map
|
|
1
|
+
import'./index.css';import {i,j,k,g}from'./chunk-MC6VZLKC.js';export{h as DrawerModal,t as InsufficientPermissionsTooltipContent,u as PermissionTooltip,g as Separator,l as Table,n as TableBody,s as TableCaption,r as TableCell,o as TableFooter,q as TableHead,m as TableHeader,p as TableRow,f as Toaster,b as Toggle,c as ToggleGroup,d as ToggleGroupItem,e as toast,a as toggleVariants}from'./chunk-MC6VZLKC.js';import {a as a$2}from'./chunk-7GBAYC7G.js';export{a as Input}from'./chunk-7GBAYC7G.js';import {a as a$3}from'./chunk-OEWYLKO7.js';export{a as Textarea}from'./chunk-OEWYLKO7.js';import {a as a$1,b as b$1,c,e}from'./chunk-YW2EEXMV.js';export{b as Tooltip,e as TooltipContent,d as TooltipPortal,a as TooltipProvider,c as TooltipTrigger}from'./chunk-YW2EEXMV.js';import {a as a$4,d,c as c$1,e as e$1,g as g$1}from'./chunk-XU2JGXYC.js';export{a as Select,e as SelectContent,b as SelectGroup,g as SelectItem,f as SelectLabel,j as SelectScrollDownButton,i as SelectScrollUpButton,h as SelectSeparator,d as SelectTrigger,c as SelectValue}from'./chunk-XU2JGXYC.js';import {c as c$2,d as d$1,h,k as k$1,m,n,o,p,q,r,t,u,s,v,w,b as b$2}from'./chunk-LL2Z4TD3.js';export{b as Badge,m as Command,n as CommandDialog,q as CommandEmpty,r as CommandGroup,o as CommandInput,t as CommandItem,p as CommandList,s as CommandSeparator,u as CommandShortcut,c as Dialog,f as DialogClose,h as DialogContent,l as DialogDescription,j as DialogFooter,i as DialogHeader,g as DialogOverlay,e as DialogPortal,k as DialogTitle,d as DialogTrigger,v as ScrollArea,w as ScrollBar,a as badgeVariants}from'./chunk-LL2Z4TD3.js';export{a as Avatar,c as AvatarFallback,b as AvatarImage}from'./chunk-2FFSI7IK.js';import {h as h$1,c as c$3,e as e$2,f}from'./chunk-IXO2LU47.js';export{c as DropdownMenu,i as DropdownMenuCheckboxItem,f as DropdownMenuContent,g as DropdownMenuGroup,h as DropdownMenuItem,l as DropdownMenuLabel,d as DropdownMenuPortal,j as DropdownMenuRadioGroup,k as DropdownMenuRadioItem,m as DropdownMenuSeparator,n as DropdownMenuShortcut,o as DropdownMenuSub,q as DropdownMenuSubContent,p as DropdownMenuSubTrigger,e as DropdownMenuTrigger,r as Skeleton}from'./chunk-IXO2LU47.js';import {b}from'./chunk-EYGOJ2ZN.js';export{b as Button,a as buttonVariants}from'./chunk-EYGOJ2ZN.js';export{a as Switch}from'./chunk-KGYH74NA.js';export{j as Checkbox,b as Form,g as FormControl,h as FormDescription,c as FormField,e as FormItem,f as FormLabel,i as FormMessage,a as Label,d as useFormField}from'./chunk-FVFRTCEB.js';import {a}from'./chunk-O2QMYUPS.js';import*as Ve from'lucide-react';import {BrainIcon,ChevronDownIcon,XCircleIcon,CheckCircleIcon,CircleIcon,ClockIcon,SquareArrowOutUpRight,GripVerticalIcon,XIcon,PanelLeftIcon,Loader2Icon,CheckIcon,CopyIcon,ArrowDownIcon,DownloadIcon,ChevronLeftIcon,ChevronRightIcon,ImageIcon,Monitor,PlusIcon,CornerDownLeftIcon,SquareIcon,BookIcon,WrenchIcon,VideoIcon,PaperclipIcon,GlobeIcon,FileTextIcon,Music2Icon}from'lucide-react';import {jsx,jsxs,Fragment}from'react/jsx-runtime';import*as te from'react-resizable-panels';import {Dialog,Slot,Tabs,HoverCard}from'radix-ui';import*as z from'react';import {createContext,memo,useMemo,useRef,useState,useEffect,useCallback,useContext,createElement,Children,isValidElement}from'react';import Pn from'fuse.js';import {NavLink}from'react-router-dom';import {cva}from'class-variance-authority';import {groupBy}from'ramda';import {createHighlighter}from'shiki';import {StickToBottom,useStickToBottomContext}from'use-stick-to-bottom';import {cjk}from'@streamdown/cjk';import {code}from'@streamdown/code';import {math}from'@streamdown/math';import {mermaid}from'@streamdown/mermaid';import {Streamdown}from'streamdown';import {nanoid}from'nanoid';import {useControllableState}from'@radix-ui/react-use-controllable-state';import {motion}from'motion/react';function Yr({href:e,children:t}){return jsx(b,{asChild:true,className:"fk:h-6 fk:px-1! fk:py-0 fk:text-sm fk:font-light fk:text-link",size:"sm",variant:"link",children:jsxs("a",{href:e,target:"_blank",children:[t," ",jsx(SquareArrowOutUpRight,{className:"fk:size-3",strokeWidth:3})]})})}function en({className:e,...t}){return jsx(te.Group,{"data-slot":"resizable-panel-group",className:a("fk:flex fk:h-full fk:w-full fk:aria-[orientation=vertical]:flex-col",e),...t})}function tn({...e}){return jsx(te.Panel,{"data-slot":"resizable-panel",...e})}function on({withHandle:e,className:t,...o}){return jsx(te.Separator,{"data-slot":"resizable-handle",className:a("fk:relative fk:flex fk:w-px fk:items-center fk:justify-center fk:bg-border fk:after:absolute fk:after:inset-y-0 fk:after:left-1/2 fk:after:w-1 fk:after:-translate-x-1/2 fk:focus-visible:ring-1 fk:focus-visible:ring-ring fk:focus-visible:ring-offset-1 fk:focus-visible:outline-hidden fk:aria-[orientation=horizontal]:h-px fk:aria-[orientation=horizontal]:w-full fk:aria-[orientation=horizontal]:after:left-0 fk:aria-[orientation=horizontal]:after:h-1 fk:aria-[orientation=horizontal]:after:w-full fk:aria-[orientation=horizontal]:after:translate-x-0 fk:aria-[orientation=horizontal]:after:-translate-y-1/2 fk:[&[aria-orientation=horizontal]>div]:rotate-90",t),...o,children:e&&jsx("div",{className:"fk:z-10 fk:flex fk:h-8 fk:w-3 fk:items-center fk:justify-center fk:rounded-xs fk:border fk:bg-border",children:jsx(GripVerticalIcon,{className:"fk:size-2.5"})})})}function kt({...e}){return jsx(Dialog.Root,{"data-slot":"sheet",...e})}function nn({...e}){return jsx(Dialog.Trigger,{"data-slot":"sheet-trigger",...e})}function an({...e}){return jsx(Dialog.Close,{"data-slot":"sheet-close",...e})}function $t({...e}){return jsx(Dialog.Portal,{"data-slot":"sheet-portal",...e})}function Kt({className:e,...t}){return jsx(Dialog.Overlay,{"data-slot":"sheet-overlay",className:a("fk:fixed fk:inset-0 fk:z-50 fk:bg-black/50 fk:data-[state=closed]:animate-out fk:data-[state=closed]:fade-out-0 fk:data-[state=open]:animate-in fk:data-[state=open]:fade-in-0",e),...t})}function gt({className:e,children:t,side:o="right",showCloseButton:r=true,...a$1}){return jsxs($t,{children:[jsx(Kt,{}),jsxs(Dialog.Content,{"data-slot":"sheet-content",className:a("fk:fixed fk:z-50 fk:flex fk:flex-col fk:gap-4 fk:bg-background fk:shadow-lg fk:transition fk:ease-in-out fk:data-[state=closed]:animate-out fk:data-[state=closed]:duration-300 fk:data-[state=open]:animate-in fk:data-[state=open]:duration-500",o==="right"&&"fk:inset-y-0 fk:right-0 fk:h-full fk:w-3/4 fk:border-l fk:data-[state=closed]:slide-out-to-right fk:data-[state=open]:slide-in-from-right fk:sm:max-w-sm",o==="left"&&"fk:inset-y-0 fk:left-0 fk:h-full fk:w-3/4 fk:border-r fk:data-[state=closed]:slide-out-to-left fk:data-[state=open]:slide-in-from-left fk:sm:max-w-sm",o==="top"&&"fk:inset-x-0 fk:top-0 fk:h-auto fk:border-b fk:data-[state=closed]:slide-out-to-top fk:data-[state=open]:slide-in-from-top",o==="bottom"&&"fk:inset-x-0 fk:bottom-0 fk:h-auto fk:border-t fk:data-[state=closed]:slide-out-to-bottom fk:data-[state=open]:slide-in-from-bottom",e),...a$1,children:[t,r&&jsxs(Dialog.Close,{className:"fk:absolute fk:top-4 fk:right-4 fk:rounded-xs fk:opacity-70 fk:ring-offset-background fk:transition-opacity fk:hover:opacity-100 fk:focus:ring-2 fk:focus:ring-ring fk:focus:ring-offset-2 fk:focus:outline-hidden fk:disabled:pointer-events-none fk:data-[state=open]:bg-secondary",children:[jsx(XIcon,{className:"fk:size-4"}),jsx("span",{className:"fk:sr-only",children:"Close"})]})]})]})}function bt({className:e,...t}){return jsx("div",{"data-slot":"sheet-header",className:a("fk:flex fk:flex-col fk:gap-1.5 fk:p-4",e),...t})}function sn({className:e,...t}){return jsx("div",{"data-slot":"sheet-footer",className:a("fk:mt-auto fk:flex fk:flex-col fk:gap-2 fk:p-4",e),...t})}function ht({className:e,...t}){return jsx(Dialog.Title,{"data-slot":"sheet-title",className:a("fk:font-semibold fk:text-foreground",e),...t})}function vt({className:e,...t}){return jsx(Dialog.Description,{"data-slot":"sheet-description",className:a("fk:text-sm fk:text-muted-foreground",e),...t})}var xt=768;function qt(){let[e,t]=z.useState(void 0);return z.useEffect(()=>{let o=window.matchMedia(`(max-width: ${xt-1}px)`),r=()=>{t(window.innerWidth<xt);};return o.addEventListener("change",r),t(window.innerWidth<xt),()=>o.removeEventListener("change",r)},[]),!!e}var fn="flexkit:sidebar:state",cn=3600*24*7,dn="16rem",un="18rem",mn="2rem",kn="b",Jt=z.createContext(null);function ye(){let e=z.useContext(Jt);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}function gn({defaultOpen:e=true,open:t,onOpenChange:o,className:r,style:a$2,children:i,...s}){let p=qt(),[f,c]=z.useState(false),[g,m]=z.useState(e),k=t??g,T=z.useCallback(d=>{let v=typeof d=="function"?d(k):d;o?o(v):m(v),document.cookie=`${fn}=${v}; path=/; max-age=${cn}`;},[o,k]),h=z.useCallback(()=>p?c(d=>!d):T(d=>!d),[p,T,c]);z.useEffect(()=>{let d=v=>{v.key===kn&&(v.metaKey||v.ctrlKey)&&(v.preventDefault(),h());};return window.addEventListener("keydown",d),()=>window.removeEventListener("keydown",d)},[h]);let M=k?"expanded":"collapsed",A=z.useMemo(()=>({state:M,open:k,setOpen:T,isMobile:p,openMobile:f,setOpenMobile:c,toggleSidebar:h}),[M,k,T,p,f,c,h]);return jsx(Jt.Provider,{value:A,children:jsx(a$1,{delayDuration:0,children:jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":dn,"--sidebar-width-icon":mn,...a$2},className:a("fk:group/sidebar-wrapper fk:flex fk:w-full fk:has-data-[variant=inset]:bg-sidebar fk:overflow-hidden",r),...s,children:i})})})}function Pt({side:e="left",variant:t="sidebar",collapsible:o="offcanvas",className:r,children:a$1,...i}){let{isMobile:s,state:p,openMobile:f,setOpenMobile:c}=ye();return o==="none"?jsx("div",{"data-slot":"sidebar",className:a("fk:flex fk:h-full fk:w-(--sidebar-width) fk:flex-col fk:bg-sidebar fk:text-sidebar-foreground",r),...i,children:a$1}):s?jsx(kt,{open:f,onOpenChange:c,...i,children:jsxs(gt,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"fk:w-(--sidebar-width) fk:bg-sidebar fk:p-0 fk:text-sidebar-foreground fk:[&>button]:hidden",style:{"--sidebar-width":un},side:e,children:[jsxs(bt,{className:"fk:sr-only",children:[jsx(ht,{children:"Sidebar"}),jsx(vt,{children:"Displays the mobile sidebar."})]}),jsx("div",{className:"fk:flex fk:h-full fk:w-full fk:flex-col",children:a$1})]})}):jsxs("div",{className:"fk:group fk:peer fk:hidden fk:text-sidebar-foreground fk:md:block","data-state":p,"data-collapsible":p==="collapsed"?o:"","data-variant":t,"data-side":e,"data-slot":"sidebar",children:[jsx("div",{"data-slot":"sidebar-gap",className:a("fk:relative fk:w-(--sidebar-width) fk:bg-transparent fk:transition-[width] fk:duration-200 fk:ease-linear","fk:group-data-[collapsible=offcanvas]:w-0","fk:group-data-[side=right]:rotate-180",t==="floating"||t==="inset"?"fk:group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"fk:group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),jsx("div",{"data-slot":"sidebar-container",className:a("fk:relative fk:inset-y-0 fk:z-10 fk:hidden fk:h-[calc(100svh-3.5rem)] fk:w-(--sidebar-width) fk:transition-[left,right,width] fk:duration-200 fk:ease-linear fk:md:flex",e==="left"?"fk:left-0 fk:group-data-[collapsible=offcanvas]:-left-(--sidebar-width)":"fk:right-0 k:group-data-[collapsible=offcanvas]:-right-(--sidebar-width)",t==="floating"||t==="inset"?"fk:group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)] fk:group-data-[side=left]:border-r":"fk:group-data-[collapsible=icon]:w-(--sidebar-width-icon) fk:group-data-[side=left]:border-r fk:group-data-[side=right]:border-l",r),...i,children:jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"fk:flex fk:h-full fk:w-full fk:flex-col fk:bg-sidebar fk:group-data-[variant=floating]:rounded-lg fk:group-data-[variant=floating]:border fk:group-data-[variant=floating]:border-sidebar-border fk:group-data-[variant=floating]:shadow-sm",children:a$1})})]})}function bn({className:e,onClick:t,...o}){let{toggleSidebar:r}=ye();return jsxs(b,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon",className:a("fk:size-7",e),onClick:a=>{t?.(a),r();},...o,children:[jsx(PanelLeftIcon,{}),jsx("span",{className:"fk:sr-only",children:"Toggle Sidebar"})]})}function Ct({className:e,...t}){let{toggleSidebar:o}=ye();return jsx("button",{"data-sidebar":"rail","data-slot":"sidebar-rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:o,title:"Toggle Sidebar",className:a("fk:absolute fk:inset-y-0 fk:z-20 fk:hidden fk:w-4 fk:-translate-x-1/2 fk:transition-all fk:ease-linear fk:group-data-[side=left]:-right-4 fk:group-data-[side=right]:left-0 fk:after:absolute fk:after:inset-y-0 fk:after:left-1/2 fk:after:w-[2px] fk:hover:after:bg-sidebar-border fk:sm:flex","fk:in-data-[side=left]:cursor-w-resize fk:in-data-[side=right]:cursor-e-resize","fk:[[data-side=left][data-state=collapsed]_&]:cursor-e-resize fk:[[data-side=right][data-state=collapsed]_&]:cursor-w-resize","fk:group-data-[collapsible=offcanvas]:translate-x-0 fk:group-data-[collapsible=offcanvas]:after:left-full fk:hover:group-data-[collapsible=offcanvas]:bg-sidebar","fk:[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","fk:[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",e),...t})}function hn({className:e,...t}){return jsx("main",{"data-slot":"sidebar-inset",className:a("fk:relative fk:flex fk:flex-1 fk:flex-col fk:bg-background fk:overflow-hidden fk:peer-data-[variant=inset]:h-[calc(100svh-3.625rem)]",e),...t})}function yt({className:e,...t}){return jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:a("fk:flex fk:min-h-0 fk:flex-1 fk:flex-col fk:overflow-auto fk:group-data-[collapsible=icon]:overflow-hidden",e),...t})}function Ee({className:e,...t}){return jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:a("fk:relative fk:flex fk:w-full fk:min-w-0 fk:flex-col fk:p-2",e),...t})}function St({className:e,asChild:t=false,...o}){let r=t?Slot.Root:"div";return jsx(r,{"data-slot":"sidebar-group-label","data-sidebar":"group-label",className:a("fk:flex fk:h-8 fk:shrink-0 fk:items-center fk:rounded-md fk:px-2 fk:text-xs fk:font-medium fk:text-sidebar-foreground/70 fk:ring-sidebar-ring fk:outline-hidden fk:transition-[margin,opacity] fk:duration-200 fk:ease-linear fk:focus-visible:ring-2 fk:[&>svg]:size-4 fk:[&>svg]:shrink-0","fk:group-data-[collapsible=icon]:-mt-8 fk:group-data-[collapsible=icon]:opacity-0",e),...o})}function vn({className:e,...t}){return jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:a("fk:w-full fk:text-sm",e),...t})}function He({className:e,...t}){return jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:a("fk:flex fk:w-full fk:min-w-0 fk:flex-col fk:gap-1",e),...t})}function Ge({className:e,...t}){return jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:a("fk:group/menu-item fk:relative",e),...t})}var xn=cva("fk:peer/menu-button fk:flex fk:w-full fk:items-center fk:gap-2 fk:overflow-hidden fk:rounded-md fk:p-2 fk:text-left fk:text-sm fk:ring-sidebar-ring fk:outline-hidden fk:transition-[width,height,padding] fk:group-has-data-[sidebar=menu-action]/menu-item:pr-8 fk:group-data-[collapsible=icon]:size-8! fk:group-data-[collapsible=icon]:p-2! fk:hover:bg-sidebar-accent fk:hover:text-sidebar-accent-foreground fk:focus-visible:ring-2 fk:active:bg-sidebar-accent fk:active:text-sidebar-accent-foreground fk:disabled:pointer-events-none fk:disabled:opacity-50 fk:aria-disabled:pointer-events-none fk:aria-disabled:opacity-50 fk:data-[active=true]:bg-sidebar-accent fk:data-[active=true]:font-medium fk:data-[active=true]:text-sidebar-accent-foreground fk:data-[state=open]:hover:bg-sidebar-accent fk:data-[state=open]:hover:text-sidebar-accent-foreground fk:[&>span:last-child]:truncate fk:[&>svg]:size-4 fk:[&>svg]:shrink-0",{variants:{variant:{default:"fk:hover:bg-sidebar-accent fk:hover:text-sidebar-accent-foreground",outline:"fk:bg-background fk:shadow-[0_0_0_1px_hsl(var(--sidebar-border))] fk:hover:bg-sidebar-accent fk:hover:text-sidebar-accent-foreground fk:hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"fk:h-8 fk:text-sm",sm:"fk:h-7 fk:text-xs",lg:"fk:h-12 fk:text-sm fk:group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function Oe({asChild:e$1=false,isActive:t=false,variant:o="default",size:r="default",tooltip:a$1,className:i,...s}){let p=e$1?Slot.Root:"button",{isMobile:f,state:c$1}=ye(),g=jsx(p,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":r,"data-active":t,className:a(xn({variant:o,size:r}),i),...s});return a$1?(typeof a$1=="string"&&(a$1={children:a$1}),jsxs(b$1,{children:[jsx(c,{asChild:true,children:g}),jsx(e,{side:"right",align:"center",hidden:c$1!=="collapsed"||f,...a$1})]})):g}var Zt=NavLink,Sn=Object.keys(Ve).map(e=>({name:e,icon:Ve[e]})),Tn=new Pn(Sn,{keys:["name"],threshold:.5});function In({className:e,menuGroups:t,schema:o}){let r=o.filter(s=>!(s.menu&&"hidden"in s.menu)),a=groupBy(s=>s.menu?.group&&t?.find(p=>p.name===s.menu?.group)?.name||"ungrouped",r),i=t?.filter(s=>a[s.name]?.length);return jsxs(Pt,{className:e,collapsible:"icon",variant:"inset",children:[jsxs(yt,{children:[i?.map(s=>jsxs(Ee,{children:[jsx(St,{children:s.title}),jsx(He,{children:a[s.name]?.map(p=>jsx(Ge,{children:jsx(Oe,{asChild:true,isActive:location.pathname.includes(`/list/${p.plural}`),tooltip:Ue(p.menu?.label??p.plural),children:jsxs(Zt,{to:`list/${p.plural}`,children:[p.menu?.icon??createElement(Ve[Qt(p.name)],{className:"fk:h-4 fk:w-4 fk:mr-2",strokeWidth:2}),jsx("span",{children:Ue(p.menu?.label??p.plural)})]})})},p.plural))})]},s.name)),jsx(Ee,{children:jsx(He,{children:a.ungrouped?.map(s=>jsx(Ge,{children:jsx(Oe,{asChild:true,isActive:location.pathname.includes(`/list/${s.plural}`),tooltip:Ue(s.menu?.label??s.plural),children:jsxs(Zt,{to:`list/${s.plural}`,children:[createElement(Ve[Qt(s.name)],{className:"fk:h-4 fk:w-4 fk:mr-2",strokeWidth:2}),jsx("span",{children:Ue(s.menu?.label??s.plural)})]})})},s.plural))})})]}),jsx(Ct,{})]})}function Ue(e){let t=e.replace(/([A-Z])/g," $1");return t.charAt(0).toUpperCase()+t.slice(1).trim()}function Qt(e){let t=Tn.search(e);return t.length>0?t[0].item.name:"Dock"}function Mn({className:e,orientation:t="horizontal",...o}){return jsx(Tabs.Root,{"data-slot":"tabs","data-orientation":t,orientation:t,className:a("fk:group/tabs fk:flex fk:data-[orientation=horizontal]:flex-col",e),...o})}var Nn=cva("fk:group/tabs-list fk:inline-flex fk:w-fit fk:items-center fk:justify-center fk:rounded-lg fk:p-[3px] fk:text-muted-foreground fk:group-data-[orientation=horizontal]/tabs:h-9 fk:group-data-[orientation=vertical]/tabs:h-fit fk:group-data-[orientation=vertical]/tabs:flex-col fk:data-[variant=line]:rounded-none",{variants:{variant:{default:"fk:bg-muted",line:"fk:gap-1 fk:bg-transparent"}},defaultVariants:{variant:"default"}});function Rn({className:e,variant:t="default",...o}){return jsx(Tabs.List,{"data-slot":"tabs-list","data-variant":t,className:a(Nn({variant:t}),e),...o})}function Ln({className:e,...t}){return jsx(Tabs.Trigger,{"data-slot":"tabs-trigger",className:a("fk:relative fk:inline-flex fk:h-[calc(100%-1px)] fk:flex-1 fk:items-center fk:justify-center fk:gap-1.5 fk:rounded-md fk:border fk:border-transparent! fk:px-4 fk:py-1 fk:text-sm fk:font-medium fk:whitespace-nowrap fk:text-foreground/60 fk:transition-all fk:group-data-[orientation=vertical]/tabs:w-full fk:group-data-[orientation=vertical]/tabs:justify-start fk:hover:text-foreground fk:focus-visible:border-ring! fk:focus-visible:ring-[3px] fk:focus-visible:ring-ring/50 fk:focus-visible:outline-1 fk:focus-visible:outline-ring fk:disabled:pointer-events-none fk:disabled:opacity-50 fk:group-data-[variant=default]/tabs-list:data-[state=active]:shadow-sm fk:group-data-[variant=line]/tabs-list:data-[state=active]:shadow-none fk:dark:text-muted-foreground fk:dark:hover:text-foreground fk:[&_svg]:pointer-events-none fk:[&_svg]:shrink-0 fk:[&_svg:not([class*='size-'])]:size-4","fk:group-data-[variant=line]/tabs-list:bg-transparent fk:group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent fk:dark:group-data-[variant=line]/tabs-list:data-[state=active]:border-transparent! fk:dark:group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent","fk:data-[state=active]:bg-background fk:data-[state=active]:text-foreground fk:dark:data-[state=active]:border-muted-foreground/75! fk:dark:data-[state=active]:bg-input/30 fk:dark:data-[state=active]:text-foreground","fk:after:absolute fk:after:bg-foreground fk:after:opacity-0 fk:after:transition-opacity fk:group-data-[orientation=horizontal]/tabs:after:inset-x-0 fk:group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] fk:group-data-[orientation=horizontal]/tabs:after:h-0.5 fk:group-data-[orientation=vertical]/tabs:after:inset-y-0 fk:group-data-[orientation=vertical]/tabs:after:-right-1 fk:group-data-[orientation=vertical]/tabs:after:w-0.5 fk:group-data-[variant=line]/tabs-list:data-[state=active]:after:opacity-100",e),...t})}function Bn({className:e,...t}){return jsx(Tabs.Content,{"data-slot":"tabs-content",className:a("fk:flex-1 fk:outline-none fk:gap-2 fk:flex fk:flex-col",e),...t})}function Te({...e}){return jsx(HoverCard.Root,{"data-slot":"hover-card",...e})}function Ie({...e}){return jsx(HoverCard.Trigger,{"data-slot":"hover-card-trigger",...e})}function we({className:e,align:t="center",sideOffset:o=4,...r}){return jsx(HoverCard.Portal,{"data-slot":"hover-card-portal",children:jsx(HoverCard.Content,{"data-slot":"hover-card-content",align:t,sideOffset:o,className:a("fk:z-50 fk:w-64 fk:origin-(--radix-hover-card-content-transform-origin) fk:rounded-md fk:border fk:bg-popover fk:p-4 fk:text-popover-foreground fk:shadow-md fk:outline-hidden fk:data-[side=bottom]:slide-in-from-top-2 fk:data-[side=left]:slide-in-from-right-2 fk:data-[side=right]:slide-in-from-left-2 fk:data-[side=top]:slide-in-from-bottom-2 fk:data-[state=closed]:animate-out fk:data-[state=closed]:fade-out-0 fk:data-[state=closed]:zoom-out-95 fk:data-[state=open]:animate-in fk:data-[state=open]:fade-in-0 fk:data-[state=open]:zoom-in-95",e),...r})})}function Tt({className:e,...t}){return jsx(Loader2Icon,{role:"status","aria-label":"Loading",className:a("fk:size-4 fk:animate-spin",e),...t})}var eo=cva("fk:flex fk:w-fit fk:items-stretch fk:has-[>[data-slot=button-group]]:gap-2 fk:[&>*]:focus-visible:relative fk:[&>*]:focus-visible:z-10 fk:has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-md fk:[&>[data-slot=select-trigger]:not([class*=w-])]:w-fit fk:[&>input]:flex-1",{variants:{orientation:{horizontal:"fk:[&>*:not(:first-child)]:rounded-l-none fk:[&>*:not(:first-child)]:border-l-0 fk:[&>*:not(:last-child)]:rounded-r-none",vertical:"fk:flex-col fk:[&>*:not(:first-child)]:rounded-t-none fk:[&>*:not(:first-child)]:border-t-0 fk:[&>*:not(:last-child)]:rounded-b-none"}},defaultVariants:{orientation:"horizontal"}});function It({className:e,orientation:t,...o}){return jsx("div",{role:"group","data-slot":"button-group","data-orientation":t,className:a(eo({orientation:t}),e),...o})}function wt({className:e,asChild:t=false,...o}){let r=t?Slot.Root:"div";return jsx(r,{className:a("fk:bg-muted fk:shadow-xs fk:flex fk:items-center fk:gap-2 fk:rounded-md fk:border fk:px-4 fk:text-sm fk:font-medium fk:[&_svg:not([class*=size-])]:size-4 fk:[&_svg]:pointer-events-none",e),...o})}function Hn({className:e,orientation:t="vertical",...o}){return jsx(g,{"data-slot":"button-group-separator",orientation:t,className:a("fk:bg-input fk:relative fk:!m-0 fk:self-stretch fk:data-[orientation=vertical]:h-auto",e),...o})}function Nt({className:e,...t}){return jsx("div",{"data-slot":"input-group",role:"group",className:a("fk:group/input-group fk:border-input fk:dark:bg-input/30 fk:shadow-xs fk:relative fk:flex fk:w-full fk:items-center fk:rounded-md fk:border fk:outline-none fk:transition-[color,box-shadow]","fk:h-9 fk:has-[>textarea]:h-auto","fk:has-[>[data-align=inline-start]]:[&>input]:pl-2","fk:has-[>[data-align=inline-end]]:[&>input]:pr-2","fk:has-[>[data-align=block-start]]:h-auto fk:has-[>[data-align=block-start]]:flex-col fk:has-[>[data-align=block-start]]:[&>input]:pb-3","fk:has-[>[data-align=block-end]]:h-auto fk:has-[>[data-align=block-end]]:flex-col fk:has-[>[data-align=block-end]]:[&>input]:pt-3","fk:has-[[data-slot=input-group-control]:focus-visible]:ring-ring fk:has-[[data-slot=input-group-control]:focus-visible]:ring-1","fk:has-[[data-slot][aria-invalid=true]]:ring-destructive/20 fk:has-[[data-slot][aria-invalid=true]]:border-destructive fk:dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40",e),...t})}var Gn=cva("fk:text-muted-foreground fk:flex fk:h-auto fk:cursor-text fk:select-none fk:items-center fk:justify-center fk:gap-2 fk:py-1.5 fk:text-sm fk:font-medium fk:group-data-[disabled=true]/input-group:opacity-50 fk:[&>kbd]:rounded-[calc(var(--radius)-5px)] fk:[&>svg:not([class*=size-])]:size-4",{variants:{align:{"inline-start":"fk:order-first fk:pl-3 fk:has-[>button]:ml-[-0.45rem] fk:has-[>kbd]:ml-[-0.35rem]","inline-end":"fk:order-last fk:pr-3 fk:has-[>button]:mr-[-0.4rem] fk:has-[>kbd]:mr-[-0.35rem]","block-start":"fk:[.border-b]:pb-3 fk:order-first fk:w-full fk:justify-start fk:px-3 fk:pt-3 fk:group-has-[>input]/input-group:pt-2.5","block-end":"fk:[.border-t]:pt-3 fk:order-last fk:w-full fk:justify-start fk:px-3 fk:pb-3 fk:group-has-[>input]/input-group:pb-2.5"}},defaultVariants:{align:"inline-start"}});function $e({className:e,align:t="inline-start",...o}){return jsx("div",{role:"group","data-slot":"input-group-addon","data-align":t,className:a(Gn({align:t}),e),onClick:r=>{r.target.closest("button")||r.currentTarget.parentElement?.querySelector("input")?.focus();},...o})}var On=cva("fk:flex fk:items-center fk:gap-2 fk:text-sm fk:shadow-none",{variants:{size:{xs:"fk:h-6 fk:gap-1 fk:rounded-[calc(var(--radius)-5px)] fk:px-2 fk:has-[>svg]:px-2 fk:[&>svg:not([class*=size-])]:size-3.5",sm:"fk:h-8 fk:gap-1.5 fk:rounded-md fk:px-2.5 fk:has-[>svg]:px-2.5","icon-xs":"fk:size-6 fk:rounded-[calc(var(--radius)-5px)] fk:p-0 fk:has-[>svg]:p-0","icon-sm":"fk:size-8 fk:p-0 fk:has-[>svg]:p-0"}},defaultVariants:{size:"xs"}});function Ke({className:e,type:t="button",variant:o="ghost",size:r="xs",...a$1}){return jsx(b,{type:t,"data-size":r,variant:o,className:a(On({size:r}),e),...a$1})}function Un({className:e,...t}){return jsx("span",{className:a("fk:text-muted-foreground fk:flex fk:items-center fk:gap-2 fk:text-sm fk:[&_svg:not([class*=size-])]:size-4 fk:[&_svg]:pointer-events-none",e),...t})}function Vn({className:e,...t}){return jsx(a$2,{"data-slot":"input-group-control",className:a("fk:flex-1 fk:rounded-none fk:border-0 fk:bg-transparent fk:shadow-none fk:focus-visible:ring-0 fk:dark:bg-transparent",e),...t})}function Rt({className:e,...t}){return jsx(a$3,{"data-slot":"input-group-control",className:a("fk:flex-1 fk:resize-none fk:rounded-none fk:border-0 fk:bg-transparent fk:py-3 fk:shadow-none fk:focus-visible:ring-0 fk:dark:bg-transparent",e),...t})}var Jn={audio:Music2Icon,document:FileTextIcon,image:ImageIcon,source:GlobeIcon,unknown:PaperclipIcon,video:VideoIcon},ao=e=>{if(e.type==="source-document")return "source";let t=e.mediaType??"";return t.startsWith("image/")?"image":t.startsWith("video/")?"video":t.startsWith("audio/")?"audio":t.startsWith("application/")||t.startsWith("text/")?"document":"unknown"},Yn=e=>{if(e.type==="source-document")return e.title||e.filename||"Source";let t=ao(e);return e.filename||(t==="image"?"Image":"Attachment")},Zn=(e,t,o)=>o?jsx("img",{alt:t||"Image",className:"fk:size-full fk:object-cover",height:96,src:e,width:96}):jsx("img",{alt:t||"Image",className:"fk:size-full fk:rounded fk:object-cover",height:20,src:e,width:20}),so=createContext(null),io=createContext(null),Qn=()=>useContext(so)??{variant:"grid"},Lt=()=>{let e=useContext(io);if(!e)throw new Error("Attachment components must be used within <Attachment>");return e},Wi=({variant:e="grid",className:t,children:o,...r})=>{let a$1=useMemo(()=>({variant:e}),[e]);return jsx(so.Provider,{value:a$1,children:jsx("div",{className:a("fk:flex fk:items-start",e==="list"?"fk:flex-col fk:gap-2":"fk:flex-wrap fk:gap-2",e==="grid"&&"fk:ml-auto fk:w-fit",t),...r,children:o})})},$i=({data:e,onRemove:t,className:o,children:r,...a$1})=>{let{variant:i}=Qn(),s=ao(e),p=useMemo(()=>({data:e,mediaCategory:s,onRemove:t,variant:i}),[e,s,t,i]);return jsx(io.Provider,{value:p,children:jsx("div",{className:a("fk:group fk:relative",i==="grid"&&"fk:size-24 fk:overflow-hidden fk:rounded-lg",i==="inline"&&["fk:flex fk:h-8 fk:cursor-pointer fk:select-none fk:items-center fk:gap-1.5","fk:rounded-md fk:border fk:border-border fk:px-1.5","fk:font-medium fk:text-sm fk:transition-all","fk:hover:bg-accent fk:hover:text-accent-foreground fk:dark:hover:bg-accent/50"],i==="list"&&["fk:flex fk:w-full fk:items-center fk:gap-3 fk:rounded-lg fk:border fk:p-3","fk:hover:bg-accent/50"],o),...a$1,children:r})})},Ki=({fallbackIcon:e,className:t,...o})=>{let{data:r,mediaCategory:a$1,variant:i}=Lt(),s=i==="inline"?"fk:size-3":"fk:size-4",p=c=>jsx(c,{className:a(s,"fk:text-muted-foreground")}),f=()=>{if(a$1==="image"&&r.type==="file"&&r.url)return Zn(r.url,r.filename,i==="grid");if(a$1==="video"&&r.type==="file"&&r.url)return jsx("video",{className:"fk:size-full fk:object-cover",muted:true,src:r.url});let c=Jn[a$1];return e??p(c)};return jsx("div",{className:a("fk:flex fk:shrink-0 fk:items-center fk:justify-center fk:overflow-hidden",i==="grid"&&"fk:size-full fk:bg-muted",i==="inline"&&"fk:size-5 fk:rounded fk:bg-background",i==="list"&&"fk:size-12 fk:rounded fk:bg-muted",t),...o,children:f()})},qi=({showMediaType:e=false,className:t,...o})=>{let{data:r,variant:a$1}=Lt(),i=Yn(r);return a$1==="grid"?null:jsxs("div",{className:a("fk:min-w-0 fk:flex-1",t),...o,children:[jsx("span",{className:"fk:block fk:truncate",children:i}),e&&r.mediaType&&jsx("span",{className:"fk:block fk:truncate fk:text-muted-foreground fk:text-xs",children:r.mediaType})]})},Xi=({label:e="Remove",className:t,children:o,...r})=>{let{onRemove:a$1,variant:i}=Lt(),s=useCallback(p=>{p.stopPropagation(),a$1?.();},[a$1]);return a$1?jsxs(b,{"aria-label":e,className:a(i==="grid"&&["fk:absolute fk:top-2 fk:right-2 fk:size-6 fk:rounded-full fk:p-0","fk:bg-background/80 fk:backdrop-blur-sm","fk:opacity-0 fk:transition-opacity fk:group-hover:opacity-100","fk:hover:bg-background","fk:[&>svg]:size-3"],i==="inline"&&["fk:size-5 fk:rounded fk:p-0","fk:opacity-0 fk:transition-opacity fk:group-hover:opacity-100","fk:[&>svg]:size-2.5"],i==="list"&&["fk:size-8 fk:shrink-0 fk:rounded fk:p-0","fk:[&>svg]:size-4"],t),onClick:s,type:"button",variant:"ghost",...r,children:[o??jsx(XIcon,{}),jsx("span",{className:"fk:sr-only",children:e})]}):null},Ji=({openDelay:e=0,closeDelay:t=0,...o})=>jsx(Te,{closeDelay:t,openDelay:e,...o}),Yi=e=>jsx(Ie,{...e}),Zi=({align:e="start",className:t,...o})=>jsx(we,{align:e,className:a("fk:w-auto fk:p-2",t),...o}),Qi=({className:e,children:t,...o})=>jsx("div",{className:a("fk:flex fk:items-center fk:justify-center fk:p-4 fk:text-muted-foreground fk:text-sm",e),...o,children:t??"No attachments"});var ia=e=>e&&e&1,pa=e=>e&&e&2,la=e=>e&&e&4,fa=e=>e.map((t,o)=>({key:`line-${o}`,tokens:t.map((r,a)=>({key:`line-${o}-${a}`,token:r}))})),ca=({token:e})=>jsx("span",{className:"fk:dark:bg-(--shiki-dark-bg)! fk:dark:text-(--shiki-dark)!",style:{backgroundColor:e.bgColor,color:e.color,fontStyle:ia(e.fontStyle)?"italic":void 0,fontWeight:pa(e.fontStyle)?"bold":void 0,textDecoration:la(e.fontStyle)?"underline":void 0,...e.htmlStyle},children:e.content}),da=a("fk:block","fk:before:content-[counter(line)]","fk:before:inline-block","fk:before:[counter-increment:line]","fk:before:w-8","fk:before:mr-4","fk:before:text-right","fk:before:text-muted-foreground/50","fk:before:font-mono","fk:before:select-none"),ua=({keyedLine:e,showLineNumbers:t})=>jsx("span",{className:t?da:"fk:block",children:e.tokens.length===0?`
|
|
2
|
+
`:e.tokens.map(({token:o,key:r})=>jsx(ca,{token:o},r))}),go=createContext({code:""}),lo=new Map,fo=new Map,re=new Map,ma=(e,t)=>{let o=e.slice(0,100),r=e.length>100?e.slice(-100):"";return `${t}:${e.length}:${o}:${r}`},ka=e=>{let t=lo.get(e);if(t)return t;let o=createHighlighter({langs:[e],themes:["github-light","github-dark"]});return lo.set(e,o),o},ga=e=>({bg:"transparent",fg:"inherit",tokens:e.split(`
|
|
3
|
+
`).map(t=>t===""?[]:[{color:"inherit",content:t}])}),co=(e,t,o)=>{let r=ma(e,t),a=fo.get(r);return a||(o&&(re.has(r)||re.set(r,new Set),re.get(r)?.add(o)),ka(t).then(i=>{let p=i.getLoadedLanguages().includes(t)?t:"text",f=i.codeToTokens(e,{lang:p,themes:{dark:"github-dark",light:"github-light"}}),c={bg:f.bg??"transparent",fg:f.fg??"inherit",tokens:f.tokens};fo.set(r,c);let g=re.get(r);if(g){for(let m of g)m(c);re.delete(r);}}).catch(i=>{console.error("Failed to highlight code:",i),re.delete(r);}),null)},bo=memo(({tokenized:e,showLineNumbers:t,className:o})=>{let r=useMemo(()=>({backgroundColor:e.bg,color:e.fg}),[e.bg,e.fg]),a$1=useMemo(()=>fa(e.tokens),[e.tokens]);return jsx("pre",{className:a("fk:dark:bg-(--shiki-dark-bg)! fk:dark:text-(--shiki-dark)! fk:m-0 fk:p-4 fk:text-sm",o),style:r,children:jsx("code",{className:a("fk:font-mono fk:text-sm",t&&"fk:[counter-increment:line_0] fk:[counter-reset:line]"),children:a$1.map(i=>jsx(ua,{keyedLine:i,showLineNumbers:t},i.key))})})},(e,t)=>e.tokenized===t.tokenized&&e.showLineNumbers===t.showLineNumbers&&e.className===t.className);bo.displayName="CodeBlockBody";var ba=({className:e,language:t,style:o,...r})=>jsx("div",{className:a("fk:group fk:relative fk:w-full fk:overflow-hidden fk:rounded-md fk:border fk:bg-background fk:text-foreground",e),"data-language":t,style:{containIntrinsicSize:"auto 200px",contentVisibility:"auto",...o},...r}),pp=({children:e,className:t,...o})=>jsx("div",{className:a("fk:flex fk:items-center fk:justify-between fk:border-b fk:bg-muted/80 fk:px-3 fk:py-2 fk:text-muted-foreground fk:text-xs",t),...o,children:e}),lp=({children:e,className:t,...o})=>jsx("div",{className:a("fk:flex fk:items-center fk:gap-2",t),...o,children:e}),fp=({children:e,className:t,...o})=>jsx("span",{className:a("fk:font-mono",t),...o,children:e}),cp=({children:e,className:t,...o})=>jsx("div",{className:a("fk:-my-1 fk:-mr-1 fk:flex fk:items-center fk:gap-2",t),...o,children:e}),ha=({code:e,language:t,showLineNumbers:o=false})=>{let r=useMemo(()=>ga(e),[e]),a=useMemo(()=>co(e,t)??r,[e,t,r]),[i,s]=useState(null),p=useRef({code:e,language:t});return (p.current.code!==e||p.current.language!==t)&&(p.current={code:e,language:t},s(null)),useEffect(()=>{let c=false;return co(e,t,g=>{c||s(g);}),()=>{c=true;}},[e,t]),jsx("div",{className:"fk:relative fk:overflow-auto",children:jsx(bo,{showLineNumbers:o,tokenized:i??a})})},qe=({code:e,language:t,showLineNumbers:o=false,className:r,children:a,...i})=>{let s=useMemo(()=>({code:e}),[e]);return jsx(go.Provider,{value:s,children:jsxs(ba,{className:r,language:t,...i,children:[a,jsx(ha,{code:e,language:t,showLineNumbers:o})]})})},dp=({onCopy:e,onError:t,timeout:o=2e3,children:r,className:a$1,...i})=>{let[s,p]=useState(false),f=useRef(0),{code:c}=useContext(go),g=useCallback(async()=>{if(typeof window>"u"||!navigator?.clipboard?.writeText){t?.(new Error("Clipboard API not available"));return}try{s||(await navigator.clipboard.writeText(c),p(!0),e?.(),f.current=window.setTimeout(()=>p(!1),o));}catch(k){t?.(k);}},[c,e,t,o,s]);useEffect(()=>()=>{window.clearTimeout(f.current);},[]);let m=s?CheckIcon:CopyIcon;return jsx(b,{className:a("fk:shrink-0",a$1),onClick:g,size:"icon",variant:"ghost",...i,children:r??jsx(m,{size:14})})},up=e=>jsx(a$4,{...e}),mp=({className:e,...t})=>jsx(d,{className:a("fk:h-7 fk:border-none fk:bg-transparent fk:px-2 fk:text-xs fk:shadow-none",e),size:"sm",...t}),kp=e=>jsx(c$1,{...e}),gp=({align:e="end",...t})=>jsx(e$1,{align:e,...t}),bp=e=>jsx(g$1,{...e});var Tp=({className:e,...t})=>jsx(StickToBottom,{className:a("fk:relative fk:flex-1 fk:overflow-y-hidden",e),initial:"smooth",resize:"smooth",role:"log",...t}),Ip=({className:e,...t})=>jsx(StickToBottom.Content,{className:a("fk:flex fk:flex-col fk:gap-8 fk:p-4",e),...t}),wp=({className:e,title:t="No messages yet",description:o="Start a conversation to see messages here",icon:r,children:a$1,...i})=>jsx("div",{className:a("fk:flex fk:size-full fk:flex-col fk:items-center fk:justify-center fk:gap-3 fk:p-8 fk:text-center",e),...i,children:a$1??jsxs(Fragment,{children:[r&&jsx("div",{className:"fk:text-muted-foreground",children:r}),jsxs("div",{className:"fk:space-y-1",children:[jsx("h3",{className:"fk:font-medium fk:text-sm",children:t}),o&&jsx("p",{className:"fk:text-muted-foreground fk:text-sm",children:o})]})]})}),Mp=({className:e,...t})=>{let{isAtBottom:o,scrollToBottom:r}=useStickToBottomContext(),a$1=useCallback(()=>{r();},[r]);return !o&&jsx(b,{className:a("fk:absolute fk:bottom-4 fk:left-[50%] fk:translate-x-[-50%] fk:rounded-full fk:dark:bg-background fk:dark:hover:bg-muted",e),onClick:a$1,size:"icon",type:"button",variant:"outline",...t,children:jsx(ArrowDownIcon,{className:"fk:size-4"})})},ya=e=>e.parts.filter(t=>t.type==="text").map(t=>t.text).join(""),Po=e=>`**${e.role.charAt(0).toUpperCase()+e.role.slice(1)}:** ${ya(e)}`,Sa=(e,t=Po)=>e.map((o,r)=>t(o,r)).join(`
|
|
4
|
+
|
|
5
|
+
`),Np=({messages:e,filename:t="conversation.md",formatMessage:o=Po,className:r,children:a$1,...i})=>{let s=useCallback(()=>{let p=Sa(e,o),f=new Blob([p],{type:"text/markdown"}),c=URL.createObjectURL(f),g=document.createElement("a");g.href=c,g.download=t,document.body.append(g),g.click(),g.remove(),URL.revokeObjectURL(c);},[e,t,o]);return jsx(b,{className:a("fk:absolute fk:top-4 fk:right-4 fk:rounded-full fk:dark:bg-background fk:dark:hover:bg-muted",r),onClick:s,size:"icon",type:"button",variant:"outline",...i,children:a$1??jsx(DownloadIcon,{className:"fk:size-4"})})};var _p=({className:e,from:t,...o})=>jsx("div",{className:a("fk:group fk:flex fk:w-full fk:max-w-[95%] fk:flex-col fk:gap-2",t==="user"?"fk:is-user fk:ml-auto fk:justify-end":"fk:is-assistant",e),...o}),jp=({children:e,className:t,...o})=>jsx("div",{className:a("fk:is-user:dark fk:flex fk:w-fit fk:min-w-0 fk:max-w-full fk:flex-col fk:gap-2 fk:overflow-hidden fk:text-sm","fk:group-[.is-user]:ml-auto fk:group-[.is-user]:rounded-lg fk:group-[.is-user]:bg-secondary fk:group-[.is-user]:px-4 fk:group-[.is-user]:py-3 fk:group-[.is-user]:text-foreground","fk:group-[.is-assistant]:text-foreground",t),...o,children:e}),Wp=({className:e,children:t,...o})=>jsx("div",{className:a("fk:flex fk:items-center fk:gap-1",e),...o,children:t}),$p=({tooltip:e$1,children:t,label:o,variant:r="ghost",size:a="icon-sm",...i})=>{let s=jsxs(b,{size:a,type:"button",variant:r,...i,children:[t,jsx("span",{className:"fk:sr-only",children:o||e$1})]});return e$1?jsx(a$1,{children:jsxs(b$1,{children:[jsx(c,{asChild:true,children:s}),jsx(e,{children:jsx("p",{children:e$1})})]})}):s},So=createContext(null),Ne=()=>{let e=useContext(So);if(!e)throw new Error("MessageBranch components must be used within MessageBranch");return e},Kp=({defaultBranch:e=0,onBranchChange:t,className:o,...r})=>{let[a$1,i]=useState(e),[s,p]=useState([]),f=useCallback(k=>{i(k),t?.(k);},[t]),c=useCallback(()=>{let k=a$1>0?a$1-1:s.length-1;f(k);},[a$1,s.length,f]),g=useCallback(()=>{let k=a$1<s.length-1?a$1+1:0;f(k);},[a$1,s.length,f]),m=useMemo(()=>({branches:s,currentBranch:a$1,goToNext:g,goToPrevious:c,setBranches:p,totalBranches:s.length}),[s,a$1,g,c]);return jsx(So.Provider,{value:m,children:jsx("div",{className:a("fk:grid fk:w-full fk:gap-2 fk:[&>div]:pb-0",o),...r})})},qp=({children:e,...t})=>{let{currentBranch:o,setBranches:r,branches:a$1}=Ne(),i=useMemo(()=>Array.isArray(e)?e:[e],[e]);return useEffect(()=>{a$1.length!==i.length&&r(i);},[i,a$1,r]),i.map((s,p)=>jsx("div",{className:a("fk:grid fk:gap-2 fk:overflow-hidden fk:[&>div]:pb-0",p===o?"fk:block":"fk:hidden"),...t,children:s},s.key))},Xp=({className:e,...t})=>{let{totalBranches:o}=Ne();return o<=1?null:jsx(It,{className:a("fk:[&>*:not(:first-child)]:rounded-l-md fk:[&>*:not(:last-child)]:rounded-r-md",e),orientation:"horizontal",...t})},Jp=({children:e,...t})=>{let{goToPrevious:o,totalBranches:r}=Ne();return jsx(b,{"aria-label":"Previous branch",disabled:r<=1,onClick:o,size:"icon-sm",type:"button",variant:"ghost",...t,children:e??jsx(ChevronLeftIcon,{size:14})})},Yp=({children:e,...t})=>{let{goToNext:o,totalBranches:r}=Ne();return jsx(b,{"aria-label":"Next branch",disabled:r<=1,onClick:o,size:"icon-sm",type:"button",variant:"ghost",...t,children:e??jsx(ChevronRightIcon,{size:14})})},Zp=({className:e,...t})=>{let{currentBranch:o,totalBranches:r}=Ne();return jsxs(wt,{className:a("fk:border-none fk:bg-transparent fk:text-muted-foreground fk:shadow-none",e),...t,children:[o+1," of ",r]})},Ha={cjk:cjk,code:code,math:math,mermaid:mermaid},Ga=memo(({className:e,...t})=>jsx(Streamdown,{className:a("fk:size-full fk:[&>*:first-child]:mt-0 fk:[&>*:last-child]:mb-0",e),plugins:Ha,...t}),(e,t)=>e.children===t.children&&t.isAnimating===e.isAnimating);Ga.displayName="MessageResponse";var Qp=({className:e,children:t,...o})=>jsx("div",{className:a("fk:mt-4 fk:flex fk:w-full fk:items-center fk:justify-between fk:gap-4",e),...o,children:t});var al=e=>jsx(c$2,{...e}),sl=e=>jsx(d$1,{...e}),il=({className:e,children:t,title:o="Model Selector",...r})=>jsxs(h,{"aria-describedby":void 0,className:a("fk:outline! fk:border-none! fk:p-0 fk:outline-border! fk:outline-solid!",e),...r,children:[jsx(k$1,{className:"fk:sr-only",children:o}),jsx(m,{className:"fk:**:data-[slot=command-input-wrapper]:h-auto",children:t})]}),pl=e=>jsx(n,{...e}),ll=({className:e,...t})=>jsx(o,{className:a("fk:h-auto fk:py-3.5",e),...t}),fl=e=>jsx(p,{...e}),cl=e=>jsx(q,{...e}),dl=e=>jsx(r,{...e}),ul=e=>jsx(t,{...e}),ml=e=>jsx(u,{...e}),kl=e=>jsx(s,{...e}),gl=({provider:e,className:t,...o})=>jsx("img",{...o,alt:`${e} logo`,className:a("fk:size-3 fk:dark:invert",t),height:12,src:`https://models.dev/logos/${e}.svg`,width:12}),bl=({className:e,...t})=>jsx("div",{className:a("fk:flex fk:shrink-0 fk:items-center fk:-space-x-1 fk:[&>img]:rounded-full fk:[&>img]:bg-background fk:[&>img]:p-px fk:[&>img]:ring-1 fk:dark:[&>img]:bg-foreground",e),...t}),hl=({className:e,...t})=>jsx("span",{className:a("fk:flex-1 fk:truncate fk:text-left",e),...t});var Ka=async e=>{try{let o=await(await fetch(e)).blob();return new Promise(r=>{let a=new FileReader;a.onloadend=()=>r(a.result),a.onerror=()=>r(null),a.readAsDataURL(o);})}catch{return null}},qa=async()=>{if(typeof navigator>"u"||!navigator.mediaDevices?.getDisplayMedia)return null;let e=null,t=document.createElement("video");t.muted=true,t.playsInline=true;try{e=await navigator.mediaDevices.getDisplayMedia({audio:!1,video:!0}),t.srcObject=e,await new Promise((f,c)=>{t.onloadedmetadata=()=>f(),t.onerror=()=>c(new Error("Failed to load screen stream"));}),await t.play();let o=t.videoWidth,r=t.videoHeight;if(!o||!r)return null;let a=document.createElement("canvas");a.width=o,a.height=r;let i=a.getContext("2d");if(!i)return null;i.drawImage(t,0,0,o,r);let s=await new Promise(f=>{a.toBlob(f,"image/png");});if(!s)return null;let p=new Date().toISOString().replaceAll(/[:.]/g,"-").replace("T","_").replace("Z","");return new File([s],`screenshot-${p}.png`,{lastModified:Date.now(),type:"image/png"})}finally{if(e)for(let o of e.getTracks())o.stop();t.pause(),t.srcObject=null;}},zt=createContext(null),Et=createContext(null),Bl=()=>{let e=useContext(zt);if(!e)throw new Error("Wrap your component inside <PromptInputProvider> to use usePromptInputController().");return e},To=()=>useContext(zt),Al=()=>{let e=useContext(Et);if(!e)throw new Error("Wrap your component inside <PromptInputProvider> to use useProviderAttachments().");return e},Xa=()=>useContext(Et),Dl=({initialInput:e="",children:t})=>{let[o,r]=useState(e),a=useCallback(()=>r(""),[]),[i,s]=useState([]),p=useRef(null),f=useRef(()=>{}),c=useCallback(d=>{let v=Array.from(d);v.length!==0&&s(O=>[...O,...v.map(D=>({filename:D.name,id:nanoid(),mediaType:D.type,type:"file",url:URL.createObjectURL(D)}))]);},[]),g=useCallback(d=>{s(v=>{let O=v.find(D=>D.id===d);return O?.url&&URL.revokeObjectURL(O.url),v.filter(D=>D.id!==d)});},[]),m=useCallback(()=>{s(d=>{for(let v of d)v.url&&URL.revokeObjectURL(v.url);return []});},[]),k=useRef(i);useEffect(()=>{k.current=i;},[i]),useEffect(()=>()=>{for(let d of k.current)d.url&&URL.revokeObjectURL(d.url);},[]);let T=useCallback(()=>{f.current?.();},[]),h=useMemo(()=>({add:c,clear:m,fileInputRef:p,files:i,openFileDialog:T,remove:g}),[i,c,g,m,T]),M=useCallback((d,v)=>{p.current=d.current,f.current=v;},[]),A=useMemo(()=>({__registerFileInput:M,attachments:h,textInput:{clear:a,setInput:r,value:o}}),[o,a,h,M]);return jsx(zt.Provider,{value:A,children:jsx(Et.Provider,{value:h,children:t})})},Io=createContext(null),Ht=()=>{let e=Xa(),o=useContext(Io)??e;if(!o)throw new Error("usePromptInputAttachments must be used within a PromptInput or PromptInputProvider");return o},wo=createContext(null),zl=()=>{let e=useContext(wo);if(!e)throw new Error("usePromptInputReferencedSources must be used within a LocalReferencedSourcesContext.Provider");return e},El=({label:e="Add photos or files",...t})=>{let o=Ht(),r=useCallback(a=>{a.preventDefault(),o.openFileDialog();},[o]);return jsxs(h$1,{...t,onSelect:r,children:[jsx(ImageIcon,{className:"fk:mr-2 fk:size-4"})," ",e]})},Hl=({label:e="Take screenshot",onSelect:t,...o})=>{let r=Ht(),a=useCallback(async i=>{if(t?.(i),!i.defaultPrevented)try{let s=await qa();s&&r.add([s]);}catch(s){if(s instanceof DOMException&&(s.name==="NotAllowedError"||s.name==="AbortError"))return;throw s}},[t,r]);return jsxs(h$1,{...o,onSelect:a,children:[jsx(Monitor,{className:"fk:mr-2 fk:size-4"}),e]})},Gl=({className:e,accept:t,multiple:o,globalDrop:r,syncHiddenInput:a$1,maxFiles:i,maxFileSize:s,onError:p,onSubmit:f,children:c,...g})=>{let m=To(),k=!!m,T=useRef(null),h=useRef(null),[M,A]=useState([]),d=k?m.attachments.files:M,[v,O]=useState([]),D=useRef(d);useEffect(()=>{D.current=d;},[d]);let Ho=useCallback(()=>{T.current?.click();},[]),Be=useCallback(u=>!t||t.trim()===""?true:t.split(",").map(b=>b.trim()).filter(Boolean).some(b=>{if(b.endsWith("/*")){let C=b.slice(0,-1);return u.type.startsWith(C)}return u.type===b}),[t]),Go=useCallback(u=>{let x=Array.from(u),b=x.filter(V=>Be(V));if(x.length&&b.length===0){p?.({code:"accept",message:"No files match the accepted types."});return}let C=V=>s?V.size<=s:true,E=b.filter(C);if(b.length>0&&E.length===0){p?.({code:"max_file_size",message:"All files exceed the maximum size."});return}A(V=>{let L=typeof i=="number"?Math.max(0,i-V.length):void 0,J=typeof L=="number"?E.slice(0,L):E;typeof L=="number"&&E.length>L&&p?.({code:"max_files",message:"Too many files. Some were not added."});let Y=[];for(let Ze of J)Y.push({filename:Ze.name,id:nanoid(),mediaType:Ze.type,type:"file",url:URL.createObjectURL(Ze)});return [...V,...Y]});},[Be,i,s,p]),Oo=useCallback(u=>A(x=>{let b=x.find(C=>C.id===u);return b?.url&&URL.revokeObjectURL(b.url),x.filter(C=>C.id!==u)}),[]),Uo=useCallback(u=>{let x=Array.from(u),b=x.filter(Y=>Be(Y));if(x.length&&b.length===0){p?.({code:"accept",message:"No files match the accepted types."});return}let C=Y=>s?Y.size<=s:true,E=b.filter(C);if(b.length>0&&E.length===0){p?.({code:"max_file_size",message:"All files exceed the maximum size."});return}let V=d.length,L=typeof i=="number"?Math.max(0,i-V):void 0,J=typeof L=="number"?E.slice(0,L):E;typeof L=="number"&&E.length>L&&p?.({code:"max_files",message:"Too many files. Some were not added."}),J.length>0&&m?.attachments.add(J);},[Be,s,i,p,d.length,m]),Ae=useCallback(()=>k?m?.attachments.clear():A(u=>{for(let x of u)x.url&&URL.revokeObjectURL(x.url);return []}),[k,m]),De=useCallback(()=>O([]),[]),j=k?Uo:Go,_t=k?m.attachments.remove:Oo,jt=k?m.attachments.openFileDialog:Ho,Ye=useCallback(()=>{Ae(),De();},[Ae,De]);useEffect(()=>{k&&m.__registerFileInput(T,()=>T.current?.click());},[k,m]),useEffect(()=>{a$1&&T.current&&d.length===0&&(T.current.value="");},[d,a$1]),useEffect(()=>{let u=h.current;if(!u||r)return;let x=C=>{C.dataTransfer?.types?.includes("Files")&&C.preventDefault();},b=C=>{C.dataTransfer?.types?.includes("Files")&&C.preventDefault(),C.dataTransfer?.files&&C.dataTransfer.files.length>0&&j(C.dataTransfer.files);};return u.addEventListener("dragover",x),u.addEventListener("drop",b),()=>{u.removeEventListener("dragover",x),u.removeEventListener("drop",b);}},[j,r]),useEffect(()=>{if(!r)return;let u=b=>{b.dataTransfer?.types?.includes("Files")&&b.preventDefault();},x=b=>{b.dataTransfer?.types?.includes("Files")&&b.preventDefault(),b.dataTransfer?.files&&b.dataTransfer.files.length>0&&j(b.dataTransfer.files);};return document.addEventListener("dragover",u),document.addEventListener("drop",x),()=>{document.removeEventListener("dragover",u),document.removeEventListener("drop",x);}},[j,r]),useEffect(()=>()=>{if(!k)for(let u of D.current)u.url&&URL.revokeObjectURL(u.url);},[k]);let Vo=useCallback(u=>{u.currentTarget.files&&j(u.currentTarget.files),u.currentTarget.value="";},[j]),Fo=useMemo(()=>({add:j,clear:Ae,fileInputRef:T,files:d.map(u=>({...u,id:u.id})),openFileDialog:jt,remove:_t}),[d,j,_t,Ae,jt]),_o=useMemo(()=>({add:u=>{let x=Array.isArray(u)?u:[u];O(b=>[...b,...x.map(C=>({...C,id:nanoid()}))]);},clear:De,remove:u=>{O(x=>x.filter(b=>b.id!==u));},sources:v}),[v,De]),jo=useCallback(async u=>{u.preventDefault();let x=u.currentTarget,b=k?m.textInput.value:new FormData(x).get("message")||"";k||x.reset();try{let C=await Promise.all(d.map(async({id:V,...L})=>{if(L.url?.startsWith("blob:")){let J=await Ka(L.url);return {...L,url:J??L.url}}return L})),E=f({files:C,text:b},u);if(E instanceof Promise)try{await E,Ye(),k&&m.textInput.clear();}catch{}else Ye(),k&&m.textInput.clear();}catch{}},[k,m,d,f,Ye]),Wo=jsxs(Fragment,{children:[jsx("input",{accept:t,"aria-label":"Upload files",className:"fk:hidden",multiple:o,onChange:Vo,ref:T,title:"Upload files",type:"file"}),jsx("form",{className:a("fk:w-full",e),onSubmit:jo,ref:h,...g,children:jsx(Nt,{className:"fk:overflow-hidden",children:c})})]}),$o=jsx(wo.Provider,{value:_o,children:Wo});return jsx(Io.Provider,{value:Fo,children:$o})},Ol=({className:e,...t})=>jsx("div",{className:a("fk:contents",e),...t}),Ul=({onChange:e,onKeyDown:t,className:o,placeholder:r="What would you like to know?",...a$1})=>{let i=To(),s=Ht(),[p,f]=useState(false),c=useCallback(h=>{if(t?.(h),!h.defaultPrevented){if(h.key==="Enter"){if(p||h.nativeEvent.isComposing||h.shiftKey)return;h.preventDefault();let{form:M}=h.currentTarget;if(M?.querySelector('button[type="submit"]')?.disabled)return;M?.requestSubmit();}if(h.key==="Backspace"&&h.currentTarget.value===""&&s.files.length>0){h.preventDefault();let M=s.files[s.files.length-1];M&&s.remove(M.id);}}},[t,p,s]),g=useCallback(h=>{let M=h.clipboardData?.items;if(!M)return;let A=[];for(let d of Array.from(M))if(d.kind==="file"){let v=d.getAsFile();v&&A.push(v);}A.length>0&&(h.preventDefault(),s.add(A));},[s]),m=useCallback(()=>f(false),[]),k=useCallback(()=>f(true),[]),T=i?{onChange:h=>{i.textInput.setInput(h.currentTarget.value),e?.(h);},value:i.textInput.value}:{onChange:e};return jsx(Rt,{className:a("fk:field-sizing-content fk:max-h-48 fk:min-h-16",o),name:"message",onCompositionEnd:m,onCompositionStart:k,onKeyDown:c,onPaste:g,placeholder:r,...a$1,...T})},Vl=({className:e,...t})=>jsx($e,{align:"block-end",className:a("fk:order-first fk:flex-wrap fk:gap-1",e),...t}),Fl=({className:e,...t})=>jsx($e,{align:"block-end",className:a("fk:justify-between fk:gap-1",e),...t}),_l=({className:e,...t})=>jsx("div",{className:a("fk:flex fk:min-w-0 fk:items-center fk:gap-1",e),...t}),Ja=({variant:e$1="ghost",className:t,size:o,tooltip:r,...a$1})=>{let i=o??(Children.count(a$1.children)>1?"sm":"icon-sm"),s=jsx(Ke,{className:a(t),size:i,type:"button",variant:e$1,...a$1});if(!r)return s;let p=typeof r=="string"?r:r.content,f=typeof r=="string"?void 0:r.shortcut,c$1=typeof r=="string"?"top":r.side??"top";return jsxs(b$1,{children:[jsx(c,{asChild:true,children:s}),jsxs(e,{side:c$1,children:[p,f&&jsx("span",{className:"fk:ml-2 fk:text-muted-foreground",children:f})]})]})},jl=e=>jsx(c$3,{...e}),Wl=({className:e,children:t,...o})=>jsx(e$2,{asChild:true,children:jsx(Ja,{className:e,...o,children:t??jsx(PlusIcon,{className:"fk:size-4"})})}),$l=({className:e,...t})=>jsx(f,{align:"start",className:a(e),...t}),Kl=({className:e,...t})=>jsx(h$1,{className:a(e),...t}),ql=({className:e,variant:t="default",size:o="icon-sm",status:r,onStop:a$1,onClick:i,children:s,...p})=>{let f=r==="submitted"||r==="streaming",c=jsx(CornerDownLeftIcon,{className:"fk:size-4"});r==="submitted"?c=jsx(Tt,{}):r==="streaming"?c=jsx(SquareIcon,{className:"fk:size-4"}):r==="error"&&(c=jsx(XIcon,{className:"fk:size-4"}));let g=useCallback(m=>{if(f&&a$1){m.preventDefault(),a$1();return}i?.(m);},[f,a$1,i]);return jsx(Ke,{"aria-label":f?"Stop":"Submit",className:a(e),onClick:g,size:o,type:f&&a$1?"button":"submit",variant:t,...p,children:s??c})},Xl=e=>jsx(a$4,{...e}),Jl=({className:e,...t})=>jsx(d,{className:a("fk:border-none fk:bg-transparent fk:font-medium fk:text-muted-foreground fk:shadow-none fk:transition-colors","fk:hover:bg-accent fk:hover:text-foreground fk:aria-expanded:bg-accent fk:aria-expanded:text-foreground",e),...t}),Yl=({className:e,...t})=>jsx(e$1,{className:a(e),...t}),Zl=({className:e,...t})=>jsx(g$1,{className:a(e),...t}),Ql=({className:e,...t})=>jsx(c$1,{className:a(e),...t}),ef=({openDelay:e=0,closeDelay:t=0,...o})=>jsx(Te,{closeDelay:t,openDelay:e,...o}),tf=e=>jsx(Ie,{...e}),of=({align:e="start",...t})=>jsx(we,{align:e,...t}),rf=({className:e,...t})=>jsx("div",{className:a(e),...t}),nf=({className:e,...t})=>jsx("div",{className:a(e),...t}),af=({className:e,...t})=>jsx("h3",{className:a("fk:mb-2 fk:px-3 fk:font-medium fk:text-muted-foreground fk:text-xs",e),...t}),sf=({className:e,...t})=>jsx("div",{className:a("fk:space-y-1",e),...t}),pf=({className:e,...t})=>jsx("div",{className:a("fk:flex fk:items-center fk:gap-2 fk:px-3 fk:py-2 fk:text-xs fk:hover:bg-accent",e),...t}),lf=({className:e,...t})=>jsx(m,{className:a(e),...t}),ff=({className:e,...t})=>jsx(o,{className:a(e),...t}),cf=({className:e,...t})=>jsx(p,{className:a(e),...t}),df=({className:e,...t})=>jsx(q,{className:a(e),...t}),uf=({className:e,...t})=>jsx(r,{className:a(e),...t}),mf=({className:e,...t$1})=>jsx(t,{className:a(e),...t$1}),kf=({className:e,...t})=>jsx(s,{className:a(e),...t});var Mo=new Map,ts=e=>{let t=Mo.get(e);return t||(t=motion.create(e),Mo.set(e,t)),t},os=({children:e,as:t="p",className:o,duration:r=2,spread:a$1=2})=>{let i=ts(t),s=useMemo(()=>(e?.length??0)*a$1,[e,a$1]);return jsx(i,{animate:{backgroundPosition:"0% center"},className:a("fk:relative fk:inline-block fk:bg-[length:250%_100%,auto] fk:bg-clip-text fk:text-transparent","fk:[--bg:linear-gradient(90deg,#0000_calc(50%-var(--spread)),var(--color-background),#0000_calc(50%+var(--spread)))] fk:[background-repeat:no-repeat,padding-box]",o),initial:{backgroundPosition:"100% center"},style:{"--spread":`${s}px`,backgroundImage:"var(--bg), linear-gradient(var(--color-muted-foreground), var(--color-muted-foreground))"},transition:{duration:r,ease:"linear",repeat:Number.POSITIVE_INFINITY},children:e})},Gt=memo(os);var Lo=createContext(null),gs=()=>{let e=useContext(Lo);if(!e)throw new Error("Reasoning components must be used within Reasoning");return e},bs=1e3,hs=1e3,vs=memo(({className:e,isStreaming:t=false,open:o,defaultOpen:r,onOpenChange:a$1,duration:i$1,children:s,...p})=>{let f=r??t,c=r===false,[g,m]=useControllableState({defaultProp:f,onChange:a$1,prop:o}),[k,T]=useControllableState({defaultProp:void 0,prop:i$1}),h=useRef(t),[M,A]=useState(false),d=useRef(null);useEffect(()=>{t?(h.current=true,d.current===null&&(d.current=Date.now())):d.current!==null&&(T(Math.ceil((Date.now()-d.current)/hs)),d.current=null);},[t,T]),useEffect(()=>{t&&!g&&!c&&m(true);},[t,g,m,c]),useEffect(()=>{if(h.current&&!t&&g&&!M){let D=setTimeout(()=>{m(false),A(true);},bs);return ()=>clearTimeout(D)}},[t,g,m,M]);let v=useCallback(D=>{m(D);},[m]),O=useMemo(()=>({duration:k,isOpen:g,isStreaming:t,setIsOpen:m}),[k,g,t,m]);return jsx(Lo.Provider,{value:O,children:jsx(i,{className:a("fk:not-prose fk:mb-4",e),onOpenChange:v,open:g,...p,children:s})})}),xs=(e,t)=>e||t===0?jsx(Gt,{duration:1,children:"Thinking..."}):t===void 0?jsx("p",{children:"Thought for a few seconds"}):jsxs("p",{children:["Thought for ",t," seconds"]}),Ps=memo(({className:e,children:t,getThinkingMessage:o=xs,...r})=>{let{isStreaming:a$1,isOpen:i,duration:s}=gs();return jsx(j,{className:a("fk:flex fk:w-full fk:items-center fk:gap-2 fk:text-muted-foreground fk:text-sm fk:transition-colors fk:hover:text-foreground",e),...r,children:t??jsxs(Fragment,{children:[jsx(BrainIcon,{className:"fk:size-4"}),o(a$1,s),jsx(ChevronDownIcon,{className:a("fk:size-4 fk:transition-transform",i?"fk:rotate-180":"fk:rotate-0")})]})})}),Cs={cjk:cjk,code:code,math:math,mermaid:mermaid},ys=memo(({className:e,children:t,...o})=>jsx(k,{className:a("fk:mt-4 fk:text-sm","fk:data-[state=closed]:fade-out-0 fk:data-[state=closed]:slide-out-to-top-2 fk:data-[state=open]:slide-in-from-top-2 fk:text-muted-foreground fk:outline-none fk:data-[state=closed]:animate-out fk:data-[state=open]:animate-in",e),...o,children:jsx(Streamdown,{plugins:Cs,children:t})}));vs.displayName="Reasoning";Ps.displayName="ReasoningTrigger";ys.displayName="ReasoningContent";var Of=({className:e,...t})=>jsx(i,{className:a("fk:not-prose fk:mb-4 fk:text-primary fk:text-xs",e),...t}),Uf=({className:e,count:t,children:o,...r})=>jsx(j,{className:a("fk:flex fk:items-center fk:gap-2",e),...r,children:o??jsxs(Fragment,{children:[jsxs("p",{className:"fk:font-medium",children:["Used ",t," sources"]}),jsx(ChevronDownIcon,{className:"fk:h-4 fk:w-4"})]})}),Vf=({className:e,...t})=>jsx(k,{className:a("fk:mt-3 fk:flex fk:w-fit fk:flex-col fk:gap-2","fk:data-[state=closed]:fade-out-0 fk:data-[state=closed]:slide-out-to-top-2 fk:data-[state=open]:slide-in-from-top-2 fk:outline-none fk:data-[state=closed]:animate-out fk:data-[state=open]:animate-in",e),...t}),Ff=({href:e,title:t,children:o,...r})=>jsx("a",{className:"fk:flex fk:items-center fk:gap-2",href:e,rel:"noreferrer",target:"_blank",...r,children:o??jsxs(Fragment,{children:[jsx(BookIcon,{className:"fk:h-4 fk:w-4"}),jsx("span",{className:"fk:block fk:font-medium",children:t})]})});var Xf=({className:e,children:t,...o})=>jsxs(v,{className:"fk:w-full fk:overflow-x-auto fk:whitespace-nowrap",...o,children:[jsx("div",{className:a("fk:flex fk:w-max fk:flex-nowrap fk:items-center fk:gap-2",e),children:t}),jsx(w,{className:"fk:hidden",orientation:"horizontal"})]}),Jf=({suggestion:e,onClick:t,className:o,variant:r="outline",size:a$1="sm",children:i,...s})=>{let p=useCallback(()=>{t?.(e);},[t,e]);return jsx(b,{className:a("fk:cursor-pointer fk:rounded-full fk:px-4",o),onClick:p,size:a$1,type:"button",variant:r,...s,children:i||e})};var ac=({className:e,...t})=>jsx(i,{className:a("fk:group fk:not-prose fk:mb-4 fk:w-full fk:rounded-md fk:border",e),...t}),As={"approval-requested":"Awaiting Approval","approval-responded":"Responded","input-available":"Running","input-streaming":"Pending","output-available":"Completed","output-denied":"Denied","output-error":"Error"},Ds={"approval-requested":jsx(ClockIcon,{className:"fk:size-4 fk:text-yellow-600"}),"approval-responded":jsx(CheckCircleIcon,{className:"fk:size-4 fk:text-blue-600"}),"input-available":jsx(ClockIcon,{className:"fk:size-4 fk:animate-pulse"}),"input-streaming":jsx(CircleIcon,{className:"fk:size-4"}),"output-available":jsx(CheckCircleIcon,{className:"fk:size-4 fk:text-green-600"}),"output-denied":jsx(XCircleIcon,{className:"fk:size-4 fk:text-orange-600"}),"output-error":jsx(XCircleIcon,{className:"fk:size-4 fk:text-red-600"})},zs=e=>jsxs(b$2,{className:"fk:gap-1.5 fk:py-px fk:rounded-full fk:text-xs",variant:"secondary",children:[Ds[e],As[e]]}),sc=({className:e,title:t,type:o,state:r,toolName:a$1,...i})=>{let s=o==="dynamic-tool"?a$1:o.split("-").slice(1).join("-");return jsxs(j,{className:a("fk:flex fk:w-full fk:items-center fk:justify-between fk:gap-4 fk:px-3 fk:py-2",e),...i,children:[jsxs("div",{className:"fk:flex fk:items-center fk:gap-2",children:[jsx(WrenchIcon,{className:"fk:size-4 fk:text-muted-foreground"}),jsx("span",{className:"fk:font-medium fk:text-sm",children:t??s}),zs(r)]}),jsx(ChevronDownIcon,{className:"fk:size-4 fk:text-muted-foreground fk:transition-transform fk:group-data-[state=open]:rotate-180"})]})},ic=({className:e,...t})=>jsx(k,{className:a("fk:data-[state=closed]:fade-out-0 fk:data-[state=closed]:slide-out-to-top-2 fk:data-[state=open]:slide-in-from-top-2 fk:space-y-4 fk:p-4 fk:text-popover-foreground fk:outline-none fk:data-[state=closed]:animate-out fk:data-[state=open]:animate-in",e),...t}),pc=({className:e,input:t,...o})=>jsxs("div",{className:a("fk:space-y-2 fk:overflow-hidden",e),...o,children:[jsx("h4",{className:"fk:font-medium fk:text-muted-foreground fk:text-xs fk:uppercase fk:tracking-wide",children:"Parameters"}),jsx("div",{className:"fk:rounded-md fk:bg-muted/50",children:jsx(qe,{code:JSON.stringify(t,null,2),language:"json"})})]}),lc=({className:e,output:t,errorText:o,...r})=>{if(!(t||o))return null;let a$1=jsx("div",{children:t});return typeof t=="object"&&!isValidElement(t)?a$1=jsx(qe,{code:JSON.stringify(t,null,2),language:"json"}):typeof t=="string"&&(a$1=jsx(qe,{code:t,language:"json"})),jsxs("div",{className:a("fk:space-y-2",e),...r,children:[jsx("h4",{className:"fk:font-medium fk:text-muted-foreground fk:text-xs fk:uppercase fk:tracking-wide",children:o?"Error":"Result"}),jsxs("div",{className:a("fk:overflow-x-auto fk:rounded-md fk:text-xs fk:[&_table]:w-full",o?"fk:bg-destructive/10 fk:text-destructive":"fk:bg-muted/50 fk:text-foreground"),children:[o&&jsx("div",{children:o}),a$1]})]})};
|
|
6
|
+
export{$i as Attachment,Qi as AttachmentEmpty,Ji as AttachmentHoverCard,Zi as AttachmentHoverCardContent,Yi as AttachmentHoverCardTrigger,qi as AttachmentInfo,Ki as AttachmentPreview,Xi as AttachmentRemove,Wi as Attachments,It as ButtonGroup,Hn as ButtonGroupSeparator,wt as ButtonGroupText,qe as CodeBlock,cp as CodeBlockActions,ba as CodeBlockContainer,ha as CodeBlockContent,dp as CodeBlockCopyButton,fp as CodeBlockFilename,pp as CodeBlockHeader,up as CodeBlockLanguageSelector,gp as CodeBlockLanguageSelectorContent,bp as CodeBlockLanguageSelectorItem,mp as CodeBlockLanguageSelectorTrigger,kp as CodeBlockLanguageSelectorValue,lp as CodeBlockTitle,Tp as Conversation,Ip as ConversationContent,Np as ConversationDownload,wp as ConversationEmptyState,Mp as ConversationScrollButton,Yr as ExternalLink,Te as HoverCard,we as HoverCardContent,Ie as HoverCardTrigger,Nt as InputGroup,$e as InputGroupAddon,Ke as InputGroupButton,Vn as InputGroupInput,Un as InputGroupText,Rt as InputGroupTextarea,wo as LocalReferencedSourcesContext,_p as Message,$p as MessageAction,Wp as MessageActions,Kp as MessageBranch,qp as MessageBranchContent,Yp as MessageBranchNext,Zp as MessageBranchPage,Jp as MessageBranchPrevious,Xp as MessageBranchSelector,jp as MessageContent,Ga as MessageResponse,Qp as MessageToolbar,al as ModelSelector,il as ModelSelectorContent,pl as ModelSelectorDialog,cl as ModelSelectorEmpty,dl as ModelSelectorGroup,ll as ModelSelectorInput,ul as ModelSelectorItem,fl as ModelSelectorList,gl as ModelSelectorLogo,bl as ModelSelectorLogoGroup,hl as ModelSelectorName,kl as ModelSelectorSeparator,ml as ModelSelectorShortcut,sl as ModelSelectorTrigger,Gl as PromptInput,El as PromptInputActionAddAttachments,Hl as PromptInputActionAddScreenshot,jl as PromptInputActionMenu,$l as PromptInputActionMenuContent,Kl as PromptInputActionMenuItem,Wl as PromptInputActionMenuTrigger,Ol as PromptInputBody,Ja as PromptInputButton,lf as PromptInputCommand,df as PromptInputCommandEmpty,uf as PromptInputCommandGroup,ff as PromptInputCommandInput,mf as PromptInputCommandItem,cf as PromptInputCommandList,kf as PromptInputCommandSeparator,Fl as PromptInputFooter,Vl as PromptInputHeader,ef as PromptInputHoverCard,of as PromptInputHoverCardContent,tf as PromptInputHoverCardTrigger,Dl as PromptInputProvider,Xl as PromptInputSelect,Yl as PromptInputSelectContent,Zl as PromptInputSelectItem,Jl as PromptInputSelectTrigger,Ql as PromptInputSelectValue,ql as PromptInputSubmit,nf as PromptInputTab,sf as PromptInputTabBody,pf as PromptInputTabItem,af as PromptInputTabLabel,rf as PromptInputTabsList,Ul as PromptInputTextarea,_l as PromptInputTools,vs as Reasoning,ys as ReasoningContent,Ps as ReasoningTrigger,on as ResizableHandle,tn as ResizablePanel,en as ResizablePanelGroup,kt as Sheet,an as SheetClose,gt as SheetContent,vt as SheetDescription,sn as SheetFooter,bt as SheetHeader,Kt as SheetOverlay,$t as SheetPortal,ht as SheetTitle,nn as SheetTrigger,Gt as Shimmer,In as Sidebar,yt as SidebarContent,Ee as SidebarGroup,vn as SidebarGroupContent,St as SidebarGroupLabel,hn as SidebarInset,He as SidebarMenu,Oe as SidebarMenuButton,Ge as SidebarMenuItem,Pt as SidebarPanel,gn as SidebarProvider,Ct as SidebarRail,bn as SidebarTrigger,Ff as Source,Of as Sources,Vf as SourcesContent,Uf as SourcesTrigger,Tt as Spinner,Jf as Suggestion,Xf as Suggestions,Mn as Tabs,Bn as TabsContent,Rn as TabsList,Ln as TabsTrigger,ac as Tool,ic as ToolContent,sc as ToolHeader,pc as ToolInput,lc as ToolOutput,eo as buttonGroupVariants,Yn as getAttachmentLabel,ao as getMediaCategory,zs as getStatusBadge,co as highlightCode,Sa as messagesToMarkdown,Lt as useAttachmentContext,Qn as useAttachmentsContext,Ht as usePromptInputAttachments,Bl as usePromptInputController,zl as usePromptInputReferencedSources,Al as useProviderAttachments,gs as useReasoning,ye as useSidebar};//# sourceMappingURL=ui.js.map
|
|
2
7
|
//# sourceMappingURL=ui.js.map
|