@alquimia-ai/ui 2.2.4 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/runner/work/sdk-frontend/sdk-frontend/packages/ui/dist/components/genui/index.mjs","../../../src/components/genui/renderer.tsx","../../../src/components/genui/components/layout.tsx","../../../src/lib/utils.ts","../../../src/components/genui/style-props.ts","../../../src/components/atoms/ui/card.tsx","../../../src/components/atoms/ui/separator.tsx","../../../src/components/atoms/ui/tabs.tsx","../../../src/components/atoms/ui/accordion.tsx","../../../src/components/genui/components/content.tsx","../../../src/components/atoms/ui/alert.tsx","../../../src/components/atoms/ui/badge.tsx","../../../src/components/atoms/ui/avatar.tsx","../../../src/components/atoms/ui/rich-text.tsx","../../../src/components/genui/components/inputs.tsx","../../../src/components/atoms/ui/input.tsx","../../../src/components/atoms/ui/textarea.tsx","../../../src/components/atoms/ui/label.tsx","../../../src/components/atoms/ui/checkbox.tsx","../../../src/components/atoms/ui/switch.tsx","../../../src/components/atoms/ui/slider.tsx","../../../src/components/atoms/ui/button.tsx","../../../src/components/atoms/ui/calendar.tsx","../../../src/components/atoms/ui/radio-group.tsx","../../../src/components/atoms/ui/popover.tsx","../../../src/components/atoms/ui/select.tsx","../../../src/components/atoms/ui/command.tsx","../../../src/components/atoms/ui/dialog.tsx","../../../src/components/genui/components/data.tsx","../../../src/components/atoms/ui/table.tsx","../../../src/components/atoms/ui/progress.tsx","../../../src/components/atoms/ui/chart.tsx","../../../src/components/genui/components/actions.tsx","../../../src/components/genui/registry.tsx","../../../src/components/genui/assistant-chat.tsx","../../../src/components/organisms/assistant.tsx","../../../src/components/atoms/ui/scroll-area.tsx","../../../src/components/atoms/ui/skeleton.tsx","../../../src/components/atoms/ui/drawer.tsx","../../../src/components/atoms/ui/typography/index.tsx","../../../src/components/atoms/ui/toggle.tsx","../../../src/components/atoms/ui/aspect-ratio.tsx","../../../src/components/atoms/ui/breadcrumb.tsx","../../../src/components/molecules/alert-dialog.tsx","../../../src/components/atoms/ui/toast.tsx","../../../src/components/atoms/ui/loader.tsx","../../../src/components/hooks/use-toast.ts","../../../src/components/atoms/ui/toaster.tsx","../../../src/components/atoms/ui/think-indicator.tsx","../../../src/components/molecules/page-container.tsx","../../../src/components/molecules/assistant-button.tsx","../../../src/components/molecules/carousel.tsx","../../../src/components/molecules/navigation-menu.tsx","../../../src/components/molecules/sidebar.tsx","../../../src/components/molecules/sonner.tsx","../../../src/providers/theme-context.ts","../../../src/components/molecules/rating-stars.tsx","../../../src/components/molecules/rating-thumbs.tsx","../../../src/components/molecules/rating-comment.tsx","../../../src/components/molecules/call-out.tsx","../../../src/components/hooks/use-text-streaming.ts"],"names":["React","getPointer","setPointer","classifyAction","resolveDynamic","isPathRef","Fragment","jsx","jsxs","A2uiRenderer","surface","registry","onAgentAction","onLocalAction","useState","dataModel","model","setModel","useEffect","surfaceId","byId","useMemo","m","Map","components","c","set","id","emitAction","node","action","kind","ui","componentId","name","payload","renderNode","seen","has","get","nextSeen","Set","add","childIds","children","child","map","cid","Comp","component","className","boundPath","binding","value","path","onChange","v","onAction","a","length","rootId","root","clsx","twMerge","cn","inputs","hasToolResult","data","tool_output","result","Object","keys","getErrorMessage","error_code","TONE","default","muted","primary","success","warning","danger","SIZE","sm","md","lg","ALIGN","start","center","end","DENSITY","compact","comfortable","styleProps","tone","size","align","density","emphasis","Card","React2","forwardRef","ref","props","displayName","CardHeader","CardTitle","CardDescription","CardContent","CardFooter","SeparatorPrimitive","Separator","React3","orientation","decorative","Root","TabsPrimitive","Tabs","TabsList","React4","List","TabsTrigger","Trigger","TabsContent","Content","AccordionPrimitive","ChevronDown","Accordion","AccordionItem","React5","Item","AccordionTrigger","Header","AccordionContent","gapClass","g","Stack","direction","gap","Row","wrap","Column","Grid","cols","columns","Math","min","max","colClass","Divider","label","Spacer","h","CardNode","variant","title","description","TabsNode","tabs","Array","isArray","kids","React6","Children","toArray","defaultValue","t","i","AccordionNode","items","type","collapsible","it","icons","cva","alertVariants","variants","destructive","defaultVariants","Alert","React7","role","AlertTitle","AlertDescription","badgeVariants","secondary","outline","Badge","AvatarPrimitive","Avatar","React8","AvatarImage","Image","AvatarFallback","Fallback","ReactMarkdown","remarkGfm","RichText","content","remarkPlugins","SAFE_IMG","Text","String","text","Heading","level","Tag","Markdown","ImageNode","src","test","alt","IconNode","Cmp","BADGE_VARIANT","solid","subtle","BadgeNode","AvatarNode","fallback","slice","toUpperCase","ALERT_VARIANT","info","AlertNode","Stat","delta","KeyValueNode","obj","entries","k","React9","ListNode","ordered","Quote","cite","format","Star","Input","Textarea","React10","LabelPrimitive","labelVariants","Label","React11","CheckboxPrimitive","Check","Checkbox","React12","Indicator","SwitchPrimitives","Switch","React13","Thumb","SliderPrimitive","Slider","React14","Track","Range","Slot","buttonVariants","ghost","link","icon","Button","React15","asChild","ChevronLeft","ChevronRight","DayPicker","Calendar","classNames","showOutsideDays","months","month","caption","caption_label","nav","nav_button","nav_button_previous","nav_button_next","table","head_row","head_cell","row","cell","day","day_range_end","day_selected","day_today","day_outside","day_disabled","day_range_middle","day_hidden","IconLeft","IconRight","RadioGroupPrimitive","Circle","RadioGroup","React16","RadioGroupItem","PopoverPrimitive","Popover","PopoverTrigger","PopoverContent","React17","sideOffset","Portal","SelectPrimitive","ChevronUp","Select","SelectValue","Value","SelectTrigger","React18","Icon","SelectScrollUpButton","ScrollUpButton","SelectScrollDownButton","ScrollDownButton","SelectContent","position","Viewport","SelectLabel","SelectItem","ItemIndicator","ItemText","SelectSeparator","Command","CommandPrimitive","Search","DialogPrimitive","X","Dialog","DialogTrigger","DialogPortal","DialogOverlay","React19","Overlay","DialogContent","Close","DialogHeader","DialogFooter","DialogTitle","Title","DialogDescription","Description","React20","CommandInput","CommandList","CommandEmpty","Empty","CommandGroup","Group","CommandSeparator","CommandItem","CommandShortcut","opts","options","o","toDate","d","Date","isNaN","getTime","Field","htmlFor","TextField","placeholder","e","target","TextArea","rows","NumberField","step","Number","SelectNode","onValueChange","MultiSelect","selected","toggle","includes","filter","x","checked","onCheckedChange","Combobox","React21","open","setOpen","find","onOpenChange","onSelect","CheckboxNode","CheckboxGroup","Radio","match","SwitchNode","SliderNode","vals","DatePicker","mode","toISOString","DateRange","parsed","from","to","r","FileUpload","accept","multiple","files","f","Rating","current","_","n","onClick","useReactTable","getCoreRowModel","getSortedRowModel","flexRender","BarChart","Bar","LineChart","Line","AreaChart","Area","PieChart","Pie","Cell","Tooltip","Legend","Table","React22","TableHeader","TableBody","TableFooter","TableRow","TableHead","TableCell","TableCaption","ProgressPrimitive","Progress","React23","style","transform","ResponsiveContainer","CartesianGrid","XAxis","YAxis","CHART_PALETTE","Chart","height","width","themedChartAxes","strokeDasharray","dataKey","PALETTE","TableNode","key","header","some","sortable","React24","sorting","setSorting","accessorKey","accessorFn","state","onSortingChange","enableSorting","getHeaderGroups","hg","headers","column","toggleSorting","wantResponse","columnDef","getContext","getRowModel","getVisibleCells","getValue","ChartNode","series","s","first","axes","stroke","fill","fillOpacity","nameKey","pct","round","Timeline","timestamp","BUTTON_VARIANT","BUTTON_SIZE","ButtonNode","ButtonGroup","SAFE_HREF","LinkNode","href","rel","coreUiRegistry","KeyValue","Link","useCallback","useRef","ScrollAreaPrimitive","ScrollArea","React25","ScrollBar","Corner","ScrollAreaScrollbar","ScrollAreaThumb","Drawer","DrawerPrimitive","shouldScaleBackground","DrawerTrigger","DrawerPortal","DrawerClose","DrawerOverlay","React26","DrawerContent","DrawerHeader","DrawerFooter","DrawerTitle","DrawerDescription","Typography","Component","as","typeStyle","TogglePrimitive","toggleVariants","Toggle","React27","AspectRatioPrimitive","MoreHorizontal","Breadcrumb","React28","BreadcrumbList","BreadcrumbItem","BreadcrumbLink","BreadcrumbPage","BreadcrumbSeparator","BreadcrumbEllipsis","AlertDialogPrimitive","AlertDialogPortal","AlertDialogOverlay","React29","AlertDialogContent","AlertDialogHeader","AlertDialogFooter","AlertDialogTitle","AlertDialogDescription","AlertDialogAction","Action","AlertDialogCancel","Cancel","ToastPrimitives","ToastViewport","React30","toastVariants","Toast","ToastAction","ToastClose","ToastTitle","ToastDescription","Loader2","loaderVariants","small","medium","large","xl","colorVariant","Loader","React31","thinkIndicatorVariants","ThinkIndicator","React33","thoughts","interval","loader","currentThoughtIndex","setCurrentThoughtIndex","isAnimating","setIsAnimating","timer","setInterval","setTimeout","prev","clearInterval","PageContainer","AssistantSuggestions","React34","suggestions","showSuggestions","suggestion","index","transitionDelay","AssistantButton","clickAction","isVisible","setIsVisible","setShowSuggestions","handleMouseEnter","requestAnimationFrame","handleMouseLeave","onMouseEnter","onMouseLeave","useEmblaCarousel","ArrowLeft","ArrowRight","CarouselContext","React35","createContext","useCarousel","context","useContext","Error","Carousel","setApi","plugins","axis","carouselRef","api","canScrollPrev","setCanScrollPrev","canScrollNext","setCanScrollNext","scrollPrev","scrollNext","handleKeyDown","event","preventDefault","on","off","Provider","onKeyDownCapture","CarouselContent","CarouselItem","CarouselPrevious","disabled","CarouselNext","NavigationMenuPrimitive","NavigationMenu","React36","NavigationMenuViewport","NavigationMenuList","navigationMenuTriggerStyle","NavigationMenuTrigger","NavigationMenuContent","NavigationMenuIndicator","sidebarVariants","SidebarFooter","React37","Sidebar","selectedSection","footerContent","selectedVariant","defaultVariant","buttonClassName","item","Toaster","Sonner","ThemeContext","theme","setTheme","TooltipPrimitive","TooltipProvider","TooltipTrigger","TooltipContent","React38","StarRating","rating","onRate","star","RatingStars","currentRating","isLoading","animate","setAnimate","handleRate","clearTimeout","hasRated","side","ThumbsUp","ThumbsDown","RatingThumbs","React39","Book","RatingComment","React40","comment","setComment","CHAR_DELAY","PUNCTUATION_DELAY","useTextStreaming","shouldStream","handleIsTextStreaming","displayedText","setDisplayedText","contentRef","indexRef","timerRef","hasStartedStreaming","typeNext","nextChar","charAt","delay","CallOut","React41","CallOutDate","CallOutActions","actions","message","setIsLoading","isClicked","setIsClicked","custom","then","CallOutResponse","additionalInfo","toggleAdditionalInfo","isStreaming","isAdditionalInfoOpen","setIsAdditionalInfoOpen","displayedContent","showAsToggle","showInline","Send","Assistant","React42","sdk","AssistantHeader","AssistantTitle","AssistantDescription","AssistantMessageArea","messages","messagesEndRef","streamingMessageId","thinkIndicator","toolFactory","showDetailedErrors","interleave","awaitingUser","isMessageStreaming","_isMessageStreaming","scrollIntoView","behavior","error_detail","taskid","tooler","tool","createTool","tool_summary","control_id","created_at","toLocaleString","hour","minute","hour12","AssistantInput","sendMessageFunc","isButtonDisabled","input","handleInputChange","speechToTextComponent","userToolboxComponent","placeholders","onFileDrop","attachmentsSlot","isDragging","setIsDragging","dragCounterRef","handleDragEnter","stopPropagation","dataTransfer","types","handleDragOver","handleDragLeave","handleDrop","onSubmit","onDragEnter","onDragOver","onDragLeave","onDrop","onKeyDown","shiftKey","TypingDots","animationDelay","animationDuration","AssistantChat","alquimia","conversationId","endRef","React43","handleSubmit","handleLoadingCancel","genui","surfaces","isBusy","hasContent","trim","isEmpty","renderSurface","submitted","dismissedWith","controlId","byCount","arr","afterCount","push","afterIndex","nodes","unshift","dismiss"],"mappings":"AAAA,oCAAoC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACApC,YAAYA,WAAW,QAAA;AAEvB,SAASC,UAAA,EAAYC,UAAA,EAAYC,cAAA,EAAgBC,cAAA,EAAgBC,SAAA,QAAiB,2BAAA;AA8C5E,SAqCGC,YAAAA,SAAAA,EArCHC,GAAA,EAOEC,IAAA,QAPF,oBAAA;AApC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AACxD;gBAC7BoB,OAAAA;gBACAC,mBAAAA;gBACApB,oBAAoB,CAAC,CAACA;gBACtBuB,cAAc;oBAAClZ;oBAAaA;iBAAW;YAAA;SACzC;IAAA;AAGN;AlCi1GA,SACEtW,YAAY,EACZ+wB,aAAa,EACbjS,cAAc,GACd","sourcesContent":["// src/components/genui/renderer.tsx\nimport * as React from \"react\";\nimport { getPointer, setPointer, classifyAction, resolveDynamic, isPathRef } from \"@alquimia-ai/tools/genui\";\nimport { Fragment as Fragment2, jsx, jsxs } from \"react/jsx-runtime\";\nfunction A2uiRenderer({ surface, registry, onAgentAction, onLocalAction }) {\n const [model, setModel] = React.useState(surface.dataModel ?? {});\n React.useEffect(() => {\n setModel(surface.dataModel ?? {});\n }, [surface.surfaceId]);\n const byId = React.useMemo(() => {\n const m = /* @__PURE__ */ new Map();\n for (const c of surface.components) m.set(c.id, c);\n return m;\n }, [surface]);\n const emitAction = (node, action) => {\n const kind = classifyAction(action);\n const ui = {\n surfaceId: surface.surfaceId,\n componentId: node.id,\n action: action.name,\n kind,\n payload: kind === \"agent-bound\" ? model : void 0\n };\n if (kind === \"agent-bound\") onAgentAction(ui);\n else onLocalAction?.(ui);\n };\n const renderNode = (id, seen) => {\n if (seen.has(id)) return null;\n const node = byId.get(id);\n if (!node) return null;\n const nextSeen = new Set(seen).add(id);\n const childIds = node.children ?? (node.child ? [node.child] : []);\n const children = childIds.map((cid) => /* @__PURE__ */ jsx(React.Fragment, { children: renderNode(cid, nextSeen) }, cid));\n const Comp = registry[node.component];\n if (!Comp) {\n return /* @__PURE__ */ jsxs(\"p\", { className: \"text-muted-foreground text-sm\", \"data-a2ui-fallback\": node.component, children: [\n \"[unsupported component: \",\n node.component,\n \"]\"\n ] });\n }\n const boundPath = node.binding ?? (isPathRef(node.value) ? node.value.path : void 0);\n const value = boundPath !== void 0 ? getPointer(model, boundPath) : node.value !== void 0 ? resolveDynamic(node.value, model) : void 0;\n const onChange = boundPath !== void 0 ? (v) => setModel((m) => setPointer(m, boundPath, v)) : void 0;\n const onAction = node.action ? (a) => emitAction(node, a) : void 0;\n return /* @__PURE__ */ jsx(Comp, { node, value, onChange, onAction, children: children.length ? children : void 0 });\n };\n const rootId = byId.has(\"root\") ? \"root\" : surface.root;\n if (!rootId) return null;\n return /* @__PURE__ */ jsx(Fragment2, { children: renderNode(rootId, /* @__PURE__ */ new Set()) });\n}\n\n// src/components/genui/components/layout.tsx\nimport * as React6 from \"react\";\n\n// src/lib/utils.ts\nimport { clsx } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\nfunction cn(...inputs) {\n return twMerge(clsx(inputs));\n}\nfunction hasToolResult(data) {\n return data?.tool_output?.result && Object.keys(data.tool_output.result).length > 0;\n}\nfunction getErrorMessage(error_code) {\n switch (error_code) {\n case \"STREAM_ERROR\":\n return \"Connection lost. Please try again.\";\n case \"REQUEST_ERROR\":\n return \"There was a problem with your request. Please try again.\";\n case \"401\":\n case \"403\":\n return \"You are not authorized. Please try again.\";\n case \"404\":\n return \"Resource not found.\";\n case \"500\":\n return \"Server error. Please try again later.\";\n default:\n return \"We have an internal error, please try again later.\";\n }\n}\n\n// src/components/genui/style-props.ts\nvar TONE = {\n default: \"text-foreground\",\n muted: \"text-muted-foreground\",\n primary: \"text-primary\",\n success: \"text-emerald-600 dark:text-emerald-400\",\n warning: \"text-amber-600 dark:text-amber-400\",\n danger: \"text-destructive\"\n};\nvar SIZE = { sm: \"text-sm\", md: \"text-base\", lg: \"text-lg\" };\nvar ALIGN = { start: \"text-left\", center: \"text-center\", end: \"text-right\" };\nvar DENSITY = { compact: \"gap-2\", comfortable: \"gap-4\" };\nfunction styleProps(node) {\n return cn(\n typeof node.tone === \"string\" ? TONE[node.tone] : void 0,\n typeof node.size === \"string\" ? SIZE[node.size] : void 0,\n typeof node.align === \"string\" ? ALIGN[node.align] : void 0,\n typeof node.density === \"string\" ? DENSITY[node.density] : void 0,\n node.emphasis === \"high\" ? \"font-semibold\" : node.emphasis === \"medium\" ? \"font-medium\" : void 0\n );\n}\n\n// src/components/atoms/ui/card.tsx\nimport * as React2 from \"react\";\nimport { jsx as jsx2 } from \"react/jsx-runtime\";\nvar Card = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx2(\n \"div\",\n {\n ref,\n className: cn(\n \"rounded-lg\",\n \" border\",\n \"bg-card\",\n \"text-card-foreground\",\n \"shadow-raised\",\n className\n ),\n ...props\n }\n));\nCard.displayName = \"Card\";\nvar CardHeader = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx2(\n \"div\",\n {\n ref,\n className: cn(\"flex flex-col space-y-1.5 p-6\", className),\n ...props\n }\n));\nCardHeader.displayName = \"CardHeader\";\nvar CardTitle = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx2(\n \"h3\",\n {\n ref,\n className: cn(\"alq--typography-heading4\", className),\n ...props\n }\n));\nCardTitle.displayName = \"CardTitle\";\nvar CardDescription = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx2(\n \"p\",\n {\n ref,\n className: cn(\"text-sm text-muted-foreground\", className),\n ...props\n }\n));\nCardDescription.displayName = \"CardDescription\";\nvar CardContent = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx2(\"div\", { ref, className: cn(\"p-6 pt-0\", className), ...props }));\nCardContent.displayName = \"CardContent\";\nvar CardFooter = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx2(\n \"div\",\n {\n ref,\n className: cn(\"flex items-center p-6 pt-0\", className),\n ...props\n }\n));\nCardFooter.displayName = \"CardFooter\";\n\n// src/components/atoms/ui/separator.tsx\nimport * as React3 from \"react\";\nimport * as SeparatorPrimitive from \"@radix-ui/react-separator\";\nimport { jsx as jsx3 } from \"react/jsx-runtime\";\nvar Separator = React3.forwardRef(({ className, orientation = \"horizontal\", decorative = true, ...props }, ref) => /* @__PURE__ */ jsx3(\n SeparatorPrimitive.Root,\n {\n ref,\n decorative,\n orientation,\n className: cn(\n \"shrink-0 bg-border\",\n orientation === \"horizontal\" ? \"h-[1px] w-full\" : \"h-full w-[1px]\",\n className,\n \"alq--separator\"\n ),\n ...props\n }\n));\nSeparator.displayName = SeparatorPrimitive.Root.displayName;\n\n// src/components/atoms/ui/tabs.tsx\nimport * as React4 from \"react\";\nimport * as TabsPrimitive from \"@radix-ui/react-tabs\";\nimport { jsx as jsx4 } from \"react/jsx-runtime\";\nvar Tabs = TabsPrimitive.Root;\nvar TabsList = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx4(\n TabsPrimitive.List,\n {\n ref,\n className: cn(\n \"inline-flex h-10 items-center justify-center rounded-md p-1 text-muted-foreground\",\n className,\n \"alq--tabs\"\n ),\n ...props\n }\n));\nTabsList.displayName = TabsPrimitive.List.displayName;\nvar TabsTrigger = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx4(\n TabsPrimitive.Trigger,\n {\n ref,\n className: cn(\n \"inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:border-b-2 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:border-b-2 data-[state=active]:text-foreground data-[state=active]:shadow-sm\",\n className\n ),\n ...props\n }\n));\nTabsTrigger.displayName = TabsPrimitive.Trigger.displayName;\nvar TabsContent = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx4(\n TabsPrimitive.Content,\n {\n ref,\n className: cn(\n \"mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2\",\n className\n ),\n ...props\n }\n));\nTabsContent.displayName = TabsPrimitive.Content.displayName;\n\n// src/components/atoms/ui/accordion.tsx\nimport * as React5 from \"react\";\nimport * as AccordionPrimitive from \"@radix-ui/react-accordion\";\nimport { ChevronDown } from \"lucide-react\";\nimport { jsx as jsx5, jsxs as jsxs2 } from \"react/jsx-runtime\";\nvar Accordion = AccordionPrimitive.Root;\nvar AccordionItem = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx5(AccordionPrimitive.Item, { ref, className: cn(\"border-b\", className), ...props }));\nAccordionItem.displayName = \"AccordionItem\";\nvar AccordionTrigger = React5.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsx5(AccordionPrimitive.Header, { className: \"flex\", children: /* @__PURE__ */ jsxs2(\n AccordionPrimitive.Trigger,\n {\n ref,\n className: cn(\n \"flex flex-1 items-center justify-between py-4 text-sm font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180\",\n className\n ),\n ...props,\n children: [\n children,\n /* @__PURE__ */ jsx5(ChevronDown, { className: \"h-4 w-4 shrink-0 text-muted-foreground transition-transform duration-200\" })\n ]\n }\n) }));\nAccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName;\nvar AccordionContent = React5.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsx5(\n AccordionPrimitive.Content,\n {\n ref,\n className: \"overflow-hidden text-sm text-muted-foreground data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down\",\n ...props,\n children: /* @__PURE__ */ jsx5(\"div\", { className: cn(\"pb-4 pt-0\", className), children })\n }\n));\nAccordionContent.displayName = AccordionPrimitive.Content.displayName;\n\n// src/components/genui/components/layout.tsx\nimport { Fragment as Fragment3, jsx as jsx6, jsxs as jsxs3 } from \"react/jsx-runtime\";\nvar gapClass = (g) => g === \"lg\" ? \"gap-6\" : g === \"sm\" ? \"gap-2\" : \"gap-4\";\nvar Stack = ({ node, children }) => /* @__PURE__ */ jsx6(\n \"div\",\n {\n className: cn(\n \"flex\",\n node.direction === \"horizontal\" ? \"flex-row\" : \"flex-col\",\n gapClass(node.gap),\n styleProps(node)\n ),\n children\n }\n);\nvar Row = ({ node, children }) => /* @__PURE__ */ jsx6(\"div\", { className: cn(\"flex flex-row\", node.wrap ? \"flex-wrap\" : \"\", gapClass(node.gap), styleProps(node)), children });\nvar Column = ({ node, children }) => /* @__PURE__ */ jsx6(\"div\", { className: cn(\"flex flex-col\", gapClass(node.gap), styleProps(node)), children });\nvar Grid = ({ node, children }) => {\n const cols = typeof node.columns === \"number\" ? Math.min(Math.max(node.columns, 1), 6) : 2;\n const colClass = [\"\", \"grid-cols-1\", \"grid-cols-2\", \"grid-cols-3\", \"grid-cols-4\", \"grid-cols-5\", \"grid-cols-6\"][cols];\n return /* @__PURE__ */ jsx6(\"div\", { className: cn(\"grid\", colClass, gapClass(node.gap), styleProps(node)), children });\n};\nvar Divider = ({ node }) => typeof node.label === \"string\" ? /* @__PURE__ */ jsxs3(\"div\", { className: \"flex items-center gap-3 text-xs text-muted-foreground\", children: [\n /* @__PURE__ */ jsx6(Separator, { className: \"flex-1\" }),\n /* @__PURE__ */ jsx6(\"span\", { children: node.label }),\n /* @__PURE__ */ jsx6(Separator, { className: \"flex-1\" })\n] }) : /* @__PURE__ */ jsx6(Separator, {});\nvar Spacer = ({ node }) => {\n const h = node.size === \"lg\" ? \"h-8\" : node.size === \"sm\" ? \"h-2\" : \"h-4\";\n return /* @__PURE__ */ jsx6(\"div\", { className: h, \"aria-hidden\": true });\n};\nvar CardNode = ({ node, children }) => {\n const variant = node.variant === \"ghost\" ? \"border-transparent shadow-none bg-transparent\" : node.variant === \"outline\" ? \"shadow-none\" : \"\";\n return /* @__PURE__ */ jsxs3(Card, { className: cn(variant, styleProps(node)), children: [\n (typeof node.title === \"string\" || typeof node.description === \"string\") && /* @__PURE__ */ jsxs3(CardHeader, { children: [\n typeof node.title === \"string\" && /* @__PURE__ */ jsx6(CardTitle, { children: node.title }),\n typeof node.description === \"string\" && /* @__PURE__ */ jsx6(CardDescription, { children: node.description })\n ] }),\n /* @__PURE__ */ jsx6(CardContent, { children })\n ] });\n};\nvar TabsNode = ({ node, children }) => {\n const tabs = Array.isArray(node.tabs) ? node.tabs : [];\n const kids = React6.Children.toArray(children);\n if (!tabs.length) return /* @__PURE__ */ jsx6(Fragment3, { children });\n return /* @__PURE__ */ jsxs3(Tabs, { defaultValue: tabs[0]?.value, className: cn(styleProps(node)), children: [\n /* @__PURE__ */ jsx6(TabsList, { children: tabs.map((t) => /* @__PURE__ */ jsx6(TabsTrigger, { value: t.value, children: t.label }, t.value)) }),\n tabs.map((t, i) => /* @__PURE__ */ jsx6(TabsContent, { value: t.value, children: kids[i] ?? null }, t.value))\n ] });\n};\nvar AccordionNode = ({ node, children }) => {\n const items = Array.isArray(node.items) ? node.items : [];\n const kids = React6.Children.toArray(children);\n if (!items.length) return /* @__PURE__ */ jsx6(\"div\", { className: cn(\"flex flex-col gap-2\", styleProps(node)), children });\n return /* @__PURE__ */ jsx6(\n Accordion,\n {\n type: \"single\",\n collapsible: true,\n className: cn(\"rounded-md border border-border px-4\", styleProps(node)),\n children: items.map((it, i) => /* @__PURE__ */ jsxs3(AccordionItem, { value: it.value, children: [\n /* @__PURE__ */ jsx6(AccordionTrigger, { children: it.title }),\n /* @__PURE__ */ jsx6(AccordionContent, { children: kids[i] ?? null })\n ] }, it.value))\n }\n );\n};\n\n// src/components/genui/components/content.tsx\nimport * as React9 from \"react\";\nimport { icons } from \"lucide-react\";\n\n// src/components/atoms/ui/alert.tsx\nimport * as React7 from \"react\";\nimport { cva } from \"class-variance-authority\";\nimport { jsx as jsx7 } from \"react/jsx-runtime\";\nvar alertVariants = cva(\n \"relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground\",\n {\n variants: {\n variant: {\n default: \"bg-background text-foreground\",\n destructive: \"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive\"\n }\n },\n defaultVariants: {\n variant: \"default\"\n }\n }\n);\nvar Alert = React7.forwardRef(({ className, variant, ...props }, ref) => /* @__PURE__ */ jsx7(\n \"div\",\n {\n ref,\n role: \"alert\",\n className: cn(alertVariants({ variant }), className),\n ...props\n }\n));\nAlert.displayName = \"Alert\";\nvar AlertTitle = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx7(\n \"h5\",\n {\n ref,\n className: cn(\"mb-1 font-medium leading-none tracking-tight\", className),\n ...props\n }\n));\nAlertTitle.displayName = \"AlertTitle\";\nvar AlertDescription = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx7(\n \"div\",\n {\n ref,\n className: cn(\"text-sm [&_p]:leading-relaxed\", className),\n ...props\n }\n));\nAlertDescription.displayName = \"AlertDescription\";\n\n// src/components/atoms/ui/badge.tsx\nimport { cva as cva2 } from \"class-variance-authority\";\nimport { jsx as jsx8 } from \"react/jsx-runtime\";\nvar badgeVariants = cva2(\n \"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2\",\n {\n variants: {\n variant: {\n default: \"border-transparent bg-primary text-primary-foreground hover:bg-primary/80\",\n secondary: \"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80\",\n destructive: \"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80\",\n outline: \"text-foreground\"\n }\n },\n defaultVariants: {\n variant: \"default\"\n }\n }\n);\nfunction Badge({ className, variant, ...props }) {\n return /* @__PURE__ */ jsx8(\"div\", { className: cn(badgeVariants({ variant }), className, \"alq--badge\"), ...props });\n}\n\n// src/components/atoms/ui/avatar.tsx\nimport * as React8 from \"react\";\nimport * as AvatarPrimitive from \"@radix-ui/react-avatar\";\nimport { jsx as jsx9 } from \"react/jsx-runtime\";\nvar Avatar = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx9(\n AvatarPrimitive.Root,\n {\n ref,\n className: cn(\n \"relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full\",\n className\n ),\n ...props\n }\n));\nAvatar.displayName = AvatarPrimitive.Root.displayName;\nvar AvatarImage = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx9(\n AvatarPrimitive.Image,\n {\n ref,\n className: cn(\"aspect-square h-full w-full\", className),\n ...props\n }\n));\nAvatarImage.displayName = AvatarPrimitive.Image.displayName;\nvar AvatarFallback = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx9(\n AvatarPrimitive.Fallback,\n {\n ref,\n className: cn(\n \"flex h-full w-full items-center justify-center rounded-full bg-muted\",\n className\n ),\n ...props\n }\n));\nAvatarFallback.displayName = AvatarPrimitive.Fallback.displayName;\n\n// src/components/atoms/ui/rich-text.tsx\nimport ReactMarkdown from \"react-markdown\";\nimport remarkGfm from \"remark-gfm\";\nimport { jsx as jsx10 } from \"react/jsx-runtime\";\nfunction RichText({ content, className }) {\n return /* @__PURE__ */ jsx10(ReactMarkdown, { className: cn(className), remarkPlugins: [remarkGfm], children: content });\n}\n\n// src/components/genui/components/content.tsx\nimport { jsx as jsx11, jsxs as jsxs4 } from \"react/jsx-runtime\";\nvar SAFE_IMG = /^data:image\\/(png|jpe?g|gif|webp|svg\\+xml);/i;\nvar Text = ({ node }) => {\n const variant = node.variant === \"muted\" || node.variant === \"caption\" ? \"text-muted-foreground\" : \"text-foreground\";\n const size = node.variant === \"lead\" ? \"text-lg\" : node.variant === \"caption\" ? \"text-xs\" : \"\";\n return /* @__PURE__ */ jsx11(\"p\", { className: cn(variant, size, styleProps(node)), children: String(node.text ?? \"\") });\n};\nvar Heading = ({ node }) => {\n const level = typeof node.level === \"number\" ? Math.min(Math.max(node.level, 1), 4) : 1;\n const Tag = [\"h1\", \"h2\", \"h3\", \"h4\"][level - 1];\n const size = [\"text-2xl\", \"text-xl\", \"text-lg\", \"text-base\"][level - 1];\n return /* @__PURE__ */ jsx11(Tag, { className: cn(\"font-semibold text-foreground\", size, styleProps(node)), children: String(node.text ?? \"\") });\n};\nvar Markdown = ({ node }) => /* @__PURE__ */ jsx11(\n RichText,\n {\n content: String(node.text ?? \"\"),\n className: cn(\"prose prose-sm dark:prose-invert max-w-none\", styleProps(node))\n }\n);\nvar ImageNode = ({ node }) => {\n const src = typeof node.src === \"string\" ? node.src : \"\";\n if (!SAFE_IMG.test(src)) return /* @__PURE__ */ jsx11(\"span\", { className: \"text-muted-foreground text-sm\", children: \"[image omitted]\" });\n return /* @__PURE__ */ jsx11(\n \"img\",\n {\n src,\n alt: typeof node.alt === \"string\" ? node.alt : \"\",\n className: cn(\"max-w-full rounded-md\", styleProps(node))\n }\n );\n};\nvar IconNode = ({ node }) => {\n const name = typeof node.name === \"string\" ? node.name : \"\";\n const Cmp = icons[name];\n if (!Cmp) return null;\n return /* @__PURE__ */ jsx11(Cmp, { className: cn(\"h-4 w-4\", styleProps(node)) });\n};\nvar BADGE_VARIANT = {\n solid: \"default\",\n outline: \"outline\",\n subtle: \"secondary\"\n};\nvar BadgeNode = ({ node }) => /* @__PURE__ */ jsx11(Badge, { variant: BADGE_VARIANT[String(node.variant ?? \"solid\")] ?? \"default\", className: styleProps(node), children: String(node.text ?? \"\") });\nvar AvatarNode = ({ node }) => {\n const src = typeof node.src === \"string\" && SAFE_IMG.test(node.src) ? node.src : void 0;\n const fallback = typeof node.fallback === \"string\" ? node.fallback.slice(0, 2).toUpperCase() : \"?\";\n return /* @__PURE__ */ jsxs4(Avatar, { className: styleProps(node), children: [\n src && /* @__PURE__ */ jsx11(AvatarImage, { src }),\n /* @__PURE__ */ jsx11(AvatarFallback, { children: fallback })\n ] });\n};\nvar ALERT_VARIANT = {\n info: \"default\",\n success: \"default\",\n warning: \"default\",\n danger: \"destructive\"\n};\nvar AlertNode = ({ node }) => /* @__PURE__ */ jsxs4(Alert, { variant: ALERT_VARIANT[String(node.variant ?? \"info\")] ?? \"default\", className: styleProps(node), children: [\n typeof node.title === \"string\" && /* @__PURE__ */ jsx11(AlertTitle, { children: node.title }),\n /* @__PURE__ */ jsx11(AlertDescription, { children: String(node.text ?? \"\") })\n] });\nvar Stat = ({ node }) => {\n const label = node.label ?? node.title;\n const value = node.value ?? node.text;\n return /* @__PURE__ */ jsxs4(\"div\", { className: cn(\"flex flex-col\", styleProps(node)), children: [\n label != null && /* @__PURE__ */ jsx11(\"span\", { className: \"text-sm text-muted-foreground\", children: String(label) }),\n /* @__PURE__ */ jsx11(\"span\", { className: \"text-2xl font-semibold text-foreground\", children: String(value ?? \"\") }),\n typeof node.delta === \"string\" && /* @__PURE__ */ jsx11(\"span\", { className: \"text-sm text-muted-foreground\", children: node.delta })\n ] });\n};\nvar KeyValueNode = ({ node, value }) => {\n const src = value && typeof value === \"object\" ? value : node.data && typeof node.data === \"object\" ? node.data : {};\n const obj = src;\n return /* @__PURE__ */ jsx11(\"dl\", { className: cn(\"grid grid-cols-2 gap-x-4 gap-y-1\", styleProps(node)), children: Object.entries(obj).map(([k, v]) => /* @__PURE__ */ jsxs4(React9.Fragment, { children: [\n /* @__PURE__ */ jsx11(\"dt\", { className: \"text-muted-foreground\", children: k }),\n /* @__PURE__ */ jsx11(\"dd\", { className: \"text-foreground\", children: String(v) })\n ] }, k)) });\n};\nvar ListNode = ({ node, value }) => {\n const items = Array.isArray(value) ? value : Array.isArray(node.items) ? node.items : [];\n const ordered = node.ordered === true;\n const Tag = ordered ? \"ol\" : \"ul\";\n return /* @__PURE__ */ jsx11(Tag, { className: cn(ordered ? \"list-decimal\" : \"list-disc\", \"pl-5\", styleProps(node)), children: items.map((it, i) => /* @__PURE__ */ jsx11(\"li\", { children: String(it) }, i)) });\n};\nvar Quote = ({ node }) => /* @__PURE__ */ jsxs4(\"blockquote\", { className: cn(\"border-l-2 border-border pl-4 italic text-muted-foreground\", styleProps(node)), children: [\n String(node.text ?? \"\"),\n typeof node.cite === \"string\" && /* @__PURE__ */ jsxs4(\"footer\", { className: \"mt-1 text-xs not-italic\", children: [\n \"\\u2014 \",\n node.cite\n ] })\n] });\n\n// src/components/genui/components/inputs.tsx\nimport * as React21 from \"react\";\nimport { format } from \"date-fns\";\nimport { Star } from \"lucide-react\";\n\n// src/components/atoms/ui/input.tsx\nimport { forwardRef as forwardRef7 } from \"react\";\nimport { jsx as jsx12 } from \"react/jsx-runtime\";\nvar Input = forwardRef7(\n ({ className, type, ...props }, ref) => {\n return /* @__PURE__ */ jsx12(\n \"input\",\n {\n type,\n className: cn(\n \"flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50\",\n className,\n \"alq--input\"\n ),\n ref,\n ...props\n }\n );\n }\n);\nInput.displayName = \"Input\";\n\n// src/components/atoms/ui/textarea.tsx\nimport * as React10 from \"react\";\nimport { jsx as jsx13 } from \"react/jsx-runtime\";\nvar Textarea = React10.forwardRef(\n ({ className, ...props }, ref) => {\n return /* @__PURE__ */ jsx13(\n \"textarea\",\n {\n className: cn(\n \"flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50\",\n className,\n \"alq--textarea\"\n ),\n ref,\n ...props\n }\n );\n }\n);\nTextarea.displayName = \"Textarea\";\n\n// src/components/atoms/ui/label.tsx\nimport * as React11 from \"react\";\nimport * as LabelPrimitive from \"@radix-ui/react-label\";\nimport { cva as cva3 } from \"class-variance-authority\";\nimport { jsx as jsx14 } from \"react/jsx-runtime\";\nvar labelVariants = cva3(\n \"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70\"\n);\nvar Label = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx14(\n LabelPrimitive.Root,\n {\n ref,\n className: cn(labelVariants(), className, \"alq--label\"),\n ...props\n }\n));\nLabel.displayName = LabelPrimitive.Root.displayName;\n\n// src/components/atoms/ui/checkbox.tsx\nimport * as React12 from \"react\";\nimport * as CheckboxPrimitive from \"@radix-ui/react-checkbox\";\nimport { Check } from \"lucide-react\";\nimport { jsx as jsx15 } from \"react/jsx-runtime\";\nvar Checkbox = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx15(\n CheckboxPrimitive.Root,\n {\n ref,\n className: cn(\n \"peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground\",\n className,\n \"alq--checkbox\"\n ),\n ...props,\n children: /* @__PURE__ */ jsx15(\n CheckboxPrimitive.Indicator,\n {\n className: cn(\"flex items-center justify-center text-current\"),\n children: /* @__PURE__ */ jsx15(Check, { className: \"h-4 w-4\" })\n }\n )\n }\n));\nCheckbox.displayName = CheckboxPrimitive.Root.displayName;\n\n// src/components/atoms/ui/switch.tsx\nimport * as React13 from \"react\";\nimport * as SwitchPrimitives from \"@radix-ui/react-switch\";\nimport { jsx as jsx16 } from \"react/jsx-runtime\";\nvar Switch = React13.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx16(\n SwitchPrimitives.Root,\n {\n className: cn(\n \"peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input\",\n className,\n \"alq--switch\"\n ),\n ...props,\n ref,\n children: /* @__PURE__ */ jsx16(\n SwitchPrimitives.Thumb,\n {\n className: cn(\n \"pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0\"\n )\n }\n )\n }\n));\nSwitch.displayName = SwitchPrimitives.Root.displayName;\n\n// src/components/atoms/ui/slider.tsx\nimport * as React14 from \"react\";\nimport * as SliderPrimitive from \"@radix-ui/react-slider\";\nimport { jsx as jsx17, jsxs as jsxs5 } from \"react/jsx-runtime\";\nvar Slider = React14.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxs5(\n SliderPrimitive.Root,\n {\n ref,\n className: cn(\n \"relative flex w-44 touch-none select-none items-center\",\n className,\n \"alq--slider\"\n ),\n ...props,\n children: [\n /* @__PURE__ */ jsx17(SliderPrimitive.Track, { className: \"relative h-2 w-44 grow overflow-hidden rounded-full bg-primary\", children: /* @__PURE__ */ jsx17(SliderPrimitive.Range, { className: \"absolute h-full bg-secondary\" }) }),\n /* @__PURE__ */ jsx17(SliderPrimitive.Thumb, { className: \"block h-5 w-5 rounded-full border-2 border-gray bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50\" })\n ]\n }\n));\nSlider.displayName = SliderPrimitive.Root.displayName;\n\n// src/components/atoms/ui/button.tsx\nimport * as React15 from \"react\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport { cva as cva4 } from \"class-variance-authority\";\nimport { jsx as jsx18 } from \"react/jsx-runtime\";\nvar buttonVariants = cva4(\n \"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0\",\n {\n variants: {\n variant: {\n default: \"bg-primary text-primary-foreground hover:bg-primary/90\",\n destructive: \"bg-destructive text-destructive-foreground hover:bg-destructive/90\",\n outline: \"border border-input bg-background hover:bg-accent hover:text-accent-foreground\",\n secondary: \"bg-secondary text-secondary-foreground hover:bg-secondary/80\",\n ghost: \"hover:bg-accent hover:text-accent-foreground\",\n link: \"text-primary underline-offset-4 hover:underline\"\n },\n size: {\n default: \"h-10 px-4 py-2\",\n sm: \"h-9 rounded-md px-3\",\n lg: \"h-11 rounded-md px-8\",\n icon: \"h-10 w-10\"\n }\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\"\n }\n }\n);\nvar Button = React15.forwardRef(\n ({ className, variant, size, asChild = false, ...props }, ref) => {\n const Comp = asChild ? Slot : \"button\";\n return /* @__PURE__ */ jsx18(\n Comp,\n {\n className: cn(buttonVariants({ variant, size, className })),\n ref,\n ...props\n }\n );\n }\n);\nButton.displayName = \"Button\";\n\n// src/components/atoms/ui/calendar.tsx\nimport { ChevronLeft, ChevronRight } from \"lucide-react\";\nimport { DayPicker } from \"react-day-picker\";\nimport { jsx as jsx19 } from \"react/jsx-runtime\";\nfunction Calendar({ className, classNames, showOutsideDays = true, ...props }) {\n return /* @__PURE__ */ jsx19(\n DayPicker,\n {\n showOutsideDays,\n className: cn(\"p-3\", className),\n classNames: {\n months: \"flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0\",\n month: \"space-y-4\",\n caption: \"flex justify-center pt-1 relative items-center\",\n caption_label: \"text-sm font-medium\",\n nav: \"space-x-1 flex items-center\",\n nav_button: cn(\n buttonVariants({ variant: \"outline\" }),\n \"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100\"\n ),\n nav_button_previous: \"absolute left-1\",\n nav_button_next: \"absolute right-1\",\n table: \"w-full border-collapse space-y-1\",\n head_row: \"flex\",\n head_cell: \"text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]\",\n row: \"flex w-full mt-2\",\n cell: \"h-9 w-9 text-center text-sm p-0 relative [&:has([aria-selected])]:bg-accent first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md focus-within:relative focus-within:z-20\",\n day: cn(buttonVariants({ variant: \"ghost\" }), \"h-9 w-9 p-0 font-normal aria-selected:opacity-100\"),\n day_range_end: \"day-range-end\",\n day_selected: \"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground\",\n day_today: \"bg-accent text-accent-foreground\",\n day_outside: \"day-outside text-muted-foreground opacity-50\",\n day_disabled: \"text-muted-foreground opacity-50\",\n day_range_middle: \"aria-selected:bg-accent aria-selected:text-accent-foreground\",\n day_hidden: \"invisible\",\n ...classNames\n },\n components: {\n IconLeft: () => /* @__PURE__ */ jsx19(ChevronLeft, { className: \"h-4 w-4\" }),\n IconRight: () => /* @__PURE__ */ jsx19(ChevronRight, { className: \"h-4 w-4\" })\n },\n ...props\n }\n );\n}\nCalendar.displayName = \"Calendar\";\n\n// src/components/atoms/ui/radio-group.tsx\nimport * as React16 from \"react\";\nimport * as RadioGroupPrimitive from \"@radix-ui/react-radio-group\";\nimport { Circle } from \"lucide-react\";\nimport { jsx as jsx20 } from \"react/jsx-runtime\";\nvar RadioGroup = React16.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx20(RadioGroupPrimitive.Root, { ref, className: cn(\"grid gap-2\", className), ...props }));\nRadioGroup.displayName = RadioGroupPrimitive.Root.displayName;\nvar RadioGroupItem = React16.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx20(\n RadioGroupPrimitive.Item,\n {\n ref,\n className: cn(\n \"aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50\",\n className\n ),\n ...props,\n children: /* @__PURE__ */ jsx20(RadioGroupPrimitive.Indicator, { className: \"flex items-center justify-center\", children: /* @__PURE__ */ jsx20(Circle, { className: \"h-2.5 w-2.5 fill-current text-current\" }) })\n }\n));\nRadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName;\n\n// src/components/atoms/ui/popover.tsx\nimport * as React17 from \"react\";\nimport * as PopoverPrimitive from \"@radix-ui/react-popover\";\nimport { jsx as jsx21 } from \"react/jsx-runtime\";\nvar Popover = PopoverPrimitive.Root;\nvar PopoverTrigger = PopoverPrimitive.Trigger;\nvar PopoverContent = React17.forwardRef(({ className, align = \"center\", sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx21(PopoverPrimitive.Portal, { children: /* @__PURE__ */ jsx21(\n PopoverPrimitive.Content,\n {\n ref,\n align,\n sideOffset,\n className: cn(\n \"z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 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\",\n className\n ),\n ...props\n }\n) }));\nPopoverContent.displayName = PopoverPrimitive.Content.displayName;\n\n// src/components/atoms/ui/select.tsx\nimport * as React18 from \"react\";\nimport * as SelectPrimitive from \"@radix-ui/react-select\";\nimport { Check as Check2, ChevronDown as ChevronDown2, ChevronUp } from \"lucide-react\";\nimport { jsx as jsx22, jsxs as jsxs6 } from \"react/jsx-runtime\";\nvar Select = SelectPrimitive.Root;\nvar SelectValue = SelectPrimitive.Value;\nvar SelectTrigger = React18.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs6(\n SelectPrimitive.Trigger,\n {\n ref,\n className: cn(\n \"flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1\",\n className,\n \"alq--select\"\n ),\n ...props,\n children: [\n children,\n /* @__PURE__ */ jsx22(SelectPrimitive.Icon, { asChild: true, children: /* @__PURE__ */ jsx22(ChevronDown2, { className: \"h-4 w-4 opacity-50\" }) })\n ]\n }\n));\nSelectTrigger.displayName = SelectPrimitive.Trigger.displayName;\nvar SelectScrollUpButton = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx22(\n SelectPrimitive.ScrollUpButton,\n {\n ref,\n className: cn(\n \"flex cursor-default items-center justify-center py-1\",\n className\n ),\n ...props,\n children: /* @__PURE__ */ jsx22(ChevronUp, { className: \"h-4 w-4\" })\n }\n));\nSelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;\nvar SelectScrollDownButton = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx22(\n SelectPrimitive.ScrollDownButton,\n {\n ref,\n className: cn(\n \"flex cursor-default items-center justify-center py-1\",\n className\n ),\n ...props,\n children: /* @__PURE__ */ jsx22(ChevronDown2, { className: \"h-4 w-4\" })\n }\n));\nSelectScrollDownButton.displayName = SelectPrimitive.ScrollDownButton.displayName;\nvar SelectContent = React18.forwardRef(({ className, children, position = \"popper\", ...props }, ref) => /* @__PURE__ */ jsx22(SelectPrimitive.Portal, { children: /* @__PURE__ */ jsxs6(\n SelectPrimitive.Content,\n {\n ref,\n className: cn(\n \"relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 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\",\n position === \"popper\" && \"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1\",\n className\n ),\n position,\n ...props,\n children: [\n /* @__PURE__ */ jsx22(SelectScrollUpButton, {}),\n /* @__PURE__ */ jsx22(\n SelectPrimitive.Viewport,\n {\n className: cn(\n \"p-1\",\n position === \"popper\" && \"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]\"\n ),\n children\n }\n ),\n /* @__PURE__ */ jsx22(SelectScrollDownButton, {})\n ]\n }\n) }));\nSelectContent.displayName = SelectPrimitive.Content.displayName;\nvar SelectLabel = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx22(\n SelectPrimitive.Label,\n {\n ref,\n className: cn(\"py-1.5 pl-8 pr-2 text-sm font-semibold\", className),\n ...props\n }\n));\nSelectLabel.displayName = SelectPrimitive.Label.displayName;\nvar SelectItem = React18.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs6(\n SelectPrimitive.Item,\n {\n ref,\n className: cn(\n \"relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50\",\n className\n ),\n ...props,\n children: [\n /* @__PURE__ */ jsx22(\"span\", { className: \"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\", children: /* @__PURE__ */ jsx22(SelectPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx22(Check2, { className: \"h-4 w-4\" }) }) }),\n /* @__PURE__ */ jsx22(SelectPrimitive.ItemText, { children })\n ]\n }\n));\nSelectItem.displayName = SelectPrimitive.Item.displayName;\nvar SelectSeparator = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx22(\n SelectPrimitive.Separator,\n {\n ref,\n className: cn(\"-mx-1 my-1 h-px bg-muted\", className),\n ...props\n }\n));\nSelectSeparator.displayName = SelectPrimitive.Separator.displayName;\n\n// src/components/atoms/ui/command.tsx\nimport * as React20 from \"react\";\nimport { Command as CommandPrimitive } from \"cmdk\";\nimport { Search } from \"lucide-react\";\n\n// src/components/atoms/ui/dialog.tsx\nimport * as React19 from \"react\";\nimport * as DialogPrimitive from \"@radix-ui/react-dialog\";\nimport { X } from \"lucide-react\";\nimport { jsx as jsx23, jsxs as jsxs7 } from \"react/jsx-runtime\";\nvar Dialog = DialogPrimitive.Root;\nvar DialogTrigger = DialogPrimitive.Trigger;\nvar DialogPortal = DialogPrimitive.Portal;\nvar DialogOverlay = React19.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx23(\n DialogPrimitive.Overlay,\n {\n ref,\n className: cn(\n \"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0\",\n className\n ),\n ...props\n }\n));\nDialogOverlay.displayName = DialogPrimitive.Overlay.displayName;\nvar DialogContent = React19.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs7(DialogPortal, { children: [\n /* @__PURE__ */ jsx23(DialogOverlay, {}),\n /* @__PURE__ */ jsxs7(\n DialogPrimitive.Content,\n {\n ref,\n className: cn(\n \"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg\",\n className,\n \"alq--dialog-content\"\n ),\n ...props,\n children: [\n children,\n /* @__PURE__ */ jsxs7(DialogPrimitive.Close, { className: \"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground\", children: [\n /* @__PURE__ */ jsx23(X, { className: \"h-4 w-4\" }),\n /* @__PURE__ */ jsx23(\"span\", { className: \"sr-only\", children: \"Close\" })\n ] })\n ]\n }\n )\n] }));\nDialogContent.displayName = DialogPrimitive.Content.displayName;\nvar DialogHeader = ({\n className,\n ...props\n}) => /* @__PURE__ */ jsx23(\n \"div\",\n {\n className: cn(\n \"flex flex-col space-y-1.5 text-center sm:text-left text-foreground\",\n className,\n \"alq--dialog-header\"\n ),\n ...props\n }\n);\nDialogHeader.displayName = \"DialogHeader\";\nvar DialogFooter = ({\n className,\n ...props\n}) => /* @__PURE__ */ jsx23(\n \"div\",\n {\n className: cn(\n \"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2\",\n className\n ),\n ...props\n }\n);\nDialogFooter.displayName = \"DialogFooter\";\nvar DialogTitle = React19.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx23(\n DialogPrimitive.Title,\n {\n ref,\n className: cn(\n \"text-lg font-semibold leading-none tracking-tight text-foreground\",\n className,\n \"alq--dialog-title\"\n ),\n ...props\n }\n));\nDialogTitle.displayName = DialogPrimitive.Title.displayName;\nvar DialogDescription = React19.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx23(\n DialogPrimitive.Description,\n {\n ref,\n className: cn(\"text-sm text-muted-foreground\", className),\n ...props\n }\n));\nDialogDescription.displayName = DialogPrimitive.Description.displayName;\n\n// src/components/atoms/ui/command.tsx\nimport { jsx as jsx24, jsxs as jsxs8 } from \"react/jsx-runtime\";\nvar Command = React20.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx24(\n CommandPrimitive,\n {\n ref,\n className: cn(\n \"flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground\",\n className\n ),\n ...props\n }\n));\nCommand.displayName = CommandPrimitive.displayName;\nvar CommandInput = React20.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxs8(\"div\", { className: \"flex items-center border-b px-3\", \"cmdk-input-wrapper\": \"\", children: [\n /* @__PURE__ */ jsx24(Search, { className: \"mr-2 h-4 w-4 shrink-0 opacity-50\" }),\n /* @__PURE__ */ jsx24(\n CommandPrimitive.Input,\n {\n ref,\n className: cn(\n \"flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50\",\n className\n ),\n ...props\n }\n )\n] }));\nCommandInput.displayName = CommandPrimitive.Input.displayName;\nvar CommandList = React20.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx24(\n CommandPrimitive.List,\n {\n ref,\n className: cn(\"max-h-[300px] overflow-y-auto overflow-x-hidden\", className),\n ...props\n }\n));\nCommandList.displayName = CommandPrimitive.List.displayName;\nvar CommandEmpty = React20.forwardRef((props, ref) => /* @__PURE__ */ jsx24(\n CommandPrimitive.Empty,\n {\n ref,\n className: \"py-6 text-center text-sm\",\n ...props\n }\n));\nCommandEmpty.displayName = CommandPrimitive.Empty.displayName;\nvar CommandGroup = React20.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx24(\n CommandPrimitive.Group,\n {\n ref,\n className: cn(\n \"overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground\",\n className\n ),\n ...props\n }\n));\nCommandGroup.displayName = CommandPrimitive.Group.displayName;\nvar CommandSeparator = React20.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx24(\n CommandPrimitive.Separator,\n {\n ref,\n className: cn(\"-mx-1 h-px bg-border\", className),\n ...props\n }\n));\nCommandSeparator.displayName = CommandPrimitive.Separator.displayName;\nvar CommandItem = React20.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx24(\n CommandPrimitive.Item,\n {\n ref,\n className: cn(\n \"relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0\",\n className\n ),\n ...props\n }\n));\nCommandItem.displayName = CommandPrimitive.Item.displayName;\nvar CommandShortcut = ({\n className,\n ...props\n}) => {\n return /* @__PURE__ */ jsx24(\n \"span\",\n {\n className: cn(\n \"ml-auto text-xs tracking-widest text-muted-foreground\",\n className\n ),\n ...props\n }\n );\n};\nCommandShortcut.displayName = \"CommandShortcut\";\n\n// src/components/genui/components/inputs.tsx\nimport { jsx as jsx25, jsxs as jsxs9 } from \"react/jsx-runtime\";\nvar opts = (node) => Array.isArray(node.options) ? node.options.map(\n (o) => typeof o === \"string\" || typeof o === \"number\" ? { label: String(o), value: o } : o\n) : [];\nvar toDate = (v) => {\n if (typeof v !== \"string\" || !v) return void 0;\n const d = new Date(v);\n return isNaN(d.getTime()) ? void 0 : d;\n};\nvar Field = ({\n id,\n label,\n node,\n children\n}) => /* @__PURE__ */ jsxs9(\"div\", { className: cn(\"flex flex-col gap-1.5\", styleProps(node)), children: [\n typeof label === \"string\" && /* @__PURE__ */ jsx25(Label, { htmlFor: id, children: label }),\n children\n] });\nvar TextField = ({ node, value, onChange }) => {\n const id = `f-${node.id}`;\n return /* @__PURE__ */ jsx25(Field, { id, label: node.label, node, children: /* @__PURE__ */ jsx25(\n Input,\n {\n id,\n placeholder: typeof node.placeholder === \"string\" ? node.placeholder : void 0,\n value: typeof value === \"string\" ? value : \"\",\n onChange: (e) => onChange?.(e.target.value)\n }\n ) });\n};\nvar TextArea = ({ node, value, onChange }) => {\n const id = `f-${node.id}`;\n return /* @__PURE__ */ jsx25(Field, { id, label: node.label, node, children: /* @__PURE__ */ jsx25(\n Textarea,\n {\n id,\n rows: typeof node.rows === \"number\" ? node.rows : void 0,\n placeholder: typeof node.placeholder === \"string\" ? node.placeholder : void 0,\n value: typeof value === \"string\" ? value : \"\",\n onChange: (e) => onChange?.(e.target.value)\n }\n ) });\n};\nvar NumberField = ({ node, value, onChange }) => {\n const id = `f-${node.id}`;\n return /* @__PURE__ */ jsx25(Field, { id, label: node.label, node, children: /* @__PURE__ */ jsx25(\n Input,\n {\n id,\n type: \"number\",\n min: typeof node.min === \"number\" ? node.min : void 0,\n max: typeof node.max === \"number\" ? node.max : void 0,\n step: typeof node.step === \"number\" ? node.step : void 0,\n value: typeof value === \"number\" ? value : \"\",\n onChange: (e) => onChange?.(e.target.value === \"\" ? void 0 : Number(e.target.value))\n }\n ) });\n};\nvar SelectNode = ({ node, value, onChange }) => {\n const id = `f-${node.id}`;\n return /* @__PURE__ */ jsx25(Field, { id, label: node.label, node, children: /* @__PURE__ */ jsxs9(Select, { value: value != null ? String(value) : void 0, onValueChange: (v) => onChange?.(v), children: [\n /* @__PURE__ */ jsx25(SelectTrigger, { id, children: /* @__PURE__ */ jsx25(SelectValue, { placeholder: typeof node.placeholder === \"string\" ? node.placeholder : void 0 }) }),\n /* @__PURE__ */ jsx25(SelectContent, { children: opts(node).map((o) => /* @__PURE__ */ jsx25(SelectItem, { value: String(o.value), children: o.label }, String(o.value))) })\n ] }) });\n};\nvar MultiSelect = ({ node, value, onChange }) => {\n const selected = Array.isArray(value) ? value : [];\n const toggle = (v) => onChange?.(selected.includes(v) ? selected.filter((x) => x !== v) : [...selected, v]);\n return /* @__PURE__ */ jsx25(Field, { id: `f-${node.id}`, label: node.label, node, children: /* @__PURE__ */ jsx25(\"div\", { className: \"flex flex-col gap-1.5\", children: opts(node).map((o) => /* @__PURE__ */ jsxs9(\"label\", { className: \"flex items-center gap-2 text-sm\", children: [\n /* @__PURE__ */ jsx25(Checkbox, { checked: selected.includes(o.value), onCheckedChange: () => toggle(o.value) }),\n o.label\n ] }, String(o.value))) }) });\n};\nvar Combobox = ({ node, value, onChange }) => {\n const [open, setOpen] = React21.useState(false);\n const selected = opts(node).find((o) => o.value === value);\n const placeholder = typeof node.placeholder === \"string\" ? node.placeholder : \"Select\\u2026\";\n return /* @__PURE__ */ jsx25(Field, { id: `f-${node.id}`, label: node.label, node, children: /* @__PURE__ */ jsxs9(Popover, { open, onOpenChange: setOpen, children: [\n /* @__PURE__ */ jsx25(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx25(Button, { variant: \"outline\", role: \"combobox\", className: \"justify-between font-normal\", children: selected ? selected.label : placeholder }) }),\n /* @__PURE__ */ jsx25(PopoverContent, { className: \"w-[--radix-popover-trigger-width] p-0\", children: /* @__PURE__ */ jsxs9(Command, { children: [\n /* @__PURE__ */ jsx25(CommandInput, { placeholder: \"Search\\u2026\" }),\n /* @__PURE__ */ jsxs9(CommandList, { children: [\n /* @__PURE__ */ jsx25(CommandEmpty, { children: \"No results.\" }),\n opts(node).map((o) => /* @__PURE__ */ jsx25(\n CommandItem,\n {\n value: o.label,\n onSelect: () => {\n onChange?.(o.value);\n setOpen(false);\n },\n children: o.label\n },\n String(o.value)\n ))\n ] })\n ] }) })\n ] }) });\n};\nvar CheckboxNode = ({ node, value, onChange }) => {\n const id = `f-${node.id}`;\n return /* @__PURE__ */ jsxs9(\"div\", { className: cn(\"flex items-center gap-2\", styleProps(node)), children: [\n /* @__PURE__ */ jsx25(Checkbox, { id, checked: value === true, onCheckedChange: (c) => onChange?.(c === true) }),\n typeof node.label === \"string\" && /* @__PURE__ */ jsx25(Label, { htmlFor: id, children: node.label })\n ] });\n};\nvar CheckboxGroup = ({ node, value, onChange }) => {\n const selected = Array.isArray(value) ? value : [];\n const toggle = (v) => onChange?.(selected.includes(v) ? selected.filter((x) => x !== v) : [...selected, v]);\n return /* @__PURE__ */ jsx25(Field, { id: `f-${node.id}`, label: node.label, node, children: /* @__PURE__ */ jsx25(\"div\", { className: \"flex flex-col gap-1.5\", children: opts(node).map((o) => /* @__PURE__ */ jsxs9(\"label\", { className: \"flex items-center gap-2 text-sm\", children: [\n /* @__PURE__ */ jsx25(Checkbox, { checked: selected.includes(o.value), onCheckedChange: () => toggle(o.value) }),\n o.label\n ] }, String(o.value))) }) });\n};\nvar Radio = ({ node, value, onChange }) => /* @__PURE__ */ jsx25(Field, { id: `f-${node.id}`, label: node.label, node, children: /* @__PURE__ */ jsx25(\n RadioGroup,\n {\n value: value != null ? String(value) : void 0,\n onValueChange: (v) => {\n const match = opts(node).find((o) => String(o.value) === v);\n onChange?.(match ? match.value : v);\n },\n children: opts(node).map((o) => {\n const id = `r-${node.id}-${o.value}`;\n return /* @__PURE__ */ jsxs9(\"div\", { className: \"flex items-center gap-2 text-sm\", children: [\n /* @__PURE__ */ jsx25(RadioGroupItem, { id, value: String(o.value) }),\n /* @__PURE__ */ jsx25(Label, { htmlFor: id, className: \"font-normal\", children: o.label })\n ] }, String(o.value));\n })\n }\n) });\nvar SwitchNode = ({ node, value, onChange }) => {\n const id = `f-${node.id}`;\n return /* @__PURE__ */ jsxs9(\"div\", { className: cn(\"flex items-center gap-2\", styleProps(node)), children: [\n /* @__PURE__ */ jsx25(Switch, { id, checked: value === true, onCheckedChange: (c) => onChange?.(c === true) }),\n typeof node.label === \"string\" && /* @__PURE__ */ jsx25(Label, { htmlFor: id, children: node.label })\n ] });\n};\nvar SliderNode = ({ node, value, onChange }) => {\n const min = typeof node.min === \"number\" ? node.min : 0;\n const max = typeof node.max === \"number\" ? node.max : 100;\n const step = typeof node.step === \"number\" ? node.step : 1;\n const v = typeof value === \"number\" ? value : min;\n return /* @__PURE__ */ jsx25(Field, { id: `f-${node.id}`, label: node.label, node, children: /* @__PURE__ */ jsx25(Slider, { min, max, step, value: [v], onValueChange: (vals) => onChange?.(vals[0]) }) });\n};\nvar DatePicker = ({ node, value, onChange }) => {\n const selected = toDate(value);\n const label = selected ? format(selected, \"PPP\") : \"Pick a date\";\n return /* @__PURE__ */ jsx25(Field, { id: `f-${node.id}`, label: node.label, node, children: /* @__PURE__ */ jsxs9(Popover, { children: [\n /* @__PURE__ */ jsx25(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx25(Button, { variant: \"outline\", className: \"justify-start font-normal\", children: label }) }),\n /* @__PURE__ */ jsx25(PopoverContent, { className: \"w-auto p-0\", children: /* @__PURE__ */ jsx25(Calendar, { mode: \"single\", selected, onSelect: (d) => d && onChange?.(d.toISOString()) }) })\n ] }) });\n};\nvar DateRange = ({ node, value, onChange }) => {\n const parsed = value && typeof value === \"object\" ? value : void 0;\n const from = toDate(parsed?.from);\n const to = toDate(parsed?.to);\n const selected = from ? { from, to } : void 0;\n const label = from ? `${format(from, \"PP\")} \\u2013 ${to ? format(to, \"PP\") : \"\\u2026\"}` : \"Pick a range\";\n return /* @__PURE__ */ jsx25(Field, { id: `f-${node.id}`, label: node.label, node, children: /* @__PURE__ */ jsxs9(Popover, { children: [\n /* @__PURE__ */ jsx25(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx25(Button, { variant: \"outline\", className: \"justify-start font-normal\", children: label }) }),\n /* @__PURE__ */ jsx25(PopoverContent, { className: \"w-auto p-0\", children: /* @__PURE__ */ jsx25(\n Calendar,\n {\n mode: \"range\",\n selected,\n onSelect: (r) => onChange?.({ from: r?.from?.toISOString() ?? null, to: r?.to?.toISOString() ?? null })\n }\n ) })\n ] }) });\n};\nvar FileUpload = ({ node, onChange }) => {\n const id = `f-${node.id}`;\n return /* @__PURE__ */ jsx25(Field, { id, label: node.label, node, children: /* @__PURE__ */ jsx25(\n Input,\n {\n id,\n type: \"file\",\n accept: typeof node.accept === \"string\" ? node.accept : void 0,\n multiple: node.multiple === true,\n onChange: (e) => onChange?.(\n Array.from(e.target.files ?? []).map((f) => ({ name: f.name, size: f.size, type: f.type }))\n )\n }\n ) });\n};\nvar Rating = ({ node, value, onChange }) => {\n const max = typeof node.max === \"number\" ? node.max : 5;\n const current = typeof value === \"number\" ? value : 0;\n return /* @__PURE__ */ jsx25(Field, { id: `f-${node.id}`, label: node.label, node, children: /* @__PURE__ */ jsx25(\"div\", { className: \"flex items-center gap-1\", role: \"radiogroup\", \"aria-label\": \"rating\", children: Array.from({ length: max }, (_, i) => i + 1).map((n) => /* @__PURE__ */ jsx25(\n \"button\",\n {\n type: \"button\",\n \"aria-label\": `${n} star${n > 1 ? \"s\" : \"\"}`,\n onClick: () => onChange?.(n),\n className: \"text-amber-500\",\n children: /* @__PURE__ */ jsx25(Star, { className: cn(\"h-5 w-5\", n <= current ? \"fill-current\" : \"opacity-40\") })\n },\n n\n )) }) });\n};\n\n// src/components/genui/components/data.tsx\nimport * as React24 from \"react\";\nimport {\n useReactTable,\n getCoreRowModel,\n getSortedRowModel,\n flexRender\n} from \"@tanstack/react-table\";\nimport { BarChart, Bar, LineChart, Line, AreaChart, Area, PieChart, Pie, Cell, Tooltip as Tooltip2, Legend as Legend2 } from \"recharts\";\n\n// src/components/atoms/ui/table.tsx\nimport * as React22 from \"react\";\nimport { jsx as jsx26 } from \"react/jsx-runtime\";\nvar Table = React22.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx26(\"div\", { className: \"relative w-full overflow-auto\", children: /* @__PURE__ */ jsx26(\n \"table\",\n {\n ref,\n className: cn(\"w-full caption-bottom text-sm text-foreground bg-background\", className, \"alq--table\"),\n ...props\n }\n) }));\nTable.displayName = \"Table\";\nvar TableHeader = React22.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx26(\"thead\", { ref, className: cn(\"[&_tr]:border-b border-border bg-muted\", className, \"alq--table-header\"), ...props }));\nTableHeader.displayName = \"TableHeader\";\nvar TableBody = React22.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx26(\n \"tbody\",\n {\n ref,\n className: cn(\"[&_tr:last-child]:border-0 [&_tr]:border-b border-border\", className, \"alq--table-body\"),\n ...props\n }\n));\nTableBody.displayName = \"TableBody\";\nvar TableFooter = React22.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx26(\n \"tfoot\",\n {\n ref,\n className: cn(\n \"border-t border-border bg-muted/50 font-medium [&>tr]:last:border-b-0\",\n className,\n \"alq--table-footer\"\n ),\n ...props\n }\n));\nTableFooter.displayName = \"TableFooter\";\nvar TableRow = React22.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx26(\n \"tr\",\n {\n ref,\n className: cn(\n \"border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted\",\n className\n ),\n ...props\n }\n));\nTableRow.displayName = \"TableRow\";\nvar TableHead = React22.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx26(\n \"th\",\n {\n ref,\n className: cn(\n \"h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0\",\n className\n ),\n ...props\n }\n));\nTableHead.displayName = \"TableHead\";\nvar TableCell = React22.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx26(\n \"td\",\n {\n ref,\n className: cn(\"p-4 align-middle [&:has([role=checkbox])]:pr-0\", className),\n ...props\n }\n));\nTableCell.displayName = \"TableCell\";\nvar TableCaption = React22.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx26(\n \"caption\",\n {\n ref,\n className: cn(\"mt-4 text-sm text-muted-foreground\", className),\n ...props\n }\n));\nTableCaption.displayName = \"TableCaption\";\n\n// src/components/atoms/ui/progress.tsx\nimport * as React23 from \"react\";\nimport * as ProgressPrimitive from \"@radix-ui/react-progress\";\nimport { jsx as jsx27 } from \"react/jsx-runtime\";\nvar Progress = React23.forwardRef(({ className, value, ...props }, ref) => /* @__PURE__ */ jsx27(\n ProgressPrimitive.Root,\n {\n ref,\n className: cn(\"relative h-2 w-full overflow-hidden rounded-full bg-muted\", className),\n ...props,\n children: /* @__PURE__ */ jsx27(\n ProgressPrimitive.Indicator,\n {\n className: \"h-full w-full flex-1 bg-primary transition-all\",\n style: { transform: `translateX(-${100 - (value || 0)}%)` }\n }\n )\n }\n));\nProgress.displayName = ProgressPrimitive.Root.displayName;\n\n// src/components/atoms/ui/chart.tsx\nimport { ResponsiveContainer, CartesianGrid, XAxis, YAxis, Tooltip, Legend } from \"recharts\";\nimport { Fragment as Fragment5, jsx as jsx28, jsxs as jsxs10 } from \"react/jsx-runtime\";\nvar CHART_PALETTE = [\n \"hsl(var(--chart-1))\",\n \"hsl(var(--chart-2))\",\n \"hsl(var(--chart-3))\",\n \"hsl(var(--chart-4))\",\n \"hsl(var(--chart-5))\"\n];\nfunction Chart({ className, height = 300, children }) {\n return /* @__PURE__ */ jsx28(\"div\", { className: cn(\"w-full\", className), style: { height }, children: /* @__PURE__ */ jsx28(ResponsiveContainer, { width: \"100%\", height: \"100%\", children }) });\n}\nChart.displayName = \"Chart\";\nfunction themedChartAxes(x) {\n return /* @__PURE__ */ jsxs10(Fragment5, { children: [\n /* @__PURE__ */ jsx28(CartesianGrid, { strokeDasharray: \"3 3\", className: \"stroke-border\" }),\n /* @__PURE__ */ jsx28(XAxis, { dataKey: x, className: \"text-xs\" }),\n /* @__PURE__ */ jsx28(YAxis, { className: \"text-xs\" }),\n /* @__PURE__ */ jsx28(Tooltip, {}),\n /* @__PURE__ */ jsx28(Legend, {})\n ] });\n}\n\n// src/components/genui/components/data.tsx\nimport { jsx as jsx29, jsxs as jsxs11 } from \"react/jsx-runtime\";\nvar PALETTE = CHART_PALETTE;\nvar TableNode = ({ node, value, onAction }) => {\n const data = Array.isArray(value) ? value : Array.isArray(node.rows) ? node.rows : Array.isArray(node.data) ? node.data : [];\n let cols = (Array.isArray(node.columns) ? node.columns : []).map(\n (c) => typeof c === \"string\" ? { key: c, header: c } : c\n );\n if (!cols.some((c) => c.key) && data.length) {\n cols = Object.keys(data[0]).map((k) => ({ key: k, header: k }));\n }\n const sortable = node.sortable === true;\n const [sorting, setSorting] = React24.useState([]);\n const columns = React24.useMemo(\n () => cols.map((c, i) => {\n const id = String(c.key ?? `col_${i}`);\n const header = String(c.header ?? c.key ?? `Column ${i + 1}`);\n return c.key ? { id, accessorKey: c.key, header } : { id, accessorFn: () => \"\", header };\n }),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [node]\n );\n const table = useReactTable({\n data,\n columns,\n state: { sorting },\n onSortingChange: setSorting,\n getCoreRowModel: getCoreRowModel(),\n getSortedRowModel: getSortedRowModel(),\n enableSorting: sortable\n });\n return /* @__PURE__ */ jsxs11(Table, { className: styleProps(node), children: [\n /* @__PURE__ */ jsx29(TableHeader, { children: table.getHeaderGroups().map((hg) => /* @__PURE__ */ jsx29(TableRow, { children: hg.headers.map((h) => /* @__PURE__ */ jsx29(TableHead, { children: sortable ? /* @__PURE__ */ jsx29(\n \"button\",\n {\n type: \"button\",\n onClick: () => {\n h.column.toggleSorting();\n onAction?.({ name: \"sort\", wantResponse: false });\n },\n children: flexRender(h.column.columnDef.header, h.getContext())\n }\n ) : flexRender(h.column.columnDef.header, h.getContext()) }, h.id)) }, hg.id)) }),\n /* @__PURE__ */ jsx29(TableBody, { children: table.getRowModel().rows.map((r) => /* @__PURE__ */ jsx29(TableRow, { children: r.getVisibleCells().map((c) => /* @__PURE__ */ jsx29(TableCell, { children: String(c.getValue() ?? \"\") }, c.id)) }, r.id)) })\n ] });\n};\nvar ChartNode = ({ node, value }) => {\n const data = Array.isArray(value) ? value : Array.isArray(node.data) ? node.data : [];\n let series = (Array.isArray(node.series) ? node.series : []).map(\n (s) => typeof s === \"string\" ? { key: s } : s\n );\n const first = data[0] ?? {};\n const x = String(node.x ?? Object.keys(first).find((k) => typeof first[k] !== \"number\") ?? \"\");\n if (!series.length && data.length) {\n series = Object.keys(first).filter((k) => k !== x && typeof first[k] === \"number\").map((k) => ({ key: k }));\n }\n const kind = String(node.kind ?? \"bar\");\n if (!data.length || !series.length) {\n return /* @__PURE__ */ jsx29(\"p\", { className: \"text-muted-foreground text-sm\", children: \"No data to display\" });\n }\n const axes = themedChartAxes(x);\n return /* @__PURE__ */ jsxs11(\"div\", { className: cn(\"w-full\", styleProps(node)), children: [\n typeof node.title === \"string\" && /* @__PURE__ */ jsx29(\"p\", { className: \"mb-2 font-medium\", children: node.title }),\n /* @__PURE__ */ jsx29(Chart, { height: 300, children: kind === \"line\" ? /* @__PURE__ */ jsxs11(LineChart, { data, children: [\n axes,\n series.map((s, i) => /* @__PURE__ */ jsx29(Line, { dataKey: s.key, name: s.label ?? s.key, stroke: PALETTE[i % PALETTE.length] }, s.key))\n ] }) : kind === \"area\" ? /* @__PURE__ */ jsxs11(AreaChart, { data, children: [\n axes,\n series.map((s, i) => /* @__PURE__ */ jsx29(\n Area,\n {\n dataKey: s.key,\n name: s.label ?? s.key,\n stroke: PALETTE[i % PALETTE.length],\n fill: PALETTE[i % PALETTE.length],\n fillOpacity: 0.2\n },\n s.key\n ))\n ] }) : kind === \"pie\" ? /* @__PURE__ */ jsxs11(PieChart, { children: [\n /* @__PURE__ */ jsx29(Tooltip2, {}),\n /* @__PURE__ */ jsx29(Legend2, {}),\n /* @__PURE__ */ jsx29(Pie, { data, dataKey: series[0].key, nameKey: x, label: true, children: data.map((_, i) => /* @__PURE__ */ jsx29(Cell, { fill: PALETTE[i % PALETTE.length] }, i)) })\n ] }) : /* @__PURE__ */ jsxs11(BarChart, { data, children: [\n axes,\n series.map((s, i) => /* @__PURE__ */ jsx29(Bar, { dataKey: s.key, name: s.label ?? s.key, fill: PALETTE[i % PALETTE.length] }, s.key))\n ] }) })\n ] });\n};\nvar Progress2 = ({ node }) => {\n const max = typeof node.max === \"number\" && node.max > 0 ? node.max : 100;\n const value = typeof node.value === \"number\" ? Math.min(Math.max(node.value, 0), max) : 0;\n const pct = Math.round(value / max * 100);\n return /* @__PURE__ */ jsxs11(\"div\", { className: cn(\"flex flex-col gap-1\", styleProps(node)), children: [\n typeof node.label === \"string\" && /* @__PURE__ */ jsxs11(\"div\", { className: \"flex justify-between text-sm text-muted-foreground\", children: [\n /* @__PURE__ */ jsx29(\"span\", { children: node.label }),\n /* @__PURE__ */ jsxs11(\"span\", { children: [\n pct,\n \"%\"\n ] })\n ] }),\n /* @__PURE__ */ jsx29(Progress, { value: pct })\n ] });\n};\nvar Timeline = ({ node }) => {\n const items = Array.isArray(node.items) ? node.items : [];\n return /* @__PURE__ */ jsx29(\"ol\", { className: cn(\"relative ml-2 border-l border-border\", styleProps(node)), children: items.map((it, i) => /* @__PURE__ */ jsxs11(\"li\", { className: \"mb-4 ml-4\", children: [\n /* @__PURE__ */ jsx29(\"span\", { className: \"absolute -left-1.5 mt-1 h-3 w-3 rounded-full bg-primary\" }),\n /* @__PURE__ */ jsx29(\"div\", { className: \"text-sm font-medium text-foreground\", children: it.title }),\n it.timestamp && /* @__PURE__ */ jsx29(\"div\", { className: \"text-xs text-muted-foreground\", children: it.timestamp }),\n it.description && /* @__PURE__ */ jsx29(\"div\", { className: \"text-sm text-muted-foreground\", children: it.description })\n ] }, i)) });\n};\n\n// src/components/genui/components/actions.tsx\nimport { jsx as jsx30 } from \"react/jsx-runtime\";\nvar BUTTON_VARIANT = {\n solid: \"default\",\n outline: \"outline\",\n ghost: \"ghost\",\n link: \"link\"\n};\nvar BUTTON_SIZE = { sm: \"sm\", lg: \"lg\" };\nvar ButtonNode = ({ node, onAction }) => {\n const caption = node.text ?? node.label ?? node.title ?? \"\";\n return /* @__PURE__ */ jsx30(\n Button,\n {\n variant: BUTTON_VARIANT[String(node.variant ?? \"solid\")] ?? \"default\",\n size: typeof node.size === \"string\" ? BUTTON_SIZE[node.size] : void 0,\n className: node.emphasis === \"high\" ? \"font-semibold\" : void 0,\n onClick: () => node.action && onAction?.(node.action),\n children: String(caption)\n }\n );\n};\nvar ButtonGroup = ({ node, children }) => /* @__PURE__ */ jsx30(\"div\", { className: cn(\"flex flex-row gap-2\", styleProps(node)), children });\nvar SAFE_HREF = /^(\\/|https:\\/\\/)/i;\nvar LinkNode = ({ node }) => {\n const href = typeof node.href === \"string\" && SAFE_HREF.test(node.href) ? node.href : void 0;\n const text = String(node.text ?? \"\");\n if (!href) return /* @__PURE__ */ jsx30(\"span\", { className: cn(\"text-muted-foreground\", styleProps(node)), children: text });\n return /* @__PURE__ */ jsx30(\n \"a\",\n {\n href,\n target: \"_blank\",\n rel: \"noopener noreferrer\",\n className: cn(\"text-primary underline underline-offset-2\", styleProps(node)),\n children: text\n }\n );\n};\n\n// src/components/genui/registry.tsx\nvar coreUiRegistry = {\n // layout\n Stack,\n Row,\n Column,\n Grid,\n Divider,\n Spacer,\n Card: CardNode,\n Tabs: TabsNode,\n Accordion: AccordionNode,\n // content\n Text,\n Heading,\n Markdown,\n Image: ImageNode,\n Icon: IconNode,\n Badge: BadgeNode,\n Avatar: AvatarNode,\n Alert: AlertNode,\n Stat,\n KeyValue: KeyValueNode,\n List: ListNode,\n Quote,\n // inputs\n TextField,\n TextArea,\n NumberField,\n Select: SelectNode,\n MultiSelect,\n Combobox,\n Checkbox: CheckboxNode,\n CheckboxGroup,\n Radio,\n Switch: SwitchNode,\n Slider: SliderNode,\n DatePicker,\n DateRange,\n FileUpload,\n Rating,\n // data\n Table: TableNode,\n Chart: ChartNode,\n Progress: Progress2,\n Timeline,\n // actions\n Button: ButtonNode,\n ButtonGroup,\n Link: LinkNode\n};\n\n// src/components/genui/assistant-chat.tsx\nimport * as React43 from \"react\";\nimport { Check as Check3 } from \"lucide-react\";\n\n// src/components/organisms/assistant.tsx\nimport * as React42 from \"react\";\nimport { useCallback as useCallback3, useEffect as useEffect10, useRef as useRef2, useState as useState13 } from \"react\";\n\n// src/components/atoms/ui/scroll-area.tsx\nimport * as React25 from \"react\";\nimport * as ScrollAreaPrimitive from \"@radix-ui/react-scroll-area\";\nimport { jsx as jsx31, jsxs as jsxs12 } from \"react/jsx-runtime\";\nvar ScrollArea = React25.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs12(\n ScrollAreaPrimitive.Root,\n {\n ref,\n className: cn(\"relative overflow-hidden\", className),\n ...props,\n children: [\n /* @__PURE__ */ jsx31(ScrollAreaPrimitive.Viewport, { className: \"h-full w-full rounded-[inherit]\", children }),\n /* @__PURE__ */ jsx31(ScrollBar, {}),\n /* @__PURE__ */ jsx31(ScrollAreaPrimitive.Corner, {})\n ]\n }\n));\nScrollArea.displayName = ScrollAreaPrimitive.Root.displayName;\nvar ScrollBar = React25.forwardRef(({ className, orientation = \"vertical\", ...props }, ref) => /* @__PURE__ */ jsx31(\n ScrollAreaPrimitive.ScrollAreaScrollbar,\n {\n ref,\n orientation,\n className: cn(\n \"flex touch-none select-none transition-colors\",\n orientation === \"vertical\" && \"h-full w-2.5 border-l border-l-transparent p-[1px]\",\n orientation === \"horizontal\" && \"h-2.5 flex-col border-t border-t-transparent p-[1px]\",\n className\n ),\n ...props,\n children: /* @__PURE__ */ jsx31(ScrollAreaPrimitive.ScrollAreaThumb, { className: \"relative flex-1 rounded-full bg-border\" })\n }\n));\nScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName;\n\n// src/components/atoms/ui/skeleton.tsx\nimport { jsx as jsx32 } from \"react/jsx-runtime\";\n\n// src/components/atoms/ui/drawer.tsx\nimport * as React26 from \"react\";\nimport { Drawer as DrawerPrimitive } from \"vaul\";\nimport { jsx as jsx33, jsxs as jsxs13 } from \"react/jsx-runtime\";\nvar Drawer = ({\n shouldScaleBackground = true,\n ...props\n}) => /* @__PURE__ */ jsx33(\n DrawerPrimitive.Root,\n {\n shouldScaleBackground,\n ...props\n }\n);\nDrawer.displayName = \"Drawer\";\nvar DrawerTrigger = DrawerPrimitive.Trigger;\nvar DrawerPortal = DrawerPrimitive.Portal;\nvar DrawerClose = DrawerPrimitive.Close;\nvar DrawerOverlay = React26.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx33(\n DrawerPrimitive.Overlay,\n {\n ref,\n className: cn(\"fixed inset-0 z-50 bg-black/80\", className),\n ...props\n }\n));\nDrawerOverlay.displayName = DrawerPrimitive.Overlay.displayName;\nvar DrawerContent = React26.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs13(DrawerPortal, { children: [\n /* @__PURE__ */ jsx33(DrawerOverlay, {}),\n /* @__PURE__ */ jsxs13(\n DrawerPrimitive.Content,\n {\n ref,\n className: cn(\n \"fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border border-border bg-background text-foreground alq--drawer-content\",\n className\n ),\n ...props,\n children: [\n /* @__PURE__ */ jsx33(\"div\", { className: \"mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted\" }),\n children\n ]\n }\n )\n] }));\nDrawerContent.displayName = \"DrawerContent\";\nvar DrawerHeader = ({\n className,\n ...props\n}) => /* @__PURE__ */ jsx33(\n \"div\",\n {\n className: cn(\"grid gap-1.5 p-4 text-center sm:text-left\", className, \"alq--drawer-header\"),\n ...props\n }\n);\nDrawerHeader.displayName = \"DrawerHeader\";\nvar DrawerFooter = ({\n className,\n ...props\n}) => /* @__PURE__ */ jsx33(\n \"div\",\n {\n className: cn(\"mt-auto flex flex-col gap-2 p-4\", className, \"alq--drawer-footer\"),\n ...props\n }\n);\nDrawerFooter.displayName = \"DrawerFooter\";\nvar DrawerTitle = React26.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx33(\n DrawerPrimitive.Title,\n {\n ref,\n className: cn(\n \"text-lg font-semibold leading-none tracking-tight\",\n className,\n \"alq--drawer-title\"\n ),\n ...props\n }\n));\nDrawerTitle.displayName = DrawerPrimitive.Title.displayName;\nvar DrawerDescription = React26.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx33(\n DrawerPrimitive.Description,\n {\n ref,\n className: cn(\"text-sm text-muted-foreground\", className, \"alq--drawer-description\"),\n ...props\n }\n));\nDrawerDescription.displayName = DrawerPrimitive.Description.displayName;\n\n// src/components/atoms/ui/typography/index.tsx\nimport { forwardRef as forwardRef23 } from \"react\";\nimport { jsx as jsx34 } from \"react/jsx-runtime\";\nvar Typography = forwardRef23(\n ({ as: Component = \"p\", typeStyle, ...props }, ref) => {\n return /* @__PURE__ */ jsx34(\n Component,\n {\n ...props,\n className: cn(props.className, `alq--typography-${typeStyle}`),\n ref\n }\n );\n }\n);\nTypography.displayName = \"Typography\";\n\n// src/components/atoms/ui/toggle.tsx\nimport * as React27 from \"react\";\nimport * as TogglePrimitive from \"@radix-ui/react-toggle\";\nimport { cva as cva5 } from \"class-variance-authority\";\nimport { jsx as jsx35 } from \"react/jsx-runtime\";\nvar toggleVariants = cva5(\n \"inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground\",\n {\n variants: {\n variant: {\n default: \"bg-transparent\",\n outline: \"border border-input bg-transparent hover:bg-accent hover:text-accent-foreground\"\n },\n size: {\n default: \"h-10 px-3\",\n sm: \"h-9 px-2.5\",\n lg: \"h-11 px-5\"\n }\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\"\n }\n }\n);\nvar Toggle = React27.forwardRef(({ className, variant, size, ...props }, ref) => /* @__PURE__ */ jsx35(\n TogglePrimitive.Root,\n {\n ref,\n className: cn(toggleVariants({ variant, size, className }), \"alq--toggle\"),\n ...props\n }\n));\nToggle.displayName = TogglePrimitive.Root.displayName;\n\n// src/components/atoms/ui/aspect-ratio.tsx\nimport * as AspectRatioPrimitive from \"@radix-ui/react-aspect-ratio\";\n\n// src/components/atoms/ui/breadcrumb.tsx\nimport * as React28 from \"react\";\nimport { Slot as Slot2 } from \"@radix-ui/react-slot\";\nimport { ChevronRight as ChevronRight2, MoreHorizontal } from \"lucide-react\";\nimport { jsx as jsx36, jsxs as jsxs14 } from \"react/jsx-runtime\";\nvar Breadcrumb = React28.forwardRef(({ ...props }, ref) => /* @__PURE__ */ jsx36(\"nav\", { ref, \"aria-label\": \"breadcrumb\", ...props }));\nBreadcrumb.displayName = \"Breadcrumb\";\nvar BreadcrumbList = React28.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx36(\n \"ol\",\n {\n ref,\n className: cn(\n \"flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5\",\n className\n ),\n ...props\n }\n));\nBreadcrumbList.displayName = \"BreadcrumbList\";\nvar BreadcrumbItem = React28.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx36(\n \"li\",\n {\n ref,\n className: cn(\"inline-flex items-center gap-1.5\", className),\n ...props\n }\n));\nBreadcrumbItem.displayName = \"BreadcrumbItem\";\nvar BreadcrumbLink = React28.forwardRef(({ asChild, className, ...props }, ref) => {\n const Comp = asChild ? Slot2 : \"a\";\n return /* @__PURE__ */ jsx36(\n Comp,\n {\n ref,\n className: cn(\"transition-colors hover:text-foreground\", className),\n ...props\n }\n );\n});\nBreadcrumbLink.displayName = \"BreadcrumbLink\";\nvar BreadcrumbPage = React28.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx36(\n \"span\",\n {\n ref,\n role: \"link\",\n \"aria-disabled\": \"true\",\n \"aria-current\": \"page\",\n className: cn(\"font-normal text-foreground\", className),\n ...props\n }\n));\nBreadcrumbPage.displayName = \"BreadcrumbPage\";\nvar BreadcrumbSeparator = ({\n children,\n className,\n ...props\n}) => /* @__PURE__ */ jsx36(\n \"li\",\n {\n role: \"presentation\",\n \"aria-hidden\": \"true\",\n className: cn(\"[&>svg]:w-3.5 [&>svg]:h-3.5\", className),\n ...props,\n children: children ?? /* @__PURE__ */ jsx36(ChevronRight2, {})\n }\n);\nBreadcrumbSeparator.displayName = \"BreadcrumbSeparator\";\nvar BreadcrumbEllipsis = ({\n className,\n ...props\n}) => /* @__PURE__ */ jsxs14(\n \"span\",\n {\n role: \"presentation\",\n \"aria-hidden\": \"true\",\n className: cn(\"flex h-9 w-9 items-center justify-center\", className),\n ...props,\n children: [\n /* @__PURE__ */ jsx36(MoreHorizontal, { className: \"h-4 w-4\" }),\n /* @__PURE__ */ jsx36(\"span\", { className: \"sr-only\", children: \"More\" })\n ]\n }\n);\nBreadcrumbEllipsis.displayName = \"BreadcrumbElipssis\";\n\n// src/components/molecules/alert-dialog.tsx\nimport * as React29 from \"react\";\nimport * as AlertDialogPrimitive from \"@radix-ui/react-alert-dialog\";\nimport { jsx as jsx37, jsxs as jsxs15 } from \"react/jsx-runtime\";\nvar AlertDialogPortal = AlertDialogPrimitive.Portal;\nvar AlertDialogOverlay = React29.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx37(\n AlertDialogPrimitive.Overlay,\n {\n className: cn(\n \"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0\",\n className\n ),\n ...props,\n ref\n }\n));\nAlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName;\nvar AlertDialogContent = React29.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxs15(AlertDialogPortal, { children: [\n /* @__PURE__ */ jsx37(AlertDialogOverlay, {}),\n /* @__PURE__ */ jsx37(\n AlertDialogPrimitive.Content,\n {\n ref,\n className: cn(\n \"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg\",\n className\n ),\n ...props\n }\n )\n] }));\nAlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName;\nvar AlertDialogHeader = ({\n className,\n ...props\n}) => /* @__PURE__ */ jsx37(\n \"div\",\n {\n className: cn(\n \"flex flex-col space-y-2 text-center sm:text-left\",\n className\n ),\n ...props\n }\n);\nAlertDialogHeader.displayName = \"AlertDialogHeader\";\nvar AlertDialogFooter = ({\n className,\n ...props\n}) => /* @__PURE__ */ jsx37(\n \"div\",\n {\n className: cn(\n \"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2\",\n className\n ),\n ...props\n }\n);\nAlertDialogFooter.displayName = \"AlertDialogFooter\";\nvar AlertDialogTitle = React29.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx37(\n AlertDialogPrimitive.Title,\n {\n ref,\n className: cn(\"text-lg font-semibold\", className),\n ...props\n }\n));\nAlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName;\nvar AlertDialogDescription = React29.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx37(\n AlertDialogPrimitive.Description,\n {\n ref,\n className: cn(\"text-sm text-muted-foreground\", className),\n ...props\n }\n));\nAlertDialogDescription.displayName = AlertDialogPrimitive.Description.displayName;\nvar AlertDialogAction = React29.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx37(\n AlertDialogPrimitive.Action,\n {\n ref,\n className: cn(buttonVariants(), className),\n ...props\n }\n));\nAlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName;\nvar AlertDialogCancel = React29.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx37(\n AlertDialogPrimitive.Cancel,\n {\n ref,\n className: cn(\n buttonVariants({ variant: \"outline\" }),\n \"mt-2 sm:mt-0\",\n className\n ),\n ...props\n }\n));\nAlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName;\n\n// src/components/atoms/ui/toast.tsx\nimport * as React30 from \"react\";\nimport * as ToastPrimitives from \"@radix-ui/react-toast\";\nimport { cva as cva6 } from \"class-variance-authority\";\nimport { X as X2 } from \"lucide-react\";\nimport { jsx as jsx38 } from \"react/jsx-runtime\";\nvar ToastViewport = React30.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx38(\n ToastPrimitives.Viewport,\n {\n ref,\n className: cn(\n \"fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]\",\n className\n ),\n ...props\n }\n));\nToastViewport.displayName = ToastPrimitives.Viewport.displayName;\nvar toastVariants = cva6(\n \"group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full\",\n {\n variants: {\n variant: {\n default: \"border bg-background text-foreground\",\n destructive: \"destructive group border-destructive bg-destructive text-destructive-foreground\"\n }\n },\n defaultVariants: {\n variant: \"default\"\n }\n }\n);\nvar Toast = React30.forwardRef(({ className, variant, ...props }, ref) => {\n return /* @__PURE__ */ jsx38(\n ToastPrimitives.Root,\n {\n ref,\n className: cn(toastVariants({ variant }), className),\n ...props\n }\n );\n});\nToast.displayName = ToastPrimitives.Root.displayName;\nvar ToastAction = React30.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx38(\n ToastPrimitives.Action,\n {\n ref,\n className: cn(\n \"inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive\",\n className\n ),\n ...props\n }\n));\nToastAction.displayName = ToastPrimitives.Action.displayName;\nvar ToastClose = React30.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx38(\n ToastPrimitives.Close,\n {\n ref,\n className: cn(\n \"absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600\",\n className\n ),\n \"toast-close\": \"\",\n ...props,\n children: /* @__PURE__ */ jsx38(X2, { className: \"h-4 w-4\" })\n }\n));\nToastClose.displayName = ToastPrimitives.Close.displayName;\nvar ToastTitle = React30.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx38(\n ToastPrimitives.Title,\n {\n ref,\n className: cn(\"text-sm font-semibold\", className),\n ...props\n }\n));\nToastTitle.displayName = ToastPrimitives.Title.displayName;\nvar ToastDescription = React30.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx38(\n ToastPrimitives.Description,\n {\n ref,\n className: cn(\"text-sm opacity-90\", className),\n ...props\n }\n));\nToastDescription.displayName = ToastPrimitives.Description.displayName;\n\n// src/components/atoms/ui/loader.tsx\nimport * as React31 from \"react\";\nimport { cva as cva7 } from \"class-variance-authority\";\nimport { Loader2 } from \"lucide-react\";\nimport { jsx as jsx39 } from \"react/jsx-runtime\";\nvar loaderVariants = cva7(\n \"flex justify-center items-center w-full\",\n {\n variants: {\n size: {\n small: \"h-6 w-6\",\n medium: \"h-8 w-8\",\n large: \"h-12 w-12\",\n xl: \"h-24 w-24\"\n },\n colorVariant: {\n default: \"text-primary\",\n primary: \"text-primary\",\n secondary: \"text-secondary\",\n destructive: \"text-destructive\"\n }\n },\n defaultVariants: {\n size: \"medium\",\n colorVariant: \"default\"\n }\n }\n);\nvar Loader = React31.forwardRef(\n ({ className, size, colorVariant, ...props }, ref) => /* @__PURE__ */ jsx39(\n \"div\",\n {\n ref,\n className: cn(loaderVariants({ size, colorVariant }), \"flex justify-center items-center h-full w-full\", className),\n ...props,\n children: /* @__PURE__ */ jsx39(Loader2, { className: \"animate-spin\" })\n }\n )\n);\nLoader.displayName = \"Loader\";\n\n// src/components/hooks/use-toast.ts\nimport * as React32 from \"react\";\n\n// src/components/atoms/ui/toaster.tsx\nimport { jsx as jsx40, jsxs as jsxs16 } from \"react/jsx-runtime\";\n\n// src/components/atoms/ui/think-indicator.tsx\nimport * as React33 from \"react\";\nimport { useState as useState5, useEffect as useEffect3 } from \"react\";\nimport { cva as cva8 } from \"class-variance-authority\";\nimport { jsx as jsx41, jsxs as jsxs17 } from \"react/jsx-runtime\";\nvar thinkIndicatorVariants = cva8(\n \"flex items-center gap-3\",\n {\n variants: {\n variant: {\n default: \"text-muted-foreground\",\n primary: \"text-primary\",\n secondary: \"text-secondary\"\n },\n size: {\n default: \"gap-3\",\n sm: \"gap-2\",\n lg: \"gap-4\"\n }\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\"\n }\n }\n);\nvar ThinkIndicator = React33.forwardRef(\n ({\n className,\n variant,\n size,\n thoughts = [\n \"Analyzing your request...\",\n \"Processing information...\",\n \"Formulating response...\"\n ],\n interval = 5e3,\n loader,\n ...props\n }, ref) => {\n const [currentThoughtIndex, setCurrentThoughtIndex] = useState5(0);\n const [isAnimating, setIsAnimating] = useState5(false);\n useEffect3(() => {\n const timer = setInterval(() => {\n setIsAnimating(true);\n setTimeout(() => {\n setCurrentThoughtIndex((prev) => {\n return prev < thoughts.length - 1 ? prev + 1 : prev;\n });\n setIsAnimating(false);\n }, 300);\n }, interval);\n if (currentThoughtIndex === thoughts.length - 1) {\n clearInterval(timer);\n }\n return () => clearInterval(timer);\n }, [thoughts, interval, currentThoughtIndex]);\n return /* @__PURE__ */ jsxs17(\n \"div\",\n {\n ref,\n className: cn(thinkIndicatorVariants({ variant, size }), className, \"alq--think-indicator\"),\n ...props,\n children: [\n loader || /* @__PURE__ */ jsx41(\n Loader,\n {\n className: cn(\n size === \"sm\" ? \"h-3 w-3\" : size === \"lg\" ? \"h-5 w-5\" : \"h-4 w-4\"\n )\n }\n ),\n /* @__PURE__ */ jsx41(\n \"div\",\n {\n className: cn(\n \"alq--think-indicator-text\",\n \"transition-all duration-300\",\n isAnimating ? \"opacity-0 -translate-y-2\" : \"opacity-100 translate-y-0\"\n ),\n children: thoughts[currentThoughtIndex]\n }\n )\n ]\n }\n );\n }\n);\nThinkIndicator.displayName = \"ThinkIndicator\";\n\n// src/components/molecules/page-container.tsx\nimport { forwardRef as forwardRef30 } from \"react\";\nimport { jsx as jsx42 } from \"react/jsx-runtime\";\nvar PageContainer = forwardRef30(\n ({ className, ...props }, ref) => {\n return /* @__PURE__ */ jsx42(\n \"div\",\n {\n ref,\n className: cn(className, \"alq--page-container\"),\n ...props\n }\n );\n }\n);\nPageContainer.displayName = \"PageContainer\";\n\n// src/components/molecules/assistant-button.tsx\nimport * as React34 from \"react\";\nimport { useState as useState6 } from \"react\";\nimport { jsx as jsx43, jsxs as jsxs18 } from \"react/jsx-runtime\";\nvar AssistantSuggestions = React34.forwardRef(({ suggestions, showSuggestions, className }, ref) => {\n return /* @__PURE__ */ jsx43(\n \"div\",\n {\n ref,\n className: cn(\n \"absolute bottom-[calc(100%+0.5rem)] right-0 pb-2 mb-4 alq--assistant-suggestions-container\",\n \"transition-all duration-300\",\n showSuggestions ? \"opacity-100 translate-y-0\" : \"opacity-0 translate-y-4\",\n className\n ),\n children: /* @__PURE__ */ jsx43(\"div\", { className: \"rounded-lg p-2 pr-0 w-64\", children: suggestions.map((suggestion, index) => /* @__PURE__ */ jsxs18(\n \"button\",\n {\n onClick: () => suggestion.action?.(),\n style: {\n transitionDelay: showSuggestions ? `${index * 50}ms` : \"0ms\"\n },\n className: cn(\n \"bg-background flex items-center gap-2 border p-2 pr-4 my-2 rounded-full ml-auto\",\n \"text-primary hover:bg-secondary\",\n \"transition-all duration-100\",\n \"origin-bottom w-fit\",\n \"alq--assistant-suggestion\",\n showSuggestions ? \"opacity-100 translate-y-0\" : \"opacity-0 translate-y-4\"\n ),\n children: [\n /* @__PURE__ */ jsx43(suggestion.icon, { className: \"w-5 h-5 text-primary\" }),\n /* @__PURE__ */ jsx43(\"span\", { className: \"text-xs whitespace-nowrap font-normal\", children: suggestion.label })\n ]\n },\n index\n )) })\n }\n );\n});\nAssistantSuggestions.displayName = \"Suggestions\";\nvar AssistantButton = React34.forwardRef(\n ({\n icon: Icon2,\n clickAction,\n className,\n suggestions = []\n }, ref) => {\n const [isVisible, setIsVisible] = useState6(false);\n const [showSuggestions, setShowSuggestions] = useState6(false);\n const handleMouseEnter = () => {\n setIsVisible(true);\n requestAnimationFrame(() => {\n requestAnimationFrame(() => {\n setShowSuggestions(true);\n });\n });\n };\n const handleMouseLeave = () => {\n setShowSuggestions(false);\n setTimeout(() => setIsVisible(false), 300);\n };\n return /* @__PURE__ */ jsx43(\n \"div\",\n {\n ref,\n className: cn(\n \"fixed bottom-8 right-4 z-50\",\n \"alq--assistant-button-container\",\n className\n ),\n onMouseEnter: handleMouseEnter,\n onMouseLeave: handleMouseLeave,\n children: /* @__PURE__ */ jsxs18(\"div\", { className: \"relative group\", children: [\n isVisible && suggestions.length > 0 && /* @__PURE__ */ jsx43(\n AssistantSuggestions,\n {\n suggestions,\n showSuggestions\n }\n ),\n /* @__PURE__ */ jsx43(\n Button,\n {\n variant: \"outline\",\n size: \"sm\",\n className: cn(\n \"fixed hover:bg-opacity-70 transition-all duration-300\",\n \"bottom-4 h-12 w-12 right-4 z-50 rounded-full p-2\",\n \"shadow-md\",\n \"hover:shadow-lg\",\n showSuggestions ? \"scale-110\" : \"hover:scale-105\",\n \"alq--assistant-button\"\n ),\n onClick: clickAction,\n children: /* @__PURE__ */ jsx43(\n Icon2,\n {\n style: { width: \"22px\", height: \"22px\" },\n className: \"text-primary\"\n }\n )\n }\n )\n ] })\n }\n );\n }\n);\nAssistantButton.displayName = \"AssistantButton\";\n\n// src/components/molecules/carousel.tsx\nimport * as React35 from \"react\";\nimport useEmblaCarousel from \"embla-carousel-react\";\nimport { ArrowLeft, ArrowRight } from \"lucide-react\";\nimport { jsx as jsx44, jsxs as jsxs19 } from \"react/jsx-runtime\";\nvar CarouselContext = React35.createContext(null);\nfunction useCarousel() {\n const context = React35.useContext(CarouselContext);\n if (!context) {\n throw new Error(\"useCarousel must be used within a <Carousel />\");\n }\n return context;\n}\nvar Carousel = React35.forwardRef(\n ({\n orientation = \"horizontal\",\n opts: opts2,\n setApi,\n plugins,\n className,\n children,\n ...props\n }, ref) => {\n const [carouselRef, api] = useEmblaCarousel(\n {\n ...opts2,\n axis: orientation === \"horizontal\" ? \"x\" : \"y\"\n },\n plugins\n );\n const [canScrollPrev, setCanScrollPrev] = React35.useState(false);\n const [canScrollNext, setCanScrollNext] = React35.useState(false);\n const onSelect = React35.useCallback((api2) => {\n if (!api2) {\n return;\n }\n setCanScrollPrev(api2.canScrollPrev());\n setCanScrollNext(api2.canScrollNext());\n }, []);\n const scrollPrev = React35.useCallback(() => {\n api?.scrollPrev();\n }, [api]);\n const scrollNext = React35.useCallback(() => {\n api?.scrollNext();\n }, [api]);\n const handleKeyDown = React35.useCallback(\n (event) => {\n if (event.key === \"ArrowLeft\") {\n event.preventDefault();\n scrollPrev();\n } else if (event.key === \"ArrowRight\") {\n event.preventDefault();\n scrollNext();\n }\n },\n [scrollPrev, scrollNext]\n );\n React35.useEffect(() => {\n if (!api || !setApi) {\n return;\n }\n setApi(api);\n }, [api, setApi]);\n React35.useEffect(() => {\n if (!api) {\n return;\n }\n onSelect(api);\n api.on(\"reInit\", onSelect);\n api.on(\"select\", onSelect);\n return () => {\n api?.off(\"select\", onSelect);\n };\n }, [api, onSelect]);\n return /* @__PURE__ */ jsx44(\n CarouselContext.Provider,\n {\n value: {\n carouselRef,\n api,\n opts: opts2,\n orientation: orientation || (opts2?.axis === \"y\" ? \"vertical\" : \"horizontal\"),\n scrollPrev,\n scrollNext,\n canScrollPrev,\n canScrollNext\n },\n children: /* @__PURE__ */ jsx44(\n \"div\",\n {\n ref,\n onKeyDownCapture: handleKeyDown,\n className: cn(\"relative\", className),\n role: \"region\",\n \"aria-roledescription\": \"carousel\",\n ...props,\n children\n }\n )\n }\n );\n }\n);\nCarousel.displayName = \"Carousel\";\nvar CarouselContent = React35.forwardRef(({ className, ...props }, ref) => {\n const { carouselRef, orientation } = useCarousel();\n return /* @__PURE__ */ jsx44(\"div\", { ref: carouselRef, className: \"overflow-hidden\", children: /* @__PURE__ */ jsx44(\n \"div\",\n {\n ref,\n className: cn(\n \"flex\",\n orientation === \"horizontal\" ? \"-ml-4\" : \"-mt-4 flex-col\",\n className\n ),\n ...props\n }\n ) });\n});\nCarouselContent.displayName = \"CarouselContent\";\nvar CarouselItem = React35.forwardRef(({ className, ...props }, ref) => {\n const { orientation } = useCarousel();\n return /* @__PURE__ */ jsx44(\n \"div\",\n {\n ref,\n role: \"group\",\n \"aria-roledescription\": \"slide\",\n className: cn(\n \"min-w-0 shrink-0 grow-0 basis-full\",\n orientation === \"horizontal\" ? \"pl-4\" : \"pt-4\",\n className\n ),\n ...props\n }\n );\n});\nCarouselItem.displayName = \"CarouselItem\";\nvar CarouselPrevious = React35.forwardRef(({ className, variant = \"outline\", size = \"icon\", ...props }, ref) => {\n const { orientation, scrollPrev, canScrollPrev } = useCarousel();\n return /* @__PURE__ */ jsxs19(\n Button,\n {\n ref,\n variant,\n size,\n className: cn(\n \"absolute h-8 w-8 rounded-full\",\n orientation === \"horizontal\" ? \"-left-12 top-1/2 -translate-y-1/2\" : \"-top-12 left-1/2 -translate-x-1/2 rotate-90\",\n className\n ),\n disabled: !canScrollPrev,\n onClick: scrollPrev,\n ...props,\n children: [\n /* @__PURE__ */ jsx44(ArrowLeft, { className: \"h-4 w-4\" }),\n /* @__PURE__ */ jsx44(\"span\", { className: \"sr-only\", children: \"Previous slide\" })\n ]\n }\n );\n});\nCarouselPrevious.displayName = \"CarouselPrevious\";\nvar CarouselNext = React35.forwardRef(({ className, variant = \"outline\", size = \"icon\", ...props }, ref) => {\n const { orientation, scrollNext, canScrollNext } = useCarousel();\n return /* @__PURE__ */ jsxs19(\n Button,\n {\n ref,\n variant,\n size,\n className: cn(\n \"absolute h-8 w-8 rounded-full\",\n orientation === \"horizontal\" ? \"-right-12 top-1/2 -translate-y-1/2\" : \"-bottom-12 left-1/2 -translate-x-1/2 rotate-90\",\n className\n ),\n disabled: !canScrollNext,\n onClick: scrollNext,\n ...props,\n children: [\n /* @__PURE__ */ jsx44(ArrowRight, { className: \"h-4 w-4\" }),\n /* @__PURE__ */ jsx44(\"span\", { className: \"sr-only\", children: \"Next slide\" })\n ]\n }\n );\n});\nCarouselNext.displayName = \"CarouselNext\";\n\n// src/components/molecules/navigation-menu.tsx\nimport * as React36 from \"react\";\nimport * as NavigationMenuPrimitive from \"@radix-ui/react-navigation-menu\";\nimport { cva as cva9 } from \"class-variance-authority\";\nimport { ChevronDown as ChevronDown3 } from \"lucide-react\";\nimport { jsx as jsx45, jsxs as jsxs20 } from \"react/jsx-runtime\";\nvar NavigationMenu = React36.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs20(\n NavigationMenuPrimitive.Root,\n {\n ref,\n className: cn(\n \"relative z-10 flex max-w-max flex-1 items-center justify-center\",\n className\n ),\n ...props,\n children: [\n children,\n /* @__PURE__ */ jsx45(NavigationMenuViewport, {})\n ]\n }\n));\nNavigationMenu.displayName = NavigationMenuPrimitive.Root.displayName;\nvar NavigationMenuList = React36.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx45(\n NavigationMenuPrimitive.List,\n {\n ref,\n className: cn(\n \"group flex flex-1 list-none items-center justify-center space-x-1\",\n className\n ),\n ...props\n }\n));\nNavigationMenuList.displayName = NavigationMenuPrimitive.List.displayName;\nvar navigationMenuTriggerStyle = cva9(\n \"group inline-flex h-10 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-none disabled:pointer-events-none disabled:opacity-50 data-[active]:bg-accent/50 data-[state=open]:bg-accent/50\"\n);\nvar NavigationMenuTrigger = React36.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs20(\n NavigationMenuPrimitive.Trigger,\n {\n ref,\n className: cn(navigationMenuTriggerStyle(), \"group\", className),\n ...props,\n children: [\n children,\n \" \",\n /* @__PURE__ */ jsx45(\n ChevronDown3,\n {\n className: \"relative top-[1px] ml-1 h-3 w-3 transition duration-200 group-data-[state=open]:rotate-180\",\n \"aria-hidden\": \"true\"\n }\n )\n ]\n }\n));\nNavigationMenuTrigger.displayName = NavigationMenuPrimitive.Trigger.displayName;\nvar NavigationMenuContent = React36.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx45(\n NavigationMenuPrimitive.Content,\n {\n ref,\n className: cn(\n \"left-0 top-0 w-full data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 md:absolute md:w-auto \",\n className\n ),\n ...props\n }\n));\nNavigationMenuContent.displayName = NavigationMenuPrimitive.Content.displayName;\nvar NavigationMenuViewport = React36.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx45(\"div\", { className: cn(\"absolute left-0 top-full flex justify-center\"), children: /* @__PURE__ */ jsx45(\n NavigationMenuPrimitive.Viewport,\n {\n className: cn(\n \"origin-top-center relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 md:w-[var(--radix-navigation-menu-viewport-width)]\",\n className\n ),\n ref,\n ...props\n }\n) }));\nNavigationMenuViewport.displayName = NavigationMenuPrimitive.Viewport.displayName;\nvar NavigationMenuIndicator = React36.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx45(\n NavigationMenuPrimitive.Indicator,\n {\n ref,\n className: cn(\n \"top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in\",\n className\n ),\n ...props,\n children: /* @__PURE__ */ jsx45(\"div\", { className: \"relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md\" })\n }\n));\nNavigationMenuIndicator.displayName = NavigationMenuPrimitive.Indicator.displayName;\n\n// src/components/molecules/sidebar.tsx\nimport * as React37 from \"react\";\nimport { cva as cva10 } from \"class-variance-authority\";\nimport { jsx as jsx46, jsxs as jsxs21 } from \"react/jsx-runtime\";\nvar sidebarVariants = cva10(\n \"flex flex-col border-r\",\n {\n variants: {\n size: {\n sm: \"w-48\",\n default: \"w-64\",\n lg: \"w-72\"\n }\n },\n defaultVariants: {\n size: \"default\"\n }\n }\n);\nvar SidebarFooter = React37.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsx46(\n \"div\",\n {\n ref,\n className: cn(\"p-4\", className),\n ...props,\n children\n }\n));\nSidebarFooter.displayName = \"SidebarFooter\";\nvar Sidebar = React37.forwardRef(\n ({\n className,\n items,\n selectedSection,\n onSelect,\n footerContent,\n size = \"default\",\n selectedVariant = \"secondary\",\n defaultVariant = \"ghost\",\n buttonClassName,\n ...props\n }, ref) => {\n return /* @__PURE__ */ jsx46(\"div\", { className: cn(className, \"alq--navigation-sidebar h-full\"), ref, ...props, children: /* @__PURE__ */ jsxs21(\"aside\", { className: cn(sidebarVariants({ size }), \"h-full\"), children: [\n /* @__PURE__ */ jsx46(ScrollArea, { className: \"flex-grow justify-between\", children: /* @__PURE__ */ jsx46(\"div\", { className: \"flex flex-col gap-2 p-4\", children: items.map((item) => /* @__PURE__ */ jsxs21(\n Button,\n {\n variant: selectedSection?.name === item.name ? selectedVariant : defaultVariant,\n className: cn(\"justify-start\", buttonClassName),\n disabled: item.disabled,\n onClick: () => {\n if (onSelect) {\n onSelect(item);\n }\n },\n children: [\n item.icon && /* @__PURE__ */ jsx46(item.icon, { className: \"mr-2 h-4 w-4\" }),\n item.name\n ]\n },\n item.name\n )) }) }),\n footerContent && /* @__PURE__ */ jsx46(SidebarFooter, { children: footerContent })\n ] }) });\n }\n);\n\n// src/components/molecules/sonner.tsx\nimport { Toaster as Sonner } from \"sonner\";\n\n// src/providers/theme-context.ts\nimport { createContext as createContext2, useContext as useContext2 } from \"react\";\nvar ThemeContext = createContext2({\n theme: \"system\",\n setTheme: () => {\n }\n});\n\n// src/components/molecules/sonner.tsx\nimport { jsx as jsx47 } from \"react/jsx-runtime\";\n\n// src/components/molecules/rating-stars.tsx\nimport * as React38 from \"react\";\nimport * as TooltipPrimitive from \"@radix-ui/react-tooltip\";\nimport { Star as Star2 } from \"lucide-react\";\nimport { jsx as jsx48, jsxs as jsxs22 } from \"react/jsx-runtime\";\nvar TooltipProvider = TooltipPrimitive.Provider;\nvar Tooltip3 = TooltipPrimitive.Root;\nvar TooltipTrigger = TooltipPrimitive.Trigger;\nvar TooltipContent = React38.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx48(\n TooltipPrimitive.Content,\n {\n ref,\n sideOffset,\n className: cn(\n \"z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground shadow-lg animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 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\",\n className\n ),\n ...props\n }\n));\nTooltipContent.displayName = TooltipPrimitive.Content.displayName;\nvar StarRating = React38.forwardRef(({ rating, onRate }, ref) => /* @__PURE__ */ jsx48(\"div\", { ref, className: \"flex\", children: [1, 2, 3, 4, 5].map((star) => /* @__PURE__ */ jsx48(\n Button,\n {\n onClick: () => onRate(star),\n variant: \"link\",\n className: \"p-1 transition-colors [&_svg]:size-5 h-5\",\n \"aria-label\": `Rate ${star} star${star !== 1 ? \"s\" : \"\"}`,\n children: /* @__PURE__ */ jsx48(\n Star2,\n {\n className: cn(\n \"w-5 h-5\",\n star <= rating ? \"alq-rating-star-active fill-current stroke-current\" : \"alq-rating-star-inactive\"\n )\n }\n )\n },\n star\n)) }));\nStarRating.displayName = \"StarRating\";\nvar RatingStars = React38.forwardRef(({\n currentRating = 0,\n onRate,\n className,\n isLoading\n}, ref) => {\n const [open, setOpen] = React38.useState(false);\n const [animate, setAnimate] = React38.useState(false);\n const handleRate = (rating) => {\n onRate(rating);\n setOpen(false);\n };\n React38.useEffect(() => {\n if (currentRating > 0) {\n setAnimate(true);\n const timer = setTimeout(() => setAnimate(false), 150);\n return () => clearTimeout(timer);\n }\n }, [currentRating]);\n const hasRated = currentRating > 0;\n return /* @__PURE__ */ jsx48(TooltipProvider, { children: /* @__PURE__ */ jsxs22(Tooltip3, { open, onOpenChange: setOpen, children: [\n /* @__PURE__ */ jsx48(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx48(\n Button,\n {\n ref,\n variant: \"link\",\n className: cn(\n \"inline-flex items-center justify-center rounded-md text-sm font-medium [&_svg]:size-5 transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50\",\n className\n ),\n disabled: isLoading,\n onClick: () => setOpen(!open),\n children: /* @__PURE__ */ jsx48(\n Star2,\n {\n className: cn(\n \"w-5 h-5 transition-all duration-500\",\n animate && \"animate-ping\",\n isLoading && \"animate-pulse\",\n hasRated ? \"alq-rating-star-active fill-current stroke-current\" : \"alq-rating-star-inactive\"\n )\n }\n )\n }\n ) }),\n /* @__PURE__ */ jsx48(TooltipContent, { side: \"top\", align: \"center\", className: \"p-0\", children: /* @__PURE__ */ jsx48(\"div\", { className: \"p-2 bg-background\", children: /* @__PURE__ */ jsx48(\n StarRating,\n {\n rating: currentRating,\n onRate: handleRate\n }\n ) }) })\n ] }) });\n});\nRatingStars.displayName = \"RatingStars\";\n\n// src/components/molecules/rating-thumbs.tsx\nimport * as React39 from \"react\";\nimport { ThumbsUp, ThumbsDown } from \"lucide-react\";\nimport { jsx as jsx49, jsxs as jsxs23 } from \"react/jsx-runtime\";\nvar RatingThumbs = React39.forwardRef(\n ({\n currentRating,\n onRate,\n direction = \"row\",\n className,\n isLoading\n }, ref) => {\n const [animate, setAnimate] = React39.useState(false);\n React39.useEffect(() => {\n if (currentRating) {\n setAnimate(true);\n const timer = setTimeout(() => setAnimate(false), 150);\n return () => clearTimeout(timer);\n }\n }, [currentRating]);\n return /* @__PURE__ */ jsxs23(\n \"div\",\n {\n ref,\n className: cn(\n \"inline-flex\",\n direction === \"column\" ? \"flex-col\" : \"flex-row\",\n \"space-x-1 gap-4\",\n className\n ),\n children: [\n /* @__PURE__ */ jsx49(\n Button,\n {\n variant: \"link\",\n onClick: () => onRate(currentRating === \"thumbsUp\" ? \"\" : \"thumbsUp\"),\n className: cn(\n \"p-1 transition-colors disabled:opacity-50 [&_svg]:size-5\",\n `hover:alq-rating-thumbsup/10`\n ),\n \"aria-label\": \"Thumbs up\",\n disabled: isLoading,\n children: /* @__PURE__ */ jsx49(\n ThumbsUp,\n {\n className: cn(\n \"w-5 h-5 transition-all duration-500\",\n animate && currentRating === \"thumbsUp\" && \"animate-ping\",\n isLoading && \"animate-pulse\",\n currentRating === \"thumbsUp\" ? \"alq-rating-thumbsup fill-current stroke-current\" : \"alq-rating-thumbs-inactive fill-transparent\"\n )\n }\n )\n }\n ),\n /* @__PURE__ */ jsx49(\n Button,\n {\n variant: \"link\",\n onClick: () => onRate(currentRating === \"thumbsDown\" ? \"\" : \"thumbsDown\"),\n className: cn(\n \"p-1 transition-colors disabled:opacity-50 mt-0.5 [&_svg]:size-5\",\n `hover:bg-alq-rating-thumbsdown/10`\n ),\n \"aria-label\": \"Thumbs down\",\n disabled: isLoading,\n children: /* @__PURE__ */ jsx49(\n ThumbsDown,\n {\n className: cn(\n \"w-5 h-5 transition-all duration-500\",\n animate && currentRating === \"thumbsDown\" && \"animate-ping\",\n isLoading && \"animate-pulse\",\n currentRating === \"thumbsDown\" ? \"alq-rating-thumbsdown fill-current stroke-current\" : \"alq-rating-thumbs-inactive fill-transparent\"\n )\n }\n )\n }\n )\n ]\n }\n );\n }\n);\nRatingThumbs.displayName = \"RatingThumbs\";\n\n// src/components/molecules/rating-comment.tsx\nimport * as React40 from \"react\";\nimport { Book } from \"lucide-react\";\nimport { jsx as jsx50, jsxs as jsxs24 } from \"react/jsx-runtime\";\nvar RatingComment = React40.forwardRef(\n ({ currentRating, onRate, className, isLoading }, ref) => {\n const [open, setOpen] = React40.useState(false);\n const [comment, setComment] = React40.useState(\"\");\n const [animate, setAnimate] = React40.useState(false);\n const handleRate = () => {\n onRate(comment);\n setOpen(false);\n };\n React40.useEffect(() => {\n if (currentRating) {\n setAnimate(true);\n const timer = setTimeout(() => setAnimate(false), 150);\n return () => clearTimeout(timer);\n }\n }, [currentRating]);\n React40.useEffect(() => {\n setComment(\"\");\n }, [open]);\n return /* @__PURE__ */ jsxs24(Dialog, { open, onOpenChange: setOpen, children: [\n /* @__PURE__ */ jsx50(DialogTrigger, { asChild: true, children: /* @__PURE__ */ jsx50(\n Button,\n {\n ref,\n variant: \"link\",\n size: \"lg\",\n className: cn(\n \"inline-flex p-2 items-center justify-center rounded-md text-sm font-medium transition-colors [&_svg]:size-5 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring bg-transparent hover:none disabled:pointer-events-none disabled:opacity-50\",\n className\n ),\n disabled: isLoading,\n children: /* @__PURE__ */ jsx50(\n Book,\n {\n className: cn(\n \"w-5 h-5 transition-all duration-500\",\n animate && \"animate-ping\",\n isLoading && \"animate-pulse\",\n `${comment ? \"alq-rating-comment\" : \"stroke-gray-400\"}`\n )\n }\n )\n }\n ) }),\n /* @__PURE__ */ jsx50(DialogOverlay, { className: \"fixed inset-0 bg-black bg-opacity-50\" }),\n /* @__PURE__ */ jsxs24(DialogContent, { \"aria-describedby\": void 0, children: [\n /* @__PURE__ */ jsx50(DialogTitle, { className: \"text-lg font-medium\", children: \"Deja un comentario\" }),\n /* @__PURE__ */ jsx50(\n \"textarea\",\n {\n className: \"mt-4 w-full p-2 border rounded-md focus:outline-none focus:ring-2 focus:ring-primary\",\n rows: 4,\n value: comment,\n onChange: (e) => setComment(e.target.value)\n }\n ),\n /* @__PURE__ */ jsx50(\"div\", { className: \"mt-4 flex justify-end\", children: /* @__PURE__ */ jsx50(\n Button,\n {\n onClick: handleRate,\n disabled: !comment,\n children: \"Enviar\"\n }\n ) })\n ] })\n ] });\n }\n);\nRatingComment.displayName = \"RatingComment\";\n\n// src/components/molecules/call-out.tsx\nimport * as React41 from \"react\";\nimport { ChevronDown as ChevronDown4, ChevronUp as ChevronUp2 } from \"lucide-react\";\n\n// src/components/hooks/use-text-streaming.ts\nimport { useState as useState11, useEffect as useEffect9, useRef, useCallback as useCallback2 } from \"react\";\nvar CHAR_DELAY = 15;\nvar PUNCTUATION_DELAY = 300;\nfunction useTextStreaming(content, shouldStream, handleIsTextStreaming) {\n const [displayedText, setDisplayedText] = useState11(\"\");\n const contentRef = useRef(content);\n const indexRef = useRef(0);\n const timerRef = useRef(null);\n const hasStartedStreaming = useRef(false);\n useEffect9(() => {\n contentRef.current = content;\n if (hasStartedStreaming.current && !timerRef.current && indexRef.current < contentRef.current.length) {\n typeNext();\n }\n }, [content]);\n const typeNext = useCallback2(() => {\n if (indexRef.current < contentRef.current.length) {\n const nextChar = contentRef.current.charAt(indexRef.current);\n setDisplayedText((prev) => prev + nextChar);\n indexRef.current++;\n const delay = /[.!?;:]/.test(nextChar) ? PUNCTUATION_DELAY : CHAR_DELAY;\n timerRef.current = setTimeout(() => {\n timerRef.current = null;\n typeNext();\n }, delay);\n } else {\n handleIsTextStreaming?.(false);\n }\n }, []);\n useEffect9(() => {\n if (!shouldStream && !hasStartedStreaming.current) {\n setDisplayedText(contentRef.current);\n indexRef.current = contentRef.current.length;\n if (timerRef.current) {\n clearTimeout(timerRef.current);\n timerRef.current = null;\n }\n handleIsTextStreaming?.(false);\n } else {\n if (indexRef.current < contentRef.current.length && !timerRef.current) {\n handleIsTextStreaming?.(true);\n hasStartedStreaming.current = true;\n typeNext();\n }\n }\n return () => {\n if (timerRef.current) {\n clearTimeout(timerRef.current);\n timerRef.current = null;\n }\n };\n }, [shouldStream, typeNext]);\n return displayedText;\n}\n\n// src/components/molecules/call-out.tsx\nimport { jsx as jsx51, jsxs as jsxs25 } from \"react/jsx-runtime\";\nvar CallOut = React41.forwardRef(({ className, children, role, ...props }, ref) => {\n return /* @__PURE__ */ jsx51(\n \"div\",\n {\n ref,\n className: cn(\"alq--callout-box\", className),\n \"data-role\": role,\n ...props,\n children\n }\n );\n});\nvar CallOutDate = React41.forwardRef(({ className, children, ...props }, ref) => {\n return /* @__PURE__ */ jsx51(\n \"div\",\n {\n ref,\n className: cn(\n \"alq--callout-date\",\n \"text-sm text-muted-foreground\",\n className\n ),\n ...props,\n children\n }\n );\n});\nvar CallOutActions = React41.forwardRef(({ className, actions, role, message, ...props }, ref) => {\n const [isLoading, setIsLoading] = React41.useState(false);\n const [isClicked, setIsClicked] = React41.useState(false);\n if (role === \"user\") {\n return null;\n }\n return /* @__PURE__ */ jsx51(\"div\", { ref, className: cn(\"alq--callout-actions\", className), ...props, children: actions.map((action) => action.custom ? /* @__PURE__ */ jsx51(React41.Fragment, { children: action.component?.({ message }) }, action.label) : /* @__PURE__ */ jsxs25(\n \"button\",\n {\n className: cn(\n \"alq--callout-action\",\n {\n \"alq--callout-animate-action\": isLoading\n },\n {\n \"alq--callout-clicked-action\": isClicked\n }\n ),\n type: \"button\",\n title: action.label,\n onClick: () => {\n setIsLoading(true);\n action.onClick(message).then(() => {\n setIsLoading(false);\n setIsClicked(true);\n });\n },\n children: [\n /* @__PURE__ */ jsx51(\n \"span\",\n {\n className: cn(\"alq-action-icon-wrapper\", {\n \"alq--callout-animate-action\": isLoading\n }),\n children: action.icon\n }\n ),\n /* @__PURE__ */ jsx51(\"label\", { children: action.label })\n ]\n },\n action.label\n )) });\n});\nvar CallOutResponse = React41.forwardRef(\n ({\n className,\n children,\n role,\n additionalInfo,\n toggleAdditionalInfo,\n isStreaming,\n handleIsTextStreaming,\n ...props\n }, ref) => {\n const [isAdditionalInfoOpen, setIsAdditionalInfoOpen] = React41.useState(false);\n const content = String(children || \"\");\n const shouldStream = role === \"assistant\" && isStreaming;\n const displayedContent = useTextStreaming(\n content,\n shouldStream ?? false,\n handleIsTextStreaming\n );\n const showAsToggle = additionalInfo && toggleAdditionalInfo;\n const showInline = additionalInfo && !toggleAdditionalInfo;\n return /* @__PURE__ */ jsxs25(\n \"div\",\n {\n ref,\n \"data-role\": role,\n className: cn(\n \"alq--callout-response\",\n \"max-w-none\",\n \"text-foreground\",\n className\n ),\n ...props,\n children: [\n /* @__PURE__ */ jsx51(RichText, { content: displayedContent }),\n showInline && /* @__PURE__ */ jsx51(\n \"div\",\n {\n className: cn(\n \"alq--callout-response-additional-info\",\n \"mt-2 text-sm text-muted-foreground whitespace-pre-line\",\n \"border-t border-border pt-2\"\n ),\n children: additionalInfo\n }\n ),\n showAsToggle && /* @__PURE__ */ jsxs25(\n \"div\",\n {\n className: cn(\n \"alq--callout-response-additional-info\",\n \"mt-2 border-t border-border pt-2\"\n ),\n children: [\n /* @__PURE__ */ jsxs25(\n Button,\n {\n type: \"button\",\n variant: \"ghost\",\n size: \"sm\",\n className: \"h-auto py-1.5 px-0 text-xs text-muted-foreground hover:bg-transparent hover:text-muted-foreground -ml-1\",\n onClick: () => setIsAdditionalInfoOpen((prev) => !prev),\n \"aria-expanded\": isAdditionalInfoOpen,\n children: [\n isAdditionalInfoOpen ? /* @__PURE__ */ jsx51(ChevronUp2, { className: \"h-4 w-4 mr-1.5 shrink-0 transition-transform\" }) : /* @__PURE__ */ jsx51(ChevronDown4, { className: \"h-4 w-4 mr-1.5 shrink-0 transition-transform\" }),\n isAdditionalInfoOpen ? \"Hide details\" : \"Show details\"\n ]\n }\n ),\n /* @__PURE__ */ jsx51(\n \"div\",\n {\n className: cn(\n \"grid transition-[grid-template-rows] duration-200 ease-out\",\n isAdditionalInfoOpen ? \"grid-rows-[1fr]\" : \"grid-rows-[0fr]\"\n ),\n children: /* @__PURE__ */ jsx51(\"div\", { className: \"overflow-hidden\", children: /* @__PURE__ */ jsx51(\"div\", { className: \"text-sm text-muted-foreground pt-1 whitespace-pre-line\", children: additionalInfo }) })\n }\n )\n ]\n }\n )\n ]\n }\n );\n }\n);\nCallOut.displayName = \"CallOut\";\nCallOutDate.displayName = \"CallOutDate\";\nCallOutActions.displayName = \"CallOutActions\";\nCallOutResponse.displayName = \"CallOutResponse\";\n\n// src/components/organisms/assistant.tsx\nimport { Send } from \"lucide-react\";\nimport { jsx as jsx52, jsxs as jsxs26 } from \"react/jsx-runtime\";\nvar Assistant = React42.forwardRef(\n ({ className, sdk, title, description, children, ...props }, ref) => {\n return /* @__PURE__ */ jsxs26(\n \"div\",\n {\n ref,\n className: cn(\"flex flex-col h-full bg-background text-foreground\", className),\n ...props,\n children: [\n (title || description) && /* @__PURE__ */ jsxs26(AssistantHeader, { children: [\n title && /* @__PURE__ */ jsx52(AssistantTitle, { title }),\n description && /* @__PURE__ */ jsx52(AssistantDescription, { description })\n ] }),\n children\n ]\n }\n );\n }\n);\nAssistant.displayName = \"Assistant\";\nvar AssistantTitle = React42.forwardRef(\n ({ className, title, ...props }, ref) => /* @__PURE__ */ jsx52(\"div\", { ref, className: cn(\"text-foreground\", className), ...props, children: /* @__PURE__ */ jsx52(Typography, { typeStyle: \"heading1\", as: \"h1\", children: title }) })\n);\nAssistantTitle.displayName = \"AssistantTitle\";\nvar AssistantDescription = React42.forwardRef(({ className, description, ...props }, ref) => /* @__PURE__ */ jsx52(\"div\", { ref, className: cn(\"text-foreground\", className), ...props, children: /* @__PURE__ */ jsx52(Typography, { typeStyle: \"display\", as: \"p\", children: description }) }));\nAssistantDescription.displayName = \"AssistantDescription\";\nvar AssistantHeader = React42.forwardRef(\n ({ className, children, ...props }, ref) => /* @__PURE__ */ jsx52(\n \"div\",\n {\n ref,\n className: cn(\"bg-background text-foreground\", className),\n ...props,\n children\n }\n )\n);\nAssistantHeader.displayName = \"AssistantHeader\";\nvar AssistantMessageArea = React42.forwardRef(\n ({\n className,\n messages,\n messagesEndRef,\n actions,\n streamingMessageId,\n thinkIndicator,\n handleIsTextStreaming,\n toolFactory,\n isLoading,\n showDetailedErrors,\n interleave,\n awaitingUser,\n isMessageStreaming: _isMessageStreaming,\n ...props\n }, ref) => {\n useEffect10(() => {\n messagesEndRef.current?.scrollIntoView({ behavior: \"instant\" });\n }, []);\n return /* @__PURE__ */ jsxs26(\n \"div\",\n {\n ref,\n className: cn(\"p-6 overflow-y-auto flex-grow bg-background\", className),\n ...props,\n children: [\n interleave?.(0),\n messages.map((message, index) => /* @__PURE__ */ jsxs26(\"div\", { children: [\n /* @__PURE__ */ jsxs26(\n CallOut,\n {\n role: message.role,\n message,\n children: [\n streamingMessageId === message.id && (isLoading || message.content.length === 0) && !message.error_code && !awaitingUser && /* @__PURE__ */ jsx52(\"div\", { children: thinkIndicator ?? /* @__PURE__ */ jsx52(ThinkIndicator, {}) }),\n message.error_code && /* @__PURE__ */ jsx52(\n CallOutResponse,\n {\n role: \"assistant\",\n \"data-error-code\": message.error_code,\n additionalInfo: showDetailedErrors ? `${message.error_detail}${message.taskid ? `\ntask id: ${message.taskid}` : \"\"}` : void 0,\n toggleAdditionalInfo: true,\n children: getErrorMessage(message.error_code)\n }\n ),\n !message.error_code && message.tooler?.filter(hasToolResult).map((tool, index2) => /* @__PURE__ */ jsx52(React42.Fragment, { children: toolFactory?.createTool(tool.tool_summary?.name || \"\", tool.tool_output) }, tool.control_id || `${tool.tool_summary?.name}-${index2}`)),\n message.content && !message.error_code && /* @__PURE__ */ jsxs26(\n \"div\",\n {\n \"data-role\": message.role,\n className: \"alq--callout-message-container\",\n children: [\n message.created_at && streamingMessageId !== message.id && /* @__PURE__ */ jsx52(\"div\", { className: \"text-xs text-muted-foreground/80 pb-1 alq--callout-message-date\", children: new Date(Number(message.created_at)).toLocaleString(\n \"es-ES\",\n {\n hour: \"2-digit\",\n minute: \"2-digit\",\n hour12: false\n }\n ) }),\n /* @__PURE__ */ jsx52(\n CallOutResponse,\n {\n role: message.role,\n isStreaming: streamingMessageId === message.id,\n handleIsTextStreaming,\n additionalInfo: streamingMessageId !== message.id ? message?.additionalInfo : void 0,\n children: message.content\n }\n ),\n actions && streamingMessageId !== message.id && /* @__PURE__ */ jsx52(\n CallOutActions,\n {\n actions,\n message,\n role: message.role\n },\n message.id\n )\n ]\n }\n )\n ]\n },\n message.id\n ),\n interleave?.(index + 1)\n ] }, message.id)),\n /* @__PURE__ */ jsx52(\"div\", { ref: messagesEndRef })\n ]\n }\n );\n }\n);\nAssistantMessageArea.displayName = \"AssistantMessageArea\";\nvar AssistantInput = React42.forwardRef(\n ({\n className,\n sendMessageFunc,\n isButtonDisabled,\n input,\n handleInputChange,\n isMessageStreaming,\n speechToTextComponent,\n userToolboxComponent,\n placeholders,\n onFileDrop,\n attachmentsSlot,\n ...props\n }, ref) => {\n const [isDragging, setIsDragging] = useState13(false);\n const dragCounterRef = useRef2(0);\n const handleDragEnter = useCallback3((e) => {\n e.preventDefault();\n e.stopPropagation();\n dragCounterRef.current += 1;\n if (e.dataTransfer.types.includes(\"Files\")) {\n setIsDragging(true);\n }\n }, []);\n const handleDragOver = useCallback3((e) => {\n e.preventDefault();\n e.stopPropagation();\n }, []);\n const handleDragLeave = useCallback3((e) => {\n e.preventDefault();\n e.stopPropagation();\n dragCounterRef.current -= 1;\n if (dragCounterRef.current === 0) {\n setIsDragging(false);\n }\n }, []);\n const handleDrop = useCallback3(\n (e) => {\n e.preventDefault();\n e.stopPropagation();\n dragCounterRef.current = 0;\n setIsDragging(false);\n const files = Array.from(e.dataTransfer.files);\n if (files.length > 0) {\n onFileDrop?.(files);\n }\n },\n [onFileDrop]\n );\n const placeholder = placeholders ? isMessageStreaming ? placeholders[0] : placeholders[1] : isMessageStreaming ? \"Processing...\" : \"Type your message here...\";\n return /* @__PURE__ */ jsxs26(\n \"form\",\n {\n onSubmit: sendMessageFunc,\n className: cn(\n \"flex flex-col relative rounded-lg border border-input bg-background\",\n \"focus-within:ring-2 focus-within:ring-ring\",\n onFileDrop && isDragging && \"ring-2 ring-primary/50 alq--assistant-input-dragover\",\n className\n ),\n ref,\n onDragEnter: onFileDrop ? handleDragEnter : void 0,\n onDragOver: onFileDrop ? handleDragOver : void 0,\n onDragLeave: onFileDrop ? handleDragLeave : void 0,\n onDrop: onFileDrop ? handleDrop : void 0,\n ...props,\n children: [\n attachmentsSlot,\n /* @__PURE__ */ jsx52(\n \"textarea\",\n {\n disabled: isButtonDisabled,\n value: input,\n onChange: handleInputChange,\n placeholder,\n className: cn(\n \"flex-1 min-w-0 text-sm p-3 focus:outline-none w-full resize-none\",\n \"bg-transparent text-foreground\",\n \"placeholder:text-muted-foreground\",\n \"disabled:opacity-50 disabled:cursor-not-allowed\"\n ),\n onKeyDown: (e) => {\n if (e.key === \"Enter\" && !e.shiftKey) {\n e.preventDefault();\n sendMessageFunc(e);\n }\n }\n }\n ),\n /* @__PURE__ */ jsxs26(\"div\", { className: \"flex items-center relative alq--assistant-actions\", children: [\n userToolboxComponent,\n speechToTextComponent,\n /* @__PURE__ */ jsx52(\n \"button\",\n {\n type: \"submit\",\n \"aria-label\": \"Send\",\n disabled: isButtonDisabled,\n className: cn(\n \"w-10 h-10 rounded-full flex items-center justify-center alq--assistant-button-send\",\n isButtonDisabled ? \"bg-muted text-muted-foreground\" : \"bg-primary text-primary-foreground hover:bg-primary/90\"\n ),\n children: /* @__PURE__ */ jsx52(Send, { className: \"w-5 h-5\" })\n }\n )\n ] })\n ]\n }\n );\n }\n);\nAssistantInput.displayName = \"AssistantInput\";\n\n// src/components/genui/assistant-chat.tsx\nimport { jsx as jsx53, jsxs as jsxs27 } from \"react/jsx-runtime\";\nfunction TypingDots() {\n return /* @__PURE__ */ jsx53(\"div\", { className: \"flex w-fit items-center gap-1.5 rounded-2xl rounded-bl-md border border-border/60 bg-card px-4 py-3 shadow-sm\", children: [0, 1, 2].map((i) => /* @__PURE__ */ jsx53(\n \"span\",\n {\n className: \"h-2 w-2 animate-bounce rounded-full bg-primary\",\n style: { animationDelay: `${i * 0.15}s`, animationDuration: \"0.9s\" }\n },\n i\n )) });\n}\nfunction AssistantChat({\n alquimia,\n registry = coreUiRegistry,\n conversationId,\n placeholder = \"Ask the agent to build something\\u2026\",\n suggestions = [],\n className,\n thinkIndicator\n}) {\n const endRef = React43.useRef(null);\n const {\n messages,\n input,\n handleInputChange,\n handleSubmit,\n handleLoadingCancel,\n isLoading,\n isMessageStreaming,\n streamingMessageId,\n genui\n } = alquimia;\n const surfaces = genui?.surfaces ?? [];\n const awaitingUser = genui?.awaitingUser ?? false;\n const isBusy = !!(isLoading || isMessageStreaming);\n const hasContent = messages.some(\n (m) => m.role === \"user\" || m.role !== \"system\" && (m.content ?? \"\").trim().length > 0\n );\n const isEmpty = !hasContent && surfaces.length === 0;\n React43.useEffect(() => {\n endRef.current?.scrollIntoView({ behavior: \"smooth\" });\n }, [messages, surfaces]);\n const renderSurface = (item) => /* @__PURE__ */ jsxs27(\"div\", { className: \"my-3 flex flex-col items-start gap-1.5\", children: [\n /* @__PURE__ */ jsxs27(\n \"div\",\n {\n className: cn(\n \"relative w-full max-w-[95%] rounded-2xl border border-border/60 bg-card p-5 shadow-sm duration-500 animate-in fade-in slide-in-from-bottom-2\",\n item.submitted && \"opacity-70\"\n ),\n children: [\n item.submitted && /* @__PURE__ */ jsxs27(\"div\", { className: \"absolute right-3 top-3 z-10 flex items-center gap-1 rounded-full bg-emerald-500/10 px-2 py-0.5 text-xs font-medium text-emerald-600 dark:text-emerald-400\", children: [\n /* @__PURE__ */ jsx53(Check3, { className: \"h-3 w-3\" }),\n item.dismissedWith ? \"Skipped\" : \"Submitted\"\n ] }),\n /* @__PURE__ */ jsx53(\"div\", { className: cn(item.submitted && \"pointer-events-none select-none\"), \"aria-disabled\": item.submitted, children: /* @__PURE__ */ jsx53(\n A2uiRenderer,\n {\n surface: item.surface,\n registry,\n onAgentAction: genui ? genui.onAgentAction(item.controlId) : () => {\n }\n }\n ) })\n ]\n }\n ),\n item.dismissedWith && /* @__PURE__ */ jsxs27(\"p\", { className: \"alq--surface-dismissed max-w-[95%] pl-1 text-sm text-muted-foreground\", children: [\n /* @__PURE__ */ jsx53(\"span\", { className: \"font-medium text-foreground\", children: \"You replied:\" }),\n \" \",\n item.dismissedWith\n ] })\n ] }, `s-${item.controlId}`);\n const byCount = /* @__PURE__ */ new Map();\n for (const s of surfaces) {\n const arr = byCount.get(s.afterCount) ?? [];\n arr.push(s);\n byCount.set(s.afterCount, arr);\n }\n const interleave = (afterIndex) => {\n const nodes = (byCount.get(afterIndex) ?? []).map(renderSurface);\n if (afterIndex === 0 && isEmpty) {\n nodes.unshift(\n /* @__PURE__ */ jsxs27(\n \"div\",\n {\n className: \"flex min-h-full flex-col items-center justify-center gap-4 py-16 text-center\",\n children: [\n /* @__PURE__ */ jsx53(\"p\", { className: \"max-w-sm text-muted-foreground\", children: \"Ask the agent to build an interface.\" }),\n /* @__PURE__ */ jsx53(\"div\", { className: \"flex flex-col items-center gap-2\", children: suggestions.map((s) => /* @__PURE__ */ jsx53(\n \"button\",\n {\n type: \"button\",\n onClick: () => handleInputChange({\n target: { value: s }\n }),\n className: \"rounded-full border border-border/70 bg-card px-4 py-2 text-sm text-foreground/80 transition hover:border-primary/40 hover:shadow-sm\",\n children: s\n },\n s\n )) })\n ]\n },\n \"empty\"\n )\n );\n }\n return nodes.length ? nodes : null;\n };\n const onSubmit = async (e) => {\n e.preventDefault();\n if (!input.trim()) return;\n if (awaitingUser && genui?.dismiss) {\n genui.dismiss(input);\n return;\n }\n if (isBusy) return;\n try {\n await handleSubmit(e, void 0, conversationId ?? void 0);\n } catch {\n handleLoadingCancel?.();\n }\n };\n return /* @__PURE__ */ jsxs27(Assistant, { className: cn(\"mx-auto flex h-full w-full max-w-2xl flex-col bg-transparent px-4\", className), children: [\n /* @__PURE__ */ jsx53(\n AssistantMessageArea,\n {\n className: \"bg-transparent\",\n messages,\n messagesEndRef: endRef,\n isLoading: !!isLoading,\n streamingMessageId: streamingMessageId ?? null,\n interleave,\n awaitingUser,\n thinkIndicator: thinkIndicator ?? /* @__PURE__ */ jsx53(TypingDots, {})\n }\n ),\n /* @__PURE__ */ jsx53(\n AssistantInput,\n {\n className: \"mb-5 mt-2 rounded-2xl border-border/60 bg-card/90 shadow-lg backdrop-blur\",\n sendMessageFunc: onSubmit,\n isButtonDisabled: isBusy && !awaitingUser,\n input,\n handleInputChange,\n isMessageStreaming: !!isMessageStreaming,\n placeholders: [placeholder, placeholder]\n }\n )\n ] });\n}\nexport {\n A2uiRenderer,\n AssistantChat,\n coreUiRegistry\n};\n","import * as React from \"react\";\nimport type { A2uiSurface, A2uiComponent, SurfaceAction, UIAction } from \"@alquimia-ai/tools/genui\";\nimport { getPointer, setPointer, classifyAction, resolveDynamic, isPathRef } from \"@alquimia-ai/tools/genui\";\nimport type { A2uiNodeProps } from \"./registry\";\n\nexport interface A2uiRendererProps {\n surface: A2uiSurface;\n registry: Record<string, React.ComponentType<A2uiNodeProps>>;\n onAgentAction: (action: UIAction) => void;\n onLocalAction?: (action: UIAction) => void;\n}\n\nexport function A2uiRenderer({ surface, registry, onAgentAction, onLocalAction }: A2uiRendererProps) {\n const [model, setModel] = React.useState<Record<string, unknown>>(surface.dataModel ?? {});\n // Reset local model if the agent sends a new surface.\n React.useEffect(() => {\n setModel(surface.dataModel ?? {});\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [surface.surfaceId]);\n\n const byId = React.useMemo(() => {\n const m = new Map<string, A2uiComponent>();\n for (const c of surface.components) m.set(c.id, c);\n return m;\n }, [surface]);\n\n const emitAction = (node: A2uiComponent, action: SurfaceAction) => {\n const kind = classifyAction(action);\n const ui: UIAction = {\n surfaceId: surface.surfaceId,\n componentId: node.id,\n action: action.name,\n kind,\n payload: kind === \"agent-bound\" ? model : undefined,\n };\n if (kind === \"agent-bound\") onAgentAction(ui);\n else onLocalAction?.(ui);\n };\n\n const renderNode = (id: string, seen: Set<string>): React.ReactNode => {\n if (seen.has(id)) return null; // cycle guard\n const node = byId.get(id);\n if (!node) return null;\n const nextSeen = new Set(seen).add(id);\n\n // Containers reference children by id array; A2UI single-child components use `child`.\n const childIds = node.children ?? (node.child ? [node.child] : []);\n const children = childIds.map((cid) => (\n <React.Fragment key={cid}>{renderNode(cid, nextSeen)}</React.Fragment>\n ));\n\n const Comp = registry[node.component];\n if (!Comp) {\n // Text fallback — never crash on an unknown component.\n return (\n <p className=\"text-muted-foreground text-sm\" data-a2ui-fallback={node.component}>\n [unsupported component: {node.component}]\n </p>\n );\n }\n\n // Binding: prefer the legacy `binding` JSON-Pointer field; otherwise honor an A2UI\n // DynamicString on the node's `value` prop (`{ path: \"/ptr\" }`). Both write back to the\n // same path; a literal `value` resolves to itself (no write-back).\n const boundPath = node.binding ?? (isPathRef(node.value) ? (node.value as { path: string }).path : undefined);\n const value =\n boundPath !== undefined\n ? getPointer(model, boundPath)\n : node.value !== undefined\n ? resolveDynamic(node.value, model)\n : undefined;\n const onChange =\n boundPath !== undefined ? (v: unknown) => setModel((m) => setPointer(m, boundPath, v)) : undefined;\n const onAction = node.action ? (a: SurfaceAction) => emitAction(node, a) : undefined;\n\n return (\n <Comp node={node} value={value} onChange={onChange} onAction={onAction}>\n {children.length ? children : undefined}\n </Comp>\n );\n };\n\n // A2UI convention: the root is the component with id \"root\"; fall back to the legacy field.\n const rootId = byId.has(\"root\") ? \"root\" : surface.root;\n if (!rootId) return null;\n return <>{renderNode(rootId, new Set())}</>;\n}\n","import * as React from \"react\";\nimport type { A2uiNodeProps } from \"../registry\";\nimport { cn } from \"../../../lib/utils\";\nimport { styleProps } from \"../style-props\";\nimport { Card, CardHeader, CardTitle, CardDescription, CardContent } from \"../../atoms/ui/card\";\nimport { Separator } from \"../../atoms/ui/separator\";\nimport { Tabs, TabsList, TabsTrigger, TabsContent } from \"../../atoms/ui/tabs\";\nimport { Accordion, AccordionItem, AccordionTrigger, AccordionContent } from \"../../atoms/ui/accordion\";\n\nconst gapClass = (g: unknown) => (g === \"lg\" ? \"gap-6\" : g === \"sm\" ? \"gap-2\" : \"gap-4\");\n\nexport const Stack: React.FC<A2uiNodeProps> = ({ node, children }) => (\n <div\n className={cn(\n \"flex\",\n node.direction === \"horizontal\" ? \"flex-row\" : \"flex-col\",\n gapClass(node.gap),\n styleProps(node),\n )}\n >\n {children}\n </div>\n);\n\nexport const Row: React.FC<A2uiNodeProps> = ({ node, children }) => (\n <div className={cn(\"flex flex-row\", node.wrap ? \"flex-wrap\" : \"\", gapClass(node.gap), styleProps(node))}>\n {children}\n </div>\n);\n\nexport const Column: React.FC<A2uiNodeProps> = ({ node, children }) => (\n <div className={cn(\"flex flex-col\", gapClass(node.gap), styleProps(node))}>{children}</div>\n);\n\nexport const Grid: React.FC<A2uiNodeProps> = ({ node, children }) => {\n const cols = typeof node.columns === \"number\" ? Math.min(Math.max(node.columns, 1), 6) : 2;\n const colClass = [\"\", \"grid-cols-1\", \"grid-cols-2\", \"grid-cols-3\", \"grid-cols-4\", \"grid-cols-5\", \"grid-cols-6\"][cols];\n return <div className={cn(\"grid\", colClass, gapClass(node.gap), styleProps(node))}>{children}</div>;\n};\n\nexport const Divider: React.FC<A2uiNodeProps> = ({ node }) =>\n typeof node.label === \"string\" ? (\n <div className=\"flex items-center gap-3 text-xs text-muted-foreground\">\n <Separator className=\"flex-1\" />\n <span>{node.label}</span>\n <Separator className=\"flex-1\" />\n </div>\n ) : (\n <Separator />\n );\n\nexport const Spacer: React.FC<A2uiNodeProps> = ({ node }) => {\n const h = node.size === \"lg\" ? \"h-8\" : node.size === \"sm\" ? \"h-2\" : \"h-4\";\n return <div className={h} aria-hidden />;\n};\n\nexport const CardNode: React.FC<A2uiNodeProps> = ({ node, children }) => {\n const variant =\n node.variant === \"ghost\" ? \"border-transparent shadow-none bg-transparent\" : node.variant === \"outline\" ? \"shadow-none\" : \"\";\n return (\n <Card className={cn(variant, styleProps(node))}>\n {(typeof node.title === \"string\" || typeof node.description === \"string\") && (\n <CardHeader>\n {typeof node.title === \"string\" && <CardTitle>{node.title}</CardTitle>}\n {typeof node.description === \"string\" && <CardDescription>{node.description}</CardDescription>}\n </CardHeader>\n )}\n <CardContent>{children}</CardContent>\n </Card>\n );\n};\n\n/** Tabs: each child (by index) is the content for the tab at the same index. */\nexport const TabsNode: React.FC<A2uiNodeProps> = ({ node, children }) => {\n const tabs = (Array.isArray(node.tabs) ? node.tabs : []) as Array<{ label: string; value: string }>;\n const kids = React.Children.toArray(children);\n if (!tabs.length) return <>{children}</>;\n return (\n <Tabs defaultValue={tabs[0]?.value} className={cn(styleProps(node))}>\n <TabsList>\n {tabs.map((t) => (\n <TabsTrigger key={t.value} value={t.value}>\n {t.label}\n </TabsTrigger>\n ))}\n </TabsList>\n {tabs.map((t, i) => (\n <TabsContent key={t.value} value={t.value}>\n {kids[i] ?? null}\n </TabsContent>\n ))}\n </Tabs>\n );\n};\n\n/**\n * Accordion: each `items[i]` is a collapsible section whose body is the child at the\n * same index. Renders through the shared `Accordion` atom (Radix).\n */\nexport const AccordionNode: React.FC<A2uiNodeProps> = ({ node, children }) => {\n const items = (Array.isArray(node.items) ? node.items : []) as Array<{ title: string; value: string }>;\n const kids = React.Children.toArray(children);\n if (!items.length) return <div className={cn(\"flex flex-col gap-2\", styleProps(node))}>{children}</div>;\n return (\n <Accordion\n type=\"single\"\n collapsible\n className={cn(\"rounded-md border border-border px-4\", styleProps(node))}\n >\n {items.map((it, i) => (\n <AccordionItem key={it.value} value={it.value}>\n <AccordionTrigger>{it.title}</AccordionTrigger>\n <AccordionContent>{kids[i] ?? null}</AccordionContent>\n </AccordionItem>\n ))}\n </Accordion>\n );\n};\n","import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n\nexport function parseTextToSpeech(content: string) {\n return content.replace(/[^\\p{L}\\p{N}\\s.,:]/gu, '');\n}\n\n\nexport function blobToBase64(blob: Blob): Promise<string> {\n return new Promise((resolve, reject) => {\n const reader = new FileReader();\n reader.onloadend = () => resolve(reader.result as string);\n reader.onerror = reject;\n reader.readAsDataURL(blob);\n });\n};\n\nexport const truncateString = (str: string, maxLength: number): string => {\n if (str.length <= maxLength) {\n return str;\n }\n return str.slice(0, maxLength) + \"...\";\n};\n\nexport function getCookies(name: string) {\n if (typeof document === 'undefined') return undefined;\n const value = `; ${document.cookie}`;\n const parts = value.split(`; ${name}=`);\n if (parts.length === 2) return parts.pop()?.split(\";\").shift();\n}\n\nexport function hasToolResult(data: any) {\n return data?.tool_output?.result && Object.keys(data.tool_output.result).length > 0;\n}\n\nexport function getErrorMessage(error_code?: string) {\n switch (error_code) {\n case \"STREAM_ERROR\":\n return \"Connection lost. Please try again.\";\n case \"REQUEST_ERROR\":\n return \"There was a problem with your request. Please try again.\";\n case \"401\":\n case \"403\":\n return \"You are not authorized. Please try again.\";\n case \"404\":\n return \"Resource not found.\";\n case \"500\":\n return \"Server error. Please try again later.\";\n default:\n return \"We have an internal error, please try again later.\";\n }\n}\n","import { cn } from \"../../lib/utils\";\n\n/**\n * Map the agent-facing semantic style vocabulary (docs/a2ui-approach.md §11) to the\n * consumer's Tailwind semantic-token classes. Unknown/absent values contribute nothing,\n * so a component falls back to its own default styling.\n */\nconst TONE: Record<string, string> = {\n default: \"text-foreground\",\n muted: \"text-muted-foreground\",\n primary: \"text-primary\",\n success: \"text-emerald-600 dark:text-emerald-400\",\n warning: \"text-amber-600 dark:text-amber-400\",\n danger: \"text-destructive\",\n};\nconst SIZE: Record<string, string> = { sm: \"text-sm\", md: \"text-base\", lg: \"text-lg\" };\nconst ALIGN: Record<string, string> = { start: \"text-left\", center: \"text-center\", end: \"text-right\" };\nconst DENSITY: Record<string, string> = { compact: \"gap-2\", comfortable: \"gap-4\" };\n\nexport function styleProps(node: {\n tone?: unknown;\n size?: unknown;\n emphasis?: unknown;\n align?: unknown;\n density?: unknown;\n}): string {\n return cn(\n typeof node.tone === \"string\" ? TONE[node.tone] : undefined,\n typeof node.size === \"string\" ? SIZE[node.size] : undefined,\n typeof node.align === \"string\" ? ALIGN[node.align] : undefined,\n typeof node.density === \"string\" ? DENSITY[node.density] : undefined,\n node.emphasis === \"high\" ? \"font-semibold\" : node.emphasis === \"medium\" ? \"font-medium\" : undefined,\n );\n}\n","import * as React from \"react\";\n\nimport { cn } from \"../../../lib/utils\";\n\nconst Card = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\n \"rounded-lg\",\n \" border\",\n \"bg-card\",\n \"text-card-foreground\",\n \"shadow-raised\",\n className\n )}\n {...props}\n />\n));\nCard.displayName = \"Card\";\n\nconst CardHeader = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\"flex flex-col space-y-1.5 p-6\", className)}\n {...props}\n />\n));\nCardHeader.displayName = \"CardHeader\";\n\nconst CardTitle = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLHeadingElement>\n>(({ className, ...props }, ref) => (\n <h3\n ref={ref}\n className={cn(\"alq--typography-heading4\", className)}\n {...props}\n />\n));\nCardTitle.displayName = \"CardTitle\";\n\nconst CardDescription = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLParagraphElement>\n>(({ className, ...props }, ref) => (\n <p\n ref={ref}\n className={cn(\"text-sm text-muted-foreground\", className)}\n {...props}\n />\n));\nCardDescription.displayName = \"CardDescription\";\n\nconst CardContent = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div ref={ref} className={cn(\"p-6 pt-0\", className)} {...props} />\n));\nCardContent.displayName = \"CardContent\";\n\nconst CardFooter = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\"flex items-center p-6 pt-0\", className)}\n {...props}\n />\n));\nCardFooter.displayName = \"CardFooter\";\n\nexport {\n Card,\n CardHeader,\n CardFooter,\n CardTitle,\n CardDescription,\n CardContent,\n};\n","\"use client\"\n\nimport * as React from \"react\"\nimport * as SeparatorPrimitive from \"@radix-ui/react-separator\"\n\nimport { cn } from \"../../../lib/utils\"\n\nconst Separator = React.forwardRef<\n React.ElementRef<typeof SeparatorPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root>\n>(({ className, orientation = \"horizontal\", decorative = true, ...props }, ref) => (\n <SeparatorPrimitive.Root\n ref={ref}\n decorative={decorative}\n orientation={orientation}\n className={cn(\n \"shrink-0 bg-border\",\n orientation === \"horizontal\" ? \"h-[1px] w-full\" : \"h-full w-[1px]\",\n className,\n \"alq--separator\"\n )}\n {...props}\n />\n))\nSeparator.displayName = SeparatorPrimitive.Root.displayName\n\nexport { Separator }","\"use client\";\n\nimport * as React from \"react\";\nimport * as TabsPrimitive from \"@radix-ui/react-tabs\";\n\nimport { cn } from \"../../../lib/utils\";\n\nconst Tabs = TabsPrimitive.Root;\n\nconst TabsList = React.forwardRef<\n React.ElementRef<typeof TabsPrimitive.List>,\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.List>\n>(({ className, ...props }, ref) => (\n <TabsPrimitive.List\n ref={ref}\n className={cn(\n \"inline-flex h-10 items-center justify-center rounded-md p-1 text-muted-foreground\",\n className,\n \"alq--tabs\"\n )}\n {...props}\n />\n));\nTabsList.displayName = TabsPrimitive.List.displayName;\n\nconst TabsTrigger = React.forwardRef<\n React.ElementRef<typeof TabsPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.Trigger>\n>(({ className, ...props }, ref) => (\n <TabsPrimitive.Trigger\n ref={ref}\n className={cn(\n \"inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:border-b-2 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:border-b-2 data-[state=active]:text-foreground data-[state=active]:shadow-sm\",\n className\n )}\n {...props}\n />\n));\nTabsTrigger.displayName = TabsPrimitive.Trigger.displayName;\n\nconst TabsContent = React.forwardRef<\n React.ElementRef<typeof TabsPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.Content>\n>(({ className, ...props }, ref) => (\n <TabsPrimitive.Content\n ref={ref}\n className={cn(\n \"mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2\",\n className\n )}\n {...props}\n />\n));\nTabsContent.displayName = TabsPrimitive.Content.displayName;\n\nexport { Tabs, TabsList, TabsTrigger, TabsContent };\n","\"use client\";\n\nimport * as React from \"react\";\nimport * as AccordionPrimitive from \"@radix-ui/react-accordion\";\nimport { ChevronDown } from \"lucide-react\";\n\nimport { cn } from \"../../../lib/utils\";\n\nconst Accordion = AccordionPrimitive.Root;\n\nconst AccordionItem = React.forwardRef<\n React.ElementRef<typeof AccordionPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Item>\n>(({ className, ...props }, ref) => (\n <AccordionPrimitive.Item ref={ref} className={cn(\"border-b\", className)} {...props} />\n));\nAccordionItem.displayName = \"AccordionItem\";\n\nconst AccordionTrigger = React.forwardRef<\n React.ElementRef<typeof AccordionPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Trigger>\n>(({ className, children, ...props }, ref) => (\n <AccordionPrimitive.Header className=\"flex\">\n <AccordionPrimitive.Trigger\n ref={ref}\n className={cn(\n \"flex flex-1 items-center justify-between py-4 text-sm font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180\",\n className\n )}\n {...props}\n >\n {children}\n <ChevronDown className=\"h-4 w-4 shrink-0 text-muted-foreground transition-transform duration-200\" />\n </AccordionPrimitive.Trigger>\n </AccordionPrimitive.Header>\n));\nAccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName;\n\nconst AccordionContent = React.forwardRef<\n React.ElementRef<typeof AccordionPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Content>\n>(({ className, children, ...props }, ref) => (\n <AccordionPrimitive.Content\n ref={ref}\n className=\"overflow-hidden text-sm text-muted-foreground data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down\"\n {...props}\n >\n <div className={cn(\"pb-4 pt-0\", className)}>{children}</div>\n </AccordionPrimitive.Content>\n));\nAccordionContent.displayName = AccordionPrimitive.Content.displayName;\n\nexport { Accordion, AccordionItem, AccordionTrigger, AccordionContent };\n","import * as React from \"react\";\nimport { icons } from \"lucide-react\";\nimport type { A2uiNodeProps } from \"../registry\";\nimport { cn } from \"../../../lib/utils\";\nimport { styleProps } from \"../style-props\";\nimport { Alert, AlertTitle, AlertDescription } from \"../../atoms/ui/alert\";\nimport { Badge } from \"../../atoms/ui/badge\";\nimport { Avatar, AvatarImage, AvatarFallback } from \"../../atoms/ui/avatar\";\nimport { RichText } from \"../../atoms/ui/rich-text\";\n\nconst SAFE_IMG = /^data:image\\/(png|jpe?g|gif|webp|svg\\+xml);/i;\n\nexport const Text: React.FC<A2uiNodeProps> = ({ node }) => {\n const variant = node.variant === \"muted\" || node.variant === \"caption\" ? \"text-muted-foreground\" : \"text-foreground\";\n const size = node.variant === \"lead\" ? \"text-lg\" : node.variant === \"caption\" ? \"text-xs\" : \"\";\n return <p className={cn(variant, size, styleProps(node))}>{String(node.text ?? \"\")}</p>;\n};\n\nexport const Heading: React.FC<A2uiNodeProps> = ({ node }) => {\n const level = typeof node.level === \"number\" ? Math.min(Math.max(node.level, 1), 4) : 1;\n const Tag = ([\"h1\", \"h2\", \"h3\", \"h4\"][level - 1]) as keyof JSX.IntrinsicElements;\n const size = [\"text-2xl\", \"text-xl\", \"text-lg\", \"text-base\"][level - 1];\n return <Tag className={cn(\"font-semibold text-foreground\", size, styleProps(node))}>{String(node.text ?? \"\")}</Tag>;\n};\n\n/**\n * Delegates to the shared `RichText` atom (react-markdown WITHOUT rehype-raw, so raw\n * HTML is stripped/escaped — the security invariant lives in the atom, not here).\n */\nexport const Markdown: React.FC<A2uiNodeProps> = ({ node }) => (\n <RichText\n content={String(node.text ?? \"\")}\n className={cn(\"prose prose-sm dark:prose-invert max-w-none\", styleProps(node))}\n />\n);\n\nexport const ImageNode: React.FC<A2uiNodeProps> = ({ node }) => {\n const src = typeof node.src === \"string\" ? node.src : \"\";\n if (!SAFE_IMG.test(src)) return <span className=\"text-muted-foreground text-sm\">[image omitted]</span>;\n // eslint-disable-next-line jsx-a11y/alt-text\n return (\n <img\n src={src}\n alt={typeof node.alt === \"string\" ? node.alt : \"\"}\n className={cn(\"max-w-full rounded-md\", styleProps(node))}\n />\n );\n};\n\nexport const IconNode: React.FC<A2uiNodeProps> = ({ node }) => {\n const name = typeof node.name === \"string\" ? node.name : \"\";\n const Cmp = (icons as Record<string, React.ComponentType<{ className?: string }>>)[name];\n if (!Cmp) return null;\n return <Cmp className={cn(\"h-4 w-4\", styleProps(node))} />;\n};\n\nconst BADGE_VARIANT: Record<string, \"default\" | \"secondary\" | \"outline\"> = {\n solid: \"default\",\n outline: \"outline\",\n subtle: \"secondary\",\n};\nexport const BadgeNode: React.FC<A2uiNodeProps> = ({ node }) => (\n <Badge variant={BADGE_VARIANT[String(node.variant ?? \"solid\")] ?? \"default\"} className={styleProps(node)}>\n {String(node.text ?? \"\")}\n </Badge>\n);\n\nexport const AvatarNode: React.FC<A2uiNodeProps> = ({ node }) => {\n const src = typeof node.src === \"string\" && SAFE_IMG.test(node.src) ? node.src : undefined;\n const fallback = typeof node.fallback === \"string\" ? node.fallback.slice(0, 2).toUpperCase() : \"?\";\n return (\n <Avatar className={styleProps(node)}>\n {src && <AvatarImage src={src} />}\n <AvatarFallback>{fallback}</AvatarFallback>\n </Avatar>\n );\n};\n\nconst ALERT_VARIANT: Record<string, \"default\" | \"destructive\"> = {\n info: \"default\",\n success: \"default\",\n warning: \"default\",\n danger: \"destructive\",\n};\nexport const AlertNode: React.FC<A2uiNodeProps> = ({ node }) => (\n <Alert variant={ALERT_VARIANT[String(node.variant ?? \"info\")] ?? \"default\"} className={styleProps(node)}>\n {typeof node.title === \"string\" && <AlertTitle>{node.title}</AlertTitle>}\n <AlertDescription>{String(node.text ?? \"\")}</AlertDescription>\n </Alert>\n);\n\nexport const Stat: React.FC<A2uiNodeProps> = ({ node }) => {\n // Accept the canonical label/value, but fall back to title/text — models commonly\n // reach for those prop names.\n const label = node.label ?? node.title;\n const value = node.value ?? node.text;\n return (\n <div className={cn(\"flex flex-col\", styleProps(node))}>\n {label != null && <span className=\"text-sm text-muted-foreground\">{String(label)}</span>}\n <span className=\"text-2xl font-semibold text-foreground\">{String(value ?? \"\")}</span>\n {typeof node.delta === \"string\" && <span className=\"text-sm text-muted-foreground\">{node.delta}</span>}\n </div>\n );\n};\n\nexport const KeyValueNode: React.FC<A2uiNodeProps> = ({ node, value }) => {\n const src = value && typeof value === \"object\" ? value : node.data && typeof node.data === \"object\" ? node.data : {};\n const obj = src as Record<string, unknown>;\n return (\n <dl className={cn(\"grid grid-cols-2 gap-x-4 gap-y-1\", styleProps(node))}>\n {Object.entries(obj).map(([k, v]) => (\n <React.Fragment key={k}>\n <dt className=\"text-muted-foreground\">{k}</dt>\n <dd className=\"text-foreground\">{String(v)}</dd>\n </React.Fragment>\n ))}\n </dl>\n );\n};\n\nexport const ListNode: React.FC<A2uiNodeProps> = ({ node, value }) => {\n const items = Array.isArray(value) ? value : Array.isArray(node.items) ? node.items : [];\n const ordered = node.ordered === true;\n const Tag = ordered ? \"ol\" : \"ul\";\n return (\n <Tag className={cn(ordered ? \"list-decimal\" : \"list-disc\", \"pl-5\", styleProps(node))}>\n {items.map((it, i) => (\n <li key={i}>{String(it)}</li>\n ))}\n </Tag>\n );\n};\n\nexport const Quote: React.FC<A2uiNodeProps> = ({ node }) => (\n <blockquote className={cn(\"border-l-2 border-border pl-4 italic text-muted-foreground\", styleProps(node))}>\n {String(node.text ?? \"\")}\n {typeof node.cite === \"string\" && <footer className=\"mt-1 text-xs not-italic\">— {node.cite}</footer>}\n </blockquote>\n);\n","import * as React from \"react\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\n\nimport { cn } from \"../../../lib/utils\";\n\nconst alertVariants = cva(\n \"relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground\",\n {\n variants: {\n variant: {\n default: \"bg-background text-foreground\",\n destructive:\n \"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n },\n }\n);\n\nconst Alert = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement> & VariantProps<typeof alertVariants>\n>(({ className, variant, ...props }, ref) => (\n <div\n ref={ref}\n role=\"alert\"\n className={cn(alertVariants({ variant }), className)}\n {...props}\n />\n));\nAlert.displayName = \"Alert\";\n\nconst AlertTitle = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLHeadingElement>\n>(({ className, ...props }, ref) => (\n <h5\n ref={ref}\n className={cn(\"mb-1 font-medium leading-none tracking-tight\", className)}\n {...props}\n />\n));\nAlertTitle.displayName = \"AlertTitle\";\n\nconst AlertDescription = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLParagraphElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\"text-sm [&_p]:leading-relaxed\", className)}\n {...props}\n />\n));\nAlertDescription.displayName = \"AlertDescription\";\n\nexport { Alert, AlertTitle, AlertDescription };\n","import * as React from \"react\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\n\nimport { cn } from \"../../../lib/utils\";\n\nconst badgeVariants = cva(\n \"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2\",\n {\n variants: {\n variant: {\n default:\n \"border-transparent bg-primary text-primary-foreground hover:bg-primary/80\",\n secondary:\n \"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80\",\n destructive:\n \"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80\",\n outline: \"text-foreground\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n },\n }\n)\n\nexport interface BadgeProps\n extends React.HTMLAttributes<HTMLDivElement>,\n VariantProps<typeof badgeVariants> {}\n\nfunction Badge({ className, variant, ...props }: BadgeProps) {\n return (\n <div className={cn(badgeVariants({ variant }), className, \"alq--badge\")} {...props} />\n )\n}\n\nexport { Badge, badgeVariants }\n","\"use client\"\n\nimport * as React from \"react\"\nimport * as AvatarPrimitive from \"@radix-ui/react-avatar\"\n\nimport { cn } from \"../../../lib/utils\";\n\nconst Avatar = React.forwardRef<\n React.ElementRef<typeof AvatarPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Root>\n>(({ className, ...props }, ref) => (\n <AvatarPrimitive.Root\n ref={ref}\n className={cn(\n \"relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full\",\n className\n )}\n {...props}\n />\n))\nAvatar.displayName = AvatarPrimitive.Root.displayName\n\nconst AvatarImage = React.forwardRef<\n React.ElementRef<typeof AvatarPrimitive.Image>,\n React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Image>\n>(({ className, ...props }, ref) => (\n <AvatarPrimitive.Image\n ref={ref}\n className={cn(\"aspect-square h-full w-full\", className)}\n {...props}\n />\n))\nAvatarImage.displayName = AvatarPrimitive.Image.displayName\n\nconst AvatarFallback = React.forwardRef<\n React.ElementRef<typeof AvatarPrimitive.Fallback>,\n React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Fallback>\n>(({ className, ...props }, ref) => (\n <AvatarPrimitive.Fallback\n ref={ref}\n className={cn(\n \"flex h-full w-full items-center justify-center rounded-full bg-muted\",\n className\n )}\n {...props}\n />\n))\nAvatarFallback.displayName = AvatarPrimitive.Fallback.displayName\n\nexport { Avatar, AvatarImage, AvatarFallback }\n","import * as React from \"react\";\nimport ReactMarkdown from \"react-markdown\";\nimport remarkGfm from \"remark-gfm\";\nimport { cn } from \"../../../lib/utils\";\n\ninterface RichTextProps extends React.HTMLAttributes<HTMLDivElement> {\n content: string;\n className?: string;\n}\n\nfunction RichText({ content, className }: RichTextProps) {\n return (\n <ReactMarkdown className={cn(className)} remarkPlugins={[remarkGfm]}>\n {content}\n </ReactMarkdown>\n );\n}\n\nexport { RichText };\n","import * as React from \"react\";\nimport { format } from \"date-fns\";\nimport { Star } from \"lucide-react\";\nimport type { A2uiNodeProps } from \"../registry\";\nimport { cn } from \"../../../lib/utils\";\nimport { styleProps } from \"../style-props\";\nimport { Input } from \"../../atoms/ui/input\";\nimport { Textarea } from \"../../atoms/ui/textarea\";\nimport { Label } from \"../../atoms/ui/label\";\nimport { Checkbox } from \"../../atoms/ui/checkbox\";\nimport { Switch } from \"../../atoms/ui/switch\";\nimport { Slider } from \"../../atoms/ui/slider\";\nimport { Button } from \"../../atoms/ui/button\";\nimport { Calendar } from \"../../atoms/ui/calendar\";\nimport { RadioGroup, RadioGroupItem } from \"../../atoms/ui/radio-group\";\nimport { Popover, PopoverContent, PopoverTrigger } from \"../../atoms/ui/popover\";\nimport {\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n SelectValue,\n} from \"../../atoms/ui/select\";\nimport { Command, CommandInput, CommandList, CommandEmpty, CommandItem } from \"../../atoms/ui/command\";\n\ntype Opt = { label: string; value: string | number };\n// Models often emit options as a plain string array ([\"A\",\"B\"]) instead of\n// {label,value} objects — normalize both forms.\nconst opts = (node: A2uiNodeProps[\"node\"]): Opt[] =>\n Array.isArray(node.options)\n ? node.options.map((o) =>\n typeof o === \"string\" || typeof o === \"number\" ? { label: String(o), value: o } : (o as Opt),\n )\n : [];\n\n/** Parse a value into a valid Date, or undefined. Guards against \"\" and invalid strings. */\nconst toDate = (v: unknown): Date | undefined => {\n if (typeof v !== \"string\" || !v) return undefined;\n const d = new Date(v);\n return isNaN(d.getTime()) ? undefined : d;\n};\n\nconst Field: React.FC<{ id: string; label?: unknown; node: A2uiNodeProps[\"node\"]; children: React.ReactNode }> = ({\n id,\n label,\n node,\n children,\n}) => (\n <div className={cn(\"flex flex-col gap-1.5\", styleProps(node))}>\n {typeof label === \"string\" && <Label htmlFor={id}>{label}</Label>}\n {children}\n </div>\n);\n\nexport const TextField: React.FC<A2uiNodeProps> = ({ node, value, onChange }) => {\n const id = `f-${node.id}`;\n return (\n <Field id={id} label={node.label} node={node}>\n <Input\n id={id}\n placeholder={typeof node.placeholder === \"string\" ? node.placeholder : undefined}\n value={typeof value === \"string\" ? value : \"\"}\n onChange={(e) => onChange?.(e.target.value)}\n />\n </Field>\n );\n};\n\nexport const TextArea: React.FC<A2uiNodeProps> = ({ node, value, onChange }) => {\n const id = `f-${node.id}`;\n return (\n <Field id={id} label={node.label} node={node}>\n <Textarea\n id={id}\n rows={typeof node.rows === \"number\" ? node.rows : undefined}\n placeholder={typeof node.placeholder === \"string\" ? node.placeholder : undefined}\n value={typeof value === \"string\" ? value : \"\"}\n onChange={(e) => onChange?.(e.target.value)}\n />\n </Field>\n );\n};\n\nexport const NumberField: React.FC<A2uiNodeProps> = ({ node, value, onChange }) => {\n const id = `f-${node.id}`;\n return (\n <Field id={id} label={node.label} node={node}>\n <Input\n id={id}\n type=\"number\"\n min={typeof node.min === \"number\" ? node.min : undefined}\n max={typeof node.max === \"number\" ? node.max : undefined}\n step={typeof node.step === \"number\" ? node.step : undefined}\n value={typeof value === \"number\" ? value : \"\"}\n onChange={(e) => onChange?.(e.target.value === \"\" ? undefined : Number(e.target.value))}\n />\n </Field>\n );\n};\n\nexport const SelectNode: React.FC<A2uiNodeProps> = ({ node, value, onChange }) => {\n const id = `f-${node.id}`;\n return (\n <Field id={id} label={node.label} node={node}>\n <Select value={value != null ? String(value) : undefined} onValueChange={(v) => onChange?.(v)}>\n <SelectTrigger id={id}>\n <SelectValue placeholder={typeof node.placeholder === \"string\" ? node.placeholder : undefined} />\n </SelectTrigger>\n <SelectContent>\n {opts(node).map((o) => (\n <SelectItem key={String(o.value)} value={String(o.value)}>\n {o.label}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n </Field>\n );\n};\n\nexport const MultiSelect: React.FC<A2uiNodeProps> = ({ node, value, onChange }) => {\n const selected = Array.isArray(value) ? (value as (string | number)[]) : [];\n const toggle = (v: string | number) =>\n onChange?.(selected.includes(v) ? selected.filter((x) => x !== v) : [...selected, v]);\n return (\n <Field id={`f-${node.id}`} label={node.label} node={node}>\n <div className=\"flex flex-col gap-1.5\">\n {opts(node).map((o) => (\n <label key={String(o.value)} className=\"flex items-center gap-2 text-sm\">\n <Checkbox checked={selected.includes(o.value)} onCheckedChange={() => toggle(o.value)} />\n {o.label}\n </label>\n ))}\n </div>\n </Field>\n );\n};\n\nexport const Combobox: React.FC<A2uiNodeProps> = ({ node, value, onChange }) => {\n const [open, setOpen] = React.useState(false);\n const selected = opts(node).find((o) => o.value === value);\n const placeholder = typeof node.placeholder === \"string\" ? node.placeholder : \"Select…\";\n return (\n <Field id={`f-${node.id}`} label={node.label} node={node}>\n <Popover open={open} onOpenChange={setOpen}>\n <PopoverTrigger asChild>\n <Button variant=\"outline\" role=\"combobox\" className=\"justify-between font-normal\">\n {selected ? selected.label : placeholder}\n </Button>\n </PopoverTrigger>\n <PopoverContent className=\"w-[--radix-popover-trigger-width] p-0\">\n <Command>\n <CommandInput placeholder=\"Search…\" />\n <CommandList>\n <CommandEmpty>No results.</CommandEmpty>\n {opts(node).map((o) => (\n <CommandItem\n key={String(o.value)}\n value={o.label}\n onSelect={() => {\n onChange?.(o.value);\n setOpen(false);\n }}\n >\n {o.label}\n </CommandItem>\n ))}\n </CommandList>\n </Command>\n </PopoverContent>\n </Popover>\n </Field>\n );\n};\n\nexport const CheckboxNode: React.FC<A2uiNodeProps> = ({ node, value, onChange }) => {\n const id = `f-${node.id}`;\n return (\n <div className={cn(\"flex items-center gap-2\", styleProps(node))}>\n <Checkbox id={id} checked={value === true} onCheckedChange={(c) => onChange?.(c === true)} />\n {typeof node.label === \"string\" && <Label htmlFor={id}>{node.label}</Label>}\n </div>\n );\n};\n\nexport const CheckboxGroup: React.FC<A2uiNodeProps> = ({ node, value, onChange }) => {\n const selected = Array.isArray(value) ? (value as (string | number)[]) : [];\n const toggle = (v: string | number) =>\n onChange?.(selected.includes(v) ? selected.filter((x) => x !== v) : [...selected, v]);\n return (\n <Field id={`f-${node.id}`} label={node.label} node={node}>\n <div className=\"flex flex-col gap-1.5\">\n {opts(node).map((o) => (\n <label key={String(o.value)} className=\"flex items-center gap-2 text-sm\">\n <Checkbox checked={selected.includes(o.value)} onCheckedChange={() => toggle(o.value)} />\n {o.label}\n </label>\n ))}\n </div>\n </Field>\n );\n};\n\nexport const Radio: React.FC<A2uiNodeProps> = ({ node, value, onChange }) => (\n <Field id={`f-${node.id}`} label={node.label} node={node}>\n <RadioGroup\n value={value != null ? String(value) : undefined}\n onValueChange={(v) => {\n // Restore the original option type (values can be numbers) before emitting.\n const match = opts(node).find((o) => String(o.value) === v);\n onChange?.(match ? match.value : v);\n }}\n >\n {opts(node).map((o) => {\n const id = `r-${node.id}-${o.value}`;\n return (\n <div key={String(o.value)} className=\"flex items-center gap-2 text-sm\">\n <RadioGroupItem id={id} value={String(o.value)} />\n <Label htmlFor={id} className=\"font-normal\">\n {o.label}\n </Label>\n </div>\n );\n })}\n </RadioGroup>\n </Field>\n);\n\nexport const SwitchNode: React.FC<A2uiNodeProps> = ({ node, value, onChange }) => {\n const id = `f-${node.id}`;\n return (\n <div className={cn(\"flex items-center gap-2\", styleProps(node))}>\n <Switch id={id} checked={value === true} onCheckedChange={(c) => onChange?.(c === true)} />\n {typeof node.label === \"string\" && <Label htmlFor={id}>{node.label}</Label>}\n </div>\n );\n};\n\nexport const SliderNode: React.FC<A2uiNodeProps> = ({ node, value, onChange }) => {\n const min = typeof node.min === \"number\" ? node.min : 0;\n const max = typeof node.max === \"number\" ? node.max : 100;\n const step = typeof node.step === \"number\" ? node.step : 1;\n const v = typeof value === \"number\" ? value : min;\n return (\n <Field id={`f-${node.id}`} label={node.label} node={node}>\n <Slider min={min} max={max} step={step} value={[v]} onValueChange={(vals) => onChange?.(vals[0])} />\n </Field>\n );\n};\n\nexport const DatePicker: React.FC<A2uiNodeProps> = ({ node, value, onChange }) => {\n const selected = toDate(value);\n const label = selected ? format(selected, \"PPP\") : \"Pick a date\";\n return (\n <Field id={`f-${node.id}`} label={node.label} node={node}>\n <Popover>\n <PopoverTrigger asChild>\n <Button variant=\"outline\" className=\"justify-start font-normal\">\n {label}\n </Button>\n </PopoverTrigger>\n <PopoverContent className=\"w-auto p-0\">\n <Calendar mode=\"single\" selected={selected} onSelect={(d?: Date) => d && onChange?.(d.toISOString())} />\n </PopoverContent>\n </Popover>\n </Field>\n );\n};\n\nexport const DateRange: React.FC<A2uiNodeProps> = ({ node, value, onChange }) => {\n const parsed = value && typeof value === \"object\" ? (value as { from?: string; to?: string | null }) : undefined;\n const from = toDate(parsed?.from);\n const to = toDate(parsed?.to);\n const selected = from ? { from, to } : undefined;\n const label = from ? `${format(from, \"PP\")} – ${to ? format(to, \"PP\") : \"…\"}` : \"Pick a range\";\n return (\n <Field id={`f-${node.id}`} label={node.label} node={node}>\n <Popover>\n <PopoverTrigger asChild>\n <Button variant=\"outline\" className=\"justify-start font-normal\">\n {label}\n </Button>\n </PopoverTrigger>\n <PopoverContent className=\"w-auto p-0\">\n <Calendar\n mode=\"range\"\n selected={selected}\n onSelect={(r) =>\n onChange?.({ from: r?.from?.toISOString() ?? null, to: r?.to?.toISOString() ?? null })\n }\n />\n </PopoverContent>\n </Popover>\n </Field>\n );\n};\n\n/** Collects file METADATA only (name/size/type). File bytes ride the SDK attachment path, never the tool result. */\nexport const FileUpload: React.FC<A2uiNodeProps> = ({ node, onChange }) => {\n const id = `f-${node.id}`;\n return (\n <Field id={id} label={node.label} node={node}>\n <Input\n id={id}\n type=\"file\"\n accept={typeof node.accept === \"string\" ? node.accept : undefined}\n multiple={node.multiple === true}\n onChange={(e) =>\n onChange?.(\n Array.from(e.target.files ?? []).map((f) => ({ name: f.name, size: f.size, type: f.type })),\n )\n }\n />\n </Field>\n );\n};\n\n/**\n * Inline N-star rating input. NOT the `rating-stars` molecule — that one is a collapsed\n * feedback-popover widget (fixed 5 stars, requires isLoading), the wrong UX for a form\n * field. The lib has no generic inline-rating primitive; this is a candidate to promote\n * to an atom if another consumer needs it.\n */\nexport const Rating: React.FC<A2uiNodeProps> = ({ node, value, onChange }) => {\n const max = typeof node.max === \"number\" ? node.max : 5;\n const current = typeof value === \"number\" ? value : 0;\n return (\n <Field id={`f-${node.id}`} label={node.label} node={node}>\n <div className=\"flex items-center gap-1\" role=\"radiogroup\" aria-label=\"rating\">\n {Array.from({ length: max }, (_, i) => i + 1).map((n) => (\n <button\n key={n}\n type=\"button\"\n aria-label={`${n} star${n > 1 ? \"s\" : \"\"}`}\n onClick={() => onChange?.(n)}\n className=\"text-amber-500\"\n >\n <Star className={cn(\"h-5 w-5\", n <= current ? \"fill-current\" : \"opacity-40\")} />\n </button>\n ))}\n </div>\n </Field>\n );\n};\n","import { forwardRef } from \"react\";\n\nimport { cn } from \"../../../lib/utils\";\n\nexport interface InputProps\n extends React.InputHTMLAttributes<HTMLInputElement> {}\n\nconst Input = forwardRef<HTMLInputElement, InputProps>(\n ({ className, type, ...props }, ref) => {\n return (\n <input\n type={type}\n className={cn(\n \"flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50\",\n className,\n \"alq--input\"\n )}\n ref={ref}\n {...props}\n />\n );\n }\n);\nInput.displayName = \"Input\";\n\nexport { Input };\n","import * as React from \"react\";\n\nimport { cn } from \"../../../lib/utils\";\n\nexport interface TextareaProps\n extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {}\n\nconst Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(\n ({ className, ...props }, ref) => {\n return (\n <textarea\n className={cn(\n \"flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50\",\n className,\n \"alq--textarea\"\n )}\n ref={ref}\n {...props}\n />\n );\n }\n);\nTextarea.displayName = \"Textarea\";\n\nexport { Textarea };\n","\"use client\";\n\nimport * as React from \"react\";\nimport * as LabelPrimitive from \"@radix-ui/react-label\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\n\nimport { cn } from \"../../../lib/utils\";\n\nconst labelVariants = cva(\n \"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70\"\n);\n\nconst Label = React.forwardRef<\n React.ElementRef<typeof LabelPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> &\n VariantProps<typeof labelVariants>\n>(({ className, ...props }, ref) => (\n <LabelPrimitive.Root\n ref={ref}\n className={cn(labelVariants(), className, \"alq--label\")}\n {...props}\n />\n));\nLabel.displayName = LabelPrimitive.Root.displayName;\n\nexport { Label };\n","\"use client\";\n\nimport * as React from \"react\";\nimport * as CheckboxPrimitive from \"@radix-ui/react-checkbox\";\nimport { Check } from \"lucide-react\";\n\nimport { cn } from \"../../../lib/utils\";\n\nconst Checkbox = React.forwardRef<\n React.ElementRef<typeof CheckboxPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>\n>(({ className, ...props }, ref) => (\n <CheckboxPrimitive.Root\n ref={ref}\n className={cn(\n \"peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground\",\n className,\n \"alq--checkbox\"\n )}\n {...props}\n >\n <CheckboxPrimitive.Indicator\n className={cn(\"flex items-center justify-center text-current\")}\n >\n <Check className=\"h-4 w-4\" />\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n));\nCheckbox.displayName = CheckboxPrimitive.Root.displayName;\n\nexport { Checkbox };\n","\"use client\";\n\nimport * as React from \"react\";\nimport * as SwitchPrimitives from \"@radix-ui/react-switch\";\n\nimport { cn } from \"../../../lib/utils\";\n\nconst Switch = React.forwardRef<\n React.ElementRef<typeof SwitchPrimitives.Root>,\n React.ComponentPropsWithoutRef<typeof SwitchPrimitives.Root>\n>(({ className, ...props }, ref) => (\n <SwitchPrimitives.Root\n className={cn(\n \"peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input\",\n className,\n \"alq--switch\"\n )}\n {...props}\n ref={ref}\n >\n <SwitchPrimitives.Thumb\n className={cn(\n \"pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0\"\n )}\n />\n </SwitchPrimitives.Root>\n));\nSwitch.displayName = SwitchPrimitives.Root.displayName;\n\nexport { Switch };\n","\"use client\";\n\nimport * as React from \"react\";\nimport * as SliderPrimitive from \"@radix-ui/react-slider\";\n\nimport { cn } from \"../../../lib/utils\";\n\nconst Slider = React.forwardRef<\n React.ElementRef<typeof SliderPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof SliderPrimitive.Root>\n>(({ className, ...props }, ref) => (\n <SliderPrimitive.Root\n ref={ref}\n className={cn(\n \"relative flex w-44 touch-none select-none items-center\",\n className,\n \"alq--slider\"\n )}\n {...props}\n >\n <SliderPrimitive.Track className=\"relative h-2 w-44 grow overflow-hidden rounded-full bg-primary\">\n <SliderPrimitive.Range className=\"absolute h-full bg-secondary\" />\n </SliderPrimitive.Track>\n <SliderPrimitive.Thumb className=\"block h-5 w-5 rounded-full border-2 border-gray bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50\" />\n </SliderPrimitive.Root>\n));\nSlider.displayName = SliderPrimitive.Root.displayName;\n\nexport { Slider };\n","import * as React from \"react\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\n\nimport { cn } from \"../../../lib/utils\";\n\nconst buttonVariants = cva(\n \"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0\",\n {\n variants: {\n variant: {\n default: \"bg-primary text-primary-foreground hover:bg-primary/90\",\n destructive:\n \"bg-destructive text-destructive-foreground hover:bg-destructive/90\",\n outline:\n \"border border-input bg-background hover:bg-accent hover:text-accent-foreground\",\n secondary:\n \"bg-secondary text-secondary-foreground hover:bg-secondary/80\",\n ghost: \"hover:bg-accent hover:text-accent-foreground\",\n link: \"text-primary underline-offset-4 hover:underline\",\n },\n size: {\n default: \"h-10 px-4 py-2\",\n sm: \"h-9 rounded-md px-3\",\n lg: \"h-11 rounded-md px-8\",\n icon: \"h-10 w-10\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n }\n);\n\nexport interface ButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof buttonVariants> {\n asChild?: boolean;\n}\n\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n ({ className, variant, size, asChild = false, ...props }, ref) => {\n const Comp = asChild ? Slot : \"button\";\n return (\n <Comp\n className={cn(buttonVariants({ variant, size, className }))}\n ref={ref}\n {...props}\n />\n );\n }\n);\nButton.displayName = \"Button\";\n\nexport { Button, buttonVariants };\n","\"use client\";\n\nimport * as React from \"react\";\nimport { ChevronLeft, ChevronRight } from \"lucide-react\";\nimport { DayPicker } from \"react-day-picker\";\n\nimport { cn } from \"../../../lib/utils\";\nimport { buttonVariants } from \"./button\";\n\nexport type CalendarProps = React.ComponentProps<typeof DayPicker>;\n\nfunction Calendar({ className, classNames, showOutsideDays = true, ...props }: CalendarProps) {\n return (\n <DayPicker\n showOutsideDays={showOutsideDays}\n className={cn(\"p-3\", className)}\n classNames={{\n months: \"flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0\",\n month: \"space-y-4\",\n caption: \"flex justify-center pt-1 relative items-center\",\n caption_label: \"text-sm font-medium\",\n nav: \"space-x-1 flex items-center\",\n nav_button: cn(\n buttonVariants({ variant: \"outline\" }),\n \"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100\"\n ),\n nav_button_previous: \"absolute left-1\",\n nav_button_next: \"absolute right-1\",\n table: \"w-full border-collapse space-y-1\",\n head_row: \"flex\",\n head_cell: \"text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]\",\n row: \"flex w-full mt-2\",\n cell: \"h-9 w-9 text-center text-sm p-0 relative [&:has([aria-selected])]:bg-accent first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md focus-within:relative focus-within:z-20\",\n day: cn(buttonVariants({ variant: \"ghost\" }), \"h-9 w-9 p-0 font-normal aria-selected:opacity-100\"),\n day_range_end: \"day-range-end\",\n day_selected:\n \"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground\",\n day_today: \"bg-accent text-accent-foreground\",\n day_outside: \"day-outside text-muted-foreground opacity-50\",\n day_disabled: \"text-muted-foreground opacity-50\",\n day_range_middle: \"aria-selected:bg-accent aria-selected:text-accent-foreground\",\n day_hidden: \"invisible\",\n ...classNames,\n }}\n components={{\n IconLeft: () => <ChevronLeft className=\"h-4 w-4\" />,\n IconRight: () => <ChevronRight className=\"h-4 w-4\" />,\n }}\n {...props}\n />\n );\n}\nCalendar.displayName = \"Calendar\";\n\nexport { Calendar };\n","\"use client\";\n\nimport * as React from \"react\";\nimport * as RadioGroupPrimitive from \"@radix-ui/react-radio-group\";\nimport { Circle } from \"lucide-react\";\n\nimport { cn } from \"../../../lib/utils\";\n\nconst RadioGroup = React.forwardRef<\n React.ElementRef<typeof RadioGroupPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root>\n>(({ className, ...props }, ref) => (\n <RadioGroupPrimitive.Root ref={ref} className={cn(\"grid gap-2\", className)} {...props} />\n));\nRadioGroup.displayName = RadioGroupPrimitive.Root.displayName;\n\nconst RadioGroupItem = React.forwardRef<\n React.ElementRef<typeof RadioGroupPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item>\n>(({ className, ...props }, ref) => (\n <RadioGroupPrimitive.Item\n ref={ref}\n className={cn(\n \"aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50\",\n className\n )}\n {...props}\n >\n <RadioGroupPrimitive.Indicator className=\"flex items-center justify-center\">\n <Circle className=\"h-2.5 w-2.5 fill-current text-current\" />\n </RadioGroupPrimitive.Indicator>\n </RadioGroupPrimitive.Item>\n));\nRadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName;\n\nexport { RadioGroup, RadioGroupItem };\n","\"use client\";\n\nimport * as React from \"react\";\nimport * as PopoverPrimitive from \"@radix-ui/react-popover\";\n\nimport { cn } from \"../../../lib/utils\";\n\nconst Popover = PopoverPrimitive.Root;\n\nconst PopoverTrigger = PopoverPrimitive.Trigger;\n\nconst PopoverContent = React.forwardRef<\n React.ElementRef<typeof PopoverPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content>\n>(({ className, align = \"center\", sideOffset = 4, ...props }, ref) => (\n <PopoverPrimitive.Portal>\n <PopoverPrimitive.Content\n ref={ref}\n align={align}\n sideOffset={sideOffset}\n className={cn(\n \"z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 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\",\n className\n )}\n {...props}\n />\n </PopoverPrimitive.Portal>\n));\nPopoverContent.displayName = PopoverPrimitive.Content.displayName;\n\nexport { Popover, PopoverTrigger, PopoverContent };\n","\"use client\";\n\nimport * as React from \"react\";\nimport * as SelectPrimitive from \"@radix-ui/react-select\";\nimport { Check, ChevronDown, ChevronUp } from \"lucide-react\";\nimport { cn } from \"../../../lib/utils\";\n\nconst Select = SelectPrimitive.Root;\n\nconst SelectGroup = SelectPrimitive.Group;\n\nconst SelectValue = SelectPrimitive.Value;\n\nconst SelectTrigger = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>\n>(({ className, children, ...props }, ref) => (\n <SelectPrimitive.Trigger\n ref={ref}\n className={cn(\n \"flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1\",\n className,\n \"alq--select\"\n )}\n {...props}\n >\n {children}\n <SelectPrimitive.Icon asChild>\n <ChevronDown className=\"h-4 w-4 opacity-50\" />\n </SelectPrimitive.Icon>\n </SelectPrimitive.Trigger>\n));\nSelectTrigger.displayName = SelectPrimitive.Trigger.displayName;\n\nconst SelectScrollUpButton = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.ScrollUpButton>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollUpButton>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.ScrollUpButton\n ref={ref}\n className={cn(\n \"flex cursor-default items-center justify-center py-1\",\n className\n )}\n {...props}\n >\n <ChevronUp className=\"h-4 w-4\" />\n </SelectPrimitive.ScrollUpButton>\n));\nSelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;\n\nconst SelectScrollDownButton = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.ScrollDownButton>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollDownButton>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.ScrollDownButton\n ref={ref}\n className={cn(\n \"flex cursor-default items-center justify-center py-1\",\n className\n )}\n {...props}\n >\n <ChevronDown className=\"h-4 w-4\" />\n </SelectPrimitive.ScrollDownButton>\n));\nSelectScrollDownButton.displayName =\n SelectPrimitive.ScrollDownButton.displayName;\n\nconst SelectContent = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content>\n>(({ className, children, position = \"popper\", ...props }, ref) => (\n <SelectPrimitive.Portal>\n <SelectPrimitive.Content\n ref={ref}\n className={cn(\n \"relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 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\",\n position === \"popper\" &&\n \"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1\",\n className\n )}\n position={position}\n {...props}\n >\n <SelectScrollUpButton />\n <SelectPrimitive.Viewport\n className={cn(\n \"p-1\",\n position === \"popper\" &&\n \"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]\"\n )}\n >\n {children}\n </SelectPrimitive.Viewport>\n <SelectScrollDownButton />\n </SelectPrimitive.Content>\n </SelectPrimitive.Portal>\n));\nSelectContent.displayName = SelectPrimitive.Content.displayName;\n\nconst SelectLabel = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Label>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.Label\n ref={ref}\n className={cn(\"py-1.5 pl-8 pr-2 text-sm font-semibold\", className)}\n {...props}\n />\n));\nSelectLabel.displayName = SelectPrimitive.Label.displayName;\n\nconst SelectItem = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item>\n>(({ className, children, ...props }, ref) => (\n <SelectPrimitive.Item\n ref={ref}\n className={cn(\n \"relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50\",\n className\n )}\n {...props}\n >\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <SelectPrimitive.ItemIndicator>\n <Check className=\"h-4 w-4\" />\n </SelectPrimitive.ItemIndicator>\n </span>\n\n <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>\n </SelectPrimitive.Item>\n));\nSelectItem.displayName = SelectPrimitive.Item.displayName;\n\nconst SelectSeparator = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.Separator\n ref={ref}\n className={cn(\"-mx-1 my-1 h-px bg-muted\", className)}\n {...props}\n />\n));\nSelectSeparator.displayName = SelectPrimitive.Separator.displayName;\n\nexport {\n Select,\n SelectGroup,\n SelectValue,\n SelectTrigger,\n SelectContent,\n SelectLabel,\n SelectItem,\n SelectSeparator,\n SelectScrollUpButton,\n SelectScrollDownButton,\n};\n","\"use client\";\n\nimport * as React from \"react\";\nimport { type DialogProps } from \"@radix-ui/react-dialog\";\nimport { Command as CommandPrimitive } from \"cmdk\";\nimport { Search } from \"lucide-react\";\n\nimport { cn } from \"../../../lib/utils\";\nimport { Dialog, DialogContent } from \"./dialog\";\n\nconst Command = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive\n ref={ref}\n className={cn(\n \"flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground\",\n className\n )}\n {...props}\n />\n));\nCommand.displayName = CommandPrimitive.displayName;\n\ninterface CommandDialogProps extends DialogProps {}\n\nconst CommandDialog = ({ children, ...props }: CommandDialogProps) => {\n return (\n <Dialog {...props}>\n <DialogContent className=\"overflow-hidden p-0 shadow-lg\">\n <Command className=\"[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5\">\n {children}\n </Command>\n </DialogContent>\n </Dialog>\n );\n};\n\nconst CommandInput = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive.Input>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Input>\n>(({ className, ...props }, ref) => (\n <div className=\"flex items-center border-b px-3\" cmdk-input-wrapper=\"\">\n <Search className=\"mr-2 h-4 w-4 shrink-0 opacity-50\" />\n <CommandPrimitive.Input\n ref={ref}\n className={cn(\n \"flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50\",\n className\n )}\n {...props}\n />\n </div>\n));\n\nCommandInput.displayName = CommandPrimitive.Input.displayName;\n\nconst CommandList = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive.List>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.List>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.List\n ref={ref}\n className={cn(\"max-h-[300px] overflow-y-auto overflow-x-hidden\", className)}\n {...props}\n />\n));\n\nCommandList.displayName = CommandPrimitive.List.displayName;\n\nconst CommandEmpty = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive.Empty>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Empty>\n>((props, ref) => (\n <CommandPrimitive.Empty\n ref={ref}\n className=\"py-6 text-center text-sm\"\n {...props}\n />\n));\n\nCommandEmpty.displayName = CommandPrimitive.Empty.displayName;\n\nconst CommandGroup = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive.Group>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Group>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.Group\n ref={ref}\n className={cn(\n \"overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground\",\n className\n )}\n {...props}\n />\n));\n\nCommandGroup.displayName = CommandPrimitive.Group.displayName;\n\nconst CommandSeparator = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.Separator\n ref={ref}\n className={cn(\"-mx-1 h-px bg-border\", className)}\n {...props}\n />\n));\nCommandSeparator.displayName = CommandPrimitive.Separator.displayName;\n\nconst CommandItem = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Item>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.Item\n ref={ref}\n className={cn(\n \"relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0\",\n className\n )}\n {...props}\n />\n));\n\nCommandItem.displayName = CommandPrimitive.Item.displayName;\n\nconst CommandShortcut = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLSpanElement>) => {\n return (\n <span\n className={cn(\n \"ml-auto text-xs tracking-widest text-muted-foreground\",\n className\n )}\n {...props}\n />\n );\n};\nCommandShortcut.displayName = \"CommandShortcut\";\n\nexport {\n Command,\n CommandDialog,\n CommandInput,\n CommandList,\n CommandEmpty,\n CommandGroup,\n CommandItem,\n CommandShortcut,\n CommandSeparator,\n};\n","\"use client\";\n\nimport * as React from \"react\";\nimport * as DialogPrimitive from \"@radix-ui/react-dialog\";\nimport { X } from \"lucide-react\";\n\nimport { cn } from \"../../../lib/utils\";\n\nconst Dialog = DialogPrimitive.Root;\n\nconst DialogTrigger = DialogPrimitive.Trigger;\n\nconst DialogPortal = DialogPrimitive.Portal;\n\nconst DialogClose = DialogPrimitive.Close;\n\nconst DialogOverlay = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Overlay\n ref={ref}\n className={cn(\n \"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0\",\n className\n )}\n {...props}\n />\n));\nDialogOverlay.displayName = DialogPrimitive.Overlay.displayName;\n\nconst DialogContent = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>\n>(({ className, children, ...props }, ref) => (\n <DialogPortal>\n <DialogOverlay />\n <DialogPrimitive.Content\n ref={ref}\n className={cn(\n \"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg\",\n className,\n \"alq--dialog-content\"\n )}\n {...props}\n >\n {children}\n <DialogPrimitive.Close className=\"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground\">\n <X className=\"h-4 w-4\" />\n <span className=\"sr-only\">Close</span>\n </DialogPrimitive.Close>\n </DialogPrimitive.Content>\n </DialogPortal>\n));\nDialogContent.displayName = DialogPrimitive.Content.displayName;\n\nconst DialogHeader = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\n \"flex flex-col space-y-1.5 text-center sm:text-left text-foreground\",\n className,\n \"alq--dialog-header\"\n )}\n {...props}\n />\n);\nDialogHeader.displayName = \"DialogHeader\";\n\nconst DialogFooter = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\n \"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2\",\n className\n )}\n {...props}\n />\n);\nDialogFooter.displayName = \"DialogFooter\";\n\nconst DialogTitle = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Title\n ref={ref}\n className={cn(\n \"text-lg font-semibold leading-none tracking-tight text-foreground\",\n className,\n \"alq--dialog-title\"\n )}\n {...props}\n />\n));\nDialogTitle.displayName = DialogPrimitive.Title.displayName;\n\nconst DialogDescription = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Description\n ref={ref}\n className={cn(\"text-sm text-muted-foreground\", className)}\n {...props}\n />\n));\nDialogDescription.displayName = DialogPrimitive.Description.displayName;\n\nexport {\n Dialog,\n DialogPortal,\n DialogOverlay,\n DialogClose,\n DialogTrigger,\n DialogContent,\n DialogHeader,\n DialogFooter,\n DialogTitle,\n DialogDescription,\n};\n","import * as React from \"react\";\nimport {\n useReactTable,\n getCoreRowModel,\n getSortedRowModel,\n flexRender,\n type ColumnDef,\n type SortingState,\n} from \"@tanstack/react-table\";\nimport { BarChart, Bar, LineChart, Line, AreaChart, Area, PieChart, Pie, Cell, Tooltip, Legend } from \"recharts\";\nimport type { A2uiNodeProps } from \"../registry\";\nimport { cn } from \"../../../lib/utils\";\nimport { styleProps } from \"../style-props\";\nimport { Table, TableHeader, TableBody, TableRow, TableHead, TableCell } from \"../../atoms/ui/table\";\nimport { Progress as ProgressBar } from \"../../atoms/ui/progress\";\nimport { Chart, CHART_PALETTE, themedChartAxes } from \"../../atoms/ui/chart\";\n\nconst PALETTE = CHART_PALETTE;\n\nexport const TableNode: React.FC<A2uiNodeProps> = ({ node, value, onAction }) => {\n // Data comes from the bound dataModel (`value`) OR inline `node.rows`/`node.data`.\n const data = (\n Array.isArray(value) ? value : Array.isArray(node.rows) ? node.rows : Array.isArray(node.data) ? node.data : []\n ) as Array<Record<string, unknown>>;\n let cols = (Array.isArray(node.columns) ? node.columns : []).map((c) =>\n typeof c === \"string\" ? { key: c, header: c } : c,\n ) as Array<{ key?: string; header?: string }>;\n // If the model gave no usable columns, derive them from the first row's keys.\n if (!cols.some((c) => c.key) && data.length) {\n cols = Object.keys(data[0]).map((k) => ({ key: k, header: k }));\n }\n const sortable = node.sortable === true;\n const [sorting, setSorting] = React.useState<SortingState>([]);\n\n const columns = React.useMemo<ColumnDef<Record<string, unknown>>[]>(\n () =>\n cols.map((c, i) => {\n const id = String(c.key ?? `col_${i}`);\n const header = String(c.header ?? c.key ?? `Column ${i + 1}`);\n // Always give an explicit id + string header so TanStack never has to derive\n // one (which throws when the agent omits key/header).\n return c.key\n ? { id, accessorKey: c.key, header }\n : { id, accessorFn: () => \"\", header };\n }),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [node],\n );\n\n const table = useReactTable({\n data,\n columns,\n state: { sorting },\n onSortingChange: setSorting,\n getCoreRowModel: getCoreRowModel(),\n getSortedRowModel: getSortedRowModel(),\n enableSorting: sortable,\n });\n\n return (\n <Table className={styleProps(node)}>\n <TableHeader>\n {table.getHeaderGroups().map((hg) => (\n <TableRow key={hg.id}>\n {hg.headers.map((h) => (\n <TableHead key={h.id}>\n {sortable ? (\n <button\n type=\"button\"\n onClick={() => {\n h.column.toggleSorting();\n // Sorting is LOCAL — a non-wantResponse action never round-trips to the agent.\n onAction?.({ name: \"sort\", wantResponse: false });\n }}\n >\n {flexRender(h.column.columnDef.header, h.getContext())}\n </button>\n ) : (\n flexRender(h.column.columnDef.header, h.getContext())\n )}\n </TableHead>\n ))}\n </TableRow>\n ))}\n </TableHeader>\n <TableBody>\n {table.getRowModel().rows.map((r) => (\n <TableRow key={r.id}>\n {r.getVisibleCells().map((c) => (\n <TableCell key={c.id}>{String(c.getValue() ?? \"\")}</TableCell>\n ))}\n </TableRow>\n ))}\n </TableBody>\n </Table>\n );\n};\n\nexport const ChartNode: React.FC<A2uiNodeProps> = ({ node, value }) => {\n // Data comes from the bound dataModel (`value`) OR inline `node.data`.\n const data = (\n Array.isArray(value) ? value : Array.isArray(node.data) ? node.data : []\n ) as Array<Record<string, unknown>>;\n let series = (Array.isArray(node.series) ? node.series : []).map((s) =>\n typeof s === \"string\" ? { key: s } : s,\n ) as Array<{ key: string; label?: string }>;\n const first = (data[0] ?? {}) as Record<string, unknown>;\n // Derive x (first non-numeric key) and series (numeric keys) if the model omitted them.\n const x = String(node.x ?? Object.keys(first).find((k) => typeof first[k] !== \"number\") ?? \"\");\n if (!series.length && data.length) {\n series = Object.keys(first)\n .filter((k) => k !== x && typeof first[k] === \"number\")\n .map((k) => ({ key: k }));\n }\n const kind = String(node.kind ?? \"bar\");\n\n if (!data.length || !series.length) {\n return <p className=\"text-muted-foreground text-sm\">No data to display</p>;\n }\n\n const axes = themedChartAxes(x);\n\n return (\n <div className={cn(\"w-full\", styleProps(node))}>\n {typeof node.title === \"string\" && <p className=\"mb-2 font-medium\">{node.title}</p>}\n <Chart height={300}>\n {kind === \"line\" ? (\n <LineChart data={data}>\n {axes}\n {series.map((s, i) => (\n <Line key={s.key} dataKey={s.key} name={s.label ?? s.key} stroke={PALETTE[i % PALETTE.length]} />\n ))}\n </LineChart>\n ) : kind === \"area\" ? (\n <AreaChart data={data}>\n {axes}\n {series.map((s, i) => (\n <Area\n key={s.key}\n dataKey={s.key}\n name={s.label ?? s.key}\n stroke={PALETTE[i % PALETTE.length]}\n fill={PALETTE[i % PALETTE.length]}\n fillOpacity={0.2}\n />\n ))}\n </AreaChart>\n ) : kind === \"pie\" ? (\n <PieChart>\n <Tooltip />\n <Legend />\n <Pie data={data} dataKey={series[0].key} nameKey={x} label>\n {data.map((_, i) => (\n <Cell key={i} fill={PALETTE[i % PALETTE.length]} />\n ))}\n </Pie>\n </PieChart>\n ) : (\n <BarChart data={data}>\n {axes}\n {series.map((s, i) => (\n <Bar key={s.key} dataKey={s.key} name={s.label ?? s.key} fill={PALETTE[i % PALETTE.length]} />\n ))}\n </BarChart>\n )}\n </Chart>\n </div>\n );\n};\n\nexport const Progress: React.FC<A2uiNodeProps> = ({ node }) => {\n const max = typeof node.max === \"number\" && node.max > 0 ? node.max : 100;\n const value = typeof node.value === \"number\" ? Math.min(Math.max(node.value, 0), max) : 0;\n const pct = Math.round((value / max) * 100);\n return (\n <div className={cn(\"flex flex-col gap-1\", styleProps(node))}>\n {typeof node.label === \"string\" && (\n <div className=\"flex justify-between text-sm text-muted-foreground\">\n <span>{node.label}</span>\n <span>{pct}%</span>\n </div>\n )}\n <ProgressBar value={pct} />\n </div>\n );\n};\n\nexport const Timeline: React.FC<A2uiNodeProps> = ({ node }) => {\n const items = (Array.isArray(node.items) ? node.items : []) as Array<{\n title: string;\n description?: string;\n timestamp?: string;\n }>;\n return (\n <ol className={cn(\"relative ml-2 border-l border-border\", styleProps(node))}>\n {items.map((it, i) => (\n <li key={i} className=\"mb-4 ml-4\">\n <span className=\"absolute -left-1.5 mt-1 h-3 w-3 rounded-full bg-primary\" />\n <div className=\"text-sm font-medium text-foreground\">{it.title}</div>\n {it.timestamp && <div className=\"text-xs text-muted-foreground\">{it.timestamp}</div>}\n {it.description && <div className=\"text-sm text-muted-foreground\">{it.description}</div>}\n </li>\n ))}\n </ol>\n );\n};\n","import * as React from \"react\";\n\nimport { cn } from \"../../../lib/utils\";\n\nconst Table = React.forwardRef<\n HTMLTableElement,\n React.HTMLAttributes<HTMLTableElement>\n>(({ className, ...props }, ref) => (\n <div className=\"relative w-full overflow-auto\">\n <table\n ref={ref}\n className={cn(\"w-full caption-bottom text-sm text-foreground bg-background\", className, \"alq--table\")}\n {...props}\n />\n </div>\n));\nTable.displayName = \"Table\";\n\nconst TableHeader = React.forwardRef<\n HTMLTableSectionElement,\n React.HTMLAttributes<HTMLTableSectionElement>\n>(({ className, ...props }, ref) => (\n <thead ref={ref} className={cn(\"[&_tr]:border-b border-border bg-muted\", className, \"alq--table-header\")} {...props} />\n));\nTableHeader.displayName = \"TableHeader\";\n\nconst TableBody = React.forwardRef<\n HTMLTableSectionElement,\n React.HTMLAttributes<HTMLTableSectionElement>\n>(({ className, ...props }, ref) => (\n <tbody\n ref={ref}\n className={cn(\"[&_tr:last-child]:border-0 [&_tr]:border-b border-border\", className, \"alq--table-body\")}\n {...props}\n />\n));\nTableBody.displayName = \"TableBody\";\n\nconst TableFooter = React.forwardRef<\n HTMLTableSectionElement,\n React.HTMLAttributes<HTMLTableSectionElement>\n>(({ className, ...props }, ref) => (\n <tfoot\n ref={ref}\n className={cn(\n \"border-t border-border bg-muted/50 font-medium [&>tr]:last:border-b-0\",\n className,\n \"alq--table-footer\"\n )}\n {...props}\n />\n));\nTableFooter.displayName = \"TableFooter\";\n\nconst TableRow = React.forwardRef<\n HTMLTableRowElement,\n React.HTMLAttributes<HTMLTableRowElement>\n>(({ className, ...props }, ref) => (\n <tr\n ref={ref}\n className={cn(\n \"border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted\",\n className\n )}\n {...props}\n />\n));\nTableRow.displayName = \"TableRow\";\n\nconst TableHead = React.forwardRef<\n HTMLTableCellElement,\n React.ThHTMLAttributes<HTMLTableCellElement>\n>(({ className, ...props }, ref) => (\n <th\n ref={ref}\n className={cn(\n \"h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0\",\n className\n )}\n {...props}\n />\n));\nTableHead.displayName = \"TableHead\";\n\nconst TableCell = React.forwardRef<\n HTMLTableCellElement,\n React.TdHTMLAttributes<HTMLTableCellElement>\n>(({ className, ...props }, ref) => (\n <td\n ref={ref}\n className={cn(\"p-4 align-middle [&:has([role=checkbox])]:pr-0\", className)}\n {...props}\n />\n));\nTableCell.displayName = \"TableCell\";\n\nconst TableCaption = React.forwardRef<\n HTMLTableCaptionElement,\n React.HTMLAttributes<HTMLTableCaptionElement>\n>(({ className, ...props }, ref) => (\n <caption\n ref={ref}\n className={cn(\"mt-4 text-sm text-muted-foreground\", className)}\n {...props}\n />\n));\nTableCaption.displayName = \"TableCaption\";\n\nexport {\n Table,\n TableHeader,\n TableBody,\n TableFooter,\n TableHead,\n TableRow,\n TableCell,\n TableCaption,\n};\n","\"use client\";\n\nimport * as React from \"react\";\nimport * as ProgressPrimitive from \"@radix-ui/react-progress\";\n\nimport { cn } from \"../../../lib/utils\";\n\nconst Progress = React.forwardRef<\n React.ElementRef<typeof ProgressPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof ProgressPrimitive.Root>\n>(({ className, value, ...props }, ref) => (\n <ProgressPrimitive.Root\n ref={ref}\n className={cn(\"relative h-2 w-full overflow-hidden rounded-full bg-muted\", className)}\n {...props}\n >\n <ProgressPrimitive.Indicator\n className=\"h-full w-full flex-1 bg-primary transition-all\"\n style={{ transform: `translateX(-${100 - (value || 0)}%)` }}\n />\n </ProgressPrimitive.Root>\n));\nProgress.displayName = ProgressPrimitive.Root.displayName;\n\nexport { Progress };\n","\"use client\";\n\nimport * as React from \"react\";\nimport { ResponsiveContainer, CartesianGrid, XAxis, YAxis, Tooltip, Legend } from \"recharts\";\n\nimport { cn } from \"../../../lib/utils\";\n\n/** Semantic chart token palette (defined in the theme CSS as --chart-1..5). */\nexport const CHART_PALETTE = [\n \"hsl(var(--chart-1))\",\n \"hsl(var(--chart-2))\",\n \"hsl(var(--chart-3))\",\n \"hsl(var(--chart-4))\",\n \"hsl(var(--chart-5))\",\n];\n\nexport interface ChartProps {\n className?: string;\n /** Height in px for the responsive container. */\n height?: number;\n /** A single recharts chart element (BarChart/LineChart/…). */\n children: React.ReactElement;\n}\n\n/**\n * Generic responsive chart container with standardized sizing. The concrete\n * chart type (bars/lines/…) and series come from the caller; this atom owns\n * only the responsive box and theming primitives (see `themedChartAxes`).\n */\nfunction Chart({ className, height = 300, children }: ChartProps) {\n return (\n <div className={cn(\"w-full\", className)} style={{ height }}>\n <ResponsiveContainer width=\"100%\" height=\"100%\">\n {children}\n </ResponsiveContainer>\n </div>\n );\n}\nChart.displayName = \"Chart\";\n\n/**\n * Token-themed axes + grid + tooltip + legend, returned as a fragment so recharts\n * flattens them as direct chart children. Not a component (recharts inspects child\n * types and would not render a wrapper component's output as axes).\n */\nexport function themedChartAxes(x: string): React.ReactElement {\n return (\n <>\n <CartesianGrid strokeDasharray=\"3 3\" className=\"stroke-border\" />\n <XAxis dataKey={x} className=\"text-xs\" />\n <YAxis className=\"text-xs\" />\n <Tooltip />\n <Legend />\n </>\n );\n}\n\nexport { Chart };\n","import * as React from \"react\";\nimport type { A2uiNodeProps } from \"../registry\";\nimport { cn } from \"../../../lib/utils\";\nimport { styleProps } from \"../style-props\";\nimport { Button as UIButton } from \"../../atoms/ui/button\";\n\nconst BUTTON_VARIANT: Record<string, \"default\" | \"outline\" | \"ghost\" | \"link\"> = {\n solid: \"default\",\n outline: \"outline\",\n ghost: \"ghost\",\n link: \"link\",\n};\n\nconst BUTTON_SIZE: Record<string, \"sm\" | \"lg\"> = { sm: \"sm\", lg: \"lg\" };\n\nexport const ButtonNode: React.FC<A2uiNodeProps> = ({ node, onAction }) => {\n // Canonical prop is `text`, but models commonly use `label`/`title` for a button caption.\n const caption = node.text ?? node.label ?? node.title ?? \"\";\n // A Button is colored by its VARIANT (bg + matching foreground). We deliberately do NOT\n // apply styleProps() here: its `tone` maps to a `text-*` color that tailwind-merge would\n // let override the variant's `text-*-foreground`, making the label the same color as the\n // background (invisible). Sizing is expressed via the atom's own `size` prop.\n return (\n <UIButton\n variant={BUTTON_VARIANT[String(node.variant ?? \"solid\")] ?? \"default\"}\n size={typeof node.size === \"string\" ? BUTTON_SIZE[node.size] : undefined}\n className={node.emphasis === \"high\" ? \"font-semibold\" : undefined}\n onClick={() => node.action && onAction?.(node.action)}\n >\n {String(caption)}\n </UIButton>\n );\n};\n\nexport const ButtonGroup: React.FC<A2uiNodeProps> = ({ node, children }) => (\n <div className={cn(\"flex flex-row gap-2\", styleProps(node))}>{children}</div>\n);\n\n/** Only render a real anchor for a safe href (relative or https). Anything else renders as\n * plain text — never navigate a model-authored javascript:/data: or arbitrary URL. */\nconst SAFE_HREF = /^(\\/|https:\\/\\/)/i;\nexport const LinkNode: React.FC<A2uiNodeProps> = ({ node }) => {\n const href = typeof node.href === \"string\" && SAFE_HREF.test(node.href) ? node.href : undefined;\n const text = String(node.text ?? \"\");\n if (!href) return <span className={cn(\"text-muted-foreground\", styleProps(node))}>{text}</span>;\n return (\n <a\n href={href}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className={cn(\"text-primary underline underline-offset-2\", styleProps(node))}\n >\n {text}\n </a>\n );\n};\n","import type * as React from \"react\";\nimport type { A2uiComponent, SurfaceAction } from \"@alquimia-ai/tools/genui\";\nimport {\n Stack,\n Row,\n Column,\n Grid,\n Divider,\n Spacer,\n CardNode,\n TabsNode,\n AccordionNode,\n} from \"./components/layout\";\nimport {\n Text,\n Heading,\n Markdown,\n ImageNode,\n IconNode,\n BadgeNode,\n AvatarNode,\n AlertNode,\n Stat,\n KeyValueNode,\n ListNode,\n Quote,\n} from \"./components/content\";\nimport {\n TextField,\n TextArea,\n NumberField,\n SelectNode,\n MultiSelect,\n Combobox,\n CheckboxNode,\n CheckboxGroup,\n Radio,\n SwitchNode,\n SliderNode,\n DatePicker,\n DateRange,\n FileUpload,\n Rating,\n} from \"./components/inputs\";\nimport { TableNode, ChartNode, Progress, Timeline } from \"./components/data\";\nimport { ButtonNode, ButtonGroup, LinkNode } from \"./components/actions\";\n\n/** Props every A2UI component receives from the renderer. */\nexport interface A2uiNodeProps {\n node: A2uiComponent;\n value?: unknown;\n onChange?: (value: unknown) => void;\n onAction?: (action: SurfaceAction) => void;\n children?: React.ReactNode;\n}\n\n/** The default catalog registry: catalog component name -> React component. */\nexport const coreUiRegistry: Record<string, React.ComponentType<A2uiNodeProps>> = {\n // layout\n Stack,\n Row,\n Column,\n Grid,\n Divider,\n Spacer,\n Card: CardNode,\n Tabs: TabsNode,\n Accordion: AccordionNode,\n // content\n Text,\n Heading,\n Markdown,\n Image: ImageNode,\n Icon: IconNode,\n Badge: BadgeNode,\n Avatar: AvatarNode,\n Alert: AlertNode,\n Stat,\n KeyValue: KeyValueNode,\n List: ListNode,\n Quote,\n // inputs\n TextField,\n TextArea,\n NumberField,\n Select: SelectNode,\n MultiSelect,\n Combobox,\n Checkbox: CheckboxNode,\n CheckboxGroup,\n Radio,\n Switch: SwitchNode,\n Slider: SliderNode,\n DatePicker,\n DateRange,\n FileUpload,\n Rating,\n // data\n Table: TableNode,\n Chart: ChartNode,\n Progress,\n Timeline,\n // actions\n Button: ButtonNode,\n ButtonGroup,\n Link: LinkNode,\n};\n","import * as React from \"react\";\nimport { Check } from \"lucide-react\";\nimport type { A2uiSurface, UIAction } from \"@alquimia-ai/tools/genui\";\nimport { cn } from \"../../lib/utils\";\nimport { Assistant, AssistantMessageArea, AssistantInput } from \"../organisms/assistant\";\nimport { A2uiRenderer } from \"./renderer\";\nimport { coreUiRegistry, type A2uiNodeProps } from \"./registry\";\n\ntype ChatMessage = { id?: string; role?: string; content?: string };\n\n/** The subset of the `useAlquimia` return that AssistantChat consumes. */\nexport interface GenuiChatController {\n messages: ChatMessage[];\n input: string;\n handleInputChange: (event: React.ChangeEvent<HTMLTextAreaElement>) => void;\n handleSubmit: (\n event: React.FormEvent<HTMLFormElement>,\n traceParentId?: string,\n sessionId?: string,\n ) => Promise<void> | void;\n handleLoadingCancel?: () => void;\n isLoading?: boolean;\n isMessageStreaming?: boolean;\n streamingMessageId?: string | null;\n genui?: {\n surfaces: Array<{\n controlId: string;\n surface: A2uiSurface;\n afterCount: number;\n submitted?: boolean;\n dismissedWith?: string;\n }>;\n onAgentAction: (controlId: string) => (action: UIAction) => void;\n awaitingUser: boolean;\n dismiss?: (userMessage?: string) => void;\n };\n}\n\nexport interface AssistantChatProps {\n /** The value returned by `useAlquimia({ genui: {...} })`. */\n alquimia: GenuiChatController;\n /** Catalog component name -> React component. Defaults to the built-in catalog; pass your own to swap component libraries. */\n registry?: Record<string, React.ComponentType<A2uiNodeProps>>;\n /** Conversation id passed to `handleSubmit`. Optional if the SDK already has one. */\n conversationId?: string | null;\n placeholder?: string;\n suggestions?: string[];\n className?: string;\n /** Override the typing indicator shown while the agent is working. Defaults to animated dots. */\n thinkIndicator?: React.ReactNode;\n}\n\n/** Animated three-dot \"typing\" bubble, themed via the primary token. */\nfunction TypingDots() {\n return (\n <div className=\"flex w-fit items-center gap-1.5 rounded-2xl rounded-bl-md border border-border/60 bg-card px-4 py-3 shadow-sm\">\n {[0, 1, 2].map((i) => (\n <span\n key={i}\n className=\"h-2 w-2 animate-bounce rounded-full bg-primary\"\n style={{ animationDelay: `${i * 0.15}s`, animationDuration: \"0.9s\" }}\n />\n ))}\n </div>\n );\n}\n\n/**\n * Batteries-included GenUI chat. A thin composition of the SDK's existing organisms\n * (`AssistantMessageArea` + `AssistantInput`) — it does NOT reimplement message\n * rendering, so it inherits markdown, error rendering, timestamps, and streaming for\n * free. Its only job is to (a) turn `genui.surfaces` into an `interleave` callback the\n * message area renders in place, and (b) gate the typing indicator while a surface\n * awaits the user. All orchestration lives in `useAlquimia({ genui })`.\n *\n * To use a different component library, swap `registry` (and pass your own catalog to\n * the hook). To customize the shell, compose the organisms directly instead of using\n * this wrapper.\n */\nexport function AssistantChat({\n alquimia,\n registry = coreUiRegistry,\n conversationId,\n placeholder = \"Ask the agent to build something…\",\n suggestions = [],\n className,\n thinkIndicator,\n}: AssistantChatProps) {\n const endRef = React.useRef<HTMLDivElement>(null);\n const {\n messages,\n input,\n handleInputChange,\n handleSubmit,\n handleLoadingCancel,\n isLoading,\n isMessageStreaming,\n streamingMessageId,\n genui,\n } = alquimia;\n\n const surfaces = genui?.surfaces ?? [];\n const awaitingUser = genui?.awaitingUser ?? false;\n const isBusy = !!(isLoading || isMessageStreaming);\n\n // A chat \"has content\" once there's a user turn or any assistant text. Until then we\n // show the empty state (prompt + suggestions).\n const hasContent = messages.some(\n (m) => m.role === \"user\" || (m.role !== \"system\" && (m.content ?? \"\").trim().length > 0),\n );\n const isEmpty = !hasContent && surfaces.length === 0;\n\n React.useEffect(() => {\n endRef.current?.scrollIntoView({ behavior: \"smooth\" });\n }, [messages, surfaces]);\n\n const renderSurface = (item: {\n controlId: string;\n surface: A2uiSurface;\n submitted?: boolean;\n dismissedWith?: string;\n }) => (\n <div key={`s-${item.controlId}`} className=\"my-3 flex flex-col items-start gap-1.5\">\n <div\n className={cn(\n \"relative w-full max-w-[95%] rounded-2xl border border-border/60 bg-card p-5 shadow-sm duration-500 animate-in fade-in slide-in-from-bottom-2\",\n item.submitted && \"opacity-70\",\n )}\n >\n {item.submitted && (\n <div className=\"absolute right-3 top-3 z-10 flex items-center gap-1 rounded-full bg-emerald-500/10 px-2 py-0.5 text-xs font-medium text-emerald-600 dark:text-emerald-400\">\n <Check className=\"h-3 w-3\" />\n {item.dismissedWith ? \"Skipped\" : \"Submitted\"}\n </div>\n )}\n {/* Once submitted, freeze the surface: no re-submits, inputs read-only. */}\n <div className={cn(item.submitted && \"pointer-events-none select-none\")} aria-disabled={item.submitted}>\n <A2uiRenderer\n surface={item.surface}\n registry={registry}\n onAgentAction={genui ? genui.onAgentAction(item.controlId) : () => {}}\n />\n </div>\n </div>\n {/* What the user said instead of using the surface, anchored to the surface it replaced. */}\n {item.dismissedWith && (\n <p className=\"alq--surface-dismissed max-w-[95%] pl-1 text-sm text-muted-foreground\">\n <span className=\"font-medium text-foreground\">You replied:</span> {item.dismissedWith}\n </p>\n )}\n </div>\n );\n\n // Group surfaces by their message-count anchor (`afterCount`). The message area calls\n // interleave(0) before the first message and interleave(i+1) after message i.\n const byCount = new Map<number, typeof surfaces>();\n for (const s of surfaces) {\n const arr = byCount.get(s.afterCount) ?? [];\n arr.push(s);\n byCount.set(s.afterCount, arr);\n }\n\n const interleave = (afterIndex: number): React.ReactNode => {\n const nodes: React.ReactNode[] = (byCount.get(afterIndex) ?? []).map(renderSurface);\n if (afterIndex === 0 && isEmpty) {\n nodes.unshift(\n <div\n key=\"empty\"\n className=\"flex min-h-full flex-col items-center justify-center gap-4 py-16 text-center\"\n >\n <p className=\"max-w-sm text-muted-foreground\">Ask the agent to build an interface.</p>\n <div className=\"flex flex-col items-center gap-2\">\n {suggestions.map((s) => (\n <button\n key={s}\n type=\"button\"\n onClick={() =>\n handleInputChange({\n target: { value: s },\n } as unknown as React.ChangeEvent<HTMLTextAreaElement>)\n }\n className=\"rounded-full border border-border/70 bg-card px-4 py-2 text-sm text-foreground/80 transition hover:border-primary/40 hover:shadow-sm\"\n >\n {s}\n </button>\n ))}\n </div>\n </div>,\n );\n }\n return nodes.length ? nodes : null;\n };\n\n const onSubmit = async (e: React.FormEvent<HTMLFormElement>) => {\n e.preventDefault();\n if (!input.trim()) return;\n if (awaitingUser && genui?.dismiss) {\n genui.dismiss(input);\n return;\n }\n if (isBusy) return;\n try {\n await handleSubmit(e, undefined, conversationId ?? undefined);\n } catch {\n handleLoadingCancel?.();\n }\n };\n\n return (\n <Assistant className={cn(\"mx-auto flex h-full w-full max-w-2xl flex-col bg-transparent px-4\", className)}>\n <AssistantMessageArea\n className=\"bg-transparent\"\n messages={messages as never}\n messagesEndRef={endRef}\n isLoading={!!isLoading}\n streamingMessageId={streamingMessageId ?? null}\n interleave={interleave}\n awaitingUser={awaitingUser}\n thinkIndicator={thinkIndicator ?? <TypingDots />}\n />\n <AssistantInput\n className=\"mb-5 mt-2 rounded-2xl border-border/60 bg-card/90 shadow-lg backdrop-blur\"\n sendMessageFunc={onSubmit}\n // NOTE: AssistantInput ties BOTH the textarea and the send button to this flag,\n // so it must reflect \"busy\", not \"empty\" — otherwise an empty input can't be typed\n // into. Empty submits are already a no-op (guarded in onSubmit).\n //\n // `&& !awaitingUser`: while a surface waits for the user the inference is parked, so\n // `isLoading` stays true — but the user is not being made to wait, they are being asked.\n // Disabling here would trap anyone who wants none of the offered options. They must be\n // able to answer in words; `onSubmit` turns that into a dismissal of the surface.\n isButtonDisabled={isBusy && !awaitingUser}\n input={input}\n handleInputChange={handleInputChange}\n isMessageStreaming={!!isMessageStreaming}\n placeholders={[placeholder, placeholder]}\n />\n </Assistant>\n );\n}\n","\"use client\";\n\nimport * as React from \"react\";\nimport { FormEvent, useCallback, useEffect, useRef, useState } from \"react\";\nimport { AlquimiaSDK } from \"@alquimia-ai/tools/sdk\";\nimport { Typography } from \"../atoms\";\nimport { CallOut, CallOutResponse, CallOutActions } from \"../molecules\";\nimport { ThinkIndicator } from \"../atoms\";\nimport { cn, getErrorMessage, hasToolResult } from \"../../lib/utils\";\nimport { Message } from \"ai\";\nimport { Send } from \"lucide-react\";\nimport { Tooler, ToolFactory } from \"../../types\";\n\ninterface AssistantProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Optional — the shell doesn't consume it; kept for API compatibility. */\n sdk?: AlquimiaSDK;\n title?: string;\n description?: string;\n}\n\nconst Assistant = React.forwardRef<HTMLDivElement, AssistantProps>(\n ({ className, sdk, title, description, children, ...props }, ref) => {\n return (\n <div\n ref={ref}\n className={cn(\"flex flex-col h-full bg-background text-foreground\", className)}\n {...props}\n >\n {(title || description) && (\n <AssistantHeader>\n {title && <AssistantTitle title={title} />}\n {description && <AssistantDescription description={description} />}\n </AssistantHeader>\n )}\n {children}\n </div>\n );\n }\n);\nAssistant.displayName = \"Assistant\";\n\ninterface AssistantTitleProps extends React.HTMLAttributes<HTMLHeadingElement> {\n title: string;\n}\n\nconst AssistantTitle = React.forwardRef<HTMLHeadingElement, AssistantTitleProps>(\n ({ className, title, ...props }, ref) => (\n <div ref={ref} className={cn(\"text-foreground\", className)} {...props}>\n <Typography typeStyle=\"heading1\" as=\"h1\">\n {title}\n </Typography>\n </div>\n )\n);\nAssistantTitle.displayName = \"AssistantTitle\";\n\ninterface AssistantDescriptionProps\n extends React.HTMLAttributes<HTMLParagraphElement> {\n description: string;\n}\n\nconst AssistantDescription = React.forwardRef<\n HTMLParagraphElement,\n AssistantDescriptionProps\n>(({ className, description, ...props }, ref) => (\n <div ref={ref} className={cn(\"text-foreground\", className)} {...props}>\n <Typography typeStyle=\"display\" as=\"p\">\n {description}\n </Typography>\n </div>\n));\nAssistantDescription.displayName = \"AssistantDescription\";\n\ninterface AssistantHeaderProps extends React.HTMLAttributes<HTMLDivElement> {}\n\nconst AssistantHeader = React.forwardRef<HTMLDivElement, AssistantHeaderProps>(\n ({ className, children, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\"bg-background text-foreground\", className)}\n {...props}\n >\n {children}\n </div>\n )\n);\nAssistantHeader.displayName = \"AssistantHeader\";\n\ninterface MessageAction {\n label: string;\n icon: React.ReactNode;\n onClick: (message?: Message) => Promise<void>;\n custom?: boolean;\n component?: (props: { message?: Message }) => React.ReactNode;\n}\n\ninterface AssistantMessageAreaProps\n extends React.HTMLAttributes<HTMLDivElement> {\n messages: (Message & {\n error_code?: string;\n created_at?: string;\n error_detail?: string;\n additionalInfo?: string;\n loading?: boolean;\n tooler?: Tooler[];\n taskid?: string;\n })[];\n actions?: MessageAction[];\n messagesEndRef: any;\n thinkIndicator?: React.ReactNode;\n isMessageStreaming?: boolean;\n streamingMessageId: string | null;\n handleIsTextStreaming?: (isStreaming: boolean) => void;\n toolFactory?: ToolFactory;\n isLoading: boolean;\n showDetailedErrors?: boolean;\n /**\n * Optional injection seam for content rendered between messages. Called with `0`\n * before the first message and `i + 1` after the message at index `i`, so callers\n * can interleave extra nodes (e.g. GenUI surfaces anchored to a message count).\n * Generic on purpose — the organism stays unaware of GenUI.\n */\n interleave?: (afterIndex: number) => React.ReactNode;\n /**\n * When true, suppresses the trailing typing indicator — used when an interactive\n * surface is awaiting the user, so the chat doesn't look like it's still thinking.\n */\n awaitingUser?: boolean;\n}\n\nconst AssistantMessageArea = React.forwardRef<\n HTMLDivElement,\n AssistantMessageAreaProps\n>(\n (\n {\n className,\n messages,\n messagesEndRef,\n actions,\n streamingMessageId,\n thinkIndicator,\n handleIsTextStreaming,\n toolFactory,\n isLoading,\n showDetailedErrors,\n interleave,\n awaitingUser,\n isMessageStreaming: _isMessageStreaming,\n ...props\n },\n ref\n ) => {\n useEffect(() => {\n messagesEndRef.current?.scrollIntoView({ behavior: \"instant\" });\n }, []);\n return (\n <div\n ref={ref}\n className={cn(\"p-6 overflow-y-auto flex-grow bg-background\", className)}\n {...props}\n >\n {interleave?.(0)}\n {messages.map((message, index) => (\n <div key={message.id}>\n <CallOut\n key={message.id}\n role={message.role as \"user\" | \"assistant\"}\n message={message}\n >\n {streamingMessageId === message.id &&\n (isLoading || message.content.length === 0) &&\n !message.error_code &&\n !awaitingUser && (\n <div>{thinkIndicator ?? <ThinkIndicator />}</div>\n )}\n {message.error_code && (\n <CallOutResponse\n role=\"assistant\"\n data-error-code={message.error_code}\n additionalInfo={showDetailedErrors ? `${message.error_detail}${message.taskid ? `\\ntask id: ${message.taskid}` : ''}` : undefined}\n toggleAdditionalInfo\n >\n {getErrorMessage(message.error_code)}\n </CallOutResponse>\n )}\n {!message.error_code && message.tooler?.filter(hasToolResult).map((tool, index) => (\n <React.Fragment key={tool.control_id || `${tool.tool_summary?.name}-${index}`}>\n {toolFactory?.createTool(tool.tool_summary?.name || \"\", tool.tool_output)}\n </React.Fragment>\n ))}\n {message.content && !message.error_code && (\n <div\n data-role={message.role}\n className=\"alq--callout-message-container\"\n >\n {message.created_at && streamingMessageId !== message.id && (\n <div className=\"text-xs text-muted-foreground/80 pb-1 alq--callout-message-date\">\n {new Date(Number(message.created_at)).toLocaleString(\n \"es-ES\",\n {\n hour: \"2-digit\",\n minute: \"2-digit\",\n hour12: false,\n }\n )}\n </div>\n )}\n <CallOutResponse\n role={message.role}\n isStreaming={streamingMessageId === message.id}\n handleIsTextStreaming={handleIsTextStreaming}\n additionalInfo={\n streamingMessageId !== message.id\n ? message?.additionalInfo\n : undefined\n }\n >\n {message.content}\n </CallOutResponse>\n {actions && streamingMessageId !== message.id && (\n <CallOutActions\n key={message.id}\n actions={actions}\n message={message}\n role={message.role as \"user\" | \"assistant\"}\n />\n )}\n </div>\n )}\n </CallOut>\n {interleave?.(index + 1)}\n </div>\n ))}\n <div ref={messagesEndRef} />\n </div>\n );\n }\n);\nAssistantMessageArea.displayName = \"AssistantMessageArea\";\n\ninterface AssistantInputProps\n extends React.FormHTMLAttributes<HTMLFormElement> {\n sendMessageFunc: (event: React.FormEvent<HTMLFormElement>) => Promise<void>;\n isButtonDisabled: boolean;\n input: string;\n handleInputChange: (event: React.ChangeEvent<HTMLTextAreaElement>) => void;\n isMessageStreaming: boolean;\n speechToTextComponent?: React.ReactNode;\n userToolboxComponent?: React.ReactNode;\n placeholders?: [string, string];\n onFileDrop?: (files: File[]) => void;\n attachmentsSlot?: React.ReactNode;\n}\n\nconst AssistantInput = React.forwardRef<HTMLFormElement, AssistantInputProps>(\n (\n {\n className,\n sendMessageFunc,\n isButtonDisabled,\n input,\n handleInputChange,\n isMessageStreaming,\n speechToTextComponent,\n userToolboxComponent,\n placeholders,\n onFileDrop,\n attachmentsSlot,\n ...props\n },\n ref\n ) => {\n const [isDragging, setIsDragging] = useState(false);\n const dragCounterRef = useRef(0);\n\n const handleDragEnter = useCallback((e: React.DragEvent) => {\n e.preventDefault();\n e.stopPropagation();\n dragCounterRef.current += 1;\n if (e.dataTransfer.types.includes(\"Files\")) {\n setIsDragging(true);\n }\n }, []);\n\n const handleDragOver = useCallback((e: React.DragEvent) => {\n e.preventDefault();\n e.stopPropagation();\n }, []);\n\n const handleDragLeave = useCallback((e: React.DragEvent) => {\n e.preventDefault();\n e.stopPropagation();\n dragCounterRef.current -= 1;\n if (dragCounterRef.current === 0) {\n setIsDragging(false);\n }\n }, []);\n\n const handleDrop = useCallback(\n (e: React.DragEvent) => {\n e.preventDefault();\n e.stopPropagation();\n dragCounterRef.current = 0;\n setIsDragging(false);\n const files = Array.from(e.dataTransfer.files);\n if (files.length > 0) {\n onFileDrop?.(files);\n }\n },\n [onFileDrop]\n );\n\n const placeholder = placeholders\n ? isMessageStreaming\n ? placeholders[0]\n : placeholders[1]\n : isMessageStreaming\n ? \"Processing...\"\n : \"Type your message here...\";\n\n return (\n <form\n onSubmit={sendMessageFunc}\n className={cn(\n \"flex flex-col relative rounded-lg border border-input bg-background\",\n \"focus-within:ring-2 focus-within:ring-ring\",\n onFileDrop && isDragging && \"ring-2 ring-primary/50 alq--assistant-input-dragover\",\n className\n )}\n ref={ref}\n onDragEnter={onFileDrop ? handleDragEnter : undefined}\n onDragOver={onFileDrop ? handleDragOver : undefined}\n onDragLeave={onFileDrop ? handleDragLeave : undefined}\n onDrop={onFileDrop ? handleDrop : undefined}\n {...props}\n >\n {attachmentsSlot}\n <textarea\n disabled={isButtonDisabled}\n value={input}\n onChange={handleInputChange}\n placeholder={placeholder}\n className={cn(\n \"flex-1 min-w-0 text-sm p-3 focus:outline-none w-full resize-none\",\n \"bg-transparent text-foreground\",\n \"placeholder:text-muted-foreground\",\n \"disabled:opacity-50 disabled:cursor-not-allowed\"\n )}\n onKeyDown={(e) => {\n if (e.key === 'Enter' && !e.shiftKey) {\n e.preventDefault();\n sendMessageFunc(e as unknown as FormEvent<HTMLFormElement>);\n }\n }}\n />\n <div className=\"flex items-center relative alq--assistant-actions\">\n {userToolboxComponent}\n {speechToTextComponent}\n <button\n type=\"submit\"\n aria-label=\"Send\"\n disabled={isButtonDisabled}\n className={cn(\n \"w-10 h-10 rounded-full flex items-center justify-center alq--assistant-button-send\",\n isButtonDisabled\n ? \"bg-muted text-muted-foreground\"\n : \"bg-primary text-primary-foreground hover:bg-primary/90\"\n )}\n >\n <Send className=\"w-5 h-5\" />\n </button>\n </div>\n </form>\n );\n }\n);\nAssistantInput.displayName = \"AssistantInput\";\n\nexport {\n Assistant,\n AssistantTitle,\n AssistantDescription,\n AssistantHeader,\n AssistantMessageArea,\n AssistantInput,\n};\n","\"use client\"\n\nimport * as React from \"react\"\nimport * as ScrollAreaPrimitive from \"@radix-ui/react-scroll-area\"\n\nimport { cn } from \"../../../lib/utils\";\n\nconst ScrollArea = React.forwardRef<\n React.ElementRef<typeof ScrollAreaPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.Root>\n>(({ className, children, ...props }, ref) => (\n <ScrollAreaPrimitive.Root\n ref={ref}\n className={cn(\"relative overflow-hidden\", className)}\n {...props}\n >\n <ScrollAreaPrimitive.Viewport className=\"h-full w-full rounded-[inherit]\">\n {children}\n </ScrollAreaPrimitive.Viewport>\n <ScrollBar />\n <ScrollAreaPrimitive.Corner />\n </ScrollAreaPrimitive.Root>\n))\nScrollArea.displayName = ScrollAreaPrimitive.Root.displayName\n\nconst ScrollBar = React.forwardRef<\n React.ElementRef<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>,\n React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>\n>(({ className, orientation = \"vertical\", ...props }, ref) => (\n <ScrollAreaPrimitive.ScrollAreaScrollbar\n ref={ref}\n orientation={orientation}\n className={cn(\n \"flex touch-none select-none transition-colors\",\n orientation === \"vertical\" &&\n \"h-full w-2.5 border-l border-l-transparent p-[1px]\",\n orientation === \"horizontal\" &&\n \"h-2.5 flex-col border-t border-t-transparent p-[1px]\",\n className\n )}\n {...props}\n >\n <ScrollAreaPrimitive.ScrollAreaThumb className=\"relative flex-1 rounded-full bg-border\" />\n </ScrollAreaPrimitive.ScrollAreaScrollbar>\n))\nScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName\n\nexport { ScrollArea, ScrollBar }\n","import { cn } from \"../../../lib/utils\";\n\nfunction Skeleton({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) {\n return (\n <div\n className={cn(\"animate-pulse rounded-md bg-muted text-muted-foreground\", className, \"alq--skeleton\")}\n {...props}\n />\n );\n}\n\nexport { Skeleton };\n","\"use client\";\n\nimport * as React from \"react\";\nimport { Drawer as DrawerPrimitive } from \"vaul\";\n\nimport { cn } from \"../../../lib/utils\";\n\nconst Drawer = ({\n shouldScaleBackground = true,\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Root>) => (\n <DrawerPrimitive.Root\n shouldScaleBackground={shouldScaleBackground}\n {...props}\n />\n);\nDrawer.displayName = \"Drawer\";\n\nconst DrawerTrigger = DrawerPrimitive.Trigger;\n\nconst DrawerPortal = DrawerPrimitive.Portal;\n\nconst DrawerClose = DrawerPrimitive.Close;\n\nconst DrawerOverlay = React.forwardRef<\n React.ElementRef<typeof DrawerPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n <DrawerPrimitive.Overlay\n ref={ref}\n className={cn(\"fixed inset-0 z-50 bg-black/80\", className)}\n {...props}\n />\n));\nDrawerOverlay.displayName = DrawerPrimitive.Overlay.displayName;\n\nconst DrawerContent = React.forwardRef<\n React.ElementRef<typeof DrawerPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Content>\n>(({ className, children, ...props }, ref) => (\n <DrawerPortal>\n <DrawerOverlay />\n <DrawerPrimitive.Content\n ref={ref}\n className={cn(\n \"fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border border-border bg-background text-foreground alq--drawer-content\",\n className\n )}\n {...props}\n >\n <div className=\"mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted\" />\n {children}\n </DrawerPrimitive.Content>\n </DrawerPortal>\n));\nDrawerContent.displayName = \"DrawerContent\";\n\nconst DrawerHeader = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\"grid gap-1.5 p-4 text-center sm:text-left\", className, \"alq--drawer-header\")}\n {...props}\n />\n);\nDrawerHeader.displayName = \"DrawerHeader\";\n\nconst DrawerFooter = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\"mt-auto flex flex-col gap-2 p-4\", className, \"alq--drawer-footer\")}\n {...props}\n />\n);\nDrawerFooter.displayName = \"DrawerFooter\";\n\nconst DrawerTitle = React.forwardRef<\n React.ElementRef<typeof DrawerPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <DrawerPrimitive.Title\n ref={ref}\n className={cn(\n \"text-lg font-semibold leading-none tracking-tight\",\n className,\n \"alq--drawer-title\"\n )}\n {...props}\n />\n));\nDrawerTitle.displayName = DrawerPrimitive.Title.displayName;\n\nconst DrawerDescription = React.forwardRef<\n React.ElementRef<typeof DrawerPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <DrawerPrimitive.Description\n ref={ref}\n className={cn(\"text-sm text-muted-foreground\", className, \"alq--drawer-description\")}\n {...props}\n />\n));\nDrawerDescription.displayName = DrawerPrimitive.Description.displayName;\n\nexport {\n Drawer,\n DrawerPortal,\n DrawerOverlay,\n DrawerTrigger,\n DrawerClose,\n DrawerContent,\n DrawerHeader,\n DrawerFooter,\n DrawerTitle,\n DrawerDescription,\n};\n","import { cn } from \"../../../../lib/utils\";\nimport { forwardRef } from \"react\";\n\nexport interface TypographyProps extends React.HTMLAttributes<HTMLDivElement> {\n as?: \"h1\" | \"h2\" | \"h3\" | \"h4\" | \"h5\" | \"h6\" | \"p\" | \"span\";\n typeStyle:\n | \"display\"\n | \"heading1\"\n | \"heading2\"\n | \"heading3\"\n | \"heading4\"\n | \"small\"\n | \"tiny\";\n}\n\nconst Typography = forwardRef<HTMLDivElement, TypographyProps>(\n ({ as: Component = \"p\", typeStyle, ...props }, ref) => {\n return (\n <Component\n {...props}\n className={cn(props.className, `alq--typography-${typeStyle}`)}\n ref={ref}\n />\n );\n }\n);\n\nTypography.displayName = \"Typography\";\n\nexport { Typography };\n","\"use client\";\n\nimport * as React from \"react\";\nimport * as TogglePrimitive from \"@radix-ui/react-toggle\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\n\nimport { cn } from \"../../../lib/utils\";\n\nconst toggleVariants = cva(\n \"inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground\",\n {\n variants: {\n variant: {\n default: \"bg-transparent\",\n outline:\n \"border border-input bg-transparent hover:bg-accent hover:text-accent-foreground\",\n },\n size: {\n default: \"h-10 px-3\",\n sm: \"h-9 px-2.5\",\n lg: \"h-11 px-5\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n }\n);\n\nconst Toggle = React.forwardRef<\n React.ElementRef<typeof TogglePrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof TogglePrimitive.Root> &\n VariantProps<typeof toggleVariants>\n>(({ className, variant, size, ...props }, ref) => (\n <TogglePrimitive.Root\n ref={ref}\n className={cn(toggleVariants({ variant, size, className }), \"alq--toggle\")}\n {...props}\n />\n));\n\nToggle.displayName = TogglePrimitive.Root.displayName;\n\nexport { Toggle, toggleVariants };\n","\"use client\"\n\nimport * as AspectRatioPrimitive from \"@radix-ui/react-aspect-ratio\"\n\nconst AspectRatio = AspectRatioPrimitive.Root\n\nexport { AspectRatio }\n","import * as React from \"react\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport { ChevronRight, MoreHorizontal } from \"lucide-react\";\n\nimport { cn } from \"../../../lib/utils\";\ninterface BreadcrumbItemProps {\n label: string;\n href?: string;\n current?: boolean;\n}\n\nconst Breadcrumb = React.forwardRef<\n HTMLElement,\n React.ComponentPropsWithoutRef<\"nav\"> & {\n separator?: React.ReactNode;\n }\n>(({ ...props }, ref) => <nav ref={ref} aria-label=\"breadcrumb\" {...props} />);\nBreadcrumb.displayName = \"Breadcrumb\";\n\nconst BreadcrumbList = React.forwardRef<\n HTMLOListElement,\n React.ComponentPropsWithoutRef<\"ol\">\n>(({ className, ...props }, ref) => (\n <ol\n ref={ref}\n className={cn(\n \"flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5\",\n className\n )}\n {...props}\n />\n));\nBreadcrumbList.displayName = \"BreadcrumbList\";\n\nconst BreadcrumbItem = React.forwardRef<\n HTMLLIElement,\n React.ComponentPropsWithoutRef<\"li\">\n>(({ className, ...props }, ref) => (\n <li\n ref={ref}\n className={cn(\"inline-flex items-center gap-1.5\", className)}\n {...props}\n />\n));\nBreadcrumbItem.displayName = \"BreadcrumbItem\";\n\nconst BreadcrumbLink = React.forwardRef<\n HTMLAnchorElement,\n React.ComponentPropsWithoutRef<\"a\"> & {\n asChild?: boolean;\n }\n>(({ asChild, className, ...props }, ref) => {\n const Comp = asChild ? Slot : \"a\";\n\n return (\n <Comp\n ref={ref}\n className={cn(\"transition-colors hover:text-foreground\", className)}\n {...props}\n />\n );\n});\nBreadcrumbLink.displayName = \"BreadcrumbLink\";\n\nconst BreadcrumbPage = React.forwardRef<\n HTMLSpanElement,\n React.ComponentPropsWithoutRef<\"span\">\n>(({ className, ...props }, ref) => (\n <span\n ref={ref}\n role=\"link\"\n aria-disabled=\"true\"\n aria-current=\"page\"\n className={cn(\"font-normal text-foreground\", className)}\n {...props}\n />\n));\nBreadcrumbPage.displayName = \"BreadcrumbPage\";\n\nconst BreadcrumbSeparator = ({\n children,\n className,\n ...props\n}: React.ComponentProps<\"li\">) => (\n <li\n role=\"presentation\"\n aria-hidden=\"true\"\n className={cn(\"[&>svg]:w-3.5 [&>svg]:h-3.5\", className)}\n {...props}\n >\n {children ?? <ChevronRight />}\n </li>\n);\nBreadcrumbSeparator.displayName = \"BreadcrumbSeparator\";\n\nconst BreadcrumbEllipsis = ({\n className,\n ...props\n}: React.ComponentProps<\"span\">) => (\n <span\n role=\"presentation\"\n aria-hidden=\"true\"\n className={cn(\"flex h-9 w-9 items-center justify-center\", className)}\n {...props}\n >\n <MoreHorizontal className=\"h-4 w-4\" />\n <span className=\"sr-only\">More</span>\n </span>\n);\nBreadcrumbEllipsis.displayName = \"BreadcrumbElipssis\";\n\nexport {\n Breadcrumb,\n BreadcrumbList,\n BreadcrumbItem,\n BreadcrumbLink,\n BreadcrumbPage,\n BreadcrumbSeparator,\n BreadcrumbEllipsis,\n};\n","\"use client\";\n\nimport * as React from \"react\";\nimport * as AlertDialogPrimitive from \"@radix-ui/react-alert-dialog\";\n\nimport { cn } from \"../../lib/utils\";\nimport { buttonVariants } from \"../atoms/ui/button\";\n\nconst AlertDialog = AlertDialogPrimitive.Root;\n\nconst AlertDialogTrigger = AlertDialogPrimitive.Trigger;\n\nconst AlertDialogPortal = AlertDialogPrimitive.Portal;\n\nconst AlertDialogOverlay = React.forwardRef<\n React.ElementRef<typeof AlertDialogPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n <AlertDialogPrimitive.Overlay\n className={cn(\n \"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0\",\n className\n )}\n {...props}\n ref={ref}\n />\n));\nAlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName;\n\nconst AlertDialogContent = React.forwardRef<\n React.ElementRef<typeof AlertDialogPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Content>\n>(({ className, ...props }, ref) => (\n <AlertDialogPortal>\n <AlertDialogOverlay />\n <AlertDialogPrimitive.Content\n ref={ref}\n className={cn(\n \"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg\",\n className\n )}\n {...props}\n />\n </AlertDialogPortal>\n));\nAlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName;\n\nconst AlertDialogHeader = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\n \"flex flex-col space-y-2 text-center sm:text-left\",\n className\n )}\n {...props}\n />\n);\nAlertDialogHeader.displayName = \"AlertDialogHeader\";\n\nconst AlertDialogFooter = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\n \"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2\",\n className\n )}\n {...props}\n />\n);\nAlertDialogFooter.displayName = \"AlertDialogFooter\";\n\nconst AlertDialogTitle = React.forwardRef<\n React.ElementRef<typeof AlertDialogPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <AlertDialogPrimitive.Title\n ref={ref}\n className={cn(\"text-lg font-semibold\", className)}\n {...props}\n />\n));\nAlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName;\n\nconst AlertDialogDescription = React.forwardRef<\n React.ElementRef<typeof AlertDialogPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <AlertDialogPrimitive.Description\n ref={ref}\n className={cn(\"text-sm text-muted-foreground\", className)}\n {...props}\n />\n));\nAlertDialogDescription.displayName =\n AlertDialogPrimitive.Description.displayName;\n\nconst AlertDialogAction = React.forwardRef<\n React.ElementRef<typeof AlertDialogPrimitive.Action>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Action>\n>(({ className, ...props }, ref) => (\n <AlertDialogPrimitive.Action\n ref={ref}\n className={cn(buttonVariants(), className)}\n {...props}\n />\n));\nAlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName;\n\nconst AlertDialogCancel = React.forwardRef<\n React.ElementRef<typeof AlertDialogPrimitive.Cancel>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Cancel>\n>(({ className, ...props }, ref) => (\n <AlertDialogPrimitive.Cancel\n ref={ref}\n className={cn(\n buttonVariants({ variant: \"outline\" }),\n \"mt-2 sm:mt-0\",\n className\n )}\n {...props}\n />\n));\nAlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName;\n\nexport {\n AlertDialog,\n AlertDialogPortal,\n AlertDialogOverlay,\n AlertDialogTrigger,\n AlertDialogContent,\n AlertDialogHeader,\n AlertDialogFooter,\n AlertDialogTitle,\n AlertDialogDescription,\n AlertDialogAction,\n AlertDialogCancel,\n};\n","\"use client\";\n\nimport * as React from \"react\";\nimport * as ToastPrimitives from \"@radix-ui/react-toast\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { X } from \"lucide-react\";\n\nimport { cn } from \"../../../lib/utils\";\n\nconst ToastProvider = ToastPrimitives.Provider;\n\nconst ToastViewport = React.forwardRef<\n React.ElementRef<typeof ToastPrimitives.Viewport>,\n React.ComponentPropsWithoutRef<typeof ToastPrimitives.Viewport>\n>(({ className, ...props }, ref) => (\n <ToastPrimitives.Viewport\n ref={ref}\n className={cn(\n \"fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]\",\n className\n )}\n {...props}\n />\n));\nToastViewport.displayName = ToastPrimitives.Viewport.displayName;\n\nconst toastVariants = cva(\n \"group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full\",\n {\n variants: {\n variant: {\n default: \"border bg-background text-foreground\",\n destructive:\n \"destructive group border-destructive bg-destructive text-destructive-foreground\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n },\n }\n);\n\nconst Toast = React.forwardRef<\n React.ElementRef<typeof ToastPrimitives.Root>,\n React.ComponentPropsWithoutRef<typeof ToastPrimitives.Root> &\n VariantProps<typeof toastVariants>\n>(({ className, variant, ...props }, ref) => {\n return (\n <ToastPrimitives.Root\n ref={ref}\n className={cn(toastVariants({ variant }), className)}\n {...props}\n />\n );\n});\nToast.displayName = ToastPrimitives.Root.displayName;\n\nconst ToastAction = React.forwardRef<\n React.ElementRef<typeof ToastPrimitives.Action>,\n React.ComponentPropsWithoutRef<typeof ToastPrimitives.Action>\n>(({ className, ...props }, ref) => (\n <ToastPrimitives.Action\n ref={ref}\n className={cn(\n \"inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive\",\n className\n )}\n {...props}\n />\n));\nToastAction.displayName = ToastPrimitives.Action.displayName;\n\nconst ToastClose = React.forwardRef<\n React.ElementRef<typeof ToastPrimitives.Close>,\n React.ComponentPropsWithoutRef<typeof ToastPrimitives.Close>\n>(({ className, ...props }, ref) => (\n <ToastPrimitives.Close\n ref={ref}\n className={cn(\n \"absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600\",\n className\n )}\n toast-close=\"\"\n {...props}\n >\n <X className=\"h-4 w-4\" />\n </ToastPrimitives.Close>\n));\nToastClose.displayName = ToastPrimitives.Close.displayName;\n\nconst ToastTitle = React.forwardRef<\n React.ElementRef<typeof ToastPrimitives.Title>,\n React.ComponentPropsWithoutRef<typeof ToastPrimitives.Title>\n>(({ className, ...props }, ref) => (\n <ToastPrimitives.Title\n ref={ref}\n className={cn(\"text-sm font-semibold\", className)}\n {...props}\n />\n));\nToastTitle.displayName = ToastPrimitives.Title.displayName;\n\nconst ToastDescription = React.forwardRef<\n React.ElementRef<typeof ToastPrimitives.Description>,\n React.ComponentPropsWithoutRef<typeof ToastPrimitives.Description>\n>(({ className, ...props }, ref) => (\n <ToastPrimitives.Description\n ref={ref}\n className={cn(\"text-sm opacity-90\", className)}\n {...props}\n />\n));\nToastDescription.displayName = ToastPrimitives.Description.displayName;\n\ntype ToastProps = React.ComponentPropsWithoutRef<typeof Toast>;\n\ntype ToastActionElement = React.ReactElement<typeof ToastAction>;\n\nexport {\n type ToastProps,\n type ToastActionElement,\n ToastProvider,\n ToastViewport,\n Toast,\n ToastTitle,\n ToastDescription,\n ToastClose,\n ToastAction,\n};\n","// Loader.tsx\nimport * as React from \"react\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { cn } from \"../../../lib/utils\";\nimport { Loader2 } from \"lucide-react\";\n\nconst loaderVariants = cva(\n \"flex justify-center items-center w-full\",\n {\n variants: {\n size: {\n small: \"h-6 w-6\",\n medium: \"h-8 w-8\",\n large: \"h-12 w-12\",\n xl: \"h-24 w-24\",\n },\n colorVariant: {\n default: \"text-primary\",\n primary: \"text-primary\",\n secondary: \"text-secondary\",\n destructive: \"text-destructive\",\n },\n },\n defaultVariants: {\n size: \"medium\",\n colorVariant: \"default\",\n },\n }\n);\n\ninterface LoaderProps\n extends React.HTMLAttributes<HTMLDivElement>,\n VariantProps<typeof loaderVariants> {}\n\nconst Loader = React.forwardRef<HTMLDivElement, LoaderProps>(\n (\n { className, size, colorVariant, ...props },\n ref\n ) => (\n <div\n ref={ref}\n className={cn(loaderVariants({ size, colorVariant }), \"flex justify-center items-center h-full w-full\", className)}\n {...props}\n >\n <Loader2 className=\"animate-spin\" />\n </div>\n )\n);\n\nLoader.displayName = \"Loader\";\n\nexport { Loader };","\"use client\";\n\n// Inspired by react-hot-toast library\nimport * as React from \"react\";\n\nimport type {\n ToastActionElement,\n ToastProps,\n} from \"../../components/atoms/ui/toast\";\n\nconst TOAST_LIMIT = 1;\nconst TOAST_REMOVE_DELAY = 1000000;\n\ntype ToasterToast = ToastProps & {\n id: string;\n title?: React.ReactNode;\n description?: React.ReactNode;\n action?: ToastActionElement;\n};\n\nconst actionTypes = {\n ADD_TOAST: \"ADD_TOAST\",\n UPDATE_TOAST: \"UPDATE_TOAST\",\n DISMISS_TOAST: \"DISMISS_TOAST\",\n REMOVE_TOAST: \"REMOVE_TOAST\",\n} as const;\n\nlet count = 0;\n\nfunction genId() {\n count = (count + 1) % Number.MAX_SAFE_INTEGER;\n return count.toString();\n}\n\ntype ActionType = typeof actionTypes;\n\ntype Action =\n | {\n type: ActionType[\"ADD_TOAST\"];\n toast: ToasterToast;\n }\n | {\n type: ActionType[\"UPDATE_TOAST\"];\n toast: Partial<ToasterToast>;\n }\n | {\n type: ActionType[\"DISMISS_TOAST\"];\n toastId?: ToasterToast[\"id\"];\n }\n | {\n type: ActionType[\"REMOVE_TOAST\"];\n toastId?: ToasterToast[\"id\"];\n };\n\ninterface State {\n toasts: ToasterToast[];\n}\n\nconst toastTimeouts = new Map<string, ReturnType<typeof setTimeout>>();\n\nconst addToRemoveQueue = (toastId: string) => {\n if (toastTimeouts.has(toastId)) {\n return;\n }\n\n const timeout = setTimeout(() => {\n toastTimeouts.delete(toastId);\n dispatch({\n type: \"REMOVE_TOAST\",\n toastId: toastId,\n });\n }, TOAST_REMOVE_DELAY);\n\n toastTimeouts.set(toastId, timeout);\n};\n\nexport const reducer = (state: State, action: Action): State => {\n switch (action.type) {\n case \"ADD_TOAST\":\n return {\n ...state,\n toasts: [action.toast, ...state.toasts].slice(0, TOAST_LIMIT),\n };\n\n case \"UPDATE_TOAST\":\n return {\n ...state,\n toasts: state.toasts.map((t) =>\n t.id === action.toast.id ? { ...t, ...action.toast } : t\n ),\n };\n\n case \"DISMISS_TOAST\": {\n const { toastId } = action;\n\n // ! Side effects ! - This could be extracted into a dismissToast() action,\n // but I'll keep it here for simplicity\n if (toastId) {\n addToRemoveQueue(toastId);\n } else {\n state.toasts.forEach((toast) => {\n addToRemoveQueue(toast.id);\n });\n }\n\n return {\n ...state,\n toasts: state.toasts.map((t) =>\n t.id === toastId || toastId === undefined\n ? {\n ...t,\n open: false,\n }\n : t\n ),\n };\n }\n case \"REMOVE_TOAST\":\n if (action.toastId === undefined) {\n return {\n ...state,\n toasts: [],\n };\n }\n return {\n ...state,\n toasts: state.toasts.filter((t) => t.id !== action.toastId),\n };\n }\n};\n\nconst listeners: Array<(state: State) => void> = [];\n\nlet memoryState: State = { toasts: [] };\n\nfunction dispatch(action: Action) {\n memoryState = reducer(memoryState, action);\n listeners.forEach((listener) => {\n listener(memoryState);\n });\n}\n\ntype Toast = Omit<ToasterToast, \"id\">;\n\nfunction toast({ ...props }: Toast) {\n const id = genId();\n\n const update = (props: ToasterToast) =>\n dispatch({\n type: \"UPDATE_TOAST\",\n toast: { ...props, id },\n });\n const dismiss = () => dispatch({ type: \"DISMISS_TOAST\", toastId: id });\n\n dispatch({\n type: \"ADD_TOAST\",\n toast: {\n ...props,\n id,\n open: true,\n onOpenChange: (open) => {\n if (!open) dismiss();\n },\n },\n });\n\n return {\n id: id,\n dismiss,\n update,\n };\n}\n\nfunction useToast() {\n const [state, setState] = React.useState<State>(memoryState);\n\n React.useEffect(() => {\n listeners.push(setState);\n return () => {\n const index = listeners.indexOf(setState);\n if (index > -1) {\n listeners.splice(index, 1);\n }\n };\n }, [state]);\n\n return {\n ...state,\n toast,\n dismiss: (toastId?: string) => dispatch({ type: \"DISMISS_TOAST\", toastId }),\n };\n}\n\nexport { useToast, toast };\n","\"use client\";\n\nimport * as React from \"react\";\nimport { useToast } from \"../../hooks/use-toast\";\nimport {\n Toast,\n ToastClose,\n ToastDescription,\n ToastProvider,\n ToastTitle,\n ToastViewport,\n} from \"./toast\";\n\nfunction Toaster() {\n const { toasts } = useToast();\n\n return (\n <ToastProvider>\n {toasts.map(function ({ id, title, description, action, ...props }: any) {\n return (\n <Toast key={id} {...props}>\n <div className=\"grid gap-1\">\n {title && <ToastTitle>{title}</ToastTitle>}\n {description && (\n <ToastDescription>{description}</ToastDescription>\n )}\n </div>\n {action}\n <ToastClose />\n </Toast>\n );\n })}\n <ToastViewport />\n </ToastProvider>\n );\n}\n\nexport { Toaster };\n","\"use client\";\n\nimport * as React from \"react\";\nimport { useState, useEffect } from \"react\";\nimport { Loader } from \"..\";\nimport { cn } from \"../../../lib/utils\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\n\nconst thinkIndicatorVariants = cva(\n \"flex items-center gap-3\",\n {\n variants: {\n variant: {\n default: \"text-muted-foreground\",\n primary: \"text-primary\",\n secondary: \"text-secondary\",\n },\n size: {\n default: \"gap-3\",\n sm: \"gap-2\",\n lg: \"gap-4\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n }\n);\n\nexport interface ThinkIndicatorProps\n extends React.HTMLAttributes<HTMLDivElement>,\n VariantProps<typeof thinkIndicatorVariants> {\n thoughts?: string[];\n interval?: number;\n loader?: React.ReactNode;\n}\n\nexport const ThinkIndicator = React.forwardRef<HTMLDivElement, ThinkIndicatorProps>(\n ({ \n className, \n variant,\n size,\n thoughts = [\n \"Analyzing your request...\",\n \"Processing information...\",\n \"Formulating response...\",\n ],\n interval = 5000, \n loader,\n ...props \n }, ref) => {\n const [currentThoughtIndex, setCurrentThoughtIndex] = useState<number>(0);\n const [isAnimating, setIsAnimating] = useState<boolean>(false);\n\n useEffect(() => {\n const timer = setInterval(() => {\n setIsAnimating(true);\n setTimeout(() => {\n setCurrentThoughtIndex((prev) => {\n return prev < thoughts.length - 1 ? prev + 1 : prev;\n });\n setIsAnimating(false);\n }, 300);\n }, interval);\n\n if (currentThoughtIndex === thoughts.length - 1) {\n clearInterval(timer);\n }\n\n return () => clearInterval(timer);\n }, [thoughts, interval, currentThoughtIndex]);\n\n return (\n <div\n ref={ref}\n className={cn(thinkIndicatorVariants({ variant, size }), className, \"alq--think-indicator\")}\n {...props}\n >\n {loader || (\n <Loader \n className={cn(\n size === \"sm\" ? \"h-3 w-3\" : size === \"lg\" ? \"h-5 w-5\" : \"h-4 w-4\"\n )} \n />\n )}\n <div\n className={cn(\n \"alq--think-indicator-text\",\n \"transition-all duration-300\",\n isAnimating ? \"opacity-0 -translate-y-2\" : \"opacity-100 translate-y-0\"\n )}\n >\n {thoughts[currentThoughtIndex]}\n </div>\n </div>\n );\n }\n);\n\nThinkIndicator.displayName = \"ThinkIndicator\";\n\nexport { thinkIndicatorVariants };","import { forwardRef } from \"react\";\nimport { cn } from \"../../lib/utils\";\n\ninterface PageContainerProps extends React.HTMLAttributes<HTMLDivElement> {}\nconst PageContainer = forwardRef<HTMLDivElement, PageContainerProps>(\n ({ className, ...props }, ref) => {\n return (\n <div\n ref={ref}\n className={cn(className, \"alq--page-container\")}\n {...props}\n />\n );\n }\n);\nPageContainer.displayName = \"PageContainer\";\nexport { PageContainer };\n","\"use client\";\n\nimport * as React from \"react\";\nimport { useState, useEffect } from \"react\";\nimport { LucideIcon } from \"lucide-react\";\nimport { Button } from \"../atoms\";\nimport { cn } from \"../../lib/utils\";\n\ninterface Suggestion {\n label: string;\n icon: LucideIcon;\n action: () => void;\n}\n\ninterface AssistantSuggestionsProps {\n suggestions: Suggestion[];\n className?: string;\n showSuggestions: boolean;\n}\n\nconst AssistantSuggestions = React.forwardRef<\n HTMLDivElement,\n AssistantSuggestionsProps\n>(({ suggestions, showSuggestions, className }, ref) => {\n return (\n <div\n ref={ref}\n className={cn(\n \"absolute bottom-[calc(100%+0.5rem)] right-0 pb-2 mb-4 alq--assistant-suggestions-container\",\n \"transition-all duration-300\",\n showSuggestions\n ? \"opacity-100 translate-y-0\"\n : \"opacity-0 translate-y-4\",\n className\n )}\n >\n <div className=\"rounded-lg p-2 pr-0 w-64\">\n {suggestions.map((suggestion, index) => (\n <button\n key={index}\n onClick={() => suggestion.action?.()}\n style={{\n transitionDelay: showSuggestions ? `${index * 50}ms` : \"0ms\",\n }}\n className={cn(\n \"bg-background flex items-center gap-2 border p-2 pr-4 my-2 rounded-full ml-auto\",\n \"text-primary hover:bg-secondary\",\n \"transition-all duration-100\",\n \"origin-bottom w-fit\",\n \"alq--assistant-suggestion\",\n showSuggestions\n ? \"opacity-100 translate-y-0\"\n : \"opacity-0 translate-y-4\"\n )}\n >\n <suggestion.icon className=\"w-5 h-5 text-primary\" />\n <span className=\"text-xs whitespace-nowrap font-normal\">\n {suggestion.label}\n </span>\n </button>\n ))}\n </div>\n </div>\n );\n});\n\nAssistantSuggestions.displayName = \"Suggestions\";\n\ninterface AssistantButtonProps {\n icon: LucideIcon;\n clickAction: () => void;\n className?: string;\n suggestions?: Suggestion[];\n}\n\nexport const AssistantButton = React.forwardRef<\n HTMLDivElement,\n AssistantButtonProps\n>(\n (\n {\n icon: Icon,\n clickAction,\n className,\n suggestions = [],\n },\n ref\n ) => {\n const [isVisible, setIsVisible] = useState(false);\n const [showSuggestions, setShowSuggestions] = useState(false);\n\n const handleMouseEnter = () => {\n setIsVisible(true);\n requestAnimationFrame(() => {\n requestAnimationFrame(() => {\n setShowSuggestions(true);\n });\n });\n };\n\n const handleMouseLeave = () => {\n setShowSuggestions(false);\n setTimeout(() => setIsVisible(false), 300);\n };\n\n return (\n <div\n ref={ref}\n className={cn(\n \"fixed bottom-8 right-4 z-50\",\n \"alq--assistant-button-container\",\n className\n )}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n >\n <div className=\"relative group\">\n {isVisible && suggestions.length > 0 && (\n <AssistantSuggestions\n suggestions={suggestions}\n showSuggestions={showSuggestions}\n />\n )}\n <Button\n variant=\"outline\"\n size=\"sm\"\n className={cn(\n \"fixed hover:bg-opacity-70 transition-all duration-300\",\n \"bottom-4 h-12 w-12 right-4 z-50 rounded-full p-2\",\n \"shadow-md\",\n \"hover:shadow-lg\",\n showSuggestions ? \"scale-110\" : \"hover:scale-105\",\n \"alq--assistant-button\"\n )}\n onClick={clickAction}\n >\n <Icon\n style={{ width: \"22px\", height: \"22px\" }}\n className=\"text-primary\"\n />\n </Button>\n </div>\n </div>\n );\n }\n);\n\nAssistantButton.displayName = \"AssistantButton\";\n","\"use client\";\n\nimport * as React from \"react\";\nimport useEmblaCarousel, {\n type UseEmblaCarouselType,\n} from \"embla-carousel-react\";\nimport { ArrowLeft, ArrowRight } from \"lucide-react\";\n\nimport { cn } from \"../../lib/utils\";\nimport { Button } from \"../../components/atoms/ui/button\";\n\ntype CarouselApi = UseEmblaCarouselType[1];\ntype UseCarouselParameters = Parameters<typeof useEmblaCarousel>;\ntype CarouselOptions = UseCarouselParameters[0];\ntype CarouselPlugin = UseCarouselParameters[1];\n\ntype CarouselProps = {\n opts?: CarouselOptions;\n plugins?: CarouselPlugin;\n orientation?: \"horizontal\" | \"vertical\";\n setApi?: (api: CarouselApi) => void;\n};\n\ntype CarouselContextProps = {\n carouselRef: ReturnType<typeof useEmblaCarousel>[0];\n api: ReturnType<typeof useEmblaCarousel>[1];\n scrollPrev: () => void;\n scrollNext: () => void;\n canScrollPrev: boolean;\n canScrollNext: boolean;\n} & CarouselProps;\n\nconst CarouselContext = React.createContext<CarouselContextProps | null>(null);\n\nfunction useCarousel() {\n const context = React.useContext(CarouselContext);\n\n if (!context) {\n throw new Error(\"useCarousel must be used within a <Carousel />\");\n }\n\n return context;\n}\n\nconst Carousel = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement> & CarouselProps\n>(\n (\n {\n orientation = \"horizontal\",\n opts,\n setApi,\n plugins,\n className,\n children,\n ...props\n },\n ref\n ) => {\n const [carouselRef, api] = useEmblaCarousel(\n {\n ...opts,\n axis: orientation === \"horizontal\" ? \"x\" : \"y\",\n },\n plugins\n );\n const [canScrollPrev, setCanScrollPrev] = React.useState(false);\n const [canScrollNext, setCanScrollNext] = React.useState(false);\n\n const onSelect = React.useCallback((api: CarouselApi) => {\n if (!api) {\n return;\n }\n\n setCanScrollPrev(api.canScrollPrev());\n setCanScrollNext(api.canScrollNext());\n }, []);\n\n const scrollPrev = React.useCallback(() => {\n api?.scrollPrev();\n }, [api]);\n\n const scrollNext = React.useCallback(() => {\n api?.scrollNext();\n }, [api]);\n\n const handleKeyDown = React.useCallback(\n (event: React.KeyboardEvent<HTMLDivElement>) => {\n if (event.key === \"ArrowLeft\") {\n event.preventDefault();\n scrollPrev();\n } else if (event.key === \"ArrowRight\") {\n event.preventDefault();\n scrollNext();\n }\n },\n [scrollPrev, scrollNext]\n );\n\n React.useEffect(() => {\n if (!api || !setApi) {\n return;\n }\n\n setApi(api);\n }, [api, setApi]);\n\n React.useEffect(() => {\n if (!api) {\n return;\n }\n\n onSelect(api);\n api.on(\"reInit\", onSelect);\n api.on(\"select\", onSelect);\n\n return () => {\n api?.off(\"select\", onSelect);\n };\n }, [api, onSelect]);\n\n return (\n <CarouselContext.Provider\n value={{\n carouselRef,\n api: api,\n opts,\n orientation:\n orientation || (opts?.axis === \"y\" ? \"vertical\" : \"horizontal\"),\n scrollPrev,\n scrollNext,\n canScrollPrev,\n canScrollNext,\n }}\n >\n <div\n ref={ref}\n onKeyDownCapture={handleKeyDown}\n className={cn(\"relative\", className)}\n role=\"region\"\n aria-roledescription=\"carousel\"\n {...props}\n >\n {children}\n </div>\n </CarouselContext.Provider>\n );\n }\n);\nCarousel.displayName = \"Carousel\";\n\nconst CarouselContent = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => {\n const { carouselRef, orientation } = useCarousel();\n\n return (\n <div ref={carouselRef} className=\"overflow-hidden\">\n <div\n ref={ref}\n className={cn(\n \"flex\",\n orientation === \"horizontal\" ? \"-ml-4\" : \"-mt-4 flex-col\",\n className\n )}\n {...props}\n />\n </div>\n );\n});\nCarouselContent.displayName = \"CarouselContent\";\n\nconst CarouselItem = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => {\n const { orientation } = useCarousel();\n\n return (\n <div\n ref={ref}\n role=\"group\"\n aria-roledescription=\"slide\"\n className={cn(\n \"min-w-0 shrink-0 grow-0 basis-full\",\n orientation === \"horizontal\" ? \"pl-4\" : \"pt-4\",\n className\n )}\n {...props}\n />\n );\n});\nCarouselItem.displayName = \"CarouselItem\";\n\nconst CarouselPrevious = React.forwardRef<\n HTMLButtonElement,\n React.ComponentProps<typeof Button>\n>(({ className, variant = \"outline\", size = \"icon\", ...props }, ref) => {\n const { orientation, scrollPrev, canScrollPrev } = useCarousel();\n\n return (\n <Button\n ref={ref}\n variant={variant}\n size={size}\n className={cn(\n \"absolute h-8 w-8 rounded-full\",\n orientation === \"horizontal\"\n ? \"-left-12 top-1/2 -translate-y-1/2\"\n : \"-top-12 left-1/2 -translate-x-1/2 rotate-90\",\n className\n )}\n disabled={!canScrollPrev}\n onClick={scrollPrev}\n {...props}\n >\n <ArrowLeft className=\"h-4 w-4\" />\n <span className=\"sr-only\">Previous slide</span>\n </Button>\n );\n});\nCarouselPrevious.displayName = \"CarouselPrevious\";\n\nconst CarouselNext = React.forwardRef<\n HTMLButtonElement,\n React.ComponentProps<typeof Button>\n>(({ className, variant = \"outline\", size = \"icon\", ...props }, ref) => {\n const { orientation, scrollNext, canScrollNext } = useCarousel();\n\n return (\n <Button\n ref={ref}\n variant={variant}\n size={size}\n className={cn(\n \"absolute h-8 w-8 rounded-full\",\n orientation === \"horizontal\"\n ? \"-right-12 top-1/2 -translate-y-1/2\"\n : \"-bottom-12 left-1/2 -translate-x-1/2 rotate-90\",\n className\n )}\n disabled={!canScrollNext}\n onClick={scrollNext}\n {...props}\n >\n <ArrowRight className=\"h-4 w-4\" />\n <span className=\"sr-only\">Next slide</span>\n </Button>\n );\n});\nCarouselNext.displayName = \"CarouselNext\";\n\nexport {\n type CarouselApi,\n Carousel,\n CarouselContent,\n CarouselItem,\n CarouselPrevious,\n CarouselNext,\n};\n","import * as React from \"react\";\nimport * as NavigationMenuPrimitive from \"@radix-ui/react-navigation-menu\";\nimport { cva } from \"class-variance-authority\";\nimport { ChevronDown } from \"lucide-react\";\n\nimport { cn } from \"../../lib/utils\";\n\nconst NavigationMenu = React.forwardRef<\n React.ElementRef<typeof NavigationMenuPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Root>\n>(({ className, children, ...props }, ref) => (\n <NavigationMenuPrimitive.Root\n ref={ref}\n className={cn(\n \"relative z-10 flex max-w-max flex-1 items-center justify-center\",\n className\n )}\n {...props}\n >\n {children}\n <NavigationMenuViewport />\n </NavigationMenuPrimitive.Root>\n));\nNavigationMenu.displayName = NavigationMenuPrimitive.Root.displayName;\n\nconst NavigationMenuList = React.forwardRef<\n React.ElementRef<typeof NavigationMenuPrimitive.List>,\n React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.List>\n>(({ className, ...props }, ref) => (\n <NavigationMenuPrimitive.List\n ref={ref}\n className={cn(\n \"group flex flex-1 list-none items-center justify-center space-x-1\",\n className\n )}\n {...props}\n />\n));\nNavigationMenuList.displayName = NavigationMenuPrimitive.List.displayName;\n\nconst NavigationMenuItem = NavigationMenuPrimitive.Item;\n\nconst navigationMenuTriggerStyle = cva(\n \"group inline-flex h-10 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-none disabled:pointer-events-none disabled:opacity-50 data-[active]:bg-accent/50 data-[state=open]:bg-accent/50\"\n);\n\nconst NavigationMenuTrigger = React.forwardRef<\n React.ElementRef<typeof NavigationMenuPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Trigger>\n>(({ className, children, ...props }, ref) => (\n <NavigationMenuPrimitive.Trigger\n ref={ref}\n className={cn(navigationMenuTriggerStyle(), \"group\", className)}\n {...props}\n >\n {children}{\" \"}\n <ChevronDown\n className=\"relative top-[1px] ml-1 h-3 w-3 transition duration-200 group-data-[state=open]:rotate-180\"\n aria-hidden=\"true\"\n />\n </NavigationMenuPrimitive.Trigger>\n));\nNavigationMenuTrigger.displayName = NavigationMenuPrimitive.Trigger.displayName;\n\nconst NavigationMenuContent = React.forwardRef<\n React.ElementRef<typeof NavigationMenuPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Content>\n>(({ className, ...props }, ref) => (\n <NavigationMenuPrimitive.Content\n ref={ref}\n className={cn(\n \"left-0 top-0 w-full data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 md:absolute md:w-auto \",\n className\n )}\n {...props}\n />\n));\nNavigationMenuContent.displayName = NavigationMenuPrimitive.Content.displayName;\n\nconst NavigationMenuLink = NavigationMenuPrimitive.Link;\n\nconst NavigationMenuViewport = React.forwardRef<\n React.ElementRef<typeof NavigationMenuPrimitive.Viewport>,\n React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Viewport>\n>(({ className, ...props }, ref) => (\n <div className={cn(\"absolute left-0 top-full flex justify-center\")}>\n <NavigationMenuPrimitive.Viewport\n className={cn(\n \"origin-top-center relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 md:w-[var(--radix-navigation-menu-viewport-width)]\",\n className\n )}\n ref={ref}\n {...props}\n />\n </div>\n));\nNavigationMenuViewport.displayName =\n NavigationMenuPrimitive.Viewport.displayName;\n\nconst NavigationMenuIndicator = React.forwardRef<\n React.ElementRef<typeof NavigationMenuPrimitive.Indicator>,\n React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Indicator>\n>(({ className, ...props }, ref) => (\n <NavigationMenuPrimitive.Indicator\n ref={ref}\n className={cn(\n \"top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in\",\n className\n )}\n {...props}\n >\n <div className=\"relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md\" />\n </NavigationMenuPrimitive.Indicator>\n));\nNavigationMenuIndicator.displayName =\n NavigationMenuPrimitive.Indicator.displayName;\n\nexport {\n navigationMenuTriggerStyle,\n NavigationMenu,\n NavigationMenuList,\n NavigationMenuItem,\n NavigationMenuContent,\n NavigationMenuTrigger,\n NavigationMenuLink,\n NavigationMenuIndicator,\n NavigationMenuViewport,\n};\n","import * as React from \"react\";\nimport { LucideIcon } from \"lucide-react\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\n\nimport { cn } from \"../../lib/utils\";\nimport { ScrollArea, Button } from \"../atoms\";\n\nconst sidebarVariants = cva(\n \"flex flex-col border-r\",\n {\n variants: {\n size: {\n sm: \"w-48\",\n default: \"w-64\",\n lg: \"w-72\"\n },\n },\n defaultVariants: {\n size: \"default\",\n },\n }\n);\n\nexport interface SidebarItem {\n name: string;\n icon?: LucideIcon;\n disabled?: boolean;\n isLink?: boolean;\n link?: string;\n}\n\ntype SidebarBaseProps = {\n items: SidebarItem[];\n selectedSection?: SidebarItem;\n onSelect?: (item: SidebarItem) => void;\n footerContent?: React.ReactNode;\n selectedVariant?: \"default\" | \"secondary\" | \"ghost\" | \"link\";\n defaultVariant?: \"default\" | \"secondary\" | \"ghost\" | \"link\";\n buttonClassName?: string;\n}\n\nexport interface SidebarProps \n extends SidebarBaseProps,\n Omit<React.HTMLAttributes<HTMLDivElement>, keyof SidebarBaseProps>,\n VariantProps<typeof sidebarVariants> {}\n\nexport const SidebarFooter = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, children, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\"p-4\", className)}\n {...props}\n >\n {children}\n </div>\n));\nSidebarFooter.displayName = \"SidebarFooter\";\n\n\nexport const Sidebar = React.forwardRef<HTMLDivElement, SidebarProps>(\n ({ \n className, \n items, \n selectedSection, \n onSelect, \n footerContent,\n size = \"default\",\n selectedVariant = \"secondary\",\n defaultVariant = \"ghost\",\n buttonClassName,\n ...props \n }, ref) => {\n return (\n <div className={cn(className, \"alq--navigation-sidebar h-full\")} ref={ref} {...props}>\n <aside className={cn(sidebarVariants({ size }), \"h-full\")}>\n <ScrollArea className=\"flex-grow justify-between\">\n <div className=\"flex flex-col gap-2 p-4\">\n {items.map((item) => (\n <Button\n key={item.name}\n variant={selectedSection?.name === item.name ? selectedVariant : defaultVariant}\n className={cn(\"justify-start\", buttonClassName)}\n disabled={item.disabled}\n onClick={() => {\n if (onSelect) {\n onSelect(item);\n }\n }}\n >\n {item.icon && <item.icon className=\"mr-2 h-4 w-4\" />}\n {item.name}\n </Button>\n ))}\n </div>\n </ScrollArea>\n {footerContent && (\n <SidebarFooter>\n {footerContent}\n </SidebarFooter>\n )}\n </aside>\n </div>\n );\n }\n);","\"use client\";\nimport * as React from \"react\";\nimport { Toaster as Sonner } from \"sonner\";\nimport { useAlquimiaTheme } from '../../providers/theme-context';\n\ntype ToasterProps = React.ComponentProps<typeof Sonner>;\n\nconst Toaster = ({ ...props }: ToasterProps) => {\n const { theme = \"system\" } = useAlquimiaTheme();\n\n return (\n <Sonner\n theme={theme as ToasterProps[\"theme\"]}\n className=\"toaster group\"\n toastOptions={{\n classNames: {\n toast:\n \"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg\",\n description: \"group-[.toast]:text-muted-foreground\",\n actionButton:\n \"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground\",\n cancelButton:\n \"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground\",\n },\n }}\n {...props}\n />\n );\n};\nexport { Toaster as SonnerToaster };\n","\"use client\";\nimport { createContext, useContext } from 'react';\n\ninterface ThemeContextValue {\n theme: string;\n setTheme: (theme: string) => void;\n}\n\nexport const ThemeContext = createContext<ThemeContextValue>({\n theme: 'system',\n setTheme: () => {},\n});\n\nexport function useAlquimiaTheme() {\n return useContext(ThemeContext);\n}\n","\"use client\"\n\nimport * as React from \"react\"\nimport * as TooltipPrimitive from \"@radix-ui/react-tooltip\"\nimport { Star } from \"lucide-react\"\nimport { cn } from \"../../lib/utils\";\nimport { Button } from \"../atoms\";\n\nconst TooltipProvider = TooltipPrimitive.Provider\nconst Tooltip = TooltipPrimitive.Root\nconst TooltipTrigger = TooltipPrimitive.Trigger\n\nconst TooltipContent = React.forwardRef<\n React.ElementRef<typeof TooltipPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content>\n>(({ className, sideOffset = 4, ...props }, ref) => (\n <TooltipPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n className={cn(\n \"z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground shadow-lg animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 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\",\n className\n )}\n {...props}\n />\n))\nTooltipContent.displayName = TooltipPrimitive.Content.displayName\n\ninterface StarColors {\n fill: string\n stroke: string\n}\n\ninterface RatingStarsProps {\n currentRating: number\n isLoading: boolean\n onRate: (rating: number) => void\n className?: string\n}\n\nconst StarRating = React.forwardRef<\n HTMLDivElement,\n { rating: number; onRate: (r: number) => void }\n>(({ rating, onRate }, ref) => (\n <div ref={ref} className=\"flex\">\n {[1, 2, 3, 4, 5].map((star) => (\n <Button\n key={star}\n onClick={() => onRate(star)}\n variant=\"link\"\n className=\"p-1 transition-colors [&_svg]:size-5 h-5\"\n aria-label={`Rate ${star} star${star !== 1 ? \"s\" : \"\"}`}\n >\n <Star\n className={cn(\n \"w-5 h-5\",\n star <= rating ? \"alq-rating-star-active fill-current stroke-current\" : \"alq-rating-star-inactive\",\n )}\n />\n </Button>\n ))}\n </div>\n));\nStarRating.displayName = \"StarRating\"\n\nexport const RatingStars = React.forwardRef<\n HTMLButtonElement,\n RatingStarsProps\n>(({\n currentRating = 0,\n onRate,\n className,\n isLoading\n}, ref) => {\n const [open, setOpen] = React.useState(false)\n const [animate, setAnimate] = React.useState(false)\n\n const handleRate = (rating: number) => {\n onRate(rating)\n setOpen(false)\n }\n\n React.useEffect(() => {\n if (currentRating > 0) {\n setAnimate(true)\n const timer = setTimeout(() => setAnimate(false), 150)\n return () => clearTimeout(timer)\n }\n }, [currentRating])\n\n const hasRated = currentRating > 0\n\n return (\n <TooltipProvider>\n <Tooltip open={open} onOpenChange={setOpen}>\n <TooltipTrigger asChild>\n <Button\n ref={ref}\n variant=\"link\"\n className={cn(\n \"inline-flex items-center justify-center rounded-md text-sm font-medium [&_svg]:size-5 transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50\",\n className\n )}\n disabled={isLoading}\n onClick={() => setOpen(!open)}\n >\n <Star \n className={cn(\n \"w-5 h-5 transition-all duration-500\",\n animate && \"animate-ping\",\n isLoading && \"animate-pulse\",\n hasRated ? \"alq-rating-star-active fill-current stroke-current\" : \"alq-rating-star-inactive\",\n )}\n />\n </Button>\n </TooltipTrigger>\n <TooltipContent side=\"top\" align=\"center\" className=\"p-0\">\n <div className=\"p-2 bg-background\">\n <StarRating \n rating={currentRating} \n onRate={handleRate}\n />\n </div>\n </TooltipContent>\n </Tooltip>\n </TooltipProvider>\n )\n})\nRatingStars.displayName = \"RatingStars\"\n\nexport {\n Tooltip,\n TooltipTrigger,\n TooltipContent,\n TooltipProvider,\n}","\"use client\"\n\nimport * as React from \"react\"\nimport { ThumbsUp, ThumbsDown } from \"lucide-react\"\nimport { Button } from \"../atoms\";\nimport { cn } from \"../../lib/utils\";\n\ninterface RatingThumbsProps {\n currentRating: string\n isLoading: boolean\n onRate: (rating: \"thumbsUp\" | \"thumbsDown\" | \"\") => void\n direction?: \"row\" | \"column\"\n className?: string\n}\n\nexport const RatingThumbs = React.forwardRef<HTMLDivElement, RatingThumbsProps>(\n (\n {\n currentRating,\n onRate,\n direction = \"row\",\n className,\n isLoading\n },\n ref\n ) => {\n const [animate, setAnimate] = React.useState(false);\n\n React.useEffect(() => {\n if (currentRating) {\n setAnimate(true);\n const timer = setTimeout(() => setAnimate(false), 150);\n return () => clearTimeout(timer);\n }\n }, [currentRating]);\n\n return (\n <div\n ref={ref}\n className={cn(\n \"inline-flex\",\n direction === \"column\" ? \"flex-col\" : \"flex-row\",\n \"space-x-1 gap-4\",\n className\n )}\n >\n <Button\n variant=\"link\"\n onClick={() => onRate(currentRating === \"thumbsUp\" ? \"\" : \"thumbsUp\")}\n className={cn(\n \"p-1 transition-colors disabled:opacity-50 [&_svg]:size-5\",\n `hover:alq-rating-thumbsup/10`\n )}\n aria-label=\"Thumbs up\"\n disabled={isLoading}\n >\n <ThumbsUp\n className={cn(\n \"w-5 h-5 transition-all duration-500\",\n animate && currentRating === \"thumbsUp\" && \"animate-ping\",\n isLoading && \"animate-pulse\",\n currentRating === \"thumbsUp\" ? \"alq-rating-thumbsup fill-current stroke-current\" : \"alq-rating-thumbs-inactive fill-transparent\"\n )}\n />\n </Button>\n <Button\n variant=\"link\"\n onClick={() => onRate(currentRating === \"thumbsDown\" ? \"\" : \"thumbsDown\")}\n className={cn(\n \"p-1 transition-colors disabled:opacity-50 mt-0.5 [&_svg]:size-5\",\n `hover:bg-alq-rating-thumbsdown/10`\n )}\n aria-label=\"Thumbs down\"\n disabled={isLoading}\n >\n <ThumbsDown\n className={cn(\n \"w-5 h-5 transition-all duration-500\",\n animate && currentRating === \"thumbsDown\" && \"animate-ping\",\n isLoading && \"animate-pulse\",\n currentRating === \"thumbsDown\" ? \"alq-rating-thumbsdown fill-current stroke-current\" : \"alq-rating-thumbs-inactive fill-transparent\"\n )}\n />\n </Button>\n </div>\n );\n }\n);\n\nRatingThumbs.displayName = \"RatingThumbs\"","\"use client\"\n\nimport * as React from \"react\"\nimport { Book } from \"lucide-react\"\nimport { cn } from \"../../lib/utils\"\nimport { Button } from \"../atoms\"\nimport {\n Dialog,\n DialogTrigger,\n DialogContent,\n DialogOverlay,\n DialogTitle,\n} from \"../atoms/ui/dialog\";\n\ninterface RatingCommentProps {\n currentRating: string\n onRate: (comment: string) => void\n className?: string\n isLoading?: boolean\n}\n\nexport const RatingComment = React.forwardRef<HTMLButtonElement, RatingCommentProps>(\n ({ currentRating, onRate, className, isLoading }, ref) => {\n const [open, setOpen] = React.useState(false)\n const [comment, setComment] = React.useState(\"\")\n const [animate, setAnimate] = React.useState(false);\n\n const handleRate = () => {\n onRate(comment)\n setOpen(false)\n }\n\n React.useEffect(() => {\n if (currentRating) {\n setAnimate(true);\n const timer = setTimeout(() => setAnimate(false), 150);\n return () => clearTimeout(timer);\n }\n }, [currentRating]);\n\n React.useEffect(() => {\n setComment(\"\")\n }, [open])\n\n return (\n <Dialog open={open} onOpenChange={setOpen}>\n <DialogTrigger asChild>\n <Button\n ref={ref}\n variant=\"link\"\n size={\"lg\"}\n className={cn(\n \"inline-flex p-2 items-center justify-center rounded-md text-sm font-medium transition-colors [&_svg]:size-5 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring bg-transparent hover:none disabled:pointer-events-none disabled:opacity-50\",\n className\n )}\n disabled={isLoading}\n >\n <Book\n className={cn(\n \"w-5 h-5 transition-all duration-500\",\n animate && \"animate-ping\",\n isLoading && \"animate-pulse\",\n `${comment ? \"alq-rating-comment\" : \"stroke-gray-400\"}`\n )}\n />\n </Button>\n </DialogTrigger>\n <DialogOverlay className=\"fixed inset-0 bg-black bg-opacity-50\" />\n <DialogContent aria-describedby={undefined}>\n <DialogTitle className=\"text-lg font-medium\">\n Deja un comentario\n </DialogTitle>\n <textarea\n className=\"mt-4 w-full p-2 border rounded-md focus:outline-none focus:ring-2 focus:ring-primary\"\n rows={4}\n value={comment}\n onChange={(e) => setComment(e.target.value)}\n />\n <div className=\"mt-4 flex justify-end\">\n <Button\n onClick={handleRate}\n disabled={!comment}\n >\n Enviar\n </Button>\n </div>\n </DialogContent>\n </Dialog>\n );\n }\n)\n\nRatingComment.displayName = \"RatingComment\"\n","import * as React from \"react\";\nimport { ChevronDown, ChevronUp } from \"lucide-react\";\n\nimport { cn } from \"../../lib/utils\";\nimport { Button, RichText } from \"../atoms\";\nimport { Message } from \"ai\";\nimport { useTextStreaming } from \"../hooks/use-text-streaming\";\n\nexport interface CallOutMessage {\n id: string;\n role: \"user\" | \"assistant\";\n content: string;\n timestamp: Date;\n}\n\ninterface CallOutActionProps {\n label: string;\n icon: React.ReactNode;\n onClick: (message?: Message) => Promise<void>;\n custom?: boolean;\n component?: (props: { message?: Message }) => React.ReactNode;\n}\n\nexport interface CallOutProps extends React.HTMLAttributes<HTMLDivElement> {\n message?: Message;\n}\n\nconst CallOut = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement> & CallOutProps\n>(({ className, children, role, ...props }, ref) => {\n return (\n <div\n ref={ref}\n className={cn(\"alq--callout-box\", className)}\n data-role={role}\n {...props}\n >\n {children}\n </div>\n );\n});\n\nconst CallOutDate = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, children, ...props }, ref) => {\n return (\n <div\n ref={ref}\n className={cn(\n \"alq--callout-date\",\n \"text-sm text-muted-foreground\",\n className\n )}\n {...props}\n >\n {children}\n </div>\n );\n});\n\nconst CallOutActions = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement> & {\n actions: CallOutActionProps[];\n role: \"user\" | \"assistant\";\n message?: Message;\n }\n>(({ className, actions, role, message, ...props }, ref) => {\n const [isLoading, setIsLoading] = React.useState(false);\n const [isClicked, setIsClicked] = React.useState(false);\n\n if (role === \"user\") {\n return null;\n }\n\n return (\n <div ref={ref} className={cn(\"alq--callout-actions\", className)} {...props}>\n {actions.map((action) => (\n action.custom ? (\n <React.Fragment key={action.label}>\n {action.component?.({ message })}\n </React.Fragment>\n ) : (\n <button\n key={action.label}\n className={cn(\n \"alq--callout-action\",\n {\n \"alq--callout-animate-action\": isLoading,\n },\n {\n \"alq--callout-clicked-action\": isClicked,\n }\n )}\n type=\"button\"\n title={action.label}\n onClick={() => {\n setIsLoading(true);\n action.onClick(message).then(() => {\n setIsLoading(false);\n setIsClicked(true);\n });\n }}\n >\n <span\n className={cn(\"alq-action-icon-wrapper\", {\n \"alq--callout-animate-action\": isLoading,\n })}\n >\n {action.icon}\n </span>\n <label>{action.label}</label>\n </button>\n )\n ))}\n </div>\n );\n});\n\nconst CallOutResponse = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement> & {\n role: Message[\"role\"];\n additionalInfo?: string;\n toggleAdditionalInfo?: boolean;\n isStreaming?: boolean;\n handleIsTextStreaming?: (isStreaming: boolean) => void;\n }\n>(\n (\n {\n className,\n children,\n role,\n additionalInfo,\n toggleAdditionalInfo,\n isStreaming,\n handleIsTextStreaming,\n ...props\n },\n ref\n ) => {\n const [isAdditionalInfoOpen, setIsAdditionalInfoOpen] =\n React.useState(false);\n const content = String(children || \"\");\n const shouldStream = role === \"assistant\" && isStreaming;\n const displayedContent = useTextStreaming(\n content,\n shouldStream ?? false,\n handleIsTextStreaming\n );\n\n const showAsToggle = additionalInfo && toggleAdditionalInfo;\n const showInline = additionalInfo && !toggleAdditionalInfo;\n\n return (\n <div\n ref={ref}\n data-role={role}\n className={cn(\n \"alq--callout-response\",\n \"max-w-none\",\n \"text-foreground\",\n className\n )}\n {...props}\n >\n <RichText content={displayedContent} />\n {showInline && (\n <div\n className={cn(\n \"alq--callout-response-additional-info\",\n \"mt-2 text-sm text-muted-foreground whitespace-pre-line\",\n \"border-t border-border pt-2\"\n )}\n >\n {additionalInfo}\n </div>\n )}\n {showAsToggle && (\n <div\n className={cn(\n \"alq--callout-response-additional-info\",\n \"mt-2 border-t border-border pt-2\"\n )}\n >\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n className=\"h-auto py-1.5 px-0 text-xs text-muted-foreground hover:bg-transparent hover:text-muted-foreground -ml-1\"\n onClick={() => setIsAdditionalInfoOpen((prev) => !prev)}\n aria-expanded={isAdditionalInfoOpen}\n >\n {isAdditionalInfoOpen ? (\n <ChevronUp className=\"h-4 w-4 mr-1.5 shrink-0 transition-transform\" />\n ) : (\n <ChevronDown className=\"h-4 w-4 mr-1.5 shrink-0 transition-transform\" />\n )}\n {isAdditionalInfoOpen ? \"Hide details\" : \"Show details\"}\n </Button>\n <div\n className={cn(\n \"grid transition-[grid-template-rows] duration-200 ease-out\",\n isAdditionalInfoOpen ? \"grid-rows-[1fr]\" : \"grid-rows-[0fr]\"\n )}\n >\n <div className=\"overflow-hidden\">\n <div className=\"text-sm text-muted-foreground pt-1 whitespace-pre-line\">\n {additionalInfo}\n </div>\n </div>\n </div>\n </div>\n )}\n </div>\n );\n }\n);\n\nCallOut.displayName = \"CallOut\";\nCallOutDate.displayName = \"CallOutDate\";\nCallOutActions.displayName = \"CallOutActions\";\nCallOutResponse.displayName = \"CallOutResponse\";\nexport { CallOut, CallOutDate, CallOutResponse, CallOutActions };\n","import { useState, useEffect, useRef, useCallback } from \"react\";\n\nconst CHAR_DELAY = 15;\nconst PUNCTUATION_DELAY = 300;\n\nexport function useTextStreaming(\n content: string,\n shouldStream: boolean,\n handleIsTextStreaming?: (isStreaming: boolean) => void\n) {\n const [displayedText, setDisplayedText] = useState(\"\");\n const contentRef = useRef(content);\n const indexRef = useRef(0);\n const timerRef = useRef<NodeJS.Timeout | null>(null);\n\n const hasStartedStreaming = useRef<boolean>(false);\n\n useEffect(() => {\n contentRef.current = content;\n if (hasStartedStreaming.current && !timerRef.current && indexRef.current < contentRef.current.length) {\n typeNext();\n }\n }, [content]);\n\n const typeNext = useCallback(() => {\n if (indexRef.current < contentRef.current.length) {\n const nextChar = contentRef.current.charAt(indexRef.current);\n setDisplayedText((prev) => prev + nextChar);\n indexRef.current++;\n\n const delay = /[.!?;:]/.test(nextChar) ? PUNCTUATION_DELAY : CHAR_DELAY;\n \n timerRef.current = setTimeout(() => {\n timerRef.current = null;\n typeNext();\n }, delay);\n } else {\n handleIsTextStreaming?.(false);\n }\n }, []);\n\n useEffect(() => {\n if (!shouldStream && !hasStartedStreaming.current) {\n setDisplayedText(contentRef.current);\n indexRef.current = contentRef.current.length;\n if (timerRef.current) {\n clearTimeout(timerRef.current);\n timerRef.current = null;\n }\n handleIsTextStreaming?.(false);\n } else {\n if (indexRef.current < contentRef.current.length && !timerRef.current) {\n handleIsTextStreaming?.(true);\n hasStartedStreaming.current = true;\n typeNext();\n }\n }\n\n return () => {\n if (timerRef.current) {\n clearTimeout(timerRef.current);\n timerRef.current = null;\n }\n };\n }, [shouldStream, typeNext]);\n\n return displayedText;\n}\n\n"]}
1
+ {"version":3,"sources":["/home/runner/work/sdk-frontend/sdk-frontend/packages/ui/dist/components/genui/index.mjs","../../../src/components/genui/renderer.tsx","../../../src/components/genui/components/layout.tsx","../../../src/lib/utils.ts","../../../src/components/genui/style-props.ts","../../../src/components/atoms/ui/card.tsx","../../../src/components/atoms/ui/separator.tsx","../../../src/components/atoms/ui/tabs.tsx","../../../src/components/atoms/ui/accordion.tsx","../../../src/components/genui/components/content.tsx","../../../src/components/atoms/ui/alert.tsx","../../../src/components/atoms/ui/badge.tsx","../../../src/components/atoms/ui/avatar.tsx","../../../src/components/atoms/ui/rich-text.tsx","../../../src/components/genui/components/inputs.tsx","../../../src/components/atoms/ui/input.tsx","../../../src/components/atoms/ui/textarea.tsx","../../../src/components/atoms/ui/label.tsx","../../../src/components/atoms/ui/checkbox.tsx","../../../src/components/atoms/ui/switch.tsx","../../../src/components/atoms/ui/slider.tsx","../../../src/components/atoms/ui/button.tsx","../../../src/components/atoms/ui/calendar.tsx","../../../src/components/atoms/ui/radio-group.tsx","../../../src/components/atoms/ui/popover.tsx","../../../src/components/atoms/ui/select.tsx","../../../src/components/atoms/ui/command.tsx","../../../src/components/atoms/ui/dialog.tsx","../../../src/components/genui/components/data.tsx","../../../src/components/atoms/ui/table.tsx","../../../src/components/atoms/ui/progress.tsx","../../../src/components/atoms/ui/chart.tsx","../../../src/components/genui/components/actions.tsx","../../../src/components/genui/registry.tsx","../../../src/components/genui/assistant-chat.tsx","../../../src/components/organisms/assistant.tsx","../../../src/components/atoms/ui/scroll-area.tsx","../../../src/components/atoms/ui/skeleton.tsx","../../../src/components/atoms/ui/drawer.tsx","../../../src/components/atoms/ui/typography/index.tsx","../../../src/components/atoms/ui/toggle.tsx","../../../src/components/atoms/ui/aspect-ratio.tsx","../../../src/components/atoms/ui/breadcrumb.tsx","../../../src/components/molecules/alert-dialog.tsx","../../../src/components/atoms/ui/toast.tsx","../../../src/components/atoms/ui/loader.tsx","../../../src/components/hooks/use-toast.ts","../../../src/components/atoms/ui/toaster.tsx","../../../src/components/atoms/ui/think-indicator.tsx","../../../src/components/molecules/page-container.tsx","../../../src/components/molecules/assistant-button.tsx","../../../src/components/molecules/carousel.tsx","../../../src/components/molecules/navigation-menu.tsx","../../../src/components/molecules/sidebar.tsx","../../../src/components/molecules/sonner.tsx","../../../src/providers/theme-context.ts","../../../src/components/molecules/rating-stars.tsx","../../../src/components/molecules/rating-thumbs.tsx","../../../src/components/molecules/rating-comment.tsx","../../../src/components/molecules/call-out.tsx","../../../src/components/hooks/use-text-streaming.ts","../../../src/components/organisms/tool-approval.tsx"],"names":["React","getPointer","setPointer","classifyAction","resolveDynamic","isPathRef","Fragment","jsx","jsxs","A2uiRenderer","surface","registry","onAgentAction","onLocalAction","useState","dataModel","model","setModel","useEffect","surfaceId","byId","useMemo","m","Map","components","c","set","id","emitAction","node","action","kind","ui","componentId","name","payload","renderNode","seen","has","get","nextSeen","Set","add","childIds","children","child","map","cid","Comp","component","className","boundPath","binding","value","path","onChange","v","onAction","a","length","rootId","root","clsx","twMerge","cn","inputs","hasToolResult","data","tool_output","result","Object","keys","getErrorMessage","error_code","TONE","default","muted","primary","success","warning","danger","SIZE","sm","md","lg","ALIGN","start","center","end","DENSITY","compact","comfortable","styleProps","tone","size","align","density","emphasis","Card","React2","forwardRef","ref","props","displayName","CardHeader","CardTitle","CardDescription","CardContent","CardFooter","SeparatorPrimitive","Separator","React3","orientation","decorative","Root","TabsPrimitive","Tabs","TabsList","React4","List","TabsTrigger","Trigger","TabsContent","Content","AccordionPrimitive","ChevronDown","Accordion","AccordionItem","React5","Item","AccordionTrigger","Header","AccordionContent","gapClass","g","Stack","direction","gap","Row","wrap","Column","Grid","cols","columns","Math","min","max","colClass","Divider","label","Spacer","h","CardNode","variant","title","description","TabsNode","tabs","Array","isArray","kids","React6","Children","toArray","defaultValue","t","i","AccordionNode","items","type","collapsible","it","icons","cva","alertVariants","variants","destructive","defaultVariants","Alert","React7","role","AlertTitle","AlertDescription","badgeVariants","secondary","outline","Badge","AvatarPrimitive","Avatar","React8","AvatarImage","Image","AvatarFallback","Fallback","ReactMarkdown","remarkGfm","RichText","content","remarkPlugins","SAFE_IMG","Text","String","text","Heading","level","Tag","Markdown","ImageNode","src","test","alt","IconNode","Cmp","BADGE_VARIANT","solid","subtle","BadgeNode","AvatarNode","fallback","slice","toUpperCase","ALERT_VARIANT","info","AlertNode","Stat","delta","KeyValueNode","obj","entries","k","React9","ListNode","ordered","Quote","cite","format","Star","Input","Textarea","React10","LabelPrimitive","labelVariants","Label","React11","CheckboxPrimitive","Check","Checkbox","React12","Indicator","SwitchPrimitives","Switch","React13","Thumb","SliderPrimitive","Slider","React14","Track","Range","Slot","buttonVariants","ghost","link","icon","Button","React15","asChild","ChevronLeft","ChevronRight","DayPicker","Calendar","classNames","showOutsideDays","months","month","caption","caption_label","nav","nav_button","nav_button_previous","nav_button_next","table","head_row","head_cell","row","cell","day","day_range_end","day_selected","day_today","day_outside","day_disabled","day_range_middle","day_hidden","IconLeft","IconRight","RadioGroupPrimitive","Circle","RadioGroup","React16","RadioGroupItem","PopoverPrimitive","Popover","PopoverTrigger","PopoverContent","React17","sideOffset","Portal","SelectPrimitive","ChevronUp","Select","SelectValue","Value","SelectTrigger","React18","Icon","SelectScrollUpButton","ScrollUpButton","SelectScrollDownButton","ScrollDownButton","SelectContent","position","Viewport","SelectLabel","SelectItem","ItemIndicator","ItemText","SelectSeparator","Command","CommandPrimitive","Search","DialogPrimitive","X","Dialog","DialogTrigger","DialogPortal","DialogOverlay","React19","Overlay","DialogContent","Close","DialogHeader","DialogFooter","DialogTitle","Title","DialogDescription","Description","React20","CommandInput","CommandList","CommandEmpty","Empty","CommandGroup","Group","CommandSeparator","CommandItem","CommandShortcut","opts","options","o","toDate","d","Date","isNaN","getTime","Field","htmlFor","TextField","placeholder","e","target","TextArea","rows","NumberField","step","Number","SelectNode","onValueChange","MultiSelect","selected","toggle","includes","filter","x","checked","onCheckedChange","Combobox","React21","open","setOpen","find","onOpenChange","onSelect","CheckboxNode","CheckboxGroup","Radio","match","SwitchNode","SliderNode","vals","DatePicker","mode","toISOString","DateRange","parsed","from","to","r","FileUpload","accept","multiple","files","f","Rating","current","_","n","onClick","useReactTable","getCoreRowModel","getSortedRowModel","flexRender","BarChart","Bar","LineChart","Line","AreaChart","Area","PieChart","Pie","Cell","Tooltip","Legend","Table","React22","TableHeader","TableBody","TableFooter","TableRow","TableHead","TableCell","TableCaption","ProgressPrimitive","Progress","React23","style","transform","ResponsiveContainer","CartesianGrid","XAxis","YAxis","CHART_PALETTE","Chart","height","width","themedChartAxes","strokeDasharray","dataKey","PALETTE","TableNode","key","header","some","sortable","React24","sorting","setSorting","accessorKey","accessorFn","state","onSortingChange","enableSorting","getHeaderGroups","hg","headers","column","toggleSorting","wantResponse","columnDef","getContext","getRowModel","getVisibleCells","getValue","ChartNode","series","s","first","axes","stroke","fill","fillOpacity","nameKey","pct","round","Timeline","timestamp","BUTTON_VARIANT","BUTTON_SIZE","ButtonNode","ButtonGroup","SAFE_HREF","LinkNode","href","rel","coreUiRegistry","KeyValue","Link","useCallback","useRef","ScrollAreaPrimitive","ScrollArea","React25","ScrollBar","Corner","ScrollAreaScrollbar","ScrollAreaThumb","Drawer","DrawerPrimitive","shouldScaleBackground","DrawerTrigger","DrawerPortal","DrawerClose","DrawerOverlay","React26","DrawerContent","DrawerHeader","DrawerFooter","DrawerTitle","DrawerDescription","Typography","Component","as","typeStyle","TogglePrimitive","toggleVariants","Toggle","React27","AspectRatioPrimitive","MoreHorizontal","Breadcrumb","React28","BreadcrumbList","BreadcrumbItem","BreadcrumbLink","BreadcrumbPage","BreadcrumbSeparator","BreadcrumbEllipsis","AlertDialogPrimitive","AlertDialogPortal","AlertDialogOverlay","React29","AlertDialogContent","AlertDialogHeader","AlertDialogFooter","AlertDialogTitle","AlertDialogDescription","AlertDialogAction","Action","AlertDialogCancel","Cancel","ToastPrimitives","ToastViewport","React30","toastVariants","Toast","ToastAction","ToastClose","ToastTitle","ToastDescription","Loader2","loaderVariants","small","medium","large","xl","colorVariant","Loader","React31","thinkIndicatorVariants","ThinkIndicator","React33","thoughts","interval","loader","currentThoughtIndex","setCurrentThoughtIndex","isAnimating","setIsAnimating","timer","setInterval","setTimeout","prev","clearInterval","PageContainer","AssistantSuggestions","React34","suggestions","showSuggestions","suggestion","index","transitionDelay","AssistantButton","clickAction","isVisible","setIsVisible","setShowSuggestions","handleMouseEnter","requestAnimationFrame","handleMouseLeave","onMouseEnter","onMouseLeave","useEmblaCarousel","ArrowLeft","ArrowRight","CarouselContext","React35","createContext","useCarousel","context","useContext","Error","Carousel","setApi","plugins","axis","carouselRef","api","canScrollPrev","setCanScrollPrev","canScrollNext","setCanScrollNext","scrollPrev","scrollNext","handleKeyDown","event","preventDefault","on","off","Provider","onKeyDownCapture","CarouselContent","CarouselItem","CarouselPrevious","disabled","CarouselNext","NavigationMenuPrimitive","NavigationMenu","React36","NavigationMenuViewport","NavigationMenuList","navigationMenuTriggerStyle","NavigationMenuTrigger","NavigationMenuContent","NavigationMenuIndicator","sidebarVariants","SidebarFooter","React37","Sidebar","selectedSection","footerContent","selectedVariant","defaultVariant","buttonClassName","item","Toaster","Sonner","ThemeContext","theme","setTheme","TooltipPrimitive","TooltipProvider","TooltipTrigger","TooltipContent","React38","StarRating","rating","onRate","star","RatingStars","currentRating","isLoading","animate","setAnimate","handleRate","clearTimeout","hasRated","side","ThumbsUp","ThumbsDown","RatingThumbs","React39","Book","RatingComment","React40","comment","setComment","CHAR_DELAY","PUNCTUATION_DELAY","useTextStreaming","shouldStream","handleIsTextStreaming","displayedText","setDisplayedText","contentRef","indexRef","timerRef","hasStartedStreaming","typeNext","nextChar","charAt","delay","CallOut","React41","CallOutDate","CallOutActions","actions","message","setIsLoading","isClicked","setIsClicked","custom","then","CallOutResponse","additionalInfo","toggleAdditionalInfo","isStreaming","isAdditionalInfoOpen","setIsAdditionalInfoOpen","displayedContent","showAsToggle","showInline","Send","Assistant","React42","sdk","AssistantHeader","AssistantTitle","AssistantDescription","AssistantMessageArea","messages","messagesEndRef","streamingMessageId","thinkIndicator","toolFactory","showDetailedErrors","interleave","awaitingUser","isMessageStreaming","_isMessageStreaming","scrollIntoView","behavior","error_detail","taskid","tooler","tool","createTool","tool_summary","control_id","created_at","toLocaleString","hour","minute","hour12","AssistantInput","sendMessageFunc","isButtonDisabled","input","handleInputChange","speechToTextComponent","userToolboxComponent","placeholders","onFileDrop","attachmentsSlot","isDragging","setIsDragging","dragCounterRef","handleDragEnter","stopPropagation","dataTransfer","types","handleDragOver","handleDragLeave","handleDrop","onSubmit","onDragEnter","onDragOver","onDragLeave","onDrop","onKeyDown","shiftKey","ShieldAlert","formatArguments","args","JSON","stringify","blockedMessage","approval","channelName","outcome","lastResult","channelOwned","ToolApprovalCard","onDecide","React43","rejecting","setRejecting","reason","setReason","arguments","toolLabel","toolName","submitting","status","settled","blocked","canAnswer","failed","decide","approved","said","trim","controlId","decidedHere","detail","TypingDots","animationDelay","animationDuration","AssistantChat","alquimia","conversationId","approvalChannelName","endRef","React44","handleSubmit","handleLoadingCancel","genui","toolApprovals","approveTool","surfaces","approvals","awaitingApproval","isBusy","hasContent","isEmpty","renderSurface","submitted","dismissedWith","byCount","arr","af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;YAEhD,aAAA,GAAAhzB,MAACmvB,gBAAA;gBACCxsB,WAAU;gBACVysB,iBAAiBmB;gBASjBlB,kBAAkB4E,UAAU,CAAC/F;gBAC7BoB,OAAAA;gBACAC,mBAAAA;gBACApB,oBAAoB,CAAC,CAACA;gBACtBuB,cAAc;oBAAClZ;oBAAaA;iBAAW;YAAA;SACzC;IAAA;AAGN;AlC28GA,SACEtW,YAAY,EACZizB,aAAa,EACbnU,cAAc,GACd","sourcesContent":["// src/components/genui/renderer.tsx\nimport * as React from \"react\";\nimport { getPointer, setPointer, classifyAction, resolveDynamic, isPathRef } from \"@alquimia-ai/tools/genui\";\nimport { Fragment as Fragment2, jsx, jsxs } from \"react/jsx-runtime\";\nfunction A2uiRenderer({ surface, registry, onAgentAction, onLocalAction }) {\n const [model, setModel] = React.useState(surface.dataModel ?? {});\n React.useEffect(() => {\n setModel(surface.dataModel ?? {});\n }, [surface.surfaceId]);\n const byId = React.useMemo(() => {\n const m = /* @__PURE__ */ new Map();\n for (const c of surface.components) m.set(c.id, c);\n return m;\n }, [surface]);\n const emitAction = (node, action) => {\n const kind = classifyAction(action);\n const ui = {\n surfaceId: surface.surfaceId,\n componentId: node.id,\n action: action.name,\n kind,\n payload: kind === \"agent-bound\" ? model : void 0\n };\n if (kind === \"agent-bound\") onAgentAction(ui);\n else onLocalAction?.(ui);\n };\n const renderNode = (id, seen) => {\n if (seen.has(id)) return null;\n const node = byId.get(id);\n if (!node) return null;\n const nextSeen = new Set(seen).add(id);\n const childIds = node.children ?? (node.child ? [node.child] : []);\n const children = childIds.map((cid) => /* @__PURE__ */ jsx(React.Fragment, { children: renderNode(cid, nextSeen) }, cid));\n const Comp = registry[node.component];\n if (!Comp) {\n return /* @__PURE__ */ jsxs(\"p\", { className: \"text-muted-foreground text-sm\", \"data-a2ui-fallback\": node.component, children: [\n \"[unsupported component: \",\n node.component,\n \"]\"\n ] });\n }\n const boundPath = node.binding ?? (isPathRef(node.value) ? node.value.path : void 0);\n const value = boundPath !== void 0 ? getPointer(model, boundPath) : node.value !== void 0 ? resolveDynamic(node.value, model) : void 0;\n const onChange = boundPath !== void 0 ? (v) => setModel((m) => setPointer(m, boundPath, v)) : void 0;\n const onAction = node.action ? (a) => emitAction(node, a) : void 0;\n return /* @__PURE__ */ jsx(Comp, { node, value, onChange, onAction, children: children.length ? children : void 0 });\n };\n const rootId = byId.has(\"root\") ? \"root\" : surface.root;\n if (!rootId) return null;\n return /* @__PURE__ */ jsx(Fragment2, { children: renderNode(rootId, /* @__PURE__ */ new Set()) });\n}\n\n// src/components/genui/components/layout.tsx\nimport * as React6 from \"react\";\n\n// src/lib/utils.ts\nimport { clsx } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\nfunction cn(...inputs) {\n return twMerge(clsx(inputs));\n}\nfunction hasToolResult(data) {\n return data?.tool_output?.result && Object.keys(data.tool_output.result).length > 0;\n}\nfunction getErrorMessage(error_code) {\n switch (error_code) {\n case \"STREAM_ERROR\":\n return \"Connection lost. Please try again.\";\n case \"REQUEST_ERROR\":\n return \"There was a problem with your request. Please try again.\";\n case \"401\":\n case \"403\":\n return \"You are not authorized. Please try again.\";\n case \"404\":\n return \"Resource not found.\";\n case \"500\":\n return \"Server error. Please try again later.\";\n default:\n return \"We have an internal error, please try again later.\";\n }\n}\n\n// src/components/genui/style-props.ts\nvar TONE = {\n default: \"text-foreground\",\n muted: \"text-muted-foreground\",\n primary: \"text-primary\",\n success: \"text-emerald-600 dark:text-emerald-400\",\n warning: \"text-amber-600 dark:text-amber-400\",\n danger: \"text-destructive\"\n};\nvar SIZE = { sm: \"text-sm\", md: \"text-base\", lg: \"text-lg\" };\nvar ALIGN = { start: \"text-left\", center: \"text-center\", end: \"text-right\" };\nvar DENSITY = { compact: \"gap-2\", comfortable: \"gap-4\" };\nfunction styleProps(node) {\n return cn(\n typeof node.tone === \"string\" ? TONE[node.tone] : void 0,\n typeof node.size === \"string\" ? SIZE[node.size] : void 0,\n typeof node.align === \"string\" ? ALIGN[node.align] : void 0,\n typeof node.density === \"string\" ? DENSITY[node.density] : void 0,\n node.emphasis === \"high\" ? \"font-semibold\" : node.emphasis === \"medium\" ? \"font-medium\" : void 0\n );\n}\n\n// src/components/atoms/ui/card.tsx\nimport * as React2 from \"react\";\nimport { jsx as jsx2 } from \"react/jsx-runtime\";\nvar Card = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx2(\n \"div\",\n {\n ref,\n className: cn(\n \"rounded-lg\",\n \" border\",\n \"bg-card\",\n \"text-card-foreground\",\n \"shadow-raised\",\n className\n ),\n ...props\n }\n));\nCard.displayName = \"Card\";\nvar CardHeader = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx2(\n \"div\",\n {\n ref,\n className: cn(\"flex flex-col space-y-1.5 p-6\", className),\n ...props\n }\n));\nCardHeader.displayName = \"CardHeader\";\nvar CardTitle = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx2(\n \"h3\",\n {\n ref,\n className: cn(\"alq--typography-heading4\", className),\n ...props\n }\n));\nCardTitle.displayName = \"CardTitle\";\nvar CardDescription = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx2(\n \"p\",\n {\n ref,\n className: cn(\"text-sm text-muted-foreground\", className),\n ...props\n }\n));\nCardDescription.displayName = \"CardDescription\";\nvar CardContent = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx2(\"div\", { ref, className: cn(\"p-6 pt-0\", className), ...props }));\nCardContent.displayName = \"CardContent\";\nvar CardFooter = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx2(\n \"div\",\n {\n ref,\n className: cn(\"flex items-center p-6 pt-0\", className),\n ...props\n }\n));\nCardFooter.displayName = \"CardFooter\";\n\n// src/components/atoms/ui/separator.tsx\nimport * as React3 from \"react\";\nimport * as SeparatorPrimitive from \"@radix-ui/react-separator\";\nimport { jsx as jsx3 } from \"react/jsx-runtime\";\nvar Separator = React3.forwardRef(({ className, orientation = \"horizontal\", decorative = true, ...props }, ref) => /* @__PURE__ */ jsx3(\n SeparatorPrimitive.Root,\n {\n ref,\n decorative,\n orientation,\n className: cn(\n \"shrink-0 bg-border\",\n orientation === \"horizontal\" ? \"h-[1px] w-full\" : \"h-full w-[1px]\",\n className,\n \"alq--separator\"\n ),\n ...props\n }\n));\nSeparator.displayName = SeparatorPrimitive.Root.displayName;\n\n// src/components/atoms/ui/tabs.tsx\nimport * as React4 from \"react\";\nimport * as TabsPrimitive from \"@radix-ui/react-tabs\";\nimport { jsx as jsx4 } from \"react/jsx-runtime\";\nvar Tabs = TabsPrimitive.Root;\nvar TabsList = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx4(\n TabsPrimitive.List,\n {\n ref,\n className: cn(\n \"inline-flex h-10 items-center justify-center rounded-md p-1 text-muted-foreground\",\n className,\n \"alq--tabs\"\n ),\n ...props\n }\n));\nTabsList.displayName = TabsPrimitive.List.displayName;\nvar TabsTrigger = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx4(\n TabsPrimitive.Trigger,\n {\n ref,\n className: cn(\n \"inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:border-b-2 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:border-b-2 data-[state=active]:text-foreground data-[state=active]:shadow-sm\",\n className\n ),\n ...props\n }\n));\nTabsTrigger.displayName = TabsPrimitive.Trigger.displayName;\nvar TabsContent = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx4(\n TabsPrimitive.Content,\n {\n ref,\n className: cn(\n \"mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2\",\n className\n ),\n ...props\n }\n));\nTabsContent.displayName = TabsPrimitive.Content.displayName;\n\n// src/components/atoms/ui/accordion.tsx\nimport * as React5 from \"react\";\nimport * as AccordionPrimitive from \"@radix-ui/react-accordion\";\nimport { ChevronDown } from \"lucide-react\";\nimport { jsx as jsx5, jsxs as jsxs2 } from \"react/jsx-runtime\";\nvar Accordion = AccordionPrimitive.Root;\nvar AccordionItem = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx5(AccordionPrimitive.Item, { ref, className: cn(\"border-b\", className), ...props }));\nAccordionItem.displayName = \"AccordionItem\";\nvar AccordionTrigger = React5.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsx5(AccordionPrimitive.Header, { className: \"flex\", children: /* @__PURE__ */ jsxs2(\n AccordionPrimitive.Trigger,\n {\n ref,\n className: cn(\n \"flex flex-1 items-center justify-between py-4 text-sm font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180\",\n className\n ),\n ...props,\n children: [\n children,\n /* @__PURE__ */ jsx5(ChevronDown, { className: \"h-4 w-4 shrink-0 text-muted-foreground transition-transform duration-200\" })\n ]\n }\n) }));\nAccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName;\nvar AccordionContent = React5.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsx5(\n AccordionPrimitive.Content,\n {\n ref,\n className: \"overflow-hidden text-sm text-muted-foreground data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down\",\n ...props,\n children: /* @__PURE__ */ jsx5(\"div\", { className: cn(\"pb-4 pt-0\", className), children })\n }\n));\nAccordionContent.displayName = AccordionPrimitive.Content.displayName;\n\n// src/components/genui/components/layout.tsx\nimport { Fragment as Fragment3, jsx as jsx6, jsxs as jsxs3 } from \"react/jsx-runtime\";\nvar gapClass = (g) => g === \"lg\" ? \"gap-6\" : g === \"sm\" ? \"gap-2\" : \"gap-4\";\nvar Stack = ({ node, children }) => /* @__PURE__ */ jsx6(\n \"div\",\n {\n className: cn(\n \"flex\",\n node.direction === \"horizontal\" ? \"flex-row\" : \"flex-col\",\n gapClass(node.gap),\n styleProps(node)\n ),\n children\n }\n);\nvar Row = ({ node, children }) => /* @__PURE__ */ jsx6(\"div\", { className: cn(\"flex flex-row\", node.wrap ? \"flex-wrap\" : \"\", gapClass(node.gap), styleProps(node)), children });\nvar Column = ({ node, children }) => /* @__PURE__ */ jsx6(\"div\", { className: cn(\"flex flex-col\", gapClass(node.gap), styleProps(node)), children });\nvar Grid = ({ node, children }) => {\n const cols = typeof node.columns === \"number\" ? Math.min(Math.max(node.columns, 1), 6) : 2;\n const colClass = [\"\", \"grid-cols-1\", \"grid-cols-2\", \"grid-cols-3\", \"grid-cols-4\", \"grid-cols-5\", \"grid-cols-6\"][cols];\n return /* @__PURE__ */ jsx6(\"div\", { className: cn(\"grid\", colClass, gapClass(node.gap), styleProps(node)), children });\n};\nvar Divider = ({ node }) => typeof node.label === \"string\" ? /* @__PURE__ */ jsxs3(\"div\", { className: \"flex items-center gap-3 text-xs text-muted-foreground\", children: [\n /* @__PURE__ */ jsx6(Separator, { className: \"flex-1\" }),\n /* @__PURE__ */ jsx6(\"span\", { children: node.label }),\n /* @__PURE__ */ jsx6(Separator, { className: \"flex-1\" })\n] }) : /* @__PURE__ */ jsx6(Separator, {});\nvar Spacer = ({ node }) => {\n const h = node.size === \"lg\" ? \"h-8\" : node.size === \"sm\" ? \"h-2\" : \"h-4\";\n return /* @__PURE__ */ jsx6(\"div\", { className: h, \"aria-hidden\": true });\n};\nvar CardNode = ({ node, children }) => {\n const variant = node.variant === \"ghost\" ? \"border-transparent shadow-none bg-transparent\" : node.variant === \"outline\" ? \"shadow-none\" : \"\";\n return /* @__PURE__ */ jsxs3(Card, { className: cn(variant, styleProps(node)), children: [\n (typeof node.title === \"string\" || typeof node.description === \"string\") && /* @__PURE__ */ jsxs3(CardHeader, { children: [\n typeof node.title === \"string\" && /* @__PURE__ */ jsx6(CardTitle, { children: node.title }),\n typeof node.description === \"string\" && /* @__PURE__ */ jsx6(CardDescription, { children: node.description })\n ] }),\n /* @__PURE__ */ jsx6(CardContent, { children })\n ] });\n};\nvar TabsNode = ({ node, children }) => {\n const tabs = Array.isArray(node.tabs) ? node.tabs : [];\n const kids = React6.Children.toArray(children);\n if (!tabs.length) return /* @__PURE__ */ jsx6(Fragment3, { children });\n return /* @__PURE__ */ jsxs3(Tabs, { defaultValue: tabs[0]?.value, className: cn(styleProps(node)), children: [\n /* @__PURE__ */ jsx6(TabsList, { children: tabs.map((t) => /* @__PURE__ */ jsx6(TabsTrigger, { value: t.value, children: t.label }, t.value)) }),\n tabs.map((t, i) => /* @__PURE__ */ jsx6(TabsContent, { value: t.value, children: kids[i] ?? null }, t.value))\n ] });\n};\nvar AccordionNode = ({ node, children }) => {\n const items = Array.isArray(node.items) ? node.items : [];\n const kids = React6.Children.toArray(children);\n if (!items.length) return /* @__PURE__ */ jsx6(\"div\", { className: cn(\"flex flex-col gap-2\", styleProps(node)), children });\n return /* @__PURE__ */ jsx6(\n Accordion,\n {\n type: \"single\",\n collapsible: true,\n className: cn(\"rounded-md border border-border px-4\", styleProps(node)),\n children: items.map((it, i) => /* @__PURE__ */ jsxs3(AccordionItem, { value: it.value, children: [\n /* @__PURE__ */ jsx6(AccordionTrigger, { children: it.title }),\n /* @__PURE__ */ jsx6(AccordionContent, { children: kids[i] ?? null })\n ] }, it.value))\n }\n );\n};\n\n// src/components/genui/components/content.tsx\nimport * as React9 from \"react\";\nimport { icons } from \"lucide-react\";\n\n// src/components/atoms/ui/alert.tsx\nimport * as React7 from \"react\";\nimport { cva } from \"class-variance-authority\";\nimport { jsx as jsx7 } from \"react/jsx-runtime\";\nvar alertVariants = cva(\n \"relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground\",\n {\n variants: {\n variant: {\n default: \"bg-background text-foreground\",\n destructive: \"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive\"\n }\n },\n defaultVariants: {\n variant: \"default\"\n }\n }\n);\nvar Alert = React7.forwardRef(({ className, variant, ...props }, ref) => /* @__PURE__ */ jsx7(\n \"div\",\n {\n ref,\n role: \"alert\",\n className: cn(alertVariants({ variant }), className),\n ...props\n }\n));\nAlert.displayName = \"Alert\";\nvar AlertTitle = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx7(\n \"h5\",\n {\n ref,\n className: cn(\"mb-1 font-medium leading-none tracking-tight\", className),\n ...props\n }\n));\nAlertTitle.displayName = \"AlertTitle\";\nvar AlertDescription = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx7(\n \"div\",\n {\n ref,\n className: cn(\"text-sm [&_p]:leading-relaxed\", className),\n ...props\n }\n));\nAlertDescription.displayName = \"AlertDescription\";\n\n// src/components/atoms/ui/badge.tsx\nimport { cva as cva2 } from \"class-variance-authority\";\nimport { jsx as jsx8 } from \"react/jsx-runtime\";\nvar badgeVariants = cva2(\n \"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2\",\n {\n variants: {\n variant: {\n default: \"border-transparent bg-primary text-primary-foreground hover:bg-primary/80\",\n secondary: \"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80\",\n destructive: \"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80\",\n outline: \"text-foreground\"\n }\n },\n defaultVariants: {\n variant: \"default\"\n }\n }\n);\nfunction Badge({ className, variant, ...props }) {\n return /* @__PURE__ */ jsx8(\"div\", { className: cn(badgeVariants({ variant }), className, \"alq--badge\"), ...props });\n}\n\n// src/components/atoms/ui/avatar.tsx\nimport * as React8 from \"react\";\nimport * as AvatarPrimitive from \"@radix-ui/react-avatar\";\nimport { jsx as jsx9 } from \"react/jsx-runtime\";\nvar Avatar = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx9(\n AvatarPrimitive.Root,\n {\n ref,\n className: cn(\n \"relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full\",\n className\n ),\n ...props\n }\n));\nAvatar.displayName = AvatarPrimitive.Root.displayName;\nvar AvatarImage = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx9(\n AvatarPrimitive.Image,\n {\n ref,\n className: cn(\"aspect-square h-full w-full\", className),\n ...props\n }\n));\nAvatarImage.displayName = AvatarPrimitive.Image.displayName;\nvar AvatarFallback = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx9(\n AvatarPrimitive.Fallback,\n {\n ref,\n className: cn(\n \"flex h-full w-full items-center justify-center rounded-full bg-muted\",\n className\n ),\n ...props\n }\n));\nAvatarFallback.displayName = AvatarPrimitive.Fallback.displayName;\n\n// src/components/atoms/ui/rich-text.tsx\nimport ReactMarkdown from \"react-markdown\";\nimport remarkGfm from \"remark-gfm\";\nimport { jsx as jsx10 } from \"react/jsx-runtime\";\nfunction RichText({ content, className }) {\n return /* @__PURE__ */ jsx10(ReactMarkdown, { className: cn(className), remarkPlugins: [remarkGfm], children: content });\n}\n\n// src/components/genui/components/content.tsx\nimport { jsx as jsx11, jsxs as jsxs4 } from \"react/jsx-runtime\";\nvar SAFE_IMG = /^data:image\\/(png|jpe?g|gif|webp|svg\\+xml);/i;\nvar Text = ({ node }) => {\n const variant = node.variant === \"muted\" || node.variant === \"caption\" ? \"text-muted-foreground\" : \"text-foreground\";\n const size = node.variant === \"lead\" ? \"text-lg\" : node.variant === \"caption\" ? \"text-xs\" : \"\";\n return /* @__PURE__ */ jsx11(\"p\", { className: cn(variant, size, styleProps(node)), children: String(node.text ?? \"\") });\n};\nvar Heading = ({ node }) => {\n const level = typeof node.level === \"number\" ? Math.min(Math.max(node.level, 1), 4) : 1;\n const Tag = [\"h1\", \"h2\", \"h3\", \"h4\"][level - 1];\n const size = [\"text-2xl\", \"text-xl\", \"text-lg\", \"text-base\"][level - 1];\n return /* @__PURE__ */ jsx11(Tag, { className: cn(\"font-semibold text-foreground\", size, styleProps(node)), children: String(node.text ?? \"\") });\n};\nvar Markdown = ({ node }) => /* @__PURE__ */ jsx11(\n RichText,\n {\n content: String(node.text ?? \"\"),\n className: cn(\"prose prose-sm dark:prose-invert max-w-none\", styleProps(node))\n }\n);\nvar ImageNode = ({ node }) => {\n const src = typeof node.src === \"string\" ? node.src : \"\";\n if (!SAFE_IMG.test(src)) return /* @__PURE__ */ jsx11(\"span\", { className: \"text-muted-foreground text-sm\", children: \"[image omitted]\" });\n return /* @__PURE__ */ jsx11(\n \"img\",\n {\n src,\n alt: typeof node.alt === \"string\" ? node.alt : \"\",\n className: cn(\"max-w-full rounded-md\", styleProps(node))\n }\n );\n};\nvar IconNode = ({ node }) => {\n const name = typeof node.name === \"string\" ? node.name : \"\";\n const Cmp = icons[name];\n if (!Cmp) return null;\n return /* @__PURE__ */ jsx11(Cmp, { className: cn(\"h-4 w-4\", styleProps(node)) });\n};\nvar BADGE_VARIANT = {\n solid: \"default\",\n outline: \"outline\",\n subtle: \"secondary\"\n};\nvar BadgeNode = ({ node }) => /* @__PURE__ */ jsx11(Badge, { variant: BADGE_VARIANT[String(node.variant ?? \"solid\")] ?? \"default\", className: styleProps(node), children: String(node.text ?? \"\") });\nvar AvatarNode = ({ node }) => {\n const src = typeof node.src === \"string\" && SAFE_IMG.test(node.src) ? node.src : void 0;\n const fallback = typeof node.fallback === \"string\" ? node.fallback.slice(0, 2).toUpperCase() : \"?\";\n return /* @__PURE__ */ jsxs4(Avatar, { className: styleProps(node), children: [\n src && /* @__PURE__ */ jsx11(AvatarImage, { src }),\n /* @__PURE__ */ jsx11(AvatarFallback, { children: fallback })\n ] });\n};\nvar ALERT_VARIANT = {\n info: \"default\",\n success: \"default\",\n warning: \"default\",\n danger: \"destructive\"\n};\nvar AlertNode = ({ node }) => /* @__PURE__ */ jsxs4(Alert, { variant: ALERT_VARIANT[String(node.variant ?? \"info\")] ?? \"default\", className: styleProps(node), children: [\n typeof node.title === \"string\" && /* @__PURE__ */ jsx11(AlertTitle, { children: node.title }),\n /* @__PURE__ */ jsx11(AlertDescription, { children: String(node.text ?? \"\") })\n] });\nvar Stat = ({ node }) => {\n const label = node.label ?? node.title;\n const value = node.value ?? node.text;\n return /* @__PURE__ */ jsxs4(\"div\", { className: cn(\"flex flex-col\", styleProps(node)), children: [\n label != null && /* @__PURE__ */ jsx11(\"span\", { className: \"text-sm text-muted-foreground\", children: String(label) }),\n /* @__PURE__ */ jsx11(\"span\", { className: \"text-2xl font-semibold text-foreground\", children: String(value ?? \"\") }),\n typeof node.delta === \"string\" && /* @__PURE__ */ jsx11(\"span\", { className: \"text-sm text-muted-foreground\", children: node.delta })\n ] });\n};\nvar KeyValueNode = ({ node, value }) => {\n const src = value && typeof value === \"object\" ? value : node.data && typeof node.data === \"object\" ? node.data : {};\n const obj = src;\n return /* @__PURE__ */ jsx11(\"dl\", { className: cn(\"grid grid-cols-2 gap-x-4 gap-y-1\", styleProps(node)), children: Object.entries(obj).map(([k, v]) => /* @__PURE__ */ jsxs4(React9.Fragment, { children: [\n /* @__PURE__ */ jsx11(\"dt\", { className: \"text-muted-foreground\", children: k }),\n /* @__PURE__ */ jsx11(\"dd\", { className: \"text-foreground\", children: String(v) })\n ] }, k)) });\n};\nvar ListNode = ({ node, value }) => {\n const items = Array.isArray(value) ? value : Array.isArray(node.items) ? node.items : [];\n const ordered = node.ordered === true;\n const Tag = ordered ? \"ol\" : \"ul\";\n return /* @__PURE__ */ jsx11(Tag, { className: cn(ordered ? \"list-decimal\" : \"list-disc\", \"pl-5\", styleProps(node)), children: items.map((it, i) => /* @__PURE__ */ jsx11(\"li\", { children: String(it) }, i)) });\n};\nvar Quote = ({ node }) => /* @__PURE__ */ jsxs4(\"blockquote\", { className: cn(\"border-l-2 border-border pl-4 italic text-muted-foreground\", styleProps(node)), children: [\n String(node.text ?? \"\"),\n typeof node.cite === \"string\" && /* @__PURE__ */ jsxs4(\"footer\", { className: \"mt-1 text-xs not-italic\", children: [\n \"\\u2014 \",\n node.cite\n ] })\n] });\n\n// src/components/genui/components/inputs.tsx\nimport * as React21 from \"react\";\nimport { format } from \"date-fns\";\nimport { Star } from \"lucide-react\";\n\n// src/components/atoms/ui/input.tsx\nimport { forwardRef as forwardRef7 } from \"react\";\nimport { jsx as jsx12 } from \"react/jsx-runtime\";\nvar Input = forwardRef7(\n ({ className, type, ...props }, ref) => {\n return /* @__PURE__ */ jsx12(\n \"input\",\n {\n type,\n className: cn(\n \"flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50\",\n className,\n \"alq--input\"\n ),\n ref,\n ...props\n }\n );\n }\n);\nInput.displayName = \"Input\";\n\n// src/components/atoms/ui/textarea.tsx\nimport * as React10 from \"react\";\nimport { jsx as jsx13 } from \"react/jsx-runtime\";\nvar Textarea = React10.forwardRef(\n ({ className, ...props }, ref) => {\n return /* @__PURE__ */ jsx13(\n \"textarea\",\n {\n className: cn(\n \"flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50\",\n className,\n \"alq--textarea\"\n ),\n ref,\n ...props\n }\n );\n }\n);\nTextarea.displayName = \"Textarea\";\n\n// src/components/atoms/ui/label.tsx\nimport * as React11 from \"react\";\nimport * as LabelPrimitive from \"@radix-ui/react-label\";\nimport { cva as cva3 } from \"class-variance-authority\";\nimport { jsx as jsx14 } from \"react/jsx-runtime\";\nvar labelVariants = cva3(\n \"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70\"\n);\nvar Label = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx14(\n LabelPrimitive.Root,\n {\n ref,\n className: cn(labelVariants(), className, \"alq--label\"),\n ...props\n }\n));\nLabel.displayName = LabelPrimitive.Root.displayName;\n\n// src/components/atoms/ui/checkbox.tsx\nimport * as React12 from \"react\";\nimport * as CheckboxPrimitive from \"@radix-ui/react-checkbox\";\nimport { Check } from \"lucide-react\";\nimport { jsx as jsx15 } from \"react/jsx-runtime\";\nvar Checkbox = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx15(\n CheckboxPrimitive.Root,\n {\n ref,\n className: cn(\n \"peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground\",\n className,\n \"alq--checkbox\"\n ),\n ...props,\n children: /* @__PURE__ */ jsx15(\n CheckboxPrimitive.Indicator,\n {\n className: cn(\"flex items-center justify-center text-current\"),\n children: /* @__PURE__ */ jsx15(Check, { className: \"h-4 w-4\" })\n }\n )\n }\n));\nCheckbox.displayName = CheckboxPrimitive.Root.displayName;\n\n// src/components/atoms/ui/switch.tsx\nimport * as React13 from \"react\";\nimport * as SwitchPrimitives from \"@radix-ui/react-switch\";\nimport { jsx as jsx16 } from \"react/jsx-runtime\";\nvar Switch = React13.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx16(\n SwitchPrimitives.Root,\n {\n className: cn(\n \"peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input\",\n className,\n \"alq--switch\"\n ),\n ...props,\n ref,\n children: /* @__PURE__ */ jsx16(\n SwitchPrimitives.Thumb,\n {\n className: cn(\n \"pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0\"\n )\n }\n )\n }\n));\nSwitch.displayName = SwitchPrimitives.Root.displayName;\n\n// src/components/atoms/ui/slider.tsx\nimport * as React14 from \"react\";\nimport * as SliderPrimitive from \"@radix-ui/react-slider\";\nimport { jsx as jsx17, jsxs as jsxs5 } from \"react/jsx-runtime\";\nvar Slider = React14.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxs5(\n SliderPrimitive.Root,\n {\n ref,\n className: cn(\n \"relative flex w-44 touch-none select-none items-center\",\n className,\n \"alq--slider\"\n ),\n ...props,\n children: [\n /* @__PURE__ */ jsx17(SliderPrimitive.Track, { className: \"relative h-2 w-44 grow overflow-hidden rounded-full bg-primary\", children: /* @__PURE__ */ jsx17(SliderPrimitive.Range, { className: \"absolute h-full bg-secondary\" }) }),\n /* @__PURE__ */ jsx17(SliderPrimitive.Thumb, { className: \"block h-5 w-5 rounded-full border-2 border-gray bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50\" })\n ]\n }\n));\nSlider.displayName = SliderPrimitive.Root.displayName;\n\n// src/components/atoms/ui/button.tsx\nimport * as React15 from \"react\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport { cva as cva4 } from \"class-variance-authority\";\nimport { jsx as jsx18 } from \"react/jsx-runtime\";\nvar buttonVariants = cva4(\n \"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0\",\n {\n variants: {\n variant: {\n default: \"bg-primary text-primary-foreground hover:bg-primary/90\",\n destructive: \"bg-destructive text-destructive-foreground hover:bg-destructive/90\",\n outline: \"border border-input bg-background hover:bg-accent hover:text-accent-foreground\",\n secondary: \"bg-secondary text-secondary-foreground hover:bg-secondary/80\",\n ghost: \"hover:bg-accent hover:text-accent-foreground\",\n link: \"text-primary underline-offset-4 hover:underline\"\n },\n size: {\n default: \"h-10 px-4 py-2\",\n sm: \"h-9 rounded-md px-3\",\n lg: \"h-11 rounded-md px-8\",\n icon: \"h-10 w-10\"\n }\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\"\n }\n }\n);\nvar Button = React15.forwardRef(\n ({ className, variant, size, asChild = false, ...props }, ref) => {\n const Comp = asChild ? Slot : \"button\";\n return /* @__PURE__ */ jsx18(\n Comp,\n {\n className: cn(buttonVariants({ variant, size, className })),\n ref,\n ...props\n }\n );\n }\n);\nButton.displayName = \"Button\";\n\n// src/components/atoms/ui/calendar.tsx\nimport { ChevronLeft, ChevronRight } from \"lucide-react\";\nimport { DayPicker } from \"react-day-picker\";\nimport { jsx as jsx19 } from \"react/jsx-runtime\";\nfunction Calendar({ className, classNames, showOutsideDays = true, ...props }) {\n return /* @__PURE__ */ jsx19(\n DayPicker,\n {\n showOutsideDays,\n className: cn(\"p-3\", className),\n classNames: {\n months: \"flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0\",\n month: \"space-y-4\",\n caption: \"flex justify-center pt-1 relative items-center\",\n caption_label: \"text-sm font-medium\",\n nav: \"space-x-1 flex items-center\",\n nav_button: cn(\n buttonVariants({ variant: \"outline\" }),\n \"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100\"\n ),\n nav_button_previous: \"absolute left-1\",\n nav_button_next: \"absolute right-1\",\n table: \"w-full border-collapse space-y-1\",\n head_row: \"flex\",\n head_cell: \"text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]\",\n row: \"flex w-full mt-2\",\n cell: \"h-9 w-9 text-center text-sm p-0 relative [&:has([aria-selected])]:bg-accent first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md focus-within:relative focus-within:z-20\",\n day: cn(buttonVariants({ variant: \"ghost\" }), \"h-9 w-9 p-0 font-normal aria-selected:opacity-100\"),\n day_range_end: \"day-range-end\",\n day_selected: \"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground\",\n day_today: \"bg-accent text-accent-foreground\",\n day_outside: \"day-outside text-muted-foreground opacity-50\",\n day_disabled: \"text-muted-foreground opacity-50\",\n day_range_middle: \"aria-selected:bg-accent aria-selected:text-accent-foreground\",\n day_hidden: \"invisible\",\n ...classNames\n },\n components: {\n IconLeft: () => /* @__PURE__ */ jsx19(ChevronLeft, { className: \"h-4 w-4\" }),\n IconRight: () => /* @__PURE__ */ jsx19(ChevronRight, { className: \"h-4 w-4\" })\n },\n ...props\n }\n );\n}\nCalendar.displayName = \"Calendar\";\n\n// src/components/atoms/ui/radio-group.tsx\nimport * as React16 from \"react\";\nimport * as RadioGroupPrimitive from \"@radix-ui/react-radio-group\";\nimport { Circle } from \"lucide-react\";\nimport { jsx as jsx20 } from \"react/jsx-runtime\";\nvar RadioGroup = React16.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx20(RadioGroupPrimitive.Root, { ref, className: cn(\"grid gap-2\", className), ...props }));\nRadioGroup.displayName = RadioGroupPrimitive.Root.displayName;\nvar RadioGroupItem = React16.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx20(\n RadioGroupPrimitive.Item,\n {\n ref,\n className: cn(\n \"aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50\",\n className\n ),\n ...props,\n children: /* @__PURE__ */ jsx20(RadioGroupPrimitive.Indicator, { className: \"flex items-center justify-center\", children: /* @__PURE__ */ jsx20(Circle, { className: \"h-2.5 w-2.5 fill-current text-current\" }) })\n }\n));\nRadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName;\n\n// src/components/atoms/ui/popover.tsx\nimport * as React17 from \"react\";\nimport * as PopoverPrimitive from \"@radix-ui/react-popover\";\nimport { jsx as jsx21 } from \"react/jsx-runtime\";\nvar Popover = PopoverPrimitive.Root;\nvar PopoverTrigger = PopoverPrimitive.Trigger;\nvar PopoverContent = React17.forwardRef(({ className, align = \"center\", sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx21(PopoverPrimitive.Portal, { children: /* @__PURE__ */ jsx21(\n PopoverPrimitive.Content,\n {\n ref,\n align,\n sideOffset,\n className: cn(\n \"z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 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\",\n className\n ),\n ...props\n }\n) }));\nPopoverContent.displayName = PopoverPrimitive.Content.displayName;\n\n// src/components/atoms/ui/select.tsx\nimport * as React18 from \"react\";\nimport * as SelectPrimitive from \"@radix-ui/react-select\";\nimport { Check as Check2, ChevronDown as ChevronDown2, ChevronUp } from \"lucide-react\";\nimport { jsx as jsx22, jsxs as jsxs6 } from \"react/jsx-runtime\";\nvar Select = SelectPrimitive.Root;\nvar SelectValue = SelectPrimitive.Value;\nvar SelectTrigger = React18.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs6(\n SelectPrimitive.Trigger,\n {\n ref,\n className: cn(\n \"flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1\",\n className,\n \"alq--select\"\n ),\n ...props,\n children: [\n children,\n /* @__PURE__ */ jsx22(SelectPrimitive.Icon, { asChild: true, children: /* @__PURE__ */ jsx22(ChevronDown2, { className: \"h-4 w-4 opacity-50\" }) })\n ]\n }\n));\nSelectTrigger.displayName = SelectPrimitive.Trigger.displayName;\nvar SelectScrollUpButton = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx22(\n SelectPrimitive.ScrollUpButton,\n {\n ref,\n className: cn(\n \"flex cursor-default items-center justify-center py-1\",\n className\n ),\n ...props,\n children: /* @__PURE__ */ jsx22(ChevronUp, { className: \"h-4 w-4\" })\n }\n));\nSelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;\nvar SelectScrollDownButton = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx22(\n SelectPrimitive.ScrollDownButton,\n {\n ref,\n className: cn(\n \"flex cursor-default items-center justify-center py-1\",\n className\n ),\n ...props,\n children: /* @__PURE__ */ jsx22(ChevronDown2, { className: \"h-4 w-4\" })\n }\n));\nSelectScrollDownButton.displayName = SelectPrimitive.ScrollDownButton.displayName;\nvar SelectContent = React18.forwardRef(({ className, children, position = \"popper\", ...props }, ref) => /* @__PURE__ */ jsx22(SelectPrimitive.Portal, { children: /* @__PURE__ */ jsxs6(\n SelectPrimitive.Content,\n {\n ref,\n className: cn(\n \"relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 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\",\n position === \"popper\" && \"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1\",\n className\n ),\n position,\n ...props,\n children: [\n /* @__PURE__ */ jsx22(SelectScrollUpButton, {}),\n /* @__PURE__ */ jsx22(\n SelectPrimitive.Viewport,\n {\n className: cn(\n \"p-1\",\n position === \"popper\" && \"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]\"\n ),\n children\n }\n ),\n /* @__PURE__ */ jsx22(SelectScrollDownButton, {})\n ]\n }\n) }));\nSelectContent.displayName = SelectPrimitive.Content.displayName;\nvar SelectLabel = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx22(\n SelectPrimitive.Label,\n {\n ref,\n className: cn(\"py-1.5 pl-8 pr-2 text-sm font-semibold\", className),\n ...props\n }\n));\nSelectLabel.displayName = SelectPrimitive.Label.displayName;\nvar SelectItem = React18.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs6(\n SelectPrimitive.Item,\n {\n ref,\n className: cn(\n \"relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50\",\n className\n ),\n ...props,\n children: [\n /* @__PURE__ */ jsx22(\"span\", { className: \"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\", children: /* @__PURE__ */ jsx22(SelectPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx22(Check2, { className: \"h-4 w-4\" }) }) }),\n /* @__PURE__ */ jsx22(SelectPrimitive.ItemText, { children })\n ]\n }\n));\nSelectItem.displayName = SelectPrimitive.Item.displayName;\nvar SelectSeparator = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx22(\n SelectPrimitive.Separator,\n {\n ref,\n className: cn(\"-mx-1 my-1 h-px bg-muted\", className),\n ...props\n }\n));\nSelectSeparator.displayName = SelectPrimitive.Separator.displayName;\n\n// src/components/atoms/ui/command.tsx\nimport * as React20 from \"react\";\nimport { Command as CommandPrimitive } from \"cmdk\";\nimport { Search } from \"lucide-react\";\n\n// src/components/atoms/ui/dialog.tsx\nimport * as React19 from \"react\";\nimport * as DialogPrimitive from \"@radix-ui/react-dialog\";\nimport { X } from \"lucide-react\";\nimport { jsx as jsx23, jsxs as jsxs7 } from \"react/jsx-runtime\";\nvar Dialog = DialogPrimitive.Root;\nvar DialogTrigger = DialogPrimitive.Trigger;\nvar DialogPortal = DialogPrimitive.Portal;\nvar DialogOverlay = React19.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx23(\n DialogPrimitive.Overlay,\n {\n ref,\n className: cn(\n \"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0\",\n className\n ),\n ...props\n }\n));\nDialogOverlay.displayName = DialogPrimitive.Overlay.displayName;\nvar DialogContent = React19.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs7(DialogPortal, { children: [\n /* @__PURE__ */ jsx23(DialogOverlay, {}),\n /* @__PURE__ */ jsxs7(\n DialogPrimitive.Content,\n {\n ref,\n className: cn(\n \"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg\",\n className,\n \"alq--dialog-content\"\n ),\n ...props,\n children: [\n children,\n /* @__PURE__ */ jsxs7(DialogPrimitive.Close, { className: \"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground\", children: [\n /* @__PURE__ */ jsx23(X, { className: \"h-4 w-4\" }),\n /* @__PURE__ */ jsx23(\"span\", { className: \"sr-only\", children: \"Close\" })\n ] })\n ]\n }\n )\n] }));\nDialogContent.displayName = DialogPrimitive.Content.displayName;\nvar DialogHeader = ({\n className,\n ...props\n}) => /* @__PURE__ */ jsx23(\n \"div\",\n {\n className: cn(\n \"flex flex-col space-y-1.5 text-center sm:text-left text-foreground\",\n className,\n \"alq--dialog-header\"\n ),\n ...props\n }\n);\nDialogHeader.displayName = \"DialogHeader\";\nvar DialogFooter = ({\n className,\n ...props\n}) => /* @__PURE__ */ jsx23(\n \"div\",\n {\n className: cn(\n \"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2\",\n className\n ),\n ...props\n }\n);\nDialogFooter.displayName = \"DialogFooter\";\nvar DialogTitle = React19.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx23(\n DialogPrimitive.Title,\n {\n ref,\n className: cn(\n \"text-lg font-semibold leading-none tracking-tight text-foreground\",\n className,\n \"alq--dialog-title\"\n ),\n ...props\n }\n));\nDialogTitle.displayName = DialogPrimitive.Title.displayName;\nvar DialogDescription = React19.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx23(\n DialogPrimitive.Description,\n {\n ref,\n className: cn(\"text-sm text-muted-foreground\", className),\n ...props\n }\n));\nDialogDescription.displayName = DialogPrimitive.Description.displayName;\n\n// src/components/atoms/ui/command.tsx\nimport { jsx as jsx24, jsxs as jsxs8 } from \"react/jsx-runtime\";\nvar Command = React20.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx24(\n CommandPrimitive,\n {\n ref,\n className: cn(\n \"flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground\",\n className\n ),\n ...props\n }\n));\nCommand.displayName = CommandPrimitive.displayName;\nvar CommandInput = React20.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxs8(\"div\", { className: \"flex items-center border-b px-3\", \"cmdk-input-wrapper\": \"\", children: [\n /* @__PURE__ */ jsx24(Search, { className: \"mr-2 h-4 w-4 shrink-0 opacity-50\" }),\n /* @__PURE__ */ jsx24(\n CommandPrimitive.Input,\n {\n ref,\n className: cn(\n \"flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50\",\n className\n ),\n ...props\n }\n )\n] }));\nCommandInput.displayName = CommandPrimitive.Input.displayName;\nvar CommandList = React20.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx24(\n CommandPrimitive.List,\n {\n ref,\n className: cn(\"max-h-[300px] overflow-y-auto overflow-x-hidden\", className),\n ...props\n }\n));\nCommandList.displayName = CommandPrimitive.List.displayName;\nvar CommandEmpty = React20.forwardRef((props, ref) => /* @__PURE__ */ jsx24(\n CommandPrimitive.Empty,\n {\n ref,\n className: \"py-6 text-center text-sm\",\n ...props\n }\n));\nCommandEmpty.displayName = CommandPrimitive.Empty.displayName;\nvar CommandGroup = React20.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx24(\n CommandPrimitive.Group,\n {\n ref,\n className: cn(\n \"overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground\",\n className\n ),\n ...props\n }\n));\nCommandGroup.displayName = CommandPrimitive.Group.displayName;\nvar CommandSeparator = React20.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx24(\n CommandPrimitive.Separator,\n {\n ref,\n className: cn(\"-mx-1 h-px bg-border\", className),\n ...props\n }\n));\nCommandSeparator.displayName = CommandPrimitive.Separator.displayName;\nvar CommandItem = React20.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx24(\n CommandPrimitive.Item,\n {\n ref,\n className: cn(\n \"relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0\",\n className\n ),\n ...props\n }\n));\nCommandItem.displayName = CommandPrimitive.Item.displayName;\nvar CommandShortcut = ({\n className,\n ...props\n}) => {\n return /* @__PURE__ */ jsx24(\n \"span\",\n {\n className: cn(\n \"ml-auto text-xs tracking-widest text-muted-foreground\",\n className\n ),\n ...props\n }\n );\n};\nCommandShortcut.displayName = \"CommandShortcut\";\n\n// src/components/genui/components/inputs.tsx\nimport { jsx as jsx25, jsxs as jsxs9 } from \"react/jsx-runtime\";\nvar opts = (node) => Array.isArray(node.options) ? node.options.map(\n (o) => typeof o === \"string\" || typeof o === \"number\" ? { label: String(o), value: o } : o\n) : [];\nvar toDate = (v) => {\n if (typeof v !== \"string\" || !v) return void 0;\n const d = new Date(v);\n return isNaN(d.getTime()) ? void 0 : d;\n};\nvar Field = ({\n id,\n label,\n node,\n children\n}) => /* @__PURE__ */ jsxs9(\"div\", { className: cn(\"flex flex-col gap-1.5\", styleProps(node)), children: [\n typeof label === \"string\" && /* @__PURE__ */ jsx25(Label, { htmlFor: id, children: label }),\n children\n] });\nvar TextField = ({ node, value, onChange }) => {\n const id = `f-${node.id}`;\n return /* @__PURE__ */ jsx25(Field, { id, label: node.label, node, children: /* @__PURE__ */ jsx25(\n Input,\n {\n id,\n placeholder: typeof node.placeholder === \"string\" ? node.placeholder : void 0,\n value: typeof value === \"string\" ? value : \"\",\n onChange: (e) => onChange?.(e.target.value)\n }\n ) });\n};\nvar TextArea = ({ node, value, onChange }) => {\n const id = `f-${node.id}`;\n return /* @__PURE__ */ jsx25(Field, { id, label: node.label, node, children: /* @__PURE__ */ jsx25(\n Textarea,\n {\n id,\n rows: typeof node.rows === \"number\" ? node.rows : void 0,\n placeholder: typeof node.placeholder === \"string\" ? node.placeholder : void 0,\n value: typeof value === \"string\" ? value : \"\",\n onChange: (e) => onChange?.(e.target.value)\n }\n ) });\n};\nvar NumberField = ({ node, value, onChange }) => {\n const id = `f-${node.id}`;\n return /* @__PURE__ */ jsx25(Field, { id, label: node.label, node, children: /* @__PURE__ */ jsx25(\n Input,\n {\n id,\n type: \"number\",\n min: typeof node.min === \"number\" ? node.min : void 0,\n max: typeof node.max === \"number\" ? node.max : void 0,\n step: typeof node.step === \"number\" ? node.step : void 0,\n value: typeof value === \"number\" ? value : \"\",\n onChange: (e) => onChange?.(e.target.value === \"\" ? void 0 : Number(e.target.value))\n }\n ) });\n};\nvar SelectNode = ({ node, value, onChange }) => {\n const id = `f-${node.id}`;\n return /* @__PURE__ */ jsx25(Field, { id, label: node.label, node, children: /* @__PURE__ */ jsxs9(Select, { value: value != null ? String(value) : void 0, onValueChange: (v) => onChange?.(v), children: [\n /* @__PURE__ */ jsx25(SelectTrigger, { id, children: /* @__PURE__ */ jsx25(SelectValue, { placeholder: typeof node.placeholder === \"string\" ? node.placeholder : void 0 }) }),\n /* @__PURE__ */ jsx25(SelectContent, { children: opts(node).map((o) => /* @__PURE__ */ jsx25(SelectItem, { value: String(o.value), children: o.label }, String(o.value))) })\n ] }) });\n};\nvar MultiSelect = ({ node, value, onChange }) => {\n const selected = Array.isArray(value) ? value : [];\n const toggle = (v) => onChange?.(selected.includes(v) ? selected.filter((x) => x !== v) : [...selected, v]);\n return /* @__PURE__ */ jsx25(Field, { id: `f-${node.id}`, label: node.label, node, children: /* @__PURE__ */ jsx25(\"div\", { className: \"flex flex-col gap-1.5\", children: opts(node).map((o) => /* @__PURE__ */ jsxs9(\"label\", { className: \"flex items-center gap-2 text-sm\", children: [\n /* @__PURE__ */ jsx25(Checkbox, { checked: selected.includes(o.value), onCheckedChange: () => toggle(o.value) }),\n o.label\n ] }, String(o.value))) }) });\n};\nvar Combobox = ({ node, value, onChange }) => {\n const [open, setOpen] = React21.useState(false);\n const selected = opts(node).find((o) => o.value === value);\n const placeholder = typeof node.placeholder === \"string\" ? node.placeholder : \"Select\\u2026\";\n return /* @__PURE__ */ jsx25(Field, { id: `f-${node.id}`, label: node.label, node, children: /* @__PURE__ */ jsxs9(Popover, { open, onOpenChange: setOpen, children: [\n /* @__PURE__ */ jsx25(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx25(Button, { variant: \"outline\", role: \"combobox\", className: \"justify-between font-normal\", children: selected ? selected.label : placeholder }) }),\n /* @__PURE__ */ jsx25(PopoverContent, { className: \"w-[--radix-popover-trigger-width] p-0\", children: /* @__PURE__ */ jsxs9(Command, { children: [\n /* @__PURE__ */ jsx25(CommandInput, { placeholder: \"Search\\u2026\" }),\n /* @__PURE__ */ jsxs9(CommandList, { children: [\n /* @__PURE__ */ jsx25(CommandEmpty, { children: \"No results.\" }),\n opts(node).map((o) => /* @__PURE__ */ jsx25(\n CommandItem,\n {\n value: o.label,\n onSelect: () => {\n onChange?.(o.value);\n setOpen(false);\n },\n children: o.label\n },\n String(o.value)\n ))\n ] })\n ] }) })\n ] }) });\n};\nvar CheckboxNode = ({ node, value, onChange }) => {\n const id = `f-${node.id}`;\n return /* @__PURE__ */ jsxs9(\"div\", { className: cn(\"flex items-center gap-2\", styleProps(node)), children: [\n /* @__PURE__ */ jsx25(Checkbox, { id, checked: value === true, onCheckedChange: (c) => onChange?.(c === true) }),\n typeof node.label === \"string\" && /* @__PURE__ */ jsx25(Label, { htmlFor: id, children: node.label })\n ] });\n};\nvar CheckboxGroup = ({ node, value, onChange }) => {\n const selected = Array.isArray(value) ? value : [];\n const toggle = (v) => onChange?.(selected.includes(v) ? selected.filter((x) => x !== v) : [...selected, v]);\n return /* @__PURE__ */ jsx25(Field, { id: `f-${node.id}`, label: node.label, node, children: /* @__PURE__ */ jsx25(\"div\", { className: \"flex flex-col gap-1.5\", children: opts(node).map((o) => /* @__PURE__ */ jsxs9(\"label\", { className: \"flex items-center gap-2 text-sm\", children: [\n /* @__PURE__ */ jsx25(Checkbox, { checked: selected.includes(o.value), onCheckedChange: () => toggle(o.value) }),\n o.label\n ] }, String(o.value))) }) });\n};\nvar Radio = ({ node, value, onChange }) => /* @__PURE__ */ jsx25(Field, { id: `f-${node.id}`, label: node.label, node, children: /* @__PURE__ */ jsx25(\n RadioGroup,\n {\n value: value != null ? String(value) : void 0,\n onValueChange: (v) => {\n const match = opts(node).find((o) => String(o.value) === v);\n onChange?.(match ? match.value : v);\n },\n children: opts(node).map((o) => {\n const id = `r-${node.id}-${o.value}`;\n return /* @__PURE__ */ jsxs9(\"div\", { className: \"flex items-center gap-2 text-sm\", children: [\n /* @__PURE__ */ jsx25(RadioGroupItem, { id, value: String(o.value) }),\n /* @__PURE__ */ jsx25(Label, { htmlFor: id, className: \"font-normal\", children: o.label })\n ] }, String(o.value));\n })\n }\n) });\nvar SwitchNode = ({ node, value, onChange }) => {\n const id = `f-${node.id}`;\n return /* @__PURE__ */ jsxs9(\"div\", { className: cn(\"flex items-center gap-2\", styleProps(node)), children: [\n /* @__PURE__ */ jsx25(Switch, { id, checked: value === true, onCheckedChange: (c) => onChange?.(c === true) }),\n typeof node.label === \"string\" && /* @__PURE__ */ jsx25(Label, { htmlFor: id, children: node.label })\n ] });\n};\nvar SliderNode = ({ node, value, onChange }) => {\n const min = typeof node.min === \"number\" ? node.min : 0;\n const max = typeof node.max === \"number\" ? node.max : 100;\n const step = typeof node.step === \"number\" ? node.step : 1;\n const v = typeof value === \"number\" ? value : min;\n return /* @__PURE__ */ jsx25(Field, { id: `f-${node.id}`, label: node.label, node, children: /* @__PURE__ */ jsx25(Slider, { min, max, step, value: [v], onValueChange: (vals) => onChange?.(vals[0]) }) });\n};\nvar DatePicker = ({ node, value, onChange }) => {\n const selected = toDate(value);\n const label = selected ? format(selected, \"PPP\") : \"Pick a date\";\n return /* @__PURE__ */ jsx25(Field, { id: `f-${node.id}`, label: node.label, node, children: /* @__PURE__ */ jsxs9(Popover, { children: [\n /* @__PURE__ */ jsx25(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx25(Button, { variant: \"outline\", className: \"justify-start font-normal\", children: label }) }),\n /* @__PURE__ */ jsx25(PopoverContent, { className: \"w-auto p-0\", children: /* @__PURE__ */ jsx25(Calendar, { mode: \"single\", selected, onSelect: (d) => d && onChange?.(d.toISOString()) }) })\n ] }) });\n};\nvar DateRange = ({ node, value, onChange }) => {\n const parsed = value && typeof value === \"object\" ? value : void 0;\n const from = toDate(parsed?.from);\n const to = toDate(parsed?.to);\n const selected = from ? { from, to } : void 0;\n const label = from ? `${format(from, \"PP\")} \\u2013 ${to ? format(to, \"PP\") : \"\\u2026\"}` : \"Pick a range\";\n return /* @__PURE__ */ jsx25(Field, { id: `f-${node.id}`, label: node.label, node, children: /* @__PURE__ */ jsxs9(Popover, { children: [\n /* @__PURE__ */ jsx25(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx25(Button, { variant: \"outline\", className: \"justify-start font-normal\", children: label }) }),\n /* @__PURE__ */ jsx25(PopoverContent, { className: \"w-auto p-0\", children: /* @__PURE__ */ jsx25(\n Calendar,\n {\n mode: \"range\",\n selected,\n onSelect: (r) => onChange?.({ from: r?.from?.toISOString() ?? null, to: r?.to?.toISOString() ?? null })\n }\n ) })\n ] }) });\n};\nvar FileUpload = ({ node, onChange }) => {\n const id = `f-${node.id}`;\n return /* @__PURE__ */ jsx25(Field, { id, label: node.label, node, children: /* @__PURE__ */ jsx25(\n Input,\n {\n id,\n type: \"file\",\n accept: typeof node.accept === \"string\" ? node.accept : void 0,\n multiple: node.multiple === true,\n onChange: (e) => onChange?.(\n Array.from(e.target.files ?? []).map((f) => ({ name: f.name, size: f.size, type: f.type }))\n )\n }\n ) });\n};\nvar Rating = ({ node, value, onChange }) => {\n const max = typeof node.max === \"number\" ? node.max : 5;\n const current = typeof value === \"number\" ? value : 0;\n return /* @__PURE__ */ jsx25(Field, { id: `f-${node.id}`, label: node.label, node, children: /* @__PURE__ */ jsx25(\"div\", { className: \"flex items-center gap-1\", role: \"radiogroup\", \"aria-label\": \"rating\", children: Array.from({ length: max }, (_, i) => i + 1).map((n) => /* @__PURE__ */ jsx25(\n \"button\",\n {\n type: \"button\",\n \"aria-label\": `${n} star${n > 1 ? \"s\" : \"\"}`,\n onClick: () => onChange?.(n),\n className: \"text-amber-500\",\n children: /* @__PURE__ */ jsx25(Star, { className: cn(\"h-5 w-5\", n <= current ? \"fill-current\" : \"opacity-40\") })\n },\n n\n )) }) });\n};\n\n// src/components/genui/components/data.tsx\nimport * as React24 from \"react\";\nimport {\n useReactTable,\n getCoreRowModel,\n getSortedRowModel,\n flexRender\n} from \"@tanstack/react-table\";\nimport { BarChart, Bar, LineChart, Line, AreaChart, Area, PieChart, Pie, Cell, Tooltip as Tooltip2, Legend as Legend2 } from \"recharts\";\n\n// src/components/atoms/ui/table.tsx\nimport * as React22 from \"react\";\nimport { jsx as jsx26 } from \"react/jsx-runtime\";\nvar Table = React22.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx26(\"div\", { className: \"relative w-full overflow-auto\", children: /* @__PURE__ */ jsx26(\n \"table\",\n {\n ref,\n className: cn(\"w-full caption-bottom text-sm text-foreground bg-background\", className, \"alq--table\"),\n ...props\n }\n) }));\nTable.displayName = \"Table\";\nvar TableHeader = React22.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx26(\"thead\", { ref, className: cn(\"[&_tr]:border-b border-border bg-muted\", className, \"alq--table-header\"), ...props }));\nTableHeader.displayName = \"TableHeader\";\nvar TableBody = React22.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx26(\n \"tbody\",\n {\n ref,\n className: cn(\"[&_tr:last-child]:border-0 [&_tr]:border-b border-border\", className, \"alq--table-body\"),\n ...props\n }\n));\nTableBody.displayName = \"TableBody\";\nvar TableFooter = React22.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx26(\n \"tfoot\",\n {\n ref,\n className: cn(\n \"border-t border-border bg-muted/50 font-medium [&>tr]:last:border-b-0\",\n className,\n \"alq--table-footer\"\n ),\n ...props\n }\n));\nTableFooter.displayName = \"TableFooter\";\nvar TableRow = React22.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx26(\n \"tr\",\n {\n ref,\n className: cn(\n \"border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted\",\n className\n ),\n ...props\n }\n));\nTableRow.displayName = \"TableRow\";\nvar TableHead = React22.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx26(\n \"th\",\n {\n ref,\n className: cn(\n \"h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0\",\n className\n ),\n ...props\n }\n));\nTableHead.displayName = \"TableHead\";\nvar TableCell = React22.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx26(\n \"td\",\n {\n ref,\n className: cn(\"p-4 align-middle [&:has([role=checkbox])]:pr-0\", className),\n ...props\n }\n));\nTableCell.displayName = \"TableCell\";\nvar TableCaption = React22.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx26(\n \"caption\",\n {\n ref,\n className: cn(\"mt-4 text-sm text-muted-foreground\", className),\n ...props\n }\n));\nTableCaption.displayName = \"TableCaption\";\n\n// src/components/atoms/ui/progress.tsx\nimport * as React23 from \"react\";\nimport * as ProgressPrimitive from \"@radix-ui/react-progress\";\nimport { jsx as jsx27 } from \"react/jsx-runtime\";\nvar Progress = React23.forwardRef(({ className, value, ...props }, ref) => /* @__PURE__ */ jsx27(\n ProgressPrimitive.Root,\n {\n ref,\n className: cn(\"relative h-2 w-full overflow-hidden rounded-full bg-muted\", className),\n ...props,\n children: /* @__PURE__ */ jsx27(\n ProgressPrimitive.Indicator,\n {\n className: \"h-full w-full flex-1 bg-primary transition-all\",\n style: { transform: `translateX(-${100 - (value || 0)}%)` }\n }\n )\n }\n));\nProgress.displayName = ProgressPrimitive.Root.displayName;\n\n// src/components/atoms/ui/chart.tsx\nimport { ResponsiveContainer, CartesianGrid, XAxis, YAxis, Tooltip, Legend } from \"recharts\";\nimport { Fragment as Fragment5, jsx as jsx28, jsxs as jsxs10 } from \"react/jsx-runtime\";\nvar CHART_PALETTE = [\n \"hsl(var(--chart-1))\",\n \"hsl(var(--chart-2))\",\n \"hsl(var(--chart-3))\",\n \"hsl(var(--chart-4))\",\n \"hsl(var(--chart-5))\"\n];\nfunction Chart({ className, height = 300, children }) {\n return /* @__PURE__ */ jsx28(\"div\", { className: cn(\"w-full\", className), style: { height }, children: /* @__PURE__ */ jsx28(ResponsiveContainer, { width: \"100%\", height: \"100%\", children }) });\n}\nChart.displayName = \"Chart\";\nfunction themedChartAxes(x) {\n return /* @__PURE__ */ jsxs10(Fragment5, { children: [\n /* @__PURE__ */ jsx28(CartesianGrid, { strokeDasharray: \"3 3\", className: \"stroke-border\" }),\n /* @__PURE__ */ jsx28(XAxis, { dataKey: x, className: \"text-xs\" }),\n /* @__PURE__ */ jsx28(YAxis, { className: \"text-xs\" }),\n /* @__PURE__ */ jsx28(Tooltip, {}),\n /* @__PURE__ */ jsx28(Legend, {})\n ] });\n}\n\n// src/components/genui/components/data.tsx\nimport { jsx as jsx29, jsxs as jsxs11 } from \"react/jsx-runtime\";\nvar PALETTE = CHART_PALETTE;\nvar TableNode = ({ node, value, onAction }) => {\n const data = Array.isArray(value) ? value : Array.isArray(node.rows) ? node.rows : Array.isArray(node.data) ? node.data : [];\n let cols = (Array.isArray(node.columns) ? node.columns : []).map(\n (c) => typeof c === \"string\" ? { key: c, header: c } : c\n );\n if (!cols.some((c) => c.key) && data.length) {\n cols = Object.keys(data[0]).map((k) => ({ key: k, header: k }));\n }\n const sortable = node.sortable === true;\n const [sorting, setSorting] = React24.useState([]);\n const columns = React24.useMemo(\n () => cols.map((c, i) => {\n const id = String(c.key ?? `col_${i}`);\n const header = String(c.header ?? c.key ?? `Column ${i + 1}`);\n return c.key ? { id, accessorKey: c.key, header } : { id, accessorFn: () => \"\", header };\n }),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [node]\n );\n const table = useReactTable({\n data,\n columns,\n state: { sorting },\n onSortingChange: setSorting,\n getCoreRowModel: getCoreRowModel(),\n getSortedRowModel: getSortedRowModel(),\n enableSorting: sortable\n });\n return /* @__PURE__ */ jsxs11(Table, { className: styleProps(node), children: [\n /* @__PURE__ */ jsx29(TableHeader, { children: table.getHeaderGroups().map((hg) => /* @__PURE__ */ jsx29(TableRow, { children: hg.headers.map((h) => /* @__PURE__ */ jsx29(TableHead, { children: sortable ? /* @__PURE__ */ jsx29(\n \"button\",\n {\n type: \"button\",\n onClick: () => {\n h.column.toggleSorting();\n onAction?.({ name: \"sort\", wantResponse: false });\n },\n children: flexRender(h.column.columnDef.header, h.getContext())\n }\n ) : flexRender(h.column.columnDef.header, h.getContext()) }, h.id)) }, hg.id)) }),\n /* @__PURE__ */ jsx29(TableBody, { children: table.getRowModel().rows.map((r) => /* @__PURE__ */ jsx29(TableRow, { children: r.getVisibleCells().map((c) => /* @__PURE__ */ jsx29(TableCell, { children: String(c.getValue() ?? \"\") }, c.id)) }, r.id)) })\n ] });\n};\nvar ChartNode = ({ node, value }) => {\n const data = Array.isArray(value) ? value : Array.isArray(node.data) ? node.data : [];\n let series = (Array.isArray(node.series) ? node.series : []).map(\n (s) => typeof s === \"string\" ? { key: s } : s\n );\n const first = data[0] ?? {};\n const x = String(node.x ?? Object.keys(first).find((k) => typeof first[k] !== \"number\") ?? \"\");\n if (!series.length && data.length) {\n series = Object.keys(first).filter((k) => k !== x && typeof first[k] === \"number\").map((k) => ({ key: k }));\n }\n const kind = String(node.kind ?? \"bar\");\n if (!data.length || !series.length) {\n return /* @__PURE__ */ jsx29(\"p\", { className: \"text-muted-foreground text-sm\", children: \"No data to display\" });\n }\n const axes = themedChartAxes(x);\n return /* @__PURE__ */ jsxs11(\"div\", { className: cn(\"w-full\", styleProps(node)), children: [\n typeof node.title === \"string\" && /* @__PURE__ */ jsx29(\"p\", { className: \"mb-2 font-medium\", children: node.title }),\n /* @__PURE__ */ jsx29(Chart, { height: 300, children: kind === \"line\" ? /* @__PURE__ */ jsxs11(LineChart, { data, children: [\n axes,\n series.map((s, i) => /* @__PURE__ */ jsx29(Line, { dataKey: s.key, name: s.label ?? s.key, stroke: PALETTE[i % PALETTE.length] }, s.key))\n ] }) : kind === \"area\" ? /* @__PURE__ */ jsxs11(AreaChart, { data, children: [\n axes,\n series.map((s, i) => /* @__PURE__ */ jsx29(\n Area,\n {\n dataKey: s.key,\n name: s.label ?? s.key,\n stroke: PALETTE[i % PALETTE.length],\n fill: PALETTE[i % PALETTE.length],\n fillOpacity: 0.2\n },\n s.key\n ))\n ] }) : kind === \"pie\" ? /* @__PURE__ */ jsxs11(PieChart, { children: [\n /* @__PURE__ */ jsx29(Tooltip2, {}),\n /* @__PURE__ */ jsx29(Legend2, {}),\n /* @__PURE__ */ jsx29(Pie, { data, dataKey: series[0].key, nameKey: x, label: true, children: data.map((_, i) => /* @__PURE__ */ jsx29(Cell, { fill: PALETTE[i % PALETTE.length] }, i)) })\n ] }) : /* @__PURE__ */ jsxs11(BarChart, { data, children: [\n axes,\n series.map((s, i) => /* @__PURE__ */ jsx29(Bar, { dataKey: s.key, name: s.label ?? s.key, fill: PALETTE[i % PALETTE.length] }, s.key))\n ] }) })\n ] });\n};\nvar Progress2 = ({ node }) => {\n const max = typeof node.max === \"number\" && node.max > 0 ? node.max : 100;\n const value = typeof node.value === \"number\" ? Math.min(Math.max(node.value, 0), max) : 0;\n const pct = Math.round(value / max * 100);\n return /* @__PURE__ */ jsxs11(\"div\", { className: cn(\"flex flex-col gap-1\", styleProps(node)), children: [\n typeof node.label === \"string\" && /* @__PURE__ */ jsxs11(\"div\", { className: \"flex justify-between text-sm text-muted-foreground\", children: [\n /* @__PURE__ */ jsx29(\"span\", { children: node.label }),\n /* @__PURE__ */ jsxs11(\"span\", { children: [\n pct,\n \"%\"\n ] })\n ] }),\n /* @__PURE__ */ jsx29(Progress, { value: pct })\n ] });\n};\nvar Timeline = ({ node }) => {\n const items = Array.isArray(node.items) ? node.items : [];\n return /* @__PURE__ */ jsx29(\"ol\", { className: cn(\"relative ml-2 border-l border-border\", styleProps(node)), children: items.map((it, i) => /* @__PURE__ */ jsxs11(\"li\", { className: \"mb-4 ml-4\", children: [\n /* @__PURE__ */ jsx29(\"span\", { className: \"absolute -left-1.5 mt-1 h-3 w-3 rounded-full bg-primary\" }),\n /* @__PURE__ */ jsx29(\"div\", { className: \"text-sm font-medium text-foreground\", children: it.title }),\n it.timestamp && /* @__PURE__ */ jsx29(\"div\", { className: \"text-xs text-muted-foreground\", children: it.timestamp }),\n it.description && /* @__PURE__ */ jsx29(\"div\", { className: \"text-sm text-muted-foreground\", children: it.description })\n ] }, i)) });\n};\n\n// src/components/genui/components/actions.tsx\nimport { jsx as jsx30 } from \"react/jsx-runtime\";\nvar BUTTON_VARIANT = {\n solid: \"default\",\n outline: \"outline\",\n ghost: \"ghost\",\n link: \"link\"\n};\nvar BUTTON_SIZE = { sm: \"sm\", lg: \"lg\" };\nvar ButtonNode = ({ node, onAction }) => {\n const caption = node.text ?? node.label ?? node.title ?? \"\";\n return /* @__PURE__ */ jsx30(\n Button,\n {\n variant: BUTTON_VARIANT[String(node.variant ?? \"solid\")] ?? \"default\",\n size: typeof node.size === \"string\" ? BUTTON_SIZE[node.size] : void 0,\n className: node.emphasis === \"high\" ? \"font-semibold\" : void 0,\n onClick: () => node.action && onAction?.(node.action),\n children: String(caption)\n }\n );\n};\nvar ButtonGroup = ({ node, children }) => /* @__PURE__ */ jsx30(\"div\", { className: cn(\"flex flex-row gap-2\", styleProps(node)), children });\nvar SAFE_HREF = /^(\\/|https:\\/\\/)/i;\nvar LinkNode = ({ node }) => {\n const href = typeof node.href === \"string\" && SAFE_HREF.test(node.href) ? node.href : void 0;\n const text = String(node.text ?? \"\");\n if (!href) return /* @__PURE__ */ jsx30(\"span\", { className: cn(\"text-muted-foreground\", styleProps(node)), children: text });\n return /* @__PURE__ */ jsx30(\n \"a\",\n {\n href,\n target: \"_blank\",\n rel: \"noopener noreferrer\",\n className: cn(\"text-primary underline underline-offset-2\", styleProps(node)),\n children: text\n }\n );\n};\n\n// src/components/genui/registry.tsx\nvar coreUiRegistry = {\n // layout\n Stack,\n Row,\n Column,\n Grid,\n Divider,\n Spacer,\n Card: CardNode,\n Tabs: TabsNode,\n Accordion: AccordionNode,\n // content\n Text,\n Heading,\n Markdown,\n Image: ImageNode,\n Icon: IconNode,\n Badge: BadgeNode,\n Avatar: AvatarNode,\n Alert: AlertNode,\n Stat,\n KeyValue: KeyValueNode,\n List: ListNode,\n Quote,\n // inputs\n TextField,\n TextArea,\n NumberField,\n Select: SelectNode,\n MultiSelect,\n Combobox,\n Checkbox: CheckboxNode,\n CheckboxGroup,\n Radio,\n Switch: SwitchNode,\n Slider: SliderNode,\n DatePicker,\n DateRange,\n FileUpload,\n Rating,\n // data\n Table: TableNode,\n Chart: ChartNode,\n Progress: Progress2,\n Timeline,\n // actions\n Button: ButtonNode,\n ButtonGroup,\n Link: LinkNode\n};\n\n// src/components/genui/assistant-chat.tsx\nimport * as React44 from \"react\";\nimport { Check as Check4 } from \"lucide-react\";\n\n// src/components/organisms/assistant.tsx\nimport * as React42 from \"react\";\nimport { useCallback as useCallback3, useEffect as useEffect10, useRef as useRef2, useState as useState13 } from \"react\";\n\n// src/components/atoms/ui/scroll-area.tsx\nimport * as React25 from \"react\";\nimport * as ScrollAreaPrimitive from \"@radix-ui/react-scroll-area\";\nimport { jsx as jsx31, jsxs as jsxs12 } from \"react/jsx-runtime\";\nvar ScrollArea = React25.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs12(\n ScrollAreaPrimitive.Root,\n {\n ref,\n className: cn(\"relative overflow-hidden\", className),\n ...props,\n children: [\n /* @__PURE__ */ jsx31(ScrollAreaPrimitive.Viewport, { className: \"h-full w-full rounded-[inherit]\", children }),\n /* @__PURE__ */ jsx31(ScrollBar, {}),\n /* @__PURE__ */ jsx31(ScrollAreaPrimitive.Corner, {})\n ]\n }\n));\nScrollArea.displayName = ScrollAreaPrimitive.Root.displayName;\nvar ScrollBar = React25.forwardRef(({ className, orientation = \"vertical\", ...props }, ref) => /* @__PURE__ */ jsx31(\n ScrollAreaPrimitive.ScrollAreaScrollbar,\n {\n ref,\n orientation,\n className: cn(\n \"flex touch-none select-none transition-colors\",\n orientation === \"vertical\" && \"h-full w-2.5 border-l border-l-transparent p-[1px]\",\n orientation === \"horizontal\" && \"h-2.5 flex-col border-t border-t-transparent p-[1px]\",\n className\n ),\n ...props,\n children: /* @__PURE__ */ jsx31(ScrollAreaPrimitive.ScrollAreaThumb, { className: \"relative flex-1 rounded-full bg-border\" })\n }\n));\nScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName;\n\n// src/components/atoms/ui/skeleton.tsx\nimport { jsx as jsx32 } from \"react/jsx-runtime\";\n\n// src/components/atoms/ui/drawer.tsx\nimport * as React26 from \"react\";\nimport { Drawer as DrawerPrimitive } from \"vaul\";\nimport { jsx as jsx33, jsxs as jsxs13 } from \"react/jsx-runtime\";\nvar Drawer = ({\n shouldScaleBackground = true,\n ...props\n}) => /* @__PURE__ */ jsx33(\n DrawerPrimitive.Root,\n {\n shouldScaleBackground,\n ...props\n }\n);\nDrawer.displayName = \"Drawer\";\nvar DrawerTrigger = DrawerPrimitive.Trigger;\nvar DrawerPortal = DrawerPrimitive.Portal;\nvar DrawerClose = DrawerPrimitive.Close;\nvar DrawerOverlay = React26.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx33(\n DrawerPrimitive.Overlay,\n {\n ref,\n className: cn(\"fixed inset-0 z-50 bg-black/80\", className),\n ...props\n }\n));\nDrawerOverlay.displayName = DrawerPrimitive.Overlay.displayName;\nvar DrawerContent = React26.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs13(DrawerPortal, { children: [\n /* @__PURE__ */ jsx33(DrawerOverlay, {}),\n /* @__PURE__ */ jsxs13(\n DrawerPrimitive.Content,\n {\n ref,\n className: cn(\n \"fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border border-border bg-background text-foreground alq--drawer-content\",\n className\n ),\n ...props,\n children: [\n /* @__PURE__ */ jsx33(\"div\", { className: \"mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted\" }),\n children\n ]\n }\n )\n] }));\nDrawerContent.displayName = \"DrawerContent\";\nvar DrawerHeader = ({\n className,\n ...props\n}) => /* @__PURE__ */ jsx33(\n \"div\",\n {\n className: cn(\"grid gap-1.5 p-4 text-center sm:text-left\", className, \"alq--drawer-header\"),\n ...props\n }\n);\nDrawerHeader.displayName = \"DrawerHeader\";\nvar DrawerFooter = ({\n className,\n ...props\n}) => /* @__PURE__ */ jsx33(\n \"div\",\n {\n className: cn(\"mt-auto flex flex-col gap-2 p-4\", className, \"alq--drawer-footer\"),\n ...props\n }\n);\nDrawerFooter.displayName = \"DrawerFooter\";\nvar DrawerTitle = React26.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx33(\n DrawerPrimitive.Title,\n {\n ref,\n className: cn(\n \"text-lg font-semibold leading-none tracking-tight\",\n className,\n \"alq--drawer-title\"\n ),\n ...props\n }\n));\nDrawerTitle.displayName = DrawerPrimitive.Title.displayName;\nvar DrawerDescription = React26.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx33(\n DrawerPrimitive.Description,\n {\n ref,\n className: cn(\"text-sm text-muted-foreground\", className, \"alq--drawer-description\"),\n ...props\n }\n));\nDrawerDescription.displayName = DrawerPrimitive.Description.displayName;\n\n// src/components/atoms/ui/typography/index.tsx\nimport { forwardRef as forwardRef23 } from \"react\";\nimport { jsx as jsx34 } from \"react/jsx-runtime\";\nvar Typography = forwardRef23(\n ({ as: Component = \"p\", typeStyle, ...props }, ref) => {\n return /* @__PURE__ */ jsx34(\n Component,\n {\n ...props,\n className: cn(props.className, `alq--typography-${typeStyle}`),\n ref\n }\n );\n }\n);\nTypography.displayName = \"Typography\";\n\n// src/components/atoms/ui/toggle.tsx\nimport * as React27 from \"react\";\nimport * as TogglePrimitive from \"@radix-ui/react-toggle\";\nimport { cva as cva5 } from \"class-variance-authority\";\nimport { jsx as jsx35 } from \"react/jsx-runtime\";\nvar toggleVariants = cva5(\n \"inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground\",\n {\n variants: {\n variant: {\n default: \"bg-transparent\",\n outline: \"border border-input bg-transparent hover:bg-accent hover:text-accent-foreground\"\n },\n size: {\n default: \"h-10 px-3\",\n sm: \"h-9 px-2.5\",\n lg: \"h-11 px-5\"\n }\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\"\n }\n }\n);\nvar Toggle = React27.forwardRef(({ className, variant, size, ...props }, ref) => /* @__PURE__ */ jsx35(\n TogglePrimitive.Root,\n {\n ref,\n className: cn(toggleVariants({ variant, size, className }), \"alq--toggle\"),\n ...props\n }\n));\nToggle.displayName = TogglePrimitive.Root.displayName;\n\n// src/components/atoms/ui/aspect-ratio.tsx\nimport * as AspectRatioPrimitive from \"@radix-ui/react-aspect-ratio\";\n\n// src/components/atoms/ui/breadcrumb.tsx\nimport * as React28 from \"react\";\nimport { Slot as Slot2 } from \"@radix-ui/react-slot\";\nimport { ChevronRight as ChevronRight2, MoreHorizontal } from \"lucide-react\";\nimport { jsx as jsx36, jsxs as jsxs14 } from \"react/jsx-runtime\";\nvar Breadcrumb = React28.forwardRef(({ ...props }, ref) => /* @__PURE__ */ jsx36(\"nav\", { ref, \"aria-label\": \"breadcrumb\", ...props }));\nBreadcrumb.displayName = \"Breadcrumb\";\nvar BreadcrumbList = React28.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx36(\n \"ol\",\n {\n ref,\n className: cn(\n \"flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5\",\n className\n ),\n ...props\n }\n));\nBreadcrumbList.displayName = \"BreadcrumbList\";\nvar BreadcrumbItem = React28.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx36(\n \"li\",\n {\n ref,\n className: cn(\"inline-flex items-center gap-1.5\", className),\n ...props\n }\n));\nBreadcrumbItem.displayName = \"BreadcrumbItem\";\nvar BreadcrumbLink = React28.forwardRef(({ asChild, className, ...props }, ref) => {\n const Comp = asChild ? Slot2 : \"a\";\n return /* @__PURE__ */ jsx36(\n Comp,\n {\n ref,\n className: cn(\"transition-colors hover:text-foreground\", className),\n ...props\n }\n );\n});\nBreadcrumbLink.displayName = \"BreadcrumbLink\";\nvar BreadcrumbPage = React28.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx36(\n \"span\",\n {\n ref,\n role: \"link\",\n \"aria-disabled\": \"true\",\n \"aria-current\": \"page\",\n className: cn(\"font-normal text-foreground\", className),\n ...props\n }\n));\nBreadcrumbPage.displayName = \"BreadcrumbPage\";\nvar BreadcrumbSeparator = ({\n children,\n className,\n ...props\n}) => /* @__PURE__ */ jsx36(\n \"li\",\n {\n role: \"presentation\",\n \"aria-hidden\": \"true\",\n className: cn(\"[&>svg]:w-3.5 [&>svg]:h-3.5\", className),\n ...props,\n children: children ?? /* @__PURE__ */ jsx36(ChevronRight2, {})\n }\n);\nBreadcrumbSeparator.displayName = \"BreadcrumbSeparator\";\nvar BreadcrumbEllipsis = ({\n className,\n ...props\n}) => /* @__PURE__ */ jsxs14(\n \"span\",\n {\n role: \"presentation\",\n \"aria-hidden\": \"true\",\n className: cn(\"flex h-9 w-9 items-center justify-center\", className),\n ...props,\n children: [\n /* @__PURE__ */ jsx36(MoreHorizontal, { className: \"h-4 w-4\" }),\n /* @__PURE__ */ jsx36(\"span\", { className: \"sr-only\", children: \"More\" })\n ]\n }\n);\nBreadcrumbEllipsis.displayName = \"BreadcrumbElipssis\";\n\n// src/components/molecules/alert-dialog.tsx\nimport * as React29 from \"react\";\nimport * as AlertDialogPrimitive from \"@radix-ui/react-alert-dialog\";\nimport { jsx as jsx37, jsxs as jsxs15 } from \"react/jsx-runtime\";\nvar AlertDialogPortal = AlertDialogPrimitive.Portal;\nvar AlertDialogOverlay = React29.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx37(\n AlertDialogPrimitive.Overlay,\n {\n className: cn(\n \"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0\",\n className\n ),\n ...props,\n ref\n }\n));\nAlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName;\nvar AlertDialogContent = React29.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxs15(AlertDialogPortal, { children: [\n /* @__PURE__ */ jsx37(AlertDialogOverlay, {}),\n /* @__PURE__ */ jsx37(\n AlertDialogPrimitive.Content,\n {\n ref,\n className: cn(\n \"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg\",\n className\n ),\n ...props\n }\n )\n] }));\nAlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName;\nvar AlertDialogHeader = ({\n className,\n ...props\n}) => /* @__PURE__ */ jsx37(\n \"div\",\n {\n className: cn(\n \"flex flex-col space-y-2 text-center sm:text-left\",\n className\n ),\n ...props\n }\n);\nAlertDialogHeader.displayName = \"AlertDialogHeader\";\nvar AlertDialogFooter = ({\n className,\n ...props\n}) => /* @__PURE__ */ jsx37(\n \"div\",\n {\n className: cn(\n \"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2\",\n className\n ),\n ...props\n }\n);\nAlertDialogFooter.displayName = \"AlertDialogFooter\";\nvar AlertDialogTitle = React29.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx37(\n AlertDialogPrimitive.Title,\n {\n ref,\n className: cn(\"text-lg font-semibold\", className),\n ...props\n }\n));\nAlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName;\nvar AlertDialogDescription = React29.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx37(\n AlertDialogPrimitive.Description,\n {\n ref,\n className: cn(\"text-sm text-muted-foreground\", className),\n ...props\n }\n));\nAlertDialogDescription.displayName = AlertDialogPrimitive.Description.displayName;\nvar AlertDialogAction = React29.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx37(\n AlertDialogPrimitive.Action,\n {\n ref,\n className: cn(buttonVariants(), className),\n ...props\n }\n));\nAlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName;\nvar AlertDialogCancel = React29.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx37(\n AlertDialogPrimitive.Cancel,\n {\n ref,\n className: cn(\n buttonVariants({ variant: \"outline\" }),\n \"mt-2 sm:mt-0\",\n className\n ),\n ...props\n }\n));\nAlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName;\n\n// src/components/atoms/ui/toast.tsx\nimport * as React30 from \"react\";\nimport * as ToastPrimitives from \"@radix-ui/react-toast\";\nimport { cva as cva6 } from \"class-variance-authority\";\nimport { X as X2 } from \"lucide-react\";\nimport { jsx as jsx38 } from \"react/jsx-runtime\";\nvar ToastViewport = React30.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx38(\n ToastPrimitives.Viewport,\n {\n ref,\n className: cn(\n \"fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]\",\n className\n ),\n ...props\n }\n));\nToastViewport.displayName = ToastPrimitives.Viewport.displayName;\nvar toastVariants = cva6(\n \"group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full\",\n {\n variants: {\n variant: {\n default: \"border bg-background text-foreground\",\n destructive: \"destructive group border-destructive bg-destructive text-destructive-foreground\"\n }\n },\n defaultVariants: {\n variant: \"default\"\n }\n }\n);\nvar Toast = React30.forwardRef(({ className, variant, ...props }, ref) => {\n return /* @__PURE__ */ jsx38(\n ToastPrimitives.Root,\n {\n ref,\n className: cn(toastVariants({ variant }), className),\n ...props\n }\n );\n});\nToast.displayName = ToastPrimitives.Root.displayName;\nvar ToastAction = React30.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx38(\n ToastPrimitives.Action,\n {\n ref,\n className: cn(\n \"inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive\",\n className\n ),\n ...props\n }\n));\nToastAction.displayName = ToastPrimitives.Action.displayName;\nvar ToastClose = React30.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx38(\n ToastPrimitives.Close,\n {\n ref,\n className: cn(\n \"absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600\",\n className\n ),\n \"toast-close\": \"\",\n ...props,\n children: /* @__PURE__ */ jsx38(X2, { className: \"h-4 w-4\" })\n }\n));\nToastClose.displayName = ToastPrimitives.Close.displayName;\nvar ToastTitle = React30.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx38(\n ToastPrimitives.Title,\n {\n ref,\n className: cn(\"text-sm font-semibold\", className),\n ...props\n }\n));\nToastTitle.displayName = ToastPrimitives.Title.displayName;\nvar ToastDescription = React30.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx38(\n ToastPrimitives.Description,\n {\n ref,\n className: cn(\"text-sm opacity-90\", className),\n ...props\n }\n));\nToastDescription.displayName = ToastPrimitives.Description.displayName;\n\n// src/components/atoms/ui/loader.tsx\nimport * as React31 from \"react\";\nimport { cva as cva7 } from \"class-variance-authority\";\nimport { Loader2 } from \"lucide-react\";\nimport { jsx as jsx39 } from \"react/jsx-runtime\";\nvar loaderVariants = cva7(\n \"flex justify-center items-center w-full\",\n {\n variants: {\n size: {\n small: \"h-6 w-6\",\n medium: \"h-8 w-8\",\n large: \"h-12 w-12\",\n xl: \"h-24 w-24\"\n },\n colorVariant: {\n default: \"text-primary\",\n primary: \"text-primary\",\n secondary: \"text-secondary\",\n destructive: \"text-destructive\"\n }\n },\n defaultVariants: {\n size: \"medium\",\n colorVariant: \"default\"\n }\n }\n);\nvar Loader = React31.forwardRef(\n ({ className, size, colorVariant, ...props }, ref) => /* @__PURE__ */ jsx39(\n \"div\",\n {\n ref,\n className: cn(loaderVariants({ size, colorVariant }), \"flex justify-center items-center h-full w-full\", className),\n ...props,\n children: /* @__PURE__ */ jsx39(Loader2, { className: \"animate-spin\" })\n }\n )\n);\nLoader.displayName = \"Loader\";\n\n// src/components/hooks/use-toast.ts\nimport * as React32 from \"react\";\n\n// src/components/atoms/ui/toaster.tsx\nimport { jsx as jsx40, jsxs as jsxs16 } from \"react/jsx-runtime\";\n\n// src/components/atoms/ui/think-indicator.tsx\nimport * as React33 from \"react\";\nimport { useState as useState5, useEffect as useEffect3 } from \"react\";\nimport { cva as cva8 } from \"class-variance-authority\";\nimport { jsx as jsx41, jsxs as jsxs17 } from \"react/jsx-runtime\";\nvar thinkIndicatorVariants = cva8(\n \"flex items-center gap-3\",\n {\n variants: {\n variant: {\n default: \"text-muted-foreground\",\n primary: \"text-primary\",\n secondary: \"text-secondary\"\n },\n size: {\n default: \"gap-3\",\n sm: \"gap-2\",\n lg: \"gap-4\"\n }\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\"\n }\n }\n);\nvar ThinkIndicator = React33.forwardRef(\n ({\n className,\n variant,\n size,\n thoughts = [\n \"Analyzing your request...\",\n \"Processing information...\",\n \"Formulating response...\"\n ],\n interval = 5e3,\n loader,\n ...props\n }, ref) => {\n const [currentThoughtIndex, setCurrentThoughtIndex] = useState5(0);\n const [isAnimating, setIsAnimating] = useState5(false);\n useEffect3(() => {\n const timer = setInterval(() => {\n setIsAnimating(true);\n setTimeout(() => {\n setCurrentThoughtIndex((prev) => {\n return prev < thoughts.length - 1 ? prev + 1 : prev;\n });\n setIsAnimating(false);\n }, 300);\n }, interval);\n if (currentThoughtIndex === thoughts.length - 1) {\n clearInterval(timer);\n }\n return () => clearInterval(timer);\n }, [thoughts, interval, currentThoughtIndex]);\n return /* @__PURE__ */ jsxs17(\n \"div\",\n {\n ref,\n className: cn(thinkIndicatorVariants({ variant, size }), className, \"alq--think-indicator\"),\n ...props,\n children: [\n loader || /* @__PURE__ */ jsx41(\n Loader,\n {\n className: cn(\n size === \"sm\" ? \"h-3 w-3\" : size === \"lg\" ? \"h-5 w-5\" : \"h-4 w-4\"\n )\n }\n ),\n /* @__PURE__ */ jsx41(\n \"div\",\n {\n className: cn(\n \"alq--think-indicator-text\",\n \"transition-all duration-300\",\n isAnimating ? \"opacity-0 -translate-y-2\" : \"opacity-100 translate-y-0\"\n ),\n children: thoughts[currentThoughtIndex]\n }\n )\n ]\n }\n );\n }\n);\nThinkIndicator.displayName = \"ThinkIndicator\";\n\n// src/components/molecules/page-container.tsx\nimport { forwardRef as forwardRef30 } from \"react\";\nimport { jsx as jsx42 } from \"react/jsx-runtime\";\nvar PageContainer = forwardRef30(\n ({ className, ...props }, ref) => {\n return /* @__PURE__ */ jsx42(\n \"div\",\n {\n ref,\n className: cn(className, \"alq--page-container\"),\n ...props\n }\n );\n }\n);\nPageContainer.displayName = \"PageContainer\";\n\n// src/components/molecules/assistant-button.tsx\nimport * as React34 from \"react\";\nimport { useState as useState6 } from \"react\";\nimport { jsx as jsx43, jsxs as jsxs18 } from \"react/jsx-runtime\";\nvar AssistantSuggestions = React34.forwardRef(({ suggestions, showSuggestions, className }, ref) => {\n return /* @__PURE__ */ jsx43(\n \"div\",\n {\n ref,\n className: cn(\n \"absolute bottom-[calc(100%+0.5rem)] right-0 pb-2 mb-4 alq--assistant-suggestions-container\",\n \"transition-all duration-300\",\n showSuggestions ? \"opacity-100 translate-y-0\" : \"opacity-0 translate-y-4\",\n className\n ),\n children: /* @__PURE__ */ jsx43(\"div\", { className: \"rounded-lg p-2 pr-0 w-64\", children: suggestions.map((suggestion, index) => /* @__PURE__ */ jsxs18(\n \"button\",\n {\n onClick: () => suggestion.action?.(),\n style: {\n transitionDelay: showSuggestions ? `${index * 50}ms` : \"0ms\"\n },\n className: cn(\n \"bg-background flex items-center gap-2 border p-2 pr-4 my-2 rounded-full ml-auto\",\n \"text-primary hover:bg-secondary\",\n \"transition-all duration-100\",\n \"origin-bottom w-fit\",\n \"alq--assistant-suggestion\",\n showSuggestions ? \"opacity-100 translate-y-0\" : \"opacity-0 translate-y-4\"\n ),\n children: [\n /* @__PURE__ */ jsx43(suggestion.icon, { className: \"w-5 h-5 text-primary\" }),\n /* @__PURE__ */ jsx43(\"span\", { className: \"text-xs whitespace-nowrap font-normal\", children: suggestion.label })\n ]\n },\n index\n )) })\n }\n );\n});\nAssistantSuggestions.displayName = \"Suggestions\";\nvar AssistantButton = React34.forwardRef(\n ({\n icon: Icon2,\n clickAction,\n className,\n suggestions = []\n }, ref) => {\n const [isVisible, setIsVisible] = useState6(false);\n const [showSuggestions, setShowSuggestions] = useState6(false);\n const handleMouseEnter = () => {\n setIsVisible(true);\n requestAnimationFrame(() => {\n requestAnimationFrame(() => {\n setShowSuggestions(true);\n });\n });\n };\n const handleMouseLeave = () => {\n setShowSuggestions(false);\n setTimeout(() => setIsVisible(false), 300);\n };\n return /* @__PURE__ */ jsx43(\n \"div\",\n {\n ref,\n className: cn(\n \"fixed bottom-8 right-4 z-50\",\n \"alq--assistant-button-container\",\n className\n ),\n onMouseEnter: handleMouseEnter,\n onMouseLeave: handleMouseLeave,\n children: /* @__PURE__ */ jsxs18(\"div\", { className: \"relative group\", children: [\n isVisible && suggestions.length > 0 && /* @__PURE__ */ jsx43(\n AssistantSuggestions,\n {\n suggestions,\n showSuggestions\n }\n ),\n /* @__PURE__ */ jsx43(\n Button,\n {\n variant: \"outline\",\n size: \"sm\",\n className: cn(\n \"fixed hover:bg-opacity-70 transition-all duration-300\",\n \"bottom-4 h-12 w-12 right-4 z-50 rounded-full p-2\",\n \"shadow-md\",\n \"hover:shadow-lg\",\n showSuggestions ? \"scale-110\" : \"hover:scale-105\",\n \"alq--assistant-button\"\n ),\n onClick: clickAction,\n children: /* @__PURE__ */ jsx43(\n Icon2,\n {\n style: { width: \"22px\", height: \"22px\" },\n className: \"text-primary\"\n }\n )\n }\n )\n ] })\n }\n );\n }\n);\nAssistantButton.displayName = \"AssistantButton\";\n\n// src/components/molecules/carousel.tsx\nimport * as React35 from \"react\";\nimport useEmblaCarousel from \"embla-carousel-react\";\nimport { ArrowLeft, ArrowRight } from \"lucide-react\";\nimport { jsx as jsx44, jsxs as jsxs19 } from \"react/jsx-runtime\";\nvar CarouselContext = React35.createContext(null);\nfunction useCarousel() {\n const context = React35.useContext(CarouselContext);\n if (!context) {\n throw new Error(\"useCarousel must be used within a <Carousel />\");\n }\n return context;\n}\nvar Carousel = React35.forwardRef(\n ({\n orientation = \"horizontal\",\n opts: opts2,\n setApi,\n plugins,\n className,\n children,\n ...props\n }, ref) => {\n const [carouselRef, api] = useEmblaCarousel(\n {\n ...opts2,\n axis: orientation === \"horizontal\" ? \"x\" : \"y\"\n },\n plugins\n );\n const [canScrollPrev, setCanScrollPrev] = React35.useState(false);\n const [canScrollNext, setCanScrollNext] = React35.useState(false);\n const onSelect = React35.useCallback((api2) => {\n if (!api2) {\n return;\n }\n setCanScrollPrev(api2.canScrollPrev());\n setCanScrollNext(api2.canScrollNext());\n }, []);\n const scrollPrev = React35.useCallback(() => {\n api?.scrollPrev();\n }, [api]);\n const scrollNext = React35.useCallback(() => {\n api?.scrollNext();\n }, [api]);\n const handleKeyDown = React35.useCallback(\n (event) => {\n if (event.key === \"ArrowLeft\") {\n event.preventDefault();\n scrollPrev();\n } else if (event.key === \"ArrowRight\") {\n event.preventDefault();\n scrollNext();\n }\n },\n [scrollPrev, scrollNext]\n );\n React35.useEffect(() => {\n if (!api || !setApi) {\n return;\n }\n setApi(api);\n }, [api, setApi]);\n React35.useEffect(() => {\n if (!api) {\n return;\n }\n onSelect(api);\n api.on(\"reInit\", onSelect);\n api.on(\"select\", onSelect);\n return () => {\n api?.off(\"select\", onSelect);\n };\n }, [api, onSelect]);\n return /* @__PURE__ */ jsx44(\n CarouselContext.Provider,\n {\n value: {\n carouselRef,\n api,\n opts: opts2,\n orientation: orientation || (opts2?.axis === \"y\" ? \"vertical\" : \"horizontal\"),\n scrollPrev,\n scrollNext,\n canScrollPrev,\n canScrollNext\n },\n children: /* @__PURE__ */ jsx44(\n \"div\",\n {\n ref,\n onKeyDownCapture: handleKeyDown,\n className: cn(\"relative\", className),\n role: \"region\",\n \"aria-roledescription\": \"carousel\",\n ...props,\n children\n }\n )\n }\n );\n }\n);\nCarousel.displayName = \"Carousel\";\nvar CarouselContent = React35.forwardRef(({ className, ...props }, ref) => {\n const { carouselRef, orientation } = useCarousel();\n return /* @__PURE__ */ jsx44(\"div\", { ref: carouselRef, className: \"overflow-hidden\", children: /* @__PURE__ */ jsx44(\n \"div\",\n {\n ref,\n className: cn(\n \"flex\",\n orientation === \"horizontal\" ? \"-ml-4\" : \"-mt-4 flex-col\",\n className\n ),\n ...props\n }\n ) });\n});\nCarouselContent.displayName = \"CarouselContent\";\nvar CarouselItem = React35.forwardRef(({ className, ...props }, ref) => {\n const { orientation } = useCarousel();\n return /* @__PURE__ */ jsx44(\n \"div\",\n {\n ref,\n role: \"group\",\n \"aria-roledescription\": \"slide\",\n className: cn(\n \"min-w-0 shrink-0 grow-0 basis-full\",\n orientation === \"horizontal\" ? \"pl-4\" : \"pt-4\",\n className\n ),\n ...props\n }\n );\n});\nCarouselItem.displayName = \"CarouselItem\";\nvar CarouselPrevious = React35.forwardRef(({ className, variant = \"outline\", size = \"icon\", ...props }, ref) => {\n const { orientation, scrollPrev, canScrollPrev } = useCarousel();\n return /* @__PURE__ */ jsxs19(\n Button,\n {\n ref,\n variant,\n size,\n className: cn(\n \"absolute h-8 w-8 rounded-full\",\n orientation === \"horizontal\" ? \"-left-12 top-1/2 -translate-y-1/2\" : \"-top-12 left-1/2 -translate-x-1/2 rotate-90\",\n className\n ),\n disabled: !canScrollPrev,\n onClick: scrollPrev,\n ...props,\n children: [\n /* @__PURE__ */ jsx44(ArrowLeft, { className: \"h-4 w-4\" }),\n /* @__PURE__ */ jsx44(\"span\", { className: \"sr-only\", children: \"Previous slide\" })\n ]\n }\n );\n});\nCarouselPrevious.displayName = \"CarouselPrevious\";\nvar CarouselNext = React35.forwardRef(({ className, variant = \"outline\", size = \"icon\", ...props }, ref) => {\n const { orientation, scrollNext, canScrollNext } = useCarousel();\n return /* @__PURE__ */ jsxs19(\n Button,\n {\n ref,\n variant,\n size,\n className: cn(\n \"absolute h-8 w-8 rounded-full\",\n orientation === \"horizontal\" ? \"-right-12 top-1/2 -translate-y-1/2\" : \"-bottom-12 left-1/2 -translate-x-1/2 rotate-90\",\n className\n ),\n disabled: !canScrollNext,\n onClick: scrollNext,\n ...props,\n children: [\n /* @__PURE__ */ jsx44(ArrowRight, { className: \"h-4 w-4\" }),\n /* @__PURE__ */ jsx44(\"span\", { className: \"sr-only\", children: \"Next slide\" })\n ]\n }\n );\n});\nCarouselNext.displayName = \"CarouselNext\";\n\n// src/components/molecules/navigation-menu.tsx\nimport * as React36 from \"react\";\nimport * as NavigationMenuPrimitive from \"@radix-ui/react-navigation-menu\";\nimport { cva as cva9 } from \"class-variance-authority\";\nimport { ChevronDown as ChevronDown3 } from \"lucide-react\";\nimport { jsx as jsx45, jsxs as jsxs20 } from \"react/jsx-runtime\";\nvar NavigationMenu = React36.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs20(\n NavigationMenuPrimitive.Root,\n {\n ref,\n className: cn(\n \"relative z-10 flex max-w-max flex-1 items-center justify-center\",\n className\n ),\n ...props,\n children: [\n children,\n /* @__PURE__ */ jsx45(NavigationMenuViewport, {})\n ]\n }\n));\nNavigationMenu.displayName = NavigationMenuPrimitive.Root.displayName;\nvar NavigationMenuList = React36.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx45(\n NavigationMenuPrimitive.List,\n {\n ref,\n className: cn(\n \"group flex flex-1 list-none items-center justify-center space-x-1\",\n className\n ),\n ...props\n }\n));\nNavigationMenuList.displayName = NavigationMenuPrimitive.List.displayName;\nvar navigationMenuTriggerStyle = cva9(\n \"group inline-flex h-10 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-none disabled:pointer-events-none disabled:opacity-50 data-[active]:bg-accent/50 data-[state=open]:bg-accent/50\"\n);\nvar NavigationMenuTrigger = React36.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs20(\n NavigationMenuPrimitive.Trigger,\n {\n ref,\n className: cn(navigationMenuTriggerStyle(), \"group\", className),\n ...props,\n children: [\n children,\n \" \",\n /* @__PURE__ */ jsx45(\n ChevronDown3,\n {\n className: \"relative top-[1px] ml-1 h-3 w-3 transition duration-200 group-data-[state=open]:rotate-180\",\n \"aria-hidden\": \"true\"\n }\n )\n ]\n }\n));\nNavigationMenuTrigger.displayName = NavigationMenuPrimitive.Trigger.displayName;\nvar NavigationMenuContent = React36.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx45(\n NavigationMenuPrimitive.Content,\n {\n ref,\n className: cn(\n \"left-0 top-0 w-full data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 md:absolute md:w-auto \",\n className\n ),\n ...props\n }\n));\nNavigationMenuContent.displayName = NavigationMenuPrimitive.Content.displayName;\nvar NavigationMenuViewport = React36.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx45(\"div\", { className: cn(\"absolute left-0 top-full flex justify-center\"), children: /* @__PURE__ */ jsx45(\n NavigationMenuPrimitive.Viewport,\n {\n className: cn(\n \"origin-top-center relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 md:w-[var(--radix-navigation-menu-viewport-width)]\",\n className\n ),\n ref,\n ...props\n }\n) }));\nNavigationMenuViewport.displayName = NavigationMenuPrimitive.Viewport.displayName;\nvar NavigationMenuIndicator = React36.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx45(\n NavigationMenuPrimitive.Indicator,\n {\n ref,\n className: cn(\n \"top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in\",\n className\n ),\n ...props,\n children: /* @__PURE__ */ jsx45(\"div\", { className: \"relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md\" })\n }\n));\nNavigationMenuIndicator.displayName = NavigationMenuPrimitive.Indicator.displayName;\n\n// src/components/molecules/sidebar.tsx\nimport * as React37 from \"react\";\nimport { cva as cva10 } from \"class-variance-authority\";\nimport { jsx as jsx46, jsxs as jsxs21 } from \"react/jsx-runtime\";\nvar sidebarVariants = cva10(\n \"flex flex-col border-r\",\n {\n variants: {\n size: {\n sm: \"w-48\",\n default: \"w-64\",\n lg: \"w-72\"\n }\n },\n defaultVariants: {\n size: \"default\"\n }\n }\n);\nvar SidebarFooter = React37.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsx46(\n \"div\",\n {\n ref,\n className: cn(\"p-4\", className),\n ...props,\n children\n }\n));\nSidebarFooter.displayName = \"SidebarFooter\";\nvar Sidebar = React37.forwardRef(\n ({\n className,\n items,\n selectedSection,\n onSelect,\n footerContent,\n size = \"default\",\n selectedVariant = \"secondary\",\n defaultVariant = \"ghost\",\n buttonClassName,\n ...props\n }, ref) => {\n return /* @__PURE__ */ jsx46(\"div\", { className: cn(className, \"alq--navigation-sidebar h-full\"), ref, ...props, children: /* @__PURE__ */ jsxs21(\"aside\", { className: cn(sidebarVariants({ size }), \"h-full\"), children: [\n /* @__PURE__ */ jsx46(ScrollArea, { className: \"flex-grow justify-between\", children: /* @__PURE__ */ jsx46(\"div\", { className: \"flex flex-col gap-2 p-4\", children: items.map((item) => /* @__PURE__ */ jsxs21(\n Button,\n {\n variant: selectedSection?.name === item.name ? selectedVariant : defaultVariant,\n className: cn(\"justify-start\", buttonClassName),\n disabled: item.disabled,\n onClick: () => {\n if (onSelect) {\n onSelect(item);\n }\n },\n children: [\n item.icon && /* @__PURE__ */ jsx46(item.icon, { className: \"mr-2 h-4 w-4\" }),\n item.name\n ]\n },\n item.name\n )) }) }),\n footerContent && /* @__PURE__ */ jsx46(SidebarFooter, { children: footerContent })\n ] }) });\n }\n);\n\n// src/components/molecules/sonner.tsx\nimport { Toaster as Sonner } from \"sonner\";\n\n// src/providers/theme-context.ts\nimport { createContext as createContext2, useContext as useContext2 } from \"react\";\nvar ThemeContext = createContext2({\n theme: \"system\",\n setTheme: () => {\n }\n});\n\n// src/components/molecules/sonner.tsx\nimport { jsx as jsx47 } from \"react/jsx-runtime\";\n\n// src/components/molecules/rating-stars.tsx\nimport * as React38 from \"react\";\nimport * as TooltipPrimitive from \"@radix-ui/react-tooltip\";\nimport { Star as Star2 } from \"lucide-react\";\nimport { jsx as jsx48, jsxs as jsxs22 } from \"react/jsx-runtime\";\nvar TooltipProvider = TooltipPrimitive.Provider;\nvar Tooltip3 = TooltipPrimitive.Root;\nvar TooltipTrigger = TooltipPrimitive.Trigger;\nvar TooltipContent = React38.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx48(\n TooltipPrimitive.Content,\n {\n ref,\n sideOffset,\n className: cn(\n \"z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground shadow-lg animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 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\",\n className\n ),\n ...props\n }\n));\nTooltipContent.displayName = TooltipPrimitive.Content.displayName;\nvar StarRating = React38.forwardRef(({ rating, onRate }, ref) => /* @__PURE__ */ jsx48(\"div\", { ref, className: \"flex\", children: [1, 2, 3, 4, 5].map((star) => /* @__PURE__ */ jsx48(\n Button,\n {\n onClick: () => onRate(star),\n variant: \"link\",\n className: \"p-1 transition-colors [&_svg]:size-5 h-5\",\n \"aria-label\": `Rate ${star} star${star !== 1 ? \"s\" : \"\"}`,\n children: /* @__PURE__ */ jsx48(\n Star2,\n {\n className: cn(\n \"w-5 h-5\",\n star <= rating ? \"alq-rating-star-active fill-current stroke-current\" : \"alq-rating-star-inactive\"\n )\n }\n )\n },\n star\n)) }));\nStarRating.displayName = \"StarRating\";\nvar RatingStars = React38.forwardRef(({\n currentRating = 0,\n onRate,\n className,\n isLoading\n}, ref) => {\n const [open, setOpen] = React38.useState(false);\n const [animate, setAnimate] = React38.useState(false);\n const handleRate = (rating) => {\n onRate(rating);\n setOpen(false);\n };\n React38.useEffect(() => {\n if (currentRating > 0) {\n setAnimate(true);\n const timer = setTimeout(() => setAnimate(false), 150);\n return () => clearTimeout(timer);\n }\n }, [currentRating]);\n const hasRated = currentRating > 0;\n return /* @__PURE__ */ jsx48(TooltipProvider, { children: /* @__PURE__ */ jsxs22(Tooltip3, { open, onOpenChange: setOpen, children: [\n /* @__PURE__ */ jsx48(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx48(\n Button,\n {\n ref,\n variant: \"link\",\n className: cn(\n \"inline-flex items-center justify-center rounded-md text-sm font-medium [&_svg]:size-5 transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50\",\n className\n ),\n disabled: isLoading,\n onClick: () => setOpen(!open),\n children: /* @__PURE__ */ jsx48(\n Star2,\n {\n className: cn(\n \"w-5 h-5 transition-all duration-500\",\n animate && \"animate-ping\",\n isLoading && \"animate-pulse\",\n hasRated ? \"alq-rating-star-active fill-current stroke-current\" : \"alq-rating-star-inactive\"\n )\n }\n )\n }\n ) }),\n /* @__PURE__ */ jsx48(TooltipContent, { side: \"top\", align: \"center\", className: \"p-0\", children: /* @__PURE__ */ jsx48(\"div\", { className: \"p-2 bg-background\", children: /* @__PURE__ */ jsx48(\n StarRating,\n {\n rating: currentRating,\n onRate: handleRate\n }\n ) }) })\n ] }) });\n});\nRatingStars.displayName = \"RatingStars\";\n\n// src/components/molecules/rating-thumbs.tsx\nimport * as React39 from \"react\";\nimport { ThumbsUp, ThumbsDown } from \"lucide-react\";\nimport { jsx as jsx49, jsxs as jsxs23 } from \"react/jsx-runtime\";\nvar RatingThumbs = React39.forwardRef(\n ({\n currentRating,\n onRate,\n direction = \"row\",\n className,\n isLoading\n }, ref) => {\n const [animate, setAnimate] = React39.useState(false);\n React39.useEffect(() => {\n if (currentRating) {\n setAnimate(true);\n const timer = setTimeout(() => setAnimate(false), 150);\n return () => clearTimeout(timer);\n }\n }, [currentRating]);\n return /* @__PURE__ */ jsxs23(\n \"div\",\n {\n ref,\n className: cn(\n \"inline-flex\",\n direction === \"column\" ? \"flex-col\" : \"flex-row\",\n \"space-x-1 gap-4\",\n className\n ),\n children: [\n /* @__PURE__ */ jsx49(\n Button,\n {\n variant: \"link\",\n onClick: () => onRate(currentRating === \"thumbsUp\" ? \"\" : \"thumbsUp\"),\n className: cn(\n \"p-1 transition-colors disabled:opacity-50 [&_svg]:size-5\",\n `hover:alq-rating-thumbsup/10`\n ),\n \"aria-label\": \"Thumbs up\",\n disabled: isLoading,\n children: /* @__PURE__ */ jsx49(\n ThumbsUp,\n {\n className: cn(\n \"w-5 h-5 transition-all duration-500\",\n animate && currentRating === \"thumbsUp\" && \"animate-ping\",\n isLoading && \"animate-pulse\",\n currentRating === \"thumbsUp\" ? \"alq-rating-thumbsup fill-current stroke-current\" : \"alq-rating-thumbs-inactive fill-transparent\"\n )\n }\n )\n }\n ),\n /* @__PURE__ */ jsx49(\n Button,\n {\n variant: \"link\",\n onClick: () => onRate(currentRating === \"thumbsDown\" ? \"\" : \"thumbsDown\"),\n className: cn(\n \"p-1 transition-colors disabled:opacity-50 mt-0.5 [&_svg]:size-5\",\n `hover:bg-alq-rating-thumbsdown/10`\n ),\n \"aria-label\": \"Thumbs down\",\n disabled: isLoading,\n children: /* @__PURE__ */ jsx49(\n ThumbsDown,\n {\n className: cn(\n \"w-5 h-5 transition-all duration-500\",\n animate && currentRating === \"thumbsDown\" && \"animate-ping\",\n isLoading && \"animate-pulse\",\n currentRating === \"thumbsDown\" ? \"alq-rating-thumbsdown fill-current stroke-current\" : \"alq-rating-thumbs-inactive fill-transparent\"\n )\n }\n )\n }\n )\n ]\n }\n );\n }\n);\nRatingThumbs.displayName = \"RatingThumbs\";\n\n// src/components/molecules/rating-comment.tsx\nimport * as React40 from \"react\";\nimport { Book } from \"lucide-react\";\nimport { jsx as jsx50, jsxs as jsxs24 } from \"react/jsx-runtime\";\nvar RatingComment = React40.forwardRef(\n ({ currentRating, onRate, className, isLoading }, ref) => {\n const [open, setOpen] = React40.useState(false);\n const [comment, setComment] = React40.useState(\"\");\n const [animate, setAnimate] = React40.useState(false);\n const handleRate = () => {\n onRate(comment);\n setOpen(false);\n };\n React40.useEffect(() => {\n if (currentRating) {\n setAnimate(true);\n const timer = setTimeout(() => setAnimate(false), 150);\n return () => clearTimeout(timer);\n }\n }, [currentRating]);\n React40.useEffect(() => {\n setComment(\"\");\n }, [open]);\n return /* @__PURE__ */ jsxs24(Dialog, { open, onOpenChange: setOpen, children: [\n /* @__PURE__ */ jsx50(DialogTrigger, { asChild: true, children: /* @__PURE__ */ jsx50(\n Button,\n {\n ref,\n variant: \"link\",\n size: \"lg\",\n className: cn(\n \"inline-flex p-2 items-center justify-center rounded-md text-sm font-medium transition-colors [&_svg]:size-5 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring bg-transparent hover:none disabled:pointer-events-none disabled:opacity-50\",\n className\n ),\n disabled: isLoading,\n children: /* @__PURE__ */ jsx50(\n Book,\n {\n className: cn(\n \"w-5 h-5 transition-all duration-500\",\n animate && \"animate-ping\",\n isLoading && \"animate-pulse\",\n `${comment ? \"alq-rating-comment\" : \"stroke-gray-400\"}`\n )\n }\n )\n }\n ) }),\n /* @__PURE__ */ jsx50(DialogOverlay, { className: \"fixed inset-0 bg-black bg-opacity-50\" }),\n /* @__PURE__ */ jsxs24(DialogContent, { \"aria-describedby\": void 0, children: [\n /* @__PURE__ */ jsx50(DialogTitle, { className: \"text-lg font-medium\", children: \"Deja un comentario\" }),\n /* @__PURE__ */ jsx50(\n \"textarea\",\n {\n className: \"mt-4 w-full p-2 border rounded-md focus:outline-none focus:ring-2 focus:ring-primary\",\n rows: 4,\n value: comment,\n onChange: (e) => setComment(e.target.value)\n }\n ),\n /* @__PURE__ */ jsx50(\"div\", { className: \"mt-4 flex justify-end\", children: /* @__PURE__ */ jsx50(\n Button,\n {\n onClick: handleRate,\n disabled: !comment,\n children: \"Enviar\"\n }\n ) })\n ] })\n ] });\n }\n);\nRatingComment.displayName = \"RatingComment\";\n\n// src/components/molecules/call-out.tsx\nimport * as React41 from \"react\";\nimport { ChevronDown as ChevronDown4, ChevronUp as ChevronUp2 } from \"lucide-react\";\n\n// src/components/hooks/use-text-streaming.ts\nimport { useState as useState11, useEffect as useEffect9, useRef, useCallback as useCallback2 } from \"react\";\nvar CHAR_DELAY = 15;\nvar PUNCTUATION_DELAY = 300;\nfunction useTextStreaming(content, shouldStream, handleIsTextStreaming) {\n const [displayedText, setDisplayedText] = useState11(\"\");\n const contentRef = useRef(content);\n const indexRef = useRef(0);\n const timerRef = useRef(null);\n const hasStartedStreaming = useRef(false);\n useEffect9(() => {\n contentRef.current = content;\n if (hasStartedStreaming.current && !timerRef.current && indexRef.current < contentRef.current.length) {\n typeNext();\n }\n }, [content]);\n const typeNext = useCallback2(() => {\n if (indexRef.current < contentRef.current.length) {\n const nextChar = contentRef.current.charAt(indexRef.current);\n setDisplayedText((prev) => prev + nextChar);\n indexRef.current++;\n const delay = /[.!?;:]/.test(nextChar) ? PUNCTUATION_DELAY : CHAR_DELAY;\n timerRef.current = setTimeout(() => {\n timerRef.current = null;\n typeNext();\n }, delay);\n } else {\n handleIsTextStreaming?.(false);\n }\n }, []);\n useEffect9(() => {\n if (!shouldStream && !hasStartedStreaming.current) {\n setDisplayedText(contentRef.current);\n indexRef.current = contentRef.current.length;\n if (timerRef.current) {\n clearTimeout(timerRef.current);\n timerRef.current = null;\n }\n handleIsTextStreaming?.(false);\n } else {\n if (indexRef.current < contentRef.current.length && !timerRef.current) {\n handleIsTextStreaming?.(true);\n hasStartedStreaming.current = true;\n typeNext();\n }\n }\n return () => {\n if (timerRef.current) {\n clearTimeout(timerRef.current);\n timerRef.current = null;\n }\n };\n }, [shouldStream, typeNext]);\n return displayedText;\n}\n\n// src/components/molecules/call-out.tsx\nimport { jsx as jsx51, jsxs as jsxs25 } from \"react/jsx-runtime\";\nvar CallOut = React41.forwardRef(({ className, children, role, ...props }, ref) => {\n return /* @__PURE__ */ jsx51(\n \"div\",\n {\n ref,\n className: cn(\"alq--callout-box\", className),\n \"data-role\": role,\n ...props,\n children\n }\n );\n});\nvar CallOutDate = React41.forwardRef(({ className, children, ...props }, ref) => {\n return /* @__PURE__ */ jsx51(\n \"div\",\n {\n ref,\n className: cn(\n \"alq--callout-date\",\n \"text-sm text-muted-foreground\",\n className\n ),\n ...props,\n children\n }\n );\n});\nvar CallOutActions = React41.forwardRef(({ className, actions, role, message, ...props }, ref) => {\n const [isLoading, setIsLoading] = React41.useState(false);\n const [isClicked, setIsClicked] = React41.useState(false);\n if (role === \"user\") {\n return null;\n }\n return /* @__PURE__ */ jsx51(\"div\", { ref, className: cn(\"alq--callout-actions\", className), ...props, children: actions.map((action) => action.custom ? /* @__PURE__ */ jsx51(React41.Fragment, { children: action.component?.({ message }) }, action.label) : /* @__PURE__ */ jsxs25(\n \"button\",\n {\n className: cn(\n \"alq--callout-action\",\n {\n \"alq--callout-animate-action\": isLoading\n },\n {\n \"alq--callout-clicked-action\": isClicked\n }\n ),\n type: \"button\",\n title: action.label,\n onClick: () => {\n setIsLoading(true);\n action.onClick(message).then(() => {\n setIsLoading(false);\n setIsClicked(true);\n });\n },\n children: [\n /* @__PURE__ */ jsx51(\n \"span\",\n {\n className: cn(\"alq-action-icon-wrapper\", {\n \"alq--callout-animate-action\": isLoading\n }),\n children: action.icon\n }\n ),\n /* @__PURE__ */ jsx51(\"label\", { children: action.label })\n ]\n },\n action.label\n )) });\n});\nvar CallOutResponse = React41.forwardRef(\n ({\n className,\n children,\n role,\n additionalInfo,\n toggleAdditionalInfo,\n isStreaming,\n handleIsTextStreaming,\n ...props\n }, ref) => {\n const [isAdditionalInfoOpen, setIsAdditionalInfoOpen] = React41.useState(false);\n const content = String(children || \"\");\n const shouldStream = role === \"assistant\" && isStreaming;\n const displayedContent = useTextStreaming(\n content,\n shouldStream ?? false,\n handleIsTextStreaming\n );\n const showAsToggle = additionalInfo && toggleAdditionalInfo;\n const showInline = additionalInfo && !toggleAdditionalInfo;\n return /* @__PURE__ */ jsxs25(\n \"div\",\n {\n ref,\n \"data-role\": role,\n className: cn(\n \"alq--callout-response\",\n \"max-w-none\",\n \"text-foreground\",\n className\n ),\n ...props,\n children: [\n /* @__PURE__ */ jsx51(RichText, { content: displayedContent }),\n showInline && /* @__PURE__ */ jsx51(\n \"div\",\n {\n className: cn(\n \"alq--callout-response-additional-info\",\n \"mt-2 text-sm text-muted-foreground whitespace-pre-line\",\n \"border-t border-border pt-2\"\n ),\n children: additionalInfo\n }\n ),\n showAsToggle && /* @__PURE__ */ jsxs25(\n \"div\",\n {\n className: cn(\n \"alq--callout-response-additional-info\",\n \"mt-2 border-t border-border pt-2\"\n ),\n children: [\n /* @__PURE__ */ jsxs25(\n Button,\n {\n type: \"button\",\n variant: \"ghost\",\n size: \"sm\",\n className: \"h-auto py-1.5 px-0 text-xs text-muted-foreground hover:bg-transparent hover:text-muted-foreground -ml-1\",\n onClick: () => setIsAdditionalInfoOpen((prev) => !prev),\n \"aria-expanded\": isAdditionalInfoOpen,\n children: [\n isAdditionalInfoOpen ? /* @__PURE__ */ jsx51(ChevronUp2, { className: \"h-4 w-4 mr-1.5 shrink-0 transition-transform\" }) : /* @__PURE__ */ jsx51(ChevronDown4, { className: \"h-4 w-4 mr-1.5 shrink-0 transition-transform\" }),\n isAdditionalInfoOpen ? \"Hide details\" : \"Show details\"\n ]\n }\n ),\n /* @__PURE__ */ jsx51(\n \"div\",\n {\n className: cn(\n \"grid transition-[grid-template-rows] duration-200 ease-out\",\n isAdditionalInfoOpen ? \"grid-rows-[1fr]\" : \"grid-rows-[0fr]\"\n ),\n children: /* @__PURE__ */ jsx51(\"div\", { className: \"overflow-hidden\", children: /* @__PURE__ */ jsx51(\"div\", { className: \"text-sm text-muted-foreground pt-1 whitespace-pre-line\", children: additionalInfo }) })\n }\n )\n ]\n }\n )\n ]\n }\n );\n }\n);\nCallOut.displayName = \"CallOut\";\nCallOutDate.displayName = \"CallOutDate\";\nCallOutActions.displayName = \"CallOutActions\";\nCallOutResponse.displayName = \"CallOutResponse\";\n\n// src/components/organisms/assistant.tsx\nimport { Send } from \"lucide-react\";\nimport { jsx as jsx52, jsxs as jsxs26 } from \"react/jsx-runtime\";\nvar Assistant = React42.forwardRef(\n ({ className, sdk, title, description, children, ...props }, ref) => {\n return /* @__PURE__ */ jsxs26(\n \"div\",\n {\n ref,\n className: cn(\"flex flex-col h-full bg-background text-foreground\", className),\n ...props,\n children: [\n (title || description) && /* @__PURE__ */ jsxs26(AssistantHeader, { children: [\n title && /* @__PURE__ */ jsx52(AssistantTitle, { title }),\n description && /* @__PURE__ */ jsx52(AssistantDescription, { description })\n ] }),\n children\n ]\n }\n );\n }\n);\nAssistant.displayName = \"Assistant\";\nvar AssistantTitle = React42.forwardRef(\n ({ className, title, ...props }, ref) => /* @__PURE__ */ jsx52(\"div\", { ref, className: cn(\"text-foreground\", className), ...props, children: /* @__PURE__ */ jsx52(Typography, { typeStyle: \"heading1\", as: \"h1\", children: title }) })\n);\nAssistantTitle.displayName = \"AssistantTitle\";\nvar AssistantDescription = React42.forwardRef(({ className, description, ...props }, ref) => /* @__PURE__ */ jsx52(\"div\", { ref, className: cn(\"text-foreground\", className), ...props, children: /* @__PURE__ */ jsx52(Typography, { typeStyle: \"display\", as: \"p\", children: description }) }));\nAssistantDescription.displayName = \"AssistantDescription\";\nvar AssistantHeader = React42.forwardRef(\n ({ className, children, ...props }, ref) => /* @__PURE__ */ jsx52(\n \"div\",\n {\n ref,\n className: cn(\"bg-background text-foreground\", className),\n ...props,\n children\n }\n )\n);\nAssistantHeader.displayName = \"AssistantHeader\";\nvar AssistantMessageArea = React42.forwardRef(\n ({\n className,\n messages,\n messagesEndRef,\n actions,\n streamingMessageId,\n thinkIndicator,\n handleIsTextStreaming,\n toolFactory,\n isLoading,\n showDetailedErrors,\n interleave,\n awaitingUser,\n isMessageStreaming: _isMessageStreaming,\n ...props\n }, ref) => {\n useEffect10(() => {\n messagesEndRef.current?.scrollIntoView({ behavior: \"instant\" });\n }, []);\n return /* @__PURE__ */ jsxs26(\n \"div\",\n {\n ref,\n className: cn(\"p-6 overflow-y-auto flex-grow bg-background\", className),\n ...props,\n children: [\n interleave?.(0),\n messages.map((message, index) => /* @__PURE__ */ jsxs26(\"div\", { children: [\n /* @__PURE__ */ jsxs26(\n CallOut,\n {\n role: message.role,\n message,\n children: [\n streamingMessageId === message.id && (isLoading || message.content.length === 0) && !message.error_code && !awaitingUser && /* @__PURE__ */ jsx52(\"div\", { children: thinkIndicator ?? /* @__PURE__ */ jsx52(ThinkIndicator, {}) }),\n message.error_code && /* @__PURE__ */ jsx52(\n CallOutResponse,\n {\n role: \"assistant\",\n \"data-error-code\": message.error_code,\n additionalInfo: showDetailedErrors ? `${message.error_detail}${message.taskid ? `\ntask id: ${message.taskid}` : \"\"}` : void 0,\n toggleAdditionalInfo: true,\n children: getErrorMessage(message.error_code)\n }\n ),\n !message.error_code && message.tooler?.filter(hasToolResult).map((tool, index2) => /* @__PURE__ */ jsx52(React42.Fragment, { children: toolFactory?.createTool(tool.tool_summary?.name || \"\", tool.tool_output) }, tool.control_id || `${tool.tool_summary?.name}-${index2}`)),\n message.content && !message.error_code && /* @__PURE__ */ jsxs26(\n \"div\",\n {\n \"data-role\": message.role,\n className: \"alq--callout-message-container\",\n children: [\n message.created_at && streamingMessageId !== message.id && /* @__PURE__ */ jsx52(\"div\", { className: \"text-xs text-muted-foreground/80 pb-1 alq--callout-message-date\", children: new Date(Number(message.created_at)).toLocaleString(\n \"es-ES\",\n {\n hour: \"2-digit\",\n minute: \"2-digit\",\n hour12: false\n }\n ) }),\n /* @__PURE__ */ jsx52(\n CallOutResponse,\n {\n role: message.role,\n isStreaming: streamingMessageId === message.id,\n handleIsTextStreaming,\n additionalInfo: streamingMessageId !== message.id ? message?.additionalInfo : void 0,\n children: message.content\n }\n ),\n actions && streamingMessageId !== message.id && /* @__PURE__ */ jsx52(\n CallOutActions,\n {\n actions,\n message,\n role: message.role\n },\n message.id\n )\n ]\n }\n )\n ]\n },\n message.id\n ),\n interleave?.(index + 1)\n ] }, message.id)),\n /* @__PURE__ */ jsx52(\"div\", { ref: messagesEndRef })\n ]\n }\n );\n }\n);\nAssistantMessageArea.displayName = \"AssistantMessageArea\";\nvar AssistantInput = React42.forwardRef(\n ({\n className,\n sendMessageFunc,\n isButtonDisabled,\n input,\n handleInputChange,\n isMessageStreaming,\n speechToTextComponent,\n userToolboxComponent,\n placeholders,\n onFileDrop,\n attachmentsSlot,\n ...props\n }, ref) => {\n const [isDragging, setIsDragging] = useState13(false);\n const dragCounterRef = useRef2(0);\n const handleDragEnter = useCallback3((e) => {\n e.preventDefault();\n e.stopPropagation();\n dragCounterRef.current += 1;\n if (e.dataTransfer.types.includes(\"Files\")) {\n setIsDragging(true);\n }\n }, []);\n const handleDragOver = useCallback3((e) => {\n e.preventDefault();\n e.stopPropagation();\n }, []);\n const handleDragLeave = useCallback3((e) => {\n e.preventDefault();\n e.stopPropagation();\n dragCounterRef.current -= 1;\n if (dragCounterRef.current === 0) {\n setIsDragging(false);\n }\n }, []);\n const handleDrop = useCallback3(\n (e) => {\n e.preventDefault();\n e.stopPropagation();\n dragCounterRef.current = 0;\n setIsDragging(false);\n const files = Array.from(e.dataTransfer.files);\n if (files.length > 0) {\n onFileDrop?.(files);\n }\n },\n [onFileDrop]\n );\n const placeholder = placeholders ? isMessageStreaming ? placeholders[0] : placeholders[1] : isMessageStreaming ? \"Processing...\" : \"Type your message here...\";\n return /* @__PURE__ */ jsxs26(\n \"form\",\n {\n onSubmit: sendMessageFunc,\n className: cn(\n \"flex flex-col relative rounded-lg border border-input bg-background\",\n \"focus-within:ring-2 focus-within:ring-ring\",\n onFileDrop && isDragging && \"ring-2 ring-primary/50 alq--assistant-input-dragover\",\n className\n ),\n ref,\n onDragEnter: onFileDrop ? handleDragEnter : void 0,\n onDragOver: onFileDrop ? handleDragOver : void 0,\n onDragLeave: onFileDrop ? handleDragLeave : void 0,\n onDrop: onFileDrop ? handleDrop : void 0,\n ...props,\n children: [\n attachmentsSlot,\n /* @__PURE__ */ jsx52(\n \"textarea\",\n {\n disabled: isButtonDisabled,\n value: input,\n onChange: handleInputChange,\n placeholder,\n className: cn(\n \"flex-1 min-w-0 text-sm p-3 focus:outline-none w-full resize-none\",\n \"bg-transparent text-foreground\",\n \"placeholder:text-muted-foreground\",\n \"disabled:opacity-50 disabled:cursor-not-allowed\"\n ),\n onKeyDown: (e) => {\n if (e.key === \"Enter\" && !e.shiftKey) {\n e.preventDefault();\n sendMessageFunc(e);\n }\n }\n }\n ),\n /* @__PURE__ */ jsxs26(\"div\", { className: \"flex items-center relative alq--assistant-actions\", children: [\n userToolboxComponent,\n speechToTextComponent,\n /* @__PURE__ */ jsx52(\n \"button\",\n {\n type: \"submit\",\n \"aria-label\": \"Send\",\n disabled: isButtonDisabled,\n className: cn(\n \"w-10 h-10 rounded-full flex items-center justify-center alq--assistant-button-send\",\n isButtonDisabled ? \"bg-muted text-muted-foreground\" : \"bg-primary text-primary-foreground hover:bg-primary/90\"\n ),\n children: /* @__PURE__ */ jsx52(Send, { className: \"w-5 h-5\" })\n }\n )\n ] })\n ]\n }\n );\n }\n);\nAssistantInput.displayName = \"AssistantInput\";\n\n// src/components/organisms/tool-approval.tsx\nimport * as React43 from \"react\";\nimport { Check as Check3, Loader2 as Loader22, ShieldAlert, X as X3 } from \"lucide-react\";\nimport { Fragment as Fragment8, jsx as jsx53, jsxs as jsxs27 } from \"react/jsx-runtime\";\nfunction formatArguments(args) {\n if (args === null || args === void 0) return null;\n if (typeof args === \"string\") return args;\n try {\n return JSON.stringify(args, null, 2);\n } catch {\n return String(args);\n }\n}\nfunction blockedMessage(approval, channelName) {\n const outcome = approval.lastResult?.outcome;\n if (approval.channelOwned || outcome === \"wrong-channel\") {\n return `This approval has to be answered in ${channelName ?? \"the channel the conversation came from\"}. It can't be answered here.`;\n }\n switch (outcome) {\n case \"already-decided\":\n return \"Someone else already answered this request. Waiting for the agent to continue.\";\n case \"not-pending\":\n return \"This request is no longer waiting for a decision.\";\n case \"not-found\":\n return \"This conversation has ended, so the request can no longer be answered.\";\n case \"forbidden\":\n return \"You don't have permission to answer this request.\";\n default:\n return null;\n }\n}\nfunction ToolApprovalCard({ approval, onDecide, channelName, className }) {\n const [rejecting, setRejecting] = React43.useState(false);\n const [reason, setReason] = React43.useState(\"\");\n const args = formatArguments(approval.arguments);\n const toolLabel = approval.toolName ?? \"a tool\";\n const submitting = approval.status === \"submitting\";\n const settled = approval.status === \"approved\" || approval.status === \"rejected\";\n const blocked = !settled && !submitting && !approval.canAnswer ? blockedMessage(approval, channelName) : null;\n const failed = !settled && !submitting && approval.canAnswer && approval.lastResult && approval.lastResult.outcome !== \"accepted\" ? approval.lastResult : null;\n const decide = (approved) => {\n const said = reason.trim();\n void onDecide(approval.controlId, approved, approved || !said ? void 0 : said);\n };\n return /* @__PURE__ */ jsxs27(\n \"section\",\n {\n \"aria-label\": `Approval request for ${toolLabel}`,\n \"data-status\": approval.status,\n className: cn(\n \"alq--tool-approval w-full max-w-[95%] rounded-2xl border bg-card p-4 shadow-sm\",\n settled ? \"border-border/60\" : \"border-amber-500/50\",\n className\n ),\n children: [\n /* @__PURE__ */ jsxs27(\"header\", { className: \"flex items-start gap-2\", children: [\n /* @__PURE__ */ jsx53(\n ShieldAlert,\n {\n \"aria-hidden\": true,\n className: cn(\"mt-0.5 h-4 w-4 shrink-0\", settled ? \"text-muted-foreground\" : \"text-amber-500\")\n }\n ),\n /* @__PURE__ */ jsxs27(\"div\", { className: \"min-w-0 flex-1\", children: [\n /* @__PURE__ */ jsx53(\"p\", { className: \"text-sm font-medium text-foreground\", children: settled ? \"Approval request\" : \"The agent needs your approval\" }),\n /* @__PURE__ */ jsxs27(\"p\", { className: \"text-sm text-muted-foreground\", children: [\n \"Run \",\n /* @__PURE__ */ jsx53(\"code\", { className: \"rounded bg-muted px-1 py-0.5 font-mono text-xs text-foreground\", children: toolLabel })\n ] })\n ] }),\n settled && /* @__PURE__ */ jsxs27(\n \"span\",\n {\n className: cn(\n \"flex shrink-0 items-center gap-1 rounded-full px-2 py-0.5 text-xs font-medium\",\n approval.status === \"approved\" ? \"bg-emerald-500/10 text-emerald-600 dark:text-emerald-400\" : \"bg-destructive/10 text-destructive\"\n ),\n children: [\n approval.status === \"approved\" ? /* @__PURE__ */ jsx53(Check3, { className: \"h-3 w-3\" }) : /* @__PURE__ */ jsx53(X3, { className: \"h-3 w-3\" }),\n approval.status === \"approved\" ? \"Approved\" : \"Rejected\",\n approval.decidedHere ? \" by you\" : \" elsewhere\"\n ]\n }\n )\n ] }),\n args !== null && /* @__PURE__ */ jsx53(\n \"pre\",\n {\n \"aria-label\": \"Arguments\",\n className: \"mt-3 max-h-48 overflow-auto rounded-lg bg-muted/60 p-3 font-mono text-xs text-foreground\",\n children: args\n }\n ),\n settled && approval.status === \"rejected\" && approval.reason && /* @__PURE__ */ jsxs27(\"p\", { className: \"mt-3 text-sm text-muted-foreground\", children: [\n /* @__PURE__ */ jsx53(\"span\", { className: \"font-medium text-foreground\", children: \"Reason:\" }),\n \" \",\n approval.reason\n ] }),\n blocked && /* @__PURE__ */ jsx53(\"p\", { role: \"status\", className: \"mt-3 text-sm text-muted-foreground\", children: blocked }),\n failed && /* @__PURE__ */ jsxs27(\"p\", { role: \"alert\", className: \"mt-3 text-sm text-destructive\", children: [\n \"Couldn't send your decision\",\n failed.detail ? `: ${failed.detail}` : \".\",\n \" Try again.\"\n ] }),\n !settled && (submitting || approval.canAnswer) && /* @__PURE__ */ jsxs27(\"div\", { className: \"mt-3 flex flex-col gap-2\", children: [\n rejecting && /* @__PURE__ */ jsx53(\n Textarea,\n {\n \"aria-label\": \"Reason for rejecting (optional)\",\n placeholder: \"Reason for rejecting (optional)\",\n value: reason,\n disabled: submitting,\n onChange: (e) => setReason(e.target.value),\n className: \"min-h-[64px] text-sm\"\n }\n ),\n /* @__PURE__ */ jsxs27(\"div\", { className: \"flex flex-wrap items-center justify-end gap-2\", children: [\n submitting && /* @__PURE__ */ jsx53(Loader22, { \"aria-label\": \"Sending decision\", className: \"h-4 w-4 animate-spin text-muted-foreground\" }),\n rejecting ? /* @__PURE__ */ jsxs27(Fragment8, { children: [\n /* @__PURE__ */ jsx53(Button, { size: \"sm\", variant: \"ghost\", disabled: submitting, onClick: () => setRejecting(false), children: \"Cancel\" }),\n /* @__PURE__ */ jsx53(Button, { size: \"sm\", variant: \"destructive\", disabled: submitting, onClick: () => decide(false), children: \"Reject\" })\n ] }) : /* @__PURE__ */ jsxs27(Fragment8, { children: [\n /* @__PURE__ */ jsx53(Button, { size: \"sm\", variant: \"outline\", disabled: submitting, onClick: () => setRejecting(true), children: \"Reject\\u2026\" }),\n /* @__PURE__ */ jsx53(Button, { size: \"sm\", disabled: submitting, onClick: () => decide(true), children: \"Approve\" })\n ] })\n ] })\n ] })\n ]\n }\n );\n}\n\n// src/components/genui/assistant-chat.tsx\nimport { jsx as jsx54, jsxs as jsxs28 } from \"react/jsx-runtime\";\nfunction TypingDots() {\n return /* @__PURE__ */ jsx54(\"div\", { className: \"flex w-fit items-center gap-1.5 rounded-2xl rounded-bl-md border border-border/60 bg-card px-4 py-3 shadow-sm\", children: [0, 1, 2].map((i) => /* @__PURE__ */ jsx54(\n \"span\",\n {\n className: \"h-2 w-2 animate-bounce rounded-full bg-primary\",\n style: { animationDelay: `${i * 0.15}s`, animationDuration: \"0.9s\" }\n },\n i\n )) });\n}\nfunction AssistantChat({\n alquimia,\n registry = coreUiRegistry,\n conversationId,\n placeholder = \"Ask the agent to build something\\u2026\",\n suggestions = [],\n className,\n thinkIndicator,\n approvalChannelName\n}) {\n const endRef = React44.useRef(null);\n const {\n messages,\n input,\n handleInputChange,\n handleSubmit,\n handleLoadingCancel,\n isLoading,\n isMessageStreaming,\n streamingMessageId,\n genui,\n toolApprovals,\n approveTool\n } = alquimia;\n const surfaces = genui?.surfaces ?? [];\n const approvals = toolApprovals ?? [];\n const awaitingApproval = approvals.some((a) => a.status === \"pending\" || a.status === \"submitting\");\n const awaitingUser = genui?.awaitingUser ?? false;\n const isBusy = !!(isLoading || isMessageStreaming);\n const hasContent = messages.some(\n (m) => m.role === \"user\" || m.role !== \"system\" && (m.content ?? \"\").trim().length > 0\n );\n const isEmpty = !hasContent && surfaces.length === 0 && approvals.length === 0;\n React44.useEffect(() => {\n endRef.current?.scrollIntoView({ behavior: \"smooth\" });\n }, [messages, surfaces, approvals.length]);\n const renderSurface = (item) => /* @__PURE__ */ jsxs28(\"div\", { className: \"my-3 flex flex-col items-start gap-1.5\", children: [\n /* @__PURE__ */ jsxs28(\n \"div\",\n {\n className: cn(\n \"relative w-full max-w-[95%] rounded-2xl border border-border/60 bg-card p-5 shadow-sm duration-500 animate-in fade-in slide-in-from-bottom-2\",\n item.submitted && \"opacity-70\"\n ),\n children: [\n item.submitted && /* @__PURE__ */ jsxs28(\"div\", { className: \"absolute right-3 top-3 z-10 flex items-center gap-1 rounded-full bg-emerald-500/10 px-2 py-0.5 text-xs font-medium text-emerald-600 dark:text-emerald-400\", children: [\n /* @__PURE__ */ jsx54(Check4, { className: \"h-3 w-3\" }),\n item.dismissedWith ? \"Skipped\" : \"Submitted\"\n ] }),\n /* @__PURE__ */ jsx54(\"div\", { className: cn(item.submitted && \"pointer-events-none select-none\"), \"aria-disabled\": item.submitted, children: /* @__PURE__ */ jsx54(\n A2uiRenderer,\n {\n surface: item.surface,\n registry,\n onAgentAction: genui ? genui.onAgentAction(item.controlId) : () => {\n }\n }\n ) })\n ]\n }\n ),\n item.dismissedWith && /* @__PURE__ */ jsxs28(\"p\", { className: \"alq--surface-dismissed max-w-[95%] pl-1 text-sm text-muted-foreground\", children: [\n /* @__PURE__ */ jsx54(\"span\", { className: \"font-medium text-foreground\", children: \"You replied:\" }),\n \" \",\n item.dismissedWith\n ] })\n ] }, `s-${item.controlId}`);\n const byCount = /* @__PURE__ */ new Map();\n for (const s of surfaces) {\n const arr = byCount.get(s.afterCount) ?? [];\n arr.push(s);\n byCount.set(s.afterCount, arr);\n }\n const approvalsByCount = /* @__PURE__ */ new Map();\n for (const a of approvals) {\n const arr = approvalsByCount.get(a.afterCount) ?? [];\n arr.push(a);\n approvalsByCount.set(a.afterCount, arr);\n }\n const renderApproval = (approval) => /* @__PURE__ */ jsx54(\"div\", { className: \"my-3 flex flex-col items-start\", children: /* @__PURE__ */ jsx54(\n ToolApprovalCard,\n {\n approval,\n onDecide: approveTool ?? (() => {\n }),\n channelName: approvalChannelName,\n className: \"duration-500 animate-in fade-in slide-in-from-bottom-2\"\n }\n ) }, `a-${approval.controlId}`);\n const interleave = (afterIndex) => {\n const nodes = [\n ...(byCount.get(afterIndex) ?? []).map(renderSurface),\n ...(approvalsByCount.get(afterIndex) ?? []).map(renderApproval)\n ];\n if (afterIndex === 0 && isEmpty) {\n nodes.unshift(\n /* @__PURE__ */ jsxs28(\n \"div\",\n {\n className: \"flex min-h-full flex-col items-center justify-center gap-4 py-16 text-center\",\n children: [\n /* @__PURE__ */ jsx54(\"p\", { className: \"max-w-sm text-muted-foreground\", children: \"Ask the agent to build an interface.\" }),\n /* @__PURE__ */ jsx54(\"div\", { className: \"flex flex-col items-center gap-2\", children: suggestions.map((s) => /* @__PURE__ */ jsx54(\n \"button\",\n {\n type: \"button\",\n onClick: () => handleInputChange({\n target: { value: s }\n }),\n className: \"rounded-full border border-border/70 bg-card px-4 py-2 text-sm text-foreground/80 transition hover:border-primary/40 hover:shadow-sm\",\n children: s\n },\n s\n )) })\n ]\n },\n \"empty\"\n )\n );\n }\n return nodes.length ? nodes : null;\n };\n const onSubmit = async (e) => {\n e.preventDefault();\n if (!input.trim()) return;\n if (awaitingUser && genui?.dismiss) {\n genui.dismiss(input);\n return;\n }\n if (isBusy) return;\n try {\n await handleSubmit(e, void 0, conversationId ?? void 0);\n } catch {\n handleLoadingCancel?.();\n }\n };\n return /* @__PURE__ */ jsxs28(Assistant, { className: cn(\"mx-auto flex h-full w-full max-w-2xl flex-col bg-transparent px-4\", className), children: [\n /* @__PURE__ */ jsx54(\n AssistantMessageArea,\n {\n className: \"bg-transparent\",\n messages,\n messagesEndRef: endRef,\n isLoading: !!isLoading,\n streamingMessageId: streamingMessageId ?? null,\n interleave,\n awaitingUser: awaitingUser || awaitingApproval,\n thinkIndicator: thinkIndicator ?? /* @__PURE__ */ jsx54(TypingDots, {})\n }\n ),\n /* @__PURE__ */ jsx54(\n AssistantInput,\n {\n className: \"mb-5 mt-2 rounded-2xl border-border/60 bg-card/90 shadow-lg backdrop-blur\",\n sendMessageFunc: onSubmit,\n isButtonDisabled: isBusy && !awaitingUser,\n input,\n handleInputChange,\n isMessageStreaming: !!isMessageStreaming,\n placeholders: [placeholder, placeholder]\n }\n )\n ] });\n}\nexport {\n A2uiRenderer,\n AssistantChat,\n coreUiRegistry\n};\n","import * as React from \"react\";\nimport type { A2uiSurface, A2uiComponent, SurfaceAction, UIAction } from \"@alquimia-ai/tools/genui\";\nimport { getPointer, setPointer, classifyAction, resolveDynamic, isPathRef } from \"@alquimia-ai/tools/genui\";\nimport type { A2uiNodeProps } from \"./registry\";\n\nexport interface A2uiRendererProps {\n surface: A2uiSurface;\n registry: Record<string, React.ComponentType<A2uiNodeProps>>;\n onAgentAction: (action: UIAction) => void;\n onLocalAction?: (action: UIAction) => void;\n}\n\nexport function A2uiRenderer({ surface, registry, onAgentAction, onLocalAction }: A2uiRendererProps) {\n const [model, setModel] = React.useState<Record<string, unknown>>(surface.dataModel ?? {});\n // Reset local model if the agent sends a new surface.\n React.useEffect(() => {\n setModel(surface.dataModel ?? {});\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [surface.surfaceId]);\n\n const byId = React.useMemo(() => {\n const m = new Map<string, A2uiComponent>();\n for (const c of surface.components) m.set(c.id, c);\n return m;\n }, [surface]);\n\n const emitAction = (node: A2uiComponent, action: SurfaceAction) => {\n const kind = classifyAction(action);\n const ui: UIAction = {\n surfaceId: surface.surfaceId,\n componentId: node.id,\n action: action.name,\n kind,\n payload: kind === \"agent-bound\" ? model : undefined,\n };\n if (kind === \"agent-bound\") onAgentAction(ui);\n else onLocalAction?.(ui);\n };\n\n const renderNode = (id: string, seen: Set<string>): React.ReactNode => {\n if (seen.has(id)) return null; // cycle guard\n const node = byId.get(id);\n if (!node) return null;\n const nextSeen = new Set(seen).add(id);\n\n // Containers reference children by id array; A2UI single-child components use `child`.\n const childIds = node.children ?? (node.child ? [node.child] : []);\n const children = childIds.map((cid) => (\n <React.Fragment key={cid}>{renderNode(cid, nextSeen)}</React.Fragment>\n ));\n\n const Comp = registry[node.component];\n if (!Comp) {\n // Text fallback — never crash on an unknown component.\n return (\n <p className=\"text-muted-foreground text-sm\" data-a2ui-fallback={node.component}>\n [unsupported component: {node.component}]\n </p>\n );\n }\n\n // Binding: prefer the legacy `binding` JSON-Pointer field; otherwise honor an A2UI\n // DynamicString on the node's `value` prop (`{ path: \"/ptr\" }`). Both write back to the\n // same path; a literal `value` resolves to itself (no write-back).\n const boundPath = node.binding ?? (isPathRef(node.value) ? (node.value as { path: string }).path : undefined);\n const value =\n boundPath !== undefined\n ? getPointer(model, boundPath)\n : node.value !== undefined\n ? resolveDynamic(node.value, model)\n : undefined;\n const onChange =\n boundPath !== undefined ? (v: unknown) => setModel((m) => setPointer(m, boundPath, v)) : undefined;\n const onAction = node.action ? (a: SurfaceAction) => emitAction(node, a) : undefined;\n\n return (\n <Comp node={node} value={value} onChange={onChange} onAction={onAction}>\n {children.length ? children : undefined}\n </Comp>\n );\n };\n\n // A2UI convention: the root is the component with id \"root\"; fall back to the legacy field.\n const rootId = byId.has(\"root\") ? \"root\" : surface.root;\n if (!rootId) return null;\n return <>{renderNode(rootId, new Set())}</>;\n}\n","import * as React from \"react\";\nimport type { A2uiNodeProps } from \"../registry\";\nimport { cn } from \"../../../lib/utils\";\nimport { styleProps } from \"../style-props\";\nimport { Card, CardHeader, CardTitle, CardDescription, CardContent } from \"../../atoms/ui/card\";\nimport { Separator } from \"../../atoms/ui/separator\";\nimport { Tabs, TabsList, TabsTrigger, TabsContent } from \"../../atoms/ui/tabs\";\nimport { Accordion, AccordionItem, AccordionTrigger, AccordionContent } from \"../../atoms/ui/accordion\";\n\nconst gapClass = (g: unknown) => (g === \"lg\" ? \"gap-6\" : g === \"sm\" ? \"gap-2\" : \"gap-4\");\n\nexport const Stack: React.FC<A2uiNodeProps> = ({ node, children }) => (\n <div\n className={cn(\n \"flex\",\n node.direction === \"horizontal\" ? \"flex-row\" : \"flex-col\",\n gapClass(node.gap),\n styleProps(node),\n )}\n >\n {children}\n </div>\n);\n\nexport const Row: React.FC<A2uiNodeProps> = ({ node, children }) => (\n <div className={cn(\"flex flex-row\", node.wrap ? \"flex-wrap\" : \"\", gapClass(node.gap), styleProps(node))}>\n {children}\n </div>\n);\n\nexport const Column: React.FC<A2uiNodeProps> = ({ node, children }) => (\n <div className={cn(\"flex flex-col\", gapClass(node.gap), styleProps(node))}>{children}</div>\n);\n\nexport const Grid: React.FC<A2uiNodeProps> = ({ node, children }) => {\n const cols = typeof node.columns === \"number\" ? Math.min(Math.max(node.columns, 1), 6) : 2;\n const colClass = [\"\", \"grid-cols-1\", \"grid-cols-2\", \"grid-cols-3\", \"grid-cols-4\", \"grid-cols-5\", \"grid-cols-6\"][cols];\n return <div className={cn(\"grid\", colClass, gapClass(node.gap), styleProps(node))}>{children}</div>;\n};\n\nexport const Divider: React.FC<A2uiNodeProps> = ({ node }) =>\n typeof node.label === \"string\" ? (\n <div className=\"flex items-center gap-3 text-xs text-muted-foreground\">\n <Separator className=\"flex-1\" />\n <span>{node.label}</span>\n <Separator className=\"flex-1\" />\n </div>\n ) : (\n <Separator />\n );\n\nexport const Spacer: React.FC<A2uiNodeProps> = ({ node }) => {\n const h = node.size === \"lg\" ? \"h-8\" : node.size === \"sm\" ? \"h-2\" : \"h-4\";\n return <div className={h} aria-hidden />;\n};\n\nexport const CardNode: React.FC<A2uiNodeProps> = ({ node, children }) => {\n const variant =\n node.variant === \"ghost\" ? \"border-transparent shadow-none bg-transparent\" : node.variant === \"outline\" ? \"shadow-none\" : \"\";\n return (\n <Card className={cn(variant, styleProps(node))}>\n {(typeof node.title === \"string\" || typeof node.description === \"string\") && (\n <CardHeader>\n {typeof node.title === \"string\" && <CardTitle>{node.title}</CardTitle>}\n {typeof node.description === \"string\" && <CardDescription>{node.description}</CardDescription>}\n </CardHeader>\n )}\n <CardContent>{children}</CardContent>\n </Card>\n );\n};\n\n/** Tabs: each child (by index) is the content for the tab at the same index. */\nexport const TabsNode: React.FC<A2uiNodeProps> = ({ node, children }) => {\n const tabs = (Array.isArray(node.tabs) ? node.tabs : []) as Array<{ label: string; value: string }>;\n const kids = React.Children.toArray(children);\n if (!tabs.length) return <>{children}</>;\n return (\n <Tabs defaultValue={tabs[0]?.value} className={cn(styleProps(node))}>\n <TabsList>\n {tabs.map((t) => (\n <TabsTrigger key={t.value} value={t.value}>\n {t.label}\n </TabsTrigger>\n ))}\n </TabsList>\n {tabs.map((t, i) => (\n <TabsContent key={t.value} value={t.value}>\n {kids[i] ?? null}\n </TabsContent>\n ))}\n </Tabs>\n );\n};\n\n/**\n * Accordion: each `items[i]` is a collapsible section whose body is the child at the\n * same index. Renders through the shared `Accordion` atom (Radix).\n */\nexport const AccordionNode: React.FC<A2uiNodeProps> = ({ node, children }) => {\n const items = (Array.isArray(node.items) ? node.items : []) as Array<{ title: string; value: string }>;\n const kids = React.Children.toArray(children);\n if (!items.length) return <div className={cn(\"flex flex-col gap-2\", styleProps(node))}>{children}</div>;\n return (\n <Accordion\n type=\"single\"\n collapsible\n className={cn(\"rounded-md border border-border px-4\", styleProps(node))}\n >\n {items.map((it, i) => (\n <AccordionItem key={it.value} value={it.value}>\n <AccordionTrigger>{it.title}</AccordionTrigger>\n <AccordionContent>{kids[i] ?? null}</AccordionContent>\n </AccordionItem>\n ))}\n </Accordion>\n );\n};\n","import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n\nexport function parseTextToSpeech(content: string) {\n return content.replace(/[^\\p{L}\\p{N}\\s.,:]/gu, '');\n}\n\n\nexport function blobToBase64(blob: Blob): Promise<string> {\n return new Promise((resolve, reject) => {\n const reader = new FileReader();\n reader.onloadend = () => resolve(reader.result as string);\n reader.onerror = reject;\n reader.readAsDataURL(blob);\n });\n};\n\nexport const truncateString = (str: string, maxLength: number): string => {\n if (str.length <= maxLength) {\n return str;\n }\n return str.slice(0, maxLength) + \"...\";\n};\n\nexport function getCookies(name: string) {\n if (typeof document === 'undefined') return undefined;\n const value = `; ${document.cookie}`;\n const parts = value.split(`; ${name}=`);\n if (parts.length === 2) return parts.pop()?.split(\";\").shift();\n}\n\nexport function hasToolResult(data: any) {\n return data?.tool_output?.result && Object.keys(data.tool_output.result).length > 0;\n}\n\nexport function getErrorMessage(error_code?: string) {\n switch (error_code) {\n case \"STREAM_ERROR\":\n return \"Connection lost. Please try again.\";\n case \"REQUEST_ERROR\":\n return \"There was a problem with your request. Please try again.\";\n case \"401\":\n case \"403\":\n return \"You are not authorized. Please try again.\";\n case \"404\":\n return \"Resource not found.\";\n case \"500\":\n return \"Server error. Please try again later.\";\n default:\n return \"We have an internal error, please try again later.\";\n }\n}\n","import { cn } from \"../../lib/utils\";\n\n/**\n * Map the agent-facing semantic style vocabulary (docs/a2ui-approach.md §11) to the\n * consumer's Tailwind semantic-token classes. Unknown/absent values contribute nothing,\n * so a component falls back to its own default styling.\n */\nconst TONE: Record<string, string> = {\n default: \"text-foreground\",\n muted: \"text-muted-foreground\",\n primary: \"text-primary\",\n success: \"text-emerald-600 dark:text-emerald-400\",\n warning: \"text-amber-600 dark:text-amber-400\",\n danger: \"text-destructive\",\n};\nconst SIZE: Record<string, string> = { sm: \"text-sm\", md: \"text-base\", lg: \"text-lg\" };\nconst ALIGN: Record<string, string> = { start: \"text-left\", center: \"text-center\", end: \"text-right\" };\nconst DENSITY: Record<string, string> = { compact: \"gap-2\", comfortable: \"gap-4\" };\n\nexport function styleProps(node: {\n tone?: unknown;\n size?: unknown;\n emphasis?: unknown;\n align?: unknown;\n density?: unknown;\n}): string {\n return cn(\n typeof node.tone === \"string\" ? TONE[node.tone] : undefined,\n typeof node.size === \"string\" ? SIZE[node.size] : undefined,\n typeof node.align === \"string\" ? ALIGN[node.align] : undefined,\n typeof node.density === \"string\" ? DENSITY[node.density] : undefined,\n node.emphasis === \"high\" ? \"font-semibold\" : node.emphasis === \"medium\" ? \"font-medium\" : undefined,\n );\n}\n","import * as React from \"react\";\n\nimport { cn } from \"../../../lib/utils\";\n\nconst Card = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\n \"rounded-lg\",\n \" border\",\n \"bg-card\",\n \"text-card-foreground\",\n \"shadow-raised\",\n className\n )}\n {...props}\n />\n));\nCard.displayName = \"Card\";\n\nconst CardHeader = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\"flex flex-col space-y-1.5 p-6\", className)}\n {...props}\n />\n));\nCardHeader.displayName = \"CardHeader\";\n\nconst CardTitle = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLHeadingElement>\n>(({ className, ...props }, ref) => (\n <h3\n ref={ref}\n className={cn(\"alq--typography-heading4\", className)}\n {...props}\n />\n));\nCardTitle.displayName = \"CardTitle\";\n\nconst CardDescription = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLParagraphElement>\n>(({ className, ...props }, ref) => (\n <p\n ref={ref}\n className={cn(\"text-sm text-muted-foreground\", className)}\n {...props}\n />\n));\nCardDescription.displayName = \"CardDescription\";\n\nconst CardContent = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div ref={ref} className={cn(\"p-6 pt-0\", className)} {...props} />\n));\nCardContent.displayName = \"CardContent\";\n\nconst CardFooter = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\"flex items-center p-6 pt-0\", className)}\n {...props}\n />\n));\nCardFooter.displayName = \"CardFooter\";\n\nexport {\n Card,\n CardHeader,\n CardFooter,\n CardTitle,\n CardDescription,\n CardContent,\n};\n","\"use client\"\n\nimport * as React from \"react\"\nimport * as SeparatorPrimitive from \"@radix-ui/react-separator\"\n\nimport { cn } from \"../../../lib/utils\"\n\nconst Separator = React.forwardRef<\n React.ElementRef<typeof SeparatorPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root>\n>(({ className, orientation = \"horizontal\", decorative = true, ...props }, ref) => (\n <SeparatorPrimitive.Root\n ref={ref}\n decorative={decorative}\n orientation={orientation}\n className={cn(\n \"shrink-0 bg-border\",\n orientation === \"horizontal\" ? \"h-[1px] w-full\" : \"h-full w-[1px]\",\n className,\n \"alq--separator\"\n )}\n {...props}\n />\n))\nSeparator.displayName = SeparatorPrimitive.Root.displayName\n\nexport { Separator }","\"use client\";\n\nimport * as React from \"react\";\nimport * as TabsPrimitive from \"@radix-ui/react-tabs\";\n\nimport { cn } from \"../../../lib/utils\";\n\nconst Tabs = TabsPrimitive.Root;\n\nconst TabsList = React.forwardRef<\n React.ElementRef<typeof TabsPrimitive.List>,\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.List>\n>(({ className, ...props }, ref) => (\n <TabsPrimitive.List\n ref={ref}\n className={cn(\n \"inline-flex h-10 items-center justify-center rounded-md p-1 text-muted-foreground\",\n className,\n \"alq--tabs\"\n )}\n {...props}\n />\n));\nTabsList.displayName = TabsPrimitive.List.displayName;\n\nconst TabsTrigger = React.forwardRef<\n React.ElementRef<typeof TabsPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.Trigger>\n>(({ className, ...props }, ref) => (\n <TabsPrimitive.Trigger\n ref={ref}\n className={cn(\n \"inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:border-b-2 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:border-b-2 data-[state=active]:text-foreground data-[state=active]:shadow-sm\",\n className\n )}\n {...props}\n />\n));\nTabsTrigger.displayName = TabsPrimitive.Trigger.displayName;\n\nconst TabsContent = React.forwardRef<\n React.ElementRef<typeof TabsPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.Content>\n>(({ className, ...props }, ref) => (\n <TabsPrimitive.Content\n ref={ref}\n className={cn(\n \"mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2\",\n className\n )}\n {...props}\n />\n));\nTabsContent.displayName = TabsPrimitive.Content.displayName;\n\nexport { Tabs, TabsList, TabsTrigger, TabsContent };\n","\"use client\";\n\nimport * as React from \"react\";\nimport * as AccordionPrimitive from \"@radix-ui/react-accordion\";\nimport { ChevronDown } from \"lucide-react\";\n\nimport { cn } from \"../../../lib/utils\";\n\nconst Accordion = AccordionPrimitive.Root;\n\nconst AccordionItem = React.forwardRef<\n React.ElementRef<typeof AccordionPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Item>\n>(({ className, ...props }, ref) => (\n <AccordionPrimitive.Item ref={ref} className={cn(\"border-b\", className)} {...props} />\n));\nAccordionItem.displayName = \"AccordionItem\";\n\nconst AccordionTrigger = React.forwardRef<\n React.ElementRef<typeof AccordionPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Trigger>\n>(({ className, children, ...props }, ref) => (\n <AccordionPrimitive.Header className=\"flex\">\n <AccordionPrimitive.Trigger\n ref={ref}\n className={cn(\n \"flex flex-1 items-center justify-between py-4 text-sm font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180\",\n className\n )}\n {...props}\n >\n {children}\n <ChevronDown className=\"h-4 w-4 shrink-0 text-muted-foreground transition-transform duration-200\" />\n </AccordionPrimitive.Trigger>\n </AccordionPrimitive.Header>\n));\nAccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName;\n\nconst AccordionContent = React.forwardRef<\n React.ElementRef<typeof AccordionPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Content>\n>(({ className, children, ...props }, ref) => (\n <AccordionPrimitive.Content\n ref={ref}\n className=\"overflow-hidden text-sm text-muted-foreground data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down\"\n {...props}\n >\n <div className={cn(\"pb-4 pt-0\", className)}>{children}</div>\n </AccordionPrimitive.Content>\n));\nAccordionContent.displayName = AccordionPrimitive.Content.displayName;\n\nexport { Accordion, AccordionItem, AccordionTrigger, AccordionContent };\n","import * as React from \"react\";\nimport { icons } from \"lucide-react\";\nimport type { A2uiNodeProps } from \"../registry\";\nimport { cn } from \"../../../lib/utils\";\nimport { styleProps } from \"../style-props\";\nimport { Alert, AlertTitle, AlertDescription } from \"../../atoms/ui/alert\";\nimport { Badge } from \"../../atoms/ui/badge\";\nimport { Avatar, AvatarImage, AvatarFallback } from \"../../atoms/ui/avatar\";\nimport { RichText } from \"../../atoms/ui/rich-text\";\n\nconst SAFE_IMG = /^data:image\\/(png|jpe?g|gif|webp|svg\\+xml);/i;\n\nexport const Text: React.FC<A2uiNodeProps> = ({ node }) => {\n const variant = node.variant === \"muted\" || node.variant === \"caption\" ? \"text-muted-foreground\" : \"text-foreground\";\n const size = node.variant === \"lead\" ? \"text-lg\" : node.variant === \"caption\" ? \"text-xs\" : \"\";\n return <p className={cn(variant, size, styleProps(node))}>{String(node.text ?? \"\")}</p>;\n};\n\nexport const Heading: React.FC<A2uiNodeProps> = ({ node }) => {\n const level = typeof node.level === \"number\" ? Math.min(Math.max(node.level, 1), 4) : 1;\n const Tag = ([\"h1\", \"h2\", \"h3\", \"h4\"][level - 1]) as keyof JSX.IntrinsicElements;\n const size = [\"text-2xl\", \"text-xl\", \"text-lg\", \"text-base\"][level - 1];\n return <Tag className={cn(\"font-semibold text-foreground\", size, styleProps(node))}>{String(node.text ?? \"\")}</Tag>;\n};\n\n/**\n * Delegates to the shared `RichText` atom (react-markdown WITHOUT rehype-raw, so raw\n * HTML is stripped/escaped — the security invariant lives in the atom, not here).\n */\nexport const Markdown: React.FC<A2uiNodeProps> = ({ node }) => (\n <RichText\n content={String(node.text ?? \"\")}\n className={cn(\"prose prose-sm dark:prose-invert max-w-none\", styleProps(node))}\n />\n);\n\nexport const ImageNode: React.FC<A2uiNodeProps> = ({ node }) => {\n const src = typeof node.src === \"string\" ? node.src : \"\";\n if (!SAFE_IMG.test(src)) return <span className=\"text-muted-foreground text-sm\">[image omitted]</span>;\n // eslint-disable-next-line jsx-a11y/alt-text\n return (\n <img\n src={src}\n alt={typeof node.alt === \"string\" ? node.alt : \"\"}\n className={cn(\"max-w-full rounded-md\", styleProps(node))}\n />\n );\n};\n\nexport const IconNode: React.FC<A2uiNodeProps> = ({ node }) => {\n const name = typeof node.name === \"string\" ? node.name : \"\";\n const Cmp = (icons as Record<string, React.ComponentType<{ className?: string }>>)[name];\n if (!Cmp) return null;\n return <Cmp className={cn(\"h-4 w-4\", styleProps(node))} />;\n};\n\nconst BADGE_VARIANT: Record<string, \"default\" | \"secondary\" | \"outline\"> = {\n solid: \"default\",\n outline: \"outline\",\n subtle: \"secondary\",\n};\nexport const BadgeNode: React.FC<A2uiNodeProps> = ({ node }) => (\n <Badge variant={BADGE_VARIANT[String(node.variant ?? \"solid\")] ?? \"default\"} className={styleProps(node)}>\n {String(node.text ?? \"\")}\n </Badge>\n);\n\nexport const AvatarNode: React.FC<A2uiNodeProps> = ({ node }) => {\n const src = typeof node.src === \"string\" && SAFE_IMG.test(node.src) ? node.src : undefined;\n const fallback = typeof node.fallback === \"string\" ? node.fallback.slice(0, 2).toUpperCase() : \"?\";\n return (\n <Avatar className={styleProps(node)}>\n {src && <AvatarImage src={src} />}\n <AvatarFallback>{fallback}</AvatarFallback>\n </Avatar>\n );\n};\n\nconst ALERT_VARIANT: Record<string, \"default\" | \"destructive\"> = {\n info: \"default\",\n success: \"default\",\n warning: \"default\",\n danger: \"destructive\",\n};\nexport const AlertNode: React.FC<A2uiNodeProps> = ({ node }) => (\n <Alert variant={ALERT_VARIANT[String(node.variant ?? \"info\")] ?? \"default\"} className={styleProps(node)}>\n {typeof node.title === \"string\" && <AlertTitle>{node.title}</AlertTitle>}\n <AlertDescription>{String(node.text ?? \"\")}</AlertDescription>\n </Alert>\n);\n\nexport const Stat: React.FC<A2uiNodeProps> = ({ node }) => {\n // Accept the canonical label/value, but fall back to title/text — models commonly\n // reach for those prop names.\n const label = node.label ?? node.title;\n const value = node.value ?? node.text;\n return (\n <div className={cn(\"flex flex-col\", styleProps(node))}>\n {label != null && <span className=\"text-sm text-muted-foreground\">{String(label)}</span>}\n <span className=\"text-2xl font-semibold text-foreground\">{String(value ?? \"\")}</span>\n {typeof node.delta === \"string\" && <span className=\"text-sm text-muted-foreground\">{node.delta}</span>}\n </div>\n );\n};\n\nexport const KeyValueNode: React.FC<A2uiNodeProps> = ({ node, value }) => {\n const src = value && typeof value === \"object\" ? value : node.data && typeof node.data === \"object\" ? node.data : {};\n const obj = src as Record<string, unknown>;\n return (\n <dl className={cn(\"grid grid-cols-2 gap-x-4 gap-y-1\", styleProps(node))}>\n {Object.entries(obj).map(([k, v]) => (\n <React.Fragment key={k}>\n <dt className=\"text-muted-foreground\">{k}</dt>\n <dd className=\"text-foreground\">{String(v)}</dd>\n </React.Fragment>\n ))}\n </dl>\n );\n};\n\nexport const ListNode: React.FC<A2uiNodeProps> = ({ node, value }) => {\n const items = Array.isArray(value) ? value : Array.isArray(node.items) ? node.items : [];\n const ordered = node.ordered === true;\n const Tag = ordered ? \"ol\" : \"ul\";\n return (\n <Tag className={cn(ordered ? \"list-decimal\" : \"list-disc\", \"pl-5\", styleProps(node))}>\n {items.map((it, i) => (\n <li key={i}>{String(it)}</li>\n ))}\n </Tag>\n );\n};\n\nexport const Quote: React.FC<A2uiNodeProps> = ({ node }) => (\n <blockquote className={cn(\"border-l-2 border-border pl-4 italic text-muted-foreground\", styleProps(node))}>\n {String(node.text ?? \"\")}\n {typeof node.cite === \"string\" && <footer className=\"mt-1 text-xs not-italic\">— {node.cite}</footer>}\n </blockquote>\n);\n","import * as React from \"react\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\n\nimport { cn } from \"../../../lib/utils\";\n\nconst alertVariants = cva(\n \"relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground\",\n {\n variants: {\n variant: {\n default: \"bg-background text-foreground\",\n destructive:\n \"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n },\n }\n);\n\nconst Alert = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement> & VariantProps<typeof alertVariants>\n>(({ className, variant, ...props }, ref) => (\n <div\n ref={ref}\n role=\"alert\"\n className={cn(alertVariants({ variant }), className)}\n {...props}\n />\n));\nAlert.displayName = \"Alert\";\n\nconst AlertTitle = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLHeadingElement>\n>(({ className, ...props }, ref) => (\n <h5\n ref={ref}\n className={cn(\"mb-1 font-medium leading-none tracking-tight\", className)}\n {...props}\n />\n));\nAlertTitle.displayName = \"AlertTitle\";\n\nconst AlertDescription = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLParagraphElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\"text-sm [&_p]:leading-relaxed\", className)}\n {...props}\n />\n));\nAlertDescription.displayName = \"AlertDescription\";\n\nexport { Alert, AlertTitle, AlertDescription };\n","import * as React from \"react\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\n\nimport { cn } from \"../../../lib/utils\";\n\nconst badgeVariants = cva(\n \"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2\",\n {\n variants: {\n variant: {\n default:\n \"border-transparent bg-primary text-primary-foreground hover:bg-primary/80\",\n secondary:\n \"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80\",\n destructive:\n \"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80\",\n outline: \"text-foreground\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n },\n }\n)\n\nexport interface BadgeProps\n extends React.HTMLAttributes<HTMLDivElement>,\n VariantProps<typeof badgeVariants> {}\n\nfunction Badge({ className, variant, ...props }: BadgeProps) {\n return (\n <div className={cn(badgeVariants({ variant }), className, \"alq--badge\")} {...props} />\n )\n}\n\nexport { Badge, badgeVariants }\n","\"use client\"\n\nimport * as React from \"react\"\nimport * as AvatarPrimitive from \"@radix-ui/react-avatar\"\n\nimport { cn } from \"../../../lib/utils\";\n\nconst Avatar = React.forwardRef<\n React.ElementRef<typeof AvatarPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Root>\n>(({ className, ...props }, ref) => (\n <AvatarPrimitive.Root\n ref={ref}\n className={cn(\n \"relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full\",\n className\n )}\n {...props}\n />\n))\nAvatar.displayName = AvatarPrimitive.Root.displayName\n\nconst AvatarImage = React.forwardRef<\n React.ElementRef<typeof AvatarPrimitive.Image>,\n React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Image>\n>(({ className, ...props }, ref) => (\n <AvatarPrimitive.Image\n ref={ref}\n className={cn(\"aspect-square h-full w-full\", className)}\n {...props}\n />\n))\nAvatarImage.displayName = AvatarPrimitive.Image.displayName\n\nconst AvatarFallback = React.forwardRef<\n React.ElementRef<typeof AvatarPrimitive.Fallback>,\n React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Fallback>\n>(({ className, ...props }, ref) => (\n <AvatarPrimitive.Fallback\n ref={ref}\n className={cn(\n \"flex h-full w-full items-center justify-center rounded-full bg-muted\",\n className\n )}\n {...props}\n />\n))\nAvatarFallback.displayName = AvatarPrimitive.Fallback.displayName\n\nexport { Avatar, AvatarImage, AvatarFallback }\n","import * as React from \"react\";\nimport ReactMarkdown from \"react-markdown\";\nimport remarkGfm from \"remark-gfm\";\nimport { cn } from \"../../../lib/utils\";\n\ninterface RichTextProps extends React.HTMLAttributes<HTMLDivElement> {\n content: string;\n className?: string;\n}\n\nfunction RichText({ content, className }: RichTextProps) {\n return (\n <ReactMarkdown className={cn(className)} remarkPlugins={[remarkGfm]}>\n {content}\n </ReactMarkdown>\n );\n}\n\nexport { RichText };\n","import * as React from \"react\";\nimport { format } from \"date-fns\";\nimport { Star } from \"lucide-react\";\nimport type { A2uiNodeProps } from \"../registry\";\nimport { cn } from \"../../../lib/utils\";\nimport { styleProps } from \"../style-props\";\nimport { Input } from \"../../atoms/ui/input\";\nimport { Textarea } from \"../../atoms/ui/textarea\";\nimport { Label } from \"../../atoms/ui/label\";\nimport { Checkbox } from \"../../atoms/ui/checkbox\";\nimport { Switch } from \"../../atoms/ui/switch\";\nimport { Slider } from \"../../atoms/ui/slider\";\nimport { Button } from \"../../atoms/ui/button\";\nimport { Calendar } from \"../../atoms/ui/calendar\";\nimport { RadioGroup, RadioGroupItem } from \"../../atoms/ui/radio-group\";\nimport { Popover, PopoverContent, PopoverTrigger } from \"../../atoms/ui/popover\";\nimport {\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n SelectValue,\n} from \"../../atoms/ui/select\";\nimport { Command, CommandInput, CommandList, CommandEmpty, CommandItem } from \"../../atoms/ui/command\";\n\ntype Opt = { label: string; value: string | number };\n// Models often emit options as a plain string array ([\"A\",\"B\"]) instead of\n// {label,value} objects — normalize both forms.\nconst opts = (node: A2uiNodeProps[\"node\"]): Opt[] =>\n Array.isArray(node.options)\n ? node.options.map((o) =>\n typeof o === \"string\" || typeof o === \"number\" ? { label: String(o), value: o } : (o as Opt),\n )\n : [];\n\n/** Parse a value into a valid Date, or undefined. Guards against \"\" and invalid strings. */\nconst toDate = (v: unknown): Date | undefined => {\n if (typeof v !== \"string\" || !v) return undefined;\n const d = new Date(v);\n return isNaN(d.getTime()) ? undefined : d;\n};\n\nconst Field: React.FC<{ id: string; label?: unknown; node: A2uiNodeProps[\"node\"]; children: React.ReactNode }> = ({\n id,\n label,\n node,\n children,\n}) => (\n <div className={cn(\"flex flex-col gap-1.5\", styleProps(node))}>\n {typeof label === \"string\" && <Label htmlFor={id}>{label}</Label>}\n {children}\n </div>\n);\n\nexport const TextField: React.FC<A2uiNodeProps> = ({ node, value, onChange }) => {\n const id = `f-${node.id}`;\n return (\n <Field id={id} label={node.label} node={node}>\n <Input\n id={id}\n placeholder={typeof node.placeholder === \"string\" ? node.placeholder : undefined}\n value={typeof value === \"string\" ? value : \"\"}\n onChange={(e) => onChange?.(e.target.value)}\n />\n </Field>\n );\n};\n\nexport const TextArea: React.FC<A2uiNodeProps> = ({ node, value, onChange }) => {\n const id = `f-${node.id}`;\n return (\n <Field id={id} label={node.label} node={node}>\n <Textarea\n id={id}\n rows={typeof node.rows === \"number\" ? node.rows : undefined}\n placeholder={typeof node.placeholder === \"string\" ? node.placeholder : undefined}\n value={typeof value === \"string\" ? value : \"\"}\n onChange={(e) => onChange?.(e.target.value)}\n />\n </Field>\n );\n};\n\nexport const NumberField: React.FC<A2uiNodeProps> = ({ node, value, onChange }) => {\n const id = `f-${node.id}`;\n return (\n <Field id={id} label={node.label} node={node}>\n <Input\n id={id}\n type=\"number\"\n min={typeof node.min === \"number\" ? node.min : undefined}\n max={typeof node.max === \"number\" ? node.max : undefined}\n step={typeof node.step === \"number\" ? node.step : undefined}\n value={typeof value === \"number\" ? value : \"\"}\n onChange={(e) => onChange?.(e.target.value === \"\" ? undefined : Number(e.target.value))}\n />\n </Field>\n );\n};\n\nexport const SelectNode: React.FC<A2uiNodeProps> = ({ node, value, onChange }) => {\n const id = `f-${node.id}`;\n return (\n <Field id={id} label={node.label} node={node}>\n <Select value={value != null ? String(value) : undefined} onValueChange={(v) => onChange?.(v)}>\n <SelectTrigger id={id}>\n <SelectValue placeholder={typeof node.placeholder === \"string\" ? node.placeholder : undefined} />\n </SelectTrigger>\n <SelectContent>\n {opts(node).map((o) => (\n <SelectItem key={String(o.value)} value={String(o.value)}>\n {o.label}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n </Field>\n );\n};\n\nexport const MultiSelect: React.FC<A2uiNodeProps> = ({ node, value, onChange }) => {\n const selected = Array.isArray(value) ? (value as (string | number)[]) : [];\n const toggle = (v: string | number) =>\n onChange?.(selected.includes(v) ? selected.filter((x) => x !== v) : [...selected, v]);\n return (\n <Field id={`f-${node.id}`} label={node.label} node={node}>\n <div className=\"flex flex-col gap-1.5\">\n {opts(node).map((o) => (\n <label key={String(o.value)} className=\"flex items-center gap-2 text-sm\">\n <Checkbox checked={selected.includes(o.value)} onCheckedChange={() => toggle(o.value)} />\n {o.label}\n </label>\n ))}\n </div>\n </Field>\n );\n};\n\nexport const Combobox: React.FC<A2uiNodeProps> = ({ node, value, onChange }) => {\n const [open, setOpen] = React.useState(false);\n const selected = opts(node).find((o) => o.value === value);\n const placeholder = typeof node.placeholder === \"string\" ? node.placeholder : \"Select…\";\n return (\n <Field id={`f-${node.id}`} label={node.label} node={node}>\n <Popover open={open} onOpenChange={setOpen}>\n <PopoverTrigger asChild>\n <Button variant=\"outline\" role=\"combobox\" className=\"justify-between font-normal\">\n {selected ? selected.label : placeholder}\n </Button>\n </PopoverTrigger>\n <PopoverContent className=\"w-[--radix-popover-trigger-width] p-0\">\n <Command>\n <CommandInput placeholder=\"Search…\" />\n <CommandList>\n <CommandEmpty>No results.</CommandEmpty>\n {opts(node).map((o) => (\n <CommandItem\n key={String(o.value)}\n value={o.label}\n onSelect={() => {\n onChange?.(o.value);\n setOpen(false);\n }}\n >\n {o.label}\n </CommandItem>\n ))}\n </CommandList>\n </Command>\n </PopoverContent>\n </Popover>\n </Field>\n );\n};\n\nexport const CheckboxNode: React.FC<A2uiNodeProps> = ({ node, value, onChange }) => {\n const id = `f-${node.id}`;\n return (\n <div className={cn(\"flex items-center gap-2\", styleProps(node))}>\n <Checkbox id={id} checked={value === true} onCheckedChange={(c) => onChange?.(c === true)} />\n {typeof node.label === \"string\" && <Label htmlFor={id}>{node.label}</Label>}\n </div>\n );\n};\n\nexport const CheckboxGroup: React.FC<A2uiNodeProps> = ({ node, value, onChange }) => {\n const selected = Array.isArray(value) ? (value as (string | number)[]) : [];\n const toggle = (v: string | number) =>\n onChange?.(selected.includes(v) ? selected.filter((x) => x !== v) : [...selected, v]);\n return (\n <Field id={`f-${node.id}`} label={node.label} node={node}>\n <div className=\"flex flex-col gap-1.5\">\n {opts(node).map((o) => (\n <label key={String(o.value)} className=\"flex items-center gap-2 text-sm\">\n <Checkbox checked={selected.includes(o.value)} onCheckedChange={() => toggle(o.value)} />\n {o.label}\n </label>\n ))}\n </div>\n </Field>\n );\n};\n\nexport const Radio: React.FC<A2uiNodeProps> = ({ node, value, onChange }) => (\n <Field id={`f-${node.id}`} label={node.label} node={node}>\n <RadioGroup\n value={value != null ? String(value) : undefined}\n onValueChange={(v) => {\n // Restore the original option type (values can be numbers) before emitting.\n const match = opts(node).find((o) => String(o.value) === v);\n onChange?.(match ? match.value : v);\n }}\n >\n {opts(node).map((o) => {\n const id = `r-${node.id}-${o.value}`;\n return (\n <div key={String(o.value)} className=\"flex items-center gap-2 text-sm\">\n <RadioGroupItem id={id} value={String(o.value)} />\n <Label htmlFor={id} className=\"font-normal\">\n {o.label}\n </Label>\n </div>\n );\n })}\n </RadioGroup>\n </Field>\n);\n\nexport const SwitchNode: React.FC<A2uiNodeProps> = ({ node, value, onChange }) => {\n const id = `f-${node.id}`;\n return (\n <div className={cn(\"flex items-center gap-2\", styleProps(node))}>\n <Switch id={id} checked={value === true} onCheckedChange={(c) => onChange?.(c === true)} />\n {typeof node.label === \"string\" && <Label htmlFor={id}>{node.label}</Label>}\n </div>\n );\n};\n\nexport const SliderNode: React.FC<A2uiNodeProps> = ({ node, value, onChange }) => {\n const min = typeof node.min === \"number\" ? node.min : 0;\n const max = typeof node.max === \"number\" ? node.max : 100;\n const step = typeof node.step === \"number\" ? node.step : 1;\n const v = typeof value === \"number\" ? value : min;\n return (\n <Field id={`f-${node.id}`} label={node.label} node={node}>\n <Slider min={min} max={max} step={step} value={[v]} onValueChange={(vals) => onChange?.(vals[0])} />\n </Field>\n );\n};\n\nexport const DatePicker: React.FC<A2uiNodeProps> = ({ node, value, onChange }) => {\n const selected = toDate(value);\n const label = selected ? format(selected, \"PPP\") : \"Pick a date\";\n return (\n <Field id={`f-${node.id}`} label={node.label} node={node}>\n <Popover>\n <PopoverTrigger asChild>\n <Button variant=\"outline\" className=\"justify-start font-normal\">\n {label}\n </Button>\n </PopoverTrigger>\n <PopoverContent className=\"w-auto p-0\">\n <Calendar mode=\"single\" selected={selected} onSelect={(d?: Date) => d && onChange?.(d.toISOString())} />\n </PopoverContent>\n </Popover>\n </Field>\n );\n};\n\nexport const DateRange: React.FC<A2uiNodeProps> = ({ node, value, onChange }) => {\n const parsed = value && typeof value === \"object\" ? (value as { from?: string; to?: string | null }) : undefined;\n const from = toDate(parsed?.from);\n const to = toDate(parsed?.to);\n const selected = from ? { from, to } : undefined;\n const label = from ? `${format(from, \"PP\")} – ${to ? format(to, \"PP\") : \"…\"}` : \"Pick a range\";\n return (\n <Field id={`f-${node.id}`} label={node.label} node={node}>\n <Popover>\n <PopoverTrigger asChild>\n <Button variant=\"outline\" className=\"justify-start font-normal\">\n {label}\n </Button>\n </PopoverTrigger>\n <PopoverContent className=\"w-auto p-0\">\n <Calendar\n mode=\"range\"\n selected={selected}\n onSelect={(r) =>\n onChange?.({ from: r?.from?.toISOString() ?? null, to: r?.to?.toISOString() ?? null })\n }\n />\n </PopoverContent>\n </Popover>\n </Field>\n );\n};\n\n/** Collects file METADATA only (name/size/type). File bytes ride the SDK attachment path, never the tool result. */\nexport const FileUpload: React.FC<A2uiNodeProps> = ({ node, onChange }) => {\n const id = `f-${node.id}`;\n return (\n <Field id={id} label={node.label} node={node}>\n <Input\n id={id}\n type=\"file\"\n accept={typeof node.accept === \"string\" ? node.accept : undefined}\n multiple={node.multiple === true}\n onChange={(e) =>\n onChange?.(\n Array.from(e.target.files ?? []).map((f) => ({ name: f.name, size: f.size, type: f.type })),\n )\n }\n />\n </Field>\n );\n};\n\n/**\n * Inline N-star rating input. NOT the `rating-stars` molecule — that one is a collapsed\n * feedback-popover widget (fixed 5 stars, requires isLoading), the wrong UX for a form\n * field. The lib has no generic inline-rating primitive; this is a candidate to promote\n * to an atom if another consumer needs it.\n */\nexport const Rating: React.FC<A2uiNodeProps> = ({ node, value, onChange }) => {\n const max = typeof node.max === \"number\" ? node.max : 5;\n const current = typeof value === \"number\" ? value : 0;\n return (\n <Field id={`f-${node.id}`} label={node.label} node={node}>\n <div className=\"flex items-center gap-1\" role=\"radiogroup\" aria-label=\"rating\">\n {Array.from({ length: max }, (_, i) => i + 1).map((n) => (\n <button\n key={n}\n type=\"button\"\n aria-label={`${n} star${n > 1 ? \"s\" : \"\"}`}\n onClick={() => onChange?.(n)}\n className=\"text-amber-500\"\n >\n <Star className={cn(\"h-5 w-5\", n <= current ? \"fill-current\" : \"opacity-40\")} />\n </button>\n ))}\n </div>\n </Field>\n );\n};\n","import { forwardRef } from \"react\";\n\nimport { cn } from \"../../../lib/utils\";\n\nexport interface InputProps\n extends React.InputHTMLAttributes<HTMLInputElement> {}\n\nconst Input = forwardRef<HTMLInputElement, InputProps>(\n ({ className, type, ...props }, ref) => {\n return (\n <input\n type={type}\n className={cn(\n \"flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50\",\n className,\n \"alq--input\"\n )}\n ref={ref}\n {...props}\n />\n );\n }\n);\nInput.displayName = \"Input\";\n\nexport { Input };\n","import * as React from \"react\";\n\nimport { cn } from \"../../../lib/utils\";\n\nexport interface TextareaProps\n extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {}\n\nconst Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(\n ({ className, ...props }, ref) => {\n return (\n <textarea\n className={cn(\n \"flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50\",\n className,\n \"alq--textarea\"\n )}\n ref={ref}\n {...props}\n />\n );\n }\n);\nTextarea.displayName = \"Textarea\";\n\nexport { Textarea };\n","\"use client\";\n\nimport * as React from \"react\";\nimport * as LabelPrimitive from \"@radix-ui/react-label\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\n\nimport { cn } from \"../../../lib/utils\";\n\nconst labelVariants = cva(\n \"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70\"\n);\n\nconst Label = React.forwardRef<\n React.ElementRef<typeof LabelPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> &\n VariantProps<typeof labelVariants>\n>(({ className, ...props }, ref) => (\n <LabelPrimitive.Root\n ref={ref}\n className={cn(labelVariants(), className, \"alq--label\")}\n {...props}\n />\n));\nLabel.displayName = LabelPrimitive.Root.displayName;\n\nexport { Label };\n","\"use client\";\n\nimport * as React from \"react\";\nimport * as CheckboxPrimitive from \"@radix-ui/react-checkbox\";\nimport { Check } from \"lucide-react\";\n\nimport { cn } from \"../../../lib/utils\";\n\nconst Checkbox = React.forwardRef<\n React.ElementRef<typeof CheckboxPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>\n>(({ className, ...props }, ref) => (\n <CheckboxPrimitive.Root\n ref={ref}\n className={cn(\n \"peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground\",\n className,\n \"alq--checkbox\"\n )}\n {...props}\n >\n <CheckboxPrimitive.Indicator\n className={cn(\"flex items-center justify-center text-current\")}\n >\n <Check className=\"h-4 w-4\" />\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n));\nCheckbox.displayName = CheckboxPrimitive.Root.displayName;\n\nexport { Checkbox };\n","\"use client\";\n\nimport * as React from \"react\";\nimport * as SwitchPrimitives from \"@radix-ui/react-switch\";\n\nimport { cn } from \"../../../lib/utils\";\n\nconst Switch = React.forwardRef<\n React.ElementRef<typeof SwitchPrimitives.Root>,\n React.ComponentPropsWithoutRef<typeof SwitchPrimitives.Root>\n>(({ className, ...props }, ref) => (\n <SwitchPrimitives.Root\n className={cn(\n \"peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input\",\n className,\n \"alq--switch\"\n )}\n {...props}\n ref={ref}\n >\n <SwitchPrimitives.Thumb\n className={cn(\n \"pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0\"\n )}\n />\n </SwitchPrimitives.Root>\n));\nSwitch.displayName = SwitchPrimitives.Root.displayName;\n\nexport { Switch };\n","\"use client\";\n\nimport * as React from \"react\";\nimport * as SliderPrimitive from \"@radix-ui/react-slider\";\n\nimport { cn } from \"../../../lib/utils\";\n\nconst Slider = React.forwardRef<\n React.ElementRef<typeof SliderPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof SliderPrimitive.Root>\n>(({ className, ...props }, ref) => (\n <SliderPrimitive.Root\n ref={ref}\n className={cn(\n \"relative flex w-44 touch-none select-none items-center\",\n className,\n \"alq--slider\"\n )}\n {...props}\n >\n <SliderPrimitive.Track className=\"relative h-2 w-44 grow overflow-hidden rounded-full bg-primary\">\n <SliderPrimitive.Range className=\"absolute h-full bg-secondary\" />\n </SliderPrimitive.Track>\n <SliderPrimitive.Thumb className=\"block h-5 w-5 rounded-full border-2 border-gray bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50\" />\n </SliderPrimitive.Root>\n));\nSlider.displayName = SliderPrimitive.Root.displayName;\n\nexport { Slider };\n","import * as React from \"react\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\n\nimport { cn } from \"../../../lib/utils\";\n\nconst buttonVariants = cva(\n \"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0\",\n {\n variants: {\n variant: {\n default: \"bg-primary text-primary-foreground hover:bg-primary/90\",\n destructive:\n \"bg-destructive text-destructive-foreground hover:bg-destructive/90\",\n outline:\n \"border border-input bg-background hover:bg-accent hover:text-accent-foreground\",\n secondary:\n \"bg-secondary text-secondary-foreground hover:bg-secondary/80\",\n ghost: \"hover:bg-accent hover:text-accent-foreground\",\n link: \"text-primary underline-offset-4 hover:underline\",\n },\n size: {\n default: \"h-10 px-4 py-2\",\n sm: \"h-9 rounded-md px-3\",\n lg: \"h-11 rounded-md px-8\",\n icon: \"h-10 w-10\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n }\n);\n\nexport interface ButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof buttonVariants> {\n asChild?: boolean;\n}\n\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n ({ className, variant, size, asChild = false, ...props }, ref) => {\n const Comp = asChild ? Slot : \"button\";\n return (\n <Comp\n className={cn(buttonVariants({ variant, size, className }))}\n ref={ref}\n {...props}\n />\n );\n }\n);\nButton.displayName = \"Button\";\n\nexport { Button, buttonVariants };\n","\"use client\";\n\nimport * as React from \"react\";\nimport { ChevronLeft, ChevronRight } from \"lucide-react\";\nimport { DayPicker } from \"react-day-picker\";\n\nimport { cn } from \"../../../lib/utils\";\nimport { buttonVariants } from \"./button\";\n\nexport type CalendarProps = React.ComponentProps<typeof DayPicker>;\n\nfunction Calendar({ className, classNames, showOutsideDays = true, ...props }: CalendarProps) {\n return (\n <DayPicker\n showOutsideDays={showOutsideDays}\n className={cn(\"p-3\", className)}\n classNames={{\n months: \"flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0\",\n month: \"space-y-4\",\n caption: \"flex justify-center pt-1 relative items-center\",\n caption_label: \"text-sm font-medium\",\n nav: \"space-x-1 flex items-center\",\n nav_button: cn(\n buttonVariants({ variant: \"outline\" }),\n \"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100\"\n ),\n nav_button_previous: \"absolute left-1\",\n nav_button_next: \"absolute right-1\",\n table: \"w-full border-collapse space-y-1\",\n head_row: \"flex\",\n head_cell: \"text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]\",\n row: \"flex w-full mt-2\",\n cell: \"h-9 w-9 text-center text-sm p-0 relative [&:has([aria-selected])]:bg-accent first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md focus-within:relative focus-within:z-20\",\n day: cn(buttonVariants({ variant: \"ghost\" }), \"h-9 w-9 p-0 font-normal aria-selected:opacity-100\"),\n day_range_end: \"day-range-end\",\n day_selected:\n \"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground\",\n day_today: \"bg-accent text-accent-foreground\",\n day_outside: \"day-outside text-muted-foreground opacity-50\",\n day_disabled: \"text-muted-foreground opacity-50\",\n day_range_middle: \"aria-selected:bg-accent aria-selected:text-accent-foreground\",\n day_hidden: \"invisible\",\n ...classNames,\n }}\n components={{\n IconLeft: () => <ChevronLeft className=\"h-4 w-4\" />,\n IconRight: () => <ChevronRight className=\"h-4 w-4\" />,\n }}\n {...props}\n />\n );\n}\nCalendar.displayName = \"Calendar\";\n\nexport { Calendar };\n","\"use client\";\n\nimport * as React from \"react\";\nimport * as RadioGroupPrimitive from \"@radix-ui/react-radio-group\";\nimport { Circle } from \"lucide-react\";\n\nimport { cn } from \"../../../lib/utils\";\n\nconst RadioGroup = React.forwardRef<\n React.ElementRef<typeof RadioGroupPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root>\n>(({ className, ...props }, ref) => (\n <RadioGroupPrimitive.Root ref={ref} className={cn(\"grid gap-2\", className)} {...props} />\n));\nRadioGroup.displayName = RadioGroupPrimitive.Root.displayName;\n\nconst RadioGroupItem = React.forwardRef<\n React.ElementRef<typeof RadioGroupPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item>\n>(({ className, ...props }, ref) => (\n <RadioGroupPrimitive.Item\n ref={ref}\n className={cn(\n \"aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50\",\n className\n )}\n {...props}\n >\n <RadioGroupPrimitive.Indicator className=\"flex items-center justify-center\">\n <Circle className=\"h-2.5 w-2.5 fill-current text-current\" />\n </RadioGroupPrimitive.Indicator>\n </RadioGroupPrimitive.Item>\n));\nRadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName;\n\nexport { RadioGroup, RadioGroupItem };\n","\"use client\";\n\nimport * as React from \"react\";\nimport * as PopoverPrimitive from \"@radix-ui/react-popover\";\n\nimport { cn } from \"../../../lib/utils\";\n\nconst Popover = PopoverPrimitive.Root;\n\nconst PopoverTrigger = PopoverPrimitive.Trigger;\n\nconst PopoverContent = React.forwardRef<\n React.ElementRef<typeof PopoverPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content>\n>(({ className, align = \"center\", sideOffset = 4, ...props }, ref) => (\n <PopoverPrimitive.Portal>\n <PopoverPrimitive.Content\n ref={ref}\n align={align}\n sideOffset={sideOffset}\n className={cn(\n \"z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 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\",\n className\n )}\n {...props}\n />\n </PopoverPrimitive.Portal>\n));\nPopoverContent.displayName = PopoverPrimitive.Content.displayName;\n\nexport { Popover, PopoverTrigger, PopoverContent };\n","\"use client\";\n\nimport * as React from \"react\";\nimport * as SelectPrimitive from \"@radix-ui/react-select\";\nimport { Check, ChevronDown, ChevronUp } from \"lucide-react\";\nimport { cn } from \"../../../lib/utils\";\n\nconst Select = SelectPrimitive.Root;\n\nconst SelectGroup = SelectPrimitive.Group;\n\nconst SelectValue = SelectPrimitive.Value;\n\nconst SelectTrigger = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>\n>(({ className, children, ...props }, ref) => (\n <SelectPrimitive.Trigger\n ref={ref}\n className={cn(\n \"flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1\",\n className,\n \"alq--select\"\n )}\n {...props}\n >\n {children}\n <SelectPrimitive.Icon asChild>\n <ChevronDown className=\"h-4 w-4 opacity-50\" />\n </SelectPrimitive.Icon>\n </SelectPrimitive.Trigger>\n));\nSelectTrigger.displayName = SelectPrimitive.Trigger.displayName;\n\nconst SelectScrollUpButton = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.ScrollUpButton>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollUpButton>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.ScrollUpButton\n ref={ref}\n className={cn(\n \"flex cursor-default items-center justify-center py-1\",\n className\n )}\n {...props}\n >\n <ChevronUp className=\"h-4 w-4\" />\n </SelectPrimitive.ScrollUpButton>\n));\nSelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;\n\nconst SelectScrollDownButton = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.ScrollDownButton>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollDownButton>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.ScrollDownButton\n ref={ref}\n className={cn(\n \"flex cursor-default items-center justify-center py-1\",\n className\n )}\n {...props}\n >\n <ChevronDown className=\"h-4 w-4\" />\n </SelectPrimitive.ScrollDownButton>\n));\nSelectScrollDownButton.displayName =\n SelectPrimitive.ScrollDownButton.displayName;\n\nconst SelectContent = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content>\n>(({ className, children, position = \"popper\", ...props }, ref) => (\n <SelectPrimitive.Portal>\n <SelectPrimitive.Content\n ref={ref}\n className={cn(\n \"relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 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\",\n position === \"popper\" &&\n \"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1\",\n className\n )}\n position={position}\n {...props}\n >\n <SelectScrollUpButton />\n <SelectPrimitive.Viewport\n className={cn(\n \"p-1\",\n position === \"popper\" &&\n \"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]\"\n )}\n >\n {children}\n </SelectPrimitive.Viewport>\n <SelectScrollDownButton />\n </SelectPrimitive.Content>\n </SelectPrimitive.Portal>\n));\nSelectContent.displayName = SelectPrimitive.Content.displayName;\n\nconst SelectLabel = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Label>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.Label\n ref={ref}\n className={cn(\"py-1.5 pl-8 pr-2 text-sm font-semibold\", className)}\n {...props}\n />\n));\nSelectLabel.displayName = SelectPrimitive.Label.displayName;\n\nconst SelectItem = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item>\n>(({ className, children, ...props }, ref) => (\n <SelectPrimitive.Item\n ref={ref}\n className={cn(\n \"relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50\",\n className\n )}\n {...props}\n >\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <SelectPrimitive.ItemIndicator>\n <Check className=\"h-4 w-4\" />\n </SelectPrimitive.ItemIndicator>\n </span>\n\n <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>\n </SelectPrimitive.Item>\n));\nSelectItem.displayName = SelectPrimitive.Item.displayName;\n\nconst SelectSeparator = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.Separator\n ref={ref}\n className={cn(\"-mx-1 my-1 h-px bg-muted\", className)}\n {...props}\n />\n));\nSelectSeparator.displayName = SelectPrimitive.Separator.displayName;\n\nexport {\n Select,\n SelectGroup,\n SelectValue,\n SelectTrigger,\n SelectContent,\n SelectLabel,\n SelectItem,\n SelectSeparator,\n SelectScrollUpButton,\n SelectScrollDownButton,\n};\n","\"use client\";\n\nimport * as React from \"react\";\nimport { type DialogProps } from \"@radix-ui/react-dialog\";\nimport { Command as CommandPrimitive } from \"cmdk\";\nimport { Search } from \"lucide-react\";\n\nimport { cn } from \"../../../lib/utils\";\nimport { Dialog, DialogContent } from \"./dialog\";\n\nconst Command = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive\n ref={ref}\n className={cn(\n \"flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground\",\n className\n )}\n {...props}\n />\n));\nCommand.displayName = CommandPrimitive.displayName;\n\ninterface CommandDialogProps extends DialogProps {}\n\nconst CommandDialog = ({ children, ...props }: CommandDialogProps) => {\n return (\n <Dialog {...props}>\n <DialogContent className=\"overflow-hidden p-0 shadow-lg\">\n <Command className=\"[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5\">\n {children}\n </Command>\n </DialogContent>\n </Dialog>\n );\n};\n\nconst CommandInput = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive.Input>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Input>\n>(({ className, ...props }, ref) => (\n <div className=\"flex items-center border-b px-3\" cmdk-input-wrapper=\"\">\n <Search className=\"mr-2 h-4 w-4 shrink-0 opacity-50\" />\n <CommandPrimitive.Input\n ref={ref}\n className={cn(\n \"flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50\",\n className\n )}\n {...props}\n />\n </div>\n));\n\nCommandInput.displayName = CommandPrimitive.Input.displayName;\n\nconst CommandList = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive.List>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.List>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.List\n ref={ref}\n className={cn(\"max-h-[300px] overflow-y-auto overflow-x-hidden\", className)}\n {...props}\n />\n));\n\nCommandList.displayName = CommandPrimitive.List.displayName;\n\nconst CommandEmpty = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive.Empty>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Empty>\n>((props, ref) => (\n <CommandPrimitive.Empty\n ref={ref}\n className=\"py-6 text-center text-sm\"\n {...props}\n />\n));\n\nCommandEmpty.displayName = CommandPrimitive.Empty.displayName;\n\nconst CommandGroup = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive.Group>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Group>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.Group\n ref={ref}\n className={cn(\n \"overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground\",\n className\n )}\n {...props}\n />\n));\n\nCommandGroup.displayName = CommandPrimitive.Group.displayName;\n\nconst CommandSeparator = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.Separator\n ref={ref}\n className={cn(\"-mx-1 h-px bg-border\", className)}\n {...props}\n />\n));\nCommandSeparator.displayName = CommandPrimitive.Separator.displayName;\n\nconst CommandItem = React.forwardRef<\n React.ElementRef<typeof CommandPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Item>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.Item\n ref={ref}\n className={cn(\n \"relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0\",\n className\n )}\n {...props}\n />\n));\n\nCommandItem.displayName = CommandPrimitive.Item.displayName;\n\nconst CommandShortcut = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLSpanElement>) => {\n return (\n <span\n className={cn(\n \"ml-auto text-xs tracking-widest text-muted-foreground\",\n className\n )}\n {...props}\n />\n );\n};\nCommandShortcut.displayName = \"CommandShortcut\";\n\nexport {\n Command,\n CommandDialog,\n CommandInput,\n CommandList,\n CommandEmpty,\n CommandGroup,\n CommandItem,\n CommandShortcut,\n CommandSeparator,\n};\n","\"use client\";\n\nimport * as React from \"react\";\nimport * as DialogPrimitive from \"@radix-ui/react-dialog\";\nimport { X } from \"lucide-react\";\n\nimport { cn } from \"../../../lib/utils\";\n\nconst Dialog = DialogPrimitive.Root;\n\nconst DialogTrigger = DialogPrimitive.Trigger;\n\nconst DialogPortal = DialogPrimitive.Portal;\n\nconst DialogClose = DialogPrimitive.Close;\n\nconst DialogOverlay = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Overlay\n ref={ref}\n className={cn(\n \"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0\",\n className\n )}\n {...props}\n />\n));\nDialogOverlay.displayName = DialogPrimitive.Overlay.displayName;\n\nconst DialogContent = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>\n>(({ className, children, ...props }, ref) => (\n <DialogPortal>\n <DialogOverlay />\n <DialogPrimitive.Content\n ref={ref}\n className={cn(\n \"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg\",\n className,\n \"alq--dialog-content\"\n )}\n {...props}\n >\n {children}\n <DialogPrimitive.Close className=\"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground\">\n <X className=\"h-4 w-4\" />\n <span className=\"sr-only\">Close</span>\n </DialogPrimitive.Close>\n </DialogPrimitive.Content>\n </DialogPortal>\n));\nDialogContent.displayName = DialogPrimitive.Content.displayName;\n\nconst DialogHeader = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\n \"flex flex-col space-y-1.5 text-center sm:text-left text-foreground\",\n className,\n \"alq--dialog-header\"\n )}\n {...props}\n />\n);\nDialogHeader.displayName = \"DialogHeader\";\n\nconst DialogFooter = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\n \"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2\",\n className\n )}\n {...props}\n />\n);\nDialogFooter.displayName = \"DialogFooter\";\n\nconst DialogTitle = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Title\n ref={ref}\n className={cn(\n \"text-lg font-semibold leading-none tracking-tight text-foreground\",\n className,\n \"alq--dialog-title\"\n )}\n {...props}\n />\n));\nDialogTitle.displayName = DialogPrimitive.Title.displayName;\n\nconst DialogDescription = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Description\n ref={ref}\n className={cn(\"text-sm text-muted-foreground\", className)}\n {...props}\n />\n));\nDialogDescription.displayName = DialogPrimitive.Description.displayName;\n\nexport {\n Dialog,\n DialogPortal,\n DialogOverlay,\n DialogClose,\n DialogTrigger,\n DialogContent,\n DialogHeader,\n DialogFooter,\n DialogTitle,\n DialogDescription,\n};\n","import * as React from \"react\";\nimport {\n useReactTable,\n getCoreRowModel,\n getSortedRowModel,\n flexRender,\n type ColumnDef,\n type SortingState,\n} from \"@tanstack/react-table\";\nimport { BarChart, Bar, LineChart, Line, AreaChart, Area, PieChart, Pie, Cell, Tooltip, Legend } from \"recharts\";\nimport type { A2uiNodeProps } from \"../registry\";\nimport { cn } from \"../../../lib/utils\";\nimport { styleProps } from \"../style-props\";\nimport { Table, TableHeader, TableBody, TableRow, TableHead, TableCell } from \"../../atoms/ui/table\";\nimport { Progress as ProgressBar } from \"../../atoms/ui/progress\";\nimport { Chart, CHART_PALETTE, themedChartAxes } from \"../../atoms/ui/chart\";\n\nconst PALETTE = CHART_PALETTE;\n\nexport const TableNode: React.FC<A2uiNodeProps> = ({ node, value, onAction }) => {\n // Data comes from the bound dataModel (`value`) OR inline `node.rows`/`node.data`.\n const data = (\n Array.isArray(value) ? value : Array.isArray(node.rows) ? node.rows : Array.isArray(node.data) ? node.data : []\n ) as Array<Record<string, unknown>>;\n let cols = (Array.isArray(node.columns) ? node.columns : []).map((c) =>\n typeof c === \"string\" ? { key: c, header: c } : c,\n ) as Array<{ key?: string; header?: string }>;\n // If the model gave no usable columns, derive them from the first row's keys.\n if (!cols.some((c) => c.key) && data.length) {\n cols = Object.keys(data[0]).map((k) => ({ key: k, header: k }));\n }\n const sortable = node.sortable === true;\n const [sorting, setSorting] = React.useState<SortingState>([]);\n\n const columns = React.useMemo<ColumnDef<Record<string, unknown>>[]>(\n () =>\n cols.map((c, i) => {\n const id = String(c.key ?? `col_${i}`);\n const header = String(c.header ?? c.key ?? `Column ${i + 1}`);\n // Always give an explicit id + string header so TanStack never has to derive\n // one (which throws when the agent omits key/header).\n return c.key\n ? { id, accessorKey: c.key, header }\n : { id, accessorFn: () => \"\", header };\n }),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [node],\n );\n\n const table = useReactTable({\n data,\n columns,\n state: { sorting },\n onSortingChange: setSorting,\n getCoreRowModel: getCoreRowModel(),\n getSortedRowModel: getSortedRowModel(),\n enableSorting: sortable,\n });\n\n return (\n <Table className={styleProps(node)}>\n <TableHeader>\n {table.getHeaderGroups().map((hg) => (\n <TableRow key={hg.id}>\n {hg.headers.map((h) => (\n <TableHead key={h.id}>\n {sortable ? (\n <button\n type=\"button\"\n onClick={() => {\n h.column.toggleSorting();\n // Sorting is LOCAL — a non-wantResponse action never round-trips to the agent.\n onAction?.({ name: \"sort\", wantResponse: false });\n }}\n >\n {flexRender(h.column.columnDef.header, h.getContext())}\n </button>\n ) : (\n flexRender(h.column.columnDef.header, h.getContext())\n )}\n </TableHead>\n ))}\n </TableRow>\n ))}\n </TableHeader>\n <TableBody>\n {table.getRowModel().rows.map((r) => (\n <TableRow key={r.id}>\n {r.getVisibleCells().map((c) => (\n <TableCell key={c.id}>{String(c.getValue() ?? \"\")}</TableCell>\n ))}\n </TableRow>\n ))}\n </TableBody>\n </Table>\n );\n};\n\nexport const ChartNode: React.FC<A2uiNodeProps> = ({ node, value }) => {\n // Data comes from the bound dataModel (`value`) OR inline `node.data`.\n const data = (\n Array.isArray(value) ? value : Array.isArray(node.data) ? node.data : []\n ) as Array<Record<string, unknown>>;\n let series = (Array.isArray(node.series) ? node.series : []).map((s) =>\n typeof s === \"string\" ? { key: s } : s,\n ) as Array<{ key: string; label?: string }>;\n const first = (data[0] ?? {}) as Record<string, unknown>;\n // Derive x (first non-numeric key) and series (numeric keys) if the model omitted them.\n const x = String(node.x ?? Object.keys(first).find((k) => typeof first[k] !== \"number\") ?? \"\");\n if (!series.length && data.length) {\n series = Object.keys(first)\n .filter((k) => k !== x && typeof first[k] === \"number\")\n .map((k) => ({ key: k }));\n }\n const kind = String(node.kind ?? \"bar\");\n\n if (!data.length || !series.length) {\n return <p className=\"text-muted-foreground text-sm\">No data to display</p>;\n }\n\n const axes = themedChartAxes(x);\n\n return (\n <div className={cn(\"w-full\", styleProps(node))}>\n {typeof node.title === \"string\" && <p className=\"mb-2 font-medium\">{node.title}</p>}\n <Chart height={300}>\n {kind === \"line\" ? (\n <LineChart data={data}>\n {axes}\n {series.map((s, i) => (\n <Line key={s.key} dataKey={s.key} name={s.label ?? s.key} stroke={PALETTE[i % PALETTE.length]} />\n ))}\n </LineChart>\n ) : kind === \"area\" ? (\n <AreaChart data={data}>\n {axes}\n {series.map((s, i) => (\n <Area\n key={s.key}\n dataKey={s.key}\n name={s.label ?? s.key}\n stroke={PALETTE[i % PALETTE.length]}\n fill={PALETTE[i % PALETTE.length]}\n fillOpacity={0.2}\n />\n ))}\n </AreaChart>\n ) : kind === \"pie\" ? (\n <PieChart>\n <Tooltip />\n <Legend />\n <Pie data={data} dataKey={series[0].key} nameKey={x} label>\n {data.map((_, i) => (\n <Cell key={i} fill={PALETTE[i % PALETTE.length]} />\n ))}\n </Pie>\n </PieChart>\n ) : (\n <BarChart data={data}>\n {axes}\n {series.map((s, i) => (\n <Bar key={s.key} dataKey={s.key} name={s.label ?? s.key} fill={PALETTE[i % PALETTE.length]} />\n ))}\n </BarChart>\n )}\n </Chart>\n </div>\n );\n};\n\nexport const Progress: React.FC<A2uiNodeProps> = ({ node }) => {\n const max = typeof node.max === \"number\" && node.max > 0 ? node.max : 100;\n const value = typeof node.value === \"number\" ? Math.min(Math.max(node.value, 0), max) : 0;\n const pct = Math.round((value / max) * 100);\n return (\n <div className={cn(\"flex flex-col gap-1\", styleProps(node))}>\n {typeof node.label === \"string\" && (\n <div className=\"flex justify-between text-sm text-muted-foreground\">\n <span>{node.label}</span>\n <span>{pct}%</span>\n </div>\n )}\n <ProgressBar value={pct} />\n </div>\n );\n};\n\nexport const Timeline: React.FC<A2uiNodeProps> = ({ node }) => {\n const items = (Array.isArray(node.items) ? node.items : []) as Array<{\n title: string;\n description?: string;\n timestamp?: string;\n }>;\n return (\n <ol className={cn(\"relative ml-2 border-l border-border\", styleProps(node))}>\n {items.map((it, i) => (\n <li key={i} className=\"mb-4 ml-4\">\n <span className=\"absolute -left-1.5 mt-1 h-3 w-3 rounded-full bg-primary\" />\n <div className=\"text-sm font-medium text-foreground\">{it.title}</div>\n {it.timestamp && <div className=\"text-xs text-muted-foreground\">{it.timestamp}</div>}\n {it.description && <div className=\"text-sm text-muted-foreground\">{it.description}</div>}\n </li>\n ))}\n </ol>\n );\n};\n","import * as React from \"react\";\n\nimport { cn } from \"../../../lib/utils\";\n\nconst Table = React.forwardRef<\n HTMLTableElement,\n React.HTMLAttributes<HTMLTableElement>\n>(({ className, ...props }, ref) => (\n <div className=\"relative w-full overflow-auto\">\n <table\n ref={ref}\n className={cn(\"w-full caption-bottom text-sm text-foreground bg-background\", className, \"alq--table\")}\n {...props}\n />\n </div>\n));\nTable.displayName = \"Table\";\n\nconst TableHeader = React.forwardRef<\n HTMLTableSectionElement,\n React.HTMLAttributes<HTMLTableSectionElement>\n>(({ className, ...props }, ref) => (\n <thead ref={ref} className={cn(\"[&_tr]:border-b border-border bg-muted\", className, \"alq--table-header\")} {...props} />\n));\nTableHeader.displayName = \"TableHeader\";\n\nconst TableBody = React.forwardRef<\n HTMLTableSectionElement,\n React.HTMLAttributes<HTMLTableSectionElement>\n>(({ className, ...props }, ref) => (\n <tbody\n ref={ref}\n className={cn(\"[&_tr:last-child]:border-0 [&_tr]:border-b border-border\", className, \"alq--table-body\")}\n {...props}\n />\n));\nTableBody.displayName = \"TableBody\";\n\nconst TableFooter = React.forwardRef<\n HTMLTableSectionElement,\n React.HTMLAttributes<HTMLTableSectionElement>\n>(({ className, ...props }, ref) => (\n <tfoot\n ref={ref}\n className={cn(\n \"border-t border-border bg-muted/50 font-medium [&>tr]:last:border-b-0\",\n className,\n \"alq--table-footer\"\n )}\n {...props}\n />\n));\nTableFooter.displayName = \"TableFooter\";\n\nconst TableRow = React.forwardRef<\n HTMLTableRowElement,\n React.HTMLAttributes<HTMLTableRowElement>\n>(({ className, ...props }, ref) => (\n <tr\n ref={ref}\n className={cn(\n \"border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted\",\n className\n )}\n {...props}\n />\n));\nTableRow.displayName = \"TableRow\";\n\nconst TableHead = React.forwardRef<\n HTMLTableCellElement,\n React.ThHTMLAttributes<HTMLTableCellElement>\n>(({ className, ...props }, ref) => (\n <th\n ref={ref}\n className={cn(\n \"h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0\",\n className\n )}\n {...props}\n />\n));\nTableHead.displayName = \"TableHead\";\n\nconst TableCell = React.forwardRef<\n HTMLTableCellElement,\n React.TdHTMLAttributes<HTMLTableCellElement>\n>(({ className, ...props }, ref) => (\n <td\n ref={ref}\n className={cn(\"p-4 align-middle [&:has([role=checkbox])]:pr-0\", className)}\n {...props}\n />\n));\nTableCell.displayName = \"TableCell\";\n\nconst TableCaption = React.forwardRef<\n HTMLTableCaptionElement,\n React.HTMLAttributes<HTMLTableCaptionElement>\n>(({ className, ...props }, ref) => (\n <caption\n ref={ref}\n className={cn(\"mt-4 text-sm text-muted-foreground\", className)}\n {...props}\n />\n));\nTableCaption.displayName = \"TableCaption\";\n\nexport {\n Table,\n TableHeader,\n TableBody,\n TableFooter,\n TableHead,\n TableRow,\n TableCell,\n TableCaption,\n};\n","\"use client\";\n\nimport * as React from \"react\";\nimport * as ProgressPrimitive from \"@radix-ui/react-progress\";\n\nimport { cn } from \"../../../lib/utils\";\n\nconst Progress = React.forwardRef<\n React.ElementRef<typeof ProgressPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof ProgressPrimitive.Root>\n>(({ className, value, ...props }, ref) => (\n <ProgressPrimitive.Root\n ref={ref}\n className={cn(\"relative h-2 w-full overflow-hidden rounded-full bg-muted\", className)}\n {...props}\n >\n <ProgressPrimitive.Indicator\n className=\"h-full w-full flex-1 bg-primary transition-all\"\n style={{ transform: `translateX(-${100 - (value || 0)}%)` }}\n />\n </ProgressPrimitive.Root>\n));\nProgress.displayName = ProgressPrimitive.Root.displayName;\n\nexport { Progress };\n","\"use client\";\n\nimport * as React from \"react\";\nimport { ResponsiveContainer, CartesianGrid, XAxis, YAxis, Tooltip, Legend } from \"recharts\";\n\nimport { cn } from \"../../../lib/utils\";\n\n/** Semantic chart token palette (defined in the theme CSS as --chart-1..5). */\nexport const CHART_PALETTE = [\n \"hsl(var(--chart-1))\",\n \"hsl(var(--chart-2))\",\n \"hsl(var(--chart-3))\",\n \"hsl(var(--chart-4))\",\n \"hsl(var(--chart-5))\",\n];\n\nexport interface ChartProps {\n className?: string;\n /** Height in px for the responsive container. */\n height?: number;\n /** A single recharts chart element (BarChart/LineChart/…). */\n children: React.ReactElement;\n}\n\n/**\n * Generic responsive chart container with standardized sizing. The concrete\n * chart type (bars/lines/…) and series come from the caller; this atom owns\n * only the responsive box and theming primitives (see `themedChartAxes`).\n */\nfunction Chart({ className, height = 300, children }: ChartProps) {\n return (\n <div className={cn(\"w-full\", className)} style={{ height }}>\n <ResponsiveContainer width=\"100%\" height=\"100%\">\n {children}\n </ResponsiveContainer>\n </div>\n );\n}\nChart.displayName = \"Chart\";\n\n/**\n * Token-themed axes + grid + tooltip + legend, returned as a fragment so recharts\n * flattens them as direct chart children. Not a component (recharts inspects child\n * types and would not render a wrapper component's output as axes).\n */\nexport function themedChartAxes(x: string): React.ReactElement {\n return (\n <>\n <CartesianGrid strokeDasharray=\"3 3\" className=\"stroke-border\" />\n <XAxis dataKey={x} className=\"text-xs\" />\n <YAxis className=\"text-xs\" />\n <Tooltip />\n <Legend />\n </>\n );\n}\n\nexport { Chart };\n","import * as React from \"react\";\nimport type { A2uiNodeProps } from \"../registry\";\nimport { cn } from \"../../../lib/utils\";\nimport { styleProps } from \"../style-props\";\nimport { Button as UIButton } from \"../../atoms/ui/button\";\n\nconst BUTTON_VARIANT: Record<string, \"default\" | \"outline\" | \"ghost\" | \"link\"> = {\n solid: \"default\",\n outline: \"outline\",\n ghost: \"ghost\",\n link: \"link\",\n};\n\nconst BUTTON_SIZE: Record<string, \"sm\" | \"lg\"> = { sm: \"sm\", lg: \"lg\" };\n\nexport const ButtonNode: React.FC<A2uiNodeProps> = ({ node, onAction }) => {\n // Canonical prop is `text`, but models commonly use `label`/`title` for a button caption.\n const caption = node.text ?? node.label ?? node.title ?? \"\";\n // A Button is colored by its VARIANT (bg + matching foreground). We deliberately do NOT\n // apply styleProps() here: its `tone` maps to a `text-*` color that tailwind-merge would\n // let override the variant's `text-*-foreground`, making the label the same color as the\n // background (invisible). Sizing is expressed via the atom's own `size` prop.\n return (\n <UIButton\n variant={BUTTON_VARIANT[String(node.variant ?? \"solid\")] ?? \"default\"}\n size={typeof node.size === \"string\" ? BUTTON_SIZE[node.size] : undefined}\n className={node.emphasis === \"high\" ? \"font-semibold\" : undefined}\n onClick={() => node.action && onAction?.(node.action)}\n >\n {String(caption)}\n </UIButton>\n );\n};\n\nexport const ButtonGroup: React.FC<A2uiNodeProps> = ({ node, children }) => (\n <div className={cn(\"flex flex-row gap-2\", styleProps(node))}>{children}</div>\n);\n\n/** Only render a real anchor for a safe href (relative or https). Anything else renders as\n * plain text — never navigate a model-authored javascript:/data: or arbitrary URL. */\nconst SAFE_HREF = /^(\\/|https:\\/\\/)/i;\nexport const LinkNode: React.FC<A2uiNodeProps> = ({ node }) => {\n const href = typeof node.href === \"string\" && SAFE_HREF.test(node.href) ? node.href : undefined;\n const text = String(node.text ?? \"\");\n if (!href) return <span className={cn(\"text-muted-foreground\", styleProps(node))}>{text}</span>;\n return (\n <a\n href={href}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className={cn(\"text-primary underline underline-offset-2\", styleProps(node))}\n >\n {text}\n </a>\n );\n};\n","import type * as React from \"react\";\nimport type { A2uiComponent, SurfaceAction } from \"@alquimia-ai/tools/genui\";\nimport {\n Stack,\n Row,\n Column,\n Grid,\n Divider,\n Spacer,\n CardNode,\n TabsNode,\n AccordionNode,\n} from \"./components/layout\";\nimport {\n Text,\n Heading,\n Markdown,\n ImageNode,\n IconNode,\n BadgeNode,\n AvatarNode,\n AlertNode,\n Stat,\n KeyValueNode,\n ListNode,\n Quote,\n} from \"./components/content\";\nimport {\n TextField,\n TextArea,\n NumberField,\n SelectNode,\n MultiSelect,\n Combobox,\n CheckboxNode,\n CheckboxGroup,\n Radio,\n SwitchNode,\n SliderNode,\n DatePicker,\n DateRange,\n FileUpload,\n Rating,\n} from \"./components/inputs\";\nimport { TableNode, ChartNode, Progress, Timeline } from \"./components/data\";\nimport { ButtonNode, ButtonGroup, LinkNode } from \"./components/actions\";\n\n/** Props every A2UI component receives from the renderer. */\nexport interface A2uiNodeProps {\n node: A2uiComponent;\n value?: unknown;\n onChange?: (value: unknown) => void;\n onAction?: (action: SurfaceAction) => void;\n children?: React.ReactNode;\n}\n\n/** The default catalog registry: catalog component name -> React component. */\nexport const coreUiRegistry: Record<string, React.ComponentType<A2uiNodeProps>> = {\n // layout\n Stack,\n Row,\n Column,\n Grid,\n Divider,\n Spacer,\n Card: CardNode,\n Tabs: TabsNode,\n Accordion: AccordionNode,\n // content\n Text,\n Heading,\n Markdown,\n Image: ImageNode,\n Icon: IconNode,\n Badge: BadgeNode,\n Avatar: AvatarNode,\n Alert: AlertNode,\n Stat,\n KeyValue: KeyValueNode,\n List: ListNode,\n Quote,\n // inputs\n TextField,\n TextArea,\n NumberField,\n Select: SelectNode,\n MultiSelect,\n Combobox,\n Checkbox: CheckboxNode,\n CheckboxGroup,\n Radio,\n Switch: SwitchNode,\n Slider: SliderNode,\n DatePicker,\n DateRange,\n FileUpload,\n Rating,\n // data\n Table: TableNode,\n Chart: ChartNode,\n Progress,\n Timeline,\n // actions\n Button: ButtonNode,\n ButtonGroup,\n Link: LinkNode,\n};\n","import * as React from \"react\";\nimport { Check } from \"lucide-react\";\nimport type { A2uiSurface, UIAction } from \"@alquimia-ai/tools/genui\";\nimport { cn } from \"../../lib/utils\";\nimport { Assistant, AssistantMessageArea, AssistantInput } from \"../organisms/assistant\";\nimport { ToolApprovalCard, type ToolApprovalView } from \"../organisms/tool-approval\";\nimport { A2uiRenderer } from \"./renderer\";\nimport { coreUiRegistry, type A2uiNodeProps } from \"./registry\";\n\ntype ChatMessage = { id?: string; role?: string; content?: string };\n\n/** The subset of the `useAlquimia` return that AssistantChat consumes. */\nexport interface GenuiChatController {\n messages: ChatMessage[];\n input: string;\n handleInputChange: (event: React.ChangeEvent<HTMLTextAreaElement>) => void;\n handleSubmit: (\n event: React.FormEvent<HTMLFormElement>,\n traceParentId?: string,\n sessionId?: string,\n ) => Promise<void> | void;\n handleLoadingCancel?: () => void;\n isLoading?: boolean;\n isMessageStreaming?: boolean;\n streamingMessageId?: string | null;\n genui?: {\n surfaces: Array<{\n controlId: string;\n surface: A2uiSurface;\n afterCount: number;\n submitted?: boolean;\n dismissedWith?: string;\n }>;\n onAgentAction: (controlId: string) => (action: UIAction) => void;\n awaitingUser: boolean;\n dismiss?: (userMessage?: string) => void;\n };\n /** Human-approval gates (`useAlquimia().toolApprovals`), rendered in place with Approve / Reject. */\n toolApprovals?: Array<ToolApprovalView & { afterCount: number }>;\n approveTool?: (controlId: string, approved: boolean, message?: string) => unknown;\n}\n\nexport interface AssistantChatProps {\n /** The value returned by `useAlquimia({ genui: {...} })`. */\n alquimia: GenuiChatController;\n /** Catalog component name -> React component. Defaults to the built-in catalog; pass your own to swap component libraries. */\n registry?: Record<string, React.ComponentType<A2uiNodeProps>>;\n /** Conversation id passed to `handleSubmit`. Optional if the SDK already has one. */\n conversationId?: string | null;\n placeholder?: string;\n suggestions?: string[];\n className?: string;\n /** Override the typing indicator shown while the agent is working. Defaults to animated dots. */\n thinkIndicator?: React.ReactNode;\n /** Channel name shown when an approval can only be answered on its originating channel. */\n approvalChannelName?: string;\n}\n\n/** Animated three-dot \"typing\" bubble, themed via the primary token. */\nfunction TypingDots() {\n return (\n <div className=\"flex w-fit items-center gap-1.5 rounded-2xl rounded-bl-md border border-border/60 bg-card px-4 py-3 shadow-sm\">\n {[0, 1, 2].map((i) => (\n <span\n key={i}\n className=\"h-2 w-2 animate-bounce rounded-full bg-primary\"\n style={{ animationDelay: `${i * 0.15}s`, animationDuration: \"0.9s\" }}\n />\n ))}\n </div>\n );\n}\n\n/**\n * Batteries-included GenUI chat. A thin composition of the SDK's existing organisms\n * (`AssistantMessageArea` + `AssistantInput`) — it does NOT reimplement message\n * rendering, so it inherits markdown, error rendering, timestamps, and streaming for\n * free. Its only job is to (a) turn `genui.surfaces` into an `interleave` callback the\n * message area renders in place, and (b) gate the typing indicator while a surface\n * awaits the user. All orchestration lives in `useAlquimia({ genui })`.\n *\n * To use a different component library, swap `registry` (and pass your own catalog to\n * the hook). To customize the shell, compose the organisms directly instead of using\n * this wrapper.\n */\nexport function AssistantChat({\n alquimia,\n registry = coreUiRegistry,\n conversationId,\n placeholder = \"Ask the agent to build something…\",\n suggestions = [],\n className,\n thinkIndicator,\n approvalChannelName,\n}: AssistantChatProps) {\n const endRef = React.useRef<HTMLDivElement>(null);\n const {\n messages,\n input,\n handleInputChange,\n handleSubmit,\n handleLoadingCancel,\n isLoading,\n isMessageStreaming,\n streamingMessageId,\n genui,\n toolApprovals,\n approveTool,\n } = alquimia;\n\n const surfaces = genui?.surfaces ?? [];\n const approvals = toolApprovals ?? [];\n // A parked approval is not the agent thinking; the typing dots would say it is.\n const awaitingApproval = approvals.some((a) => a.status === \"pending\" || a.status === \"submitting\");\n const awaitingUser = genui?.awaitingUser ?? false;\n const isBusy = !!(isLoading || isMessageStreaming);\n\n // A chat \"has content\" once there's a user turn or any assistant text. Until then we\n // show the empty state (prompt + suggestions).\n const hasContent = messages.some(\n (m) => m.role === \"user\" || (m.role !== \"system\" && (m.content ?? \"\").trim().length > 0),\n );\n const isEmpty = !hasContent && surfaces.length === 0 && approvals.length === 0;\n\n React.useEffect(() => {\n endRef.current?.scrollIntoView({ behavior: \"smooth\" });\n }, [messages, surfaces, approvals.length]);\n\n const renderSurface = (item: {\n controlId: string;\n surface: A2uiSurface;\n submitted?: boolean;\n dismissedWith?: string;\n }) => (\n <div key={`s-${item.controlId}`} className=\"my-3 flex flex-col items-start gap-1.5\">\n <div\n className={cn(\n \"relative w-full max-w-[95%] rounded-2xl border border-border/60 bg-card p-5 shadow-sm duration-500 animate-in fade-in slide-in-from-bottom-2\",\n item.submitted && \"opacity-70\",\n )}\n >\n {item.submitted && (\n <div className=\"absolute right-3 top-3 z-10 flex items-center gap-1 rounded-full bg-emerald-500/10 px-2 py-0.5 text-xs font-medium text-emerald-600 dark:text-emerald-400\">\n <Check className=\"h-3 w-3\" />\n {item.dismissedWith ? \"Skipped\" : \"Submitted\"}\n </div>\n )}\n {/* Once submitted, freeze the surface: no re-submits, inputs read-only. */}\n <div className={cn(item.submitted && \"pointer-events-none select-none\")} aria-disabled={item.submitted}>\n <A2uiRenderer\n surface={item.surface}\n registry={registry}\n onAgentAction={genui ? genui.onAgentAction(item.controlId) : () => {}}\n />\n </div>\n </div>\n {/* What the user said instead of using the surface, anchored to the surface it replaced. */}\n {item.dismissedWith && (\n <p className=\"alq--surface-dismissed max-w-[95%] pl-1 text-sm text-muted-foreground\">\n <span className=\"font-medium text-foreground\">You replied:</span> {item.dismissedWith}\n </p>\n )}\n </div>\n );\n\n // Group surfaces by their message-count anchor (`afterCount`). The message area calls\n // interleave(0) before the first message and interleave(i+1) after message i.\n const byCount = new Map<number, typeof surfaces>();\n for (const s of surfaces) {\n const arr = byCount.get(s.afterCount) ?? [];\n arr.push(s);\n byCount.set(s.afterCount, arr);\n }\n\n const approvalsByCount = new Map<number, typeof approvals>();\n for (const a of approvals) {\n const arr = approvalsByCount.get(a.afterCount) ?? [];\n arr.push(a);\n approvalsByCount.set(a.afterCount, arr);\n }\n\n const renderApproval = (approval: (typeof approvals)[number]) => (\n <div key={`a-${approval.controlId}`} className=\"my-3 flex flex-col items-start\">\n <ToolApprovalCard\n approval={approval}\n onDecide={approveTool ?? (() => {})}\n channelName={approvalChannelName}\n className=\"duration-500 animate-in fade-in slide-in-from-bottom-2\"\n />\n </div>\n );\n\n const interleave = (afterIndex: number): React.ReactNode => {\n const nodes: React.ReactNode[] = [\n ...(byCount.get(afterIndex) ?? []).map(renderSurface),\n ...(approvalsByCount.get(afterIndex) ?? []).map(renderApproval),\n ];\n if (afterIndex === 0 && isEmpty) {\n nodes.unshift(\n <div\n key=\"empty\"\n className=\"flex min-h-full flex-col items-center justify-center gap-4 py-16 text-center\"\n >\n <p className=\"max-w-sm text-muted-foreground\">Ask the agent to build an interface.</p>\n <div className=\"flex flex-col items-center gap-2\">\n {suggestions.map((s) => (\n <button\n key={s}\n type=\"button\"\n onClick={() =>\n handleInputChange({\n target: { value: s },\n } as unknown as React.ChangeEvent<HTMLTextAreaElement>)\n }\n className=\"rounded-full border border-border/70 bg-card px-4 py-2 text-sm text-foreground/80 transition hover:border-primary/40 hover:shadow-sm\"\n >\n {s}\n </button>\n ))}\n </div>\n </div>,\n );\n }\n return nodes.length ? nodes : null;\n };\n\n const onSubmit = async (e: React.FormEvent<HTMLFormElement>) => {\n e.preventDefault();\n if (!input.trim()) return;\n if (awaitingUser && genui?.dismiss) {\n genui.dismiss(input);\n return;\n }\n if (isBusy) return;\n try {\n await handleSubmit(e, undefined, conversationId ?? undefined);\n } catch {\n handleLoadingCancel?.();\n }\n };\n\n return (\n <Assistant className={cn(\"mx-auto flex h-full w-full max-w-2xl flex-col bg-transparent px-4\", className)}>\n <AssistantMessageArea\n className=\"bg-transparent\"\n messages={messages as never}\n messagesEndRef={endRef}\n isLoading={!!isLoading}\n streamingMessageId={streamingMessageId ?? null}\n interleave={interleave}\n // The composer stays gated while an approval waits: the card is the way to answer it.\n awaitingUser={awaitingUser || awaitingApproval}\n thinkIndicator={thinkIndicator ?? <TypingDots />}\n />\n <AssistantInput\n className=\"mb-5 mt-2 rounded-2xl border-border/60 bg-card/90 shadow-lg backdrop-blur\"\n sendMessageFunc={onSubmit}\n // NOTE: AssistantInput ties BOTH the textarea and the send button to this flag,\n // so it must reflect \"busy\", not \"empty\" — otherwise an empty input can't be typed\n // into. Empty submits are already a no-op (guarded in onSubmit).\n //\n // `&& !awaitingUser`: while a surface waits for the user the inference is parked, so\n // `isLoading` stays true — but the user is not being made to wait, they are being asked.\n // Disabling here would trap anyone who wants none of the offered options. They must be\n // able to answer in words; `onSubmit` turns that into a dismissal of the surface.\n isButtonDisabled={isBusy && !awaitingUser}\n input={input}\n handleInputChange={handleInputChange}\n isMessageStreaming={!!isMessageStreaming}\n placeholders={[placeholder, placeholder]}\n />\n </Assistant>\n );\n}\n","\"use client\";\n\nimport * as React from \"react\";\nimport { FormEvent, useCallback, useEffect, useRef, useState } from \"react\";\nimport { AlquimiaSDK } from \"@alquimia-ai/tools/sdk\";\nimport { Typography } from \"../atoms\";\nimport { CallOut, CallOutResponse, CallOutActions } from \"../molecules\";\nimport { ThinkIndicator } from \"../atoms\";\nimport { cn, getErrorMessage, hasToolResult } from \"../../lib/utils\";\nimport { Message } from \"ai\";\nimport { Send } from \"lucide-react\";\nimport { Tooler, ToolFactory } from \"../../types\";\n\ninterface AssistantProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Optional — the shell doesn't consume it; kept for API compatibility. */\n sdk?: AlquimiaSDK;\n title?: string;\n description?: string;\n}\n\nconst Assistant = React.forwardRef<HTMLDivElement, AssistantProps>(\n ({ className, sdk, title, description, children, ...props }, ref) => {\n return (\n <div\n ref={ref}\n className={cn(\"flex flex-col h-full bg-background text-foreground\", className)}\n {...props}\n >\n {(title || description) && (\n <AssistantHeader>\n {title && <AssistantTitle title={title} />}\n {description && <AssistantDescription description={description} />}\n </AssistantHeader>\n )}\n {children}\n </div>\n );\n }\n);\nAssistant.displayName = \"Assistant\";\n\ninterface AssistantTitleProps extends React.HTMLAttributes<HTMLHeadingElement> {\n title: string;\n}\n\nconst AssistantTitle = React.forwardRef<HTMLHeadingElement, AssistantTitleProps>(\n ({ className, title, ...props }, ref) => (\n <div ref={ref} className={cn(\"text-foreground\", className)} {...props}>\n <Typography typeStyle=\"heading1\" as=\"h1\">\n {title}\n </Typography>\n </div>\n )\n);\nAssistantTitle.displayName = \"AssistantTitle\";\n\ninterface AssistantDescriptionProps\n extends React.HTMLAttributes<HTMLParagraphElement> {\n description: string;\n}\n\nconst AssistantDescription = React.forwardRef<\n HTMLParagraphElement,\n AssistantDescriptionProps\n>(({ className, description, ...props }, ref) => (\n <div ref={ref} className={cn(\"text-foreground\", className)} {...props}>\n <Typography typeStyle=\"display\" as=\"p\">\n {description}\n </Typography>\n </div>\n));\nAssistantDescription.displayName = \"AssistantDescription\";\n\ninterface AssistantHeaderProps extends React.HTMLAttributes<HTMLDivElement> {}\n\nconst AssistantHeader = React.forwardRef<HTMLDivElement, AssistantHeaderProps>(\n ({ className, children, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\"bg-background text-foreground\", className)}\n {...props}\n >\n {children}\n </div>\n )\n);\nAssistantHeader.displayName = \"AssistantHeader\";\n\ninterface MessageAction {\n label: string;\n icon: React.ReactNode;\n onClick: (message?: Message) => Promise<void>;\n custom?: boolean;\n component?: (props: { message?: Message }) => React.ReactNode;\n}\n\ninterface AssistantMessageAreaProps\n extends React.HTMLAttributes<HTMLDivElement> {\n messages: (Message & {\n error_code?: string;\n created_at?: string;\n error_detail?: string;\n additionalInfo?: string;\n loading?: boolean;\n tooler?: Tooler[];\n taskid?: string;\n })[];\n actions?: MessageAction[];\n messagesEndRef: any;\n thinkIndicator?: React.ReactNode;\n isMessageStreaming?: boolean;\n streamingMessageId: string | null;\n handleIsTextStreaming?: (isStreaming: boolean) => void;\n toolFactory?: ToolFactory;\n isLoading: boolean;\n showDetailedErrors?: boolean;\n /**\n * Optional injection seam for content rendered between messages. Called with `0`\n * before the first message and `i + 1` after the message at index `i`, so callers\n * can interleave extra nodes (e.g. GenUI surfaces anchored to a message count).\n * Generic on purpose — the organism stays unaware of GenUI.\n */\n interleave?: (afterIndex: number) => React.ReactNode;\n /**\n * When true, suppresses the trailing typing indicator — used when an interactive\n * surface is awaiting the user, so the chat doesn't look like it's still thinking.\n */\n awaitingUser?: boolean;\n}\n\nconst AssistantMessageArea = React.forwardRef<\n HTMLDivElement,\n AssistantMessageAreaProps\n>(\n (\n {\n className,\n messages,\n messagesEndRef,\n actions,\n streamingMessageId,\n thinkIndicator,\n handleIsTextStreaming,\n toolFactory,\n isLoading,\n showDetailedErrors,\n interleave,\n awaitingUser,\n isMessageStreaming: _isMessageStreaming,\n ...props\n },\n ref\n ) => {\n useEffect(() => {\n messagesEndRef.current?.scrollIntoView({ behavior: \"instant\" });\n }, []);\n return (\n <div\n ref={ref}\n className={cn(\"p-6 overflow-y-auto flex-grow bg-background\", className)}\n {...props}\n >\n {interleave?.(0)}\n {messages.map((message, index) => (\n <div key={message.id}>\n <CallOut\n key={message.id}\n role={message.role as \"user\" | \"assistant\"}\n message={message}\n >\n {streamingMessageId === message.id &&\n (isLoading || message.content.length === 0) &&\n !message.error_code &&\n !awaitingUser && (\n <div>{thinkIndicator ?? <ThinkIndicator />}</div>\n )}\n {message.error_code && (\n <CallOutResponse\n role=\"assistant\"\n data-error-code={message.error_code}\n additionalInfo={showDetailedErrors ? `${message.error_detail}${message.taskid ? `\\ntask id: ${message.taskid}` : ''}` : undefined}\n toggleAdditionalInfo\n >\n {getErrorMessage(message.error_code)}\n </CallOutResponse>\n )}\n {!message.error_code && message.tooler?.filter(hasToolResult).map((tool, index) => (\n <React.Fragment key={tool.control_id || `${tool.tool_summary?.name}-${index}`}>\n {toolFactory?.createTool(tool.tool_summary?.name || \"\", tool.tool_output)}\n </React.Fragment>\n ))}\n {message.content && !message.error_code && (\n <div\n data-role={message.role}\n className=\"alq--callout-message-container\"\n >\n {message.created_at && streamingMessageId !== message.id && (\n <div className=\"text-xs text-muted-foreground/80 pb-1 alq--callout-message-date\">\n {new Date(Number(message.created_at)).toLocaleString(\n \"es-ES\",\n {\n hour: \"2-digit\",\n minute: \"2-digit\",\n hour12: false,\n }\n )}\n </div>\n )}\n <CallOutResponse\n role={message.role}\n isStreaming={streamingMessageId === message.id}\n handleIsTextStreaming={handleIsTextStreaming}\n additionalInfo={\n streamingMessageId !== message.id\n ? message?.additionalInfo\n : undefined\n }\n >\n {message.content}\n </CallOutResponse>\n {actions && streamingMessageId !== message.id && (\n <CallOutActions\n key={message.id}\n actions={actions}\n message={message}\n role={message.role as \"user\" | \"assistant\"}\n />\n )}\n </div>\n )}\n </CallOut>\n {interleave?.(index + 1)}\n </div>\n ))}\n <div ref={messagesEndRef} />\n </div>\n );\n }\n);\nAssistantMessageArea.displayName = \"AssistantMessageArea\";\n\ninterface AssistantInputProps\n extends React.FormHTMLAttributes<HTMLFormElement> {\n sendMessageFunc: (event: React.FormEvent<HTMLFormElement>) => Promise<void>;\n isButtonDisabled: boolean;\n input: string;\n handleInputChange: (event: React.ChangeEvent<HTMLTextAreaElement>) => void;\n isMessageStreaming: boolean;\n speechToTextComponent?: React.ReactNode;\n userToolboxComponent?: React.ReactNode;\n placeholders?: [string, string];\n onFileDrop?: (files: File[]) => void;\n attachmentsSlot?: React.ReactNode;\n}\n\nconst AssistantInput = React.forwardRef<HTMLFormElement, AssistantInputProps>(\n (\n {\n className,\n sendMessageFunc,\n isButtonDisabled,\n input,\n handleInputChange,\n isMessageStreaming,\n speechToTextComponent,\n userToolboxComponent,\n placeholders,\n onFileDrop,\n attachmentsSlot,\n ...props\n },\n ref\n ) => {\n const [isDragging, setIsDragging] = useState(false);\n const dragCounterRef = useRef(0);\n\n const handleDragEnter = useCallback((e: React.DragEvent) => {\n e.preventDefault();\n e.stopPropagation();\n dragCounterRef.current += 1;\n if (e.dataTransfer.types.includes(\"Files\")) {\n setIsDragging(true);\n }\n }, []);\n\n const handleDragOver = useCallback((e: React.DragEvent) => {\n e.preventDefault();\n e.stopPropagation();\n }, []);\n\n const handleDragLeave = useCallback((e: React.DragEvent) => {\n e.preventDefault();\n e.stopPropagation();\n dragCounterRef.current -= 1;\n if (dragCounterRef.current === 0) {\n setIsDragging(false);\n }\n }, []);\n\n const handleDrop = useCallback(\n (e: React.DragEvent) => {\n e.preventDefault();\n e.stopPropagation();\n dragCounterRef.current = 0;\n setIsDragging(false);\n const files = Array.from(e.dataTransfer.files);\n if (files.length > 0) {\n onFileDrop?.(files);\n }\n },\n [onFileDrop]\n );\n\n const placeholder = placeholders\n ? isMessageStreaming\n ? placeholders[0]\n : placeholders[1]\n : isMessageStreaming\n ? \"Processing...\"\n : \"Type your message here...\";\n\n return (\n <form\n onSubmit={sendMessageFunc}\n className={cn(\n \"flex flex-col relative rounded-lg border border-input bg-background\",\n \"focus-within:ring-2 focus-within:ring-ring\",\n onFileDrop && isDragging && \"ring-2 ring-primary/50 alq--assistant-input-dragover\",\n className\n )}\n ref={ref}\n onDragEnter={onFileDrop ? handleDragEnter : undefined}\n onDragOver={onFileDrop ? handleDragOver : undefined}\n onDragLeave={onFileDrop ? handleDragLeave : undefined}\n onDrop={onFileDrop ? handleDrop : undefined}\n {...props}\n >\n {attachmentsSlot}\n <textarea\n disabled={isButtonDisabled}\n value={input}\n onChange={handleInputChange}\n placeholder={placeholder}\n className={cn(\n \"flex-1 min-w-0 text-sm p-3 focus:outline-none w-full resize-none\",\n \"bg-transparent text-foreground\",\n \"placeholder:text-muted-foreground\",\n \"disabled:opacity-50 disabled:cursor-not-allowed\"\n )}\n onKeyDown={(e) => {\n if (e.key === 'Enter' && !e.shiftKey) {\n e.preventDefault();\n sendMessageFunc(e as unknown as FormEvent<HTMLFormElement>);\n }\n }}\n />\n <div className=\"flex items-center relative alq--assistant-actions\">\n {userToolboxComponent}\n {speechToTextComponent}\n <button\n type=\"submit\"\n aria-label=\"Send\"\n disabled={isButtonDisabled}\n className={cn(\n \"w-10 h-10 rounded-full flex items-center justify-center alq--assistant-button-send\",\n isButtonDisabled\n ? \"bg-muted text-muted-foreground\"\n : \"bg-primary text-primary-foreground hover:bg-primary/90\"\n )}\n >\n <Send className=\"w-5 h-5\" />\n </button>\n </div>\n </form>\n );\n }\n);\nAssistantInput.displayName = \"AssistantInput\";\n\nexport {\n Assistant,\n AssistantTitle,\n AssistantDescription,\n AssistantHeader,\n AssistantMessageArea,\n AssistantInput,\n};\n","\"use client\"\n\nimport * as React from \"react\"\nimport * as ScrollAreaPrimitive from \"@radix-ui/react-scroll-area\"\n\nimport { cn } from \"../../../lib/utils\";\n\nconst ScrollArea = React.forwardRef<\n React.ElementRef<typeof ScrollAreaPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.Root>\n>(({ className, children, ...props }, ref) => (\n <ScrollAreaPrimitive.Root\n ref={ref}\n className={cn(\"relative overflow-hidden\", className)}\n {...props}\n >\n <ScrollAreaPrimitive.Viewport className=\"h-full w-full rounded-[inherit]\">\n {children}\n </ScrollAreaPrimitive.Viewport>\n <ScrollBar />\n <ScrollAreaPrimitive.Corner />\n </ScrollAreaPrimitive.Root>\n))\nScrollArea.displayName = ScrollAreaPrimitive.Root.displayName\n\nconst ScrollBar = React.forwardRef<\n React.ElementRef<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>,\n React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>\n>(({ className, orientation = \"vertical\", ...props }, ref) => (\n <ScrollAreaPrimitive.ScrollAreaScrollbar\n ref={ref}\n orientation={orientation}\n className={cn(\n \"flex touch-none select-none transition-colors\",\n orientation === \"vertical\" &&\n \"h-full w-2.5 border-l border-l-transparent p-[1px]\",\n orientation === \"horizontal\" &&\n \"h-2.5 flex-col border-t border-t-transparent p-[1px]\",\n className\n )}\n {...props}\n >\n <ScrollAreaPrimitive.ScrollAreaThumb className=\"relative flex-1 rounded-full bg-border\" />\n </ScrollAreaPrimitive.ScrollAreaScrollbar>\n))\nScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName\n\nexport { ScrollArea, ScrollBar }\n","import { cn } from \"../../../lib/utils\";\n\nfunction Skeleton({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) {\n return (\n <div\n className={cn(\"animate-pulse rounded-md bg-muted text-muted-foreground\", className, \"alq--skeleton\")}\n {...props}\n />\n );\n}\n\nexport { Skeleton };\n","\"use client\";\n\nimport * as React from \"react\";\nimport { Drawer as DrawerPrimitive } from \"vaul\";\n\nimport { cn } from \"../../../lib/utils\";\n\nconst Drawer = ({\n shouldScaleBackground = true,\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Root>) => (\n <DrawerPrimitive.Root\n shouldScaleBackground={shouldScaleBackground}\n {...props}\n />\n);\nDrawer.displayName = \"Drawer\";\n\nconst DrawerTrigger = DrawerPrimitive.Trigger;\n\nconst DrawerPortal = DrawerPrimitive.Portal;\n\nconst DrawerClose = DrawerPrimitive.Close;\n\nconst DrawerOverlay = React.forwardRef<\n React.ElementRef<typeof DrawerPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n <DrawerPrimitive.Overlay\n ref={ref}\n className={cn(\"fixed inset-0 z-50 bg-black/80\", className)}\n {...props}\n />\n));\nDrawerOverlay.displayName = DrawerPrimitive.Overlay.displayName;\n\nconst DrawerContent = React.forwardRef<\n React.ElementRef<typeof DrawerPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Content>\n>(({ className, children, ...props }, ref) => (\n <DrawerPortal>\n <DrawerOverlay />\n <DrawerPrimitive.Content\n ref={ref}\n className={cn(\n \"fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border border-border bg-background text-foreground alq--drawer-content\",\n className\n )}\n {...props}\n >\n <div className=\"mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted\" />\n {children}\n </DrawerPrimitive.Content>\n </DrawerPortal>\n));\nDrawerContent.displayName = \"DrawerContent\";\n\nconst DrawerHeader = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\"grid gap-1.5 p-4 text-center sm:text-left\", className, \"alq--drawer-header\")}\n {...props}\n />\n);\nDrawerHeader.displayName = \"DrawerHeader\";\n\nconst DrawerFooter = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\"mt-auto flex flex-col gap-2 p-4\", className, \"alq--drawer-footer\")}\n {...props}\n />\n);\nDrawerFooter.displayName = \"DrawerFooter\";\n\nconst DrawerTitle = React.forwardRef<\n React.ElementRef<typeof DrawerPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <DrawerPrimitive.Title\n ref={ref}\n className={cn(\n \"text-lg font-semibold leading-none tracking-tight\",\n className,\n \"alq--drawer-title\"\n )}\n {...props}\n />\n));\nDrawerTitle.displayName = DrawerPrimitive.Title.displayName;\n\nconst DrawerDescription = React.forwardRef<\n React.ElementRef<typeof DrawerPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <DrawerPrimitive.Description\n ref={ref}\n className={cn(\"text-sm text-muted-foreground\", className, \"alq--drawer-description\")}\n {...props}\n />\n));\nDrawerDescription.displayName = DrawerPrimitive.Description.displayName;\n\nexport {\n Drawer,\n DrawerPortal,\n DrawerOverlay,\n DrawerTrigger,\n DrawerClose,\n DrawerContent,\n DrawerHeader,\n DrawerFooter,\n DrawerTitle,\n DrawerDescription,\n};\n","import { cn } from \"../../../../lib/utils\";\nimport { forwardRef } from \"react\";\n\nexport interface TypographyProps extends React.HTMLAttributes<HTMLDivElement> {\n as?: \"h1\" | \"h2\" | \"h3\" | \"h4\" | \"h5\" | \"h6\" | \"p\" | \"span\";\n typeStyle:\n | \"display\"\n | \"heading1\"\n | \"heading2\"\n | \"heading3\"\n | \"heading4\"\n | \"small\"\n | \"tiny\";\n}\n\nconst Typography = forwardRef<HTMLDivElement, TypographyProps>(\n ({ as: Component = \"p\", typeStyle, ...props }, ref) => {\n return (\n <Component\n {...props}\n className={cn(props.className, `alq--typography-${typeStyle}`)}\n ref={ref}\n />\n );\n }\n);\n\nTypography.displayName = \"Typography\";\n\nexport { Typography };\n","\"use client\";\n\nimport * as React from \"react\";\nimport * as TogglePrimitive from \"@radix-ui/react-toggle\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\n\nimport { cn } from \"../../../lib/utils\";\n\nconst toggleVariants = cva(\n \"inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground\",\n {\n variants: {\n variant: {\n default: \"bg-transparent\",\n outline:\n \"border border-input bg-transparent hover:bg-accent hover:text-accent-foreground\",\n },\n size: {\n default: \"h-10 px-3\",\n sm: \"h-9 px-2.5\",\n lg: \"h-11 px-5\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n }\n);\n\nconst Toggle = React.forwardRef<\n React.ElementRef<typeof TogglePrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof TogglePrimitive.Root> &\n VariantProps<typeof toggleVariants>\n>(({ className, variant, size, ...props }, ref) => (\n <TogglePrimitive.Root\n ref={ref}\n className={cn(toggleVariants({ variant, size, className }), \"alq--toggle\")}\n {...props}\n />\n));\n\nToggle.displayName = TogglePrimitive.Root.displayName;\n\nexport { Toggle, toggleVariants };\n","\"use client\"\n\nimport * as AspectRatioPrimitive from \"@radix-ui/react-aspect-ratio\"\n\nconst AspectRatio = AspectRatioPrimitive.Root\n\nexport { AspectRatio }\n","import * as React from \"react\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport { ChevronRight, MoreHorizontal } from \"lucide-react\";\n\nimport { cn } from \"../../../lib/utils\";\ninterface BreadcrumbItemProps {\n label: string;\n href?: string;\n current?: boolean;\n}\n\nconst Breadcrumb = React.forwardRef<\n HTMLElement,\n React.ComponentPropsWithoutRef<\"nav\"> & {\n separator?: React.ReactNode;\n }\n>(({ ...props }, ref) => <nav ref={ref} aria-label=\"breadcrumb\" {...props} />);\nBreadcrumb.displayName = \"Breadcrumb\";\n\nconst BreadcrumbList = React.forwardRef<\n HTMLOListElement,\n React.ComponentPropsWithoutRef<\"ol\">\n>(({ className, ...props }, ref) => (\n <ol\n ref={ref}\n className={cn(\n \"flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5\",\n className\n )}\n {...props}\n />\n));\nBreadcrumbList.displayName = \"BreadcrumbList\";\n\nconst BreadcrumbItem = React.forwardRef<\n HTMLLIElement,\n React.ComponentPropsWithoutRef<\"li\">\n>(({ className, ...props }, ref) => (\n <li\n ref={ref}\n className={cn(\"inline-flex items-center gap-1.5\", className)}\n {...props}\n />\n));\nBreadcrumbItem.displayName = \"BreadcrumbItem\";\n\nconst BreadcrumbLink = React.forwardRef<\n HTMLAnchorElement,\n React.ComponentPropsWithoutRef<\"a\"> & {\n asChild?: boolean;\n }\n>(({ asChild, className, ...props }, ref) => {\n const Comp = asChild ? Slot : \"a\";\n\n return (\n <Comp\n ref={ref}\n className={cn(\"transition-colors hover:text-foreground\", className)}\n {...props}\n />\n );\n});\nBreadcrumbLink.displayName = \"BreadcrumbLink\";\n\nconst BreadcrumbPage = React.forwardRef<\n HTMLSpanElement,\n React.ComponentPropsWithoutRef<\"span\">\n>(({ className, ...props }, ref) => (\n <span\n ref={ref}\n role=\"link\"\n aria-disabled=\"true\"\n aria-current=\"page\"\n className={cn(\"font-normal text-foreground\", className)}\n {...props}\n />\n));\nBreadcrumbPage.displayName = \"BreadcrumbPage\";\n\nconst BreadcrumbSeparator = ({\n children,\n className,\n ...props\n}: React.ComponentProps<\"li\">) => (\n <li\n role=\"presentation\"\n aria-hidden=\"true\"\n className={cn(\"[&>svg]:w-3.5 [&>svg]:h-3.5\", className)}\n {...props}\n >\n {children ?? <ChevronRight />}\n </li>\n);\nBreadcrumbSeparator.displayName = \"BreadcrumbSeparator\";\n\nconst BreadcrumbEllipsis = ({\n className,\n ...props\n}: React.ComponentProps<\"span\">) => (\n <span\n role=\"presentation\"\n aria-hidden=\"true\"\n className={cn(\"flex h-9 w-9 items-center justify-center\", className)}\n {...props}\n >\n <MoreHorizontal className=\"h-4 w-4\" />\n <span className=\"sr-only\">More</span>\n </span>\n);\nBreadcrumbEllipsis.displayName = \"BreadcrumbElipssis\";\n\nexport {\n Breadcrumb,\n BreadcrumbList,\n BreadcrumbItem,\n BreadcrumbLink,\n BreadcrumbPage,\n BreadcrumbSeparator,\n BreadcrumbEllipsis,\n};\n","\"use client\";\n\nimport * as React from \"react\";\nimport * as AlertDialogPrimitive from \"@radix-ui/react-alert-dialog\";\n\nimport { cn } from \"../../lib/utils\";\nimport { buttonVariants } from \"../atoms/ui/button\";\n\nconst AlertDialog = AlertDialogPrimitive.Root;\n\nconst AlertDialogTrigger = AlertDialogPrimitive.Trigger;\n\nconst AlertDialogPortal = AlertDialogPrimitive.Portal;\n\nconst AlertDialogOverlay = React.forwardRef<\n React.ElementRef<typeof AlertDialogPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n <AlertDialogPrimitive.Overlay\n className={cn(\n \"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0\",\n className\n )}\n {...props}\n ref={ref}\n />\n));\nAlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName;\n\nconst AlertDialogContent = React.forwardRef<\n React.ElementRef<typeof AlertDialogPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Content>\n>(({ className, ...props }, ref) => (\n <AlertDialogPortal>\n <AlertDialogOverlay />\n <AlertDialogPrimitive.Content\n ref={ref}\n className={cn(\n \"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg\",\n className\n )}\n {...props}\n />\n </AlertDialogPortal>\n));\nAlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName;\n\nconst AlertDialogHeader = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\n \"flex flex-col space-y-2 text-center sm:text-left\",\n className\n )}\n {...props}\n />\n);\nAlertDialogHeader.displayName = \"AlertDialogHeader\";\n\nconst AlertDialogFooter = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\n \"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2\",\n className\n )}\n {...props}\n />\n);\nAlertDialogFooter.displayName = \"AlertDialogFooter\";\n\nconst AlertDialogTitle = React.forwardRef<\n React.ElementRef<typeof AlertDialogPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <AlertDialogPrimitive.Title\n ref={ref}\n className={cn(\"text-lg font-semibold\", className)}\n {...props}\n />\n));\nAlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName;\n\nconst AlertDialogDescription = React.forwardRef<\n React.ElementRef<typeof AlertDialogPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <AlertDialogPrimitive.Description\n ref={ref}\n className={cn(\"text-sm text-muted-foreground\", className)}\n {...props}\n />\n));\nAlertDialogDescription.displayName =\n AlertDialogPrimitive.Description.displayName;\n\nconst AlertDialogAction = React.forwardRef<\n React.ElementRef<typeof AlertDialogPrimitive.Action>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Action>\n>(({ className, ...props }, ref) => (\n <AlertDialogPrimitive.Action\n ref={ref}\n className={cn(buttonVariants(), className)}\n {...props}\n />\n));\nAlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName;\n\nconst AlertDialogCancel = React.forwardRef<\n React.ElementRef<typeof AlertDialogPrimitive.Cancel>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Cancel>\n>(({ className, ...props }, ref) => (\n <AlertDialogPrimitive.Cancel\n ref={ref}\n className={cn(\n buttonVariants({ variant: \"outline\" }),\n \"mt-2 sm:mt-0\",\n className\n )}\n {...props}\n />\n));\nAlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName;\n\nexport {\n AlertDialog,\n AlertDialogPortal,\n AlertDialogOverlay,\n AlertDialogTrigger,\n AlertDialogContent,\n AlertDialogHeader,\n AlertDialogFooter,\n AlertDialogTitle,\n AlertDialogDescription,\n AlertDialogAction,\n AlertDialogCancel,\n};\n","\"use client\";\n\nimport * as React from \"react\";\nimport * as ToastPrimitives from \"@radix-ui/react-toast\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { X } from \"lucide-react\";\n\nimport { cn } from \"../../../lib/utils\";\n\nconst ToastProvider = ToastPrimitives.Provider;\n\nconst ToastViewport = React.forwardRef<\n React.ElementRef<typeof ToastPrimitives.Viewport>,\n React.ComponentPropsWithoutRef<typeof ToastPrimitives.Viewport>\n>(({ className, ...props }, ref) => (\n <ToastPrimitives.Viewport\n ref={ref}\n className={cn(\n \"fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]\",\n className\n )}\n {...props}\n />\n));\nToastViewport.displayName = ToastPrimitives.Viewport.displayName;\n\nconst toastVariants = cva(\n \"group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full\",\n {\n variants: {\n variant: {\n default: \"border bg-background text-foreground\",\n destructive:\n \"destructive group border-destructive bg-destructive text-destructive-foreground\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n },\n }\n);\n\nconst Toast = React.forwardRef<\n React.ElementRef<typeof ToastPrimitives.Root>,\n React.ComponentPropsWithoutRef<typeof ToastPrimitives.Root> &\n VariantProps<typeof toastVariants>\n>(({ className, variant, ...props }, ref) => {\n return (\n <ToastPrimitives.Root\n ref={ref}\n className={cn(toastVariants({ variant }), className)}\n {...props}\n />\n );\n});\nToast.displayName = ToastPrimitives.Root.displayName;\n\nconst ToastAction = React.forwardRef<\n React.ElementRef<typeof ToastPrimitives.Action>,\n React.ComponentPropsWithoutRef<typeof ToastPrimitives.Action>\n>(({ className, ...props }, ref) => (\n <ToastPrimitives.Action\n ref={ref}\n className={cn(\n \"inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive\",\n className\n )}\n {...props}\n />\n));\nToastAction.displayName = ToastPrimitives.Action.displayName;\n\nconst ToastClose = React.forwardRef<\n React.ElementRef<typeof ToastPrimitives.Close>,\n React.ComponentPropsWithoutRef<typeof ToastPrimitives.Close>\n>(({ className, ...props }, ref) => (\n <ToastPrimitives.Close\n ref={ref}\n className={cn(\n \"absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600\",\n className\n )}\n toast-close=\"\"\n {...props}\n >\n <X className=\"h-4 w-4\" />\n </ToastPrimitives.Close>\n));\nToastClose.displayName = ToastPrimitives.Close.displayName;\n\nconst ToastTitle = React.forwardRef<\n React.ElementRef<typeof ToastPrimitives.Title>,\n React.ComponentPropsWithoutRef<typeof ToastPrimitives.Title>\n>(({ className, ...props }, ref) => (\n <ToastPrimitives.Title\n ref={ref}\n className={cn(\"text-sm font-semibold\", className)}\n {...props}\n />\n));\nToastTitle.displayName = ToastPrimitives.Title.displayName;\n\nconst ToastDescription = React.forwardRef<\n React.ElementRef<typeof ToastPrimitives.Description>,\n React.ComponentPropsWithoutRef<typeof ToastPrimitives.Description>\n>(({ className, ...props }, ref) => (\n <ToastPrimitives.Description\n ref={ref}\n className={cn(\"text-sm opacity-90\", className)}\n {...props}\n />\n));\nToastDescription.displayName = ToastPrimitives.Description.displayName;\n\ntype ToastProps = React.ComponentPropsWithoutRef<typeof Toast>;\n\ntype ToastActionElement = React.ReactElement<typeof ToastAction>;\n\nexport {\n type ToastProps,\n type ToastActionElement,\n ToastProvider,\n ToastViewport,\n Toast,\n ToastTitle,\n ToastDescription,\n ToastClose,\n ToastAction,\n};\n","// Loader.tsx\nimport * as React from \"react\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { cn } from \"../../../lib/utils\";\nimport { Loader2 } from \"lucide-react\";\n\nconst loaderVariants = cva(\n \"flex justify-center items-center w-full\",\n {\n variants: {\n size: {\n small: \"h-6 w-6\",\n medium: \"h-8 w-8\",\n large: \"h-12 w-12\",\n xl: \"h-24 w-24\",\n },\n colorVariant: {\n default: \"text-primary\",\n primary: \"text-primary\",\n secondary: \"text-secondary\",\n destructive: \"text-destructive\",\n },\n },\n defaultVariants: {\n size: \"medium\",\n colorVariant: \"default\",\n },\n }\n);\n\ninterface LoaderProps\n extends React.HTMLAttributes<HTMLDivElement>,\n VariantProps<typeof loaderVariants> {}\n\nconst Loader = React.forwardRef<HTMLDivElement, LoaderProps>(\n (\n { className, size, colorVariant, ...props },\n ref\n ) => (\n <div\n ref={ref}\n className={cn(loaderVariants({ size, colorVariant }), \"flex justify-center items-center h-full w-full\", className)}\n {...props}\n >\n <Loader2 className=\"animate-spin\" />\n </div>\n )\n);\n\nLoader.displayName = \"Loader\";\n\nexport { Loader };","\"use client\";\n\n// Inspired by react-hot-toast library\nimport * as React from \"react\";\n\nimport type {\n ToastActionElement,\n ToastProps,\n} from \"../../components/atoms/ui/toast\";\n\nconst TOAST_LIMIT = 1;\nconst TOAST_REMOVE_DELAY = 1000000;\n\ntype ToasterToast = ToastProps & {\n id: string;\n title?: React.ReactNode;\n description?: React.ReactNode;\n action?: ToastActionElement;\n};\n\nconst actionTypes = {\n ADD_TOAST: \"ADD_TOAST\",\n UPDATE_TOAST: \"UPDATE_TOAST\",\n DISMISS_TOAST: \"DISMISS_TOAST\",\n REMOVE_TOAST: \"REMOVE_TOAST\",\n} as const;\n\nlet count = 0;\n\nfunction genId() {\n count = (count + 1) % Number.MAX_SAFE_INTEGER;\n return count.toString();\n}\n\ntype ActionType = typeof actionTypes;\n\ntype Action =\n | {\n type: ActionType[\"ADD_TOAST\"];\n toast: ToasterToast;\n }\n | {\n type: ActionType[\"UPDATE_TOAST\"];\n toast: Partial<ToasterToast>;\n }\n | {\n type: ActionType[\"DISMISS_TOAST\"];\n toastId?: ToasterToast[\"id\"];\n }\n | {\n type: ActionType[\"REMOVE_TOAST\"];\n toastId?: ToasterToast[\"id\"];\n };\n\ninterface State {\n toasts: ToasterToast[];\n}\n\nconst toastTimeouts = new Map<string, ReturnType<typeof setTimeout>>();\n\nconst addToRemoveQueue = (toastId: string) => {\n if (toastTimeouts.has(toastId)) {\n return;\n }\n\n const timeout = setTimeout(() => {\n toastTimeouts.delete(toastId);\n dispatch({\n type: \"REMOVE_TOAST\",\n toastId: toastId,\n });\n }, TOAST_REMOVE_DELAY);\n\n toastTimeouts.set(toastId, timeout);\n};\n\nexport const reducer = (state: State, action: Action): State => {\n switch (action.type) {\n case \"ADD_TOAST\":\n return {\n ...state,\n toasts: [action.toast, ...state.toasts].slice(0, TOAST_LIMIT),\n };\n\n case \"UPDATE_TOAST\":\n return {\n ...state,\n toasts: state.toasts.map((t) =>\n t.id === action.toast.id ? { ...t, ...action.toast } : t\n ),\n };\n\n case \"DISMISS_TOAST\": {\n const { toastId } = action;\n\n // ! Side effects ! - This could be extracted into a dismissToast() action,\n // but I'll keep it here for simplicity\n if (toastId) {\n addToRemoveQueue(toastId);\n } else {\n state.toasts.forEach((toast) => {\n addToRemoveQueue(toast.id);\n });\n }\n\n return {\n ...state,\n toasts: state.toasts.map((t) =>\n t.id === toastId || toastId === undefined\n ? {\n ...t,\n open: false,\n }\n : t\n ),\n };\n }\n case \"REMOVE_TOAST\":\n if (action.toastId === undefined) {\n return {\n ...state,\n toasts: [],\n };\n }\n return {\n ...state,\n toasts: state.toasts.filter((t) => t.id !== action.toastId),\n };\n }\n};\n\nconst listeners: Array<(state: State) => void> = [];\n\nlet memoryState: State = { toasts: [] };\n\nfunction dispatch(action: Action) {\n memoryState = reducer(memoryState, action);\n listeners.forEach((listener) => {\n listener(memoryState);\n });\n}\n\ntype Toast = Omit<ToasterToast, \"id\">;\n\nfunction toast({ ...props }: Toast) {\n const id = genId();\n\n const update = (props: ToasterToast) =>\n dispatch({\n type: \"UPDATE_TOAST\",\n toast: { ...props, id },\n });\n const dismiss = () => dispatch({ type: \"DISMISS_TOAST\", toastId: id });\n\n dispatch({\n type: \"ADD_TOAST\",\n toast: {\n ...props,\n id,\n open: true,\n onOpenChange: (open) => {\n if (!open) dismiss();\n },\n },\n });\n\n return {\n id: id,\n dismiss,\n update,\n };\n}\n\nfunction useToast() {\n const [state, setState] = React.useState<State>(memoryState);\n\n React.useEffect(() => {\n listeners.push(setState);\n return () => {\n const index = listeners.indexOf(setState);\n if (index > -1) {\n listeners.splice(index, 1);\n }\n };\n }, [state]);\n\n return {\n ...state,\n toast,\n dismiss: (toastId?: string) => dispatch({ type: \"DISMISS_TOAST\", toastId }),\n };\n}\n\nexport { useToast, toast };\n","\"use client\";\n\nimport * as React from \"react\";\nimport { useToast } from \"../../hooks/use-toast\";\nimport {\n Toast,\n ToastClose,\n ToastDescription,\n ToastProvider,\n ToastTitle,\n ToastViewport,\n} from \"./toast\";\n\nfunction Toaster() {\n const { toasts } = useToast();\n\n return (\n <ToastProvider>\n {toasts.map(function ({ id, title, description, action, ...props }: any) {\n return (\n <Toast key={id} {...props}>\n <div className=\"grid gap-1\">\n {title && <ToastTitle>{title}</ToastTitle>}\n {description && (\n <ToastDescription>{description}</ToastDescription>\n )}\n </div>\n {action}\n <ToastClose />\n </Toast>\n );\n })}\n <ToastViewport />\n </ToastProvider>\n );\n}\n\nexport { Toaster };\n","\"use client\";\n\nimport * as React from \"react\";\nimport { useState, useEffect } from \"react\";\nimport { Loader } from \"..\";\nimport { cn } from \"../../../lib/utils\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\n\nconst thinkIndicatorVariants = cva(\n \"flex items-center gap-3\",\n {\n variants: {\n variant: {\n default: \"text-muted-foreground\",\n primary: \"text-primary\",\n secondary: \"text-secondary\",\n },\n size: {\n default: \"gap-3\",\n sm: \"gap-2\",\n lg: \"gap-4\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n }\n);\n\nexport interface ThinkIndicatorProps\n extends React.HTMLAttributes<HTMLDivElement>,\n VariantProps<typeof thinkIndicatorVariants> {\n thoughts?: string[];\n interval?: number;\n loader?: React.ReactNode;\n}\n\nexport const ThinkIndicator = React.forwardRef<HTMLDivElement, ThinkIndicatorProps>(\n ({ \n className, \n variant,\n size,\n thoughts = [\n \"Analyzing your request...\",\n \"Processing information...\",\n \"Formulating response...\",\n ],\n interval = 5000, \n loader,\n ...props \n }, ref) => {\n const [currentThoughtIndex, setCurrentThoughtIndex] = useState<number>(0);\n const [isAnimating, setIsAnimating] = useState<boolean>(false);\n\n useEffect(() => {\n const timer = setInterval(() => {\n setIsAnimating(true);\n setTimeout(() => {\n setCurrentThoughtIndex((prev) => {\n return prev < thoughts.length - 1 ? prev + 1 : prev;\n });\n setIsAnimating(false);\n }, 300);\n }, interval);\n\n if (currentThoughtIndex === thoughts.length - 1) {\n clearInterval(timer);\n }\n\n return () => clearInterval(timer);\n }, [thoughts, interval, currentThoughtIndex]);\n\n return (\n <div\n ref={ref}\n className={cn(thinkIndicatorVariants({ variant, size }), className, \"alq--think-indicator\")}\n {...props}\n >\n {loader || (\n <Loader \n className={cn(\n size === \"sm\" ? \"h-3 w-3\" : size === \"lg\" ? \"h-5 w-5\" : \"h-4 w-4\"\n )} \n />\n )}\n <div\n className={cn(\n \"alq--think-indicator-text\",\n \"transition-all duration-300\",\n isAnimating ? \"opacity-0 -translate-y-2\" : \"opacity-100 translate-y-0\"\n )}\n >\n {thoughts[currentThoughtIndex]}\n </div>\n </div>\n );\n }\n);\n\nThinkIndicator.displayName = \"ThinkIndicator\";\n\nexport { thinkIndicatorVariants };","import { forwardRef } from \"react\";\nimport { cn } from \"../../lib/utils\";\n\ninterface PageContainerProps extends React.HTMLAttributes<HTMLDivElement> {}\nconst PageContainer = forwardRef<HTMLDivElement, PageContainerProps>(\n ({ className, ...props }, ref) => {\n return (\n <div\n ref={ref}\n className={cn(className, \"alq--page-container\")}\n {...props}\n />\n );\n }\n);\nPageContainer.displayName = \"PageContainer\";\nexport { PageContainer };\n","\"use client\";\n\nimport * as React from \"react\";\nimport { useState, useEffect } from \"react\";\nimport { LucideIcon } from \"lucide-react\";\nimport { Button } from \"../atoms\";\nimport { cn } from \"../../lib/utils\";\n\ninterface Suggestion {\n label: string;\n icon: LucideIcon;\n action: () => void;\n}\n\ninterface AssistantSuggestionsProps {\n suggestions: Suggestion[];\n className?: string;\n showSuggestions: boolean;\n}\n\nconst AssistantSuggestions = React.forwardRef<\n HTMLDivElement,\n AssistantSuggestionsProps\n>(({ suggestions, showSuggestions, className }, ref) => {\n return (\n <div\n ref={ref}\n className={cn(\n \"absolute bottom-[calc(100%+0.5rem)] right-0 pb-2 mb-4 alq--assistant-suggestions-container\",\n \"transition-all duration-300\",\n showSuggestions\n ? \"opacity-100 translate-y-0\"\n : \"opacity-0 translate-y-4\",\n className\n )}\n >\n <div className=\"rounded-lg p-2 pr-0 w-64\">\n {suggestions.map((suggestion, index) => (\n <button\n key={index}\n onClick={() => suggestion.action?.()}\n style={{\n transitionDelay: showSuggestions ? `${index * 50}ms` : \"0ms\",\n }}\n className={cn(\n \"bg-background flex items-center gap-2 border p-2 pr-4 my-2 rounded-full ml-auto\",\n \"text-primary hover:bg-secondary\",\n \"transition-all duration-100\",\n \"origin-bottom w-fit\",\n \"alq--assistant-suggestion\",\n showSuggestions\n ? \"opacity-100 translate-y-0\"\n : \"opacity-0 translate-y-4\"\n )}\n >\n <suggestion.icon className=\"w-5 h-5 text-primary\" />\n <span className=\"text-xs whitespace-nowrap font-normal\">\n {suggestion.label}\n </span>\n </button>\n ))}\n </div>\n </div>\n );\n});\n\nAssistantSuggestions.displayName = \"Suggestions\";\n\ninterface AssistantButtonProps {\n icon: LucideIcon;\n clickAction: () => void;\n className?: string;\n suggestions?: Suggestion[];\n}\n\nexport const AssistantButton = React.forwardRef<\n HTMLDivElement,\n AssistantButtonProps\n>(\n (\n {\n icon: Icon,\n clickAction,\n className,\n suggestions = [],\n },\n ref\n ) => {\n const [isVisible, setIsVisible] = useState(false);\n const [showSuggestions, setShowSuggestions] = useState(false);\n\n const handleMouseEnter = () => {\n setIsVisible(true);\n requestAnimationFrame(() => {\n requestAnimationFrame(() => {\n setShowSuggestions(true);\n });\n });\n };\n\n const handleMouseLeave = () => {\n setShowSuggestions(false);\n setTimeout(() => setIsVisible(false), 300);\n };\n\n return (\n <div\n ref={ref}\n className={cn(\n \"fixed bottom-8 right-4 z-50\",\n \"alq--assistant-button-container\",\n className\n )}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n >\n <div className=\"relative group\">\n {isVisible && suggestions.length > 0 && (\n <AssistantSuggestions\n suggestions={suggestions}\n showSuggestions={showSuggestions}\n />\n )}\n <Button\n variant=\"outline\"\n size=\"sm\"\n className={cn(\n \"fixed hover:bg-opacity-70 transition-all duration-300\",\n \"bottom-4 h-12 w-12 right-4 z-50 rounded-full p-2\",\n \"shadow-md\",\n \"hover:shadow-lg\",\n showSuggestions ? \"scale-110\" : \"hover:scale-105\",\n \"alq--assistant-button\"\n )}\n onClick={clickAction}\n >\n <Icon\n style={{ width: \"22px\", height: \"22px\" }}\n className=\"text-primary\"\n />\n </Button>\n </div>\n </div>\n );\n }\n);\n\nAssistantButton.displayName = \"AssistantButton\";\n","\"use client\";\n\nimport * as React from \"react\";\nimport useEmblaCarousel, {\n type UseEmblaCarouselType,\n} from \"embla-carousel-react\";\nimport { ArrowLeft, ArrowRight } from \"lucide-react\";\n\nimport { cn } from \"../../lib/utils\";\nimport { Button } from \"../../components/atoms/ui/button\";\n\ntype CarouselApi = UseEmblaCarouselType[1];\ntype UseCarouselParameters = Parameters<typeof useEmblaCarousel>;\ntype CarouselOptions = UseCarouselParameters[0];\ntype CarouselPlugin = UseCarouselParameters[1];\n\ntype CarouselProps = {\n opts?: CarouselOptions;\n plugins?: CarouselPlugin;\n orientation?: \"horizontal\" | \"vertical\";\n setApi?: (api: CarouselApi) => void;\n};\n\ntype CarouselContextProps = {\n carouselRef: ReturnType<typeof useEmblaCarousel>[0];\n api: ReturnType<typeof useEmblaCarousel>[1];\n scrollPrev: () => void;\n scrollNext: () => void;\n canScrollPrev: boolean;\n canScrollNext: boolean;\n} & CarouselProps;\n\nconst CarouselContext = React.createContext<CarouselContextProps | null>(null);\n\nfunction useCarousel() {\n const context = React.useContext(CarouselContext);\n\n if (!context) {\n throw new Error(\"useCarousel must be used within a <Carousel />\");\n }\n\n return context;\n}\n\nconst Carousel = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement> & CarouselProps\n>(\n (\n {\n orientation = \"horizontal\",\n opts,\n setApi,\n plugins,\n className,\n children,\n ...props\n },\n ref\n ) => {\n const [carouselRef, api] = useEmblaCarousel(\n {\n ...opts,\n axis: orientation === \"horizontal\" ? \"x\" : \"y\",\n },\n plugins\n );\n const [canScrollPrev, setCanScrollPrev] = React.useState(false);\n const [canScrollNext, setCanScrollNext] = React.useState(false);\n\n const onSelect = React.useCallback((api: CarouselApi) => {\n if (!api) {\n return;\n }\n\n setCanScrollPrev(api.canScrollPrev());\n setCanScrollNext(api.canScrollNext());\n }, []);\n\n const scrollPrev = React.useCallback(() => {\n api?.scrollPrev();\n }, [api]);\n\n const scrollNext = React.useCallback(() => {\n api?.scrollNext();\n }, [api]);\n\n const handleKeyDown = React.useCallback(\n (event: React.KeyboardEvent<HTMLDivElement>) => {\n if (event.key === \"ArrowLeft\") {\n event.preventDefault();\n scrollPrev();\n } else if (event.key === \"ArrowRight\") {\n event.preventDefault();\n scrollNext();\n }\n },\n [scrollPrev, scrollNext]\n );\n\n React.useEffect(() => {\n if (!api || !setApi) {\n return;\n }\n\n setApi(api);\n }, [api, setApi]);\n\n React.useEffect(() => {\n if (!api) {\n return;\n }\n\n onSelect(api);\n api.on(\"reInit\", onSelect);\n api.on(\"select\", onSelect);\n\n return () => {\n api?.off(\"select\", onSelect);\n };\n }, [api, onSelect]);\n\n return (\n <CarouselContext.Provider\n value={{\n carouselRef,\n api: api,\n opts,\n orientation:\n orientation || (opts?.axis === \"y\" ? \"vertical\" : \"horizontal\"),\n scrollPrev,\n scrollNext,\n canScrollPrev,\n canScrollNext,\n }}\n >\n <div\n ref={ref}\n onKeyDownCapture={handleKeyDown}\n className={cn(\"relative\", className)}\n role=\"region\"\n aria-roledescription=\"carousel\"\n {...props}\n >\n {children}\n </div>\n </CarouselContext.Provider>\n );\n }\n);\nCarousel.displayName = \"Carousel\";\n\nconst CarouselContent = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => {\n const { carouselRef, orientation } = useCarousel();\n\n return (\n <div ref={carouselRef} className=\"overflow-hidden\">\n <div\n ref={ref}\n className={cn(\n \"flex\",\n orientation === \"horizontal\" ? \"-ml-4\" : \"-mt-4 flex-col\",\n className\n )}\n {...props}\n />\n </div>\n );\n});\nCarouselContent.displayName = \"CarouselContent\";\n\nconst CarouselItem = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => {\n const { orientation } = useCarousel();\n\n return (\n <div\n ref={ref}\n role=\"group\"\n aria-roledescription=\"slide\"\n className={cn(\n \"min-w-0 shrink-0 grow-0 basis-full\",\n orientation === \"horizontal\" ? \"pl-4\" : \"pt-4\",\n className\n )}\n {...props}\n />\n );\n});\nCarouselItem.displayName = \"CarouselItem\";\n\nconst CarouselPrevious = React.forwardRef<\n HTMLButtonElement,\n React.ComponentProps<typeof Button>\n>(({ className, variant = \"outline\", size = \"icon\", ...props }, ref) => {\n const { orientation, scrollPrev, canScrollPrev } = useCarousel();\n\n return (\n <Button\n ref={ref}\n variant={variant}\n size={size}\n className={cn(\n \"absolute h-8 w-8 rounded-full\",\n orientation === \"horizontal\"\n ? \"-left-12 top-1/2 -translate-y-1/2\"\n : \"-top-12 left-1/2 -translate-x-1/2 rotate-90\",\n className\n )}\n disabled={!canScrollPrev}\n onClick={scrollPrev}\n {...props}\n >\n <ArrowLeft className=\"h-4 w-4\" />\n <span className=\"sr-only\">Previous slide</span>\n </Button>\n );\n});\nCarouselPrevious.displayName = \"CarouselPrevious\";\n\nconst CarouselNext = React.forwardRef<\n HTMLButtonElement,\n React.ComponentProps<typeof Button>\n>(({ className, variant = \"outline\", size = \"icon\", ...props }, ref) => {\n const { orientation, scrollNext, canScrollNext } = useCarousel();\n\n return (\n <Button\n ref={ref}\n variant={variant}\n size={size}\n className={cn(\n \"absolute h-8 w-8 rounded-full\",\n orientation === \"horizontal\"\n ? \"-right-12 top-1/2 -translate-y-1/2\"\n : \"-bottom-12 left-1/2 -translate-x-1/2 rotate-90\",\n className\n )}\n disabled={!canScrollNext}\n onClick={scrollNext}\n {...props}\n >\n <ArrowRight className=\"h-4 w-4\" />\n <span className=\"sr-only\">Next slide</span>\n </Button>\n );\n});\nCarouselNext.displayName = \"CarouselNext\";\n\nexport {\n type CarouselApi,\n Carousel,\n CarouselContent,\n CarouselItem,\n CarouselPrevious,\n CarouselNext,\n};\n","import * as React from \"react\";\nimport * as NavigationMenuPrimitive from \"@radix-ui/react-navigation-menu\";\nimport { cva } from \"class-variance-authority\";\nimport { ChevronDown } from \"lucide-react\";\n\nimport { cn } from \"../../lib/utils\";\n\nconst NavigationMenu = React.forwardRef<\n React.ElementRef<typeof NavigationMenuPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Root>\n>(({ className, children, ...props }, ref) => (\n <NavigationMenuPrimitive.Root\n ref={ref}\n className={cn(\n \"relative z-10 flex max-w-max flex-1 items-center justify-center\",\n className\n )}\n {...props}\n >\n {children}\n <NavigationMenuViewport />\n </NavigationMenuPrimitive.Root>\n));\nNavigationMenu.displayName = NavigationMenuPrimitive.Root.displayName;\n\nconst NavigationMenuList = React.forwardRef<\n React.ElementRef<typeof NavigationMenuPrimitive.List>,\n React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.List>\n>(({ className, ...props }, ref) => (\n <NavigationMenuPrimitive.List\n ref={ref}\n className={cn(\n \"group flex flex-1 list-none items-center justify-center space-x-1\",\n className\n )}\n {...props}\n />\n));\nNavigationMenuList.displayName = NavigationMenuPrimitive.List.displayName;\n\nconst NavigationMenuItem = NavigationMenuPrimitive.Item;\n\nconst navigationMenuTriggerStyle = cva(\n \"group inline-flex h-10 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-none disabled:pointer-events-none disabled:opacity-50 data-[active]:bg-accent/50 data-[state=open]:bg-accent/50\"\n);\n\nconst NavigationMenuTrigger = React.forwardRef<\n React.ElementRef<typeof NavigationMenuPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Trigger>\n>(({ className, children, ...props }, ref) => (\n <NavigationMenuPrimitive.Trigger\n ref={ref}\n className={cn(navigationMenuTriggerStyle(), \"group\", className)}\n {...props}\n >\n {children}{\" \"}\n <ChevronDown\n className=\"relative top-[1px] ml-1 h-3 w-3 transition duration-200 group-data-[state=open]:rotate-180\"\n aria-hidden=\"true\"\n />\n </NavigationMenuPrimitive.Trigger>\n));\nNavigationMenuTrigger.displayName = NavigationMenuPrimitive.Trigger.displayName;\n\nconst NavigationMenuContent = React.forwardRef<\n React.ElementRef<typeof NavigationMenuPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Content>\n>(({ className, ...props }, ref) => (\n <NavigationMenuPrimitive.Content\n ref={ref}\n className={cn(\n \"left-0 top-0 w-full data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 md:absolute md:w-auto \",\n className\n )}\n {...props}\n />\n));\nNavigationMenuContent.displayName = NavigationMenuPrimitive.Content.displayName;\n\nconst NavigationMenuLink = NavigationMenuPrimitive.Link;\n\nconst NavigationMenuViewport = React.forwardRef<\n React.ElementRef<typeof NavigationMenuPrimitive.Viewport>,\n React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Viewport>\n>(({ className, ...props }, ref) => (\n <div className={cn(\"absolute left-0 top-full flex justify-center\")}>\n <NavigationMenuPrimitive.Viewport\n className={cn(\n \"origin-top-center relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 md:w-[var(--radix-navigation-menu-viewport-width)]\",\n className\n )}\n ref={ref}\n {...props}\n />\n </div>\n));\nNavigationMenuViewport.displayName =\n NavigationMenuPrimitive.Viewport.displayName;\n\nconst NavigationMenuIndicator = React.forwardRef<\n React.ElementRef<typeof NavigationMenuPrimitive.Indicator>,\n React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Indicator>\n>(({ className, ...props }, ref) => (\n <NavigationMenuPrimitive.Indicator\n ref={ref}\n className={cn(\n \"top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in\",\n className\n )}\n {...props}\n >\n <div className=\"relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md\" />\n </NavigationMenuPrimitive.Indicator>\n));\nNavigationMenuIndicator.displayName =\n NavigationMenuPrimitive.Indicator.displayName;\n\nexport {\n navigationMenuTriggerStyle,\n NavigationMenu,\n NavigationMenuList,\n NavigationMenuItem,\n NavigationMenuContent,\n NavigationMenuTrigger,\n NavigationMenuLink,\n NavigationMenuIndicator,\n NavigationMenuViewport,\n};\n","import * as React from \"react\";\nimport { LucideIcon } from \"lucide-react\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\n\nimport { cn } from \"../../lib/utils\";\nimport { ScrollArea, Button } from \"../atoms\";\n\nconst sidebarVariants = cva(\n \"flex flex-col border-r\",\n {\n variants: {\n size: {\n sm: \"w-48\",\n default: \"w-64\",\n lg: \"w-72\"\n },\n },\n defaultVariants: {\n size: \"default\",\n },\n }\n);\n\nexport interface SidebarItem {\n name: string;\n icon?: LucideIcon;\n disabled?: boolean;\n isLink?: boolean;\n link?: string;\n}\n\ntype SidebarBaseProps = {\n items: SidebarItem[];\n selectedSection?: SidebarItem;\n onSelect?: (item: SidebarItem) => void;\n footerContent?: React.ReactNode;\n selectedVariant?: \"default\" | \"secondary\" | \"ghost\" | \"link\";\n defaultVariant?: \"default\" | \"secondary\" | \"ghost\" | \"link\";\n buttonClassName?: string;\n}\n\nexport interface SidebarProps \n extends SidebarBaseProps,\n Omit<React.HTMLAttributes<HTMLDivElement>, keyof SidebarBaseProps>,\n VariantProps<typeof sidebarVariants> {}\n\nexport const SidebarFooter = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, children, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\"p-4\", className)}\n {...props}\n >\n {children}\n </div>\n));\nSidebarFooter.displayName = \"SidebarFooter\";\n\n\nexport const Sidebar = React.forwardRef<HTMLDivElement, SidebarProps>(\n ({ \n className, \n items, \n selectedSection, \n onSelect, \n footerContent,\n size = \"default\",\n selectedVariant = \"secondary\",\n defaultVariant = \"ghost\",\n buttonClassName,\n ...props \n }, ref) => {\n return (\n <div className={cn(className, \"alq--navigation-sidebar h-full\")} ref={ref} {...props}>\n <aside className={cn(sidebarVariants({ size }), \"h-full\")}>\n <ScrollArea className=\"flex-grow justify-between\">\n <div className=\"flex flex-col gap-2 p-4\">\n {items.map((item) => (\n <Button\n key={item.name}\n variant={selectedSection?.name === item.name ? selectedVariant : defaultVariant}\n className={cn(\"justify-start\", buttonClassName)}\n disabled={item.disabled}\n onClick={() => {\n if (onSelect) {\n onSelect(item);\n }\n }}\n >\n {item.icon && <item.icon className=\"mr-2 h-4 w-4\" />}\n {item.name}\n </Button>\n ))}\n </div>\n </ScrollArea>\n {footerContent && (\n <SidebarFooter>\n {footerContent}\n </SidebarFooter>\n )}\n </aside>\n </div>\n );\n }\n);","\"use client\";\nimport * as React from \"react\";\nimport { Toaster as Sonner } from \"sonner\";\nimport { useAlquimiaTheme } from '../../providers/theme-context';\n\ntype ToasterProps = React.ComponentProps<typeof Sonner>;\n\nconst Toaster = ({ ...props }: ToasterProps) => {\n const { theme = \"system\" } = useAlquimiaTheme();\n\n return (\n <Sonner\n theme={theme as ToasterProps[\"theme\"]}\n className=\"toaster group\"\n toastOptions={{\n classNames: {\n toast:\n \"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg\",\n description: \"group-[.toast]:text-muted-foreground\",\n actionButton:\n \"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground\",\n cancelButton:\n \"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground\",\n },\n }}\n {...props}\n />\n );\n};\nexport { Toaster as SonnerToaster };\n","\"use client\";\nimport { createContext, useContext } from 'react';\n\ninterface ThemeContextValue {\n theme: string;\n setTheme: (theme: string) => void;\n}\n\nexport const ThemeContext = createContext<ThemeContextValue>({\n theme: 'system',\n setTheme: () => {},\n});\n\nexport function useAlquimiaTheme() {\n return useContext(ThemeContext);\n}\n","\"use client\"\n\nimport * as React from \"react\"\nimport * as TooltipPrimitive from \"@radix-ui/react-tooltip\"\nimport { Star } from \"lucide-react\"\nimport { cn } from \"../../lib/utils\";\nimport { Button } from \"../atoms\";\n\nconst TooltipProvider = TooltipPrimitive.Provider\nconst Tooltip = TooltipPrimitive.Root\nconst TooltipTrigger = TooltipPrimitive.Trigger\n\nconst TooltipContent = React.forwardRef<\n React.ElementRef<typeof TooltipPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content>\n>(({ className, sideOffset = 4, ...props }, ref) => (\n <TooltipPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n className={cn(\n \"z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground shadow-lg animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 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\",\n className\n )}\n {...props}\n />\n))\nTooltipContent.displayName = TooltipPrimitive.Content.displayName\n\ninterface StarColors {\n fill: string\n stroke: string\n}\n\ninterface RatingStarsProps {\n currentRating: number\n isLoading: boolean\n onRate: (rating: number) => void\n className?: string\n}\n\nconst StarRating = React.forwardRef<\n HTMLDivElement,\n { rating: number; onRate: (r: number) => void }\n>(({ rating, onRate }, ref) => (\n <div ref={ref} className=\"flex\">\n {[1, 2, 3, 4, 5].map((star) => (\n <Button\n key={star}\n onClick={() => onRate(star)}\n variant=\"link\"\n className=\"p-1 transition-colors [&_svg]:size-5 h-5\"\n aria-label={`Rate ${star} star${star !== 1 ? \"s\" : \"\"}`}\n >\n <Star\n className={cn(\n \"w-5 h-5\",\n star <= rating ? \"alq-rating-star-active fill-current stroke-current\" : \"alq-rating-star-inactive\",\n )}\n />\n </Button>\n ))}\n </div>\n));\nStarRating.displayName = \"StarRating\"\n\nexport const RatingStars = React.forwardRef<\n HTMLButtonElement,\n RatingStarsProps\n>(({\n currentRating = 0,\n onRate,\n className,\n isLoading\n}, ref) => {\n const [open, setOpen] = React.useState(false)\n const [animate, setAnimate] = React.useState(false)\n\n const handleRate = (rating: number) => {\n onRate(rating)\n setOpen(false)\n }\n\n React.useEffect(() => {\n if (currentRating > 0) {\n setAnimate(true)\n const timer = setTimeout(() => setAnimate(false), 150)\n return () => clearTimeout(timer)\n }\n }, [currentRating])\n\n const hasRated = currentRating > 0\n\n return (\n <TooltipProvider>\n <Tooltip open={open} onOpenChange={setOpen}>\n <TooltipTrigger asChild>\n <Button\n ref={ref}\n variant=\"link\"\n className={cn(\n \"inline-flex items-center justify-center rounded-md text-sm font-medium [&_svg]:size-5 transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50\",\n className\n )}\n disabled={isLoading}\n onClick={() => setOpen(!open)}\n >\n <Star \n className={cn(\n \"w-5 h-5 transition-all duration-500\",\n animate && \"animate-ping\",\n isLoading && \"animate-pulse\",\n hasRated ? \"alq-rating-star-active fill-current stroke-current\" : \"alq-rating-star-inactive\",\n )}\n />\n </Button>\n </TooltipTrigger>\n <TooltipContent side=\"top\" align=\"center\" className=\"p-0\">\n <div className=\"p-2 bg-background\">\n <StarRating \n rating={currentRating} \n onRate={handleRate}\n />\n </div>\n </TooltipContent>\n </Tooltip>\n </TooltipProvider>\n )\n})\nRatingStars.displayName = \"RatingStars\"\n\nexport {\n Tooltip,\n TooltipTrigger,\n TooltipContent,\n TooltipProvider,\n}","\"use client\"\n\nimport * as React from \"react\"\nimport { ThumbsUp, ThumbsDown } from \"lucide-react\"\nimport { Button } from \"../atoms\";\nimport { cn } from \"../../lib/utils\";\n\ninterface RatingThumbsProps {\n currentRating: string\n isLoading: boolean\n onRate: (rating: \"thumbsUp\" | \"thumbsDown\" | \"\") => void\n direction?: \"row\" | \"column\"\n className?: string\n}\n\nexport const RatingThumbs = React.forwardRef<HTMLDivElement, RatingThumbsProps>(\n (\n {\n currentRating,\n onRate,\n direction = \"row\",\n className,\n isLoading\n },\n ref\n ) => {\n const [animate, setAnimate] = React.useState(false);\n\n React.useEffect(() => {\n if (currentRating) {\n setAnimate(true);\n const timer = setTimeout(() => setAnimate(false), 150);\n return () => clearTimeout(timer);\n }\n }, [currentRating]);\n\n return (\n <div\n ref={ref}\n className={cn(\n \"inline-flex\",\n direction === \"column\" ? \"flex-col\" : \"flex-row\",\n \"space-x-1 gap-4\",\n className\n )}\n >\n <Button\n variant=\"link\"\n onClick={() => onRate(currentRating === \"thumbsUp\" ? \"\" : \"thumbsUp\")}\n className={cn(\n \"p-1 transition-colors disabled:opacity-50 [&_svg]:size-5\",\n `hover:alq-rating-thumbsup/10`\n )}\n aria-label=\"Thumbs up\"\n disabled={isLoading}\n >\n <ThumbsUp\n className={cn(\n \"w-5 h-5 transition-all duration-500\",\n animate && currentRating === \"thumbsUp\" && \"animate-ping\",\n isLoading && \"animate-pulse\",\n currentRating === \"thumbsUp\" ? \"alq-rating-thumbsup fill-current stroke-current\" : \"alq-rating-thumbs-inactive fill-transparent\"\n )}\n />\n </Button>\n <Button\n variant=\"link\"\n onClick={() => onRate(currentRating === \"thumbsDown\" ? \"\" : \"thumbsDown\")}\n className={cn(\n \"p-1 transition-colors disabled:opacity-50 mt-0.5 [&_svg]:size-5\",\n `hover:bg-alq-rating-thumbsdown/10`\n )}\n aria-label=\"Thumbs down\"\n disabled={isLoading}\n >\n <ThumbsDown\n className={cn(\n \"w-5 h-5 transition-all duration-500\",\n animate && currentRating === \"thumbsDown\" && \"animate-ping\",\n isLoading && \"animate-pulse\",\n currentRating === \"thumbsDown\" ? \"alq-rating-thumbsdown fill-current stroke-current\" : \"alq-rating-thumbs-inactive fill-transparent\"\n )}\n />\n </Button>\n </div>\n );\n }\n);\n\nRatingThumbs.displayName = \"RatingThumbs\"","\"use client\"\n\nimport * as React from \"react\"\nimport { Book } from \"lucide-react\"\nimport { cn } from \"../../lib/utils\"\nimport { Button } from \"../atoms\"\nimport {\n Dialog,\n DialogTrigger,\n DialogContent,\n DialogOverlay,\n DialogTitle,\n} from \"../atoms/ui/dialog\";\n\ninterface RatingCommentProps {\n currentRating: string\n onRate: (comment: string) => void\n className?: string\n isLoading?: boolean\n}\n\nexport const RatingComment = React.forwardRef<HTMLButtonElement, RatingCommentProps>(\n ({ currentRating, onRate, className, isLoading }, ref) => {\n const [open, setOpen] = React.useState(false)\n const [comment, setComment] = React.useState(\"\")\n const [animate, setAnimate] = React.useState(false);\n\n const handleRate = () => {\n onRate(comment)\n setOpen(false)\n }\n\n React.useEffect(() => {\n if (currentRating) {\n setAnimate(true);\n const timer = setTimeout(() => setAnimate(false), 150);\n return () => clearTimeout(timer);\n }\n }, [currentRating]);\n\n React.useEffect(() => {\n setComment(\"\")\n }, [open])\n\n return (\n <Dialog open={open} onOpenChange={setOpen}>\n <DialogTrigger asChild>\n <Button\n ref={ref}\n variant=\"link\"\n size={\"lg\"}\n className={cn(\n \"inline-flex p-2 items-center justify-center rounded-md text-sm font-medium transition-colors [&_svg]:size-5 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring bg-transparent hover:none disabled:pointer-events-none disabled:opacity-50\",\n className\n )}\n disabled={isLoading}\n >\n <Book\n className={cn(\n \"w-5 h-5 transition-all duration-500\",\n animate && \"animate-ping\",\n isLoading && \"animate-pulse\",\n `${comment ? \"alq-rating-comment\" : \"stroke-gray-400\"}`\n )}\n />\n </Button>\n </DialogTrigger>\n <DialogOverlay className=\"fixed inset-0 bg-black bg-opacity-50\" />\n <DialogContent aria-describedby={undefined}>\n <DialogTitle className=\"text-lg font-medium\">\n Deja un comentario\n </DialogTitle>\n <textarea\n className=\"mt-4 w-full p-2 border rounded-md focus:outline-none focus:ring-2 focus:ring-primary\"\n rows={4}\n value={comment}\n onChange={(e) => setComment(e.target.value)}\n />\n <div className=\"mt-4 flex justify-end\">\n <Button\n onClick={handleRate}\n disabled={!comment}\n >\n Enviar\n </Button>\n </div>\n </DialogContent>\n </Dialog>\n );\n }\n)\n\nRatingComment.displayName = \"RatingComment\"\n","import * as React from \"react\";\nimport { ChevronDown, ChevronUp } from \"lucide-react\";\n\nimport { cn } from \"../../lib/utils\";\nimport { Button, RichText } from \"../atoms\";\nimport { Message } from \"ai\";\nimport { useTextStreaming } from \"../hooks/use-text-streaming\";\n\nexport interface CallOutMessage {\n id: string;\n role: \"user\" | \"assistant\";\n content: string;\n timestamp: Date;\n}\n\ninterface CallOutActionProps {\n label: string;\n icon: React.ReactNode;\n onClick: (message?: Message) => Promise<void>;\n custom?: boolean;\n component?: (props: { message?: Message }) => React.ReactNode;\n}\n\nexport interface CallOutProps extends React.HTMLAttributes<HTMLDivElement> {\n message?: Message;\n}\n\nconst CallOut = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement> & CallOutProps\n>(({ className, children, role, ...props }, ref) => {\n return (\n <div\n ref={ref}\n className={cn(\"alq--callout-box\", className)}\n data-role={role}\n {...props}\n >\n {children}\n </div>\n );\n});\n\nconst CallOutDate = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, children, ...props }, ref) => {\n return (\n <div\n ref={ref}\n className={cn(\n \"alq--callout-date\",\n \"text-sm text-muted-foreground\",\n className\n )}\n {...props}\n >\n {children}\n </div>\n );\n});\n\nconst CallOutActions = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement> & {\n actions: CallOutActionProps[];\n role: \"user\" | \"assistant\";\n message?: Message;\n }\n>(({ className, actions, role, message, ...props }, ref) => {\n const [isLoading, setIsLoading] = React.useState(false);\n const [isClicked, setIsClicked] = React.useState(false);\n\n if (role === \"user\") {\n return null;\n }\n\n return (\n <div ref={ref} className={cn(\"alq--callout-actions\", className)} {...props}>\n {actions.map((action) => (\n action.custom ? (\n <React.Fragment key={action.label}>\n {action.component?.({ message })}\n </React.Fragment>\n ) : (\n <button\n key={action.label}\n className={cn(\n \"alq--callout-action\",\n {\n \"alq--callout-animate-action\": isLoading,\n },\n {\n \"alq--callout-clicked-action\": isClicked,\n }\n )}\n type=\"button\"\n title={action.label}\n onClick={() => {\n setIsLoading(true);\n action.onClick(message).then(() => {\n setIsLoading(false);\n setIsClicked(true);\n });\n }}\n >\n <span\n className={cn(\"alq-action-icon-wrapper\", {\n \"alq--callout-animate-action\": isLoading,\n })}\n >\n {action.icon}\n </span>\n <label>{action.label}</label>\n </button>\n )\n ))}\n </div>\n );\n});\n\nconst CallOutResponse = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement> & {\n role: Message[\"role\"];\n additionalInfo?: string;\n toggleAdditionalInfo?: boolean;\n isStreaming?: boolean;\n handleIsTextStreaming?: (isStreaming: boolean) => void;\n }\n>(\n (\n {\n className,\n children,\n role,\n additionalInfo,\n toggleAdditionalInfo,\n isStreaming,\n handleIsTextStreaming,\n ...props\n },\n ref\n ) => {\n const [isAdditionalInfoOpen, setIsAdditionalInfoOpen] =\n React.useState(false);\n const content = String(children || \"\");\n const shouldStream = role === \"assistant\" && isStreaming;\n const displayedContent = useTextStreaming(\n content,\n shouldStream ?? false,\n handleIsTextStreaming\n );\n\n const showAsToggle = additionalInfo && toggleAdditionalInfo;\n const showInline = additionalInfo && !toggleAdditionalInfo;\n\n return (\n <div\n ref={ref}\n data-role={role}\n className={cn(\n \"alq--callout-response\",\n \"max-w-none\",\n \"text-foreground\",\n className\n )}\n {...props}\n >\n <RichText content={displayedContent} />\n {showInline && (\n <div\n className={cn(\n \"alq--callout-response-additional-info\",\n \"mt-2 text-sm text-muted-foreground whitespace-pre-line\",\n \"border-t border-border pt-2\"\n )}\n >\n {additionalInfo}\n </div>\n )}\n {showAsToggle && (\n <div\n className={cn(\n \"alq--callout-response-additional-info\",\n \"mt-2 border-t border-border pt-2\"\n )}\n >\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n className=\"h-auto py-1.5 px-0 text-xs text-muted-foreground hover:bg-transparent hover:text-muted-foreground -ml-1\"\n onClick={() => setIsAdditionalInfoOpen((prev) => !prev)}\n aria-expanded={isAdditionalInfoOpen}\n >\n {isAdditionalInfoOpen ? (\n <ChevronUp className=\"h-4 w-4 mr-1.5 shrink-0 transition-transform\" />\n ) : (\n <ChevronDown className=\"h-4 w-4 mr-1.5 shrink-0 transition-transform\" />\n )}\n {isAdditionalInfoOpen ? \"Hide details\" : \"Show details\"}\n </Button>\n <div\n className={cn(\n \"grid transition-[grid-template-rows] duration-200 ease-out\",\n isAdditionalInfoOpen ? \"grid-rows-[1fr]\" : \"grid-rows-[0fr]\"\n )}\n >\n <div className=\"overflow-hidden\">\n <div className=\"text-sm text-muted-foreground pt-1 whitespace-pre-line\">\n {additionalInfo}\n </div>\n </div>\n </div>\n </div>\n )}\n </div>\n );\n }\n);\n\nCallOut.displayName = \"CallOut\";\nCallOutDate.displayName = \"CallOutDate\";\nCallOutActions.displayName = \"CallOutActions\";\nCallOutResponse.displayName = \"CallOutResponse\";\nexport { CallOut, CallOutDate, CallOutResponse, CallOutActions };\n","import { useState, useEffect, useRef, useCallback } from \"react\";\n\nconst CHAR_DELAY = 15;\nconst PUNCTUATION_DELAY = 300;\n\nexport function useTextStreaming(\n content: string,\n shouldStream: boolean,\n handleIsTextStreaming?: (isStreaming: boolean) => void\n) {\n const [displayedText, setDisplayedText] = useState(\"\");\n const contentRef = useRef(content);\n const indexRef = useRef(0);\n const timerRef = useRef<NodeJS.Timeout | null>(null);\n\n const hasStartedStreaming = useRef<boolean>(false);\n\n useEffect(() => {\n contentRef.current = content;\n if (hasStartedStreaming.current && !timerRef.current && indexRef.current < contentRef.current.length) {\n typeNext();\n }\n }, [content]);\n\n const typeNext = useCallback(() => {\n if (indexRef.current < contentRef.current.length) {\n const nextChar = contentRef.current.charAt(indexRef.current);\n setDisplayedText((prev) => prev + nextChar);\n indexRef.current++;\n\n const delay = /[.!?;:]/.test(nextChar) ? PUNCTUATION_DELAY : CHAR_DELAY;\n \n timerRef.current = setTimeout(() => {\n timerRef.current = null;\n typeNext();\n }, delay);\n } else {\n handleIsTextStreaming?.(false);\n }\n }, []);\n\n useEffect(() => {\n if (!shouldStream && !hasStartedStreaming.current) {\n setDisplayedText(contentRef.current);\n indexRef.current = contentRef.current.length;\n if (timerRef.current) {\n clearTimeout(timerRef.current);\n timerRef.current = null;\n }\n handleIsTextStreaming?.(false);\n } else {\n if (indexRef.current < contentRef.current.length && !timerRef.current) {\n handleIsTextStreaming?.(true);\n hasStartedStreaming.current = true;\n typeNext();\n }\n }\n\n return () => {\n if (timerRef.current) {\n clearTimeout(timerRef.current);\n timerRef.current = null;\n }\n };\n }, [shouldStream, typeNext]);\n\n return displayedText;\n}\n\n","import * as React from \"react\";\nimport { Check, Loader2, ShieldAlert, X } from \"lucide-react\";\nimport type { ToolApproval } from \"@alquimia-ai/tools/hooks\";\nimport { cn } from \"../../lib/utils\";\nimport { Button } from \"../atoms/ui/button\";\nimport { Textarea } from \"../atoms/ui/textarea\";\n\n/** The subset of a `useAlquimia` `ToolApproval` this card reads. */\nexport type ToolApprovalView = Pick<\n ToolApproval,\n | \"controlId\"\n | \"toolName\"\n | \"arguments\"\n | \"channelOwned\"\n | \"status\"\n | \"reason\"\n | \"decidedHere\"\n | \"canAnswer\"\n | \"lastResult\"\n>;\n\nexport interface ToolApprovalCardProps {\n approval: ToolApprovalView;\n /** Usually `useAlquimia().approveTool`. */\n onDecide: (controlId: string, approved: boolean, reason?: string) => unknown;\n /**\n * Name of the channel that owns a channel-bound gate (\"WhatsApp\", \"Slack\"…),\n * for the explanation shown in place of the buttons. The runtime's refusal\n * does not name it, so only the app can.\n */\n channelName?: string;\n className?: string;\n}\n\nfunction formatArguments(args: unknown): string | null {\n if (args === null || args === undefined) return null;\n if (typeof args === \"string\") return args;\n try {\n return JSON.stringify(args, null, 2);\n } catch {\n return String(args);\n }\n}\n\n/** Why the buttons are gone while the gate is still open, if they are. */\nfunction blockedMessage(approval: ToolApprovalView, channelName?: string): string | null {\n const outcome = approval.lastResult?.outcome;\n if (approval.channelOwned || outcome === \"wrong-channel\") {\n return `This approval has to be answered in ${channelName ?? \"the channel the conversation came from\"}. It can't be answered here.`;\n }\n switch (outcome) {\n case \"already-decided\":\n return \"Someone else already answered this request. Waiting for the agent to continue.\";\n case \"not-pending\":\n return \"This request is no longer waiting for a decision.\";\n case \"not-found\":\n return \"This conversation has ended, so the request can no longer be answered.\";\n case \"forbidden\":\n return \"You don't have permission to answer this request.\";\n default:\n return null;\n }\n}\n\n/**\n * A human-approval gate: what the agent wants to run, with what arguments, and\n * Approve / Reject. The card never decides the gate is settled on its own — it\n * reflects `approval.status`, which the hook drives from the stream, so a\n * decision made by another operator or on the originating channel shows here too.\n */\nexport function ToolApprovalCard({ approval, onDecide, channelName, className }: ToolApprovalCardProps) {\n const [rejecting, setRejecting] = React.useState(false);\n const [reason, setReason] = React.useState(\"\");\n\n const args = formatArguments(approval.arguments);\n const toolLabel = approval.toolName ?? \"a tool\";\n const submitting = approval.status === \"submitting\";\n const settled = approval.status === \"approved\" || approval.status === \"rejected\";\n const blocked = !settled && !submitting && !approval.canAnswer ? blockedMessage(approval, channelName) : null;\n const failed =\n !settled && !submitting && approval.canAnswer && approval.lastResult && approval.lastResult.outcome !== \"accepted\"\n ? approval.lastResult\n : null;\n\n const decide = (approved: boolean) => {\n const said = reason.trim();\n void onDecide(approval.controlId, approved, approved || !said ? undefined : said);\n };\n\n return (\n <section\n aria-label={`Approval request for ${toolLabel}`}\n data-status={approval.status}\n className={cn(\n \"alq--tool-approval w-full max-w-[95%] rounded-2xl border bg-card p-4 shadow-sm\",\n settled ? \"border-border/60\" : \"border-amber-500/50\",\n className,\n )}\n >\n <header className=\"flex items-start gap-2\">\n <ShieldAlert\n aria-hidden\n className={cn(\"mt-0.5 h-4 w-4 shrink-0\", settled ? \"text-muted-foreground\" : \"text-amber-500\")}\n />\n <div className=\"min-w-0 flex-1\">\n <p className=\"text-sm font-medium text-foreground\">\n {settled ? \"Approval request\" : \"The agent needs your approval\"}\n </p>\n <p className=\"text-sm text-muted-foreground\">\n Run <code className=\"rounded bg-muted px-1 py-0.5 font-mono text-xs text-foreground\">{toolLabel}</code>\n </p>\n </div>\n {settled && (\n <span\n className={cn(\n \"flex shrink-0 items-center gap-1 rounded-full px-2 py-0.5 text-xs font-medium\",\n approval.status === \"approved\"\n ? \"bg-emerald-500/10 text-emerald-600 dark:text-emerald-400\"\n : \"bg-destructive/10 text-destructive\",\n )}\n >\n {approval.status === \"approved\" ? <Check className=\"h-3 w-3\" /> : <X className=\"h-3 w-3\" />}\n {approval.status === \"approved\" ? \"Approved\" : \"Rejected\"}\n {approval.decidedHere ? \" by you\" : \" elsewhere\"}\n </span>\n )}\n </header>\n\n {args !== null && (\n <pre\n aria-label=\"Arguments\"\n className=\"mt-3 max-h-48 overflow-auto rounded-lg bg-muted/60 p-3 font-mono text-xs text-foreground\"\n >\n {args}\n </pre>\n )}\n\n {settled && approval.status === \"rejected\" && approval.reason && (\n <p className=\"mt-3 text-sm text-muted-foreground\">\n <span className=\"font-medium text-foreground\">Reason:</span> {approval.reason}\n </p>\n )}\n\n {blocked && (\n <p role=\"status\" className=\"mt-3 text-sm text-muted-foreground\">\n {blocked}\n </p>\n )}\n\n {failed && (\n <p role=\"alert\" className=\"mt-3 text-sm text-destructive\">\n Couldn't send your decision{failed.detail ? `: ${failed.detail}` : \".\"} Try again.\n </p>\n )}\n\n {!settled && (submitting || approval.canAnswer) && (\n <div className=\"mt-3 flex flex-col gap-2\">\n {rejecting && (\n <Textarea\n aria-label=\"Reason for rejecting (optional)\"\n placeholder=\"Reason for rejecting (optional)\"\n value={reason}\n disabled={submitting}\n onChange={(e) => setReason(e.target.value)}\n className=\"min-h-[64px] text-sm\"\n />\n )}\n <div className=\"flex flex-wrap items-center justify-end gap-2\">\n {submitting && <Loader2 aria-label=\"Sending decision\" className=\"h-4 w-4 animate-spin text-muted-foreground\" />}\n {rejecting ? (\n <>\n <Button size=\"sm\" variant=\"ghost\" disabled={submitting} onClick={() => setRejecting(false)}>\n Cancel\n </Button>\n <Button size=\"sm\" variant=\"destructive\" disabled={submitting} onClick={() => decide(false)}>\n Reject\n </Button>\n </>\n ) : (\n <>\n <Button size=\"sm\" variant=\"outline\" disabled={submitting} onClick={() => setRejecting(true)}>\n Reject…\n </Button>\n <Button size=\"sm\" disabled={submitting} onClick={() => decide(true)}>\n Approve\n </Button>\n </>\n )}\n </div>\n </div>\n )}\n </section>\n );\n}\n"]}