!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="8dce5181-2aa3-4a40-90c7-78030b43e4a7",e._sentryDebugIdIdentifier="sentry-dbid-8dce5181-2aa3-4a40-90c7-78030b43e4a7")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4387],{80199:function(e,t,n){Promise.resolve().then(n.bind(n,111))},3609:function(e,t,n){"use strict";n.d(t,{O:function(){return r}});let r=(0,n(79689).AY)("https://ukrdhiywigevlawgvmbj.supabase.co","eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InVrcmRoaXl3aWdldmxhd2d2bWJqIiwicm9sZSI6ImFub24iLCJpYXQiOjE3MTI4OTQ2MjYsImV4cCI6MjAyODQ3MDYyNn0.YtDKvRfcM6xY6-2vwVk0nqtKFkQD5kIBj-SahLYwOek")},27902:function(e,t,n){"use strict";n.d(t,{Me:function(){return l},cn:function(){return s},hQ:function(){return o},zs:function(){return i}});var r=n(98099),a=n(18543);function s(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return(0,a.m6)((0,r.W)(t))}function o(e,t,n){return n.findIndex(t=>t.id===e.id)===t}let i=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n="ABCDEFGHJKLMNPQRSTUVWXY3456789",r="";for(let t=0;t<e;t++)r+=n.charAt(Math.floor(Math.random()*n.length));return t?r.toLowerCase():r},l={javascript:".js",python:".py",java:".java",c:".c",cpp:".cpp","c++":".cpp","c#":".cs",ruby:".rb",php:".php",swift:".swift","objective-c":".m",kotlin:".kt",typescript:".ts",go:".go",perl:".pl",rust:".rs",scala:".scala",haskell:".hs",lua:".lua",shell:".sh",sql:".sql",html:".html",css:".css"}},42378:function(e,t,n){"use strict";n.d(t,{F:function(){return c},f:function(){return d}});var r=n(2265);let a=["light","dark"],s="(prefers-color-scheme: dark)",o="undefined"==typeof window,i=(0,r.createContext)(void 0),l={setTheme:e=>{},themes:[]},c=()=>{var e;return null!==(e=(0,r.useContext)(i))&&void 0!==e?e:l},d=e=>(0,r.useContext)(i)?r.createElement(r.Fragment,null,e.children):r.createElement(m,e),u=["light","dark"],m=({forcedTheme:e,disableTransitionOnChange:t=!1,enableSystem:n=!0,enableColorScheme:o=!0,storageKey:l="theme",themes:c=u,defaultTheme:d=n?"system":"light",attribute:m="data-theme",value:x,children:y,nonce:v})=>{let[b,w]=(0,r.useState)(()=>h(l,d)),[j,C]=(0,r.useState)(()=>h(l)),k=x?Object.values(x):c,N=(0,r.useCallback)(e=>{let r=e;if(!r)return;"system"===e&&n&&(r=p());let s=x?x[r]:r,i=t?g():null,l=document.documentElement;if("class"===m?(l.classList.remove(...k),s&&l.classList.add(s)):s?l.setAttribute(m,s):l.removeAttribute(m),o){let e=a.includes(d)?d:null,t=a.includes(r)?r:e;l.style.colorScheme=t}null==i||i()},[]),S=(0,r.useCallback)(e=>{w(e);try{localStorage.setItem(l,e)}catch(e){}},[e]),I=(0,r.useCallback)(t=>{C(p(t)),"system"===b&&n&&!e&&N("system")},[b,e]);(0,r.useEffect)(()=>{let e=window.matchMedia(s);return e.addListener(I),I(e),()=>e.removeListener(I)},[I]),(0,r.useEffect)(()=>{let e=e=>{e.key===l&&S(e.newValue||d)};return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)},[S]),(0,r.useEffect)(()=>{N(null!=e?e:b)},[e,b]);let E=(0,r.useMemo)(()=>({theme:b,setTheme:S,forcedTheme:e,resolvedTheme:"system"===b?j:b,themes:n?[...c,"system"]:c,systemTheme:n?j:void 0}),[b,S,e,j,n,c]);return r.createElement(i.Provider,{value:E},r.createElement(f,{forcedTheme:e,disableTransitionOnChange:t,enableSystem:n,enableColorScheme:o,storageKey:l,themes:c,defaultTheme:d,attribute:m,value:x,children:y,attrs:k,nonce:v}),y)},f=(0,r.memo)(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:o,enableColorScheme:i,defaultTheme:l,value:c,attrs:d,nonce:u})=>{let m="system"===l,f="class"===n?`var d=document.documentElement,c=d.classList;c.remove(${d.map(e=>`'${e}'`).join(",")});`:`var d=document.documentElement,n='${n}',s='setAttribute';`,h=i?a.includes(l)&&l?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${l}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",g=(e,t=!1,r=!0)=>{let s=c?c[e]:e,o=t?e+"|| ''":`'${s}'`,l="";return i&&r&&!t&&a.includes(e)&&(l+=`d.style.colorScheme = '${e}';`),"class"===n?l+=t||s?`c.add(${o})`:"null":s&&(l+=`d[s](n,${o})`),l},p=e?`!function(){${f}${g(e)}}()`:o?`!function(){try{${f}var e=localStorage.getItem('${t}');if('system'===e||(!e&&${m})){var t='${s}',m=window.matchMedia(t);if(m.media!==t||m.matches){${g("dark")}}else{${g("light")}}}else if(e){${c?`var x=${JSON.stringify(c)};`:""}${g(c?"x[e]":"e",!0)}}${m?"":"else{"+g(l,!1,!1)+"}"}${h}}catch(e){}}()`:`!function(){try{${f}var e=localStorage.getItem('${t}');if(e){${c?`var x=${JSON.stringify(c)};`:""}${g(c?"x[e]":"e",!0)}}else{${g(l,!1,!1)};}${h}}catch(t){}}();`;return r.createElement("script",{nonce:u,dangerouslySetInnerHTML:{__html:p}})},()=>!0),h=(e,t)=>{let n;if(!o){try{n=localStorage.getItem(e)||void 0}catch(e){}return n||t}},g=()=>{let e=document.createElement("style");return e.appendChild(document.createTextNode("*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(e),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(e)},1)}},p=e=>(e||(e=window.matchMedia(s)),e.matches?"dark":"light")},111:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return o}});var r=n(57437),a=n(72301),s=n(75552);function o(){let e=(0,a.useSearchParams)();return(0,r.jsxs)("div",{className:"flex w-full flex-1 flex-col justify-center gap-2 px-8 sm:max-w-md","data-sentry-component":"Login","data-sentry-source-file":"page.tsx",children:[(0,r.jsx)(s.Z,{"data-sentry-element":"LoginForm","data-sentry-source-file":"page.tsx"}),(null==e?void 0:e.get("message"))&&(0,r.jsx)("p",{className:"bg-accent text-foreground mt-4 rounded-lg bg-purple-300 p-4 text-center",children:e.get("message")}),(null==e?void 0:e.get("error_message"))&&(0,r.jsx)("p",{className:"text-foreground mt-4 rounded-lg bg-red-300 p-4 text-center",children:e.get("error_message")})]})}},46828:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var r=n(57437),a=n(63726);let s=e=>{let{size:t=141,className:n}=e;return(0,r.jsx)(a.default,{src:"/chatlabs.png",alt:"ChatLabs",className:n,width:t,height:t,"data-sentry-element":"Image","data-sentry-component":"ChatbotUISVG","data-sentry-source-file":"chatbotui-svg.tsx"})}},17153:function(e,t,n){"use strict";n.d(t,{U:function(){return a}});var r=n(57437);let a=e=>{let{height:t=40,width:n=40,className:a}=e;return(0,r.jsxs)("svg",{className:a,width:n,height:t,xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:"0 0 48 48","data-sentry-element":"svg","data-sentry-component":"GoogleSVG","data-sentry-source-file":"google-svg.tsx",children:[(0,r.jsx)("path",{fill:"#FFC107",d:"M43.611,20.083H42V20H24v8h11.303c-1.649,4.657-6.08,8-11.303,8c-6.627,0-12-5.373-12-12c0-6.627,5.373-12,12-12c3.059,0,5.842,1.154,7.961,3.039l5.657-5.657C34.046,6.053,29.268,4,24,4C12.955,4,4,12.955,4,24c0,11.045,8.955,20,20,20c11.045,0,20-8.955,20-20C44,22.659,43.862,21.35,43.611,20.083z","data-sentry-element":"path","data-sentry-source-file":"google-svg.tsx"}),(0,r.jsx)("path",{fill:"#FF3D00",d:"M6.306,14.691l6.571,4.819C14.655,15.108,18.961,12,24,12c3.059,0,5.842,1.154,7.961,3.039l5.657-5.657C34.046,6.053,29.268,4,24,4C16.318,4,9.656,8.337,6.306,14.691z","data-sentry-element":"path","data-sentry-source-file":"google-svg.tsx"}),(0,r.jsx)("path",{fill:"#4CAF50",d:"M24,44c5.166,0,9.86-1.977,13.409-5.192l-6.19-5.238C29.211,35.091,26.715,36,24,36c-5.202,0-9.619-3.317-11.283-7.946l-6.522,5.025C9.505,39.556,16.227,44,24,44z","data-sentry-element":"path","data-sentry-source-file":"google-svg.tsx"}),(0,r.jsx)("path",{fill:"#1976D2",d:"M43.611,20.083H42V20H24v8h11.303c-0.792,2.237-2.231,4.166-4.087,5.571c0.001-0.001,0.002-0.001,0.003-0.002l6.19,5.238C36.971,39.205,44,34,44,24C44,22.659,43.862,21.35,43.611,20.083z","data-sentry-element":"path","data-sentry-source-file":"google-svg.tsx"})]})}},75552:function(e,t,n){"use strict";n.d(t,{Z:function(){return C}});var r=n(57437),a=n(2265),s=n(72301),o=n(6429),i=n(22958),l=n.n(i),c=n(42378),d=n(77819),u=n(7805);let m=["duck.com"];var f=n(3609),h=n(27902),g=n(46828);let p=e=>{let{theme:t="dark"}=e;return(0,r.jsxs)("div",{className:"flex cursor-pointer flex-col items-center","data-sentry-component":"Brand","data-sentry-source-file":"brand.tsx",children:[(0,r.jsx)("div",{className:"mb-2",children:(0,r.jsx)(g.Z,{className:"rounded-full",theme:"dark"===t?"dark":"light",size:42.3,"data-sentry-element":"ChatbotUISVG","data-sentry-source-file":"brand.tsx"})}),(0,r.jsx)("h1",{className:"text-4xl font-semibold tracking-wide",children:"ChatLabs"}),(0,r.jsxs)("div",{className:"flex flex-col items-center py-2",children:[(0,r.jsx)("h4",{className:"text-center text-sm",children:"More than 30 AI models in one place."}),(0,r.jsx)("h4",{className:"text-center text-sm",children:"Featuring GPT-4o, Claude 3, Gemini Pro, and LLaMa 3."})]})]})};var x=n(73185),y=n(76955),v=n(25018),b=n(17153),w=n(12982),j=n(25566);function C(e){let{redirectTo:t,popup:n=!1}=e,i=(0,d.useRouter)(),[g,C]=(0,a.useState)(""),[k,N]=(0,a.useState)(!1),S=(0,s.useSearchParams)(),[I,E]=(0,a.useState)(!0);t=(null==S?void 0:S.get("next"))||t;let{theme:$}=(0,c.F)(),L=new URLSearchParams;t&&L.append("next",t),n&&L.append("popup","true"),(0,a.useEffect)(()=>{let e=e=>{"AUTH_COMPLETE"===e.data.type&&(e.data.error?(console.error("Authentication failed"),u.toast.error(e.data.error)):(console.log("Authentication successful"),window.location.reload()))};return window.addEventListener("message",e),()=>window.removeEventListener("message",e)},[]);let T=()=>{let e=window.screenX+(window.outerWidth-500)/2,t=window.screenY+(window.outerHeight-600)/2,n="width=".concat(500,",height=").concat(600,",left=").concat(e,",top=").concat(t);return window.open("","Auth",n)},M=async e=>{try{N(!0);let t=null;n&&(t=T());let{data:r,error:a}=await f.O.auth.signInWithOAuth({provider:e,options:{scopes:"email",redirectTo:"".concat(j.env.NEXT_PUBLIC_BASE_URL||window.location.origin,"/auth/callback?").concat(L.toString()),skipBrowserRedirect:n}});if(N(!1),a)return null==t||t.close(),i.push("/login?message=".concat(a.message,"&").concat(L.toString()));if(n&&r.url){let e=new URL(r.url);e.searchParams.append("popup","true"),null==t||t.location.replace(e.toString())}}catch(e){u.toast.error("Error logging in with OAuth"),console.error(e)}finally{N(!1)}};async function z(e){try{if(e.preventDefault(),e.stopPropagation(),N(!0),!function(e){var t;let n=null===(t=e.split("@"))||void 0===t?void 0:t[1];return!(!n||m.includes(n))&&l().validate(e)}(g)){E(!1);return}E(!0);let{error:t}=await f.O.auth.signInWithOtp({email:g,options:{emailRedirectTo:encodeURIComponent("".concat(window.location.origin,"/auth/confirm?").concat(L.toString()))}});if(N(!1),t)return i.push("/login?message=".concat(t.message));return i.push("/login?message=Check your email for a login link")}catch(e){u.toast.error("Error logging in with email"),console.error(e)}finally{N(!1)}}return(0,r.jsxs)("div",{className:"animate-in text-foreground flex w-full flex-col justify-center gap-2","data-sentry-component":"LoginForm","data-sentry-source-file":"login-form.tsx",children:[(0,r.jsx)(p,{theme:"dark"===$?"dark":"light","data-sentry-element":"Brand","data-sentry-source-file":"login-form.tsx"}),(0,r.jsxs)(x.z,{disabled:k,onClick:()=>M("google"),className:"text-md mb-1 mt-4 rounded-lg bg-violet-700 px-4 py-2 text-white","data-sentry-element":"Button","data-sentry-source-file":"login-form.tsx",children:[(0,r.jsx)(b.U,{height:20,width:20,className:"mr-2","data-sentry-element":"GoogleSVG","data-sentry-source-file":"login-form.tsx"})," Continue with Google"]}),(0,r.jsxs)("div",{className:"text-foreground/70 my-4 flex items-center space-x-2 text-sm",children:[(0,r.jsx)(v.Z,{className:"flex-1","data-sentry-element":"Separator","data-sentry-source-file":"login-form.tsx"}),(0,r.jsx)("div",{children:"or"}),(0,r.jsx)(v.Z,{className:"flex-1","data-sentry-element":"Separator","data-sentry-source-file":"login-form.tsx"})]}),(0,r.jsxs)("form",{onSubmit:e=>z(e),className:"flex flex-col gap-2",children:[(0,r.jsx)(y.I,{required:!0,disabled:k,type:"email",value:g,onChange:e=>C(e.target.value),className:(0,h.cn)("rounded-lg",!I&&"border-red-500"),placeholder:"Enter your company email","data-sentry-element":"Input","data-sentry-source-file":"login-form.tsx"}),!I&&(0,r.jsx)(w.d,{className:"text-center text-red-500",children:"Invalid email. Disposable email providers are not supported."}),(0,r.jsxs)(x.z,{disabled:k,variant:"outline",onClick:e=>z(e),className:"text-md mb-1 rounded-lg px-4 py-2","data-sentry-element":"Button","data-sentry-source-file":"login-form.tsx",children:[(0,r.jsx)(o.Z,{height:20,width:20,stroke:1.5,className:"mr-2","data-sentry-element":"IconMail","data-sentry-source-file":"login-form.tsx"}),"Continue with email"]}),(0,r.jsxs)(w.d,{className:"text-center","data-sentry-element":"Description","data-sentry-source-file":"login-form.tsx",children:["Disposable email providers are not supported.",(0,r.jsx)("br",{}),"We will send you a login link to your email."]})]})]})}},73185:function(e,t,n){"use strict";n.d(t,{z:function(){return d}});var r=n(57437),a=n(2265),s=n(98230),o=n(10827),i=n(5022),l=n(27902);let c=(0,o.j)("ring-offset-background focus-visible:ring-ring inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors hover:opacity-50 focus-visible:outline-none focus-visible:ring-2 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-input bg-background hover:text-accent-foreground hover:bg-accent border",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:text-accent-foreground hover:bg-accent",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",xs:"h-6 rounded-md px-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"size-10"}},defaultVariants:{variant:"default",size:"default"}}),d=a.forwardRef((e,t)=>{let{className:n,variant:a,size:o,children:d,asChild:u=!1,loading:m=!1,...f}=e,h=u?s.g7:"button";return(0,r.jsxs)(h,{disabled:m||f.disabled,className:(0,l.cn)(c({variant:a,size:o,className:n})),ref:t,...f,children:[m?(0,r.jsx)(i.Z,{className:"size-4 animate-spin"}):null,!m&&d]})});d.displayName="Button"},12982:function(e,t,n){"use strict";n.d(t,{d:function(){return s}});var r=n(57437);n(2265);var a=n(27902);function s(e){let{children:t,className:n}=e;return(0,r.jsx)("p",{className:(0,a.cn)("text-muted-foreground mt-1 text-xs",n),"data-sentry-component":"Description","data-sentry-source-file":"description.tsx",children:t})}},76955:function(e,t,n){"use strict";n.d(t,{I:function(){return o}});var r=n(57437),a=n(2265),s=n(27902);let o=a.forwardRef((e,t)=>{let{className:n,type:a,...o}=e;return(0,r.jsx)("input",{type:a,className:(0,s.cn)("border-input bg-background ring-offset-background placeholder:text-muted-foreground focus:none flex h-10 w-full rounded-md border px-3 py-2 text-sm file:border-0 file:bg-transparent file:text-sm file:font-medium focus-visible:outline-none focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",n),ref:t,...o})});o.displayName="Input"},25018:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(57437),a=n(2265),s=n(62280),o=n(27902);let i=a.forwardRef((e,t)=>{let{className:n,orientation:a="horizontal",decorative:i=!0,...l}=e;return(0,r.jsx)(s.f,{ref:t,decorative:i,orientation:a,className:(0,o.cn)("bg-border shrink-0","horizontal"===a?"h-px w-full":"h-full w-px",n),...l})});i.displayName=s.f.displayName},26978:function(e,t,n){"use strict";n.d(t,{WV:function(){return i},jH:function(){return l}});var r=n(2265),a=n(54887),s=n(98230),o=n(57437),i=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce((e,t)=>{let n=r.forwardRef((e,n)=>{let{asChild:r,...a}=e,i=r?s.g7:t;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,o.jsx)(i,{...a,ref:n})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function l(e,t){e&&a.flushSync(()=>e.dispatchEvent(t))}},62280:function(e,t,n){"use strict";n.d(t,{f:function(){return c}});var r=n(2265),a=n(26978),s=n(57437),o="horizontal",i=["horizontal","vertical"],l=r.forwardRef((e,t)=>{let{decorative:n,orientation:r=o,...l}=e,c=i.includes(r)?r:o;return(0,s.jsx)(a.WV.div,{"data-orientation":c,...n?{role:"none"}:{"aria-orientation":"vertical"===c?c:void 0,role:"separator"},...l,ref:t})});l.displayName="Separator";var c=l}},function(e){e.O(0,[5677,1325,7176,2641,3219,991,2971,8399,1744],function(){return e(e.s=80199)}),_N_E=e.O()}]);