1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[90],{2885:function(e,r,t){Promise.resolve().then(t.bind(t,6153))},1003:function(e,r,t){"use strict";t.d(r,{default:function(){return s.a}});var n=t(9618),s=t.n(n)},9393:function(e,r,t){"use strict";Object.defineProperty(r,"$",{enumerable:!0,get:function(){return s}});let n=t(7595);function s(e){let{createServerReference:r}=t(303);return r(e,n.callServer)}},3632:function(e,r,t){"use strict";t.d(r,{EX:function(){return i},tm:function(){return s}}),t(7595);var n=t(9393);(0,n.$)("c1f8925a74d077cce412d5be03b11ad2513510b9");var s=(0,n.$)("a447c5ad48a0dc0b1c471794048f5dc172a927de"),i=(0,n.$)("d38f612940796c215d639d7b682d9e53e99def33")},6153:function(e,r,t){"use strict";t.r(r),t.d(r,{default:function(){return m},maxDuration:function(){return f}});var n=t(6943),s=t(7879),i=t(3632),a=t(7623),o=t(136),l=t(4878),c=t(7156),d=t(1003);function u(){return(0,n.jsx)("div",{className:"max-w-xl mx-auto mt-10",children:(0,n.jsxs)(a.Zb,{children:[(0,n.jsxs)(a.Ol,{children:[(0,n.jsx)(a.ll,{children:"Next AI SDK Lite"}),(0,n.jsx)(a.SZ,{children:"Start streaming UI Components!"})]}),(0,n.jsxs)(a.aY,{className:"text-sm text-muted-foreground/90 leading-normal prose",children:[(0,n.jsx)("p",{className:"mb-3",children:"A simple prompt based way to enter into streaming components./"}),(0,n.jsx)("p",{className:"mb-3",children:"Try asking for the weather in any American city and see what returns. "}),(0,n.jsx)("p",{className:"mb-3",children:"Notice when the component returns you can interact with it! "}),(0,n.jsxs)("p",{children:[(0,n.jsx)(d.default,{href:"https://github.com/mattjared/nextjs-ai-lite",className:"underline",children:"Fork the repo and get hacking"})," "]})]})]})})}let f=30;
1function m(){let[e,r]=(0,s.useState)([]),[t,d]=(0,s.useState)(""),f=async()=>{let{messages:n}=await (0,i.EX)([...e.map(e=>{let{role:r,content:t}=e;return{role:r,content:t}}),{role:"user",content:t}]);d(""),r(n)};return(0,n.jsx)("div",{className:"relative flex h-[calc(100vh_-_theme(spacing.16))] overflow-hidden pb-10 flex-col",children:(0,n.jsxs)("div",{className:"group w-full overflow-auto",children:[(0,n.jsxs)("div",{className:"max-w-xl mx-auto mt-10 mb-24",children:[e.length<=0&&(0,n.jsx)(u,{}),e.map((e,r)=>(0,n.jsx)("div",{className:"whitespace-pre-wrap flex mb-5",children:(0,n.jsxs)("div",{className:"".concat("user"===e.role?"bg-slate-200 ml-auto":"bg-transparent w-full"," p-2 rounded-lg"),children:[(0,n.jsx)("div",{children:e.content}),(0,n.jsx)("div",{children:e.display})]})},r))]}),(0,n.jsx)("div",{className:"fixed inset-x-0 bottom-10 w-full ",children:(0,n.jsx)("div",{className:"w-full max-w-xl mx-auto",children:(0,n.jsx)(a.Zb,{className:"p-2",children:(0,n.jsxs)("div",{className:"flex",children:[(0,n.jsx)(o.I,{type:"text",value:t,onKeyDown:e=>{"Enter"===e.key&&f()},onChange:e=>{d(e.target.value)},className:"w-[95%] mr-2 border-0 ring-offset-0 focus-visible:ring-0 focus-visible:outline-none focus:outline-none focus:ring-0 ring-0 focus-visible:border-none border-transparent focus:border-transparent focus-visible:ring-none",placeholder:"Ask me anything..."}),(0,n.jsx)(l.z,{onClick:f,disabled:!t.trim(),children:(0,n.jsx)(c.C,{})})]})})})})]})})}},4878:function(e,r,t){"use strict";t.d(r,{z:function(){return c}});var n=t(6943),s=t(7879),i=t(9644),a=t(8737),o=t(8963);let l=(0,a.j)("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline",opaque:"bg-slate-200 text-slate-400 "},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10",xs:"h-7 rounded px-3 text-sm"}},defaultVariants:{variant:"default",size:"default"}}),c=s.forwardRef((e,r)=>{let{className:t,variant:s,size:a,asChild:c=!1,...d}=e,u=c?i.g7:"button";return(0,n.jsx)(u,{className:(0,o.cn)(l({variant:s,size:a,className:t})),ref:r,...d})});c.displayName="Button"},7623:function(e,r,t){"use strict";t.d(r,{Ol:function(){return o},SZ:function(){return c},Zb:function(){return a},aY:function(){return d},ll:function(){return l}});var n=t(6943),s=t(7879),i=t(8963);let a=s.forwardRef((e,r)=>{let{className:t,...s}=e;return(0,n.jsx)("div",{ref:r,className:(0,i.cn)("rounded-lg border bg-card text-card-foreground shadow-sm",t),...s})});a.displayName="Card";let o=s.forwardRef((e,r)=>{let{className:t,...s}=e;return(0,n.jsx)("div",{ref:r,className:(0,i.cn)("flex flex-col space-y-1.5 p-6",t),...s})});o.displayName="CardHeader";let l=s.forwardRef((e,r)=>{let{className:t,...s}=e;return(0,n.jsx)("h3",{ref:r,className:(0,i.cn)("text-2xl font-semibold leading-none tracking-tight",t),...s})});l.displayName="CardTitle";let c=s.forwardRef((e,r)=>{let{className:t,...s}=e;return(0,n.jsx)("p",{ref:r,className:(0,i.cn)("text-sm text-muted-foreground",t),...s})});c.displayName="CardDescription";let d=s.forwardRef((e,r)=>{let{className:t,...s}=e;return(0,n.jsx)("div",{ref:r,className:(0,i.cn)("p-6 pt-0",t),...s})});d.displayName="CardContent",s.forwardRef((e,r)=>{let{className:t,...s}=e;return(0,n.jsx)("div",{ref:r,className:(0,i.cn)("flex items-center p-6 pt-0",t),...s})}).displayName="CardFooter"},7156:function(e,r,t){"use strict";t.d(r,{C:function(){return o},IconSeparator:function(){return i},IconVercel:function(){return a}});var n=t(6943);t(7879);var s=t(8963);function i(e){let{className:r,...t}=e;return(0,n.jsx)("svg",{fill:"none",shapeRendering:"geometricPrecision",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1",viewBox:"0 0 24 24","aria-hidden":"true",className:(0,s.cn)("size-4",r),...t,children:(0,n.jsx)("path",{d:"M16.88 3.549L7.12 20.451"})})}function a(e){let{className:r,...t}=e;return(0,n.jsx)("svg",{"aria-label":"Vercel logomark",role:"img",viewBox:"0 0 74 64",className:(0,s.cn)("size-4",r),...t,children:(0,n.jsx)("path",{d:"M37.5896 0.25L74.5396 64.25H0.639648L37.5896 0.25Z",fill:"currentColor"})})}function o(e){let{className:r,...t}=e;return(0,n.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 256 256",fill:"currentColor",stroke:"currentColor",strokeWidth:"16",className:(0,s.cn)("size-4",r),...t,children:(0,n.jsx)("path",{d:"M122.34 34.34l72 72a8 8 0 0 1-11.32 11.32L136 59.31V216a8 8 0 0 1-16 0V59.31L73.66 117.66a8 8 0 0 1-11.32-11.32l72-72a8 8 0 0 1 11.32 0Z"})})}},136:function(e,r,t){"use strict";t.d(r,{I:function(){return a}});var n=t(6943),s=t(7879),i=t(8963);let a=s.forwardRef((e,r)=>{let{className:t,type:s,...a}=e;return(0,n.jsx)("input",{type:s,className:(0,i.cn)("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm r
1ing-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",t),ref:r,...a})});a.displayName="Input"},8963:function(e,r,t){"use strict";t.d(r,{cn:function(){return i}});var n=t(1488),s=t(689);function i(){for(var e=arguments.length,r=Array(e),t=0;t<e;t++)r[t]=arguments[t];return(0,s.m6)((0,n.W)(r))}}},function(e){e.O(0,[109,922,465,744],function(){return e(e.s=2885)}),_N_E=e.O()}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.