[{"data":1,"prerenderedAt":11397},["ShallowReactive",2],{"navigation":3,"blog":918,"blog-posts":930,"blog-hero-title":11370,"blog-hero-description":11389},[4],{"title":5,"path":6,"stem":7,"children":8,"page":36},"Docs","/docs","docs",[9,157,781,817],{"title":10,"path":11,"stem":12,"children":13,"framework":16,"category":16,"description":16,"icon":30},"Get Started","/docs/getting-started","docs/1.getting-started/1.index",[14,19,37,47,53,76,140],{"title":15,"path":11,"stem":12,"framework":16,"category":16,"description":17,"icon":18},"Introduction",null,"Nuxt UI is a comprehensive Vue UI component library (Nuxt optional), offering 125+ accessible, Tailwind CSS components for building modern web applications.","i-lucide-house",{"title":20,"framework":16,"category":16,"description":16,"shadow":21,"path":22,"stem":23,"children":24,"page":36},"Installation",true,"/docs/getting-started/installation","docs/1.getting-started/2.installation",[25,31],{"title":20,"path":26,"stem":27,"framework":28,"category":16,"description":29,"icon":30},"/docs/getting-started/installation/nuxt","docs/1.getting-started/2.installation/1.nuxt","nuxt","Learn how to install and configure Nuxt UI in your Nuxt application.","i-lucide-square-play",{"title":20,"path":32,"stem":33,"framework":34,"category":16,"description":35,"icon":30},"/docs/getting-started/installation/vue","docs/1.getting-started/2.installation/2.vue","vue","Learn how to install and configure Nuxt UI in your Vue application, compatible with both plain Vite and Inertia.",false,{"title":38,"framework":16,"category":16,"description":16,"icon":39,"shadow":21,"path":40,"stem":41,"children":42,"page":36},"Migration","i-lucide-arrow-right-left","/docs/getting-started/migration","docs/1.getting-started/3.migration",[43],{"title":38,"path":44,"stem":45,"framework":16,"category":16,"description":46,"icon":39},"/docs/getting-started/migration/v4","docs/1.getting-started/3.migration/1.v4","A comprehensive guide to migrate your application from Nuxt UI v3 to Nuxt UI v4.",{"title":48,"path":49,"stem":50,"framework":16,"category":16,"description":51,"icon":52},"Contribution","/docs/getting-started/contribution","docs/1.getting-started/4.contribution","A comprehensive guide on contributing to Nuxt UI, including project structure, development workflow, and best practices.","i-lucide-handshake",{"title":54,"path":55,"stem":56,"children":57,"page":36},"Theme","/docs/getting-started/theme","docs/1.getting-started/5.theme",[58,64,70],{"title":59,"path":60,"stem":61,"framework":16,"category":16,"description":62,"icon":63},"Design System","/docs/getting-started/theme/design-system","docs/1.getting-started/5.theme/1.design-system","Nuxt UI's design system uses Tailwind CSS for simple theming and easy customization.","i-lucide-palette",{"title":65,"path":66,"stem":67,"framework":16,"category":16,"description":68,"icon":69},"CSS Variables","/docs/getting-started/theme/css-variables","docs/1.getting-started/5.theme/2.css-variables","Nuxt UI uses CSS variables as design tokens for flexible, consistent theming with built-in light and dark mode support.","i-lucide-swatch-book",{"title":71,"path":72,"stem":73,"framework":16,"category":16,"description":74,"icon":75},"Components","/docs/getting-started/theme/components","docs/1.getting-started/5.theme/3.components","Learn how to customize Nuxt UI components with the Tailwind Variants API for advanced, flexible, and maintainable styling.","i-lucide-layout-grid",{"title":77,"framework":16,"category":16,"description":16,"path":78,"stem":79,"children":80,"page":36},"Integrations","/docs/getting-started/integrations","docs/1.getting-started/6.integrations",[81,95,101,115,129,135],{"title":82,"framework":16,"category":16,"description":16,"shadow":21,"path":83,"stem":84,"children":85,"page":36},"Icons","/docs/getting-started/integrations/icons","docs/1.getting-started/6.integrations/1.icons",[86,91],{"title":82,"path":87,"stem":88,"framework":28,"category":16,"description":89,"icon":90},"/docs/getting-started/integrations/icons/nuxt","docs/1.getting-started/6.integrations/1.icons/1.nuxt","Nuxt UI integrates with Nuxt Icon to access over 200,000+ icons from Iconify.","i-lucide-smile",{"title":82,"path":92,"stem":93,"framework":34,"category":16,"description":94,"icon":90},"/docs/getting-started/integrations/icons/vue","docs/1.getting-started/6.integrations/1.icons/2.vue","Nuxt UI integrates with Iconify to access over 200,000+ icons.",{"title":96,"path":97,"stem":98,"framework":28,"category":16,"description":99,"icon":100},"Fonts","/docs/getting-started/integrations/fonts","docs/1.getting-started/6.integrations/2.fonts","Nuxt UI integrates with Nuxt Fonts to provide plug-and-play font optimization.","i-lucide-a-large-small",{"title":102,"framework":16,"category":16,"description":16,"shadow":21,"path":103,"stem":104,"children":105,"page":36},"Color Mode","/docs/getting-started/integrations/color-mode","docs/1.getting-started/6.integrations/3.color-mode",[106,111],{"title":102,"path":107,"stem":108,"framework":28,"category":16,"description":109,"icon":110},"/docs/getting-started/integrations/color-mode/nuxt","docs/1.getting-started/6.integrations/3.color-mode/1.nuxt","Nuxt UI integrates with Nuxt Color Mode to allow for easy switching between light and dark themes.","i-lucide-sun-moon",{"title":102,"path":112,"stem":113,"framework":34,"category":16,"description":114,"icon":110},"/docs/getting-started/integrations/color-mode/vue","docs/1.getting-started/6.integrations/3.color-mode/2.vue","Nuxt UI integrates with VueUse to allow for easy switching between light and dark themes.",{"title":116,"framework":16,"category":16,"description":16,"shadow":21,"path":117,"stem":118,"children":119,"page":36},"I18n","/docs/getting-started/integrations/i18n","docs/1.getting-started/6.integrations/4.i18n",[120,126],{"title":121,"path":122,"stem":123,"framework":28,"category":16,"description":124,"icon":125},"Internationalization (i18n)","/docs/getting-started/integrations/i18n/nuxt","docs/1.getting-started/6.integrations/4.i18n/1.nuxt","Nuxt UI supports 50+ locales and multi-directional (LTR/RTL) internationalization.","i-lucide-languages",{"title":121,"path":127,"stem":128,"framework":34,"category":16,"description":124,"icon":125},"/docs/getting-started/integrations/i18n/vue","docs/1.getting-started/6.integrations/4.i18n/2.vue",{"title":130,"path":131,"stem":132,"framework":28,"category":16,"description":133,"icon":134},"Content","/docs/getting-started/integrations/content","docs/1.getting-started/6.integrations/5.content","Nuxt UI integrates with Nuxt Content to deliver beautiful typography and consistent component styling.","i-simple-icons-markdown",{"title":136,"path":137,"stem":138,"framework":34,"category":16,"description":139,"icon":134},"SSR","/docs/getting-started/integrations/ssr","docs/1.getting-started/6.integrations/6.ssr","Nuxt UI has first-party support for Vue SSR. This guide will help you have it fully enabled.",{"title":141,"framework":16,"category":16,"description":16,"path":142,"stem":143,"children":144,"page":36},"AI Tools","/docs/getting-started/ai","docs/1.getting-started/7.ai",[145,151],{"title":146,"path":147,"stem":148,"framework":16,"category":16,"description":149,"icon":150},"MCP Server","/docs/getting-started/ai/mcp","docs/1.getting-started/7.ai/1.mcp","Use Nuxt UI components in your AI assistants with Model Context Protocol support.","i-lucide-server",{"title":152,"path":153,"stem":154,"framework":16,"category":16,"description":155,"icon":156},"LLMs.txt","/docs/getting-started/ai/llms-txt","docs/1.getting-started/7.ai/2.llms-txt","How to get AI tools like Cursor, Windsurf, GitHub Copilot, ChatGPT, and Claude to understand Nuxt UI components, theming, and best practices.","i-lucide-bot",{"title":71,"framework":16,"category":16,"description":16,"icon":158,"path":159,"stem":160,"children":161,"page":36},"i-lucide-square-code","/docs/components","docs/2.components",[162,168,174,180,186,191,196,201,206,211,216,222,227,232,237,242,247,252,258,263,268,273,278,284,289,294,299,305,310,315,320,325,330,335,340,346,351,356,361,366,372,378,383,388,393,398,403,408,413,418,423,428,433,440,445,450,455,460,465,470,475,480,485,490,495,500,505,510,515,520,525,530,535,540,545,550,555,561,566,571,576,581,586,591,596,601,606,611,616,621,626,631,636,641,646,651,656,661,666,671,676,681,686,691,696,701,706,711,716,721,726,731,736,741,746,751,756,761,766,771,776],{"title":163,"path":164,"stem":165,"framework":16,"category":166,"description":167},"Accordion","/docs/components/accordion","docs/2.components/accordion","data","A stacked set of collapsible panels.",{"title":169,"path":170,"stem":171,"framework":16,"category":172,"description":173},"Alert","/docs/components/alert","docs/2.components/alert","element","A callout to draw user's attention.",{"title":175,"path":176,"stem":177,"framework":16,"category":178,"description":179},"App","/docs/components/app","docs/2.components/app","layout","Wraps your app to provide global configurations and more.",{"title":181,"path":182,"stem":183,"framework":16,"category":184,"description":185},"AuthForm","/docs/components/auth-form","docs/2.components/auth-form","page","A customizable Form to create login, register or password reset forms.",{"title":187,"path":188,"stem":189,"framework":16,"category":172,"description":190},"Avatar","/docs/components/avatar","docs/2.components/avatar","An img element with fallback and Nuxt Image support.",{"title":192,"path":193,"stem":194,"framework":16,"category":172,"description":195},"AvatarGroup","/docs/components/avatar-group","docs/2.components/avatar-group","Stack multiple avatars in a group.",{"title":197,"path":198,"stem":199,"framework":16,"category":172,"description":200},"Badge","/docs/components/badge","docs/2.components/badge","A short text to represent a status or a category.",{"title":202,"path":203,"stem":204,"framework":16,"category":172,"description":205},"Banner","/docs/components/banner","docs/2.components/banner","Display a banner at the top of your website to inform users about important information.",{"title":207,"path":208,"stem":209,"framework":16,"category":184,"description":210},"BlogPost","/docs/components/blog-post","docs/2.components/blog-post","A customizable article to display in a blog page.",{"title":212,"path":213,"stem":214,"framework":16,"category":184,"description":215},"BlogPosts","/docs/components/blog-posts","docs/2.components/blog-posts","Display a list of blog posts in a responsive grid layout.",{"title":217,"path":218,"stem":219,"framework":16,"category":220,"description":221},"Breadcrumb","/docs/components/breadcrumb","docs/2.components/breadcrumb","navigation","A hierarchy of links to navigate through a website.",{"title":223,"path":224,"stem":225,"framework":16,"category":172,"description":226},"Button","/docs/components/button","docs/2.components/button","A button element that can act as a link or trigger an action.",{"title":228,"path":229,"stem":230,"framework":16,"category":172,"description":231},"Calendar","/docs/components/calendar","docs/2.components/calendar","A calendar component for selecting single dates, multiple dates or date ranges.",{"title":233,"path":234,"stem":235,"framework":16,"category":172,"description":236},"Card","/docs/components/card","docs/2.components/card","Display content in a card with a header, body and footer.",{"title":238,"path":239,"stem":240,"framework":16,"category":166,"description":241},"Carousel","/docs/components/carousel","docs/2.components/carousel","A carousel with motion and swipe built using Embla.",{"title":243,"path":244,"stem":245,"framework":16,"category":184,"description":246},"ChangelogVersion","/docs/components/changelog-version","docs/2.components/changelog-version","A customizable article to display in a changelog.",{"title":248,"path":249,"stem":250,"framework":16,"category":184,"description":251},"ChangelogVersions","/docs/components/changelog-versions","docs/2.components/changelog-versions","Display a list of changelog versions in a timeline.",{"title":253,"path":254,"stem":255,"framework":16,"category":256,"description":257},"ChatMessage","/docs/components/chat-message","docs/2.components/chat-message","chat","Display a chat message with icon, avatar, and actions.",{"title":259,"path":260,"stem":261,"framework":16,"category":256,"description":262},"ChatMessages","/docs/components/chat-messages","docs/2.components/chat-messages","Display a list of chat messages, designed to work seamlessly with Vercel AI SDK.",{"title":264,"path":265,"stem":266,"framework":16,"category":256,"description":267},"ChatPalette","/docs/components/chat-palette","docs/2.components/chat-palette","A chat palette to create a chatbot interface inside an overlay.",{"title":269,"path":270,"stem":271,"framework":16,"category":256,"description":272},"ChatPrompt","/docs/components/chat-prompt","docs/2.components/chat-prompt","An enhanced Textarea for submitting prompts in AI chat interfaces.",{"title":274,"path":275,"stem":276,"framework":16,"category":256,"description":277},"ChatPromptSubmit","/docs/components/chat-prompt-submit","docs/2.components/chat-prompt-submit","A Button for submitting chat prompts with automatic status handling.",{"title":279,"path":280,"stem":281,"framework":16,"category":282,"description":283},"Checkbox","/docs/components/checkbox","docs/2.components/checkbox","form","An input element to toggle between checked and unchecked states.",{"title":285,"path":286,"stem":287,"framework":16,"category":282,"description":288},"CheckboxGroup","/docs/components/checkbox-group","docs/2.components/checkbox-group","A set of checklist buttons to select multiple option from a list.",{"title":290,"path":291,"stem":292,"framework":16,"category":172,"description":293},"Chip","/docs/components/chip","docs/2.components/chip","An indicator of a numeric value or a state.",{"title":295,"path":296,"stem":297,"framework":16,"category":172,"description":298},"Collapsible","/docs/components/collapsible","docs/2.components/collapsible","A collapsible element to toggle visibility of its content.",{"title":300,"path":301,"stem":302,"framework":16,"category":303,"description":304},"ColorModeAvatar","/docs/components/color-mode-avatar","docs/2.components/color-mode-avatar","color-mode","An Avatar with a different source for light and dark mode.",{"title":306,"path":307,"stem":308,"framework":16,"category":303,"description":309},"ColorModeButton","/docs/components/color-mode-button","docs/2.components/color-mode-button","A Button to switch between light and dark mode.",{"title":311,"path":312,"stem":313,"framework":16,"category":303,"description":314},"ColorModeImage","/docs/components/color-mode-image","docs/2.components/color-mode-image","An image element with a different source for light and dark mode.",{"title":316,"path":317,"stem":318,"framework":16,"category":303,"description":319},"ColorModeSelect","/docs/components/color-mode-select","docs/2.components/color-mode-select","A Select to switch between system, dark & light mode.",{"title":321,"path":322,"stem":323,"framework":16,"category":303,"description":324},"ColorModeSwitch","/docs/components/color-mode-switch","docs/2.components/color-mode-switch","A switch to toggle between light and dark mode.",{"title":326,"path":327,"stem":328,"framework":16,"category":282,"description":329},"ColorPicker","/docs/components/color-picker","docs/2.components/color-picker","A component to select a color.",{"title":331,"path":332,"stem":333,"framework":16,"category":220,"description":334},"CommandPalette","/docs/components/command-palette","docs/2.components/command-palette","A command palette with full-text search powered by Fuse.js for efficient fuzzy matching.",{"title":336,"path":337,"stem":338,"framework":16,"category":178,"description":339},"Container","/docs/components/container","docs/2.components/container","A container lets you center and constrain the width of your content.",{"title":341,"path":342,"stem":343,"framework":28,"category":344,"description":345},"ContentNavigation","/docs/components/content-navigation","docs/2.components/content-navigation","content","An accordion-style navigation component for organizing page links.",{"title":347,"path":348,"stem":349,"framework":28,"category":344,"description":350},"ContentSearch","/docs/components/content-search","docs/2.components/content-search","A ready to use CommandPalette to add to your documentation.",{"title":352,"path":353,"stem":354,"framework":28,"category":344,"description":355},"ContentSearchButton","/docs/components/content-search-button","docs/2.components/content-search-button","A pre-styled Button to open the ContentSearch modal.",{"title":357,"path":358,"stem":359,"framework":28,"category":344,"description":360},"ContentSurround","/docs/components/content-surround","docs/2.components/content-surround","A pair of prev and next links to navigate between pages.",{"title":362,"path":363,"stem":364,"framework":28,"category":344,"description":365},"ContentToc","/docs/components/content-toc","docs/2.components/content-toc","A sticky Table of Contents with automatic active anchor link highlighting.",{"title":367,"path":368,"stem":369,"framework":16,"category":370,"description":371},"ContextMenu","/docs/components/context-menu","docs/2.components/context-menu","overlay","A menu to display actions when right-clicking on an element.",{"title":373,"path":374,"stem":375,"framework":16,"category":376,"description":377},"DashboardGroup","/docs/components/dashboard-group","docs/2.components/dashboard-group","dashboard","A fixed layout component that provides context for dashboard components with sidebar state management and persistence.",{"title":379,"path":380,"stem":381,"framework":16,"category":376,"description":382},"DashboardNavbar","/docs/components/dashboard-navbar","docs/2.components/dashboard-navbar","A responsive navbar to display in a dashboard.",{"title":384,"path":385,"stem":386,"framework":16,"category":376,"description":387},"DashboardPanel","/docs/components/dashboard-panel","docs/2.components/dashboard-panel","A resizable panel to display in a dashboard.",{"title":389,"path":390,"stem":391,"framework":16,"category":376,"description":392},"DashboardResizeHandle","/docs/components/dashboard-resize-handle","docs/2.components/dashboard-resize-handle","A handle to resize a sidebar or panel.",{"title":394,"path":395,"stem":396,"framework":16,"category":376,"description":397},"DashboardSearch","/docs/components/dashboard-search","docs/2.components/dashboard-search","A ready to use CommandPalette to add to your dashboard.",{"title":399,"path":400,"stem":401,"framework":16,"category":376,"description":402},"DashboardSearchButton","/docs/components/dashboard-search-button","docs/2.components/dashboard-search-button","A pre-styled Button to open the DashboardSearch modal.",{"title":404,"path":405,"stem":406,"framework":16,"category":376,"description":407},"DashboardSidebar","/docs/components/dashboard-sidebar","docs/2.components/dashboard-sidebar","A resizable and collapsible sidebar to display in a dashboard.",{"title":409,"path":410,"stem":411,"framework":16,"category":376,"description":412},"DashboardSidebarCollapse","/docs/components/dashboard-sidebar-collapse","docs/2.components/dashboard-sidebar-collapse","A Button to collapse the sidebar on desktop.",{"title":414,"path":415,"stem":416,"framework":16,"category":376,"description":417},"DashboardSidebarToggle","/docs/components/dashboard-sidebar-toggle","docs/2.components/dashboard-sidebar-toggle","A Button to toggle the sidebar on mobile.",{"title":419,"path":420,"stem":421,"framework":16,"category":376,"description":422},"DashboardToolbar","/docs/components/dashboard-toolbar","docs/2.components/dashboard-toolbar","A toolbar to display under the navbar in a dashboard.",{"title":424,"path":425,"stem":426,"framework":16,"category":370,"description":427},"Drawer","/docs/components/drawer","docs/2.components/drawer","A drawer that smoothly slides in & out of the screen.",{"title":429,"path":430,"stem":431,"framework":16,"category":370,"description":432},"DropdownMenu","/docs/components/dropdown-menu","docs/2.components/dropdown-menu","A menu to display actions when clicking on an element.",{"title":434,"path":435,"stem":436,"framework":16,"category":437,"description":438,"badge":439},"Editor","/docs/components/editor","docs/2.components/editor","editor","A rich text editor component based on TipTap with support for markdown, HTML, and JSON content types.","New",{"title":441,"path":442,"stem":443,"framework":16,"category":437,"description":444,"badge":439},"EditorDragHandle","/docs/components/editor-drag-handle","docs/2.components/editor-drag-handle","A draggable handle for reordering and selecting blocks in the editor.",{"title":446,"path":447,"stem":448,"framework":16,"category":437,"description":449,"badge":439},"EditorEmojiMenu","/docs/components/editor-emoji-menu","docs/2.components/editor-emoji-menu","An emoji picker menu that displays emoji suggestions when typing the : character in the editor.",{"title":451,"path":452,"stem":453,"framework":16,"category":437,"description":454,"badge":439},"EditorMentionMenu","/docs/components/editor-mention-menu","docs/2.components/editor-mention-menu","A mention menu that displays user suggestions when typing the @ character in the editor.",{"title":456,"path":457,"stem":458,"framework":16,"category":437,"description":459,"badge":439},"EditorSuggestionMenu","/docs/components/editor-suggestion-menu","docs/2.components/editor-suggestion-menu","A command menu that displays formatting and action suggestions when typing the / character in the editor.",{"title":461,"path":462,"stem":463,"framework":16,"category":437,"description":464,"badge":439},"EditorToolbar","/docs/components/editor-toolbar","docs/2.components/editor-toolbar","A customizable toolbar for editor actions that can be displayed as fixed, bubble, or floating menu.",{"title":466,"path":467,"stem":468,"framework":16,"category":166,"description":469},"Empty","/docs/components/empty","docs/2.components/empty","A component to display an empty state.",{"title":471,"path":472,"stem":473,"framework":16,"category":178,"description":474},"Error","/docs/components/error","docs/2.components/error","A pre-built error component with NuxtError support.",{"title":476,"path":477,"stem":478,"framework":16,"category":172,"description":479},"FieldGroup","/docs/components/field-group","docs/2.components/field-group","Group multiple button-like elements together.",{"title":481,"path":482,"stem":483,"framework":16,"category":282,"description":484},"FileUpload","/docs/components/file-upload","docs/2.components/file-upload","An input element to upload files.",{"title":486,"path":487,"stem":488,"framework":16,"category":178,"description":489},"Footer","/docs/components/footer","docs/2.components/footer","A responsive footer component.",{"title":491,"path":492,"stem":493,"framework":16,"category":220,"description":494},"FooterColumns","/docs/components/footer-columns","docs/2.components/footer-columns","A list of links as columns to display in your Footer.",{"title":496,"path":497,"stem":498,"framework":16,"category":282,"description":499},"Form","/docs/components/form","docs/2.components/form","A form component with built-in validation and submission handling.",{"title":501,"path":502,"stem":503,"framework":16,"category":282,"description":504},"FormField","/docs/components/form-field","docs/2.components/form-field","A wrapper for form elements that provides validation and error handling.",{"title":506,"path":507,"stem":508,"framework":16,"category":178,"description":509},"Header","/docs/components/header","docs/2.components/header","A responsive header component.",{"title":511,"path":512,"stem":513,"framework":16,"category":172,"description":514},"Icon","/docs/components/icon","docs/2.components/icon","A component to display any icon from Iconify or another component.",{"title":516,"path":517,"stem":518,"framework":16,"category":282,"description":519},"Input","/docs/components/input","docs/2.components/input","An input element to enter text.",{"title":521,"path":522,"stem":523,"framework":16,"category":282,"description":524},"InputDate","/docs/components/input-date","docs/2.components/input-date","An input component for date selection.",{"title":526,"path":527,"stem":528,"framework":16,"category":282,"description":529},"InputMenu","/docs/components/input-menu","docs/2.components/input-menu","An autocomplete input with real-time suggestions.",{"title":531,"path":532,"stem":533,"framework":16,"category":282,"description":534},"InputNumber","/docs/components/input-number","docs/2.components/input-number","An input for numerical values with a customizable range.",{"title":536,"path":537,"stem":538,"framework":16,"category":282,"description":539},"InputTags","/docs/components/input-tags","docs/2.components/input-tags","An input element that displays interactive tags.",{"title":541,"path":542,"stem":543,"framework":16,"category":282,"description":544},"InputTime","/docs/components/input-time","docs/2.components/input-time","An input for selecting a time.",{"title":546,"path":547,"stem":548,"framework":16,"category":172,"description":549},"Kbd","/docs/components/kbd","docs/2.components/kbd","A kbd element to display a keyboard key.",{"title":551,"path":552,"stem":553,"framework":16,"category":220,"description":554},"Link","/docs/components/link","docs/2.components/link","A wrapper around \u003CNuxtLink> with extra props.",{"title":556,"path":557,"stem":558,"framework":16,"category":559,"description":560},"LocaleSelect","/docs/components/locale-select","docs/2.components/locale-select","i18n","A Select to switch between locales.",{"title":562,"path":563,"stem":564,"framework":16,"category":178,"description":565},"Main","/docs/components/main","docs/2.components/main","A main element that fills the available viewport height.",{"title":567,"path":568,"stem":569,"framework":16,"category":166,"description":570},"Marquee","/docs/components/marquee","docs/2.components/marquee","A component to create infinite scrolling content.",{"title":572,"path":573,"stem":574,"framework":16,"category":370,"description":575},"Modal","/docs/components/modal","docs/2.components/modal","A dialog window that can be used to display a message or request user input.",{"title":577,"path":578,"stem":579,"framework":16,"category":220,"description":580},"NavigationMenu","/docs/components/navigation-menu","docs/2.components/navigation-menu","A list of links that can be displayed horizontally or vertically.",{"title":582,"path":583,"stem":584,"framework":16,"category":184,"description":585},"Page","/docs/components/page","docs/2.components/page","A grid layout for your pages with left and right columns.",{"title":587,"path":588,"stem":589,"framework":16,"category":184,"description":590},"PageAnchors","/docs/components/page-anchors","docs/2.components/page-anchors","A list of anchors to be displayed in the page.",{"title":592,"path":593,"stem":594,"framework":16,"category":184,"description":595},"PageAside","/docs/components/page-aside","docs/2.components/page-aside","A sticky aside to display your page navigation.",{"title":597,"path":598,"stem":599,"framework":16,"category":184,"description":600},"PageBody","/docs/components/page-body","docs/2.components/page-body","The main content of your page.",{"title":602,"path":603,"stem":604,"framework":16,"category":184,"description":605},"PageCard","/docs/components/page-card","docs/2.components/page-card","A pre-styled card component that displays a title, description and optional link.",{"title":607,"path":608,"stem":609,"framework":16,"category":184,"description":610},"PageColumns","/docs/components/page-columns","docs/2.components/page-columns","A responsive multi-column layout system for organizing content side-by-side.",{"title":612,"path":613,"stem":614,"framework":16,"category":184,"description":615},"PageCTA","/docs/components/page-cta","docs/2.components/page-cta","A call to action section to display in your pages.",{"title":617,"path":618,"stem":619,"framework":16,"category":184,"description":620},"PageFeature","/docs/components/page-feature","docs/2.components/page-feature","A component to showcase key features of your application.",{"title":622,"path":623,"stem":624,"framework":16,"category":184,"description":625},"PageGrid","/docs/components/page-grid","docs/2.components/page-grid","A responsive grid system for displaying content in a flexible layout.",{"title":627,"path":628,"stem":629,"framework":16,"category":184,"description":630},"PageHeader","/docs/components/page-header","docs/2.components/page-header","A responsive header for your pages.",{"title":632,"path":633,"stem":634,"framework":16,"category":184,"description":635},"PageHero","/docs/components/page-hero","docs/2.components/page-hero","A responsive hero for your pages.",{"title":637,"path":638,"stem":639,"framework":16,"category":184,"description":640},"PageLinks","/docs/components/page-links","docs/2.components/page-links","A list of links to be displayed in the page.",{"title":642,"path":643,"stem":644,"framework":16,"category":184,"description":645},"PageList","/docs/components/page-list","docs/2.components/page-list","A vertical list layout for displaying content in a stacked format.",{"title":647,"path":648,"stem":649,"framework":16,"category":184,"description":650},"PageLogos","/docs/components/page-logos","docs/2.components/page-logos","A list of logos or images to display on your pages.",{"title":652,"path":653,"stem":654,"framework":16,"category":184,"description":655},"PageSection","/docs/components/page-section","docs/2.components/page-section","A responsive section for your pages.",{"title":657,"path":658,"stem":659,"framework":16,"category":220,"description":660},"Pagination","/docs/components/pagination","docs/2.components/pagination","A list of buttons or links to navigate through pages.",{"title":662,"path":663,"stem":664,"framework":16,"category":282,"description":665},"PinInput","/docs/components/pin-input","docs/2.components/pin-input","An input element to enter a pin.",{"title":667,"path":668,"stem":669,"framework":16,"category":370,"description":670},"Popover","/docs/components/popover","docs/2.components/popover","A non-modal dialog that floats around a trigger element.",{"title":672,"path":673,"stem":674,"framework":16,"category":184,"description":675},"PricingPlan","/docs/components/pricing-plan","docs/2.components/pricing-plan","A customizable pricing plan to display in a pricing page.",{"title":677,"path":678,"stem":679,"framework":16,"category":184,"description":680},"PricingPlans","/docs/components/pricing-plans","docs/2.components/pricing-plans","Display a list of pricing plans in a responsive grid layout.",{"title":682,"path":683,"stem":684,"framework":16,"category":184,"description":685},"PricingTable","/docs/components/pricing-table","docs/2.components/pricing-table","A responsive pricing table component that displays tiered pricing plans with feature comparisons.",{"title":687,"path":688,"stem":689,"framework":16,"category":172,"description":690},"Progress","/docs/components/progress","docs/2.components/progress","An indicator showing the progress of a task.",{"title":692,"path":693,"stem":694,"framework":16,"category":282,"description":695},"RadioGroup","/docs/components/radio-group","docs/2.components/radio-group","A set of radio buttons to select a single option from a list.",{"title":697,"path":698,"stem":699,"framework":16,"category":166,"description":700,"badge":439},"ScrollArea","/docs/components/scroll-area","docs/2.components/scroll-area","A flexible scroll container with virtualization support.",{"title":702,"path":703,"stem":704,"framework":16,"category":282,"description":705},"Select","/docs/components/select","docs/2.components/select","A select element to choose from a list of options.",{"title":707,"path":708,"stem":709,"framework":16,"category":282,"description":710},"SelectMenu","/docs/components/select-menu","docs/2.components/select-menu","An advanced searchable select element.",{"title":712,"path":713,"stem":714,"framework":16,"category":172,"description":715},"Separator","/docs/components/separator","docs/2.components/separator","Separates content horizontally or vertically.",{"title":717,"path":718,"stem":719,"framework":16,"category":172,"description":720},"Skeleton","/docs/components/skeleton","docs/2.components/skeleton","A placeholder to show while content is loading.",{"title":722,"path":723,"stem":724,"framework":16,"category":370,"description":725},"Slideover","/docs/components/slideover","docs/2.components/slideover","A dialog that slides in from any side of the screen.",{"title":727,"path":728,"stem":729,"framework":16,"category":282,"description":730},"Slider","/docs/components/slider","docs/2.components/slider","An input to select a numeric value within a range.",{"title":732,"path":733,"stem":734,"framework":16,"category":220,"description":735},"Stepper","/docs/components/stepper","docs/2.components/stepper","A set of steps that are used to indicate progress through a multi-step process.",{"title":737,"path":738,"stem":739,"framework":16,"category":282,"description":740},"Switch","/docs/components/switch","docs/2.components/switch","A control that toggles between two states.",{"title":742,"path":743,"stem":744,"framework":16,"category":166,"description":745},"Table","/docs/components/table","docs/2.components/table","A responsive table element to display data in rows and columns.",{"title":747,"path":748,"stem":749,"framework":16,"category":220,"description":750},"Tabs","/docs/components/tabs","docs/2.components/tabs","A set of tab panels that are displayed one at a time.",{"title":752,"path":753,"stem":754,"framework":16,"category":282,"description":755},"Textarea","/docs/components/textarea","docs/2.components/textarea","A textarea element to input multi-line text.",{"title":757,"path":758,"stem":759,"framework":16,"category":166,"description":760},"Timeline","/docs/components/timeline","docs/2.components/timeline","A component that displays a sequence of events with dates, titles, icons or avatars.",{"title":762,"path":763,"stem":764,"framework":16,"category":370,"description":765},"Toast","/docs/components/toast","docs/2.components/toast","A succinct message to provide information or feedback to the user.",{"title":767,"path":768,"stem":769,"framework":16,"category":370,"description":770},"Tooltip","/docs/components/tooltip","docs/2.components/tooltip","A popup that reveals information when hovering over an element.",{"title":772,"path":773,"stem":774,"framework":16,"category":166,"description":775},"Tree","/docs/components/tree","docs/2.components/tree","A tree view component to display and interact with hierarchical data structures.",{"title":777,"path":778,"stem":779,"framework":16,"category":166,"description":780},"User","/docs/components/user","docs/2.components/user","Display user information with name, description and avatar.",{"title":782,"framework":16,"category":16,"description":16,"icon":783,"path":784,"stem":785,"children":786,"page":36},"Composables","i-lucide-square-function","/docs/composables","docs/3.composables",[787,792,797,802,807,812],{"title":788,"path":789,"stem":790,"framework":16,"category":16,"description":791},"defineLocale","/docs/composables/define-locale","docs/3.composables/define-locale","A utility to create a custom locale for your app.",{"title":793,"path":794,"stem":795,"framework":16,"category":16,"description":796},"defineShortcuts","/docs/composables/define-shortcuts","docs/3.composables/define-shortcuts","A composable to define keyboard shortcuts in your app.",{"title":798,"path":799,"stem":800,"framework":16,"category":16,"description":801},"extendLocale","/docs/composables/extend-locale","docs/3.composables/extend-locale","A utility to extend an existing locale with custom translations.",{"title":803,"path":804,"stem":805,"framework":16,"category":16,"description":806},"extractShortcuts","/docs/composables/extract-shortcuts","docs/3.composables/extract-shortcuts","A utility to extract keyboard shortcuts from menu items.",{"title":808,"path":809,"stem":810,"framework":16,"category":16,"description":811},"useOverlay","/docs/composables/use-overlay","docs/3.composables/use-overlay","A composable to programmatically control overlays.",{"title":813,"path":814,"stem":815,"framework":16,"category":16,"description":816},"useToast","/docs/composables/use-toast","docs/3.composables/use-toast","A composable to display toast notifications in your app.",{"title":818,"path":819,"stem":820,"children":821,"framework":28,"category":16,"description":16,"icon":917},"Typography","/docs/typography","docs/4.typography/1.index",[822,824,829,834,839,844,849,853,858,862,867,872,877,882,887,891,896,900,904,908,913],{"title":15,"path":819,"stem":820,"framework":28,"category":16,"description":823},"Beautiful typography components and utilities to style your content with Nuxt UI.",{"title":825,"path":826,"stem":827,"framework":28,"category":16,"description":828},"Headers and text","/docs/typography/headers-and-text","docs/4.typography/2.headers-and-text","Beautifully styled headings, paragraphs, text formatting, and links for optimal readability.",{"title":830,"path":831,"stem":832,"framework":28,"category":16,"description":833},"Lists and tables","/docs/typography/lists-and-tables","docs/4.typography/3.lists-and-tables","Organize information with styled lists and responsive tables for clear, consistent readability.",{"title":835,"path":836,"stem":837,"framework":28,"category":16,"description":838},"Images and embeds","/docs/typography/images-and-embeds","docs/4.typography/4.images-and-embeds","Responsive images, videos, and rich media embeds to enhance and illustrate your documentation.",{"title":840,"path":841,"stem":842,"framework":28,"category":16,"description":843},"Code","/docs/typography/code","docs/4.typography/5.code","Display inline code and syntax-highlighted code blocks with copy-to-clipboard support.",{"title":163,"path":845,"stem":846,"framework":28,"category":847,"description":848},"/docs/typography/accordion","docs/4.typography/accordion","components","Create expandable content sections for better information organization.",{"title":197,"path":850,"stem":851,"framework":28,"category":847,"description":852},"/docs/typography/badge","docs/4.typography/badge","Display version numbers, status labels, and tags within your content.",{"title":854,"path":855,"stem":856,"framework":28,"category":847,"description":857},"Callout","/docs/typography/callout","docs/4.typography/callout","Highlight important information with eye-catching colored boxes and icons.",{"title":233,"path":859,"stem":860,"framework":28,"category":847,"description":861},"/docs/typography/card","docs/4.typography/card","Create highlighted content blocks with optional links and navigation.",{"title":863,"path":864,"stem":865,"framework":28,"category":847,"description":866},"CardGroup","/docs/typography/card-group","docs/4.typography/card-group","Organize multiple cards in responsive grid layouts for better content presentation.",{"title":868,"path":869,"stem":870,"framework":28,"category":847,"description":871},"CodeCollapse","/docs/typography/code-collapse","docs/4.typography/code-collapse","Make long code blocks collapsible to save space and improve readability.",{"title":873,"path":874,"stem":875,"framework":28,"category":847,"description":876},"CodeGroup","/docs/typography/code-group","docs/4.typography/code-group","Group multiple code examples in tabbed interfaces for easy comparison.",{"title":878,"path":879,"stem":880,"framework":28,"category":847,"description":881},"CodePreview","/docs/typography/code-preview","docs/4.typography/code-preview","Display code examples with a preview and their source for clearer documentation.",{"title":883,"path":884,"stem":885,"framework":28,"category":847,"description":886},"CodeTree","/docs/typography/code-tree","docs/4.typography/code-tree","Visualize file and folder structures with syntax-highlighted code.",{"title":295,"path":888,"stem":889,"framework":28,"category":847,"description":890},"/docs/typography/collapsible","docs/4.typography/collapsible","Toggle content visibility with smooth expand and collapse animations.",{"title":892,"path":893,"stem":894,"framework":28,"category":847,"description":895},"Field","/docs/typography/field","docs/4.typography/field","Document API parameters, props, and configuration options clearly.",{"title":476,"path":897,"stem":898,"framework":28,"category":847,"description":899},"/docs/typography/field-group","docs/4.typography/field-group","Group related fields together for comprehensive API documentation.",{"title":511,"path":901,"stem":902,"framework":28,"category":847,"description":903},"/docs/typography/icon","docs/4.typography/icon","Display icons from popular icon libraries to enhance your content.",{"title":546,"path":905,"stem":906,"framework":28,"category":847,"description":907},"/docs/typography/kbd","docs/4.typography/kbd","Display keyboard shortcuts and key combinations with proper styling.",{"title":909,"path":910,"stem":911,"framework":28,"category":847,"description":912},"Steps","/docs/typography/steps","docs/4.typography/steps","Transform headings into numbered step-by-step guides and tutorials.",{"title":747,"path":914,"stem":915,"framework":28,"category":847,"description":916},"/docs/typography/tabs","docs/4.typography/tabs","Organize related content in interactive tabbed interfaces.","i-lucide-square-pilcrow",{"id":919,"title":920,"body":16,"description":921,"extension":922,"hero":923,"meta":925,"navigation":36,"path":926,"seo":927,"stem":928,"__hash__":929},"blog/blog.yml","Blog","Tutorials, guides, and insights to help you build beautiful applications with Nuxt UI.","yml",{"title":924,"description":921},"Nuxt [UI]{.text-primary} Blog",{},"/blog",{"title":920,"description":921},"blog","ESl67YJxs4hhxlk_OHymZ1sSoeclVge2lYINtoN5zxg",[931],{"id":932,"title":933,"authors":934,"body":945,"date":11360,"description":11361,"extension":11362,"image":11363,"meta":11364,"navigation":36,"path":11366,"seo":11367,"stem":11368,"__hash__":11369},"posts/blog/how-to-build-an-ai-chat.md","Build an AI Chatbot with Nuxt, Nuxt UI, and AI SDK",[935,940],{"name":936,"avatar":937,"to":939},"Hugo Richard",{"src":938},"https://github.com/hugorcd.png","https://x.com/hugorcd",{"name":941,"avatar":942,"to":944},"Benjamin Canac",{"src":943},"https://github.com/benjamincanac.png","https://x.com/benjamincanac",{"type":946,"value":947,"toc":11327},"minimark",[948,952,957,960,995,1008,1012,1015,1031,1035,1038,1076,1081,1084,1228,1232,1239,1455,1458,1497,1501,1508,1603,1610,1627,1637,1641,1655,2386,2389,2407,2417,2421,2429,2433,2444,2812,2816,2843,4197,4200,4205,4212,4217,4228,4233,4242,4260,4265,4281,4294,4298,4301,4676,4680,4695,4699,4707,5283,5290,5315,5319,5338,6598,6601,6606,6617,6655,6670,6675,6682,6696,6701,6722,6727,6732,6739,6750,6754,6757,6761,6764,6917,6921,6946,7415,7419,7958,7962,9126,9135,9139,9146,9150,9160,9417,9421,9429,9678,9682,9685,10928,10932,10935,10940,10949,10953,10962,11165,11177,11181,11184,11199,11202,11217,11232,11240,11244,11247,11277,11280,11285,11320,11323],[949,950,951],"p",{},"Building AI-powered applications has never been more accessible. This guide walks through creating a full-featured AI chatbot using Nuxt, Nuxt UI, and the Vercel AI SDK. Each step is explained in detail so you understand how every piece works together.",[953,954,956],"h2",{"id":955},"what-were-building","What we're building",[949,958,959],{},"By the end of this tutorial, you'll have a fully functional AI chatbot with:",[961,962,963,971,977,983,989],"ul",{},[964,965,966,970],"li",{},[967,968,969],"strong",{},"Streaming responses"," that appear in real-time as the AI generates them",[964,972,973,976],{},[967,974,975],{},"A beautiful chat interface"," built with Nuxt UI's purpose-built chat components",[964,978,979,982],{},[967,980,981],{},"Markdown rendering"," for rich AI responses with code highlighting",[964,984,985,988],{},[967,986,987],{},"Multi-model support"," allowing users to switch between OpenAI, Anthropic, and Google models",[964,990,991,994],{},[967,992,993],{},"Server-side AI integration"," using Nitro API routes and the AI SDK",[996,997,1001],"callout",{"icon":998,"target":999,"to":1000},"i-simple-icons-github","_blank","https://github.com/nuxt-ui-templates/chat",[949,1002,1003,1004,1007],{},"Check out the complete ",[967,1005,1006],{},"AI Chat template"," on GitHub for a production-ready implementation with authentication, database persistence, and more.",[953,1009,1011],{"id":1010},"prerequisites","Prerequisites",[949,1013,1014],{},"Before we start, make sure you have:",[961,1016,1017,1020],{},[964,1018,1019],{},"Node.js 20+ installed",[964,1021,1022,1023,1030],{},"A ",[1024,1025,1029],"a",{"href":1026,"rel":1027},"https://vercel.com/docs/ai-gateway",[1028],"nofollow","Vercel AI Gateway"," API key (provides access to multiple AI providers through a single endpoint)",[953,1032,1034],{"id":1033},"project-setup","Project setup",[949,1036,1037],{},"Start by creating a new Nuxt project:",[1039,1040,1045],"pre",{"className":1041,"code":1042,"language":1043,"meta":1044,"style":1044},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","npx nuxi@latest init nuxt-ai-chat\ncd nuxt-ai-chat\n","bash","",[1046,1047,1048,1067],"code",{"__ignoreMap":1044},[1049,1050,1053,1057,1061,1064],"span",{"class":1051,"line":1052},"line",1,[1049,1054,1056],{"class":1055},"sBMFI","npx",[1049,1058,1060],{"class":1059},"sfazB"," nuxi@latest",[1049,1062,1063],{"class":1059}," init",[1049,1065,1066],{"class":1059}," nuxt-ai-chat\n",[1049,1068,1070,1074],{"class":1051,"line":1069},2,[1049,1071,1073],{"class":1072},"s2Zo4","cd",[1049,1075,1066],{"class":1059},[1077,1078,1080],"h3",{"id":1079},"installing-dependencies","Installing dependencies",[949,1082,1083],{},"Install Nuxt UI and the AI-specific dependencies:",[1085,1086,1088,1131,1163,1196],"code-group",{"sync":1087},"pm",[1039,1089,1092],{"className":1041,"code":1090,"filename":1091,"language":1043,"meta":1044,"style":1044},"pnpm add @nuxt/ui tailwindcss @nuxtjs/mdc @nuxthub/core drizzle-orm drizzle-kit @libsql/client ai @ai-sdk/vue zod\n","pnpm",[1046,1093,1094],{"__ignoreMap":1044},[1049,1095,1096,1098,1101,1104,1107,1110,1113,1116,1119,1122,1125,1128],{"class":1051,"line":1052},[1049,1097,1091],{"class":1055},[1049,1099,1100],{"class":1059}," add",[1049,1102,1103],{"class":1059}," @nuxt/ui",[1049,1105,1106],{"class":1059}," tailwindcss",[1049,1108,1109],{"class":1059}," @nuxtjs/mdc",[1049,1111,1112],{"class":1059}," @nuxthub/core",[1049,1114,1115],{"class":1059}," drizzle-orm",[1049,1117,1118],{"class":1059}," drizzle-kit",[1049,1120,1121],{"class":1059}," @libsql/client",[1049,1123,1124],{"class":1059}," ai",[1049,1126,1127],{"class":1059}," @ai-sdk/vue",[1049,1129,1130],{"class":1059}," zod\n",[1039,1132,1135],{"className":1041,"code":1133,"filename":1134,"language":1043,"meta":1044,"style":1044},"yarn add @nuxt/ui tailwindcss @nuxtjs/mdc @nuxthub/core drizzle-orm drizzle-kit @libsql/client ai @ai-sdk/vue zod\n","yarn",[1046,1136,1137],{"__ignoreMap":1044},[1049,1138,1139,1141,1143,1145,1147,1149,1151,1153,1155,1157,1159,1161],{"class":1051,"line":1052},[1049,1140,1134],{"class":1055},[1049,1142,1100],{"class":1059},[1049,1144,1103],{"class":1059},[1049,1146,1106],{"class":1059},[1049,1148,1109],{"class":1059},[1049,1150,1112],{"class":1059},[1049,1152,1115],{"class":1059},[1049,1154,1118],{"class":1059},[1049,1156,1121],{"class":1059},[1049,1158,1124],{"class":1059},[1049,1160,1127],{"class":1059},[1049,1162,1130],{"class":1059},[1039,1164,1167],{"className":1041,"code":1165,"filename":1166,"language":1043,"meta":1044,"style":1044},"npm install @nuxt/ui tailwindcss @nuxtjs/mdc @nuxthub/core drizzle-orm drizzle-kit @libsql/client ai @ai-sdk/vue zod\n","npm",[1046,1168,1169],{"__ignoreMap":1044},[1049,1170,1171,1173,1176,1178,1180,1182,1184,1186,1188,1190,1192,1194],{"class":1051,"line":1052},[1049,1172,1166],{"class":1055},[1049,1174,1175],{"class":1059}," install",[1049,1177,1103],{"class":1059},[1049,1179,1106],{"class":1059},[1049,1181,1109],{"class":1059},[1049,1183,1112],{"class":1059},[1049,1185,1115],{"class":1059},[1049,1187,1118],{"class":1059},[1049,1189,1121],{"class":1059},[1049,1191,1124],{"class":1059},[1049,1193,1127],{"class":1059},[1049,1195,1130],{"class":1059},[1039,1197,1200],{"className":1041,"code":1198,"filename":1199,"language":1043,"meta":1044,"style":1044},"bun add @nuxt/ui tailwindcss @nuxtjs/mdc @nuxthub/core drizzle-orm drizzle-kit @libsql/client ai @ai-sdk/vue zod\n","bun",[1046,1201,1202],{"__ignoreMap":1044},[1049,1203,1204,1206,1208,1210,1212,1214,1216,1218,1220,1222,1224,1226],{"class":1051,"line":1052},[1049,1205,1199],{"class":1055},[1049,1207,1100],{"class":1059},[1049,1209,1103],{"class":1059},[1049,1211,1106],{"class":1059},[1049,1213,1109],{"class":1059},[1049,1215,1112],{"class":1059},[1049,1217,1115],{"class":1059},[1049,1219,1118],{"class":1059},[1049,1221,1121],{"class":1059},[1049,1223,1124],{"class":1059},[1049,1225,1127],{"class":1059},[1049,1227,1130],{"class":1059},[1077,1229,1231],{"id":1230},"configuration","Configuration",[949,1233,1234,1235,1238],{},"Update your ",[1046,1236,1237],{},"nuxt.config.ts"," to register the modules:",[1240,1241,1242],"code-tree-intersection",{},[1039,1243,1247],{"className":1244,"code":1245,"filename":1237,"language":1246,"meta":1044,"style":1044},"language-ts shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","export default defineNuxtConfig({\n  modules: [\n    '@nuxt/ui',\n    '@nuxtjs/mdc',\n    '@nuxthub/core'\n  ],\n\n  hub: {\n    db: 'sqlite'\n  },\n\n  css: ['~/assets/css/main.css'],\n\n  mdc: {\n    headings: {\n      anchorLinks: false // Disable anchor links in AI responses\n    }\n  },\n})\n","ts",[1046,1248,1249,1269,1281,1296,1308,1319,1327,1333,1344,1360,1366,1371,1394,1399,1409,1419,1435,1441,1446],{"__ignoreMap":1044},[1049,1250,1251,1255,1258,1261,1265],{"class":1051,"line":1052},[1049,1252,1254],{"class":1253},"s7zQu","export",[1049,1256,1257],{"class":1253}," default",[1049,1259,1260],{"class":1072}," defineNuxtConfig",[1049,1262,1264],{"class":1263},"sTEyZ","(",[1049,1266,1268],{"class":1267},"sMK4o","{\n",[1049,1270,1271,1275,1278],{"class":1051,"line":1069},[1049,1272,1274],{"class":1273},"swJcz","  modules",[1049,1276,1277],{"class":1267},":",[1049,1279,1280],{"class":1263}," [\n",[1049,1282,1284,1287,1290,1293],{"class":1051,"line":1283},3,[1049,1285,1286],{"class":1267},"    '",[1049,1288,1289],{"class":1059},"@nuxt/ui",[1049,1291,1292],{"class":1267},"'",[1049,1294,1295],{"class":1267},",\n",[1049,1297,1299,1301,1304,1306],{"class":1051,"line":1298},4,[1049,1300,1286],{"class":1267},[1049,1302,1303],{"class":1059},"@nuxtjs/mdc",[1049,1305,1292],{"class":1267},[1049,1307,1295],{"class":1267},[1049,1309,1311,1313,1316],{"class":1051,"line":1310},5,[1049,1312,1286],{"class":1267},[1049,1314,1315],{"class":1059},"@nuxthub/core",[1049,1317,1318],{"class":1267},"'\n",[1049,1320,1322,1325],{"class":1051,"line":1321},6,[1049,1323,1324],{"class":1263},"  ]",[1049,1326,1295],{"class":1267},[1049,1328,1330],{"class":1051,"line":1329},7,[1049,1331,1332],{"emptyLinePlaceholder":21},"\n",[1049,1334,1336,1339,1341],{"class":1051,"line":1335},8,[1049,1337,1338],{"class":1273},"  hub",[1049,1340,1277],{"class":1267},[1049,1342,1343],{"class":1267}," {\n",[1049,1345,1347,1350,1352,1355,1358],{"class":1051,"line":1346},9,[1049,1348,1349],{"class":1273},"    db",[1049,1351,1277],{"class":1267},[1049,1353,1354],{"class":1267}," '",[1049,1356,1357],{"class":1059},"sqlite",[1049,1359,1318],{"class":1267},[1049,1361,1363],{"class":1051,"line":1362},10,[1049,1364,1365],{"class":1267},"  },\n",[1049,1367,1369],{"class":1051,"line":1368},11,[1049,1370,1332],{"emptyLinePlaceholder":21},[1049,1372,1374,1377,1379,1382,1384,1387,1389,1392],{"class":1051,"line":1373},12,[1049,1375,1376],{"class":1273},"  css",[1049,1378,1277],{"class":1267},[1049,1380,1381],{"class":1263}," [",[1049,1383,1292],{"class":1267},[1049,1385,1386],{"class":1059},"~/assets/css/main.css",[1049,1388,1292],{"class":1267},[1049,1390,1391],{"class":1263},"]",[1049,1393,1295],{"class":1267},[1049,1395,1397],{"class":1051,"line":1396},13,[1049,1398,1332],{"emptyLinePlaceholder":21},[1049,1400,1402,1405,1407],{"class":1051,"line":1401},14,[1049,1403,1404],{"class":1273},"  mdc",[1049,1406,1277],{"class":1267},[1049,1408,1343],{"class":1267},[1049,1410,1412,1415,1417],{"class":1051,"line":1411},15,[1049,1413,1414],{"class":1273},"    headings",[1049,1416,1277],{"class":1267},[1049,1418,1343],{"class":1267},[1049,1420,1422,1425,1427,1431],{"class":1051,"line":1421},16,[1049,1423,1424],{"class":1273},"      anchorLinks",[1049,1426,1277],{"class":1267},[1049,1428,1430],{"class":1429},"sfNiH"," false",[1049,1432,1434],{"class":1433},"sHwdD"," // Disable anchor links in AI responses\n",[1049,1436,1438],{"class":1051,"line":1437},17,[1049,1439,1440],{"class":1267},"    }\n",[1049,1442,1444],{"class":1051,"line":1443},18,[1049,1445,1365],{"class":1267},[1049,1447,1449,1452],{"class":1051,"line":1448},19,[1049,1450,1451],{"class":1267},"}",[1049,1453,1454],{"class":1263},")\n",[949,1456,1457],{},"Create the main CSS file to import Tailwind CSS and Nuxt UI:",[1240,1459,1460],{},[1039,1461,1466],{"className":1462,"code":1463,"filename":1464,"language":1465,"meta":1044,"style":1044},"language-css shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","@import \"tailwindcss\";\n@import \"@nuxt/ui\";\n","app/assets/css/main.css","css",[1046,1467,1468,1485],{"__ignoreMap":1044},[1049,1469,1470,1473,1476,1479,1482],{"class":1051,"line":1052},[1049,1471,1472],{"class":1253},"@import",[1049,1474,1475],{"class":1267}," \"",[1049,1477,1478],{"class":1059},"tailwindcss",[1049,1480,1481],{"class":1267},"\"",[1049,1483,1484],{"class":1267},";\n",[1049,1486,1487,1489,1491,1493,1495],{"class":1051,"line":1069},[1049,1488,1472],{"class":1253},[1049,1490,1475],{"class":1267},[1049,1492,1289],{"class":1059},[1049,1494,1481],{"class":1267},[1049,1496,1484],{"class":1267},[1077,1498,1500],{"id":1499},"setting-up-the-app","Setting up the app",[949,1502,1503,1504,1507],{},"Nuxt UI requires wrapping your app with ",[1046,1505,1506],{},"UApp"," for modals, toasts, and overlays to work properly:",[1240,1509,1510],{},[1039,1511,1516],{"className":1512,"code":1513,"filename":1514,"highlights":1515,"language":34,"meta":1044,"style":1044},"language-vue shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","\u003Ctemplate>\n  \u003CUApp>\n    \u003CUDashboardGroup unit=\"rem\">\n      \u003CNuxtPage />\n    \u003C/UDashboardGroup>\n  \u003C/UApp>\n\u003C/template>\n","app/app.vue",[1069,1321],[1046,1517,1518,1529,1540,1564,1575,1584,1594],{"__ignoreMap":1044},[1049,1519,1520,1523,1526],{"class":1051,"line":1052},[1049,1521,1522],{"class":1267},"\u003C",[1049,1524,1525],{"class":1273},"template",[1049,1527,1528],{"class":1267},">\n",[1049,1530,1533,1536,1538],{"class":1531,"line":1069},[1051,1532],"highlight",[1049,1534,1535],{"class":1267},"  \u003C",[1049,1537,1506],{"class":1273},[1049,1539,1528],{"class":1267},[1049,1541,1542,1545,1548,1552,1555,1557,1560,1562],{"class":1051,"line":1283},[1049,1543,1544],{"class":1267},"    \u003C",[1049,1546,1547],{"class":1273},"UDashboardGroup",[1049,1549,1551],{"class":1550},"spNyl"," unit",[1049,1553,1554],{"class":1267},"=",[1049,1556,1481],{"class":1267},[1049,1558,1559],{"class":1059},"rem",[1049,1561,1481],{"class":1267},[1049,1563,1528],{"class":1267},[1049,1565,1566,1569,1572],{"class":1051,"line":1298},[1049,1567,1568],{"class":1267},"      \u003C",[1049,1570,1571],{"class":1273},"NuxtPage",[1049,1573,1574],{"class":1267}," />\n",[1049,1576,1577,1580,1582],{"class":1051,"line":1310},[1049,1578,1579],{"class":1267},"    \u003C/",[1049,1581,1547],{"class":1273},[1049,1583,1528],{"class":1267},[1049,1585,1587,1590,1592],{"class":1586,"line":1321},[1051,1532],[1049,1588,1589],{"class":1267},"  \u003C/",[1049,1591,1506],{"class":1273},[1049,1593,1528],{"class":1267},[1049,1595,1596,1599,1601],{"class":1051,"line":1329},[1049,1597,1598],{"class":1267},"\u003C/",[1049,1600,1525],{"class":1273},[1049,1602,1528],{"class":1267},[949,1604,1605,1606,1609],{},"Create a ",[1046,1607,1608],{},".env"," file with your AI Gateway API key:",[1240,1611,1612],{},[1039,1613,1615],{"className":1041,"code":1614,"filename":1608,"language":1043,"meta":1044,"style":1044},"AI_GATEWAY_API_KEY=your-api-key-here\n",[1046,1616,1617],{"__ignoreMap":1044},[1049,1618,1619,1622,1624],{"class":1051,"line":1052},[1049,1620,1621],{"class":1263},"AI_GATEWAY_API_KEY",[1049,1623,1554],{"class":1267},[1049,1625,1626],{"class":1059},"your-api-key-here\n",[1628,1629,1630],"note",{},[949,1631,1632,1633,1636],{},"With ",[1024,1634,1029],{"href":1026,"rel":1635},[1028],", you don't need individual API keys for OpenAI, Anthropic, or Google. The AI Gateway provides a unified API to access hundreds of models through a single endpoint.",[1077,1638,1640],{"id":1639},"setting-up-the-database","Setting up the database",[949,1642,1643,1648,1649,1654],{},[1024,1644,1647],{"href":1645,"rel":1646},"https://hub.nuxt.com",[1028],"NuxtHub"," provides a zero-config database powered by ",[1024,1650,1653],{"href":1651,"rel":1652},"https://orm.drizzle.team",[1028],"Drizzle ORM",". Here is the schema for the chat application:",[1240,1656,1657],{},[1658,1659,1660],"code-collapse",{},[1039,1661,1664],{"className":1244,"code":1662,"filename":1663,"language":1246,"meta":1044,"style":1044},"import { sqliteTable, text, integer, index } from 'drizzle-orm/sqlite-core'\nimport { relations } from 'drizzle-orm'\n\nexport const chats = sqliteTable('chats', {\n  id: text().primaryKey().$defaultFn(() => crypto.randomUUID()),\n  title: text(),\n  createdAt: integer({ mode: 'timestamp' }).notNull().$defaultFn(() => new Date())\n})\n\nexport const chatsRelations = relations(chats, ({ many }) => ({\n  messages: many(messages)\n}))\n\nexport const messages = sqliteTable('messages', {\n  id: text('id').primaryKey().$defaultFn(() => crypto.randomUUID()),\n  chatId: text('chat_id').notNull().references(() => chats.id, { onDelete: 'cascade' }),\n  role: text('role', { enum: ['user', 'assistant', 'system'] }).notNull(),\n  parts: text('parts', { mode: 'json' }),\n  createdAt: integer({ mode: 'timestamp' }).notNull().$defaultFn(() => new Date()),\n}, table => [\n  index('messages_chat_id_idx').on(table.chatId)\n])\n\nexport const messagesRelations = relations(messages, ({ one }) => ({\n  chat: one(chats, {\n    fields: [messages.chatId],\n    references: [chats.id]\n  })\n}))\n","server/db/schema.ts",[1046,1665,1666,1706,1726,1730,1757,1802,1815,1872,1878,1882,1917,1929,1936,1940,1966,2011,2077,2146,2185,2235,2248,2278,2284,2289,2321,2337,2355,2371,2379],{"__ignoreMap":1044},[1049,1667,1668,1671,1674,1677,1680,1683,1685,1688,1690,1693,1696,1699,1701,1704],{"class":1051,"line":1052},[1049,1669,1670],{"class":1253},"import",[1049,1672,1673],{"class":1267}," {",[1049,1675,1676],{"class":1263}," sqliteTable",[1049,1678,1679],{"class":1267},",",[1049,1681,1682],{"class":1263}," text",[1049,1684,1679],{"class":1267},[1049,1686,1687],{"class":1263}," integer",[1049,1689,1679],{"class":1267},[1049,1691,1692],{"class":1263}," index",[1049,1694,1695],{"class":1267}," }",[1049,1697,1698],{"class":1253}," from",[1049,1700,1354],{"class":1267},[1049,1702,1703],{"class":1059},"drizzle-orm/sqlite-core",[1049,1705,1318],{"class":1267},[1049,1707,1708,1710,1712,1715,1717,1719,1721,1724],{"class":1051,"line":1069},[1049,1709,1670],{"class":1253},[1049,1711,1673],{"class":1267},[1049,1713,1714],{"class":1263}," relations",[1049,1716,1695],{"class":1267},[1049,1718,1698],{"class":1253},[1049,1720,1354],{"class":1267},[1049,1722,1723],{"class":1059},"drizzle-orm",[1049,1725,1318],{"class":1267},[1049,1727,1728],{"class":1051,"line":1283},[1049,1729,1332],{"emptyLinePlaceholder":21},[1049,1731,1732,1734,1737,1740,1742,1744,1746,1748,1751,1753,1755],{"class":1051,"line":1298},[1049,1733,1254],{"class":1253},[1049,1735,1736],{"class":1550}," const",[1049,1738,1739],{"class":1263}," chats ",[1049,1741,1554],{"class":1267},[1049,1743,1676],{"class":1072},[1049,1745,1264],{"class":1263},[1049,1747,1292],{"class":1267},[1049,1749,1750],{"class":1059},"chats",[1049,1752,1292],{"class":1267},[1049,1754,1679],{"class":1267},[1049,1756,1343],{"class":1267},[1049,1758,1759,1762,1764,1766,1769,1772,1775,1777,1779,1782,1784,1786,1789,1792,1794,1797,1800],{"class":1051,"line":1310},[1049,1760,1761],{"class":1273},"  id",[1049,1763,1277],{"class":1267},[1049,1765,1682],{"class":1072},[1049,1767,1768],{"class":1263},"()",[1049,1770,1771],{"class":1267},".",[1049,1773,1774],{"class":1072},"primaryKey",[1049,1776,1768],{"class":1263},[1049,1778,1771],{"class":1267},[1049,1780,1781],{"class":1072},"$defaultFn",[1049,1783,1264],{"class":1263},[1049,1785,1768],{"class":1267},[1049,1787,1788],{"class":1550}," =>",[1049,1790,1791],{"class":1263}," crypto",[1049,1793,1771],{"class":1267},[1049,1795,1796],{"class":1072},"randomUUID",[1049,1798,1799],{"class":1263},"())",[1049,1801,1295],{"class":1267},[1049,1803,1804,1807,1809,1811,1813],{"class":1051,"line":1321},[1049,1805,1806],{"class":1273},"  title",[1049,1808,1277],{"class":1267},[1049,1810,1682],{"class":1072},[1049,1812,1768],{"class":1263},[1049,1814,1295],{"class":1267},[1049,1816,1817,1820,1822,1824,1826,1829,1832,1834,1836,1839,1841,1843,1846,1848,1851,1853,1855,1857,1859,1861,1863,1866,1869],{"class":1051,"line":1329},[1049,1818,1819],{"class":1273},"  createdAt",[1049,1821,1277],{"class":1267},[1049,1823,1687],{"class":1072},[1049,1825,1264],{"class":1263},[1049,1827,1828],{"class":1267},"{",[1049,1830,1831],{"class":1273}," mode",[1049,1833,1277],{"class":1267},[1049,1835,1354],{"class":1267},[1049,1837,1838],{"class":1059},"timestamp",[1049,1840,1292],{"class":1267},[1049,1842,1695],{"class":1267},[1049,1844,1845],{"class":1263},")",[1049,1847,1771],{"class":1267},[1049,1849,1850],{"class":1072},"notNull",[1049,1852,1768],{"class":1263},[1049,1854,1771],{"class":1267},[1049,1856,1781],{"class":1072},[1049,1858,1264],{"class":1263},[1049,1860,1768],{"class":1267},[1049,1862,1788],{"class":1550},[1049,1864,1865],{"class":1267}," new",[1049,1867,1868],{"class":1072}," Date",[1049,1870,1871],{"class":1263},"())\n",[1049,1873,1874,1876],{"class":1051,"line":1335},[1049,1875,1451],{"class":1267},[1049,1877,1454],{"class":1263},[1049,1879,1880],{"class":1051,"line":1346},[1049,1881,1332],{"emptyLinePlaceholder":21},[1049,1883,1884,1886,1888,1891,1893,1895,1898,1900,1903,1907,1910,1912,1915],{"class":1051,"line":1362},[1049,1885,1254],{"class":1253},[1049,1887,1736],{"class":1550},[1049,1889,1890],{"class":1263}," chatsRelations ",[1049,1892,1554],{"class":1267},[1049,1894,1714],{"class":1072},[1049,1896,1897],{"class":1263},"(chats",[1049,1899,1679],{"class":1267},[1049,1901,1902],{"class":1267}," ({",[1049,1904,1906],{"class":1905},"sHdIc"," many",[1049,1908,1909],{"class":1267}," })",[1049,1911,1788],{"class":1550},[1049,1913,1914],{"class":1263}," (",[1049,1916,1268],{"class":1267},[1049,1918,1919,1922,1924,1926],{"class":1051,"line":1368},[1049,1920,1921],{"class":1273},"  messages",[1049,1923,1277],{"class":1267},[1049,1925,1906],{"class":1072},[1049,1927,1928],{"class":1263},"(messages)\n",[1049,1930,1931,1933],{"class":1051,"line":1373},[1049,1932,1451],{"class":1267},[1049,1934,1935],{"class":1263},"))\n",[1049,1937,1938],{"class":1051,"line":1396},[1049,1939,1332],{"emptyLinePlaceholder":21},[1049,1941,1942,1944,1946,1949,1951,1953,1955,1957,1960,1962,1964],{"class":1051,"line":1401},[1049,1943,1254],{"class":1253},[1049,1945,1736],{"class":1550},[1049,1947,1948],{"class":1263}," messages ",[1049,1950,1554],{"class":1267},[1049,1952,1676],{"class":1072},[1049,1954,1264],{"class":1263},[1049,1956,1292],{"class":1267},[1049,1958,1959],{"class":1059},"messages",[1049,1961,1292],{"class":1267},[1049,1963,1679],{"class":1267},[1049,1965,1343],{"class":1267},[1049,1967,1968,1970,1972,1974,1976,1978,1981,1983,1985,1987,1989,1991,1993,1995,1997,1999,2001,2003,2005,2007,2009],{"class":1051,"line":1411},[1049,1969,1761],{"class":1273},[1049,1971,1277],{"class":1267},[1049,1973,1682],{"class":1072},[1049,1975,1264],{"class":1263},[1049,1977,1292],{"class":1267},[1049,1979,1980],{"class":1059},"id",[1049,1982,1292],{"class":1267},[1049,1984,1845],{"class":1263},[1049,1986,1771],{"class":1267},[1049,1988,1774],{"class":1072},[1049,1990,1768],{"class":1263},[1049,1992,1771],{"class":1267},[1049,1994,1781],{"class":1072},[1049,1996,1264],{"class":1263},[1049,1998,1768],{"class":1267},[1049,2000,1788],{"class":1550},[1049,2002,1791],{"class":1263},[1049,2004,1771],{"class":1267},[1049,2006,1796],{"class":1072},[1049,2008,1799],{"class":1263},[1049,2010,1295],{"class":1267},[1049,2012,2013,2016,2018,2020,2022,2024,2027,2029,2031,2033,2035,2037,2039,2042,2044,2046,2048,2051,2053,2055,2057,2059,2062,2064,2066,2069,2071,2073,2075],{"class":1051,"line":1421},[1049,2014,2015],{"class":1273},"  chatId",[1049,2017,1277],{"class":1267},[1049,2019,1682],{"class":1072},[1049,2021,1264],{"class":1263},[1049,2023,1292],{"class":1267},[1049,2025,2026],{"class":1059},"chat_id",[1049,2028,1292],{"class":1267},[1049,2030,1845],{"class":1263},[1049,2032,1771],{"class":1267},[1049,2034,1850],{"class":1072},[1049,2036,1768],{"class":1263},[1049,2038,1771],{"class":1267},[1049,2040,2041],{"class":1072},"references",[1049,2043,1264],{"class":1263},[1049,2045,1768],{"class":1267},[1049,2047,1788],{"class":1550},[1049,2049,2050],{"class":1263}," chats",[1049,2052,1771],{"class":1267},[1049,2054,1980],{"class":1263},[1049,2056,1679],{"class":1267},[1049,2058,1673],{"class":1267},[1049,2060,2061],{"class":1273}," onDelete",[1049,2063,1277],{"class":1267},[1049,2065,1354],{"class":1267},[1049,2067,2068],{"class":1059},"cascade",[1049,2070,1292],{"class":1267},[1049,2072,1695],{"class":1267},[1049,2074,1845],{"class":1263},[1049,2076,1295],{"class":1267},[1049,2078,2079,2082,2084,2086,2088,2090,2093,2095,2097,2099,2102,2104,2106,2108,2111,2113,2115,2117,2120,2122,2124,2126,2129,2131,2134,2136,2138,2140,2142,2144],{"class":1051,"line":1437},[1049,2080,2081],{"class":1273},"  role",[1049,2083,1277],{"class":1267},[1049,2085,1682],{"class":1072},[1049,2087,1264],{"class":1263},[1049,2089,1292],{"class":1267},[1049,2091,2092],{"class":1059},"role",[1049,2094,1292],{"class":1267},[1049,2096,1679],{"class":1267},[1049,2098,1673],{"class":1267},[1049,2100,2101],{"class":1273}," enum",[1049,2103,1277],{"class":1267},[1049,2105,1381],{"class":1263},[1049,2107,1292],{"class":1267},[1049,2109,2110],{"class":1059},"user",[1049,2112,1292],{"class":1267},[1049,2114,1679],{"class":1267},[1049,2116,1354],{"class":1267},[1049,2118,2119],{"class":1059},"assistant",[1049,2121,1292],{"class":1267},[1049,2123,1679],{"class":1267},[1049,2125,1354],{"class":1267},[1049,2127,2128],{"class":1059},"system",[1049,2130,1292],{"class":1267},[1049,2132,2133],{"class":1263},"] ",[1049,2135,1451],{"class":1267},[1049,2137,1845],{"class":1263},[1049,2139,1771],{"class":1267},[1049,2141,1850],{"class":1072},[1049,2143,1768],{"class":1263},[1049,2145,1295],{"class":1267},[1049,2147,2148,2151,2153,2155,2157,2159,2162,2164,2166,2168,2170,2172,2174,2177,2179,2181,2183],{"class":1051,"line":1443},[1049,2149,2150],{"class":1273},"  parts",[1049,2152,1277],{"class":1267},[1049,2154,1682],{"class":1072},[1049,2156,1264],{"class":1263},[1049,2158,1292],{"class":1267},[1049,2160,2161],{"class":1059},"parts",[1049,2163,1292],{"class":1267},[1049,2165,1679],{"class":1267},[1049,2167,1673],{"class":1267},[1049,2169,1831],{"class":1273},[1049,2171,1277],{"class":1267},[1049,2173,1354],{"class":1267},[1049,2175,2176],{"class":1059},"json",[1049,2178,1292],{"class":1267},[1049,2180,1695],{"class":1267},[1049,2182,1845],{"class":1263},[1049,2184,1295],{"class":1267},[1049,2186,2187,2189,2191,2193,2195,2197,2199,2201,2203,2205,2207,2209,2211,2213,2215,2217,2219,2221,2223,2225,2227,2229,2231,2233],{"class":1051,"line":1448},[1049,2188,1819],{"class":1273},[1049,2190,1277],{"class":1267},[1049,2192,1687],{"class":1072},[1049,2194,1264],{"class":1263},[1049,2196,1828],{"class":1267},[1049,2198,1831],{"class":1273},[1049,2200,1277],{"class":1267},[1049,2202,1354],{"class":1267},[1049,2204,1838],{"class":1059},[1049,2206,1292],{"class":1267},[1049,2208,1695],{"class":1267},[1049,2210,1845],{"class":1263},[1049,2212,1771],{"class":1267},[1049,2214,1850],{"class":1072},[1049,2216,1768],{"class":1263},[1049,2218,1771],{"class":1267},[1049,2220,1781],{"class":1072},[1049,2222,1264],{"class":1263},[1049,2224,1768],{"class":1267},[1049,2226,1788],{"class":1550},[1049,2228,1865],{"class":1267},[1049,2230,1868],{"class":1072},[1049,2232,1799],{"class":1263},[1049,2234,1295],{"class":1267},[1049,2236,2238,2241,2244,2246],{"class":1051,"line":2237},20,[1049,2239,2240],{"class":1267},"},",[1049,2242,2243],{"class":1905}," table",[1049,2245,1788],{"class":1550},[1049,2247,1280],{"class":1263},[1049,2249,2251,2254,2256,2258,2261,2263,2265,2267,2270,2273,2275],{"class":1051,"line":2250},21,[1049,2252,2253],{"class":1072},"  index",[1049,2255,1264],{"class":1263},[1049,2257,1292],{"class":1267},[1049,2259,2260],{"class":1059},"messages_chat_id_idx",[1049,2262,1292],{"class":1267},[1049,2264,1845],{"class":1263},[1049,2266,1771],{"class":1267},[1049,2268,2269],{"class":1072},"on",[1049,2271,2272],{"class":1263},"(table",[1049,2274,1771],{"class":1267},[1049,2276,2277],{"class":1263},"chatId)\n",[1049,2279,2281],{"class":1051,"line":2280},22,[1049,2282,2283],{"class":1263},"])\n",[1049,2285,2287],{"class":1051,"line":2286},23,[1049,2288,1332],{"emptyLinePlaceholder":21},[1049,2290,2292,2294,2296,2299,2301,2303,2306,2308,2310,2313,2315,2317,2319],{"class":1051,"line":2291},24,[1049,2293,1254],{"class":1253},[1049,2295,1736],{"class":1550},[1049,2297,2298],{"class":1263}," messagesRelations ",[1049,2300,1554],{"class":1267},[1049,2302,1714],{"class":1072},[1049,2304,2305],{"class":1263},"(messages",[1049,2307,1679],{"class":1267},[1049,2309,1902],{"class":1267},[1049,2311,2312],{"class":1905}," one",[1049,2314,1909],{"class":1267},[1049,2316,1788],{"class":1550},[1049,2318,1914],{"class":1263},[1049,2320,1268],{"class":1267},[1049,2322,2324,2327,2329,2331,2333,2335],{"class":1051,"line":2323},25,[1049,2325,2326],{"class":1273},"  chat",[1049,2328,1277],{"class":1267},[1049,2330,2312],{"class":1072},[1049,2332,1897],{"class":1263},[1049,2334,1679],{"class":1267},[1049,2336,1343],{"class":1267},[1049,2338,2340,2343,2345,2348,2350,2353],{"class":1051,"line":2339},26,[1049,2341,2342],{"class":1273},"    fields",[1049,2344,1277],{"class":1267},[1049,2346,2347],{"class":1263}," [messages",[1049,2349,1771],{"class":1267},[1049,2351,2352],{"class":1263},"chatId]",[1049,2354,1295],{"class":1267},[1049,2356,2358,2361,2363,2366,2368],{"class":1051,"line":2357},27,[1049,2359,2360],{"class":1273},"    references",[1049,2362,1277],{"class":1267},[1049,2364,2365],{"class":1263}," [chats",[1049,2367,1771],{"class":1267},[1049,2369,2370],{"class":1263},"id]\n",[1049,2372,2374,2377],{"class":1051,"line":2373},28,[1049,2375,2376],{"class":1267},"  }",[1049,2378,1454],{"class":1263},[1049,2380,2382,2384],{"class":1051,"line":2381},29,[1049,2383,1451],{"class":1267},[1049,2385,1935],{"class":1263},[949,2387,2388],{},"Generate the database migrations from your schema:",[1039,2390,2392],{"className":1041,"code":2391,"language":1043,"meta":1044,"style":1044},"npx nuxt db generate\n",[1046,2393,2394],{"__ignoreMap":1044},[1049,2395,2396,2398,2401,2404],{"class":1051,"line":1052},[1049,2397,1056],{"class":1055},[1049,2399,2400],{"class":1059}," nuxt",[1049,2402,2403],{"class":1059}," db",[1049,2405,2406],{"class":1059}," generate\n",[2408,2409,2410],"tip",{},[949,2411,2412,2413,2416],{},"Migrations are automatically applied when you start the development server with ",[1046,2414,2415],{},"npx nuxt dev",". NuxtHub uses SQLite locally, so no external database is required during development.",[953,2418,2420],{"id":2419},"building-the-backend","Building the backend",[949,2422,2423,2424,1771],{},"This section covers integrating AI on the server. The following API endpoints handle chat creation, AI streaming, and data persistence using ",[1024,2425,2428],{"href":2426,"rel":2427},"https://nitro.build",[1028],"Nitro",[1077,2430,2432],{"id":2431},"creating-a-chat","Creating a chat",[949,2434,2435,2436,2443],{},"First, create the endpoint that initializes a new chat and saves the first message to the database. This uses the ",[1024,2437,2440],{"href":2438,"rel":2439},"https://ai-sdk.dev/docs/reference/ai-sdk-ui/ui-message",[1028],[1046,2441,2442],{},"UIMessage"," type from the AI SDK:",[1240,2445,2446],{},[1039,2447,2450],{"className":1244,"code":2448,"filename":2449,"language":1246,"meta":1044,"style":1044},"import { defineEventHandler, readValidatedBody } from 'h3'\nimport type { UIMessage } from 'ai'\nimport { db, schema } from 'hub:db'\nimport { z } from 'zod'\n\nexport default defineEventHandler(async (event) => {\n  const { message } = await readValidatedBody(event, z.object({\n    message: z.custom\u003CUIMessage>()\n  }).parse)\n\n  // Create a new chat\n  const [chat] = await db.insert(schema.chats).values({}).returning()\n\n  // Save the first user message\n  await db.insert(schema.messages).values({\n    chatId: chat.id,\n    role: 'user',\n    parts: message.parts\n  })\n\n  return chat\n})\n","server/api/chats.post.ts",[1046,2451,2452,2476,2499,2523,2543,2547,2571,2608,2632,2645,2649,2654,2705,2709,2714,2743,2759,2774,2788,2794,2798,2806],{"__ignoreMap":1044},[1049,2453,2454,2456,2458,2461,2463,2466,2468,2470,2472,2474],{"class":1051,"line":1052},[1049,2455,1670],{"class":1253},[1049,2457,1673],{"class":1267},[1049,2459,2460],{"class":1263}," defineEventHandler",[1049,2462,1679],{"class":1267},[1049,2464,2465],{"class":1263}," readValidatedBody",[1049,2467,1695],{"class":1267},[1049,2469,1698],{"class":1253},[1049,2471,1354],{"class":1267},[1049,2473,1077],{"class":1059},[1049,2475,1318],{"class":1267},[1049,2477,2478,2480,2483,2485,2488,2490,2492,2494,2497],{"class":1051,"line":1069},[1049,2479,1670],{"class":1253},[1049,2481,2482],{"class":1253}," type",[1049,2484,1673],{"class":1267},[1049,2486,2487],{"class":1263}," UIMessage",[1049,2489,1695],{"class":1267},[1049,2491,1698],{"class":1253},[1049,2493,1354],{"class":1267},[1049,2495,2496],{"class":1059},"ai",[1049,2498,1318],{"class":1267},[1049,2500,2501,2503,2505,2507,2509,2512,2514,2516,2518,2521],{"class":1051,"line":1283},[1049,2502,1670],{"class":1253},[1049,2504,1673],{"class":1267},[1049,2506,2403],{"class":1263},[1049,2508,1679],{"class":1267},[1049,2510,2511],{"class":1263}," schema",[1049,2513,1695],{"class":1267},[1049,2515,1698],{"class":1253},[1049,2517,1354],{"class":1267},[1049,2519,2520],{"class":1059},"hub:db",[1049,2522,1318],{"class":1267},[1049,2524,2525,2527,2529,2532,2534,2536,2538,2541],{"class":1051,"line":1298},[1049,2526,1670],{"class":1253},[1049,2528,1673],{"class":1267},[1049,2530,2531],{"class":1263}," z",[1049,2533,1695],{"class":1267},[1049,2535,1698],{"class":1253},[1049,2537,1354],{"class":1267},[1049,2539,2540],{"class":1059},"zod",[1049,2542,1318],{"class":1267},[1049,2544,2545],{"class":1051,"line":1310},[1049,2546,1332],{"emptyLinePlaceholder":21},[1049,2548,2549,2551,2553,2555,2557,2560,2562,2565,2567,2569],{"class":1051,"line":1321},[1049,2550,1254],{"class":1253},[1049,2552,1257],{"class":1253},[1049,2554,2460],{"class":1072},[1049,2556,1264],{"class":1263},[1049,2558,2559],{"class":1550},"async",[1049,2561,1914],{"class":1267},[1049,2563,2564],{"class":1905},"event",[1049,2566,1845],{"class":1267},[1049,2568,1788],{"class":1550},[1049,2570,1343],{"class":1267},[1049,2572,2573,2576,2578,2581,2583,2586,2589,2591,2593,2595,2597,2599,2601,2604,2606],{"class":1051,"line":1329},[1049,2574,2575],{"class":1550},"  const",[1049,2577,1673],{"class":1267},[1049,2579,2580],{"class":1263}," message",[1049,2582,1695],{"class":1267},[1049,2584,2585],{"class":1267}," =",[1049,2587,2588],{"class":1253}," await",[1049,2590,2465],{"class":1072},[1049,2592,1264],{"class":1273},[1049,2594,2564],{"class":1263},[1049,2596,1679],{"class":1267},[1049,2598,2531],{"class":1263},[1049,2600,1771],{"class":1267},[1049,2602,2603],{"class":1072},"object",[1049,2605,1264],{"class":1273},[1049,2607,1268],{"class":1267},[1049,2609,2610,2613,2615,2617,2619,2622,2624,2626,2629],{"class":1051,"line":1335},[1049,2611,2612],{"class":1273},"    message",[1049,2614,1277],{"class":1267},[1049,2616,2531],{"class":1263},[1049,2618,1771],{"class":1267},[1049,2620,2621],{"class":1072},"custom",[1049,2623,1522],{"class":1267},[1049,2625,2442],{"class":1055},[1049,2627,2628],{"class":1267},">",[1049,2630,2631],{"class":1273},"()\n",[1049,2633,2634,2636,2638,2640,2643],{"class":1051,"line":1346},[1049,2635,2376],{"class":1267},[1049,2637,1845],{"class":1273},[1049,2639,1771],{"class":1267},[1049,2641,2642],{"class":1263},"parse",[1049,2644,1454],{"class":1273},[1049,2646,2647],{"class":1051,"line":1362},[1049,2648,1332],{"emptyLinePlaceholder":21},[1049,2650,2651],{"class":1051,"line":1368},[1049,2652,2653],{"class":1433},"  // Create a new chat\n",[1049,2655,2656,2658,2660,2662,2664,2666,2668,2670,2672,2675,2677,2680,2682,2684,2686,2688,2691,2693,2696,2698,2700,2703],{"class":1051,"line":1373},[1049,2657,2575],{"class":1550},[1049,2659,1381],{"class":1267},[1049,2661,256],{"class":1263},[1049,2663,1391],{"class":1267},[1049,2665,2585],{"class":1267},[1049,2667,2588],{"class":1253},[1049,2669,2403],{"class":1263},[1049,2671,1771],{"class":1267},[1049,2673,2674],{"class":1072},"insert",[1049,2676,1264],{"class":1273},[1049,2678,2679],{"class":1263},"schema",[1049,2681,1771],{"class":1267},[1049,2683,1750],{"class":1263},[1049,2685,1845],{"class":1273},[1049,2687,1771],{"class":1267},[1049,2689,2690],{"class":1072},"values",[1049,2692,1264],{"class":1273},[1049,2694,2695],{"class":1267},"{}",[1049,2697,1845],{"class":1273},[1049,2699,1771],{"class":1267},[1049,2701,2702],{"class":1072},"returning",[1049,2704,2631],{"class":1273},[1049,2706,2707],{"class":1051,"line":1396},[1049,2708,1332],{"emptyLinePlaceholder":21},[1049,2710,2711],{"class":1051,"line":1401},[1049,2712,2713],{"class":1433},"  // Save the first user message\n",[1049,2715,2716,2719,2721,2723,2725,2727,2729,2731,2733,2735,2737,2739,2741],{"class":1051,"line":1411},[1049,2717,2718],{"class":1253},"  await",[1049,2720,2403],{"class":1263},[1049,2722,1771],{"class":1267},[1049,2724,2674],{"class":1072},[1049,2726,1264],{"class":1273},[1049,2728,2679],{"class":1263},[1049,2730,1771],{"class":1267},[1049,2732,1959],{"class":1263},[1049,2734,1845],{"class":1273},[1049,2736,1771],{"class":1267},[1049,2738,2690],{"class":1072},[1049,2740,1264],{"class":1273},[1049,2742,1268],{"class":1267},[1049,2744,2745,2748,2750,2753,2755,2757],{"class":1051,"line":1421},[1049,2746,2747],{"class":1273},"    chatId",[1049,2749,1277],{"class":1267},[1049,2751,2752],{"class":1263}," chat",[1049,2754,1771],{"class":1267},[1049,2756,1980],{"class":1263},[1049,2758,1295],{"class":1267},[1049,2760,2761,2764,2766,2768,2770,2772],{"class":1051,"line":1437},[1049,2762,2763],{"class":1273},"    role",[1049,2765,1277],{"class":1267},[1049,2767,1354],{"class":1267},[1049,2769,2110],{"class":1059},[1049,2771,1292],{"class":1267},[1049,2773,1295],{"class":1267},[1049,2775,2776,2779,2781,2783,2785],{"class":1051,"line":1443},[1049,2777,2778],{"class":1273},"    parts",[1049,2780,1277],{"class":1267},[1049,2782,2580],{"class":1263},[1049,2784,1771],{"class":1267},[1049,2786,2787],{"class":1263},"parts\n",[1049,2789,2790,2792],{"class":1051,"line":1448},[1049,2791,2376],{"class":1267},[1049,2793,1454],{"class":1273},[1049,2795,2796],{"class":1051,"line":2237},[1049,2797,1332],{"emptyLinePlaceholder":21},[1049,2799,2800,2803],{"class":1051,"line":2250},[1049,2801,2802],{"class":1253},"  return",[1049,2804,2805],{"class":1263}," chat\n",[1049,2807,2808,2810],{"class":1051,"line":2280},[1049,2809,1451],{"class":1267},[1049,2811,1454],{"class":1263},[1077,2813,2815],{"id":2814},"streaming-ai-responses","Streaming AI responses",[949,2817,2818,2819,2826,2827,2834,2835,2842],{},"Next, create the endpoint that handles the AI conversation. This endpoint uses ",[1024,2820,2823],{"href":2821,"rel":2822},"https://ai-sdk.dev/docs/reference/ai-sdk-core/stream-text",[1028],[1046,2824,2825],{},"streamText",", ",[1024,2828,2831],{"href":2829,"rel":2830},"https://ai-sdk.dev/docs/reference/ai-sdk-ui/create-ui-message-stream",[1028],[1046,2832,2833],{},"createUIMessageStream",", and ",[1024,2836,2839],{"href":2837,"rel":2838},"https://ai-sdk.dev/docs/reference/ai-sdk-ui/create-ui-message-stream-response",[1028],[1046,2840,2841],{},"createUIMessageStreamResponse"," from the AI SDK:",[1240,2844,2845],{},[1658,2846,2847],{},[1039,2848,2851],{"className":1244,"code":2849,"filename":2850,"language":1246,"meta":1044,"style":1044},"import { createError, defineEventHandler, getValidatedRouterParams, readValidatedBody } from 'h3'\nimport { eq } from 'drizzle-orm'\nimport { db, schema } from 'hub:db'\nimport { z } from 'zod'\nimport {\n  convertToModelMessages,\n  createUIMessageStream,\n  createUIMessageStreamResponse,\n  generateText,\n  streamText\n} from 'ai'\nimport type { UIMessage } from 'ai'\n\nexport default defineEventHandler(async (event) => {\n  const { id } = await getValidatedRouterParams(event, z.object({\n    id: z.string()\n  }).parse)\n\n  const { model, messages } = await readValidatedBody(event, z.object({\n    model: z.string().default('openai/gpt-4o-mini'),\n    messages: z.array(z.custom\u003CUIMessage>())\n  }).parse)\n\n  // Fetch the chat from the database\n  const chat = await db.query.chats.findFirst({\n    where: (chat, { eq }) => eq(chat.id, id as string)\n  })\n\n  if (!chat) {\n    throw createError({ statusCode: 404, statusMessage: 'Chat not found' })\n  }\n\n  // Generate a title for the chat if it doesn't have one\n  if (!chat.title) {\n    const { text: title } = await generateText({\n      model: 'openai/gpt-4o-mini',\n      system: `Generate a short title (max 30 characters) based on the user's message. No quotes or punctuation.`,\n      prompt: JSON.stringify(messages[0])\n    })\n\n    await db.update(schema.chats).set({ title }).where(eq(schema.chats.id, id))\n  }\n\n  // Save the user message if it's a follow-up\n  const lastMessage = messages[messages.length - 1]\n  if (lastMessage?.role === 'user' && messages.length > 1) {\n    await db.insert(schema.messages).values({\n      chatId: id,\n      role: 'user',\n      parts: lastMessage.parts\n    })\n  }\n\n  // Create the streaming response\n  const stream = createUIMessageStream({\n    execute: async ({ writer }) => {\n      const result = streamText({\n        model,\n        system: `You are a helpful AI assistant. Be concise and friendly.`,\n        messages: await convertToModelMessages(messages)\n      })\n\n      // Notify the client that a title was generated\n      if (!chat.title) {\n        writer.write({\n          type: 'data-chat-title',\n          data: { message: 'Title generated' },\n          transient: true\n        })\n      }\n\n      writer.merge(result.toUIMessageStream())\n    },\n    onFinish: async ({ messages }) => {\n      // Save the assistant's response to the database\n      await db.insert(schema.messages).values(messages.map(message => ({\n        chatId: chat.id,\n        role: message.role as 'user' | 'assistant',\n        parts: message.parts\n      })))\n    }\n  })\n\n  return createUIMessageStreamResponse({ stream })\n})\n","server/api/chats/[id].post.ts",[1046,2852,2853,2885,2904,2926,2944,2950,2957,2964,2971,2978,2983,2995,3015,3019,3041,3074,3090,3102,3106,3144,3177,3208,3220,3224,3229,3259,3302,3308,3312,3329,3368,3374,3379,3385,3405,3433,3449,3468,3496,3504,3509,3575,3580,3585,3591,3621,3663,3692,3704,3720,3734,3741,3746,3751,3757,3774,3796,3814,3822,3839,3858,3866,3871,3877,3897,3912,3929,3953,3964,3972,3978,3983,4006,4012,4032,4038,4084,4100,4133,4147,4155,4160,4167,4172,4190],{"__ignoreMap":1044},[1049,2854,2855,2857,2859,2862,2864,2866,2868,2871,2873,2875,2877,2879,2881,2883],{"class":1051,"line":1052},[1049,2856,1670],{"class":1253},[1049,2858,1673],{"class":1267},[1049,2860,2861],{"class":1263}," createError",[1049,2863,1679],{"class":1267},[1049,2865,2460],{"class":1263},[1049,2867,1679],{"class":1267},[1049,2869,2870],{"class":1263}," getValidatedRouterParams",[1049,2872,1679],{"class":1267},[1049,2874,2465],{"class":1263},[1049,2876,1695],{"class":1267},[1049,2878,1698],{"class":1253},[1049,2880,1354],{"class":1267},[1049,2882,1077],{"class":1059},[1049,2884,1318],{"class":1267},[1049,2886,2887,2889,2891,2894,2896,2898,2900,2902],{"class":1051,"line":1069},[1049,2888,1670],{"class":1253},[1049,2890,1673],{"class":1267},[1049,2892,2893],{"class":1263}," eq",[1049,2895,1695],{"class":1267},[1049,2897,1698],{"class":1253},[1049,2899,1354],{"class":1267},[1049,2901,1723],{"class":1059},[1049,2903,1318],{"class":1267},[1049,2905,2906,2908,2910,2912,2914,2916,2918,2920,2922,2924],{"class":1051,"line":1283},[1049,2907,1670],{"class":1253},[1049,2909,1673],{"class":1267},[1049,2911,2403],{"class":1263},[1049,2913,1679],{"class":1267},[1049,2915,2511],{"class":1263},[1049,2917,1695],{"class":1267},[1049,2919,1698],{"class":1253},[1049,2921,1354],{"class":1267},[1049,2923,2520],{"class":1059},[1049,2925,1318],{"class":1267},[1049,2927,2928,2930,2932,2934,2936,2938,2940,2942],{"class":1051,"line":1298},[1049,2929,1670],{"class":1253},[1049,2931,1673],{"class":1267},[1049,2933,2531],{"class":1263},[1049,2935,1695],{"class":1267},[1049,2937,1698],{"class":1253},[1049,2939,1354],{"class":1267},[1049,2941,2540],{"class":1059},[1049,2943,1318],{"class":1267},[1049,2945,2946,2948],{"class":1051,"line":1310},[1049,2947,1670],{"class":1253},[1049,2949,1343],{"class":1267},[1049,2951,2952,2955],{"class":1051,"line":1321},[1049,2953,2954],{"class":1263},"  convertToModelMessages",[1049,2956,1295],{"class":1267},[1049,2958,2959,2962],{"class":1051,"line":1329},[1049,2960,2961],{"class":1263},"  createUIMessageStream",[1049,2963,1295],{"class":1267},[1049,2965,2966,2969],{"class":1051,"line":1335},[1049,2967,2968],{"class":1263},"  createUIMessageStreamResponse",[1049,2970,1295],{"class":1267},[1049,2972,2973,2976],{"class":1051,"line":1346},[1049,2974,2975],{"class":1263},"  generateText",[1049,2977,1295],{"class":1267},[1049,2979,2980],{"class":1051,"line":1362},[1049,2981,2982],{"class":1263},"  streamText\n",[1049,2984,2985,2987,2989,2991,2993],{"class":1051,"line":1368},[1049,2986,1451],{"class":1267},[1049,2988,1698],{"class":1253},[1049,2990,1354],{"class":1267},[1049,2992,2496],{"class":1059},[1049,2994,1318],{"class":1267},[1049,2996,2997,2999,3001,3003,3005,3007,3009,3011,3013],{"class":1051,"line":1373},[1049,2998,1670],{"class":1253},[1049,3000,2482],{"class":1253},[1049,3002,1673],{"class":1267},[1049,3004,2487],{"class":1263},[1049,3006,1695],{"class":1267},[1049,3008,1698],{"class":1253},[1049,3010,1354],{"class":1267},[1049,3012,2496],{"class":1059},[1049,3014,1318],{"class":1267},[1049,3016,3017],{"class":1051,"line":1396},[1049,3018,1332],{"emptyLinePlaceholder":21},[1049,3020,3021,3023,3025,3027,3029,3031,3033,3035,3037,3039],{"class":1051,"line":1401},[1049,3022,1254],{"class":1253},[1049,3024,1257],{"class":1253},[1049,3026,2460],{"class":1072},[1049,3028,1264],{"class":1263},[1049,3030,2559],{"class":1550},[1049,3032,1914],{"class":1267},[1049,3034,2564],{"class":1905},[1049,3036,1845],{"class":1267},[1049,3038,1788],{"class":1550},[1049,3040,1343],{"class":1267},[1049,3042,3043,3045,3047,3050,3052,3054,3056,3058,3060,3062,3064,3066,3068,3070,3072],{"class":1051,"line":1411},[1049,3044,2575],{"class":1550},[1049,3046,1673],{"class":1267},[1049,3048,3049],{"class":1263}," id",[1049,3051,1695],{"class":1267},[1049,3053,2585],{"class":1267},[1049,3055,2588],{"class":1253},[1049,3057,2870],{"class":1072},[1049,3059,1264],{"class":1273},[1049,3061,2564],{"class":1263},[1049,3063,1679],{"class":1267},[1049,3065,2531],{"class":1263},[1049,3067,1771],{"class":1267},[1049,3069,2603],{"class":1072},[1049,3071,1264],{"class":1273},[1049,3073,1268],{"class":1267},[1049,3075,3076,3079,3081,3083,3085,3088],{"class":1051,"line":1421},[1049,3077,3078],{"class":1273},"    id",[1049,3080,1277],{"class":1267},[1049,3082,2531],{"class":1263},[1049,3084,1771],{"class":1267},[1049,3086,3087],{"class":1072},"string",[1049,3089,2631],{"class":1273},[1049,3091,3092,3094,3096,3098,3100],{"class":1051,"line":1437},[1049,3093,2376],{"class":1267},[1049,3095,1845],{"class":1273},[1049,3097,1771],{"class":1267},[1049,3099,2642],{"class":1263},[1049,3101,1454],{"class":1273},[1049,3103,3104],{"class":1051,"line":1443},[1049,3105,1332],{"emptyLinePlaceholder":21},[1049,3107,3108,3110,3112,3115,3117,3120,3122,3124,3126,3128,3130,3132,3134,3136,3138,3140,3142],{"class":1051,"line":1448},[1049,3109,2575],{"class":1550},[1049,3111,1673],{"class":1267},[1049,3113,3114],{"class":1263}," model",[1049,3116,1679],{"class":1267},[1049,3118,3119],{"class":1263}," messages",[1049,3121,1695],{"class":1267},[1049,3123,2585],{"class":1267},[1049,3125,2588],{"class":1253},[1049,3127,2465],{"class":1072},[1049,3129,1264],{"class":1273},[1049,3131,2564],{"class":1263},[1049,3133,1679],{"class":1267},[1049,3135,2531],{"class":1263},[1049,3137,1771],{"class":1267},[1049,3139,2603],{"class":1072},[1049,3141,1264],{"class":1273},[1049,3143,1268],{"class":1267},[1049,3145,3146,3149,3151,3153,3155,3157,3159,3161,3164,3166,3168,3171,3173,3175],{"class":1051,"line":2237},[1049,3147,3148],{"class":1273},"    model",[1049,3150,1277],{"class":1267},[1049,3152,2531],{"class":1263},[1049,3154,1771],{"class":1267},[1049,3156,3087],{"class":1072},[1049,3158,1768],{"class":1273},[1049,3160,1771],{"class":1267},[1049,3162,3163],{"class":1072},"default",[1049,3165,1264],{"class":1273},[1049,3167,1292],{"class":1267},[1049,3169,3170],{"class":1059},"openai/gpt-4o-mini",[1049,3172,1292],{"class":1267},[1049,3174,1845],{"class":1273},[1049,3176,1295],{"class":1267},[1049,3178,3179,3182,3184,3186,3188,3191,3193,3196,3198,3200,3202,3204,3206],{"class":1051,"line":2250},[1049,3180,3181],{"class":1273},"    messages",[1049,3183,1277],{"class":1267},[1049,3185,2531],{"class":1263},[1049,3187,1771],{"class":1267},[1049,3189,3190],{"class":1072},"array",[1049,3192,1264],{"class":1273},[1049,3194,3195],{"class":1263},"z",[1049,3197,1771],{"class":1267},[1049,3199,2621],{"class":1072},[1049,3201,1522],{"class":1267},[1049,3203,2442],{"class":1055},[1049,3205,2628],{"class":1267},[1049,3207,1871],{"class":1273},[1049,3209,3210,3212,3214,3216,3218],{"class":1051,"line":2280},[1049,3211,2376],{"class":1267},[1049,3213,1845],{"class":1273},[1049,3215,1771],{"class":1267},[1049,3217,2642],{"class":1263},[1049,3219,1454],{"class":1273},[1049,3221,3222],{"class":1051,"line":2286},[1049,3223,1332],{"emptyLinePlaceholder":21},[1049,3225,3226],{"class":1051,"line":2291},[1049,3227,3228],{"class":1433},"  // Fetch the chat from the database\n",[1049,3230,3231,3233,3235,3237,3239,3241,3243,3246,3248,3250,3252,3255,3257],{"class":1051,"line":2323},[1049,3232,2575],{"class":1550},[1049,3234,2752],{"class":1263},[1049,3236,2585],{"class":1267},[1049,3238,2588],{"class":1253},[1049,3240,2403],{"class":1263},[1049,3242,1771],{"class":1267},[1049,3244,3245],{"class":1263},"query",[1049,3247,1771],{"class":1267},[1049,3249,1750],{"class":1263},[1049,3251,1771],{"class":1267},[1049,3253,3254],{"class":1072},"findFirst",[1049,3256,1264],{"class":1273},[1049,3258,1268],{"class":1267},[1049,3260,3261,3264,3266,3268,3270,3272,3274,3276,3278,3280,3282,3284,3286,3288,3290,3292,3294,3297,3300],{"class":1051,"line":2339},[1049,3262,3263],{"class":1072},"    where",[1049,3265,1277],{"class":1267},[1049,3267,1914],{"class":1267},[1049,3269,256],{"class":1905},[1049,3271,1679],{"class":1267},[1049,3273,1673],{"class":1267},[1049,3275,2893],{"class":1905},[1049,3277,1909],{"class":1267},[1049,3279,1788],{"class":1550},[1049,3281,2893],{"class":1072},[1049,3283,1264],{"class":1273},[1049,3285,256],{"class":1263},[1049,3287,1771],{"class":1267},[1049,3289,1980],{"class":1263},[1049,3291,1679],{"class":1267},[1049,3293,3049],{"class":1263},[1049,3295,3296],{"class":1253}," as",[1049,3298,3299],{"class":1055}," string",[1049,3301,1454],{"class":1273},[1049,3303,3304,3306],{"class":1051,"line":2357},[1049,3305,2376],{"class":1267},[1049,3307,1454],{"class":1273},[1049,3309,3310],{"class":1051,"line":2373},[1049,3311,1332],{"emptyLinePlaceholder":21},[1049,3313,3314,3317,3319,3322,3324,3327],{"class":1051,"line":2381},[1049,3315,3316],{"class":1253},"  if",[1049,3318,1914],{"class":1273},[1049,3320,3321],{"class":1267},"!",[1049,3323,256],{"class":1263},[1049,3325,3326],{"class":1273},") ",[1049,3328,1268],{"class":1267},[1049,3330,3332,3335,3337,3339,3341,3344,3346,3350,3352,3355,3357,3359,3362,3364,3366],{"class":1051,"line":3331},30,[1049,3333,3334],{"class":1253},"    throw",[1049,3336,2861],{"class":1072},[1049,3338,1264],{"class":1273},[1049,3340,1828],{"class":1267},[1049,3342,3343],{"class":1273}," statusCode",[1049,3345,1277],{"class":1267},[1049,3347,3349],{"class":3348},"sbssI"," 404",[1049,3351,1679],{"class":1267},[1049,3353,3354],{"class":1273}," statusMessage",[1049,3356,1277],{"class":1267},[1049,3358,1354],{"class":1267},[1049,3360,3361],{"class":1059},"Chat not found",[1049,3363,1292],{"class":1267},[1049,3365,1695],{"class":1267},[1049,3367,1454],{"class":1273},[1049,3369,3371],{"class":1051,"line":3370},31,[1049,3372,3373],{"class":1267},"  }\n",[1049,3375,3377],{"class":1051,"line":3376},32,[1049,3378,1332],{"emptyLinePlaceholder":21},[1049,3380,3382],{"class":1051,"line":3381},33,[1049,3383,3384],{"class":1433},"  // Generate a title for the chat if it doesn't have one\n",[1049,3386,3388,3390,3392,3394,3396,3398,3401,3403],{"class":1051,"line":3387},34,[1049,3389,3316],{"class":1253},[1049,3391,1914],{"class":1273},[1049,3393,3321],{"class":1267},[1049,3395,256],{"class":1263},[1049,3397,1771],{"class":1267},[1049,3399,3400],{"class":1263},"title",[1049,3402,3326],{"class":1273},[1049,3404,1268],{"class":1267},[1049,3406,3408,3411,3413,3415,3417,3420,3422,3424,3426,3429,3431],{"class":1051,"line":3407},35,[1049,3409,3410],{"class":1550},"    const",[1049,3412,1673],{"class":1267},[1049,3414,1682],{"class":1273},[1049,3416,1277],{"class":1267},[1049,3418,3419],{"class":1263}," title",[1049,3421,1695],{"class":1267},[1049,3423,2585],{"class":1267},[1049,3425,2588],{"class":1253},[1049,3427,3428],{"class":1072}," generateText",[1049,3430,1264],{"class":1273},[1049,3432,1268],{"class":1267},[1049,3434,3436,3439,3441,3443,3445,3447],{"class":1051,"line":3435},36,[1049,3437,3438],{"class":1273},"      model",[1049,3440,1277],{"class":1267},[1049,3442,1354],{"class":1267},[1049,3444,3170],{"class":1059},[1049,3446,1292],{"class":1267},[1049,3448,1295],{"class":1267},[1049,3450,3452,3455,3457,3460,3463,3466],{"class":1051,"line":3451},37,[1049,3453,3454],{"class":1273},"      system",[1049,3456,1277],{"class":1267},[1049,3458,3459],{"class":1267}," `",[1049,3461,3462],{"class":1059},"Generate a short title (max 30 characters) based on the user's message. No quotes or punctuation.",[1049,3464,3465],{"class":1267},"`",[1049,3467,1295],{"class":1267},[1049,3469,3471,3474,3476,3479,3481,3484,3486,3488,3491,3494],{"class":1051,"line":3470},38,[1049,3472,3473],{"class":1273},"      prompt",[1049,3475,1277],{"class":1267},[1049,3477,3478],{"class":1263}," JSON",[1049,3480,1771],{"class":1267},[1049,3482,3483],{"class":1072},"stringify",[1049,3485,1264],{"class":1273},[1049,3487,1959],{"class":1263},[1049,3489,3490],{"class":1273},"[",[1049,3492,3493],{"class":3348},"0",[1049,3495,2283],{"class":1273},[1049,3497,3499,3502],{"class":1051,"line":3498},39,[1049,3500,3501],{"class":1267},"    }",[1049,3503,1454],{"class":1273},[1049,3505,3507],{"class":1051,"line":3506},40,[1049,3508,1332],{"emptyLinePlaceholder":21},[1049,3510,3512,3515,3517,3519,3522,3524,3526,3528,3530,3532,3534,3537,3539,3541,3543,3545,3547,3549,3552,3554,3557,3559,3561,3563,3565,3567,3569,3571,3573],{"class":1051,"line":3511},41,[1049,3513,3514],{"class":1253},"    await",[1049,3516,2403],{"class":1263},[1049,3518,1771],{"class":1267},[1049,3520,3521],{"class":1072},"update",[1049,3523,1264],{"class":1273},[1049,3525,2679],{"class":1263},[1049,3527,1771],{"class":1267},[1049,3529,1750],{"class":1263},[1049,3531,1845],{"class":1273},[1049,3533,1771],{"class":1267},[1049,3535,3536],{"class":1072},"set",[1049,3538,1264],{"class":1273},[1049,3540,1828],{"class":1267},[1049,3542,3419],{"class":1263},[1049,3544,1695],{"class":1267},[1049,3546,1845],{"class":1273},[1049,3548,1771],{"class":1267},[1049,3550,3551],{"class":1072},"where",[1049,3553,1264],{"class":1273},[1049,3555,3556],{"class":1072},"eq",[1049,3558,1264],{"class":1273},[1049,3560,2679],{"class":1263},[1049,3562,1771],{"class":1267},[1049,3564,1750],{"class":1263},[1049,3566,1771],{"class":1267},[1049,3568,1980],{"class":1263},[1049,3570,1679],{"class":1267},[1049,3572,3049],{"class":1263},[1049,3574,1935],{"class":1273},[1049,3576,3578],{"class":1051,"line":3577},42,[1049,3579,3373],{"class":1267},[1049,3581,3583],{"class":1051,"line":3582},43,[1049,3584,1332],{"emptyLinePlaceholder":21},[1049,3586,3588],{"class":1051,"line":3587},44,[1049,3589,3590],{"class":1433},"  // Save the user message if it's a follow-up\n",[1049,3592,3594,3596,3599,3601,3603,3605,3607,3609,3612,3615,3618],{"class":1051,"line":3593},45,[1049,3595,2575],{"class":1550},[1049,3597,3598],{"class":1263}," lastMessage",[1049,3600,2585],{"class":1267},[1049,3602,3119],{"class":1263},[1049,3604,3490],{"class":1273},[1049,3606,1959],{"class":1263},[1049,3608,1771],{"class":1267},[1049,3610,3611],{"class":1263},"length",[1049,3613,3614],{"class":1267}," -",[1049,3616,3617],{"class":3348}," 1",[1049,3619,3620],{"class":1273},"]\n",[1049,3622,3624,3626,3628,3631,3634,3636,3639,3641,3643,3645,3648,3650,3652,3654,3657,3659,3661],{"class":1051,"line":3623},46,[1049,3625,3316],{"class":1253},[1049,3627,1914],{"class":1273},[1049,3629,3630],{"class":1263},"lastMessage",[1049,3632,3633],{"class":1267},"?.",[1049,3635,2092],{"class":1263},[1049,3637,3638],{"class":1267}," ===",[1049,3640,1354],{"class":1267},[1049,3642,2110],{"class":1059},[1049,3644,1292],{"class":1267},[1049,3646,3647],{"class":1267}," &&",[1049,3649,3119],{"class":1263},[1049,3651,1771],{"class":1267},[1049,3653,3611],{"class":1263},[1049,3655,3656],{"class":1267}," >",[1049,3658,3617],{"class":3348},[1049,3660,3326],{"class":1273},[1049,3662,1268],{"class":1267},[1049,3664,3666,3668,3670,3672,3674,3676,3678,3680,3682,3684,3686,3688,3690],{"class":1051,"line":3665},47,[1049,3667,3514],{"class":1253},[1049,3669,2403],{"class":1263},[1049,3671,1771],{"class":1267},[1049,3673,2674],{"class":1072},[1049,3675,1264],{"class":1273},[1049,3677,2679],{"class":1263},[1049,3679,1771],{"class":1267},[1049,3681,1959],{"class":1263},[1049,3683,1845],{"class":1273},[1049,3685,1771],{"class":1267},[1049,3687,2690],{"class":1072},[1049,3689,1264],{"class":1273},[1049,3691,1268],{"class":1267},[1049,3693,3695,3698,3700,3702],{"class":1051,"line":3694},48,[1049,3696,3697],{"class":1273},"      chatId",[1049,3699,1277],{"class":1267},[1049,3701,3049],{"class":1263},[1049,3703,1295],{"class":1267},[1049,3705,3707,3710,3712,3714,3716,3718],{"class":1051,"line":3706},49,[1049,3708,3709],{"class":1273},"      role",[1049,3711,1277],{"class":1267},[1049,3713,1354],{"class":1267},[1049,3715,2110],{"class":1059},[1049,3717,1292],{"class":1267},[1049,3719,1295],{"class":1267},[1049,3721,3723,3726,3728,3730,3732],{"class":1051,"line":3722},50,[1049,3724,3725],{"class":1273},"      parts",[1049,3727,1277],{"class":1267},[1049,3729,3598],{"class":1263},[1049,3731,1771],{"class":1267},[1049,3733,2787],{"class":1263},[1049,3735,3737,3739],{"class":1051,"line":3736},51,[1049,3738,3501],{"class":1267},[1049,3740,1454],{"class":1273},[1049,3742,3744],{"class":1051,"line":3743},52,[1049,3745,3373],{"class":1267},[1049,3747,3749],{"class":1051,"line":3748},53,[1049,3750,1332],{"emptyLinePlaceholder":21},[1049,3752,3754],{"class":1051,"line":3753},54,[1049,3755,3756],{"class":1433},"  // Create the streaming response\n",[1049,3758,3760,3762,3765,3767,3770,3772],{"class":1051,"line":3759},55,[1049,3761,2575],{"class":1550},[1049,3763,3764],{"class":1263}," stream",[1049,3766,2585],{"class":1267},[1049,3768,3769],{"class":1072}," createUIMessageStream",[1049,3771,1264],{"class":1273},[1049,3773,1268],{"class":1267},[1049,3775,3777,3780,3782,3785,3787,3790,3792,3794],{"class":1051,"line":3776},56,[1049,3778,3779],{"class":1072},"    execute",[1049,3781,1277],{"class":1267},[1049,3783,3784],{"class":1550}," async",[1049,3786,1902],{"class":1267},[1049,3788,3789],{"class":1905}," writer",[1049,3791,1909],{"class":1267},[1049,3793,1788],{"class":1550},[1049,3795,1343],{"class":1267},[1049,3797,3799,3802,3805,3807,3810,3812],{"class":1051,"line":3798},57,[1049,3800,3801],{"class":1550},"      const",[1049,3803,3804],{"class":1263}," result",[1049,3806,2585],{"class":1267},[1049,3808,3809],{"class":1072}," streamText",[1049,3811,1264],{"class":1273},[1049,3813,1268],{"class":1267},[1049,3815,3817,3820],{"class":1051,"line":3816},58,[1049,3818,3819],{"class":1263},"        model",[1049,3821,1295],{"class":1267},[1049,3823,3825,3828,3830,3832,3835,3837],{"class":1051,"line":3824},59,[1049,3826,3827],{"class":1273},"        system",[1049,3829,1277],{"class":1267},[1049,3831,3459],{"class":1267},[1049,3833,3834],{"class":1059},"You are a helpful AI assistant. Be concise and friendly.",[1049,3836,3465],{"class":1267},[1049,3838,1295],{"class":1267},[1049,3840,3842,3845,3847,3849,3852,3854,3856],{"class":1051,"line":3841},60,[1049,3843,3844],{"class":1273},"        messages",[1049,3846,1277],{"class":1267},[1049,3848,2588],{"class":1253},[1049,3850,3851],{"class":1072}," convertToModelMessages",[1049,3853,1264],{"class":1273},[1049,3855,1959],{"class":1263},[1049,3857,1454],{"class":1273},[1049,3859,3861,3864],{"class":1051,"line":3860},61,[1049,3862,3863],{"class":1267},"      }",[1049,3865,1454],{"class":1273},[1049,3867,3869],{"class":1051,"line":3868},62,[1049,3870,1332],{"emptyLinePlaceholder":21},[1049,3872,3874],{"class":1051,"line":3873},63,[1049,3875,3876],{"class":1433},"      // Notify the client that a title was generated\n",[1049,3878,3880,3883,3885,3887,3889,3891,3893,3895],{"class":1051,"line":3879},64,[1049,3881,3882],{"class":1253},"      if",[1049,3884,1914],{"class":1273},[1049,3886,3321],{"class":1267},[1049,3888,256],{"class":1263},[1049,3890,1771],{"class":1267},[1049,3892,3400],{"class":1263},[1049,3894,3326],{"class":1273},[1049,3896,1268],{"class":1267},[1049,3898,3900,3903,3905,3908,3910],{"class":1051,"line":3899},65,[1049,3901,3902],{"class":1263},"        writer",[1049,3904,1771],{"class":1267},[1049,3906,3907],{"class":1072},"write",[1049,3909,1264],{"class":1273},[1049,3911,1268],{"class":1267},[1049,3913,3915,3918,3920,3922,3925,3927],{"class":1051,"line":3914},66,[1049,3916,3917],{"class":1273},"          type",[1049,3919,1277],{"class":1267},[1049,3921,1354],{"class":1267},[1049,3923,3924],{"class":1059},"data-chat-title",[1049,3926,1292],{"class":1267},[1049,3928,1295],{"class":1267},[1049,3930,3932,3935,3937,3939,3941,3943,3945,3948,3950],{"class":1051,"line":3931},67,[1049,3933,3934],{"class":1273},"          data",[1049,3936,1277],{"class":1267},[1049,3938,1673],{"class":1267},[1049,3940,2580],{"class":1273},[1049,3942,1277],{"class":1267},[1049,3944,1354],{"class":1267},[1049,3946,3947],{"class":1059},"Title generated",[1049,3949,1292],{"class":1267},[1049,3951,3952],{"class":1267}," },\n",[1049,3954,3956,3959,3961],{"class":1051,"line":3955},68,[1049,3957,3958],{"class":1273},"          transient",[1049,3960,1277],{"class":1267},[1049,3962,3963],{"class":1429}," true\n",[1049,3965,3967,3970],{"class":1051,"line":3966},69,[1049,3968,3969],{"class":1267},"        }",[1049,3971,1454],{"class":1273},[1049,3973,3975],{"class":1051,"line":3974},70,[1049,3976,3977],{"class":1267},"      }\n",[1049,3979,3981],{"class":1051,"line":3980},71,[1049,3982,1332],{"emptyLinePlaceholder":21},[1049,3984,3986,3989,3991,3994,3996,3999,4001,4004],{"class":1051,"line":3985},72,[1049,3987,3988],{"class":1263},"      writer",[1049,3990,1771],{"class":1267},[1049,3992,3993],{"class":1072},"merge",[1049,3995,1264],{"class":1273},[1049,3997,3998],{"class":1263},"result",[1049,4000,1771],{"class":1267},[1049,4002,4003],{"class":1072},"toUIMessageStream",[1049,4005,1871],{"class":1273},[1049,4007,4009],{"class":1051,"line":4008},73,[1049,4010,4011],{"class":1267},"    },\n",[1049,4013,4015,4018,4020,4022,4024,4026,4028,4030],{"class":1051,"line":4014},74,[1049,4016,4017],{"class":1072},"    onFinish",[1049,4019,1277],{"class":1267},[1049,4021,3784],{"class":1550},[1049,4023,1902],{"class":1267},[1049,4025,3119],{"class":1905},[1049,4027,1909],{"class":1267},[1049,4029,1788],{"class":1550},[1049,4031,1343],{"class":1267},[1049,4033,4035],{"class":1051,"line":4034},75,[1049,4036,4037],{"class":1433},"      // Save the assistant's response to the database\n",[1049,4039,4041,4044,4046,4048,4050,4052,4054,4056,4058,4060,4062,4064,4066,4068,4070,4073,4075,4078,4080,4082],{"class":1051,"line":4040},76,[1049,4042,4043],{"class":1253},"      await",[1049,4045,2403],{"class":1263},[1049,4047,1771],{"class":1267},[1049,4049,2674],{"class":1072},[1049,4051,1264],{"class":1273},[1049,4053,2679],{"class":1263},[1049,4055,1771],{"class":1267},[1049,4057,1959],{"class":1263},[1049,4059,1845],{"class":1273},[1049,4061,1771],{"class":1267},[1049,4063,2690],{"class":1072},[1049,4065,1264],{"class":1273},[1049,4067,1959],{"class":1263},[1049,4069,1771],{"class":1267},[1049,4071,4072],{"class":1072},"map",[1049,4074,1264],{"class":1273},[1049,4076,4077],{"class":1905},"message",[1049,4079,1788],{"class":1550},[1049,4081,1914],{"class":1273},[1049,4083,1268],{"class":1267},[1049,4085,4087,4090,4092,4094,4096,4098],{"class":1051,"line":4086},77,[1049,4088,4089],{"class":1273},"        chatId",[1049,4091,1277],{"class":1267},[1049,4093,2752],{"class":1263},[1049,4095,1771],{"class":1267},[1049,4097,1980],{"class":1263},[1049,4099,1295],{"class":1267},[1049,4101,4103,4106,4108,4110,4112,4114,4116,4118,4120,4122,4125,4127,4129,4131],{"class":1051,"line":4102},78,[1049,4104,4105],{"class":1273},"        role",[1049,4107,1277],{"class":1267},[1049,4109,2580],{"class":1263},[1049,4111,1771],{"class":1267},[1049,4113,2092],{"class":1263},[1049,4115,3296],{"class":1253},[1049,4117,1354],{"class":1267},[1049,4119,2110],{"class":1059},[1049,4121,1292],{"class":1267},[1049,4123,4124],{"class":1267}," |",[1049,4126,1354],{"class":1267},[1049,4128,2119],{"class":1059},[1049,4130,1292],{"class":1267},[1049,4132,1295],{"class":1267},[1049,4134,4136,4139,4141,4143,4145],{"class":1051,"line":4135},79,[1049,4137,4138],{"class":1273},"        parts",[1049,4140,1277],{"class":1267},[1049,4142,2580],{"class":1263},[1049,4144,1771],{"class":1267},[1049,4146,2787],{"class":1263},[1049,4148,4150,4152],{"class":1051,"line":4149},80,[1049,4151,3863],{"class":1267},[1049,4153,4154],{"class":1273},")))\n",[1049,4156,4158],{"class":1051,"line":4157},81,[1049,4159,1440],{"class":1267},[1049,4161,4163,4165],{"class":1051,"line":4162},82,[1049,4164,2376],{"class":1267},[1049,4166,1454],{"class":1273},[1049,4168,4170],{"class":1051,"line":4169},83,[1049,4171,1332],{"emptyLinePlaceholder":21},[1049,4173,4175,4177,4180,4182,4184,4186,4188],{"class":1051,"line":4174},84,[1049,4176,2802],{"class":1253},[1049,4178,4179],{"class":1072}," createUIMessageStreamResponse",[1049,4181,1264],{"class":1273},[1049,4183,1828],{"class":1267},[1049,4185,3764],{"class":1263},[1049,4187,1695],{"class":1267},[1049,4189,1454],{"class":1273},[1049,4191,4193,4195],{"class":1051,"line":4192},85,[1049,4194,1451],{"class":1267},[1049,4196,1454],{"class":1263},[949,4198,4199],{},"Here's what each part does:",[949,4201,4202],{},[967,4203,4204],{},"AI Gateway",[949,4206,4207,4208,4211],{},"Thanks to ",[1024,4209,1029],{"href":1026,"rel":4210},[1028],", we can use any AI model supported by the gateway just by specifying the model name.",[949,4213,4214],{},[967,4215,4216],{},"Automatic Title Generation",[949,4218,4219,4220,4227],{},"When a chat doesn't have a title yet, we use ",[1024,4221,4224],{"href":4222,"rel":4223},"https://ai-sdk.dev/docs/reference/ai-sdk-core/generate-text#generatetext",[1028],[1046,4225,4226],{},"generateText"," to create one based on the first message. This provides a better UX by showing meaningful titles in the chat history instead of \"Untitled\".",[949,4229,4230],{},[967,4231,4232],{},"Streaming with streamText",[949,4234,4235,4236,4241],{},"The ",[1024,4237,4239],{"href":2821,"rel":4238},[1028],[1046,4240,2825],{}," function generates a streaming response from the AI model. Key options include:",[961,4243,4244,4250,4255],{},[964,4245,4246,4249],{},[1046,4247,4248],{},"model",": The AI model to use",[964,4251,4252,4254],{},[1046,4253,2128],{},": Instructions that guide the AI's behavior",[964,4256,4257,4259],{},[1046,4258,1959],{},": The conversation history",[949,4261,4262],{},[967,4263,4264],{},"UIMessageStream",[949,4266,4235,4267,4273,4274,4280],{},[1024,4268,4271],{"href":4269,"rel":4270},"https://ai-sdk.dev/docs/reference/ai-sdk-ui/create-ui-message-stream#createuimessagestream",[1028],[1046,4272,2833],{}," and ",[1024,4275,4278],{"href":4276,"rel":4277},"https://ai-sdk.dev/docs/reference/ai-sdk-ui/create-ui-message-stream-response#createuimessagestreamresponse",[1028],[1046,4279,2841],{}," functions create a stream that the AI SDK client can consume. The response streams chunks as they're generated, creating the real-time typing effect.",[949,4282,4235,4283,4286,4287,4289,4290,4293],{},[1046,4284,4285],{},"writer.write()"," method allows sending custom data events to the client (like ",[1046,4288,3924],{},"), while ",[1046,4291,4292],{},"onFinish"," is called when streaming completes, perfect for persisting the assistant's response.",[1077,4295,4297],{"id":4296},"fetching-a-chat","Fetching a chat",[949,4299,4300],{},"Add an endpoint to fetch existing chat data from your database:",[1240,4302,4303],{},[1039,4304,4307],{"className":1244,"code":4305,"filename":4306,"language":1246,"meta":1044,"style":1044},"import { createError, defineEventHandler, getValidatedRouterParams } from 'h3'\nimport { asc, eq } from 'drizzle-orm'\nimport { db, schema } from 'hub:db'\nimport { z } from 'zod'\n\nexport default defineEventHandler(async (event) => {\n  const { id } = await getValidatedRouterParams(event, z.object({\n    id: z.string()\n  }).parse)\n\n  const chat = await db.query.chats.findFirst({\n    where: (eq(schema.chats.id, id)),\n    with: {\n      messages: {\n        orderBy: () => asc(schema.messages.createdAt)\n      }\n    }\n  })\n\n  if (!chat) {\n    throw createError({ statusCode: 404, statusMessage: 'Chat not found' })\n  }\n\n  return chat\n})\n","server/api/chats/[id].get.ts",[1046,4308,4309,4335,4358,4380,4398,4402,4424,4456,4470,4482,4486,4514,4545,4554,4563,4592,4596,4600,4606,4610,4624,4656,4660,4664,4670],{"__ignoreMap":1044},[1049,4310,4311,4313,4315,4317,4319,4321,4323,4325,4327,4329,4331,4333],{"class":1051,"line":1052},[1049,4312,1670],{"class":1253},[1049,4314,1673],{"class":1267},[1049,4316,2861],{"class":1263},[1049,4318,1679],{"class":1267},[1049,4320,2460],{"class":1263},[1049,4322,1679],{"class":1267},[1049,4324,2870],{"class":1263},[1049,4326,1695],{"class":1267},[1049,4328,1698],{"class":1253},[1049,4330,1354],{"class":1267},[1049,4332,1077],{"class":1059},[1049,4334,1318],{"class":1267},[1049,4336,4337,4339,4341,4344,4346,4348,4350,4352,4354,4356],{"class":1051,"line":1069},[1049,4338,1670],{"class":1253},[1049,4340,1673],{"class":1267},[1049,4342,4343],{"class":1263}," asc",[1049,4345,1679],{"class":1267},[1049,4347,2893],{"class":1263},[1049,4349,1695],{"class":1267},[1049,4351,1698],{"class":1253},[1049,4353,1354],{"class":1267},[1049,4355,1723],{"class":1059},[1049,4357,1318],{"class":1267},[1049,4359,4360,4362,4364,4366,4368,4370,4372,4374,4376,4378],{"class":1051,"line":1283},[1049,4361,1670],{"class":1253},[1049,4363,1673],{"class":1267},[1049,4365,2403],{"class":1263},[1049,4367,1679],{"class":1267},[1049,4369,2511],{"class":1263},[1049,4371,1695],{"class":1267},[1049,4373,1698],{"class":1253},[1049,4375,1354],{"class":1267},[1049,4377,2520],{"class":1059},[1049,4379,1318],{"class":1267},[1049,4381,4382,4384,4386,4388,4390,4392,4394,4396],{"class":1051,"line":1298},[1049,4383,1670],{"class":1253},[1049,4385,1673],{"class":1267},[1049,4387,2531],{"class":1263},[1049,4389,1695],{"class":1267},[1049,4391,1698],{"class":1253},[1049,4393,1354],{"class":1267},[1049,4395,2540],{"class":1059},[1049,4397,1318],{"class":1267},[1049,4399,4400],{"class":1051,"line":1310},[1049,4401,1332],{"emptyLinePlaceholder":21},[1049,4403,4404,4406,4408,4410,4412,4414,4416,4418,4420,4422],{"class":1051,"line":1321},[1049,4405,1254],{"class":1253},[1049,4407,1257],{"class":1253},[1049,4409,2460],{"class":1072},[1049,4411,1264],{"class":1263},[1049,4413,2559],{"class":1550},[1049,4415,1914],{"class":1267},[1049,4417,2564],{"class":1905},[1049,4419,1845],{"class":1267},[1049,4421,1788],{"class":1550},[1049,4423,1343],{"class":1267},[1049,4425,4426,4428,4430,4432,4434,4436,4438,4440,4442,4444,4446,4448,4450,4452,4454],{"class":1051,"line":1329},[1049,4427,2575],{"class":1550},[1049,4429,1673],{"class":1267},[1049,4431,3049],{"class":1263},[1049,4433,1695],{"class":1267},[1049,4435,2585],{"class":1267},[1049,4437,2588],{"class":1253},[1049,4439,2870],{"class":1072},[1049,4441,1264],{"class":1273},[1049,4443,2564],{"class":1263},[1049,4445,1679],{"class":1267},[1049,4447,2531],{"class":1263},[1049,4449,1771],{"class":1267},[1049,4451,2603],{"class":1072},[1049,4453,1264],{"class":1273},[1049,4455,1268],{"class":1267},[1049,4457,4458,4460,4462,4464,4466,4468],{"class":1051,"line":1335},[1049,4459,3078],{"class":1273},[1049,4461,1277],{"class":1267},[1049,4463,2531],{"class":1263},[1049,4465,1771],{"class":1267},[1049,4467,3087],{"class":1072},[1049,4469,2631],{"class":1273},[1049,4471,4472,4474,4476,4478,4480],{"class":1051,"line":1346},[1049,4473,2376],{"class":1267},[1049,4475,1845],{"class":1273},[1049,4477,1771],{"class":1267},[1049,4479,2642],{"class":1263},[1049,4481,1454],{"class":1273},[1049,4483,4484],{"class":1051,"line":1362},[1049,4485,1332],{"emptyLinePlaceholder":21},[1049,4487,4488,4490,4492,4494,4496,4498,4500,4502,4504,4506,4508,4510,4512],{"class":1051,"line":1368},[1049,4489,2575],{"class":1550},[1049,4491,2752],{"class":1263},[1049,4493,2585],{"class":1267},[1049,4495,2588],{"class":1253},[1049,4497,2403],{"class":1263},[1049,4499,1771],{"class":1267},[1049,4501,3245],{"class":1263},[1049,4503,1771],{"class":1267},[1049,4505,1750],{"class":1263},[1049,4507,1771],{"class":1267},[1049,4509,3254],{"class":1072},[1049,4511,1264],{"class":1273},[1049,4513,1268],{"class":1267},[1049,4515,4516,4518,4520,4522,4524,4526,4528,4530,4532,4534,4536,4538,4540,4543],{"class":1051,"line":1373},[1049,4517,3263],{"class":1273},[1049,4519,1277],{"class":1267},[1049,4521,1914],{"class":1273},[1049,4523,3556],{"class":1072},[1049,4525,1264],{"class":1273},[1049,4527,2679],{"class":1263},[1049,4529,1771],{"class":1267},[1049,4531,1750],{"class":1263},[1049,4533,1771],{"class":1267},[1049,4535,1980],{"class":1263},[1049,4537,1679],{"class":1267},[1049,4539,3049],{"class":1263},[1049,4541,4542],{"class":1273},"))",[1049,4544,1295],{"class":1267},[1049,4546,4547,4550,4552],{"class":1051,"line":1396},[1049,4548,4549],{"class":1273},"    with",[1049,4551,1277],{"class":1267},[1049,4553,1343],{"class":1267},[1049,4555,4556,4559,4561],{"class":1051,"line":1401},[1049,4557,4558],{"class":1273},"      messages",[1049,4560,1277],{"class":1267},[1049,4562,1343],{"class":1267},[1049,4564,4565,4568,4570,4573,4575,4577,4579,4581,4583,4585,4587,4590],{"class":1051,"line":1411},[1049,4566,4567],{"class":1072},"        orderBy",[1049,4569,1277],{"class":1267},[1049,4571,4572],{"class":1267}," ()",[1049,4574,1788],{"class":1550},[1049,4576,4343],{"class":1072},[1049,4578,1264],{"class":1273},[1049,4580,2679],{"class":1263},[1049,4582,1771],{"class":1267},[1049,4584,1959],{"class":1263},[1049,4586,1771],{"class":1267},[1049,4588,4589],{"class":1263},"createdAt",[1049,4591,1454],{"class":1273},[1049,4593,4594],{"class":1051,"line":1421},[1049,4595,3977],{"class":1267},[1049,4597,4598],{"class":1051,"line":1437},[1049,4599,1440],{"class":1267},[1049,4601,4602,4604],{"class":1051,"line":1443},[1049,4603,2376],{"class":1267},[1049,4605,1454],{"class":1273},[1049,4607,4608],{"class":1051,"line":1448},[1049,4609,1332],{"emptyLinePlaceholder":21},[1049,4611,4612,4614,4616,4618,4620,4622],{"class":1051,"line":2237},[1049,4613,3316],{"class":1253},[1049,4615,1914],{"class":1273},[1049,4617,3321],{"class":1267},[1049,4619,256],{"class":1263},[1049,4621,3326],{"class":1273},[1049,4623,1268],{"class":1267},[1049,4625,4626,4628,4630,4632,4634,4636,4638,4640,4642,4644,4646,4648,4650,4652,4654],{"class":1051,"line":2250},[1049,4627,3334],{"class":1253},[1049,4629,2861],{"class":1072},[1049,4631,1264],{"class":1273},[1049,4633,1828],{"class":1267},[1049,4635,3343],{"class":1273},[1049,4637,1277],{"class":1267},[1049,4639,3349],{"class":3348},[1049,4641,1679],{"class":1267},[1049,4643,3354],{"class":1273},[1049,4645,1277],{"class":1267},[1049,4647,1354],{"class":1267},[1049,4649,3361],{"class":1059},[1049,4651,1292],{"class":1267},[1049,4653,1695],{"class":1267},[1049,4655,1454],{"class":1273},[1049,4657,4658],{"class":1051,"line":2280},[1049,4659,3373],{"class":1267},[1049,4661,4662],{"class":1051,"line":2286},[1049,4663,1332],{"emptyLinePlaceholder":21},[1049,4665,4666,4668],{"class":1051,"line":2291},[1049,4667,2802],{"class":1253},[1049,4669,2805],{"class":1263},[1049,4671,4672,4674],{"class":1051,"line":2323},[1049,4673,1451],{"class":1267},[1049,4675,1454],{"class":1263},[953,4677,4679],{"id":4678},"wire-up-the-ui","Wire up the UI",[949,4681,4682,4683,4688,4689,4694],{},"Nuxt UI provides purpose-built components for AI chat interfaces: ",[1024,4684,4685],{"href":270},[1046,4686,4687],{},"UChatPrompt"," for the input area and ",[1024,4690,4691],{"href":260},[1046,4692,4693],{},"UChatMessages"," for displaying the conversation.",[1077,4696,4698],{"id":4697},"creating-the-home-page","Creating the home page",[949,4700,4701,4702,4706],{},"The home page is where users start a new conversation. The ",[1024,4703,4704],{"href":270},[1046,4705,4687],{}," component provides a textarea with auto-resize, keyboard shortcuts, and a submit button:",[1240,4708,4709],{},[1039,4710,4714],{"className":1512,"code":4711,"filename":4712,"highlights":4713,"language":34,"meta":1044,"style":1044},"\u003Cscript setup lang=\"ts\">\nconst input = ref('')\nconst loading = ref(false)\n\nasync function createChat() {\n  if (!input.value.trim()) return\n\n  loading.value = true\n\n  // Create a new chat on the server\n  const chat = await $fetch('/api/chats', {\n    method: 'POST',\n    body: {\n      message: {\n        role: 'user',\n        parts: [{ type: 'text', text: input.value }]\n      }\n    }\n  })\n\n  // Navigate to the chat page\n  navigateTo(`/chat/${chat.id}`)\n}\n\u003C/script>\n\n\u003Ctemplate>\n  \u003CUDashboardPanel :ui=\"{ body: 'p-0 sm:p-0' }\">\n    \u003Ctemplate #body>\n      \u003CUContainer class=\"min-h-dvh flex flex-col justify-center gap-6 py-8\">\n        \u003Ch1 class=\"text-3xl sm:text-4xl text-highlighted font-bold\">\n          How can I help you today?\n        \u003C/h1>\n\n        \u003CUChatPrompt\n          v-model=\"input\"\n          :status=\"loading ? 'streaming' : 'ready'\"\n          variant=\"subtle\"\n          placeholder=\"Ask me anything...\"\n          @submit=\"createChat\"\n        >\n          \u003CUChatPromptSubmit color=\"neutral\" />\n        \u003C/UChatPrompt>\n      \u003C/UContainer>\n    \u003C/template>\n  \u003C/UDashboardPanel>\n\u003C/template>\n","app/pages/index.vue",[3387,3407,3435,3451,3470,3498,3506,3511,3577],[1046,4715,4716,4739,4759,4777,4781,4795,4822,4826,4839,4843,4848,4874,4890,4899,4908,4922,4960,4964,4968,4974,4978,4983,5009,5014,5022,5026,5034,5055,5069,5090,5111,5116,5125,5129,5137,5152,5167,5182,5197,5212,5218,5241,5250,5259,5267,5275],{"__ignoreMap":1044},[1049,4717,4718,4720,4723,4726,4729,4731,4733,4735,4737],{"class":1051,"line":1052},[1049,4719,1522],{"class":1267},[1049,4721,4722],{"class":1273},"script",[1049,4724,4725],{"class":1550}," setup",[1049,4727,4728],{"class":1550}," lang",[1049,4730,1554],{"class":1267},[1049,4732,1481],{"class":1267},[1049,4734,1246],{"class":1059},[1049,4736,1481],{"class":1267},[1049,4738,1528],{"class":1267},[1049,4740,4741,4744,4747,4749,4752,4754,4757],{"class":1051,"line":1069},[1049,4742,4743],{"class":1550},"const",[1049,4745,4746],{"class":1263}," input ",[1049,4748,1554],{"class":1267},[1049,4750,4751],{"class":1072}," ref",[1049,4753,1264],{"class":1263},[1049,4755,4756],{"class":1267},"''",[1049,4758,1454],{"class":1263},[1049,4760,4761,4763,4766,4768,4770,4772,4775],{"class":1051,"line":1283},[1049,4762,4743],{"class":1550},[1049,4764,4765],{"class":1263}," loading ",[1049,4767,1554],{"class":1267},[1049,4769,4751],{"class":1072},[1049,4771,1264],{"class":1263},[1049,4773,4774],{"class":1429},"false",[1049,4776,1454],{"class":1263},[1049,4778,4779],{"class":1051,"line":1298},[1049,4780,1332],{"emptyLinePlaceholder":21},[1049,4782,4783,4785,4788,4791,4793],{"class":1051,"line":1310},[1049,4784,2559],{"class":1550},[1049,4786,4787],{"class":1550}," function",[1049,4789,4790],{"class":1072}," createChat",[1049,4792,1768],{"class":1267},[1049,4794,1343],{"class":1267},[1049,4796,4797,4799,4801,4803,4806,4808,4811,4813,4816,4819],{"class":1051,"line":1321},[1049,4798,3316],{"class":1253},[1049,4800,1914],{"class":1273},[1049,4802,3321],{"class":1267},[1049,4804,4805],{"class":1263},"input",[1049,4807,1771],{"class":1267},[1049,4809,4810],{"class":1263},"value",[1049,4812,1771],{"class":1267},[1049,4814,4815],{"class":1072},"trim",[1049,4817,4818],{"class":1273},"()) ",[1049,4820,4821],{"class":1253},"return\n",[1049,4823,4824],{"class":1051,"line":1329},[1049,4825,1332],{"emptyLinePlaceholder":21},[1049,4827,4828,4831,4833,4835,4837],{"class":1051,"line":1335},[1049,4829,4830],{"class":1263},"  loading",[1049,4832,1771],{"class":1267},[1049,4834,4810],{"class":1263},[1049,4836,2585],{"class":1267},[1049,4838,3963],{"class":1429},[1049,4840,4841],{"class":1051,"line":1346},[1049,4842,1332],{"emptyLinePlaceholder":21},[1049,4844,4845],{"class":1051,"line":1362},[1049,4846,4847],{"class":1433},"  // Create a new chat on the server\n",[1049,4849,4850,4852,4854,4856,4858,4861,4863,4865,4868,4870,4872],{"class":1051,"line":1368},[1049,4851,2575],{"class":1550},[1049,4853,2752],{"class":1263},[1049,4855,2585],{"class":1267},[1049,4857,2588],{"class":1253},[1049,4859,4860],{"class":1072}," $fetch",[1049,4862,1264],{"class":1273},[1049,4864,1292],{"class":1267},[1049,4866,4867],{"class":1059},"/api/chats",[1049,4869,1292],{"class":1267},[1049,4871,1679],{"class":1267},[1049,4873,1343],{"class":1267},[1049,4875,4876,4879,4881,4883,4886,4888],{"class":1051,"line":1373},[1049,4877,4878],{"class":1273},"    method",[1049,4880,1277],{"class":1267},[1049,4882,1354],{"class":1267},[1049,4884,4885],{"class":1059},"POST",[1049,4887,1292],{"class":1267},[1049,4889,1295],{"class":1267},[1049,4891,4892,4895,4897],{"class":1051,"line":1396},[1049,4893,4894],{"class":1273},"    body",[1049,4896,1277],{"class":1267},[1049,4898,1343],{"class":1267},[1049,4900,4901,4904,4906],{"class":1051,"line":1401},[1049,4902,4903],{"class":1273},"      message",[1049,4905,1277],{"class":1267},[1049,4907,1343],{"class":1267},[1049,4909,4910,4912,4914,4916,4918,4920],{"class":1051,"line":1411},[1049,4911,4105],{"class":1273},[1049,4913,1277],{"class":1267},[1049,4915,1354],{"class":1267},[1049,4917,2110],{"class":1059},[1049,4919,1292],{"class":1267},[1049,4921,1295],{"class":1267},[1049,4923,4924,4926,4928,4930,4932,4934,4936,4938,4941,4943,4945,4947,4949,4952,4954,4956,4958],{"class":1051,"line":1421},[1049,4925,4138],{"class":1273},[1049,4927,1277],{"class":1267},[1049,4929,1381],{"class":1273},[1049,4931,1828],{"class":1267},[1049,4933,2482],{"class":1273},[1049,4935,1277],{"class":1267},[1049,4937,1354],{"class":1267},[1049,4939,4940],{"class":1059},"text",[1049,4942,1292],{"class":1267},[1049,4944,1679],{"class":1267},[1049,4946,1682],{"class":1273},[1049,4948,1277],{"class":1267},[1049,4950,4951],{"class":1263}," input",[1049,4953,1771],{"class":1267},[1049,4955,4810],{"class":1263},[1049,4957,1695],{"class":1267},[1049,4959,3620],{"class":1273},[1049,4961,4962],{"class":1051,"line":1437},[1049,4963,3977],{"class":1267},[1049,4965,4966],{"class":1051,"line":1443},[1049,4967,1440],{"class":1267},[1049,4969,4970,4972],{"class":1051,"line":1448},[1049,4971,2376],{"class":1267},[1049,4973,1454],{"class":1273},[1049,4975,4976],{"class":1051,"line":2237},[1049,4977,1332],{"emptyLinePlaceholder":21},[1049,4979,4980],{"class":1051,"line":2250},[1049,4981,4982],{"class":1433},"  // Navigate to the chat page\n",[1049,4984,4985,4988,4990,4992,4995,4998,5000,5002,5004,5007],{"class":1051,"line":2280},[1049,4986,4987],{"class":1072},"  navigateTo",[1049,4989,1264],{"class":1273},[1049,4991,3465],{"class":1267},[1049,4993,4994],{"class":1059},"/chat/",[1049,4996,4997],{"class":1267},"${",[1049,4999,256],{"class":1263},[1049,5001,1771],{"class":1267},[1049,5003,1980],{"class":1263},[1049,5005,5006],{"class":1267},"}`",[1049,5008,1454],{"class":1273},[1049,5010,5011],{"class":1051,"line":2286},[1049,5012,5013],{"class":1267},"}\n",[1049,5015,5016,5018,5020],{"class":1051,"line":2291},[1049,5017,1598],{"class":1267},[1049,5019,4722],{"class":1273},[1049,5021,1528],{"class":1267},[1049,5023,5024],{"class":1051,"line":2323},[1049,5025,1332],{"emptyLinePlaceholder":21},[1049,5027,5028,5030,5032],{"class":1051,"line":2339},[1049,5029,1522],{"class":1267},[1049,5031,1525],{"class":1273},[1049,5033,1528],{"class":1267},[1049,5035,5036,5038,5041,5044,5046,5048,5051,5053],{"class":1051,"line":2357},[1049,5037,1535],{"class":1267},[1049,5039,5040],{"class":1273},"UDashboardPanel",[1049,5042,5043],{"class":1550}," :ui",[1049,5045,1554],{"class":1267},[1049,5047,1481],{"class":1267},[1049,5049,5050],{"class":1059},"{ body: 'p-0 sm:p-0' }",[1049,5052,1481],{"class":1267},[1049,5054,1528],{"class":1267},[1049,5056,5057,5059,5061,5064,5067],{"class":1051,"line":2373},[1049,5058,1544],{"class":1267},[1049,5060,1525],{"class":1273},[1049,5062,5063],{"class":1267}," #",[1049,5065,5066],{"class":1550},"body",[1049,5068,1528],{"class":1267},[1049,5070,5071,5073,5076,5079,5081,5083,5086,5088],{"class":1051,"line":2381},[1049,5072,1568],{"class":1267},[1049,5074,5075],{"class":1273},"UContainer",[1049,5077,5078],{"class":1550}," class",[1049,5080,1554],{"class":1267},[1049,5082,1481],{"class":1267},[1049,5084,5085],{"class":1059},"min-h-dvh flex flex-col justify-center gap-6 py-8",[1049,5087,1481],{"class":1267},[1049,5089,1528],{"class":1267},[1049,5091,5092,5095,5098,5100,5102,5104,5107,5109],{"class":1051,"line":3331},[1049,5093,5094],{"class":1267},"        \u003C",[1049,5096,5097],{"class":1273},"h1",[1049,5099,5078],{"class":1550},[1049,5101,1554],{"class":1267},[1049,5103,1481],{"class":1267},[1049,5105,5106],{"class":1059},"text-3xl sm:text-4xl text-highlighted font-bold",[1049,5108,1481],{"class":1267},[1049,5110,1528],{"class":1267},[1049,5112,5113],{"class":1051,"line":3370},[1049,5114,5115],{"class":1263},"          How can I help you today?\n",[1049,5117,5118,5121,5123],{"class":1051,"line":3376},[1049,5119,5120],{"class":1267},"        \u003C/",[1049,5122,5097],{"class":1273},[1049,5124,1528],{"class":1267},[1049,5126,5127],{"class":1051,"line":3381},[1049,5128,1332],{"emptyLinePlaceholder":21},[1049,5130,5132,5134],{"class":5131,"line":3387},[1051,1532],[1049,5133,5094],{"class":1267},[1049,5135,5136],{"class":1273},"UChatPrompt\n",[1049,5138,5140,5143,5145,5147,5149],{"class":5139,"line":3407},[1051,1532],[1049,5141,5142],{"class":1550},"          v-model",[1049,5144,1554],{"class":1267},[1049,5146,1481],{"class":1267},[1049,5148,4805],{"class":1059},[1049,5150,5151],{"class":1267},"\"\n",[1049,5153,5155,5158,5160,5162,5165],{"class":5154,"line":3435},[1051,1532],[1049,5156,5157],{"class":1550},"          :status",[1049,5159,1554],{"class":1267},[1049,5161,1481],{"class":1267},[1049,5163,5164],{"class":1059},"loading ? 'streaming' : 'ready'",[1049,5166,5151],{"class":1267},[1049,5168,5170,5173,5175,5177,5180],{"class":5169,"line":3451},[1051,1532],[1049,5171,5172],{"class":1550},"          variant",[1049,5174,1554],{"class":1267},[1049,5176,1481],{"class":1267},[1049,5178,5179],{"class":1059},"subtle",[1049,5181,5151],{"class":1267},[1049,5183,5185,5188,5190,5192,5195],{"class":5184,"line":3470},[1051,1532],[1049,5186,5187],{"class":1550},"          placeholder",[1049,5189,1554],{"class":1267},[1049,5191,1481],{"class":1267},[1049,5193,5194],{"class":1059},"Ask me anything...",[1049,5196,5151],{"class":1267},[1049,5198,5200,5203,5205,5207,5210],{"class":5199,"line":3498},[1051,1532],[1049,5201,5202],{"class":1550},"          @submit",[1049,5204,1554],{"class":1267},[1049,5206,1481],{"class":1267},[1049,5208,5209],{"class":1059},"createChat",[1049,5211,5151],{"class":1267},[1049,5213,5215],{"class":5214,"line":3506},[1051,1532],[1049,5216,5217],{"class":1267},"        >\n",[1049,5219,5221,5224,5227,5230,5232,5234,5237,5239],{"class":5220,"line":3511},[1051,1532],[1049,5222,5223],{"class":1267},"          \u003C",[1049,5225,5226],{"class":1273},"UChatPromptSubmit",[1049,5228,5229],{"class":1550}," color",[1049,5231,1554],{"class":1267},[1049,5233,1481],{"class":1267},[1049,5235,5236],{"class":1059},"neutral",[1049,5238,1481],{"class":1267},[1049,5240,1574],{"class":1267},[1049,5242,5244,5246,5248],{"class":5243,"line":3577},[1051,1532],[1049,5245,5120],{"class":1267},[1049,5247,4687],{"class":1273},[1049,5249,1528],{"class":1267},[1049,5251,5252,5255,5257],{"class":1051,"line":3582},[1049,5253,5254],{"class":1267},"      \u003C/",[1049,5256,5075],{"class":1273},[1049,5258,1528],{"class":1267},[1049,5260,5261,5263,5265],{"class":1051,"line":3587},[1049,5262,1579],{"class":1267},[1049,5264,1525],{"class":1273},[1049,5266,1528],{"class":1267},[1049,5268,5269,5271,5273],{"class":1051,"line":3593},[1049,5270,1589],{"class":1267},[1049,5272,5040],{"class":1273},[1049,5274,1528],{"class":1267},[1049,5276,5277,5279,5281],{"class":1051,"line":3623},[1049,5278,1598],{"class":1267},[1049,5280,1525],{"class":1273},[1049,5282,1528],{"class":1267},[949,5284,4235,5285,5289],{},[1024,5286,5287],{"href":270},[1046,5288,4687],{}," component automatically handles:",[961,5291,5292,5299,5302,5312],{},[964,5293,5294,5295],{},"Form submission when pressing ",[5296,5297],"kbd",{"value":5298},"enter",[964,5300,5301],{},"Auto-resizing as you type",[964,5303,5304,5305,5308,5309],{},"A loading state when ",[1046,5306,5307],{},"status"," is set to ",[1046,5310,5311],{},"streaming",[964,5313,5314],{},"Focus management and keyboard shortcuts",[953,5316,5318],{"id":5317},"creating-the-chat-page","Creating the chat page",[949,5320,5321,5322,5329,5330,5337],{},"The chat page is where the actual conversation happens. It integrates the AI SDK's ",[1024,5323,5326],{"href":5324,"rel":5325},"https://ai-sdk.dev/docs/reference/ai-sdk-ui/chat",[1028],[1046,5327,5328],{},"Chat"," class and ",[1024,5331,5334],{"href":5332,"rel":5333},"https://ai-sdk.dev/docs/reference/ai-sdk-ui/default-chat-transport",[1028],[1046,5335,5336],{},"DefaultChatTransport"," for real-time streaming.",[1240,5339,5340],{},[1658,5341,5342],{},[1039,5343,5347],{"className":1512,"code":5344,"filename":5345,"highlights":5346,"language":34,"meta":1044,"style":1044},"\u003Cscript setup lang=\"ts\">\nimport { DefaultChatTransport } from 'ai'\nimport { Chat } from '@ai-sdk/vue'\n\nconst route = useRoute()\nconst toast = useToast()\n\n// Fetch existing chat data\nconst { data: chatData } = await useFetch(`/api/chats/${route.params.id}`)\n\nif (!chatData.value) {\n  throw createError({ statusCode: 404, statusMessage: 'Chat not found', fatal: true })\n}\n\nconst input = ref('')\n\n// Initialize the Chat class from AI SDK\nconst chat = new Chat({\n  id: chatData.value.id,\n  messages: chatData.value.messages,\n  transport: new DefaultChatTransport({\n    api: `/api/chats/${chatData.value.id}`\n  }),\n  onData(dataPart) {\n    // Refresh the chat list when a title is generated\n    if (dataPart.type === 'data-chat-title') {\n      refreshNuxtData('chats')\n    }\n  },\n  onError(error) {\n    toast.add({\n      title: 'Error',\n      description: error.message,\n      color: 'error'\n    })\n  }\n})\n\nfunction handleSubmit(e: Event) {\n  e.preventDefault()\n  if (input.value.trim()) {\n    chat.sendMessage({ text: input.value })\n    input.value = ''\n  }\n}\n\n// Auto-generate response for first message\nonMounted(() => {\n  if (chatData.value?.messages.length === 1) {\n    chat.regenerate()\n  }\n})\n\u003C/script>\n\n\u003Ctemplate>\n  \u003CUDashboardPanel :ui=\"{ body: 'p-0 sm:p-0' }\">\n    \u003Ctemplate #body>\n      \u003CUContainer class=\"min-h-dvh flex flex-col py-4 sm:py-6\">\n        \u003CUChatMessages\n          :messages=\"chat.messages\"\n          :status=\"chat.status\"\n          should-auto-scroll\n          class=\"flex-1\"\n        >\n          \u003Ctemplate #content=\"{ message }\">\n            \u003Ctemplate v-for=\"(part, index) in message.parts\" :key=\"`${message.id}-${part.type}-${index}`\">\n              \u003CMDC v-if=\"part.type === 'text' && message.role === 'assistant'\" :value=\"part.text\" :cache-key=\"`${message.id}-${index}`\" class=\"*:first:mt-0 *:last:mb-0\" />\n              \u003Cp v-else-if=\"part.type === 'text' && message.role === 'user'\" class=\"whitespace-pre-wrap\">{{ part.text }}\u003C/p>\n            \u003C/template>\n          \u003C/template>\n        \u003C/UChatMessages>\n\n        \u003CUChatPrompt\n          v-model=\"input\"\n          :error=\"chat.error\"\n          variant=\"subtle\"\n          class=\"sticky bottom-0\"\n          @submit=\"handleSubmit\"\n        >\n          \u003CUChatPromptSubmit\n            :status=\"chat.status\"\n            color=\"neutral\"\n            @stop=\"chat.stop()\"\n            @reload=\"chat.regenerate()\"\n          />\n        \u003C/UChatPrompt>\n      \u003C/UContainer>\n    \u003C/template>\n  \u003C/UDashboardPanel>\n\u003C/template>\n","app/pages/chat/[id].vue",[1069,1283,1298,1448,2237,2250,2280,2286,2291,2323,2339,2357,2373,2381,3331,3370,3376,3381,3387,3407,3435,3451,3470],[1046,5348,5349,5369,5389,5410,5415,5429,5443,5447,5452,5500,5504,5523,5566,5570,5574,5590,5594,5599,5616,5636,5655,5671,5698,5707,5722,5728,5755,5771,5776,5781,5796,5811,5827,5844,5858,5865,5870,5877,5882,5904,5916,5936,5964,5978,5982,5986,5990,5995,6008,6036,6047,6051,6057,6065,6069,6077,6095,6107,6126,6133,6147,6160,6165,6179,6183,6208,6286,6343,6383,6392,6401,6409,6413,6419,6431,6445,6457,6470,6483,6487,6494,6507,6520,6534,6548,6553,6562,6571,6580,6589],{"__ignoreMap":1044},[1049,5350,5351,5353,5355,5357,5359,5361,5363,5365,5367],{"class":1051,"line":1052},[1049,5352,1522],{"class":1267},[1049,5354,4722],{"class":1273},[1049,5356,4725],{"class":1550},[1049,5358,4728],{"class":1550},[1049,5360,1554],{"class":1267},[1049,5362,1481],{"class":1267},[1049,5364,1246],{"class":1059},[1049,5366,1481],{"class":1267},[1049,5368,1528],{"class":1267},[1049,5370,5372,5374,5376,5379,5381,5383,5385,5387],{"class":5371,"line":1069},[1051,1532],[1049,5373,1670],{"class":1253},[1049,5375,1673],{"class":1267},[1049,5377,5378],{"class":1263}," DefaultChatTransport",[1049,5380,1695],{"class":1267},[1049,5382,1698],{"class":1253},[1049,5384,1354],{"class":1267},[1049,5386,2496],{"class":1059},[1049,5388,1318],{"class":1267},[1049,5390,5392,5394,5396,5399,5401,5403,5405,5408],{"class":5391,"line":1283},[1051,1532],[1049,5393,1670],{"class":1253},[1049,5395,1673],{"class":1267},[1049,5397,5398],{"class":1263}," Chat",[1049,5400,1695],{"class":1267},[1049,5402,1698],{"class":1253},[1049,5404,1354],{"class":1267},[1049,5406,5407],{"class":1059},"@ai-sdk/vue",[1049,5409,1318],{"class":1267},[1049,5411,5413],{"class":5412,"line":1298},[1051,1532],[1049,5414,1332],{"emptyLinePlaceholder":21},[1049,5416,5417,5419,5422,5424,5427],{"class":1051,"line":1310},[1049,5418,4743],{"class":1550},[1049,5420,5421],{"class":1263}," route ",[1049,5423,1554],{"class":1267},[1049,5425,5426],{"class":1072}," useRoute",[1049,5428,2631],{"class":1263},[1049,5430,5431,5433,5436,5438,5441],{"class":1051,"line":1321},[1049,5432,4743],{"class":1550},[1049,5434,5435],{"class":1263}," toast ",[1049,5437,1554],{"class":1267},[1049,5439,5440],{"class":1072}," useToast",[1049,5442,2631],{"class":1263},[1049,5444,5445],{"class":1051,"line":1329},[1049,5446,1332],{"emptyLinePlaceholder":21},[1049,5448,5449],{"class":1051,"line":1335},[1049,5450,5451],{"class":1433},"// Fetch existing chat data\n",[1049,5453,5454,5456,5458,5461,5463,5466,5468,5470,5472,5475,5477,5479,5482,5484,5487,5489,5492,5494,5496,5498],{"class":1051,"line":1346},[1049,5455,4743],{"class":1550},[1049,5457,1673],{"class":1267},[1049,5459,5460],{"class":1273}," data",[1049,5462,1277],{"class":1267},[1049,5464,5465],{"class":1263}," chatData ",[1049,5467,1451],{"class":1267},[1049,5469,2585],{"class":1267},[1049,5471,2588],{"class":1253},[1049,5473,5474],{"class":1072}," useFetch",[1049,5476,1264],{"class":1263},[1049,5478,3465],{"class":1267},[1049,5480,5481],{"class":1059},"/api/chats/",[1049,5483,4997],{"class":1267},[1049,5485,5486],{"class":1263},"route",[1049,5488,1771],{"class":1267},[1049,5490,5491],{"class":1263},"params",[1049,5493,1771],{"class":1267},[1049,5495,1980],{"class":1263},[1049,5497,5006],{"class":1267},[1049,5499,1454],{"class":1263},[1049,5501,5502],{"class":1051,"line":1362},[1049,5503,1332],{"emptyLinePlaceholder":21},[1049,5505,5506,5509,5511,5513,5516,5518,5521],{"class":1051,"line":1368},[1049,5507,5508],{"class":1253},"if",[1049,5510,1914],{"class":1263},[1049,5512,3321],{"class":1267},[1049,5514,5515],{"class":1263},"chatData",[1049,5517,1771],{"class":1267},[1049,5519,5520],{"class":1263},"value) ",[1049,5522,1268],{"class":1267},[1049,5524,5525,5528,5530,5532,5534,5536,5538,5540,5542,5544,5546,5548,5550,5552,5554,5557,5559,5562,5564],{"class":1051,"line":1373},[1049,5526,5527],{"class":1253},"  throw",[1049,5529,2861],{"class":1072},[1049,5531,1264],{"class":1273},[1049,5533,1828],{"class":1267},[1049,5535,3343],{"class":1273},[1049,5537,1277],{"class":1267},[1049,5539,3349],{"class":3348},[1049,5541,1679],{"class":1267},[1049,5543,3354],{"class":1273},[1049,5545,1277],{"class":1267},[1049,5547,1354],{"class":1267},[1049,5549,3361],{"class":1059},[1049,5551,1292],{"class":1267},[1049,5553,1679],{"class":1267},[1049,5555,5556],{"class":1273}," fatal",[1049,5558,1277],{"class":1267},[1049,5560,5561],{"class":1429}," true",[1049,5563,1695],{"class":1267},[1049,5565,1454],{"class":1273},[1049,5567,5568],{"class":1051,"line":1396},[1049,5569,5013],{"class":1267},[1049,5571,5572],{"class":1051,"line":1401},[1049,5573,1332],{"emptyLinePlaceholder":21},[1049,5575,5576,5578,5580,5582,5584,5586,5588],{"class":1051,"line":1411},[1049,5577,4743],{"class":1550},[1049,5579,4746],{"class":1263},[1049,5581,1554],{"class":1267},[1049,5583,4751],{"class":1072},[1049,5585,1264],{"class":1263},[1049,5587,4756],{"class":1267},[1049,5589,1454],{"class":1263},[1049,5591,5592],{"class":1051,"line":1421},[1049,5593,1332],{"emptyLinePlaceholder":21},[1049,5595,5596],{"class":1051,"line":1437},[1049,5597,5598],{"class":1433},"// Initialize the Chat class from AI SDK\n",[1049,5600,5601,5603,5606,5608,5610,5612,5614],{"class":1051,"line":1443},[1049,5602,4743],{"class":1550},[1049,5604,5605],{"class":1263}," chat ",[1049,5607,1554],{"class":1267},[1049,5609,1865],{"class":1267},[1049,5611,5398],{"class":1072},[1049,5613,1264],{"class":1263},[1049,5615,1268],{"class":1267},[1049,5617,5619,5621,5623,5626,5628,5630,5632,5634],{"class":5618,"line":1448},[1051,1532],[1049,5620,1761],{"class":1273},[1049,5622,1277],{"class":1267},[1049,5624,5625],{"class":1263}," chatData",[1049,5627,1771],{"class":1267},[1049,5629,4810],{"class":1263},[1049,5631,1771],{"class":1267},[1049,5633,1980],{"class":1263},[1049,5635,1295],{"class":1267},[1049,5637,5639,5641,5643,5645,5647,5649,5651,5653],{"class":5638,"line":2237},[1051,1532],[1049,5640,1921],{"class":1273},[1049,5642,1277],{"class":1267},[1049,5644,5625],{"class":1263},[1049,5646,1771],{"class":1267},[1049,5648,4810],{"class":1263},[1049,5650,1771],{"class":1267},[1049,5652,1959],{"class":1263},[1049,5654,1295],{"class":1267},[1049,5656,5658,5661,5663,5665,5667,5669],{"class":5657,"line":2250},[1051,1532],[1049,5659,5660],{"class":1273},"  transport",[1049,5662,1277],{"class":1267},[1049,5664,1865],{"class":1267},[1049,5666,5378],{"class":1072},[1049,5668,1264],{"class":1263},[1049,5670,1268],{"class":1267},[1049,5672,5674,5677,5679,5681,5683,5685,5687,5689,5691,5693,5695],{"class":5673,"line":2280},[1051,1532],[1049,5675,5676],{"class":1273},"    api",[1049,5678,1277],{"class":1267},[1049,5680,3459],{"class":1267},[1049,5682,5481],{"class":1059},[1049,5684,4997],{"class":1267},[1049,5686,5515],{"class":1263},[1049,5688,1771],{"class":1267},[1049,5690,4810],{"class":1263},[1049,5692,1771],{"class":1267},[1049,5694,1980],{"class":1263},[1049,5696,5697],{"class":1267},"}`\n",[1049,5699,5701,5703,5705],{"class":5700,"line":2286},[1051,1532],[1049,5702,2376],{"class":1267},[1049,5704,1845],{"class":1263},[1049,5706,1295],{"class":1267},[1049,5708,5710,5713,5715,5718,5720],{"class":5709,"line":2291},[1051,1532],[1049,5711,5712],{"class":1273},"  onData",[1049,5714,1264],{"class":1267},[1049,5716,5717],{"class":1905},"dataPart",[1049,5719,1845],{"class":1267},[1049,5721,1343],{"class":1267},[1049,5723,5725],{"class":5724,"line":2323},[1051,1532],[1049,5726,5727],{"class":1433},"    // Refresh the chat list when a title is generated\n",[1049,5729,5731,5734,5736,5738,5740,5743,5745,5747,5749,5751,5753],{"class":5730,"line":2339},[1051,1532],[1049,5732,5733],{"class":1253},"    if",[1049,5735,1914],{"class":1273},[1049,5737,5717],{"class":1263},[1049,5739,1771],{"class":1267},[1049,5741,5742],{"class":1263},"type",[1049,5744,3638],{"class":1267},[1049,5746,1354],{"class":1267},[1049,5748,3924],{"class":1059},[1049,5750,1292],{"class":1267},[1049,5752,3326],{"class":1273},[1049,5754,1268],{"class":1267},[1049,5756,5758,5761,5763,5765,5767,5769],{"class":5757,"line":2357},[1051,1532],[1049,5759,5760],{"class":1072},"      refreshNuxtData",[1049,5762,1264],{"class":1273},[1049,5764,1292],{"class":1267},[1049,5766,1750],{"class":1059},[1049,5768,1292],{"class":1267},[1049,5770,1454],{"class":1273},[1049,5772,5774],{"class":5773,"line":2373},[1051,1532],[1049,5775,1440],{"class":1267},[1049,5777,5779],{"class":5778,"line":2381},[1051,1532],[1049,5780,1365],{"class":1267},[1049,5782,5784,5787,5789,5792,5794],{"class":5783,"line":3331},[1051,1532],[1049,5785,5786],{"class":1273},"  onError",[1049,5788,1264],{"class":1267},[1049,5790,5791],{"class":1905},"error",[1049,5793,1845],{"class":1267},[1049,5795,1343],{"class":1267},[1049,5797,5799,5802,5804,5807,5809],{"class":5798,"line":3370},[1051,1532],[1049,5800,5801],{"class":1263},"    toast",[1049,5803,1771],{"class":1267},[1049,5805,5806],{"class":1072},"add",[1049,5808,1264],{"class":1273},[1049,5810,1268],{"class":1267},[1049,5812,5814,5817,5819,5821,5823,5825],{"class":5813,"line":3376},[1051,1532],[1049,5815,5816],{"class":1273},"      title",[1049,5818,1277],{"class":1267},[1049,5820,1354],{"class":1267},[1049,5822,471],{"class":1059},[1049,5824,1292],{"class":1267},[1049,5826,1295],{"class":1267},[1049,5828,5830,5833,5835,5838,5840,5842],{"class":5829,"line":3381},[1051,1532],[1049,5831,5832],{"class":1273},"      description",[1049,5834,1277],{"class":1267},[1049,5836,5837],{"class":1263}," error",[1049,5839,1771],{"class":1267},[1049,5841,4077],{"class":1263},[1049,5843,1295],{"class":1267},[1049,5845,5847,5850,5852,5854,5856],{"class":5846,"line":3387},[1051,1532],[1049,5848,5849],{"class":1273},"      color",[1049,5851,1277],{"class":1267},[1049,5853,1354],{"class":1267},[1049,5855,5791],{"class":1059},[1049,5857,1318],{"class":1267},[1049,5859,5861,5863],{"class":5860,"line":3407},[1051,1532],[1049,5862,3501],{"class":1267},[1049,5864,1454],{"class":1273},[1049,5866,5868],{"class":5867,"line":3435},[1051,1532],[1049,5869,3373],{"class":1267},[1049,5871,5873,5875],{"class":5872,"line":3451},[1051,1532],[1049,5874,1451],{"class":1267},[1049,5876,1454],{"class":1263},[1049,5878,5880],{"class":5879,"line":3470},[1051,1532],[1049,5881,1332],{"emptyLinePlaceholder":21},[1049,5883,5884,5887,5890,5892,5895,5897,5900,5902],{"class":1051,"line":3498},[1049,5885,5886],{"class":1550},"function",[1049,5888,5889],{"class":1072}," handleSubmit",[1049,5891,1264],{"class":1267},[1049,5893,5894],{"class":1905},"e",[1049,5896,1277],{"class":1267},[1049,5898,5899],{"class":1055}," Event",[1049,5901,1845],{"class":1267},[1049,5903,1343],{"class":1267},[1049,5905,5906,5909,5911,5914],{"class":1051,"line":3506},[1049,5907,5908],{"class":1263},"  e",[1049,5910,1771],{"class":1267},[1049,5912,5913],{"class":1072},"preventDefault",[1049,5915,2631],{"class":1273},[1049,5917,5918,5920,5922,5924,5926,5928,5930,5932,5934],{"class":1051,"line":3511},[1049,5919,3316],{"class":1253},[1049,5921,1914],{"class":1273},[1049,5923,4805],{"class":1263},[1049,5925,1771],{"class":1267},[1049,5927,4810],{"class":1263},[1049,5929,1771],{"class":1267},[1049,5931,4815],{"class":1072},[1049,5933,4818],{"class":1273},[1049,5935,1268],{"class":1267},[1049,5937,5938,5941,5943,5946,5948,5950,5952,5954,5956,5958,5960,5962],{"class":1051,"line":3577},[1049,5939,5940],{"class":1263},"    chat",[1049,5942,1771],{"class":1267},[1049,5944,5945],{"class":1072},"sendMessage",[1049,5947,1264],{"class":1273},[1049,5949,1828],{"class":1267},[1049,5951,1682],{"class":1273},[1049,5953,1277],{"class":1267},[1049,5955,4951],{"class":1263},[1049,5957,1771],{"class":1267},[1049,5959,4810],{"class":1263},[1049,5961,1695],{"class":1267},[1049,5963,1454],{"class":1273},[1049,5965,5966,5969,5971,5973,5975],{"class":1051,"line":3582},[1049,5967,5968],{"class":1263},"    input",[1049,5970,1771],{"class":1267},[1049,5972,4810],{"class":1263},[1049,5974,2585],{"class":1267},[1049,5976,5977],{"class":1267}," ''\n",[1049,5979,5980],{"class":1051,"line":3587},[1049,5981,3373],{"class":1267},[1049,5983,5984],{"class":1051,"line":3593},[1049,5985,5013],{"class":1267},[1049,5987,5988],{"class":1051,"line":3623},[1049,5989,1332],{"emptyLinePlaceholder":21},[1049,5991,5992],{"class":1051,"line":3665},[1049,5993,5994],{"class":1433},"// Auto-generate response for first message\n",[1049,5996,5997,6000,6002,6004,6006],{"class":1051,"line":3694},[1049,5998,5999],{"class":1072},"onMounted",[1049,6001,1264],{"class":1263},[1049,6003,1768],{"class":1267},[1049,6005,1788],{"class":1550},[1049,6007,1343],{"class":1267},[1049,6009,6010,6012,6014,6016,6018,6020,6022,6024,6026,6028,6030,6032,6034],{"class":1051,"line":3706},[1049,6011,3316],{"class":1253},[1049,6013,1914],{"class":1273},[1049,6015,5515],{"class":1263},[1049,6017,1771],{"class":1267},[1049,6019,4810],{"class":1263},[1049,6021,3633],{"class":1267},[1049,6023,1959],{"class":1263},[1049,6025,1771],{"class":1267},[1049,6027,3611],{"class":1263},[1049,6029,3638],{"class":1267},[1049,6031,3617],{"class":3348},[1049,6033,3326],{"class":1273},[1049,6035,1268],{"class":1267},[1049,6037,6038,6040,6042,6045],{"class":1051,"line":3722},[1049,6039,5940],{"class":1263},[1049,6041,1771],{"class":1267},[1049,6043,6044],{"class":1072},"regenerate",[1049,6046,2631],{"class":1273},[1049,6048,6049],{"class":1051,"line":3736},[1049,6050,3373],{"class":1267},[1049,6052,6053,6055],{"class":1051,"line":3743},[1049,6054,1451],{"class":1267},[1049,6056,1454],{"class":1263},[1049,6058,6059,6061,6063],{"class":1051,"line":3748},[1049,6060,1598],{"class":1267},[1049,6062,4722],{"class":1273},[1049,6064,1528],{"class":1267},[1049,6066,6067],{"class":1051,"line":3753},[1049,6068,1332],{"emptyLinePlaceholder":21},[1049,6070,6071,6073,6075],{"class":1051,"line":3759},[1049,6072,1522],{"class":1267},[1049,6074,1525],{"class":1273},[1049,6076,1528],{"class":1267},[1049,6078,6079,6081,6083,6085,6087,6089,6091,6093],{"class":1051,"line":3776},[1049,6080,1535],{"class":1267},[1049,6082,5040],{"class":1273},[1049,6084,5043],{"class":1550},[1049,6086,1554],{"class":1267},[1049,6088,1481],{"class":1267},[1049,6090,5050],{"class":1059},[1049,6092,1481],{"class":1267},[1049,6094,1528],{"class":1267},[1049,6096,6097,6099,6101,6103,6105],{"class":1051,"line":3798},[1049,6098,1544],{"class":1267},[1049,6100,1525],{"class":1273},[1049,6102,5063],{"class":1267},[1049,6104,5066],{"class":1550},[1049,6106,1528],{"class":1267},[1049,6108,6109,6111,6113,6115,6117,6119,6122,6124],{"class":1051,"line":3816},[1049,6110,1568],{"class":1267},[1049,6112,5075],{"class":1273},[1049,6114,5078],{"class":1550},[1049,6116,1554],{"class":1267},[1049,6118,1481],{"class":1267},[1049,6120,6121],{"class":1059},"min-h-dvh flex flex-col py-4 sm:py-6",[1049,6123,1481],{"class":1267},[1049,6125,1528],{"class":1267},[1049,6127,6128,6130],{"class":1051,"line":3824},[1049,6129,5094],{"class":1267},[1049,6131,6132],{"class":1273},"UChatMessages\n",[1049,6134,6135,6138,6140,6142,6145],{"class":1051,"line":3841},[1049,6136,6137],{"class":1550},"          :messages",[1049,6139,1554],{"class":1267},[1049,6141,1481],{"class":1267},[1049,6143,6144],{"class":1059},"chat.messages",[1049,6146,5151],{"class":1267},[1049,6148,6149,6151,6153,6155,6158],{"class":1051,"line":3860},[1049,6150,5157],{"class":1550},[1049,6152,1554],{"class":1267},[1049,6154,1481],{"class":1267},[1049,6156,6157],{"class":1059},"chat.status",[1049,6159,5151],{"class":1267},[1049,6161,6162],{"class":1051,"line":3868},[1049,6163,6164],{"class":1550},"          should-auto-scroll\n",[1049,6166,6167,6170,6172,6174,6177],{"class":1051,"line":3873},[1049,6168,6169],{"class":1550},"          class",[1049,6171,1554],{"class":1267},[1049,6173,1481],{"class":1267},[1049,6175,6176],{"class":1059},"flex-1",[1049,6178,5151],{"class":1267},[1049,6180,6181],{"class":1051,"line":3879},[1049,6182,5217],{"class":1267},[1049,6184,6185,6187,6189,6191,6193,6195,6197,6199,6202,6204,6206],{"class":1051,"line":3899},[1049,6186,5223],{"class":1267},[1049,6188,1525],{"class":1273},[1049,6190,5063],{"class":1267},[1049,6192,344],{"class":1550},[1049,6194,1554],{"class":1267},[1049,6196,1481],{"class":1267},[1049,6198,1828],{"class":1267},[1049,6200,6201],{"class":1263}," message ",[1049,6203,1451],{"class":1267},[1049,6205,1481],{"class":1267},[1049,6207,1528],{"class":1267},[1049,6209,6210,6213,6215,6218,6220,6222,6225,6227,6230,6233,6235,6237,6239,6241,6244,6247,6249,6252,6254,6256,6258,6260,6263,6265,6268,6270,6272,6274,6276,6278,6281,6284],{"class":1051,"line":3914},[1049,6211,6212],{"class":1267},"            \u003C",[1049,6214,1525],{"class":1273},[1049,6216,6217],{"class":1253}," v-for",[1049,6219,1554],{"class":1267},[1049,6221,1481],{"class":1267},[1049,6223,6224],{"class":1263},"(part",[1049,6226,1679],{"class":1267},[1049,6228,6229],{"class":1263}," index) ",[1049,6231,6232],{"class":1267},"in",[1049,6234,2580],{"class":1263},[1049,6236,1771],{"class":1267},[1049,6238,2161],{"class":1263},[1049,6240,1481],{"class":1267},[1049,6242,6243],{"class":1267}," :",[1049,6245,6246],{"class":1550},"key",[1049,6248,1554],{"class":1267},[1049,6250,6251],{"class":1267},"\"`${",[1049,6253,4077],{"class":1263},[1049,6255,1771],{"class":1267},[1049,6257,1980],{"class":1263},[1049,6259,1451],{"class":1267},[1049,6261,6262],{"class":1059},"-",[1049,6264,4997],{"class":1267},[1049,6266,6267],{"class":1263},"part",[1049,6269,1771],{"class":1267},[1049,6271,5742],{"class":1263},[1049,6273,1451],{"class":1267},[1049,6275,6262],{"class":1059},[1049,6277,4997],{"class":1267},[1049,6279,6280],{"class":1263},"index",[1049,6282,6283],{"class":1267},"}`\"",[1049,6285,1528],{"class":1267},[1049,6287,6288,6291,6294,6297,6299,6301,6304,6306,6309,6311,6313,6316,6318,6321,6323,6325,6328,6330,6332,6334,6336,6339,6341],{"class":1051,"line":3931},[1049,6289,6290],{"class":1267},"              \u003C",[1049,6292,6293],{"class":1273},"MDC",[1049,6295,6296],{"class":1550}," v-if",[1049,6298,1554],{"class":1267},[1049,6300,1481],{"class":1267},[1049,6302,6303],{"class":1059},"part.type === 'text' && message.role === 'assistant'",[1049,6305,1481],{"class":1267},[1049,6307,6308],{"class":1550}," :value",[1049,6310,1554],{"class":1267},[1049,6312,1481],{"class":1267},[1049,6314,6315],{"class":1059},"part.text",[1049,6317,1481],{"class":1267},[1049,6319,6320],{"class":1550}," :cache-key",[1049,6322,1554],{"class":1267},[1049,6324,1481],{"class":1267},[1049,6326,6327],{"class":1059},"`${message.id}-${index}`",[1049,6329,1481],{"class":1267},[1049,6331,5078],{"class":1550},[1049,6333,1554],{"class":1267},[1049,6335,1481],{"class":1267},[1049,6337,6338],{"class":1059},"*:first:mt-0 *:last:mb-0",[1049,6340,1481],{"class":1267},[1049,6342,1574],{"class":1267},[1049,6344,6345,6347,6349,6352,6354,6356,6359,6361,6363,6365,6367,6370,6372,6374,6377,6379,6381],{"class":1051,"line":3955},[1049,6346,6290],{"class":1267},[1049,6348,949],{"class":1273},[1049,6350,6351],{"class":1550}," v-else-if",[1049,6353,1554],{"class":1267},[1049,6355,1481],{"class":1267},[1049,6357,6358],{"class":1059},"part.type === 'text' && message.role === 'user'",[1049,6360,1481],{"class":1267},[1049,6362,5078],{"class":1550},[1049,6364,1554],{"class":1267},[1049,6366,1481],{"class":1267},[1049,6368,6369],{"class":1059},"whitespace-pre-wrap",[1049,6371,1481],{"class":1267},[1049,6373,2628],{"class":1267},[1049,6375,6376],{"class":1263},"{{ part.text }}",[1049,6378,1598],{"class":1267},[1049,6380,949],{"class":1273},[1049,6382,1528],{"class":1267},[1049,6384,6385,6388,6390],{"class":1051,"line":3966},[1049,6386,6387],{"class":1267},"            \u003C/",[1049,6389,1525],{"class":1273},[1049,6391,1528],{"class":1267},[1049,6393,6394,6397,6399],{"class":1051,"line":3974},[1049,6395,6396],{"class":1267},"          \u003C/",[1049,6398,1525],{"class":1273},[1049,6400,1528],{"class":1267},[1049,6402,6403,6405,6407],{"class":1051,"line":3980},[1049,6404,5120],{"class":1267},[1049,6406,4693],{"class":1273},[1049,6408,1528],{"class":1267},[1049,6410,6411],{"class":1051,"line":3985},[1049,6412,1332],{"emptyLinePlaceholder":21},[1049,6414,6415,6417],{"class":1051,"line":4008},[1049,6416,5094],{"class":1267},[1049,6418,5136],{"class":1273},[1049,6420,6421,6423,6425,6427,6429],{"class":1051,"line":4014},[1049,6422,5142],{"class":1550},[1049,6424,1554],{"class":1267},[1049,6426,1481],{"class":1267},[1049,6428,4805],{"class":1059},[1049,6430,5151],{"class":1267},[1049,6432,6433,6436,6438,6440,6443],{"class":1051,"line":4034},[1049,6434,6435],{"class":1550},"          :error",[1049,6437,1554],{"class":1267},[1049,6439,1481],{"class":1267},[1049,6441,6442],{"class":1059},"chat.error",[1049,6444,5151],{"class":1267},[1049,6446,6447,6449,6451,6453,6455],{"class":1051,"line":4040},[1049,6448,5172],{"class":1550},[1049,6450,1554],{"class":1267},[1049,6452,1481],{"class":1267},[1049,6454,5179],{"class":1059},[1049,6456,5151],{"class":1267},[1049,6458,6459,6461,6463,6465,6468],{"class":1051,"line":4086},[1049,6460,6169],{"class":1550},[1049,6462,1554],{"class":1267},[1049,6464,1481],{"class":1267},[1049,6466,6467],{"class":1059},"sticky bottom-0",[1049,6469,5151],{"class":1267},[1049,6471,6472,6474,6476,6478,6481],{"class":1051,"line":4102},[1049,6473,5202],{"class":1550},[1049,6475,1554],{"class":1267},[1049,6477,1481],{"class":1267},[1049,6479,6480],{"class":1059},"handleSubmit",[1049,6482,5151],{"class":1267},[1049,6484,6485],{"class":1051,"line":4135},[1049,6486,5217],{"class":1267},[1049,6488,6489,6491],{"class":1051,"line":4149},[1049,6490,5223],{"class":1267},[1049,6492,6493],{"class":1273},"UChatPromptSubmit\n",[1049,6495,6496,6499,6501,6503,6505],{"class":1051,"line":4157},[1049,6497,6498],{"class":1550},"            :status",[1049,6500,1554],{"class":1267},[1049,6502,1481],{"class":1267},[1049,6504,6157],{"class":1059},[1049,6506,5151],{"class":1267},[1049,6508,6509,6512,6514,6516,6518],{"class":1051,"line":4162},[1049,6510,6511],{"class":1550},"            color",[1049,6513,1554],{"class":1267},[1049,6515,1481],{"class":1267},[1049,6517,5236],{"class":1059},[1049,6519,5151],{"class":1267},[1049,6521,6522,6525,6527,6529,6532],{"class":1051,"line":4169},[1049,6523,6524],{"class":1550},"            @stop",[1049,6526,1554],{"class":1267},[1049,6528,1481],{"class":1267},[1049,6530,6531],{"class":1059},"chat.stop()",[1049,6533,5151],{"class":1267},[1049,6535,6536,6539,6541,6543,6546],{"class":1051,"line":4174},[1049,6537,6538],{"class":1550},"            @reload",[1049,6540,1554],{"class":1267},[1049,6542,1481],{"class":1267},[1049,6544,6545],{"class":1059},"chat.regenerate()",[1049,6547,5151],{"class":1267},[1049,6549,6550],{"class":1051,"line":4192},[1049,6551,6552],{"class":1267},"          />\n",[1049,6554,6556,6558,6560],{"class":1051,"line":6555},86,[1049,6557,5120],{"class":1267},[1049,6559,4687],{"class":1273},[1049,6561,1528],{"class":1267},[1049,6563,6565,6567,6569],{"class":1051,"line":6564},87,[1049,6566,5254],{"class":1267},[1049,6568,5075],{"class":1273},[1049,6570,1528],{"class":1267},[1049,6572,6574,6576,6578],{"class":1051,"line":6573},88,[1049,6575,1579],{"class":1267},[1049,6577,1525],{"class":1273},[1049,6579,1528],{"class":1267},[1049,6581,6583,6585,6587],{"class":1051,"line":6582},89,[1049,6584,1589],{"class":1267},[1049,6586,5040],{"class":1273},[1049,6588,1528],{"class":1267},[1049,6590,6592,6594,6596],{"class":1051,"line":6591},90,[1049,6593,1598],{"class":1267},[1049,6595,1525],{"class":1273},[1049,6597,1528],{"class":1267},[949,6599,6600],{},"Here's a breakdown of the key parts:",[949,6602,6603],{},[967,6604,6605],{},"The Chat Class",[949,6607,4235,6608,6613,6614,6616],{},[1024,6609,6611],{"href":5324,"rel":6610},[1028],[1046,6612,5328],{}," class from ",[1046,6615,5407],{}," manages the entire conversation state. It handles:",[961,6618,6619,6624,6639,6645,6650],{},[964,6620,6621,6622],{},"Message history with ",[1046,6623,6144],{},[964,6625,6626,6627,1914,6629,2826,6632,2826,6635,2826,6637,1845],{},"Connection status with ",[1046,6628,6157],{},[1046,6630,6631],{},"ready",[1046,6633,6634],{},"submitted",[1046,6636,5311],{},[1046,6638,5791],{},[964,6640,6641,6642],{},"Sending messages with ",[1046,6643,6644],{},"chat.sendMessage()",[964,6646,6647,6648],{},"Stopping generation with ",[1046,6649,6531],{},[964,6651,6652,6653],{},"Regenerating responses with ",[1046,6654,6545],{},[949,6656,4235,6657,6660,6661,6666,6667,6669],{},[1046,6658,6659],{},"onData"," callback receives ",[1024,6662,6665],{"href":6663,"rel":6664},"https://ai-sdk.dev/docs/ai-sdk-ui/streaming-data",[1028],"custom data events"," from the server (like ",[1046,6668,3924],{},"), allowing you to react to server-side events during streaming.",[949,6671,6672],{},[967,6673,6674],{},"UChatMessages Component",[949,6676,4235,6677,6681],{},[1024,6678,6679],{"href":260},[1046,6680,4693],{}," component is purpose-built for AI chatbots with:",[961,6683,6684,6687,6690,6693],{},[964,6685,6686],{},"Auto-scroll to bottom on load",[964,6688,6689],{},"Continuous scrolling as messages stream in",[964,6691,6692],{},"A loading indicator while the assistant processes",[964,6694,6695],{},"An \"Auto scroll\" button when scrolled up",[949,6697,6698],{},[967,6699,6700],{},"Rendering Markdown with MDC",[949,6702,6703,6704,6710,6711,6717,6718,6721],{},"AI models often respond with markdown formatting (code blocks, lists, bold text, etc.). We use the ",[1024,6705,6708],{"href":6706,"rel":6707},"https://github.com/nuxt-content/mdc#mdc",[1028],[1046,6709,6293],{}," component from ",[1024,6712,6715],{"href":6713,"rel":6714},"https://github.com/nuxt-content/mdc",[1028],[1046,6716,1303],{}," to render this content beautifully. The ",[1046,6719,6720],{},"getTextFromMessage"," utility extracts the text content from AI SDK v5 message parts.",[1628,6723,6724],{"to":819},[949,6725,6726],{},"Nuxt UI provides pre-styled prose components, so your markdown content will be automatically styled to match your theme.",[949,6728,6729],{},[967,6730,6731],{},"UChatPromptSubmit Component",[949,6733,4235,6734,6738],{},[1024,6735,6736],{"href":275},[1046,6737,5226],{}," component adapts based on the chat status:",[961,6740,6741,6744,6747],{},[964,6742,6743],{},"Shows a send button when ready",[964,6745,6746],{},"Shows a stop button while streaming",[964,6748,6749],{},"Shows a reload button after an error",[953,6751,6753],{"id":6752},"adding-chat-history","Adding chat history",[949,6755,6756],{},"This section adds a dropdown menu to list previous chats and navigate between them.",[1077,6758,6760],{"id":6759},"listing-chats-api","Listing chats API",[949,6762,6763],{},"First, create an endpoint to fetch all chats:",[1240,6765,6766],{},[1039,6767,6770],{"className":1244,"code":6768,"filename":6769,"language":1246,"meta":1044,"style":1044},"import { defineEventHandler } from 'h3'\nimport { db, schema } from 'hub:db'\nimport { desc } from 'drizzle-orm'\n\nexport default defineEventHandler(async () => {\n  return await db.query.chats.findMany({\n    orderBy: () => desc(schema.chats.createdAt)\n  })\n})\n","server/api/chats.get.ts",[1046,6771,6772,6790,6812,6831,6835,6853,6878,6905,6911],{"__ignoreMap":1044},[1049,6773,6774,6776,6778,6780,6782,6784,6786,6788],{"class":1051,"line":1052},[1049,6775,1670],{"class":1253},[1049,6777,1673],{"class":1267},[1049,6779,2460],{"class":1263},[1049,6781,1695],{"class":1267},[1049,6783,1698],{"class":1253},[1049,6785,1354],{"class":1267},[1049,6787,1077],{"class":1059},[1049,6789,1318],{"class":1267},[1049,6791,6792,6794,6796,6798,6800,6802,6804,6806,6808,6810],{"class":1051,"line":1069},[1049,6793,1670],{"class":1253},[1049,6795,1673],{"class":1267},[1049,6797,2403],{"class":1263},[1049,6799,1679],{"class":1267},[1049,6801,2511],{"class":1263},[1049,6803,1695],{"class":1267},[1049,6805,1698],{"class":1253},[1049,6807,1354],{"class":1267},[1049,6809,2520],{"class":1059},[1049,6811,1318],{"class":1267},[1049,6813,6814,6816,6818,6821,6823,6825,6827,6829],{"class":1051,"line":1283},[1049,6815,1670],{"class":1253},[1049,6817,1673],{"class":1267},[1049,6819,6820],{"class":1263}," desc",[1049,6822,1695],{"class":1267},[1049,6824,1698],{"class":1253},[1049,6826,1354],{"class":1267},[1049,6828,1723],{"class":1059},[1049,6830,1318],{"class":1267},[1049,6832,6833],{"class":1051,"line":1298},[1049,6834,1332],{"emptyLinePlaceholder":21},[1049,6836,6837,6839,6841,6843,6845,6847,6849,6851],{"class":1051,"line":1310},[1049,6838,1254],{"class":1253},[1049,6840,1257],{"class":1253},[1049,6842,2460],{"class":1072},[1049,6844,1264],{"class":1263},[1049,6846,2559],{"class":1550},[1049,6848,4572],{"class":1267},[1049,6850,1788],{"class":1550},[1049,6852,1343],{"class":1267},[1049,6854,6855,6857,6859,6861,6863,6865,6867,6869,6871,6874,6876],{"class":1051,"line":1321},[1049,6856,2802],{"class":1253},[1049,6858,2588],{"class":1253},[1049,6860,2403],{"class":1263},[1049,6862,1771],{"class":1267},[1049,6864,3245],{"class":1263},[1049,6866,1771],{"class":1267},[1049,6868,1750],{"class":1263},[1049,6870,1771],{"class":1267},[1049,6872,6873],{"class":1072},"findMany",[1049,6875,1264],{"class":1273},[1049,6877,1268],{"class":1267},[1049,6879,6880,6883,6885,6887,6889,6891,6893,6895,6897,6899,6901,6903],{"class":1051,"line":1329},[1049,6881,6882],{"class":1072},"    orderBy",[1049,6884,1277],{"class":1267},[1049,6886,4572],{"class":1267},[1049,6888,1788],{"class":1550},[1049,6890,6820],{"class":1072},[1049,6892,1264],{"class":1273},[1049,6894,2679],{"class":1263},[1049,6896,1771],{"class":1267},[1049,6898,1750],{"class":1263},[1049,6900,1771],{"class":1267},[1049,6902,4589],{"class":1263},[1049,6904,1454],{"class":1273},[1049,6906,6907,6909],{"class":1051,"line":1335},[1049,6908,2376],{"class":1267},[1049,6910,1454],{"class":1273},[1049,6912,6913,6915],{"class":1051,"line":1346},[1049,6914,1451],{"class":1267},[1049,6916,1454],{"class":1263},[1077,6918,6920],{"id":6919},"building-the-chats-history-dropdown","Building the chats history dropdown",[949,6922,6923,6924,6929,6930,6935,6936,6929,6943,6945],{},"The component uses ",[1024,6925,6926],{"href":430},[1046,6927,6928],{},"UDropdownMenu"," with a ",[1024,6931,6932],{"href":224},[1046,6933,6934],{},"UButton"," as trigger. Use ",[1024,6937,6940],{"href":6938,"rel":6939},"https://nuxt.com/docs/api/composables/use-fetch",[1028],[1046,6941,6942],{},"useFetch",[1046,6944,6246],{}," to fetch and cache the chat list:",[1240,6947,6948],{},[1039,6949,6952],{"className":1512,"code":6950,"filename":6951,"language":34,"meta":1044,"style":1044},"\u003Cscript setup lang=\"ts\">\nconst route = useRoute()\n\nconst { data: chats } = useFetch('/api/chats', {\n  key: 'chats',\n  default: () => []\n})\n\nconst items = computed(() => [\n  {\n    label: 'New chat',\n    to: '/',\n    icon: 'i-lucide-plus-square',\n    active: route.name === 'index'\n  },\n  ...chats.value.map(chat => ({\n    label: chat.title || 'Untitled',\n    to: `/chat/${chat.id}`,\n    active: route.params.id === chat.id\n  }))\n])\n\u003C/script>\n\n\u003Ctemplate>\n  \u003CUDropdownMenu :items=\"items\" class=\"m-2\">\n    \u003CUButton\n      icon=\"i-lucide-messages-square\"\n      variant=\"ghost\"\n      label=\"Chats History\"\n      color=\"neutral\"\n      class=\"w-fit\"\n    />\n  \u003C/UDropdownMenu>\n\u003C/template>\n","app/components/ChatsHistory.vue",[1046,6953,6954,6974,6986,6990,7020,7035,7049,7055,7059,7079,7084,7100,7116,7132,7156,7160,7185,7210,7232,7258,7264,7268,7276,7280,7288,7319,7326,7340,7354,7368,7380,7394,7399,7407],{"__ignoreMap":1044},[1049,6955,6956,6958,6960,6962,6964,6966,6968,6970,6972],{"class":1051,"line":1052},[1049,6957,1522],{"class":1267},[1049,6959,4722],{"class":1273},[1049,6961,4725],{"class":1550},[1049,6963,4728],{"class":1550},[1049,6965,1554],{"class":1267},[1049,6967,1481],{"class":1267},[1049,6969,1246],{"class":1059},[1049,6971,1481],{"class":1267},[1049,6973,1528],{"class":1267},[1049,6975,6976,6978,6980,6982,6984],{"class":1051,"line":1069},[1049,6977,4743],{"class":1550},[1049,6979,5421],{"class":1263},[1049,6981,1554],{"class":1267},[1049,6983,5426],{"class":1072},[1049,6985,2631],{"class":1263},[1049,6987,6988],{"class":1051,"line":1283},[1049,6989,1332],{"emptyLinePlaceholder":21},[1049,6991,6992,6994,6996,6998,7000,7002,7004,7006,7008,7010,7012,7014,7016,7018],{"class":1051,"line":1298},[1049,6993,4743],{"class":1550},[1049,6995,1673],{"class":1267},[1049,6997,5460],{"class":1273},[1049,6999,1277],{"class":1267},[1049,7001,1739],{"class":1263},[1049,7003,1451],{"class":1267},[1049,7005,2585],{"class":1267},[1049,7007,5474],{"class":1072},[1049,7009,1264],{"class":1263},[1049,7011,1292],{"class":1267},[1049,7013,4867],{"class":1059},[1049,7015,1292],{"class":1267},[1049,7017,1679],{"class":1267},[1049,7019,1343],{"class":1267},[1049,7021,7022,7025,7027,7029,7031,7033],{"class":1051,"line":1310},[1049,7023,7024],{"class":1273},"  key",[1049,7026,1277],{"class":1267},[1049,7028,1354],{"class":1267},[1049,7030,1750],{"class":1059},[1049,7032,1292],{"class":1267},[1049,7034,1295],{"class":1267},[1049,7036,7037,7040,7042,7044,7046],{"class":1051,"line":1321},[1049,7038,7039],{"class":1072},"  default",[1049,7041,1277],{"class":1267},[1049,7043,4572],{"class":1267},[1049,7045,1788],{"class":1550},[1049,7047,7048],{"class":1263}," []\n",[1049,7050,7051,7053],{"class":1051,"line":1329},[1049,7052,1451],{"class":1267},[1049,7054,1454],{"class":1263},[1049,7056,7057],{"class":1051,"line":1335},[1049,7058,1332],{"emptyLinePlaceholder":21},[1049,7060,7061,7063,7066,7068,7071,7073,7075,7077],{"class":1051,"line":1346},[1049,7062,4743],{"class":1550},[1049,7064,7065],{"class":1263}," items ",[1049,7067,1554],{"class":1267},[1049,7069,7070],{"class":1072}," computed",[1049,7072,1264],{"class":1263},[1049,7074,1768],{"class":1267},[1049,7076,1788],{"class":1550},[1049,7078,1280],{"class":1263},[1049,7080,7081],{"class":1051,"line":1362},[1049,7082,7083],{"class":1267},"  {\n",[1049,7085,7086,7089,7091,7093,7096,7098],{"class":1051,"line":1368},[1049,7087,7088],{"class":1273},"    label",[1049,7090,1277],{"class":1267},[1049,7092,1354],{"class":1267},[1049,7094,7095],{"class":1059},"New chat",[1049,7097,1292],{"class":1267},[1049,7099,1295],{"class":1267},[1049,7101,7102,7105,7107,7109,7112,7114],{"class":1051,"line":1373},[1049,7103,7104],{"class":1273},"    to",[1049,7106,1277],{"class":1267},[1049,7108,1354],{"class":1267},[1049,7110,7111],{"class":1059},"/",[1049,7113,1292],{"class":1267},[1049,7115,1295],{"class":1267},[1049,7117,7118,7121,7123,7125,7128,7130],{"class":1051,"line":1396},[1049,7119,7120],{"class":1273},"    icon",[1049,7122,1277],{"class":1267},[1049,7124,1354],{"class":1267},[1049,7126,7127],{"class":1059},"i-lucide-plus-square",[1049,7129,1292],{"class":1267},[1049,7131,1295],{"class":1267},[1049,7133,7134,7137,7139,7142,7144,7147,7150,7152,7154],{"class":1051,"line":1401},[1049,7135,7136],{"class":1273},"    active",[1049,7138,1277],{"class":1267},[1049,7140,7141],{"class":1263}," route",[1049,7143,1771],{"class":1267},[1049,7145,7146],{"class":1263},"name ",[1049,7148,7149],{"class":1267},"===",[1049,7151,1354],{"class":1267},[1049,7153,6280],{"class":1059},[1049,7155,1318],{"class":1267},[1049,7157,7158],{"class":1051,"line":1411},[1049,7159,1365],{"class":1267},[1049,7161,7162,7165,7167,7169,7171,7173,7175,7177,7179,7181,7183],{"class":1051,"line":1421},[1049,7163,7164],{"class":1267},"  ...",[1049,7166,1750],{"class":1263},[1049,7168,1771],{"class":1267},[1049,7170,4810],{"class":1263},[1049,7172,1771],{"class":1267},[1049,7174,4072],{"class":1072},[1049,7176,1264],{"class":1263},[1049,7178,256],{"class":1905},[1049,7180,1788],{"class":1550},[1049,7182,1914],{"class":1263},[1049,7184,1268],{"class":1267},[1049,7186,7187,7189,7191,7193,7195,7198,7201,7203,7206,7208],{"class":1051,"line":1437},[1049,7188,7088],{"class":1273},[1049,7190,1277],{"class":1267},[1049,7192,2752],{"class":1263},[1049,7194,1771],{"class":1267},[1049,7196,7197],{"class":1263},"title ",[1049,7199,7200],{"class":1267},"||",[1049,7202,1354],{"class":1267},[1049,7204,7205],{"class":1059},"Untitled",[1049,7207,1292],{"class":1267},[1049,7209,1295],{"class":1267},[1049,7211,7212,7214,7216,7218,7220,7222,7224,7226,7228,7230],{"class":1051,"line":1443},[1049,7213,7104],{"class":1273},[1049,7215,1277],{"class":1267},[1049,7217,3459],{"class":1267},[1049,7219,4994],{"class":1059},[1049,7221,4997],{"class":1267},[1049,7223,256],{"class":1263},[1049,7225,1771],{"class":1267},[1049,7227,1980],{"class":1263},[1049,7229,5006],{"class":1267},[1049,7231,1295],{"class":1267},[1049,7233,7234,7236,7238,7240,7242,7244,7246,7249,7251,7253,7255],{"class":1051,"line":1448},[1049,7235,7136],{"class":1273},[1049,7237,1277],{"class":1267},[1049,7239,7141],{"class":1263},[1049,7241,1771],{"class":1267},[1049,7243,5491],{"class":1263},[1049,7245,1771],{"class":1267},[1049,7247,7248],{"class":1263},"id ",[1049,7250,7149],{"class":1267},[1049,7252,2752],{"class":1263},[1049,7254,1771],{"class":1267},[1049,7256,7257],{"class":1263},"id\n",[1049,7259,7260,7262],{"class":1051,"line":2237},[1049,7261,2376],{"class":1267},[1049,7263,1935],{"class":1263},[1049,7265,7266],{"class":1051,"line":2250},[1049,7267,2283],{"class":1263},[1049,7269,7270,7272,7274],{"class":1051,"line":2280},[1049,7271,1598],{"class":1267},[1049,7273,4722],{"class":1273},[1049,7275,1528],{"class":1267},[1049,7277,7278],{"class":1051,"line":2286},[1049,7279,1332],{"emptyLinePlaceholder":21},[1049,7281,7282,7284,7286],{"class":1051,"line":2291},[1049,7283,1522],{"class":1267},[1049,7285,1525],{"class":1273},[1049,7287,1528],{"class":1267},[1049,7289,7290,7292,7294,7297,7299,7301,7304,7306,7308,7310,7312,7315,7317],{"class":1051,"line":2323},[1049,7291,1535],{"class":1267},[1049,7293,6928],{"class":1273},[1049,7295,7296],{"class":1550}," :items",[1049,7298,1554],{"class":1267},[1049,7300,1481],{"class":1267},[1049,7302,7303],{"class":1059},"items",[1049,7305,1481],{"class":1267},[1049,7307,5078],{"class":1550},[1049,7309,1554],{"class":1267},[1049,7311,1481],{"class":1267},[1049,7313,7314],{"class":1059},"m-2",[1049,7316,1481],{"class":1267},[1049,7318,1528],{"class":1267},[1049,7320,7321,7323],{"class":1051,"line":2339},[1049,7322,1544],{"class":1267},[1049,7324,7325],{"class":1273},"UButton\n",[1049,7327,7328,7331,7333,7335,7338],{"class":1051,"line":2357},[1049,7329,7330],{"class":1550},"      icon",[1049,7332,1554],{"class":1267},[1049,7334,1481],{"class":1267},[1049,7336,7337],{"class":1059},"i-lucide-messages-square",[1049,7339,5151],{"class":1267},[1049,7341,7342,7345,7347,7349,7352],{"class":1051,"line":2373},[1049,7343,7344],{"class":1550},"      variant",[1049,7346,1554],{"class":1267},[1049,7348,1481],{"class":1267},[1049,7350,7351],{"class":1059},"ghost",[1049,7353,5151],{"class":1267},[1049,7355,7356,7359,7361,7363,7366],{"class":1051,"line":2381},[1049,7357,7358],{"class":1550},"      label",[1049,7360,1554],{"class":1267},[1049,7362,1481],{"class":1267},[1049,7364,7365],{"class":1059},"Chats History",[1049,7367,5151],{"class":1267},[1049,7369,7370,7372,7374,7376,7378],{"class":1051,"line":3331},[1049,7371,5849],{"class":1550},[1049,7373,1554],{"class":1267},[1049,7375,1481],{"class":1267},[1049,7377,5236],{"class":1059},[1049,7379,5151],{"class":1267},[1049,7381,7382,7385,7387,7389,7392],{"class":1051,"line":3370},[1049,7383,7384],{"class":1550},"      class",[1049,7386,1554],{"class":1267},[1049,7388,1481],{"class":1267},[1049,7390,7391],{"class":1059},"w-fit",[1049,7393,5151],{"class":1267},[1049,7395,7396],{"class":1051,"line":3376},[1049,7397,7398],{"class":1267},"    />\n",[1049,7400,7401,7403,7405],{"class":1051,"line":3381},[1049,7402,1589],{"class":1267},[1049,7404,6928],{"class":1273},[1049,7406,1528],{"class":1267},[1049,7408,7409,7411,7413],{"class":1051,"line":3387},[1049,7410,1598],{"class":1267},[1049,7412,1525],{"class":1273},[1049,7414,1528],{"class":1267},[953,7416,7418],{"id":7417},"integrating-history-in-the-home-page","Integrating history in the home page",[1240,7420,7421],{},[1658,7422,7423],{},[1039,7424,7427],{"className":1512,"code":7425,"filename":4712,"highlights":7426,"language":34,"meta":1044,"style":1044},"\u003Cscript setup lang=\"ts\">\nconst input = ref('')\nconst loading = ref(false)\n\nasync function createChat() {\n  if (!input.value.trim()) return\n\n  loading.value = true\n\n  // Create a new chat on the server\n  const chat = await $fetch('/api/chats', {\n    method: 'POST',\n    body: {\n      message: {\n        role: 'user',\n        parts: [{ type: 'text', text: input.value }]\n      }\n    }\n  })\n\n  // Navigate to the chat page\n  navigateTo(`/chat/${chat.id}`)\n}\n\u003C/script>\n\n\u003Ctemplate>\n  \u003CUDashboardPanel :ui=\"{ body: 'p-0 sm:p-0' }\">\n    \u003Ctemplate #header>\n      \u003CChatsHistory />\n    \u003C/template>\n    \u003Ctemplate #body>\n      \u003CUContainer class=\"min-h-dvh flex flex-col justify-center gap-6 py-8\">\n        \u003Ch1 class=\"text-3xl sm:text-4xl text-highlighted font-bold\">\n          How can I help you today?\n        \u003C/h1>\n\n        \u003CUChatPrompt\n          v-model=\"input\"\n          :status=\"loading ? 'streaming' : 'ready'\"\n          variant=\"subtle\"\n          placeholder=\"Ask me anything...\"\n          @submit=\"createChat\"\n        >\n          \u003CUChatPromptSubmit color=\"neutral\" />\n        \u003C/UChatPrompt>\n      \u003C/UContainer>\n    \u003C/template>\n  \u003C/UDashboardPanel>\n\u003C/template>\n",[2373,2381,3331],[1046,7428,7429,7449,7465,7481,7485,7497,7519,7523,7535,7539,7543,7567,7581,7589,7597,7611,7647,7651,7655,7661,7665,7669,7691,7695,7703,7707,7715,7733,7747,7757,7766,7778,7796,7814,7818,7826,7830,7836,7848,7860,7872,7884,7896,7900,7918,7926,7934,7942,7950],{"__ignoreMap":1044},[1049,7430,7431,7433,7435,7437,7439,7441,7443,7445,7447],{"class":1051,"line":1052},[1049,7432,1522],{"class":1267},[1049,7434,4722],{"class":1273},[1049,7436,4725],{"class":1550},[1049,7438,4728],{"class":1550},[1049,7440,1554],{"class":1267},[1049,7442,1481],{"class":1267},[1049,7444,1246],{"class":1059},[1049,7446,1481],{"class":1267},[1049,7448,1528],{"class":1267},[1049,7450,7451,7453,7455,7457,7459,7461,7463],{"class":1051,"line":1069},[1049,7452,4743],{"class":1550},[1049,7454,4746],{"class":1263},[1049,7456,1554],{"class":1267},[1049,7458,4751],{"class":1072},[1049,7460,1264],{"class":1263},[1049,7462,4756],{"class":1267},[1049,7464,1454],{"class":1263},[1049,7466,7467,7469,7471,7473,7475,7477,7479],{"class":1051,"line":1283},[1049,7468,4743],{"class":1550},[1049,7470,4765],{"class":1263},[1049,7472,1554],{"class":1267},[1049,7474,4751],{"class":1072},[1049,7476,1264],{"class":1263},[1049,7478,4774],{"class":1429},[1049,7480,1454],{"class":1263},[1049,7482,7483],{"class":1051,"line":1298},[1049,7484,1332],{"emptyLinePlaceholder":21},[1049,7486,7487,7489,7491,7493,7495],{"class":1051,"line":1310},[1049,7488,2559],{"class":1550},[1049,7490,4787],{"class":1550},[1049,7492,4790],{"class":1072},[1049,7494,1768],{"class":1267},[1049,7496,1343],{"class":1267},[1049,7498,7499,7501,7503,7505,7507,7509,7511,7513,7515,7517],{"class":1051,"line":1321},[1049,7500,3316],{"class":1253},[1049,7502,1914],{"class":1273},[1049,7504,3321],{"class":1267},[1049,7506,4805],{"class":1263},[1049,7508,1771],{"class":1267},[1049,7510,4810],{"class":1263},[1049,7512,1771],{"class":1267},[1049,7514,4815],{"class":1072},[1049,7516,4818],{"class":1273},[1049,7518,4821],{"class":1253},[1049,7520,7521],{"class":1051,"line":1329},[1049,7522,1332],{"emptyLinePlaceholder":21},[1049,7524,7525,7527,7529,7531,7533],{"class":1051,"line":1335},[1049,7526,4830],{"class":1263},[1049,7528,1771],{"class":1267},[1049,7530,4810],{"class":1263},[1049,7532,2585],{"class":1267},[1049,7534,3963],{"class":1429},[1049,7536,7537],{"class":1051,"line":1346},[1049,7538,1332],{"emptyLinePlaceholder":21},[1049,7540,7541],{"class":1051,"line":1362},[1049,7542,4847],{"class":1433},[1049,7544,7545,7547,7549,7551,7553,7555,7557,7559,7561,7563,7565],{"class":1051,"line":1368},[1049,7546,2575],{"class":1550},[1049,7548,2752],{"class":1263},[1049,7550,2585],{"class":1267},[1049,7552,2588],{"class":1253},[1049,7554,4860],{"class":1072},[1049,7556,1264],{"class":1273},[1049,7558,1292],{"class":1267},[1049,7560,4867],{"class":1059},[1049,7562,1292],{"class":1267},[1049,7564,1679],{"class":1267},[1049,7566,1343],{"class":1267},[1049,7568,7569,7571,7573,7575,7577,7579],{"class":1051,"line":1373},[1049,7570,4878],{"class":1273},[1049,7572,1277],{"class":1267},[1049,7574,1354],{"class":1267},[1049,7576,4885],{"class":1059},[1049,7578,1292],{"class":1267},[1049,7580,1295],{"class":1267},[1049,7582,7583,7585,7587],{"class":1051,"line":1396},[1049,7584,4894],{"class":1273},[1049,7586,1277],{"class":1267},[1049,7588,1343],{"class":1267},[1049,7590,7591,7593,7595],{"class":1051,"line":1401},[1049,7592,4903],{"class":1273},[1049,7594,1277],{"class":1267},[1049,7596,1343],{"class":1267},[1049,7598,7599,7601,7603,7605,7607,7609],{"class":1051,"line":1411},[1049,7600,4105],{"class":1273},[1049,7602,1277],{"class":1267},[1049,7604,1354],{"class":1267},[1049,7606,2110],{"class":1059},[1049,7608,1292],{"class":1267},[1049,7610,1295],{"class":1267},[1049,7612,7613,7615,7617,7619,7621,7623,7625,7627,7629,7631,7633,7635,7637,7639,7641,7643,7645],{"class":1051,"line":1421},[1049,7614,4138],{"class":1273},[1049,7616,1277],{"class":1267},[1049,7618,1381],{"class":1273},[1049,7620,1828],{"class":1267},[1049,7622,2482],{"class":1273},[1049,7624,1277],{"class":1267},[1049,7626,1354],{"class":1267},[1049,7628,4940],{"class":1059},[1049,7630,1292],{"class":1267},[1049,7632,1679],{"class":1267},[1049,7634,1682],{"class":1273},[1049,7636,1277],{"class":1267},[1049,7638,4951],{"class":1263},[1049,7640,1771],{"class":1267},[1049,7642,4810],{"class":1263},[1049,7644,1695],{"class":1267},[1049,7646,3620],{"class":1273},[1049,7648,7649],{"class":1051,"line":1437},[1049,7650,3977],{"class":1267},[1049,7652,7653],{"class":1051,"line":1443},[1049,7654,1440],{"class":1267},[1049,7656,7657,7659],{"class":1051,"line":1448},[1049,7658,2376],{"class":1267},[1049,7660,1454],{"class":1273},[1049,7662,7663],{"class":1051,"line":2237},[1049,7664,1332],{"emptyLinePlaceholder":21},[1049,7666,7667],{"class":1051,"line":2250},[1049,7668,4982],{"class":1433},[1049,7670,7671,7673,7675,7677,7679,7681,7683,7685,7687,7689],{"class":1051,"line":2280},[1049,7672,4987],{"class":1072},[1049,7674,1264],{"class":1273},[1049,7676,3465],{"class":1267},[1049,7678,4994],{"class":1059},[1049,7680,4997],{"class":1267},[1049,7682,256],{"class":1263},[1049,7684,1771],{"class":1267},[1049,7686,1980],{"class":1263},[1049,7688,5006],{"class":1267},[1049,7690,1454],{"class":1273},[1049,7692,7693],{"class":1051,"line":2286},[1049,7694,5013],{"class":1267},[1049,7696,7697,7699,7701],{"class":1051,"line":2291},[1049,7698,1598],{"class":1267},[1049,7700,4722],{"class":1273},[1049,7702,1528],{"class":1267},[1049,7704,7705],{"class":1051,"line":2323},[1049,7706,1332],{"emptyLinePlaceholder":21},[1049,7708,7709,7711,7713],{"class":1051,"line":2339},[1049,7710,1522],{"class":1267},[1049,7712,1525],{"class":1273},[1049,7714,1528],{"class":1267},[1049,7716,7717,7719,7721,7723,7725,7727,7729,7731],{"class":1051,"line":2357},[1049,7718,1535],{"class":1267},[1049,7720,5040],{"class":1273},[1049,7722,5043],{"class":1550},[1049,7724,1554],{"class":1267},[1049,7726,1481],{"class":1267},[1049,7728,5050],{"class":1059},[1049,7730,1481],{"class":1267},[1049,7732,1528],{"class":1267},[1049,7734,7736,7738,7740,7742,7745],{"class":7735,"line":2373},[1051,1532],[1049,7737,1544],{"class":1267},[1049,7739,1525],{"class":1273},[1049,7741,5063],{"class":1267},[1049,7743,7744],{"class":1550},"header",[1049,7746,1528],{"class":1267},[1049,7748,7750,7752,7755],{"class":7749,"line":2381},[1051,1532],[1049,7751,1568],{"class":1267},[1049,7753,7754],{"class":1273},"ChatsHistory",[1049,7756,1574],{"class":1267},[1049,7758,7760,7762,7764],{"class":7759,"line":3331},[1051,1532],[1049,7761,1579],{"class":1267},[1049,7763,1525],{"class":1273},[1049,7765,1528],{"class":1267},[1049,7767,7768,7770,7772,7774,7776],{"class":1051,"line":3370},[1049,7769,1544],{"class":1267},[1049,7771,1525],{"class":1273},[1049,7773,5063],{"class":1267},[1049,7775,5066],{"class":1550},[1049,7777,1528],{"class":1267},[1049,7779,7780,7782,7784,7786,7788,7790,7792,7794],{"class":1051,"line":3376},[1049,7781,1568],{"class":1267},[1049,7783,5075],{"class":1273},[1049,7785,5078],{"class":1550},[1049,7787,1554],{"class":1267},[1049,7789,1481],{"class":1267},[1049,7791,5085],{"class":1059},[1049,7793,1481],{"class":1267},[1049,7795,1528],{"class":1267},[1049,7797,7798,7800,7802,7804,7806,7808,7810,7812],{"class":1051,"line":3381},[1049,7799,5094],{"class":1267},[1049,7801,5097],{"class":1273},[1049,7803,5078],{"class":1550},[1049,7805,1554],{"class":1267},[1049,7807,1481],{"class":1267},[1049,7809,5106],{"class":1059},[1049,7811,1481],{"class":1267},[1049,7813,1528],{"class":1267},[1049,7815,7816],{"class":1051,"line":3387},[1049,7817,5115],{"class":1263},[1049,7819,7820,7822,7824],{"class":1051,"line":3407},[1049,7821,5120],{"class":1267},[1049,7823,5097],{"class":1273},[1049,7825,1528],{"class":1267},[1049,7827,7828],{"class":1051,"line":3435},[1049,7829,1332],{"emptyLinePlaceholder":21},[1049,7831,7832,7834],{"class":1051,"line":3451},[1049,7833,5094],{"class":1267},[1049,7835,5136],{"class":1273},[1049,7837,7838,7840,7842,7844,7846],{"class":1051,"line":3470},[1049,7839,5142],{"class":1550},[1049,7841,1554],{"class":1267},[1049,7843,1481],{"class":1267},[1049,7845,4805],{"class":1059},[1049,7847,5151],{"class":1267},[1049,7849,7850,7852,7854,7856,7858],{"class":1051,"line":3498},[1049,7851,5157],{"class":1550},[1049,7853,1554],{"class":1267},[1049,7855,1481],{"class":1267},[1049,7857,5164],{"class":1059},[1049,7859,5151],{"class":1267},[1049,7861,7862,7864,7866,7868,7870],{"class":1051,"line":3506},[1049,7863,5172],{"class":1550},[1049,7865,1554],{"class":1267},[1049,7867,1481],{"class":1267},[1049,7869,5179],{"class":1059},[1049,7871,5151],{"class":1267},[1049,7873,7874,7876,7878,7880,7882],{"class":1051,"line":3511},[1049,7875,5187],{"class":1550},[1049,7877,1554],{"class":1267},[1049,7879,1481],{"class":1267},[1049,7881,5194],{"class":1059},[1049,7883,5151],{"class":1267},[1049,7885,7886,7888,7890,7892,7894],{"class":1051,"line":3577},[1049,7887,5202],{"class":1550},[1049,7889,1554],{"class":1267},[1049,7891,1481],{"class":1267},[1049,7893,5209],{"class":1059},[1049,7895,5151],{"class":1267},[1049,7897,7898],{"class":1051,"line":3582},[1049,7899,5217],{"class":1267},[1049,7901,7902,7904,7906,7908,7910,7912,7914,7916],{"class":1051,"line":3587},[1049,7903,5223],{"class":1267},[1049,7905,5226],{"class":1273},[1049,7907,5229],{"class":1550},[1049,7909,1554],{"class":1267},[1049,7911,1481],{"class":1267},[1049,7913,5236],{"class":1059},[1049,7915,1481],{"class":1267},[1049,7917,1574],{"class":1267},[1049,7919,7920,7922,7924],{"class":1051,"line":3593},[1049,7921,5120],{"class":1267},[1049,7923,4687],{"class":1273},[1049,7925,1528],{"class":1267},[1049,7927,7928,7930,7932],{"class":1051,"line":3623},[1049,7929,5254],{"class":1267},[1049,7931,5075],{"class":1273},[1049,7933,1528],{"class":1267},[1049,7935,7936,7938,7940],{"class":1051,"line":3665},[1049,7937,1579],{"class":1267},[1049,7939,1525],{"class":1273},[1049,7941,1528],{"class":1267},[1049,7943,7944,7946,7948],{"class":1051,"line":3694},[1049,7945,1589],{"class":1267},[1049,7947,5040],{"class":1273},[1049,7949,1528],{"class":1267},[1049,7951,7952,7954,7956],{"class":1051,"line":3706},[1049,7953,1598],{"class":1267},[1049,7955,1525],{"class":1273},[1049,7957,1528],{"class":1267},[953,7959,7961],{"id":7960},"integrating-history-in-the-chat-page","Integrating history in the chat page",[1240,7963,7964],{},[1658,7965,7966],{},[1039,7967,7970],{"className":1512,"code":7968,"filename":5345,"highlights":7969,"language":34,"meta":1044,"style":1044},"\u003Cscript setup lang=\"ts\">\nimport { DefaultChatTransport } from 'ai'\nimport { Chat } from '@ai-sdk/vue'\n\nconst route = useRoute()\nconst toast = useToast()\n\n// Fetch existing chat data\nconst { data: chatData } = await useFetch(`/api/chats/${route.params.id}`)\n\nif (!chatData.value) {\n  throw createError({ statusCode: 404, statusMessage: 'Chat not found', fatal: true })\n}\n\nconst input = ref('')\n\n// Initialize the Chat class from AI SDK\nconst chat = new Chat({\n  id: chatData.value.id,\n  messages: chatData.value.messages,\n  transport: new DefaultChatTransport({\n    api: `/api/chats/${chatData.value.id}`\n  }),\n  onData(dataPart) {\n    // Refresh the chat list when a title is generated\n    if (dataPart.type === 'data-chat-title') {\n      refreshNuxtData('chats')\n    }\n  },\n  onError(error) {\n    toast.add({\n      title: 'Error',\n      description: error.message,\n      color: 'error'\n    })\n  }\n})\n\nfunction handleSubmit(e: Event) {\n  e.preventDefault()\n  if (input.value.trim()) {\n    chat.sendMessage({ text: input.value })\n    input.value = ''\n  }\n}\n\n// Auto-generate response for first message\nonMounted(() => {\n  if (chatData.value?.messages.length === 1) {\n    chat.regenerate()\n  }\n})\n\u003C/script>\n\n\u003Ctemplate>\n  \u003CUDashboardPanel :ui=\"{ body: 'p-0 sm:p-0' }\">\n    \u003Ctemplate #header>\n      \u003CChatsHistory />\n    \u003C/template>\n    \u003Ctemplate #body>\n      \u003CUContainer class=\"min-h-dvh flex flex-col py-4 sm:py-6\">\n        \u003CUChatMessages\n          :messages=\"chat.messages\"\n          :status=\"chat.status\"\n          should-auto-scroll\n          class=\"flex-1\"\n        >\n          \u003Ctemplate #content=\"{ message }\">\n            \u003Ctemplate v-for=\"(part, index) in message.parts\" :key=\"`${message.id}-${part.type}-${index}`\">\n              \u003CMDC v-if=\"part.type === 'text' && message.role === 'assistant'\" :value=\"part.text\" :cache-key=\"`${message.id}-${index}`\" class=\"*:first:mt-0 *:last:mb-0\" />\n              \u003Cp v-else-if=\"part.type === 'text' && message.role === 'user'\" class=\"whitespace-pre-wrap\">{{ part.text }}\u003C/p>\n            \u003C/template>\n          \u003C/template>\n        \u003C/UChatMessages>\n\n        \u003CUChatPrompt\n          v-model=\"input\"\n          :error=\"chat.error\"\n          variant=\"subtle\"\n          class=\"sticky bottom-0\"\n          @submit=\"handleSubmit\"\n        >\n          \u003CUChatPromptSubmit\n            :status=\"chat.status\"\n            color=\"neutral\"\n            @stop=\"chat.stop()\"\n            @reload=\"chat.regenerate()\"\n          />\n        \u003C/UChatPrompt>\n      \u003C/UContainer>\n    \u003C/template>\n  \u003C/UDashboardPanel>\n\u003C/template>\n",[3816,3824,3841],[1046,7971,7972,7992,8010,8028,8032,8044,8056,8060,8064,8106,8110,8126,8166,8170,8174,8190,8194,8198,8214,8232,8250,8264,8288,8296,8308,8312,8336,8350,8354,8358,8370,8382,8396,8410,8422,8428,8432,8438,8442,8460,8470,8490,8516,8528,8532,8536,8540,8544,8556,8584,8594,8598,8604,8612,8616,8624,8642,8654,8663,8672,8685,8703,8709,8721,8733,8737,8749,8753,8777,8843,8891,8927,8935,8943,8951,8955,8961,8973,8985,8997,9009,9021,9025,9031,9043,9055,9067,9079,9083,9091,9099,9108,9117],{"__ignoreMap":1044},[1049,7973,7974,7976,7978,7980,7982,7984,7986,7988,7990],{"class":1051,"line":1052},[1049,7975,1522],{"class":1267},[1049,7977,4722],{"class":1273},[1049,7979,4725],{"class":1550},[1049,7981,4728],{"class":1550},[1049,7983,1554],{"class":1267},[1049,7985,1481],{"class":1267},[1049,7987,1246],{"class":1059},[1049,7989,1481],{"class":1267},[1049,7991,1528],{"class":1267},[1049,7993,7994,7996,7998,8000,8002,8004,8006,8008],{"class":1051,"line":1069},[1049,7995,1670],{"class":1253},[1049,7997,1673],{"class":1267},[1049,7999,5378],{"class":1263},[1049,8001,1695],{"class":1267},[1049,8003,1698],{"class":1253},[1049,8005,1354],{"class":1267},[1049,8007,2496],{"class":1059},[1049,8009,1318],{"class":1267},[1049,8011,8012,8014,8016,8018,8020,8022,8024,8026],{"class":1051,"line":1283},[1049,8013,1670],{"class":1253},[1049,8015,1673],{"class":1267},[1049,8017,5398],{"class":1263},[1049,8019,1695],{"class":1267},[1049,8021,1698],{"class":1253},[1049,8023,1354],{"class":1267},[1049,8025,5407],{"class":1059},[1049,8027,1318],{"class":1267},[1049,8029,8030],{"class":1051,"line":1298},[1049,8031,1332],{"emptyLinePlaceholder":21},[1049,8033,8034,8036,8038,8040,8042],{"class":1051,"line":1310},[1049,8035,4743],{"class":1550},[1049,8037,5421],{"class":1263},[1049,8039,1554],{"class":1267},[1049,8041,5426],{"class":1072},[1049,8043,2631],{"class":1263},[1049,8045,8046,8048,8050,8052,8054],{"class":1051,"line":1321},[1049,8047,4743],{"class":1550},[1049,8049,5435],{"class":1263},[1049,8051,1554],{"class":1267},[1049,8053,5440],{"class":1072},[1049,8055,2631],{"class":1263},[1049,8057,8058],{"class":1051,"line":1329},[1049,8059,1332],{"emptyLinePlaceholder":21},[1049,8061,8062],{"class":1051,"line":1335},[1049,8063,5451],{"class":1433},[1049,8065,8066,8068,8070,8072,8074,8076,8078,8080,8082,8084,8086,8088,8090,8092,8094,8096,8098,8100,8102,8104],{"class":1051,"line":1346},[1049,8067,4743],{"class":1550},[1049,8069,1673],{"class":1267},[1049,8071,5460],{"class":1273},[1049,8073,1277],{"class":1267},[1049,8075,5465],{"class":1263},[1049,8077,1451],{"class":1267},[1049,8079,2585],{"class":1267},[1049,8081,2588],{"class":1253},[1049,8083,5474],{"class":1072},[1049,8085,1264],{"class":1263},[1049,8087,3465],{"class":1267},[1049,8089,5481],{"class":1059},[1049,8091,4997],{"class":1267},[1049,8093,5486],{"class":1263},[1049,8095,1771],{"class":1267},[1049,8097,5491],{"class":1263},[1049,8099,1771],{"class":1267},[1049,8101,1980],{"class":1263},[1049,8103,5006],{"class":1267},[1049,8105,1454],{"class":1263},[1049,8107,8108],{"class":1051,"line":1362},[1049,8109,1332],{"emptyLinePlaceholder":21},[1049,8111,8112,8114,8116,8118,8120,8122,8124],{"class":1051,"line":1368},[1049,8113,5508],{"class":1253},[1049,8115,1914],{"class":1263},[1049,8117,3321],{"class":1267},[1049,8119,5515],{"class":1263},[1049,8121,1771],{"class":1267},[1049,8123,5520],{"class":1263},[1049,8125,1268],{"class":1267},[1049,8127,8128,8130,8132,8134,8136,8138,8140,8142,8144,8146,8148,8150,8152,8154,8156,8158,8160,8162,8164],{"class":1051,"line":1373},[1049,8129,5527],{"class":1253},[1049,8131,2861],{"class":1072},[1049,8133,1264],{"class":1273},[1049,8135,1828],{"class":1267},[1049,8137,3343],{"class":1273},[1049,8139,1277],{"class":1267},[1049,8141,3349],{"class":3348},[1049,8143,1679],{"class":1267},[1049,8145,3354],{"class":1273},[1049,8147,1277],{"class":1267},[1049,8149,1354],{"class":1267},[1049,8151,3361],{"class":1059},[1049,8153,1292],{"class":1267},[1049,8155,1679],{"class":1267},[1049,8157,5556],{"class":1273},[1049,8159,1277],{"class":1267},[1049,8161,5561],{"class":1429},[1049,8163,1695],{"class":1267},[1049,8165,1454],{"class":1273},[1049,8167,8168],{"class":1051,"line":1396},[1049,8169,5013],{"class":1267},[1049,8171,8172],{"class":1051,"line":1401},[1049,8173,1332],{"emptyLinePlaceholder":21},[1049,8175,8176,8178,8180,8182,8184,8186,8188],{"class":1051,"line":1411},[1049,8177,4743],{"class":1550},[1049,8179,4746],{"class":1263},[1049,8181,1554],{"class":1267},[1049,8183,4751],{"class":1072},[1049,8185,1264],{"class":1263},[1049,8187,4756],{"class":1267},[1049,8189,1454],{"class":1263},[1049,8191,8192],{"class":1051,"line":1421},[1049,8193,1332],{"emptyLinePlaceholder":21},[1049,8195,8196],{"class":1051,"line":1437},[1049,8197,5598],{"class":1433},[1049,8199,8200,8202,8204,8206,8208,8210,8212],{"class":1051,"line":1443},[1049,8201,4743],{"class":1550},[1049,8203,5605],{"class":1263},[1049,8205,1554],{"class":1267},[1049,8207,1865],{"class":1267},[1049,8209,5398],{"class":1072},[1049,8211,1264],{"class":1263},[1049,8213,1268],{"class":1267},[1049,8215,8216,8218,8220,8222,8224,8226,8228,8230],{"class":1051,"line":1448},[1049,8217,1761],{"class":1273},[1049,8219,1277],{"class":1267},[1049,8221,5625],{"class":1263},[1049,8223,1771],{"class":1267},[1049,8225,4810],{"class":1263},[1049,8227,1771],{"class":1267},[1049,8229,1980],{"class":1263},[1049,8231,1295],{"class":1267},[1049,8233,8234,8236,8238,8240,8242,8244,8246,8248],{"class":1051,"line":2237},[1049,8235,1921],{"class":1273},[1049,8237,1277],{"class":1267},[1049,8239,5625],{"class":1263},[1049,8241,1771],{"class":1267},[1049,8243,4810],{"class":1263},[1049,8245,1771],{"class":1267},[1049,8247,1959],{"class":1263},[1049,8249,1295],{"class":1267},[1049,8251,8252,8254,8256,8258,8260,8262],{"class":1051,"line":2250},[1049,8253,5660],{"class":1273},[1049,8255,1277],{"class":1267},[1049,8257,1865],{"class":1267},[1049,8259,5378],{"class":1072},[1049,8261,1264],{"class":1263},[1049,8263,1268],{"class":1267},[1049,8265,8266,8268,8270,8272,8274,8276,8278,8280,8282,8284,8286],{"class":1051,"line":2280},[1049,8267,5676],{"class":1273},[1049,8269,1277],{"class":1267},[1049,8271,3459],{"class":1267},[1049,8273,5481],{"class":1059},[1049,8275,4997],{"class":1267},[1049,8277,5515],{"class":1263},[1049,8279,1771],{"class":1267},[1049,8281,4810],{"class":1263},[1049,8283,1771],{"class":1267},[1049,8285,1980],{"class":1263},[1049,8287,5697],{"class":1267},[1049,8289,8290,8292,8294],{"class":1051,"line":2286},[1049,8291,2376],{"class":1267},[1049,8293,1845],{"class":1263},[1049,8295,1295],{"class":1267},[1049,8297,8298,8300,8302,8304,8306],{"class":1051,"line":2291},[1049,8299,5712],{"class":1273},[1049,8301,1264],{"class":1267},[1049,8303,5717],{"class":1905},[1049,8305,1845],{"class":1267},[1049,8307,1343],{"class":1267},[1049,8309,8310],{"class":1051,"line":2323},[1049,8311,5727],{"class":1433},[1049,8313,8314,8316,8318,8320,8322,8324,8326,8328,8330,8332,8334],{"class":1051,"line":2339},[1049,8315,5733],{"class":1253},[1049,8317,1914],{"class":1273},[1049,8319,5717],{"class":1263},[1049,8321,1771],{"class":1267},[1049,8323,5742],{"class":1263},[1049,8325,3638],{"class":1267},[1049,8327,1354],{"class":1267},[1049,8329,3924],{"class":1059},[1049,8331,1292],{"class":1267},[1049,8333,3326],{"class":1273},[1049,8335,1268],{"class":1267},[1049,8337,8338,8340,8342,8344,8346,8348],{"class":1051,"line":2357},[1049,8339,5760],{"class":1072},[1049,8341,1264],{"class":1273},[1049,8343,1292],{"class":1267},[1049,8345,1750],{"class":1059},[1049,8347,1292],{"class":1267},[1049,8349,1454],{"class":1273},[1049,8351,8352],{"class":1051,"line":2373},[1049,8353,1440],{"class":1267},[1049,8355,8356],{"class":1051,"line":2381},[1049,8357,1365],{"class":1267},[1049,8359,8360,8362,8364,8366,8368],{"class":1051,"line":3331},[1049,8361,5786],{"class":1273},[1049,8363,1264],{"class":1267},[1049,8365,5791],{"class":1905},[1049,8367,1845],{"class":1267},[1049,8369,1343],{"class":1267},[1049,8371,8372,8374,8376,8378,8380],{"class":1051,"line":3370},[1049,8373,5801],{"class":1263},[1049,8375,1771],{"class":1267},[1049,8377,5806],{"class":1072},[1049,8379,1264],{"class":1273},[1049,8381,1268],{"class":1267},[1049,8383,8384,8386,8388,8390,8392,8394],{"class":1051,"line":3376},[1049,8385,5816],{"class":1273},[1049,8387,1277],{"class":1267},[1049,8389,1354],{"class":1267},[1049,8391,471],{"class":1059},[1049,8393,1292],{"class":1267},[1049,8395,1295],{"class":1267},[1049,8397,8398,8400,8402,8404,8406,8408],{"class":1051,"line":3381},[1049,8399,5832],{"class":1273},[1049,8401,1277],{"class":1267},[1049,8403,5837],{"class":1263},[1049,8405,1771],{"class":1267},[1049,8407,4077],{"class":1263},[1049,8409,1295],{"class":1267},[1049,8411,8412,8414,8416,8418,8420],{"class":1051,"line":3387},[1049,8413,5849],{"class":1273},[1049,8415,1277],{"class":1267},[1049,8417,1354],{"class":1267},[1049,8419,5791],{"class":1059},[1049,8421,1318],{"class":1267},[1049,8423,8424,8426],{"class":1051,"line":3407},[1049,8425,3501],{"class":1267},[1049,8427,1454],{"class":1273},[1049,8429,8430],{"class":1051,"line":3435},[1049,8431,3373],{"class":1267},[1049,8433,8434,8436],{"class":1051,"line":3451},[1049,8435,1451],{"class":1267},[1049,8437,1454],{"class":1263},[1049,8439,8440],{"class":1051,"line":3470},[1049,8441,1332],{"emptyLinePlaceholder":21},[1049,8443,8444,8446,8448,8450,8452,8454,8456,8458],{"class":1051,"line":3498},[1049,8445,5886],{"class":1550},[1049,8447,5889],{"class":1072},[1049,8449,1264],{"class":1267},[1049,8451,5894],{"class":1905},[1049,8453,1277],{"class":1267},[1049,8455,5899],{"class":1055},[1049,8457,1845],{"class":1267},[1049,8459,1343],{"class":1267},[1049,8461,8462,8464,8466,8468],{"class":1051,"line":3506},[1049,8463,5908],{"class":1263},[1049,8465,1771],{"class":1267},[1049,8467,5913],{"class":1072},[1049,8469,2631],{"class":1273},[1049,8471,8472,8474,8476,8478,8480,8482,8484,8486,8488],{"class":1051,"line":3511},[1049,8473,3316],{"class":1253},[1049,8475,1914],{"class":1273},[1049,8477,4805],{"class":1263},[1049,8479,1771],{"class":1267},[1049,8481,4810],{"class":1263},[1049,8483,1771],{"class":1267},[1049,8485,4815],{"class":1072},[1049,8487,4818],{"class":1273},[1049,8489,1268],{"class":1267},[1049,8491,8492,8494,8496,8498,8500,8502,8504,8506,8508,8510,8512,8514],{"class":1051,"line":3577},[1049,8493,5940],{"class":1263},[1049,8495,1771],{"class":1267},[1049,8497,5945],{"class":1072},[1049,8499,1264],{"class":1273},[1049,8501,1828],{"class":1267},[1049,8503,1682],{"class":1273},[1049,8505,1277],{"class":1267},[1049,8507,4951],{"class":1263},[1049,8509,1771],{"class":1267},[1049,8511,4810],{"class":1263},[1049,8513,1695],{"class":1267},[1049,8515,1454],{"class":1273},[1049,8517,8518,8520,8522,8524,8526],{"class":1051,"line":3582},[1049,8519,5968],{"class":1263},[1049,8521,1771],{"class":1267},[1049,8523,4810],{"class":1263},[1049,8525,2585],{"class":1267},[1049,8527,5977],{"class":1267},[1049,8529,8530],{"class":1051,"line":3587},[1049,8531,3373],{"class":1267},[1049,8533,8534],{"class":1051,"line":3593},[1049,8535,5013],{"class":1267},[1049,8537,8538],{"class":1051,"line":3623},[1049,8539,1332],{"emptyLinePlaceholder":21},[1049,8541,8542],{"class":1051,"line":3665},[1049,8543,5994],{"class":1433},[1049,8545,8546,8548,8550,8552,8554],{"class":1051,"line":3694},[1049,8547,5999],{"class":1072},[1049,8549,1264],{"class":1263},[1049,8551,1768],{"class":1267},[1049,8553,1788],{"class":1550},[1049,8555,1343],{"class":1267},[1049,8557,8558,8560,8562,8564,8566,8568,8570,8572,8574,8576,8578,8580,8582],{"class":1051,"line":3706},[1049,8559,3316],{"class":1253},[1049,8561,1914],{"class":1273},[1049,8563,5515],{"class":1263},[1049,8565,1771],{"class":1267},[1049,8567,4810],{"class":1263},[1049,8569,3633],{"class":1267},[1049,8571,1959],{"class":1263},[1049,8573,1771],{"class":1267},[1049,8575,3611],{"class":1263},[1049,8577,3638],{"class":1267},[1049,8579,3617],{"class":3348},[1049,8581,3326],{"class":1273},[1049,8583,1268],{"class":1267},[1049,8585,8586,8588,8590,8592],{"class":1051,"line":3722},[1049,8587,5940],{"class":1263},[1049,8589,1771],{"class":1267},[1049,8591,6044],{"class":1072},[1049,8593,2631],{"class":1273},[1049,8595,8596],{"class":1051,"line":3736},[1049,8597,3373],{"class":1267},[1049,8599,8600,8602],{"class":1051,"line":3743},[1049,8601,1451],{"class":1267},[1049,8603,1454],{"class":1263},[1049,8605,8606,8608,8610],{"class":1051,"line":3748},[1049,8607,1598],{"class":1267},[1049,8609,4722],{"class":1273},[1049,8611,1528],{"class":1267},[1049,8613,8614],{"class":1051,"line":3753},[1049,8615,1332],{"emptyLinePlaceholder":21},[1049,8617,8618,8620,8622],{"class":1051,"line":3759},[1049,8619,1522],{"class":1267},[1049,8621,1525],{"class":1273},[1049,8623,1528],{"class":1267},[1049,8625,8626,8628,8630,8632,8634,8636,8638,8640],{"class":1051,"line":3776},[1049,8627,1535],{"class":1267},[1049,8629,5040],{"class":1273},[1049,8631,5043],{"class":1550},[1049,8633,1554],{"class":1267},[1049,8635,1481],{"class":1267},[1049,8637,5050],{"class":1059},[1049,8639,1481],{"class":1267},[1049,8641,1528],{"class":1267},[1049,8643,8644,8646,8648,8650,8652],{"class":1051,"line":3798},[1049,8645,1544],{"class":1267},[1049,8647,1525],{"class":1273},[1049,8649,5063],{"class":1267},[1049,8651,7744],{"class":1550},[1049,8653,1528],{"class":1267},[1049,8655,8657,8659,8661],{"class":8656,"line":3816},[1051,1532],[1049,8658,1568],{"class":1267},[1049,8660,7754],{"class":1273},[1049,8662,1574],{"class":1267},[1049,8664,8666,8668,8670],{"class":8665,"line":3824},[1051,1532],[1049,8667,1579],{"class":1267},[1049,8669,1525],{"class":1273},[1049,8671,1528],{"class":1267},[1049,8673,8675,8677,8679,8681,8683],{"class":8674,"line":3841},[1051,1532],[1049,8676,1544],{"class":1267},[1049,8678,1525],{"class":1273},[1049,8680,5063],{"class":1267},[1049,8682,5066],{"class":1550},[1049,8684,1528],{"class":1267},[1049,8686,8687,8689,8691,8693,8695,8697,8699,8701],{"class":1051,"line":3860},[1049,8688,1568],{"class":1267},[1049,8690,5075],{"class":1273},[1049,8692,5078],{"class":1550},[1049,8694,1554],{"class":1267},[1049,8696,1481],{"class":1267},[1049,8698,6121],{"class":1059},[1049,8700,1481],{"class":1267},[1049,8702,1528],{"class":1267},[1049,8704,8705,8707],{"class":1051,"line":3868},[1049,8706,5094],{"class":1267},[1049,8708,6132],{"class":1273},[1049,8710,8711,8713,8715,8717,8719],{"class":1051,"line":3873},[1049,8712,6137],{"class":1550},[1049,8714,1554],{"class":1267},[1049,8716,1481],{"class":1267},[1049,8718,6144],{"class":1059},[1049,8720,5151],{"class":1267},[1049,8722,8723,8725,8727,8729,8731],{"class":1051,"line":3879},[1049,8724,5157],{"class":1550},[1049,8726,1554],{"class":1267},[1049,8728,1481],{"class":1267},[1049,8730,6157],{"class":1059},[1049,8732,5151],{"class":1267},[1049,8734,8735],{"class":1051,"line":3899},[1049,8736,6164],{"class":1550},[1049,8738,8739,8741,8743,8745,8747],{"class":1051,"line":3914},[1049,8740,6169],{"class":1550},[1049,8742,1554],{"class":1267},[1049,8744,1481],{"class":1267},[1049,8746,6176],{"class":1059},[1049,8748,5151],{"class":1267},[1049,8750,8751],{"class":1051,"line":3931},[1049,8752,5217],{"class":1267},[1049,8754,8755,8757,8759,8761,8763,8765,8767,8769,8771,8773,8775],{"class":1051,"line":3955},[1049,8756,5223],{"class":1267},[1049,8758,1525],{"class":1273},[1049,8760,5063],{"class":1267},[1049,8762,344],{"class":1550},[1049,8764,1554],{"class":1267},[1049,8766,1481],{"class":1267},[1049,8768,1828],{"class":1267},[1049,8770,6201],{"class":1263},[1049,8772,1451],{"class":1267},[1049,8774,1481],{"class":1267},[1049,8776,1528],{"class":1267},[1049,8778,8779,8781,8783,8785,8787,8789,8791,8793,8795,8797,8799,8801,8803,8805,8807,8809,8811,8813,8815,8817,8819,8821,8823,8825,8827,8829,8831,8833,8835,8837,8839,8841],{"class":1051,"line":3966},[1049,8780,6212],{"class":1267},[1049,8782,1525],{"class":1273},[1049,8784,6217],{"class":1253},[1049,8786,1554],{"class":1267},[1049,8788,1481],{"class":1267},[1049,8790,6224],{"class":1263},[1049,8792,1679],{"class":1267},[1049,8794,6229],{"class":1263},[1049,8796,6232],{"class":1267},[1049,8798,2580],{"class":1263},[1049,8800,1771],{"class":1267},[1049,8802,2161],{"class":1263},[1049,8804,1481],{"class":1267},[1049,8806,6243],{"class":1267},[1049,8808,6246],{"class":1550},[1049,8810,1554],{"class":1267},[1049,8812,6251],{"class":1267},[1049,8814,4077],{"class":1263},[1049,8816,1771],{"class":1267},[1049,8818,1980],{"class":1263},[1049,8820,1451],{"class":1267},[1049,8822,6262],{"class":1059},[1049,8824,4997],{"class":1267},[1049,8826,6267],{"class":1263},[1049,8828,1771],{"class":1267},[1049,8830,5742],{"class":1263},[1049,8832,1451],{"class":1267},[1049,8834,6262],{"class":1059},[1049,8836,4997],{"class":1267},[1049,8838,6280],{"class":1263},[1049,8840,6283],{"class":1267},[1049,8842,1528],{"class":1267},[1049,8844,8845,8847,8849,8851,8853,8855,8857,8859,8861,8863,8865,8867,8869,8871,8873,8875,8877,8879,8881,8883,8885,8887,8889],{"class":1051,"line":3974},[1049,8846,6290],{"class":1267},[1049,8848,6293],{"class":1273},[1049,8850,6296],{"class":1550},[1049,8852,1554],{"class":1267},[1049,8854,1481],{"class":1267},[1049,8856,6303],{"class":1059},[1049,8858,1481],{"class":1267},[1049,8860,6308],{"class":1550},[1049,8862,1554],{"class":1267},[1049,8864,1481],{"class":1267},[1049,8866,6315],{"class":1059},[1049,8868,1481],{"class":1267},[1049,8870,6320],{"class":1550},[1049,8872,1554],{"class":1267},[1049,8874,1481],{"class":1267},[1049,8876,6327],{"class":1059},[1049,8878,1481],{"class":1267},[1049,8880,5078],{"class":1550},[1049,8882,1554],{"class":1267},[1049,8884,1481],{"class":1267},[1049,8886,6338],{"class":1059},[1049,8888,1481],{"class":1267},[1049,8890,1574],{"class":1267},[1049,8892,8893,8895,8897,8899,8901,8903,8905,8907,8909,8911,8913,8915,8917,8919,8921,8923,8925],{"class":1051,"line":3980},[1049,8894,6290],{"class":1267},[1049,8896,949],{"class":1273},[1049,8898,6351],{"class":1550},[1049,8900,1554],{"class":1267},[1049,8902,1481],{"class":1267},[1049,8904,6358],{"class":1059},[1049,8906,1481],{"class":1267},[1049,8908,5078],{"class":1550},[1049,8910,1554],{"class":1267},[1049,8912,1481],{"class":1267},[1049,8914,6369],{"class":1059},[1049,8916,1481],{"class":1267},[1049,8918,2628],{"class":1267},[1049,8920,6376],{"class":1263},[1049,8922,1598],{"class":1267},[1049,8924,949],{"class":1273},[1049,8926,1528],{"class":1267},[1049,8928,8929,8931,8933],{"class":1051,"line":3985},[1049,8930,6387],{"class":1267},[1049,8932,1525],{"class":1273},[1049,8934,1528],{"class":1267},[1049,8936,8937,8939,8941],{"class":1051,"line":4008},[1049,8938,6396],{"class":1267},[1049,8940,1525],{"class":1273},[1049,8942,1528],{"class":1267},[1049,8944,8945,8947,8949],{"class":1051,"line":4014},[1049,8946,5120],{"class":1267},[1049,8948,4693],{"class":1273},[1049,8950,1528],{"class":1267},[1049,8952,8953],{"class":1051,"line":4034},[1049,8954,1332],{"emptyLinePlaceholder":21},[1049,8956,8957,8959],{"class":1051,"line":4040},[1049,8958,5094],{"class":1267},[1049,8960,5136],{"class":1273},[1049,8962,8963,8965,8967,8969,8971],{"class":1051,"line":4086},[1049,8964,5142],{"class":1550},[1049,8966,1554],{"class":1267},[1049,8968,1481],{"class":1267},[1049,8970,4805],{"class":1059},[1049,8972,5151],{"class":1267},[1049,8974,8975,8977,8979,8981,8983],{"class":1051,"line":4102},[1049,8976,6435],{"class":1550},[1049,8978,1554],{"class":1267},[1049,8980,1481],{"class":1267},[1049,8982,6442],{"class":1059},[1049,8984,5151],{"class":1267},[1049,8986,8987,8989,8991,8993,8995],{"class":1051,"line":4135},[1049,8988,5172],{"class":1550},[1049,8990,1554],{"class":1267},[1049,8992,1481],{"class":1267},[1049,8994,5179],{"class":1059},[1049,8996,5151],{"class":1267},[1049,8998,8999,9001,9003,9005,9007],{"class":1051,"line":4149},[1049,9000,6169],{"class":1550},[1049,9002,1554],{"class":1267},[1049,9004,1481],{"class":1267},[1049,9006,6467],{"class":1059},[1049,9008,5151],{"class":1267},[1049,9010,9011,9013,9015,9017,9019],{"class":1051,"line":4157},[1049,9012,5202],{"class":1550},[1049,9014,1554],{"class":1267},[1049,9016,1481],{"class":1267},[1049,9018,6480],{"class":1059},[1049,9020,5151],{"class":1267},[1049,9022,9023],{"class":1051,"line":4162},[1049,9024,5217],{"class":1267},[1049,9026,9027,9029],{"class":1051,"line":4169},[1049,9028,5223],{"class":1267},[1049,9030,6493],{"class":1273},[1049,9032,9033,9035,9037,9039,9041],{"class":1051,"line":4174},[1049,9034,6498],{"class":1550},[1049,9036,1554],{"class":1267},[1049,9038,1481],{"class":1267},[1049,9040,6157],{"class":1059},[1049,9042,5151],{"class":1267},[1049,9044,9045,9047,9049,9051,9053],{"class":1051,"line":4192},[1049,9046,6511],{"class":1550},[1049,9048,1554],{"class":1267},[1049,9050,1481],{"class":1267},[1049,9052,5236],{"class":1059},[1049,9054,5151],{"class":1267},[1049,9056,9057,9059,9061,9063,9065],{"class":1051,"line":6555},[1049,9058,6524],{"class":1550},[1049,9060,1554],{"class":1267},[1049,9062,1481],{"class":1267},[1049,9064,6531],{"class":1059},[1049,9066,5151],{"class":1267},[1049,9068,9069,9071,9073,9075,9077],{"class":1051,"line":6564},[1049,9070,6538],{"class":1550},[1049,9072,1554],{"class":1267},[1049,9074,1481],{"class":1267},[1049,9076,6545],{"class":1059},[1049,9078,5151],{"class":1267},[1049,9080,9081],{"class":1051,"line":6573},[1049,9082,6552],{"class":1267},[1049,9084,9085,9087,9089],{"class":1051,"line":6582},[1049,9086,5120],{"class":1267},[1049,9088,4687],{"class":1273},[1049,9090,1528],{"class":1267},[1049,9092,9093,9095,9097],{"class":1051,"line":6591},[1049,9094,5254],{"class":1267},[1049,9096,5075],{"class":1273},[1049,9098,1528],{"class":1267},[1049,9100,9102,9104,9106],{"class":1051,"line":9101},91,[1049,9103,1579],{"class":1267},[1049,9105,1525],{"class":1273},[1049,9107,1528],{"class":1267},[1049,9109,9111,9113,9115],{"class":1051,"line":9110},92,[1049,9112,1589],{"class":1267},[1049,9114,5040],{"class":1273},[1049,9116,1528],{"class":1267},[1049,9118,9120,9122,9124],{"class":1051,"line":9119},93,[1049,9121,1598],{"class":1267},[1049,9123,1525],{"class":1273},[1049,9125,1528],{"class":1267},[949,9127,4235,9128,9131,9132,9134],{},[1046,9129,9130],{},"refreshNuxtData('chats')"," call in the chat page's ",[1046,9133,6659],{}," callback (as shown earlier) ensures the chat list updates automatically when a new title is generated.",[953,9136,9138],{"id":9137},"adding-multi-model-support","Adding multi-model support",[949,9140,9141,9142,9145],{},"One of the benefits of using ",[1024,9143,4204],{"href":1026,"rel":9144},[1028]," is the ability to switch between models seamlessly. This section adds a model selector to the chat.",[1077,9147,9149],{"id":9148},"creating-a-models-composable","Creating a models composable",[949,9151,9152,9153,1277],{},"Define the available models and persist the user's selection using ",[1024,9154,9157],{"href":9155,"rel":9156},"https://nuxt.com/docs/api/composables/use-cookie",[1028],[1046,9158,9159],{},"useCookie",[1240,9161,9162],{},[1039,9163,9166],{"className":1244,"code":9164,"filename":9165,"language":1246,"meta":1044,"style":1044},"export function useModels() {\n  const models = [\n    { value: 'openai/gpt-4o-mini', label: 'GPT-4o Mini', icon: 'i-simple-icons-openai' },\n    { value: 'anthropic/claude-3-5-haiku-latest', label: 'Claude 3.5 Haiku', icon: 'i-simple-icons-anthropic' },\n    { value: 'google/gemini-2.0-flash', label: 'Gemini 2.0 Flash', icon: 'i-simple-icons-google' }\n  ]\n\n  const model = useCookie\u003Cstring>('ai-model', {\n    default: () => 'openai/gpt-4o-mini'\n  })\n\n  return {\n    models,\n    model\n  }\n}\n","app/composables/useModels.ts",[1046,9167,9168,9181,9192,9238,9281,9325,9330,9334,9364,9381,9387,9391,9397,9404,9409,9413],{"__ignoreMap":1044},[1049,9169,9170,9172,9174,9177,9179],{"class":1051,"line":1052},[1049,9171,1254],{"class":1253},[1049,9173,4787],{"class":1550},[1049,9175,9176],{"class":1072}," useModels",[1049,9178,1768],{"class":1267},[1049,9180,1343],{"class":1267},[1049,9182,9183,9185,9188,9190],{"class":1051,"line":1069},[1049,9184,2575],{"class":1550},[1049,9186,9187],{"class":1263}," models",[1049,9189,2585],{"class":1267},[1049,9191,1280],{"class":1273},[1049,9193,9194,9197,9200,9202,9204,9206,9208,9210,9213,9215,9217,9220,9222,9224,9227,9229,9231,9234,9236],{"class":1051,"line":1283},[1049,9195,9196],{"class":1267},"    {",[1049,9198,9199],{"class":1273}," value",[1049,9201,1277],{"class":1267},[1049,9203,1354],{"class":1267},[1049,9205,3170],{"class":1059},[1049,9207,1292],{"class":1267},[1049,9209,1679],{"class":1267},[1049,9211,9212],{"class":1273}," label",[1049,9214,1277],{"class":1267},[1049,9216,1354],{"class":1267},[1049,9218,9219],{"class":1059},"GPT-4o Mini",[1049,9221,1292],{"class":1267},[1049,9223,1679],{"class":1267},[1049,9225,9226],{"class":1273}," icon",[1049,9228,1277],{"class":1267},[1049,9230,1354],{"class":1267},[1049,9232,9233],{"class":1059},"i-simple-icons-openai",[1049,9235,1292],{"class":1267},[1049,9237,3952],{"class":1267},[1049,9239,9240,9242,9244,9246,9248,9251,9253,9255,9257,9259,9261,9264,9266,9268,9270,9272,9274,9277,9279],{"class":1051,"line":1298},[1049,9241,9196],{"class":1267},[1049,9243,9199],{"class":1273},[1049,9245,1277],{"class":1267},[1049,9247,1354],{"class":1267},[1049,9249,9250],{"class":1059},"anthropic/claude-3-5-haiku-latest",[1049,9252,1292],{"class":1267},[1049,9254,1679],{"class":1267},[1049,9256,9212],{"class":1273},[1049,9258,1277],{"class":1267},[1049,9260,1354],{"class":1267},[1049,9262,9263],{"class":1059},"Claude 3.5 Haiku",[1049,9265,1292],{"class":1267},[1049,9267,1679],{"class":1267},[1049,9269,9226],{"class":1273},[1049,9271,1277],{"class":1267},[1049,9273,1354],{"class":1267},[1049,9275,9276],{"class":1059},"i-simple-icons-anthropic",[1049,9278,1292],{"class":1267},[1049,9280,3952],{"class":1267},[1049,9282,9283,9285,9287,9289,9291,9294,9296,9298,9300,9302,9304,9307,9309,9311,9313,9315,9317,9320,9322],{"class":1051,"line":1310},[1049,9284,9196],{"class":1267},[1049,9286,9199],{"class":1273},[1049,9288,1277],{"class":1267},[1049,9290,1354],{"class":1267},[1049,9292,9293],{"class":1059},"google/gemini-2.0-flash",[1049,9295,1292],{"class":1267},[1049,9297,1679],{"class":1267},[1049,9299,9212],{"class":1273},[1049,9301,1277],{"class":1267},[1049,9303,1354],{"class":1267},[1049,9305,9306],{"class":1059},"Gemini 2.0 Flash",[1049,9308,1292],{"class":1267},[1049,9310,1679],{"class":1267},[1049,9312,9226],{"class":1273},[1049,9314,1277],{"class":1267},[1049,9316,1354],{"class":1267},[1049,9318,9319],{"class":1059},"i-simple-icons-google",[1049,9321,1292],{"class":1267},[1049,9323,9324],{"class":1267}," }\n",[1049,9326,9327],{"class":1051,"line":1321},[1049,9328,9329],{"class":1273},"  ]\n",[1049,9331,9332],{"class":1051,"line":1329},[1049,9333,1332],{"emptyLinePlaceholder":21},[1049,9335,9336,9338,9340,9342,9345,9347,9349,9351,9353,9355,9358,9360,9362],{"class":1051,"line":1335},[1049,9337,2575],{"class":1550},[1049,9339,3114],{"class":1263},[1049,9341,2585],{"class":1267},[1049,9343,9344],{"class":1072}," useCookie",[1049,9346,1522],{"class":1267},[1049,9348,3087],{"class":1055},[1049,9350,2628],{"class":1267},[1049,9352,1264],{"class":1273},[1049,9354,1292],{"class":1267},[1049,9356,9357],{"class":1059},"ai-model",[1049,9359,1292],{"class":1267},[1049,9361,1679],{"class":1267},[1049,9363,1343],{"class":1267},[1049,9365,9366,9369,9371,9373,9375,9377,9379],{"class":1051,"line":1346},[1049,9367,9368],{"class":1072},"    default",[1049,9370,1277],{"class":1267},[1049,9372,4572],{"class":1267},[1049,9374,1788],{"class":1550},[1049,9376,1354],{"class":1267},[1049,9378,3170],{"class":1059},[1049,9380,1318],{"class":1267},[1049,9382,9383,9385],{"class":1051,"line":1362},[1049,9384,2376],{"class":1267},[1049,9386,1454],{"class":1273},[1049,9388,9389],{"class":1051,"line":1368},[1049,9390,1332],{"emptyLinePlaceholder":21},[1049,9392,9393,9395],{"class":1051,"line":1373},[1049,9394,2802],{"class":1253},[1049,9396,1343],{"class":1267},[1049,9398,9399,9402],{"class":1051,"line":1396},[1049,9400,9401],{"class":1263},"    models",[1049,9403,1295],{"class":1267},[1049,9405,9406],{"class":1051,"line":1401},[1049,9407,9408],{"class":1263},"    model\n",[1049,9410,9411],{"class":1051,"line":1411},[1049,9412,3373],{"class":1267},[1049,9414,9415],{"class":1051,"line":1421},[1049,9416,5013],{"class":1267},[1077,9418,9420],{"id":9419},"building-the-model-selector","Building the model selector",[949,9422,1605,9423,9428],{},[1024,9424,9425],{"href":708},[1046,9426,9427],{},"USelectMenu"," component that displays the available models:",[1240,9430,9431],{},[1039,9432,9435],{"className":1512,"code":9433,"filename":9434,"language":34,"meta":1044,"style":1044},"\u003Cscript setup lang=\"ts\">\nconst model = defineModel\u003Cstring>({ required: true })\n\nconst { models } = useModels()\n\nconst selectedModel = computed(() =>\n  models.find(m => m.value === model.value)\n)\n\u003C/script>\n\n\u003Ctemplate>\n  \u003CUSelectMenu\n    v-model=\"model\"\n    :items=\"models\"\n    :icon=\"selectedModel?.icon\"\n    variant=\"ghost\"\n    value-key=\"value\"\n  />\n\u003C/template>\n","app/components/ModelSelect.vue",[1046,9436,9437,9457,9490,9494,9511,9515,9533,9567,9571,9579,9583,9591,9598,9611,9625,9639,9652,9665,9670],{"__ignoreMap":1044},[1049,9438,9439,9441,9443,9445,9447,9449,9451,9453,9455],{"class":1051,"line":1052},[1049,9440,1522],{"class":1267},[1049,9442,4722],{"class":1273},[1049,9444,4725],{"class":1550},[1049,9446,4728],{"class":1550},[1049,9448,1554],{"class":1267},[1049,9450,1481],{"class":1267},[1049,9452,1246],{"class":1059},[1049,9454,1481],{"class":1267},[1049,9456,1528],{"class":1267},[1049,9458,9459,9461,9464,9466,9469,9471,9473,9475,9477,9479,9482,9484,9486,9488],{"class":1051,"line":1069},[1049,9460,4743],{"class":1550},[1049,9462,9463],{"class":1263}," model ",[1049,9465,1554],{"class":1267},[1049,9467,9468],{"class":1072}," defineModel",[1049,9470,1522],{"class":1267},[1049,9472,3087],{"class":1055},[1049,9474,2628],{"class":1267},[1049,9476,1264],{"class":1263},[1049,9478,1828],{"class":1267},[1049,9480,9481],{"class":1273}," required",[1049,9483,1277],{"class":1267},[1049,9485,5561],{"class":1429},[1049,9487,1695],{"class":1267},[1049,9489,1454],{"class":1263},[1049,9491,9492],{"class":1051,"line":1283},[1049,9493,1332],{"emptyLinePlaceholder":21},[1049,9495,9496,9498,9500,9503,9505,9507,9509],{"class":1051,"line":1298},[1049,9497,4743],{"class":1550},[1049,9499,1673],{"class":1267},[1049,9501,9502],{"class":1263}," models ",[1049,9504,1451],{"class":1267},[1049,9506,2585],{"class":1267},[1049,9508,9176],{"class":1072},[1049,9510,2631],{"class":1263},[1049,9512,9513],{"class":1051,"line":1310},[1049,9514,1332],{"emptyLinePlaceholder":21},[1049,9516,9517,9519,9522,9524,9526,9528,9530],{"class":1051,"line":1321},[1049,9518,4743],{"class":1550},[1049,9520,9521],{"class":1263}," selectedModel ",[1049,9523,1554],{"class":1267},[1049,9525,7070],{"class":1072},[1049,9527,1264],{"class":1263},[1049,9529,1768],{"class":1267},[1049,9531,9532],{"class":1550}," =>\n",[1049,9534,9535,9538,9540,9543,9545,9548,9550,9553,9555,9558,9560,9562,9564],{"class":1051,"line":1329},[1049,9536,9537],{"class":1263},"  models",[1049,9539,1771],{"class":1267},[1049,9541,9542],{"class":1072},"find",[1049,9544,1264],{"class":1263},[1049,9546,9547],{"class":1905},"m",[1049,9549,1788],{"class":1550},[1049,9551,9552],{"class":1263}," m",[1049,9554,1771],{"class":1267},[1049,9556,9557],{"class":1263},"value ",[1049,9559,7149],{"class":1267},[1049,9561,3114],{"class":1263},[1049,9563,1771],{"class":1267},[1049,9565,9566],{"class":1263},"value)\n",[1049,9568,9569],{"class":1051,"line":1335},[1049,9570,1454],{"class":1263},[1049,9572,9573,9575,9577],{"class":1051,"line":1346},[1049,9574,1598],{"class":1267},[1049,9576,4722],{"class":1273},[1049,9578,1528],{"class":1267},[1049,9580,9581],{"class":1051,"line":1362},[1049,9582,1332],{"emptyLinePlaceholder":21},[1049,9584,9585,9587,9589],{"class":1051,"line":1368},[1049,9586,1522],{"class":1267},[1049,9588,1525],{"class":1273},[1049,9590,1528],{"class":1267},[1049,9592,9593,9595],{"class":1051,"line":1373},[1049,9594,1535],{"class":1267},[1049,9596,9597],{"class":1273},"USelectMenu\n",[1049,9599,9600,9603,9605,9607,9609],{"class":1051,"line":1396},[1049,9601,9602],{"class":1550},"    v-model",[1049,9604,1554],{"class":1267},[1049,9606,1481],{"class":1267},[1049,9608,4248],{"class":1059},[1049,9610,5151],{"class":1267},[1049,9612,9613,9616,9618,9620,9623],{"class":1051,"line":1401},[1049,9614,9615],{"class":1550},"    :items",[1049,9617,1554],{"class":1267},[1049,9619,1481],{"class":1267},[1049,9621,9622],{"class":1059},"models",[1049,9624,5151],{"class":1267},[1049,9626,9627,9630,9632,9634,9637],{"class":1051,"line":1411},[1049,9628,9629],{"class":1550},"    :icon",[1049,9631,1554],{"class":1267},[1049,9633,1481],{"class":1267},[1049,9635,9636],{"class":1059},"selectedModel?.icon",[1049,9638,5151],{"class":1267},[1049,9640,9641,9644,9646,9648,9650],{"class":1051,"line":1421},[1049,9642,9643],{"class":1550},"    variant",[1049,9645,1554],{"class":1267},[1049,9647,1481],{"class":1267},[1049,9649,7351],{"class":1059},[1049,9651,5151],{"class":1267},[1049,9653,9654,9657,9659,9661,9663],{"class":1051,"line":1437},[1049,9655,9656],{"class":1550},"    value-key",[1049,9658,1554],{"class":1267},[1049,9660,1481],{"class":1267},[1049,9662,4810],{"class":1059},[1049,9664,5151],{"class":1267},[1049,9666,9667],{"class":1051,"line":1443},[1049,9668,9669],{"class":1267},"  />\n",[1049,9671,9672,9674,9676],{"class":1051,"line":1448},[1049,9673,1598],{"class":1267},[1049,9675,1525],{"class":1273},[1049,9677,1528],{"class":1267},[1077,9679,9681],{"id":9680},"integrating-with-the-chat","Integrating with the chat",[949,9683,9684],{},"Update the chat page to include the model selector and pass the selected model to the server:",[1240,9686,9687],{},[1658,9688,9689],{},[1039,9690,9693],{"className":1512,"code":9691,"filename":5345,"highlights":9692,"language":34,"meta":1044,"style":1044},"\u003Cscript setup lang=\"ts\">\nimport { DefaultChatTransport } from 'ai'\nimport { Chat } from '@ai-sdk/vue'\n\nconst route = useRoute()\nconst toast = useToast()\nconst { model } = useModels()\n\nconst { data: chatData } = await useFetch(`/api/chats/${route.params.id}`)\n\nif (!chatData.value) {\n  throw createError({ statusCode: 404, statusMessage: 'Chat not found', fatal: true })\n}\n\nconst input = ref('')\n\nconst chat = new Chat({\n  id: chatData.value.id,\n  messages: chatData.value.messages,\n  transport: new DefaultChatTransport({\n    api: `/api/chats/${chatData.value.id}`,\n    body: {\n      model: model.value // Pass the selected model\n    }\n  }),\n  onData(dataPart) {\n    if (dataPart.type === 'data-chat-title') {\n      refreshNuxtData('chats')\n    }\n  },\n  onError(error) {\n    toast.add({\n      title: 'Error',\n      description: error.message,\n      color: 'error'\n    })\n  }\n})\n\nfunction handleSubmit(e: Event) {\n  e.preventDefault()\n  if (input.value.trim()) {\n    chat.sendMessage({ text: input.value })\n    input.value = ''\n  }\n}\n\nonMounted(() => {\n  if (chatData.value?.messages.length === 1) {\n    chat.regenerate()\n  }\n})\n\u003C/script>\n\n\u003Ctemplate>\n  \u003CUDashboardPanel :ui=\"{ body: 'p-0 sm:p-0' }\">\n    \u003Ctemplate #header>\n      \u003CChatsHistory />\n    \u003C/template>\n    \u003Ctemplate #body>\n      \u003CUContainer class=\"min-h-dvh flex flex-col py-4 sm:py-6\">\n        \u003CUChatMessages\n          :messages=\"chat.messages\"\n          :status=\"chat.status\"\n          should-auto-scroll\n          class=\"flex-1\"\n        >\n          \u003Ctemplate #content=\"{ message }\">\n            \u003Ctemplate v-for=\"(part, index) in message.parts\" :key=\"`${message.id}-${part.type}-${index}`\">\n              \u003CMDC v-if=\"part.type === 'text' && message.role === 'assistant'\" :value=\"part.text\" :cache-key=\"`${message.id}-${index}`\" class=\"*:first:mt-0 *:last:mb-0\" />\n              \u003Cp v-else-if=\"part.type === 'text' && message.role === 'user'\" class=\"whitespace-pre-wrap\">{{ part.text }}\u003C/p>\n            \u003C/template>\n          \u003C/template>\n        \u003C/UChatMessages>\n\n        \u003CUChatPrompt\n          v-model=\"input\"\n          :error=\"chat.error\"\n          variant=\"subtle\"\n          class=\"sticky bottom-0\"\n          @submit=\"handleSubmit\"\n        >\n          \u003Ctemplate #footer>\n            \u003CModelSelect v-model=\"model\" />\n          \u003C/template>\n\n          \u003CUChatPromptSubmit\n            :status=\"chat.status\"\n            color=\"neutral\"\n            @stop=\"chat.stop()\"\n            @reload=\"chat.regenerate()\"\n          />\n        \u003C/UChatPrompt>\n      \u003C/UContainer>\n    \u003C/template>\n  \u003C/UDashboardPanel>\n\u003C/template>\n",[1335,2286,2291,2323,4192,6555,6564],[1046,9694,9695,9715,9733,9751,9755,9767,9779,9795,9800,9842,9846,9862,9902,9906,9910,9926,9930,9946,9964,9982,9996,10022,10030,10046,10051,10060,10072,10096,10110,10114,10118,10130,10142,10156,10170,10182,10188,10192,10198,10202,10220,10230,10250,10276,10288,10292,10296,10300,10312,10340,10350,10354,10360,10368,10372,10380,10398,10410,10418,10426,10438,10456,10462,10474,10486,10490,10502,10506,10530,10596,10644,10680,10688,10696,10704,10708,10714,10726,10738,10750,10762,10774,10778,10791,10811,10820,10825,10832,10844,10856,10868,10880,10884,10892,10901,10910,10919],{"__ignoreMap":1044},[1049,9696,9697,9699,9701,9703,9705,9707,9709,9711,9713],{"class":1051,"line":1052},[1049,9698,1522],{"class":1267},[1049,9700,4722],{"class":1273},[1049,9702,4725],{"class":1550},[1049,9704,4728],{"class":1550},[1049,9706,1554],{"class":1267},[1049,9708,1481],{"class":1267},[1049,9710,1246],{"class":1059},[1049,9712,1481],{"class":1267},[1049,9714,1528],{"class":1267},[1049,9716,9717,9719,9721,9723,9725,9727,9729,9731],{"class":1051,"line":1069},[1049,9718,1670],{"class":1253},[1049,9720,1673],{"class":1267},[1049,9722,5378],{"class":1263},[1049,9724,1695],{"class":1267},[1049,9726,1698],{"class":1253},[1049,9728,1354],{"class":1267},[1049,9730,2496],{"class":1059},[1049,9732,1318],{"class":1267},[1049,9734,9735,9737,9739,9741,9743,9745,9747,9749],{"class":1051,"line":1283},[1049,9736,1670],{"class":1253},[1049,9738,1673],{"class":1267},[1049,9740,5398],{"class":1263},[1049,9742,1695],{"class":1267},[1049,9744,1698],{"class":1253},[1049,9746,1354],{"class":1267},[1049,9748,5407],{"class":1059},[1049,9750,1318],{"class":1267},[1049,9752,9753],{"class":1051,"line":1298},[1049,9754,1332],{"emptyLinePlaceholder":21},[1049,9756,9757,9759,9761,9763,9765],{"class":1051,"line":1310},[1049,9758,4743],{"class":1550},[1049,9760,5421],{"class":1263},[1049,9762,1554],{"class":1267},[1049,9764,5426],{"class":1072},[1049,9766,2631],{"class":1263},[1049,9768,9769,9771,9773,9775,9777],{"class":1051,"line":1321},[1049,9770,4743],{"class":1550},[1049,9772,5435],{"class":1263},[1049,9774,1554],{"class":1267},[1049,9776,5440],{"class":1072},[1049,9778,2631],{"class":1263},[1049,9780,9781,9783,9785,9787,9789,9791,9793],{"class":1051,"line":1329},[1049,9782,4743],{"class":1550},[1049,9784,1673],{"class":1267},[1049,9786,9463],{"class":1263},[1049,9788,1451],{"class":1267},[1049,9790,2585],{"class":1267},[1049,9792,9176],{"class":1072},[1049,9794,2631],{"class":1263},[1049,9796,9798],{"class":9797,"line":1335},[1051,1532],[1049,9799,1332],{"emptyLinePlaceholder":21},[1049,9801,9802,9804,9806,9808,9810,9812,9814,9816,9818,9820,9822,9824,9826,9828,9830,9832,9834,9836,9838,9840],{"class":1051,"line":1346},[1049,9803,4743],{"class":1550},[1049,9805,1673],{"class":1267},[1049,9807,5460],{"class":1273},[1049,9809,1277],{"class":1267},[1049,9811,5465],{"class":1263},[1049,9813,1451],{"class":1267},[1049,9815,2585],{"class":1267},[1049,9817,2588],{"class":1253},[1049,9819,5474],{"class":1072},[1049,9821,1264],{"class":1263},[1049,9823,3465],{"class":1267},[1049,9825,5481],{"class":1059},[1049,9827,4997],{"class":1267},[1049,9829,5486],{"class":1263},[1049,9831,1771],{"class":1267},[1049,9833,5491],{"class":1263},[1049,9835,1771],{"class":1267},[1049,9837,1980],{"class":1263},[1049,9839,5006],{"class":1267},[1049,9841,1454],{"class":1263},[1049,9843,9844],{"class":1051,"line":1362},[1049,9845,1332],{"emptyLinePlaceholder":21},[1049,9847,9848,9850,9852,9854,9856,9858,9860],{"class":1051,"line":1368},[1049,9849,5508],{"class":1253},[1049,9851,1914],{"class":1263},[1049,9853,3321],{"class":1267},[1049,9855,5515],{"class":1263},[1049,9857,1771],{"class":1267},[1049,9859,5520],{"class":1263},[1049,9861,1268],{"class":1267},[1049,9863,9864,9866,9868,9870,9872,9874,9876,9878,9880,9882,9884,9886,9888,9890,9892,9894,9896,9898,9900],{"class":1051,"line":1373},[1049,9865,5527],{"class":1253},[1049,9867,2861],{"class":1072},[1049,9869,1264],{"class":1273},[1049,9871,1828],{"class":1267},[1049,9873,3343],{"class":1273},[1049,9875,1277],{"class":1267},[1049,9877,3349],{"class":3348},[1049,9879,1679],{"class":1267},[1049,9881,3354],{"class":1273},[1049,9883,1277],{"class":1267},[1049,9885,1354],{"class":1267},[1049,9887,3361],{"class":1059},[1049,9889,1292],{"class":1267},[1049,9891,1679],{"class":1267},[1049,9893,5556],{"class":1273},[1049,9895,1277],{"class":1267},[1049,9897,5561],{"class":1429},[1049,9899,1695],{"class":1267},[1049,9901,1454],{"class":1273},[1049,9903,9904],{"class":1051,"line":1396},[1049,9905,5013],{"class":1267},[1049,9907,9908],{"class":1051,"line":1401},[1049,9909,1332],{"emptyLinePlaceholder":21},[1049,9911,9912,9914,9916,9918,9920,9922,9924],{"class":1051,"line":1411},[1049,9913,4743],{"class":1550},[1049,9915,4746],{"class":1263},[1049,9917,1554],{"class":1267},[1049,9919,4751],{"class":1072},[1049,9921,1264],{"class":1263},[1049,9923,4756],{"class":1267},[1049,9925,1454],{"class":1263},[1049,9927,9928],{"class":1051,"line":1421},[1049,9929,1332],{"emptyLinePlaceholder":21},[1049,9931,9932,9934,9936,9938,9940,9942,9944],{"class":1051,"line":1437},[1049,9933,4743],{"class":1550},[1049,9935,5605],{"class":1263},[1049,9937,1554],{"class":1267},[1049,9939,1865],{"class":1267},[1049,9941,5398],{"class":1072},[1049,9943,1264],{"class":1263},[1049,9945,1268],{"class":1267},[1049,9947,9948,9950,9952,9954,9956,9958,9960,9962],{"class":1051,"line":1443},[1049,9949,1761],{"class":1273},[1049,9951,1277],{"class":1267},[1049,9953,5625],{"class":1263},[1049,9955,1771],{"class":1267},[1049,9957,4810],{"class":1263},[1049,9959,1771],{"class":1267},[1049,9961,1980],{"class":1263},[1049,9963,1295],{"class":1267},[1049,9965,9966,9968,9970,9972,9974,9976,9978,9980],{"class":1051,"line":1448},[1049,9967,1921],{"class":1273},[1049,9969,1277],{"class":1267},[1049,9971,5625],{"class":1263},[1049,9973,1771],{"class":1267},[1049,9975,4810],{"class":1263},[1049,9977,1771],{"class":1267},[1049,9979,1959],{"class":1263},[1049,9981,1295],{"class":1267},[1049,9983,9984,9986,9988,9990,9992,9994],{"class":1051,"line":2237},[1049,9985,5660],{"class":1273},[1049,9987,1277],{"class":1267},[1049,9989,1865],{"class":1267},[1049,9991,5378],{"class":1072},[1049,9993,1264],{"class":1263},[1049,9995,1268],{"class":1267},[1049,9997,9998,10000,10002,10004,10006,10008,10010,10012,10014,10016,10018,10020],{"class":1051,"line":2250},[1049,9999,5676],{"class":1273},[1049,10001,1277],{"class":1267},[1049,10003,3459],{"class":1267},[1049,10005,5481],{"class":1059},[1049,10007,4997],{"class":1267},[1049,10009,5515],{"class":1263},[1049,10011,1771],{"class":1267},[1049,10013,4810],{"class":1263},[1049,10015,1771],{"class":1267},[1049,10017,1980],{"class":1263},[1049,10019,5006],{"class":1267},[1049,10021,1295],{"class":1267},[1049,10023,10024,10026,10028],{"class":1051,"line":2280},[1049,10025,4894],{"class":1273},[1049,10027,1277],{"class":1267},[1049,10029,1343],{"class":1267},[1049,10031,10033,10035,10037,10039,10041,10043],{"class":10032,"line":2286},[1051,1532],[1049,10034,3438],{"class":1273},[1049,10036,1277],{"class":1267},[1049,10038,3114],{"class":1263},[1049,10040,1771],{"class":1267},[1049,10042,9557],{"class":1263},[1049,10044,10045],{"class":1433},"// Pass the selected model\n",[1049,10047,10049],{"class":10048,"line":2291},[1051,1532],[1049,10050,1440],{"class":1267},[1049,10052,10054,10056,10058],{"class":10053,"line":2323},[1051,1532],[1049,10055,2376],{"class":1267},[1049,10057,1845],{"class":1263},[1049,10059,1295],{"class":1267},[1049,10061,10062,10064,10066,10068,10070],{"class":1051,"line":2339},[1049,10063,5712],{"class":1273},[1049,10065,1264],{"class":1267},[1049,10067,5717],{"class":1905},[1049,10069,1845],{"class":1267},[1049,10071,1343],{"class":1267},[1049,10073,10074,10076,10078,10080,10082,10084,10086,10088,10090,10092,10094],{"class":1051,"line":2357},[1049,10075,5733],{"class":1253},[1049,10077,1914],{"class":1273},[1049,10079,5717],{"class":1263},[1049,10081,1771],{"class":1267},[1049,10083,5742],{"class":1263},[1049,10085,3638],{"class":1267},[1049,10087,1354],{"class":1267},[1049,10089,3924],{"class":1059},[1049,10091,1292],{"class":1267},[1049,10093,3326],{"class":1273},[1049,10095,1268],{"class":1267},[1049,10097,10098,10100,10102,10104,10106,10108],{"class":1051,"line":2373},[1049,10099,5760],{"class":1072},[1049,10101,1264],{"class":1273},[1049,10103,1292],{"class":1267},[1049,10105,1750],{"class":1059},[1049,10107,1292],{"class":1267},[1049,10109,1454],{"class":1273},[1049,10111,10112],{"class":1051,"line":2381},[1049,10113,1440],{"class":1267},[1049,10115,10116],{"class":1051,"line":3331},[1049,10117,1365],{"class":1267},[1049,10119,10120,10122,10124,10126,10128],{"class":1051,"line":3370},[1049,10121,5786],{"class":1273},[1049,10123,1264],{"class":1267},[1049,10125,5791],{"class":1905},[1049,10127,1845],{"class":1267},[1049,10129,1343],{"class":1267},[1049,10131,10132,10134,10136,10138,10140],{"class":1051,"line":3376},[1049,10133,5801],{"class":1263},[1049,10135,1771],{"class":1267},[1049,10137,5806],{"class":1072},[1049,10139,1264],{"class":1273},[1049,10141,1268],{"class":1267},[1049,10143,10144,10146,10148,10150,10152,10154],{"class":1051,"line":3381},[1049,10145,5816],{"class":1273},[1049,10147,1277],{"class":1267},[1049,10149,1354],{"class":1267},[1049,10151,471],{"class":1059},[1049,10153,1292],{"class":1267},[1049,10155,1295],{"class":1267},[1049,10157,10158,10160,10162,10164,10166,10168],{"class":1051,"line":3387},[1049,10159,5832],{"class":1273},[1049,10161,1277],{"class":1267},[1049,10163,5837],{"class":1263},[1049,10165,1771],{"class":1267},[1049,10167,4077],{"class":1263},[1049,10169,1295],{"class":1267},[1049,10171,10172,10174,10176,10178,10180],{"class":1051,"line":3407},[1049,10173,5849],{"class":1273},[1049,10175,1277],{"class":1267},[1049,10177,1354],{"class":1267},[1049,10179,5791],{"class":1059},[1049,10181,1318],{"class":1267},[1049,10183,10184,10186],{"class":1051,"line":3435},[1049,10185,3501],{"class":1267},[1049,10187,1454],{"class":1273},[1049,10189,10190],{"class":1051,"line":3451},[1049,10191,3373],{"class":1267},[1049,10193,10194,10196],{"class":1051,"line":3470},[1049,10195,1451],{"class":1267},[1049,10197,1454],{"class":1263},[1049,10199,10200],{"class":1051,"line":3498},[1049,10201,1332],{"emptyLinePlaceholder":21},[1049,10203,10204,10206,10208,10210,10212,10214,10216,10218],{"class":1051,"line":3506},[1049,10205,5886],{"class":1550},[1049,10207,5889],{"class":1072},[1049,10209,1264],{"class":1267},[1049,10211,5894],{"class":1905},[1049,10213,1277],{"class":1267},[1049,10215,5899],{"class":1055},[1049,10217,1845],{"class":1267},[1049,10219,1343],{"class":1267},[1049,10221,10222,10224,10226,10228],{"class":1051,"line":3511},[1049,10223,5908],{"class":1263},[1049,10225,1771],{"class":1267},[1049,10227,5913],{"class":1072},[1049,10229,2631],{"class":1273},[1049,10231,10232,10234,10236,10238,10240,10242,10244,10246,10248],{"class":1051,"line":3577},[1049,10233,3316],{"class":1253},[1049,10235,1914],{"class":1273},[1049,10237,4805],{"class":1263},[1049,10239,1771],{"class":1267},[1049,10241,4810],{"class":1263},[1049,10243,1771],{"class":1267},[1049,10245,4815],{"class":1072},[1049,10247,4818],{"class":1273},[1049,10249,1268],{"class":1267},[1049,10251,10252,10254,10256,10258,10260,10262,10264,10266,10268,10270,10272,10274],{"class":1051,"line":3582},[1049,10253,5940],{"class":1263},[1049,10255,1771],{"class":1267},[1049,10257,5945],{"class":1072},[1049,10259,1264],{"class":1273},[1049,10261,1828],{"class":1267},[1049,10263,1682],{"class":1273},[1049,10265,1277],{"class":1267},[1049,10267,4951],{"class":1263},[1049,10269,1771],{"class":1267},[1049,10271,4810],{"class":1263},[1049,10273,1695],{"class":1267},[1049,10275,1454],{"class":1273},[1049,10277,10278,10280,10282,10284,10286],{"class":1051,"line":3587},[1049,10279,5968],{"class":1263},[1049,10281,1771],{"class":1267},[1049,10283,4810],{"class":1263},[1049,10285,2585],{"class":1267},[1049,10287,5977],{"class":1267},[1049,10289,10290],{"class":1051,"line":3593},[1049,10291,3373],{"class":1267},[1049,10293,10294],{"class":1051,"line":3623},[1049,10295,5013],{"class":1267},[1049,10297,10298],{"class":1051,"line":3665},[1049,10299,1332],{"emptyLinePlaceholder":21},[1049,10301,10302,10304,10306,10308,10310],{"class":1051,"line":3694},[1049,10303,5999],{"class":1072},[1049,10305,1264],{"class":1263},[1049,10307,1768],{"class":1267},[1049,10309,1788],{"class":1550},[1049,10311,1343],{"class":1267},[1049,10313,10314,10316,10318,10320,10322,10324,10326,10328,10330,10332,10334,10336,10338],{"class":1051,"line":3706},[1049,10315,3316],{"class":1253},[1049,10317,1914],{"class":1273},[1049,10319,5515],{"class":1263},[1049,10321,1771],{"class":1267},[1049,10323,4810],{"class":1263},[1049,10325,3633],{"class":1267},[1049,10327,1959],{"class":1263},[1049,10329,1771],{"class":1267},[1049,10331,3611],{"class":1263},[1049,10333,3638],{"class":1267},[1049,10335,3617],{"class":3348},[1049,10337,3326],{"class":1273},[1049,10339,1268],{"class":1267},[1049,10341,10342,10344,10346,10348],{"class":1051,"line":3722},[1049,10343,5940],{"class":1263},[1049,10345,1771],{"class":1267},[1049,10347,6044],{"class":1072},[1049,10349,2631],{"class":1273},[1049,10351,10352],{"class":1051,"line":3736},[1049,10353,3373],{"class":1267},[1049,10355,10356,10358],{"class":1051,"line":3743},[1049,10357,1451],{"class":1267},[1049,10359,1454],{"class":1263},[1049,10361,10362,10364,10366],{"class":1051,"line":3748},[1049,10363,1598],{"class":1267},[1049,10365,4722],{"class":1273},[1049,10367,1528],{"class":1267},[1049,10369,10370],{"class":1051,"line":3753},[1049,10371,1332],{"emptyLinePlaceholder":21},[1049,10373,10374,10376,10378],{"class":1051,"line":3759},[1049,10375,1522],{"class":1267},[1049,10377,1525],{"class":1273},[1049,10379,1528],{"class":1267},[1049,10381,10382,10384,10386,10388,10390,10392,10394,10396],{"class":1051,"line":3776},[1049,10383,1535],{"class":1267},[1049,10385,5040],{"class":1273},[1049,10387,5043],{"class":1550},[1049,10389,1554],{"class":1267},[1049,10391,1481],{"class":1267},[1049,10393,5050],{"class":1059},[1049,10395,1481],{"class":1267},[1049,10397,1528],{"class":1267},[1049,10399,10400,10402,10404,10406,10408],{"class":1051,"line":3798},[1049,10401,1544],{"class":1267},[1049,10403,1525],{"class":1273},[1049,10405,5063],{"class":1267},[1049,10407,7744],{"class":1550},[1049,10409,1528],{"class":1267},[1049,10411,10412,10414,10416],{"class":1051,"line":3816},[1049,10413,1568],{"class":1267},[1049,10415,7754],{"class":1273},[1049,10417,1574],{"class":1267},[1049,10419,10420,10422,10424],{"class":1051,"line":3824},[1049,10421,1579],{"class":1267},[1049,10423,1525],{"class":1273},[1049,10425,1528],{"class":1267},[1049,10427,10428,10430,10432,10434,10436],{"class":1051,"line":3841},[1049,10429,1544],{"class":1267},[1049,10431,1525],{"class":1273},[1049,10433,5063],{"class":1267},[1049,10435,5066],{"class":1550},[1049,10437,1528],{"class":1267},[1049,10439,10440,10442,10444,10446,10448,10450,10452,10454],{"class":1051,"line":3860},[1049,10441,1568],{"class":1267},[1049,10443,5075],{"class":1273},[1049,10445,5078],{"class":1550},[1049,10447,1554],{"class":1267},[1049,10449,1481],{"class":1267},[1049,10451,6121],{"class":1059},[1049,10453,1481],{"class":1267},[1049,10455,1528],{"class":1267},[1049,10457,10458,10460],{"class":1051,"line":3868},[1049,10459,5094],{"class":1267},[1049,10461,6132],{"class":1273},[1049,10463,10464,10466,10468,10470,10472],{"class":1051,"line":3873},[1049,10465,6137],{"class":1550},[1049,10467,1554],{"class":1267},[1049,10469,1481],{"class":1267},[1049,10471,6144],{"class":1059},[1049,10473,5151],{"class":1267},[1049,10475,10476,10478,10480,10482,10484],{"class":1051,"line":3879},[1049,10477,5157],{"class":1550},[1049,10479,1554],{"class":1267},[1049,10481,1481],{"class":1267},[1049,10483,6157],{"class":1059},[1049,10485,5151],{"class":1267},[1049,10487,10488],{"class":1051,"line":3899},[1049,10489,6164],{"class":1550},[1049,10491,10492,10494,10496,10498,10500],{"class":1051,"line":3914},[1049,10493,6169],{"class":1550},[1049,10495,1554],{"class":1267},[1049,10497,1481],{"class":1267},[1049,10499,6176],{"class":1059},[1049,10501,5151],{"class":1267},[1049,10503,10504],{"class":1051,"line":3931},[1049,10505,5217],{"class":1267},[1049,10507,10508,10510,10512,10514,10516,10518,10520,10522,10524,10526,10528],{"class":1051,"line":3955},[1049,10509,5223],{"class":1267},[1049,10511,1525],{"class":1273},[1049,10513,5063],{"class":1267},[1049,10515,344],{"class":1550},[1049,10517,1554],{"class":1267},[1049,10519,1481],{"class":1267},[1049,10521,1828],{"class":1267},[1049,10523,6201],{"class":1263},[1049,10525,1451],{"class":1267},[1049,10527,1481],{"class":1267},[1049,10529,1528],{"class":1267},[1049,10531,10532,10534,10536,10538,10540,10542,10544,10546,10548,10550,10552,10554,10556,10558,10560,10562,10564,10566,10568,10570,10572,10574,10576,10578,10580,10582,10584,10586,10588,10590,10592,10594],{"class":1051,"line":3966},[1049,10533,6212],{"class":1267},[1049,10535,1525],{"class":1273},[1049,10537,6217],{"class":1253},[1049,10539,1554],{"class":1267},[1049,10541,1481],{"class":1267},[1049,10543,6224],{"class":1263},[1049,10545,1679],{"class":1267},[1049,10547,6229],{"class":1263},[1049,10549,6232],{"class":1267},[1049,10551,2580],{"class":1263},[1049,10553,1771],{"class":1267},[1049,10555,2161],{"class":1263},[1049,10557,1481],{"class":1267},[1049,10559,6243],{"class":1267},[1049,10561,6246],{"class":1550},[1049,10563,1554],{"class":1267},[1049,10565,6251],{"class":1267},[1049,10567,4077],{"class":1263},[1049,10569,1771],{"class":1267},[1049,10571,1980],{"class":1263},[1049,10573,1451],{"class":1267},[1049,10575,6262],{"class":1059},[1049,10577,4997],{"class":1267},[1049,10579,6267],{"class":1263},[1049,10581,1771],{"class":1267},[1049,10583,5742],{"class":1263},[1049,10585,1451],{"class":1267},[1049,10587,6262],{"class":1059},[1049,10589,4997],{"class":1267},[1049,10591,6280],{"class":1263},[1049,10593,6283],{"class":1267},[1049,10595,1528],{"class":1267},[1049,10597,10598,10600,10602,10604,10606,10608,10610,10612,10614,10616,10618,10620,10622,10624,10626,10628,10630,10632,10634,10636,10638,10640,10642],{"class":1051,"line":3974},[1049,10599,6290],{"class":1267},[1049,10601,6293],{"class":1273},[1049,10603,6296],{"class":1550},[1049,10605,1554],{"class":1267},[1049,10607,1481],{"class":1267},[1049,10609,6303],{"class":1059},[1049,10611,1481],{"class":1267},[1049,10613,6308],{"class":1550},[1049,10615,1554],{"class":1267},[1049,10617,1481],{"class":1267},[1049,10619,6315],{"class":1059},[1049,10621,1481],{"class":1267},[1049,10623,6320],{"class":1550},[1049,10625,1554],{"class":1267},[1049,10627,1481],{"class":1267},[1049,10629,6327],{"class":1059},[1049,10631,1481],{"class":1267},[1049,10633,5078],{"class":1550},[1049,10635,1554],{"class":1267},[1049,10637,1481],{"class":1267},[1049,10639,6338],{"class":1059},[1049,10641,1481],{"class":1267},[1049,10643,1574],{"class":1267},[1049,10645,10646,10648,10650,10652,10654,10656,10658,10660,10662,10664,10666,10668,10670,10672,10674,10676,10678],{"class":1051,"line":3980},[1049,10647,6290],{"class":1267},[1049,10649,949],{"class":1273},[1049,10651,6351],{"class":1550},[1049,10653,1554],{"class":1267},[1049,10655,1481],{"class":1267},[1049,10657,6358],{"class":1059},[1049,10659,1481],{"class":1267},[1049,10661,5078],{"class":1550},[1049,10663,1554],{"class":1267},[1049,10665,1481],{"class":1267},[1049,10667,6369],{"class":1059},[1049,10669,1481],{"class":1267},[1049,10671,2628],{"class":1267},[1049,10673,6376],{"class":1263},[1049,10675,1598],{"class":1267},[1049,10677,949],{"class":1273},[1049,10679,1528],{"class":1267},[1049,10681,10682,10684,10686],{"class":1051,"line":3985},[1049,10683,6387],{"class":1267},[1049,10685,1525],{"class":1273},[1049,10687,1528],{"class":1267},[1049,10689,10690,10692,10694],{"class":1051,"line":4008},[1049,10691,6396],{"class":1267},[1049,10693,1525],{"class":1273},[1049,10695,1528],{"class":1267},[1049,10697,10698,10700,10702],{"class":1051,"line":4014},[1049,10699,5120],{"class":1267},[1049,10701,4693],{"class":1273},[1049,10703,1528],{"class":1267},[1049,10705,10706],{"class":1051,"line":4034},[1049,10707,1332],{"emptyLinePlaceholder":21},[1049,10709,10710,10712],{"class":1051,"line":4040},[1049,10711,5094],{"class":1267},[1049,10713,5136],{"class":1273},[1049,10715,10716,10718,10720,10722,10724],{"class":1051,"line":4086},[1049,10717,5142],{"class":1550},[1049,10719,1554],{"class":1267},[1049,10721,1481],{"class":1267},[1049,10723,4805],{"class":1059},[1049,10725,5151],{"class":1267},[1049,10727,10728,10730,10732,10734,10736],{"class":1051,"line":4102},[1049,10729,6435],{"class":1550},[1049,10731,1554],{"class":1267},[1049,10733,1481],{"class":1267},[1049,10735,6442],{"class":1059},[1049,10737,5151],{"class":1267},[1049,10739,10740,10742,10744,10746,10748],{"class":1051,"line":4135},[1049,10741,5172],{"class":1550},[1049,10743,1554],{"class":1267},[1049,10745,1481],{"class":1267},[1049,10747,5179],{"class":1059},[1049,10749,5151],{"class":1267},[1049,10751,10752,10754,10756,10758,10760],{"class":1051,"line":4149},[1049,10753,6169],{"class":1550},[1049,10755,1554],{"class":1267},[1049,10757,1481],{"class":1267},[1049,10759,6467],{"class":1059},[1049,10761,5151],{"class":1267},[1049,10763,10764,10766,10768,10770,10772],{"class":1051,"line":4157},[1049,10765,5202],{"class":1550},[1049,10767,1554],{"class":1267},[1049,10769,1481],{"class":1267},[1049,10771,6480],{"class":1059},[1049,10773,5151],{"class":1267},[1049,10775,10776],{"class":1051,"line":4162},[1049,10777,5217],{"class":1267},[1049,10779,10780,10782,10784,10786,10789],{"class":1051,"line":4169},[1049,10781,5223],{"class":1267},[1049,10783,1525],{"class":1273},[1049,10785,5063],{"class":1267},[1049,10787,10788],{"class":1550},"footer",[1049,10790,1528],{"class":1267},[1049,10792,10793,10795,10798,10801,10803,10805,10807,10809],{"class":1051,"line":4174},[1049,10794,6212],{"class":1267},[1049,10796,10797],{"class":1273},"ModelSelect",[1049,10799,10800],{"class":1550}," v-model",[1049,10802,1554],{"class":1267},[1049,10804,1481],{"class":1267},[1049,10806,4248],{"class":1059},[1049,10808,1481],{"class":1267},[1049,10810,1574],{"class":1267},[1049,10812,10814,10816,10818],{"class":10813,"line":4192},[1051,1532],[1049,10815,6396],{"class":1267},[1049,10817,1525],{"class":1273},[1049,10819,1528],{"class":1267},[1049,10821,10823],{"class":10822,"line":6555},[1051,1532],[1049,10824,1332],{"emptyLinePlaceholder":21},[1049,10826,10828,10830],{"class":10827,"line":6564},[1051,1532],[1049,10829,5223],{"class":1267},[1049,10831,6493],{"class":1273},[1049,10833,10834,10836,10838,10840,10842],{"class":1051,"line":6573},[1049,10835,6498],{"class":1550},[1049,10837,1554],{"class":1267},[1049,10839,1481],{"class":1267},[1049,10841,6157],{"class":1059},[1049,10843,5151],{"class":1267},[1049,10845,10846,10848,10850,10852,10854],{"class":1051,"line":6582},[1049,10847,6511],{"class":1550},[1049,10849,1554],{"class":1267},[1049,10851,1481],{"class":1267},[1049,10853,5236],{"class":1059},[1049,10855,5151],{"class":1267},[1049,10857,10858,10860,10862,10864,10866],{"class":1051,"line":6591},[1049,10859,6524],{"class":1550},[1049,10861,1554],{"class":1267},[1049,10863,1481],{"class":1267},[1049,10865,6531],{"class":1059},[1049,10867,5151],{"class":1267},[1049,10869,10870,10872,10874,10876,10878],{"class":1051,"line":9101},[1049,10871,6538],{"class":1550},[1049,10873,1554],{"class":1267},[1049,10875,1481],{"class":1267},[1049,10877,6545],{"class":1059},[1049,10879,5151],{"class":1267},[1049,10881,10882],{"class":1051,"line":9110},[1049,10883,6552],{"class":1267},[1049,10885,10886,10888,10890],{"class":1051,"line":9119},[1049,10887,5120],{"class":1267},[1049,10889,4687],{"class":1273},[1049,10891,1528],{"class":1267},[1049,10893,10895,10897,10899],{"class":1051,"line":10894},94,[1049,10896,5254],{"class":1267},[1049,10898,5075],{"class":1273},[1049,10900,1528],{"class":1267},[1049,10902,10904,10906,10908],{"class":1051,"line":10903},95,[1049,10905,1579],{"class":1267},[1049,10907,1525],{"class":1273},[1049,10909,1528],{"class":1267},[1049,10911,10913,10915,10917],{"class":1051,"line":10912},96,[1049,10914,1589],{"class":1267},[1049,10916,5040],{"class":1273},[1049,10918,1528],{"class":1267},[1049,10920,10922,10924,10926],{"class":1051,"line":10921},97,[1049,10923,1598],{"class":1267},[1049,10925,1525],{"class":1273},[1049,10927,1528],{"class":1267},[953,10929,10931],{"id":10930},"going-further","Going further",[949,10933,10934],{},"You now have a working AI chatbot with database persistence! To take it further, consider adding:",[949,10936,10937],{},[967,10938,10939],{},"User Authentication",[949,10941,10942,10943,10948],{},"Add authentication with ",[1024,10944,10947],{"href":10945,"rel":10946},"https://github.com/atinux/nuxt-auth-utils",[1028],"nuxt-auth-utils"," to let users access their chat history across devices and keep conversations private.",[949,10950,10951],{},[967,10952,141],{},[949,10954,10955,10956,10961],{},"Extend your chatbot with ",[1024,10957,10960],{"href":10958,"rel":10959},"https://ai-sdk.dev/docs/ai-sdk-core/tools-and-tool-calling",[1028],"AI SDK tools"," that can fetch real-time data, generate charts, or interact with external APIs:",[1039,10963,10965],{"className":1244,"code":10964,"language":1246,"meta":1044,"style":1044},"import { tool } from 'ai'\nimport { z } from 'zod'\n\nconst weatherTool = tool({\n  description: 'Get the current weather for a location',\n  parameters: z.object({\n    location: z.string().describe('The city name')\n  }),\n  execute: async ({ location }) => {\n    // Fetch weather data from an API\n    return { location, temperature: 22, condition: 'Sunny' }\n  }\n})\n",[1046,10966,10967,10986,11004,11008,11023,11039,11056,11087,11095,11115,11120,11155,11159],{"__ignoreMap":1044},[1049,10968,10969,10971,10973,10976,10978,10980,10982,10984],{"class":1051,"line":1052},[1049,10970,1670],{"class":1253},[1049,10972,1673],{"class":1267},[1049,10974,10975],{"class":1263}," tool",[1049,10977,1695],{"class":1267},[1049,10979,1698],{"class":1253},[1049,10981,1354],{"class":1267},[1049,10983,2496],{"class":1059},[1049,10985,1318],{"class":1267},[1049,10987,10988,10990,10992,10994,10996,10998,11000,11002],{"class":1051,"line":1069},[1049,10989,1670],{"class":1253},[1049,10991,1673],{"class":1267},[1049,10993,2531],{"class":1263},[1049,10995,1695],{"class":1267},[1049,10997,1698],{"class":1253},[1049,10999,1354],{"class":1267},[1049,11001,2540],{"class":1059},[1049,11003,1318],{"class":1267},[1049,11005,11006],{"class":1051,"line":1283},[1049,11007,1332],{"emptyLinePlaceholder":21},[1049,11009,11010,11012,11015,11017,11019,11021],{"class":1051,"line":1298},[1049,11011,4743],{"class":1550},[1049,11013,11014],{"class":1263}," weatherTool ",[1049,11016,1554],{"class":1267},[1049,11018,10975],{"class":1072},[1049,11020,1264],{"class":1263},[1049,11022,1268],{"class":1267},[1049,11024,11025,11028,11030,11032,11035,11037],{"class":1051,"line":1310},[1049,11026,11027],{"class":1273},"  description",[1049,11029,1277],{"class":1267},[1049,11031,1354],{"class":1267},[1049,11033,11034],{"class":1059},"Get the current weather for a location",[1049,11036,1292],{"class":1267},[1049,11038,1295],{"class":1267},[1049,11040,11041,11044,11046,11048,11050,11052,11054],{"class":1051,"line":1321},[1049,11042,11043],{"class":1273},"  parameters",[1049,11045,1277],{"class":1267},[1049,11047,2531],{"class":1263},[1049,11049,1771],{"class":1267},[1049,11051,2603],{"class":1072},[1049,11053,1264],{"class":1263},[1049,11055,1268],{"class":1267},[1049,11057,11058,11061,11063,11065,11067,11069,11071,11073,11076,11078,11080,11083,11085],{"class":1051,"line":1329},[1049,11059,11060],{"class":1273},"    location",[1049,11062,1277],{"class":1267},[1049,11064,2531],{"class":1263},[1049,11066,1771],{"class":1267},[1049,11068,3087],{"class":1072},[1049,11070,1768],{"class":1263},[1049,11072,1771],{"class":1267},[1049,11074,11075],{"class":1072},"describe",[1049,11077,1264],{"class":1263},[1049,11079,1292],{"class":1267},[1049,11081,11082],{"class":1059},"The city name",[1049,11084,1292],{"class":1267},[1049,11086,1454],{"class":1263},[1049,11088,11089,11091,11093],{"class":1051,"line":1335},[1049,11090,2376],{"class":1267},[1049,11092,1845],{"class":1263},[1049,11094,1295],{"class":1267},[1049,11096,11097,11100,11102,11104,11106,11109,11111,11113],{"class":1051,"line":1346},[1049,11098,11099],{"class":1072},"  execute",[1049,11101,1277],{"class":1267},[1049,11103,3784],{"class":1550},[1049,11105,1902],{"class":1267},[1049,11107,11108],{"class":1905}," location",[1049,11110,1909],{"class":1267},[1049,11112,1788],{"class":1550},[1049,11114,1343],{"class":1267},[1049,11116,11117],{"class":1051,"line":1362},[1049,11118,11119],{"class":1433},"    // Fetch weather data from an API\n",[1049,11121,11122,11125,11127,11129,11131,11134,11136,11139,11141,11144,11146,11148,11151,11153],{"class":1051,"line":1368},[1049,11123,11124],{"class":1253},"    return",[1049,11126,1673],{"class":1267},[1049,11128,11108],{"class":1263},[1049,11130,1679],{"class":1267},[1049,11132,11133],{"class":1273}," temperature",[1049,11135,1277],{"class":1267},[1049,11137,11138],{"class":3348}," 22",[1049,11140,1679],{"class":1267},[1049,11142,11143],{"class":1273}," condition",[1049,11145,1277],{"class":1267},[1049,11147,1354],{"class":1267},[1049,11149,11150],{"class":1059},"Sunny",[1049,11152,1292],{"class":1267},[1049,11154,9324],{"class":1267},[1049,11156,11157],{"class":1051,"line":1373},[1049,11158,3373],{"class":1267},[1049,11160,11161,11163],{"class":1051,"line":1396},[1049,11162,1451],{"class":1267},[1049,11164,1454],{"class":1263},[996,11166,11168],{"icon":11167,"target":999,"to":1000},"i-lucide-rocket",[949,11169,11170,11171,11173,11174,1771],{},"The official ",[967,11172,1006],{}," includes all these features and more. Get started instantly with ",[1046,11175,11176],{},"npx nuxi@latest init -t ui/chat my-chat-app",[953,11178,11180],{"id":11179},"deploying-to-vercel","Deploying to Vercel",[949,11182,11183],{},"Deploy your chatbot to Vercel with zero configuration:",[1039,11185,11187],{"className":1041,"code":11186,"language":1043,"meta":1044,"style":1044},"npx vercel deploy\n",[1046,11188,11189],{"__ignoreMap":1044},[1049,11190,11191,11193,11196],{"class":1051,"line":1052},[1049,11192,1056],{"class":1055},[1049,11194,11195],{"class":1059}," vercel",[1049,11197,11198],{"class":1059}," deploy\n",[949,11200,11201],{},"Then, in the Vercel dashboard:",[961,11203,11204,11210],{},[964,11205,11206,11207,11209],{},"Enable ",[967,11208,4204],{}," and add credits so requests can be processed.",[964,11211,11212,11213,11216],{},"Add a ",[967,11214,11215],{},"Turso"," database from the Vercel Marketplace and connect it to your project (it will provision the database and add the required environment variables automatically).",[11218,11219,11220],"blockquote",{},[949,11221,11222,11223,11228,11229,11231],{},"Note: On Vercel, you ",[967,11224,11225,11226],{},"don’t need to manually add ",[1046,11227,1621],{}," — Vercel handles the gateway configuration for deployments. Keep using ",[1046,11230,1608],{}," locally for development.",[1628,11233,11234],{"to":1026,"target":999},[949,11235,11236,11237,1771],{},"Learn more about setting up AI Gateway in the ",[967,11238,11239],{},"Vercel AI Gateway documentation",[953,11241,11243],{"id":11242},"conclusion","Conclusion",[949,11245,11246],{},"You've built a complete AI chatbot with:",[961,11248,11249,11255,11261,11266,11271],{},[964,11250,11251,11254],{},[967,11252,11253],{},"A complete chat interface"," using Nuxt UI components",[964,11256,11257,11260],{},[967,11258,11259],{},"Real-time streaming responses"," with the AI SDK",[964,11262,11263,11265],{},[967,11264,981],{}," with MDC for rich content display",[964,11267,11268,11270],{},[967,11269,987],{}," via AI Gateway",[964,11272,11273,11276],{},[967,11274,11275],{},"Database persistence"," with SQLite (local) / Turso (production) and Drizzle ORM",[949,11278,11279],{},"The combination of Nuxt's full-stack capabilities, Nuxt UI's purpose-built chat components, a local SQLite dev database with a production Turso database, and the AI SDK's streaming infrastructure makes building AI applications straightforward and enjoyable.",[949,11281,11282],{},[967,11283,11284],{},"Resources:",[961,11286,11287,11294,11301,11308,11314],{},[964,11288,11289],{},[1024,11290,11293],{"href":11291,"rel":11292},"https://ui.nuxt.com/components/chat-messages",[1028],"Nuxt UI Chat Components",[964,11295,11296],{},[1024,11297,11300],{"href":11298,"rel":11299},"https://hub.nuxt.com/docs/features/database",[1028],"NuxtHub Database",[964,11302,11303],{},[1024,11304,11307],{"href":11305,"rel":11306},"https://ai-sdk.dev",[1028],"AI SDK Documentation",[964,11309,11310],{},[1024,11311,11313],{"href":1026,"rel":11312},[1028],"AI Gateway Documentation",[964,11315,11316],{},[1024,11317,11319],{"href":1000,"rel":11318},[1028],"AI Chat Template",[949,11321,11322],{},"We're excited to see what you'll build!",[11324,11325,11326],"style",{},"html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .s7zQu, html code.shiki .s7zQu{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}html pre.shiki code .sfNiH, html code.shiki .sfNiH{--shiki-light:#FF5370;--shiki-default:#FF9CAC;--shiki-dark:#FF9CAC}html pre.shiki code .sHwdD, html code.shiki .sHwdD{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic}html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .sHdIc, html code.shiki .sHdIc{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#EEFFFF;--shiki-default-font-style:italic;--shiki-dark:#BABED8;--shiki-dark-font-style:italic}html pre.shiki code .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}",{"title":1044,"searchDepth":1069,"depth":1069,"links":11328},[11329,11330,11331,11337,11342,11345,11346,11350,11351,11352,11357,11358,11359],{"id":955,"depth":1069,"text":956},{"id":1010,"depth":1069,"text":1011},{"id":1033,"depth":1069,"text":1034,"children":11332},[11333,11334,11335,11336],{"id":1079,"depth":1283,"text":1080},{"id":1230,"depth":1283,"text":1231},{"id":1499,"depth":1283,"text":1500},{"id":1639,"depth":1283,"text":1640},{"id":2419,"depth":1069,"text":2420,"children":11338},[11339,11340,11341],{"id":2431,"depth":1283,"text":2432},{"id":2814,"depth":1283,"text":2815},{"id":4296,"depth":1283,"text":4297},{"id":4678,"depth":1069,"text":4679,"children":11343},[11344],{"id":4697,"depth":1283,"text":4698},{"id":5317,"depth":1069,"text":5318},{"id":6752,"depth":1069,"text":6753,"children":11347},[11348,11349],{"id":6759,"depth":1283,"text":6760},{"id":6919,"depth":1283,"text":6920},{"id":7417,"depth":1069,"text":7418},{"id":7960,"depth":1069,"text":7961},{"id":9137,"depth":1069,"text":9138,"children":11353},[11354,11355,11356],{"id":9148,"depth":1283,"text":9149},{"id":9419,"depth":1283,"text":9420},{"id":9680,"depth":1283,"text":9681},{"id":10930,"depth":1069,"text":10931},{"id":11179,"depth":1069,"text":11180},{"id":11242,"depth":1069,"text":11243},"2025-12-16T10:00:00.000Z","Learn how to build a full-featured AI chatbot with streaming responses, multiple models support, and a beautiful UI using Nuxt, Nuxt UI, and Vercel AI SDK.","md","/assets/blog/building-nuxt-ai-chatbot.png",{"category":11365},"Tutorial","/blog/how-to-build-an-ai-chat",{"title":933,"description":11361},"blog/how-to-build-an-ai-chat","sF-X00IyVVRUYqwN17Ubpm4H6Z1IRgi6gKRm3dRrqnY",{"data":11371,"body":11372},{},{"type":11373,"children":11374},"root",[11375],{"type":172,"tag":949,"props":11376,"children":11377},{},[11378,11380,11387],{"type":4940,"value":11379},"Nuxt ",{"type":172,"tag":1049,"props":11381,"children":11384},{"className":11382},[11383],"text-primary",[11385],{"type":4940,"value":11386},"UI",{"type":4940,"value":11388}," Blog",{"data":11390,"body":11391},{},{"type":11373,"children":11392},[11393],{"type":172,"tag":949,"props":11394,"children":11395},{},[11396],{"type":4940,"value":921},1769700079635]