(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[717],{1479:function(e,t,a){Promise.resolve().then(a.bind(a,7200)),Promise.resolve().then(a.bind(a,4819)),Promise.resolve().then(a.bind(a,3969)),Promise.resolve().then(a.bind(a,7893)),Promise.resolve().then(a.bind(a,908)),Promise.resolve().then(a.bind(a,9125)),Promise.resolve().then(a.bind(a,3261)),Promise.resolve().then(a.bind(a,5589)),Promise.resolve().then(a.bind(a,6956)),Promise.resolve().then(a.bind(a,4156)),Promise.resolve().then(a.bind(a,4560)),Promise.resolve().then(a.bind(a,2133)),Promise.resolve().then(a.bind(a,8771)),Promise.resolve().then(a.bind(a,1681)),Promise.resolve().then(a.bind(a,2623)),Promise.resolve().then(a.bind(a,6910)),Promise.resolve().then(a.bind(a,5317)),Promise.resolve().then(a.bind(a,5614)),Promise.resolve().then(a.bind(a,5565)),Promise.resolve().then(a.bind(a,4190)),Promise.resolve().then(a.bind(a,7471)),Promise.resolve().then(a.t.bind(a,8173,23)),Promise.resolve().then(a.t.bind(a,231,23))},4109:function(e,t,a){"use strict";a.d(t,{NW:function(){return r.default},PC:function(){return l.default},RI:function(){return i.default},RZ:function(){return d.default},kL:function(){return n.default},n9:function(){return o.default},pl:function(){return s.default}});var r=a(5589),n=a(9125);a(4560);var s=a(7893),i=a(3969),o=a(4819),d=a(3261);a(6956);var l=a(7200);a(908),a(4156)},2133:function(e,t,a){"use strict";a.d(t,{ClearHistory:function(){return j}});var r=a(7437),n=a(2265),s=a(6669),i=a(2732),o=a(495);let d=s.fC,l=s.xz,c=s.h_,u=n.forwardRef((e,t)=>{let{className:a,...n}=e;return(0,r.jsx)(s.aV,{className:(0,i.cn)("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",a),...n,ref:t})});u.displayName=s.aV.displayName;let f=n.forwardRef((e,t)=>{let{className:a,...n}=e;return(0,r.jsxs)(c,{children:[(0,r.jsx)(u,{}),(0,r.jsx)(s.VY,{ref:t,className:(0,i.cn)("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",a),...n})]})});f.displayName=s.VY.displayName;let m=e=>{let{className:t,...a}=e;return(0,r.jsx)("div",{className:(0,i.cn)("flex flex-col space-y-2 text-center sm:text-left",t),...a})};m.displayName="AlertDialogHeader";let h=e=>{let{className:t,...a}=e;return(0,r.jsx)("div",{className:(0,i.cn)("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...a})};h.displayName="AlertDialogFooter";let g=n.forwardRef((e,t)=>{let{className:a,...n}=e;return(0,r.jsx)(s.Dx,{ref:t,className:(0,i.cn)("text-lg font-semibold",a),...n})});g.displayName=s.Dx.displayName;let p=n.forwardRef((e,t)=>{let{className:a,...n}=e;return(0,r.jsx)(s.dk,{ref:t,className:(0,i.cn)("text-sm text-muted-foreground",a),...n})});p.displayName=s.dk.displayName;let x=n.forwardRef((e,t)=>{let{className:a,...n}=e;return(0,r.jsx)(s.aU,{ref:t,className:(0,i.cn)((0,o.d)(),a),...n})});x.displayName=s.aU.displayName;let b=n.forwardRef((e,t)=>{let{className:a,...n}=e;return(0,r.jsx)(s.$j,{ref:t,className:(0,i.cn)((0,o.d)({variant:"outline"}),"mt-2 sm:mt-0",a),...n})});b.displayName=s.$j.displayName;var v=a(4343),y=a(7776),N=a(6299),w=a(2560);function j(e){let{empty:t}=e,[a,s]=(0,n.useState)(!1),[i,c]=(0,n.useTransition)();return(0,r.jsxs)(d,{open:a,onOpenChange:s,children:[(0,r.jsx)(l,{asChild:!0,children:(0,r.jsxs)(o.z,{variant:"default",className:"w-full rounded-full gap-2 flex items-center h-12",children:[(0,r.jsx)(w.Z,{className:"size-4.5"}),"Clear History"]})}),(0,r.jsxs)(f,{children:[(0,r.jsxs)(m,{children:[(0,r.jsx)(g,{children:"Are you absolutely sure?"}),(0,r.jsx)(p,{children:"This action cannot be undone. This will permanently delete your history and remove your data from our servers."})]}),(0,r.jsxs)(h,{children:[(0,r.jsx)(b,{disabled:i,children:"Cancel"}),(0,r.jsx)(x,{disabled:i,onClick:e=>{e.preventDefault(),c(async()=>{let e=await (0,v.VB)();(null==e?void 0:e.error)?y.A.error(e.error):y.A.success("History cleared"),s(!1)})},children:i?(0,r.jsx)(N.$,{}):"Clear"})]})]})]})}},8771:function(e,t,a){"use strict";var r=a(7437);a(2265);var n=a(7138),s=a(6463),i=a(2732);let o=e=>{let t=new Date(e),a=new Date,r=new Date;r.setDate(r.getDate()-1);let n=e=>e.toLocaleString("en-US",{hour:"2-digit",minute:"2-digit",hour12:!0});return t.getDate()===a.getDate()&&t.getMonth()===a.getMonth()&&t.getFullYear()===a.getFullYear()?"Today, ".concat(n(t)):t.getDate()===r.getDate()&&t.getMonth()===r.getMonth()&&t.getFullYear()===r.getFullYear()?"Yesterday, ".concat(n(t)):t.toLocaleString("en-US",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!0})};t.default=e=>{let{chat:t}=e,a=(0,s.usePathname)()===t.path;return(0,r.jsxs)(n.default,{href:t.path,className:(0,i.cn)("flex flex-col hover:bg-muted cursor-pointer p-2 rounded-lg",a?"bg-muted/70 border-border":"border-transparent"),children:[(0,r.jsx)("div",{className:"text-sm font-medium truncate select-none",children:t.title}),(0,r.jsx)("div",{className:"text-xs text-muted-foreground",children:o(t.createdAt)})]})}},1681:function(e,t,a){"use strict";a.d(t,{default:function(){return u}});var r=a(7437),n=a(2732),s=a(9512),i=a(6648),o=a(2265),d=a(7818);let l=e=>(0,r.jsx)(o.Fragment,{children:e.children});var c=(0,d.default)(()=>Promise.resolve(l),{ssr:!1}),u=()=>{let{theme:e,systemTheme:t}=(0,s.F)();return(0,r.jsx)("div",{className:"pl-2 pt-2",children:(0,r.jsxs)("a",{href:"/",children:[(0,r.jsx)(c,{children:(0,r.jsx)(i.default,{src:e?"dark"===e?"/images/logo-white.png":"/images/logo-black.png":"dark"===t?"/images/logo-white.png":"/images/logo-black.png",className:(0,n.cn)("h-8 lg:h-full w-auto opacity-90"),alt:"Logo",width:66,height:20})}),(0,r.jsx)("span",{className:"sr-only",children:"BNNGPT"})]})})}},2623:function(e,t,a){"use strict";a.d(t,{ModeToggle:function(){return d}});var r=a(7437);a(2265);var n=a(9512),s=a(6910),i=a(6648),o=a(4109);function d(){let{setTheme:e,theme:t}=(0,n.F)();return(0,r.jsx)(s.DropdownMenuItem,{onClick:()=>{"dark"===t?e("light"):e("dark")},children:(0,r.jsxs)("div",{className:"flex w-full px-1 items-center gap-2 text-sm text-accent-foreground",children:[(0,r.jsx)(i.default,{src:"light"===t?o.NW:o.kL,alt:"light mode"}),(0,r.jsx)("button",{children:"Switch theme"})]})})}},495:function(e,t,a){"use strict";a.d(t,{d:function(){return d},z:function(){return l}});var r=a(7437),n=a(2265),s=a(1538),i=a(2218),o=a(2732);let d=(0,i.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"},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"}},defaultVariants:{variant:"default",size:"default"}}),l=n.forwardRef((e,t)=>{let{className:a,variant:n,size:i,asChild:l=!1,...c}=e,u=l?s.g7:"button";return(0,r.jsx)(u,{className:(0,o.cn)(d({variant:n,size:i,className:a})),ref:t,...c})});l.displayName="Button"},6910:function(e,t,a){"use strict";a.d(t,{DropdownMenu:function(){return c},DropdownMenuContent:function(){return f},DropdownMenuItem:function(){return m},DropdownMenuSeparator:function(){return h},DropdownMenuTrigger:function(){return u}});var r=a(7437),n=a(2265),s=a(9518),i=a(7592),o=a(2468),d=a(8165),l=a(2732);let c=s.fC,u=s.xz;s.ZA,s.Uv,s.Tr,s.Ee,n.forwardRef((e,t)=>{let{className:a,inset:n,children:o,...d}=e;return(0,r.jsxs)(s.fF,{ref:t,className:(0,l.cn)("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",n&&"pl-8",a),...d,children:[o,(0,r.jsx)(i.Z,{className:"ml-auto h-4 w-4"})]})}).displayName=s.fF.displayName,n.forwardRef((e,t)=>{let{className:a,...n}=e;return(0,r.jsx)(s.tu,{ref:t,className:(0,l.cn)("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",a),...n})}).displayName=s.tu.displayName;let f=n.forwardRef((e,t)=>{let{className:a,sideOffset:n=4,...i}=e;return(0,r.jsx)(s.Uv,{children:(0,r.jsx)(s.VY,{ref:t,sideOffset:n,className:(0,l.cn)("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",a),...i})})});f.displayName=s.VY.displayName;let m=n.forwardRef((e,t)=>{let{className:a,inset:n,...i}=e;return(0,r.jsx)(s.ck,{ref:t,className:(0,l.cn)("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",n&&"pl-8",a),...i})});m.displayName=s.ck.displayName,n.forwardRef((e,t)=>{let{className:a,children:n,checked:i,...d}=e;return(0,r.jsxs)(s.oC,{ref:t,className:(0,l.cn)("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",a),checked:i,...d,children:[(0,r.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,r.jsx)(s.wU,{children:(0,r.jsx)(o.Z,{className:"h-4 w-4"})})}),n]})}).displayName=s.oC.displayName,n.forwardRef((e,t)=>{let{className:a,children:n,...i}=e;return(0,r.jsxs)(s.Rk,{ref:t,className:(0,l.cn)("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",a),...i,children:[(0,r.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,r.jsx)(s.wU,{children:(0,r.jsx)(d.Z,{className:"h-2 w-2 fill-current"})})}),n]})}).displayName=s.Rk.displayName,n.forwardRef((e,t)=>{let{className:a,inset:n,...i}=e;return(0,r.jsx)(s.__,{ref:t,className:(0,l.cn)("px-2 py-1.5 text-sm font-semibold",n&&"pl-8",a),...i})}).displayName=s.__.displayName;let h=n.forwardRef((e,t)=>{let{className:a,...n}=e;return(0,r.jsx)(s.Z0,{ref:t,className:(0,l.cn)("-mx-1 my-1 h-px bg-muted",a),...n})});h.displayName=s.Z0.displayName},3513:function(e,t,a){"use strict";a.d(t,{IconLogo:function(){return s}});var r=a(7437),n=a(6648);function s(e){let{className:t}=e;return(0,r.jsx)(n.default,{className:t,src:"/images/bnnlogo.png",alt:"",width:20,height:20})}},5317:function(e,t,a){"use strict";a.d(t,{Sheet:function(){return l},SheetContent:function(){return h},SheetHeader:function(){return g},SheetTitle:function(){return p},SheetTrigger:function(){return c}});var r=a(7437),n=a(2265),s=a(3304),i=a(2218),o=a(4697),d=a(2732);let l=s.fC,c=s.xz;s.x8;let u=s.h_,f=n.forwardRef((e,t)=>{let{className:a,...n}=e;return(0,r.jsx)(s.aV,{className:(0,d.cn)("fixed inset-0 z-50 bg-black/30 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",a),...n,ref:t})});f.displayName=s.aV.displayName;let m=(0,i.j)("fixed z-50 gap-4 bg-background p-4 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),h=n.forwardRef((e,t)=>{let{side:a="right",className:n,children:i,...l}=e;return(0,r.jsxs)(u,{children:[(0,r.jsx)(f,{}),(0,r.jsxs)(s.VY,{ref:t,className:(0,d.cn)(m({side:a}),n),...l,children:[i,(0,r.jsxs)(s.x8,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[(0,r.jsx)(o.Z,{className:"h-4 w-4"}),(0,r.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})});h.displayName=s.VY.displayName;let g=e=>{let{className:t,...a}=e;return(0,r.jsx)("div",{className:(0,d.cn)("flex flex-col space-y-2 text-center sm:text-left",t),...a})};g.displayName="SheetHeader";let p=n.forwardRef((e,t)=>{let{className:a,...n}=e;return(0,r.jsx)(s.Dx,{ref:t,className:(0,d.cn)("text-lg font-semibold text-foreground",a),...n})});p.displayName=s.Dx.displayName,n.forwardRef((e,t)=>{let{className:a,...n}=e;return(0,r.jsx)(s.dk,{ref:t,className:(0,d.cn)("text-sm text-muted-foreground",a),...n})}).displayName=s.dk.displayName},6299:function(e,t,a){"use strict";a.d(t,{$:function(){return n}});var r=a(7437);a(3513);let n=()=>(0,r.jsx)("svg",{fill:"none",stroke:"currentColor",strokeWidth:"1.5",viewBox:"0 0 24 24",strokeLinecap:"round",strokeLinejoin:"round",xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5 animate-spin stroke-zinc-400",children:(0,r.jsx)("path",{d:"M12 3v3m6.366-.366-2.12 2.12M21 12h-3m.366 6.366-2.12-2.12M12 21v-3m-6.366.366 2.12-2.12M3 12h3m-.366-6.366 2.12 2.12"})})},4343:function(e,t,a){"use strict";a.d(t,{I8:function(){return n},VB:function(){return s}}),a(4590);var r=a(8064),n=(0,r.$)("cca16c69673e7f7a9d009d2b06f962eb087f6ddd");(0,r.$)("0eb9ec5547ff9e1c7107ad8e3f9fb568f6b7fc52"),(0,r.$)("df8afe969b73742a512a11003233e545e4406deb");var s=(0,r.$)("e0ffbbd5b24ca3a99606471e24b869aa2f4f7b05");(0,r.$)("a3a1dde8569f077c309252460a1c9539fd4f89e8"),(0,r.$)("446f8b33201e27b976890894dccb07125d5a468b")},2732:function(e,t,a){"use strict";a.d(t,{cn:function(){return s}});var r=a(4839),n=a(6164);function s(){for(var e=arguments.length,t=Array(e),a=0;a