(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8098],{14375:function(e,t,r){"use strict";r.d(t,{j:function(){return a}});let n=e=>"boolean"==typeof e?"".concat(e):0===e?"0":e,s=function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return t.flat(1/0).filter(Boolean).join(" ")},a=(e,t)=>r=>{var a;if((null==t?void 0:t.variants)==null)return s(e,null==r?void 0:r.class,null==r?void 0:r.className);let{variants:i,defaultVariants:l}=t,o=Object.keys(i).map(e=>{let t=null==r?void 0:r[e],s=null==l?void 0:l[e];if(null===t)return null;let a=n(t)||n(s);return i[e][a]}),c=r&&Object.entries(r).reduce((e,t)=>{let[r,n]=t;return void 0===n||(e[r]=n),e},{}),u=null==t?void 0:null===(a=t.compoundVariants)||void 0===a?void 0:a.reduce((e,t)=>{let{class:r,className:n,...s}=t;return Object.entries(s).every(e=>{let[t,r]=e;return Array.isArray(r)?r.includes({...l,...c}[t]):({...l,...c})[t]===r})?[...e,r,n]:e},[]);return s(e,o,u,null==r?void 0:r.class,null==r?void 0:r.className)}},21644:function(e,t,r){"use strict";r.d(t,{Z:function(){return i}});var n=r(3546),s={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
 * @license lucide-react v0.365.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let a=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),i=(e,t)=>{let r=(0,n.forwardRef)(({color:r="currentColor",size:i=24,strokeWidth:l=2,absoluteStrokeWidth:o,className:c="",children:u,...d},m)=>(0,n.createElement)("svg",{ref:m,...s,width:i,height:i,stroke:r,strokeWidth:o?24*Number(l)/Number(i):l,className:["lucide",`lucide-${a(e)}`,c].join(" "),...d},[...t.map(([e,t])=>(0,n.createElement)(e,t)),...Array.isArray(u)?u:[u]]));return r.displayName=`${e}`,r}},67960:function(e,t,r){"use strict";r.d(t,{Z:function(){return s}});var n=r(21644);/**
 * @license lucide-react v0.365.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let s=(0,n.Z)("Blocks",[["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["path",{d:"M10 21V8a1 1 0 0 0-1-1H4a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-5a1 1 0 0 0-1-1H3",key:"1fpvtg"}]])},83048:function(e,t,r){"use strict";r.d(t,{Z:function(){return s}});var n=r(21644);/**
 * @license lucide-react v0.365.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let s=(0,n.Z)("BookOpenText",[["path",{d:"M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z",key:"vv98re"}],["path",{d:"M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z",key:"1cyq3y"}],["path",{d:"M6 8h2",key:"30oboj"}],["path",{d:"M6 12h2",key:"32wvfc"}],["path",{d:"M16 8h2",key:"msurwy"}],["path",{d:"M16 12h2",key:"7q9ll5"}]])},94855:function(e,t,r){"use strict";r.d(t,{Z:function(){return s}});var n=r(21644);/**
 * @license lucide-react v0.365.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let s=(0,n.Z)("Box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]])},94240:function(e,t,r){"use strict";r.d(t,{Z:function(){return s}});var n=r(21644);/**
 * @license lucide-react v0.365.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let s=(0,n.Z)("CirclePlay",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polygon",{points:"10 8 16 12 10 16 10 8",key:"1cimsy"}]])},63057:function(e,t,r){"use strict";r.d(t,{Z:function(){return s}});var n=r(21644);/**
 * @license lucide-react v0.365.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let s=(0,n.Z)("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]])},40327:function(e,t,r){"use strict";r.d(t,{Z:function(){return s}});var n=r(21644);/**
 * @license lucide-react v0.365.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let s=(0,n.Z)("GitFork",[["circle",{cx:"12",cy:"18",r:"3",key:"1mpf1b"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["path",{d:"M18 9v2c0 .6-.4 1-1 1H7c-.6 0-1-.4-1-1V9",key:"1uq4wg"}],["path",{d:"M12 12v3",key:"158kv8"}]])},71371:function(e,t,r){"use strict";r.d(t,{Z:function(){return s}});var n=r(21644);/**
 * @license lucide-react v0.365.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let s=(0,n.Z)("Layers2",[["path",{d:"m16.02 12 5.48 3.13a1 1 0 0 1 0 1.74L13 21.74a2 2 0 0 1-2 0l-8.5-4.87a1 1 0 0 1 0-1.74L7.98 12",key:"1cuww1"}],["path",{d:"M13 13.74a2 2 0 0 1-2 0L2.5 8.87a1 1 0 0 1 0-1.74L11 2.26a2 2 0 0 1 2 0l8.5 4.87a1 1 0 0 1 0 1.74Z",key:"pdlvxu"}]])},70418:function(e,t,r){"use strict";r.d(t,{Z:function(){return s}});var n=r(21644);/**
 * @license lucide-react v0.365.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let s=(0,n.Z)("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]])},93170:function(e,t,r){"use strict";r.d(t,{Z:function(){return s}});var n=r(21644);/**
 * @license lucide-react v0.365.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let s=(0,n.Z)("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]])},12303:function(e,t,r){"use strict";r.d(t,{Z:function(){return s}});var n=r(21644);/**
 * @license lucide-react v0.365.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let s=(0,n.Z)("Sparkles",[["path",{d:"m12 3-1.912 5.813a2 2 0 0 1-1.275 1.275L3 12l5.813 1.912a2 2 0 0 1 1.275 1.275L12 21l1.912-5.813a2 2 0 0 1 1.275-1.275L21 12l-5.813-1.912a2 2 0 0 1-1.275-1.275L12 3Z",key:"17u4zn"}],["path",{d:"M5 3v4",key:"bklmnn"}],["path",{d:"M19 17v4",key:"iiml17"}],["path",{d:"M3 5h4",key:"nem4j1"}],["path",{d:"M17 19h4",key:"lbex7p"}]])},63410:function(e,t,r){"use strict";r.d(t,{Z:function(){return s}});var n=r(21644);/**
 * @license lucide-react v0.365.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let s=(0,n.Z)("Star",[["polygon",{points:"12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2",key:"8f66p6"}]])},57424:function(e,t,r){"use strict";r.d(t,{Z:function(){return s}});var n=r(21644);/**
 * @license lucide-react v0.365.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let s=(0,n.Z)("Tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]])},25125:function(e,t,r){Promise.resolve().then(r.bind(r,95463))},95463:function(e,t,r){"use strict";r.r(t),r.d(t,{default:function(){return F}});var n=r(36164),s=r(3546),a=r(11978),i=r(80605),l=r(70652),o=r.n(l),c=r(31458),u=r(81565),d=r(84381),m=r(5493),h=r(23782),f=r(21808),x=r(75561),v=r(11634),p=r(98150),g=r(82394);let y=(0,x.B)("\n  mutation requestPasswordResetEmail($input: RequestPasswordResetEmailInput!) {\n    requestPasswordResetEmail(input: $input)\n  }\n"),j=h.Ry({email:h.Z_().email("Invalid email address")}),b=e=>{let{onSuccess:t}=e,r=(0,m.cI)({resolver:(0,d.F)(j)}),{isSubmitting:s}=r.formState,a=(0,v.D)(y,{form:r});return(0,n.jsx)(p.l0,{...r,children:(0,n.jsxs)("div",{className:"grid gap-2",children:[(0,n.jsxs)("form",{className:"grid gap-4",onSubmit:r.handleSubmit(e=>a({input:e}).then(r=>{var n;(null==r?void 0:null===(n=r.data)||void 0===n?void 0:n.requestPasswordResetEmail)&&(null==t||t(e.email))})),children:[(0,n.jsx)(p.Wi,{control:r.control,name:"email",render:e=>{let{field:t}=e;return(0,n.jsxs)(p.xJ,{children:[(0,n.jsx)(p.lX,{children:"Email"}),(0,n.jsx)(p.NI,{children:(0,n.jsx)(g.I,{placeholder:f.o0,type:"email",autoCapitalize:"none",autoComplete:"email",autoCorrect:"off",...t})}),(0,n.jsx)(p.zG,{})]})}}),(0,n.jsxs)(c.z,{type:"submit",className:"mt-2",children:[s&&(0,n.jsx)(u.IconSpinner,{className:"mr-2 h-4 w-4 animate-spin"}),"Send Email"]})]}),(0,n.jsx)(p.zG,{className:"text-center"})]})})};function N(){let[e,t]=s.useState(),[r,a]=s.useState(!1);return r?(0,n.jsx)("div",{className:"w-[350px] space-y-6",children:(0,n.jsxs)("div",{className:"flex flex-col space-y-2 text-center",children:[(0,n.jsx)("div",{className:"flex justify-center",children:(0,n.jsx)(u.IconCheckCircled,{className:"h-12 w-12 text-successful-foreground"})}),(0,n.jsx)("h1",{className:"text-2xl font-semibold tracking-tight",children:"Reset Password"}),(0,n.jsxs)("p",{className:"pb-4 text-sm text-muted-foreground",children:["Request received successfully! If the email"," ",(0,n.jsx)("span",{className:"font-bold",children:null!=e?e:""})," exists, you’ll receive an email with a reset link soon."]}),(0,n.jsx)(o(),{href:"/auth/signin",className:(0,c.d)(),children:"Back to Sign In"})]})}):(0,n.jsxs)("div",{className:"w-[350px] space-y-6",children:[(0,n.jsxs)("div",{className:"flex flex-col space-y-2 text-center",children:[(0,n.jsx)("h1",{className:"text-2xl font-semibold tracking-tight",children:"Reset Password"}),(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:"Enter your email address. If an account exists, you’ll receive an email with a password reset link soon."})]}),(0,n.jsx)(b,{onSuccess:e=>{t(e),a(!0)}}),(0,n.jsx)("div",{className:"text-center",children:(0,n.jsx)(o(),{href:"/auth/signin",replace:!0,className:"text-primary hover:underline",children:"Cancel"})})]})}let k=(0,x.B)("\n  mutation requestInvitationEmail($input: RequestInvitationInput!) {\n    requestInvitationEmail(input: $input) {\n      email\n      code\n    }\n  }\n"),w=h.Ry({email:h.Z_().email("Invalid email address")}),I=e=>{let{onSuccess:t}=e,r=(0,m.cI)({resolver:(0,d.F)(w)}),{isSubmitting:s}=r.formState,a=(0,v.D)(k,{form:r});return(0,n.jsx)(p.l0,{...r,children:(0,n.jsxs)("div",{className:"grid gap-2",children:[(0,n.jsxs)("form",{className:"grid gap-4",onSubmit:r.handleSubmit(e=>a({input:e}).then(e=>{var r,n;(null==e?void 0:null===(n=e.data)||void 0===n?void 0:null===(r=n.requestInvitationEmail)||void 0===r?void 0:r.code)&&(null==t||t(e.data.requestInvitationEmail))})),children:[(0,n.jsx)(p.Wi,{control:r.control,name:"email",render:e=>{let{field:t}=e;return(0,n.jsxs)(p.xJ,{children:[(0,n.jsx)(p.lX,{children:"Email"}),(0,n.jsx)(p.NI,{children:(0,n.jsx)(g.I,{placeholder:f.o0,type:"email",autoCapitalize:"none",autoComplete:"email",autoCorrect:"off",...t})}),(0,n.jsx)(p.zG,{})]})}}),(0,n.jsxs)(c.z,{type:"submit",className:"mt-2",children:[s&&(0,n.jsx)(u.IconSpinner,{className:"mr-2 h-4 w-4 animate-spin"}),"Send Email"]})]}),(0,n.jsx)(p.zG,{className:"text-center"})]})})};function S(){let[e,t]=s.useState(),[r,a]=s.useState(!1);return r?(0,n.jsx)("div",{className:"w-[350px] space-y-6",children:(0,n.jsxs)("div",{className:"flex flex-col space-y-2 text-center",children:[(0,n.jsx)("div",{className:"flex justify-center",children:(0,n.jsx)(u.IconCheckCircled,{className:"h-12 w-12 text-successful-foreground"})}),(0,n.jsx)("h1",{className:"text-2xl font-semibold tracking-tight",children:"Create your Tabby account"}),(0,n.jsx)("p",{className:"pb-4 text-sm text-muted-foreground",children:"Request received successfully! You’ll receive an email with a signup link soon."}),(0,n.jsx)(o(),{href:"/auth/signin",className:(0,c.d)(),children:"Back to Sign In"})]})}):(0,n.jsxs)("div",{className:"w-[350px] space-y-6",children:[(0,n.jsxs)("div",{className:"flex flex-col space-y-2 text-center",children:[(0,n.jsx)("h1",{className:"text-2xl font-semibold tracking-tight",children:"Create your Tabby account"}),(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:"To register your account, please enter your email address."})]}),(0,n.jsx)(I,{onSuccess:e=>{t(e.email),a(!0)}}),(0,n.jsxs)("div",{className:"text-center text-sm",children:["Already have an accout?",(0,n.jsx)(o(),{href:"/auth/signin",className:"ml-1 font-semibold text-primary hover:underline",children:"Sign In"})]})]})}var Z=r(36327),E=r(44645),C=r(91302),R=r(3765),_=r(43240),M=r(74248);let z=(0,_.BX)("\n  mutation tokenAuth($email: String!, $password: String!) {\n    tokenAuth(email: $email, password: $password) {\n      accessToken\n      refreshToken\n    }\n  }\n"),A=h.Ry({email:h.Z_().email("Invalid email address"),password:h.Z_()}),q={EMAIL:"demo@tabbyml.com",PASSWORD:"0$TabbyDemo"};function L(e){let{className:t,invitationCode:r,...a}=e,l=(0,i.Uw)(),h=(0,i.UA)(),x=(0,m.cI)({resolver:(0,d.F)(A)}),y=s.useRef(null);s.useEffect(()=>{let e=f.$6.DEMO_AUTO_LOGIN;if(h){if(x.setValue("email",q.EMAIL),x.setValue("password",q.PASSWORD),"true"===sessionStorage.getItem(e))return;if(y.current){let t=new Event("submit",{bubbles:!0,cancelable:!0});y.current.dispatchEvent(t),sessionStorage.setItem(e,"true")}}},[h]);let j=(0,C.zq)(),{isSubmitting:b}=x.formState,N=(0,v.D)(z,{onCompleted(e){j(e.tokenAuth)},form:x});return(0,n.jsx)(p.l0,{...x,children:(0,n.jsxs)("div",{className:(0,M.cn)("grid gap-2",t),...a,children:[(0,n.jsxs)("form",{ref:y,className:"grid gap-4",onSubmit:x.handleSubmit(N),children:[(0,n.jsx)(p.Wi,{control:x.control,name:"email",render:e=>{let{field:t}=e;return(0,n.jsxs)(p.xJ,{children:[(0,n.jsx)(p.lX,{children:"Email"}),(0,n.jsx)(p.NI,{children:(0,n.jsx)(g.I,{placeholder:f.o0,type:"email",autoCapitalize:"none",autoComplete:"email",autoCorrect:"off",...t})}),(0,n.jsx)(p.zG,{})]})}}),(0,n.jsx)(p.Wi,{control:x.control,name:"password",render:e=>{let{field:t}=e;return(0,n.jsxs)(p.xJ,{children:[(0,n.jsxs)("div",{className:"flex items-center justify-between",children:[(0,n.jsx)(p.lX,{children:"Password"}),!!l&&(0,n.jsx)("div",{className:"cursor-pointer text-right text-sm text-primary hover:underline",children:(0,n.jsx)(o(),{href:"/auth/signin?mode=reset",children:"Forgot password?"})})]}),(0,n.jsx)(p.NI,{children:(0,n.jsx)(g.I,{type:"password",...t})}),(0,n.jsx)(p.zG,{})]})}}),(0,n.jsxs)(c.z,{type:"submit",className:"mt-2",disabled:b,children:[b&&(0,n.jsx)(u.IconSpinner,{className:"mr-2 h-4 w-4 animate-spin"}),"Sign In"]})]}),(0,n.jsx)(p.zG,{className:"text-center"})]})})}function P(){let{router:e,searchParams:t}=(0,E.Z)(),r=(0,i.jJ)(),a=t.get("error_message"),l=t.get("access_token"),c=t.get("refresh_token"),d=!!l&&!!c,m=d&&!a,h=(0,C.zq)(),{data:f}=(0,Z.Z)(d?null:"/oauth/providers",R.Z);(0,s.useEffect)(()=>{!a&&l&&c&&h({accessToken:l,refreshToken:c})},[t]);let{status:x}=(0,C.kP)();return((0,s.useEffect)(()=>{"authenticated"===x&&e.replace("/")},[x]),m)?(0,n.jsx)(u.IconSpinner,{className:"h-8 w-8 animate-spin"}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"w-[350px] space-y-6",children:[(0,n.jsxs)("div",{className:"flex flex-col space-y-2 text-center",children:[(0,n.jsx)("h1",{className:"text-2xl font-semibold tracking-tight",children:"Sign In"}),(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:"Enter credentials to login to your account"})]}),(0,n.jsx)(L,{}),r&&(0,n.jsxs)("div",{className:"text-center text-sm",children:["Don’t have an accout?",(0,n.jsx)(o(),{href:"/auth/signin?mode=signup",className:"ml-1 font-semibold text-primary hover:underline",children:"Create an account"})]})]}),!!(null==f?void 0:f.length)&&(0,n.jsxs)("div",{className:"relative mt-4 flex w-[350px] items-center py-5",children:[(0,n.jsx)("div",{className:"grow border-t "}),(0,n.jsx)("span",{className:"mx-4 shrink text-sm text-muted-foreground",children:"Or Sign In with"}),(0,n.jsx)("div",{className:"grow border-t "})]}),(0,n.jsxs)("div",{className:"mx-auto flex items-center gap-8",children:[(null==f?void 0:f.includes("github"))&&(0,n.jsx)("a",{href:"/oauth/signin?provider=github",children:(0,n.jsx)(u.IconGithub,{className:"h-8 w-8"})}),(null==f?void 0:f.includes("google"))&&(0,n.jsx)("a",{href:"/oauth/signin?provider=google",children:(0,n.jsx)(u.IconGoogle,{className:"h-8 w-8"})}),(null==f?void 0:f.includes("gitlab"))&&(0,n.jsx)("a",{href:"/oauth/signin?provider=gitlab",children:(0,n.jsx)(u.IconGitLab,{className:"h-8 w-8"})})]}),!!a&&(0,n.jsx)("div",{className:"mt-4 text-destructive",children:a})]})}function F(){var e;let t=(0,a.useRouter)(),r=(0,a.useSearchParams)(),l=null===(e=r.get("mode"))||void 0===e?void 0:e.toString(),o=(0,i.Uw)(),c=(0,i.jJ)();return(s.useEffect(()=>{let e=!1===o&&"reset"===l||!1===c&&"signup"===l;e&&t.replace("/auth/signin")},[l,o,c]),"reset"===l)?(0,n.jsx)(N,{}):"signup"===l?(0,n.jsx)(S,{}):(0,n.jsx)(P,{})}},31458:function(e,t,r){"use strict";r.d(t,{d:function(){return o},z:function(){return c}});var n=r(36164),s=r(3546),a=r(74047),i=r(14375),l=r(74248);let o=(0,i.j)("inline-flex items-center justify-center rounded-md text-sm font-medium shadow 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 shadow-md hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90","hover-destructive":"shadow-none hover:bg-destructive/90 hover:text-destructive-foreground",outline:"border border-input hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"shadow-none hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 shadow-none hover:underline"},size:{default:"h-8 px-4 py-2",sm:"h-8 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-8 w-8 p-0"}},defaultVariants:{variant:"default",size:"default"}}),c=s.forwardRef((e,t)=>{let{className:r,variant:s,size:i,asChild:c=!1,...u}=e,d=c?a.g7:"button";return(0,n.jsx)(d,{className:(0,l.cn)(o({variant:s,size:i,className:r})),ref:t,...u})});c.displayName="Button"},98150:function(e,t,r){"use strict";r.d(t,{NI:function(){return v},Wi:function(){return d},l0:function(){return c},lX:function(){return x},pf:function(){return p},xJ:function(){return f},zG:function(){return g}});var n=r(36164),s=r(3546),a=r(74047),i=r(5493),l=r(74248),o=r(5266);let c=i.RV,u=s.createContext({}),d=e=>{let{...t}=e;return(0,n.jsx)(u.Provider,{value:{name:t.name},children:(0,n.jsx)(i.Qr,{...t})})},m=()=>{let e=s.useContext(u),t=s.useContext(h),{getFieldState:r,formState:n}=(0,i.Gc)(),a=e.name||"root",l=r(a,n);if(!n)throw Error("useFormField should be used within <Form>");let{id:o}=t;return{id:o,name:a,formItemId:"".concat(o,"-form-item"),formDescriptionId:"".concat(o,"-form-item-description"),formMessageId:"".concat(o,"-form-item-message"),...l}},h=s.createContext({}),f=s.forwardRef((e,t)=>{let{className:r,...a}=e,i=s.useId();return(0,n.jsx)(h.Provider,{value:{id:i},children:(0,n.jsx)("div",{ref:t,className:(0,l.cn)("space-y-2",r),...a})})});f.displayName="FormItem";let x=s.forwardRef((e,t)=>{let{className:r,required:s,...a}=e,{error:i,formItemId:c}=m();return(0,n.jsx)(o._,{ref:t,className:(0,l.cn)(i&&"text-destructive",s&&'after:ml-0.5 after:text-destructive after:content-["*"]',r),htmlFor:c,...a})});x.displayName="FormLabel";let v=s.forwardRef((e,t)=>{let{...r}=e,{error:s,formItemId:i,formDescriptionId:l,formMessageId:o}=m();return(0,n.jsx)(a.g7,{ref:t,id:i,"aria-describedby":s?"".concat(l," ").concat(o):"".concat(l),"aria-invalid":!!s,...r})});v.displayName="FormControl";let p=s.forwardRef((e,t)=>{let{className:r,...s}=e,{formDescriptionId:a}=m();return(0,n.jsx)("div",{ref:t,id:a,className:(0,l.cn)("text-sm text-muted-foreground",r),...s})});p.displayName="FormDescription";let g=s.forwardRef((e,t)=>{let{className:r,children:s,...a}=e,{error:i,formMessageId:o}=m(),c=i?String(null==i?void 0:i.message):s;return c?(0,n.jsx)("p",{ref:t,id:o,className:(0,l.cn)("text-sm font-medium text-destructive",r),...a,children:c}):null});g.displayName="FormMessage"},82394:function(e,t,r){"use strict";r.d(t,{I:function(){return i}});var n=r(36164),s=r(3546),a=r(74248);let i=s.forwardRef((e,t)=>{let{className:r,type:s,...i}=e;return(0,n.jsx)("input",{type:s,className:(0,a.cn)("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",r),ref:t,...i})});i.displayName="Input"},5266:function(e,t,r){"use strict";r.d(t,{_:function(){return c}});var n=r(36164),s=r(3546),a=r(90893),i=r(14375),l=r(74248);let o=(0,i.j)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),c=s.forwardRef((e,t)=>{let{className:r,...s}=e;return(0,n.jsx)(a.f,{ref:t,className:(0,l.cn)(o(),r),...s})});c.displayName=a.f.displayName},21808:function(e,t,r){"use strict";r.d(t,{$6:function(){return a},L8:function(){return s},o0:function(){return n}});let n="name@yourcompany.com",s=20,a={DEMO_AUTO_LOGIN:"_tabby_demo_autologin",SEARCH_INITIAL_MSG:"_tabby_search_initial_msg",SEARCH_LATEST_MSG:"_tabby_search_latest_msg"}},44645:function(e,t,r){"use strict";r.d(t,{Z:function(){return a}});var n=r(3546),s=r(11978);function a(){let e=(0,s.usePathname)(),t=(0,s.useRouter)(),r=(0,s.useSearchParams)(),a=(0,n.useCallback)(e=>{let t=new URLSearchParams(r);e&&Object.entries(e).forEach(e=>{let[r,n]=e;return t.set(r,n)});let n=t.toString();return n.length>0?"?".concat(n):""},[r]),i=(0,n.useCallback)(n=>{let s=function(e,t,r){var n,s;let a=null===(n=r.searchParams)||void 0===n?void 0:n.set,i=null===(s=r.searchParams)||void 0===s?void 0:s.del,l=new URLSearchParams(t);a&&Object.entries(a).forEach(e=>{let[t,r]=e;return l.set(t,r)}),i&&(Array.isArray(i)?i.forEach(e=>l.delete(e)):l.delete(i));let o=l.toString(),c=e;return o.length>0&&(c+="?".concat(o)),r.hash&&(c+="#".concat(r.hash.replace(/^#/,""))),c}((null==n?void 0:n.pathname)||e,r,n);n.replace?t.replace(s):t.push(s)},[e,r]);return{pathname:e,router:t,searchParams:r,getQueryString:a,updateUrlComponents:i}}},3765:function(e,t,r){"use strict";r.d(t,{Z:function(){return o}});var n=r(44745),s=r(57778),a=r(79716),i=r(91302),l=r(66794);async function o(e,t){var r;let n=null!==(r=null==t?void 0:t.customFetch)&&void 0!==r?r:window.fetch;if(function(e){var t;if(e.startsWith("/oauth/providers"))return!1;let r=null===(t=(0,l.bW)())||void 0===t?void 0:t.accessToken;if(!r)return!0;try{let{exp:e}=(0,a.o)(r);return(0,l.pw)(e)}catch(e){return!0}}(e))return l.gN.refreshToken(c).then(r=>m(e,t));let s=await n(e,u(t));return 401===s.status?(l.gN.clearAccessToken(),l.gN.refreshToken(c).then(r=>m(e,t))):h(s,t)}async function c(){var e,t;let r=null===(e=(0,l.bW)())||void 0===e?void 0:e.refreshToken;if(!r)return;let n=await d(r);return null==n?void 0:null===(t=n.data)||void 0===t?void 0:t.refreshToken}function u(e){var t;let r=new Headers(null==e?void 0:e.headers);return r.append("authorization","Bearer ".concat(null===(t=(0,l.bW)())||void 0===t?void 0:t.accessToken)),{...e||{},headers:r}}async function d(e){let t=new n.KU({url:"/graphql",requestPolicy:"network-only",exchanges:[n.Ek]}),r=t.createRequestOperation("mutation",(0,s.h)(i.Dp,{refreshToken:e}));return t.executeMutation(r)}function m(e,t){var r;let n=null!==(r=null==t?void 0:t.customFetch)&&void 0!==r?r:window.fetch;return n(e,u(t)).then(e=>h(e,t))}function h(e,t){return(null==e?void 0:e.ok)?(null==t?void 0:t.responseFormatter)?t.responseFormatter(e):(null==t?void 0:t.responseFormat)==="blob"?e.blob():e.json():(null==t?void 0:t.errorHandler)?t.errorHandler(e):void 0}},70652:function(e,t,r){e.exports=r(54007)},36327:function(e,t,r){"use strict";r.d(t,{Z:function(){return a}});var n=r(21454),s=r(54859);let a=(0,s.xD)(n.ZP,e=>(t,r,n)=>(n.revalidateOnFocus=!1,n.revalidateIfStale=!1,n.revalidateOnReconnect=!1,e(t,r,n)))}},function(e){e.O(0,[7998,5498,6312,4007,240,1454,9736,1565,3396,3375,5289,1744],function(){return e(e.s=25125)}),_N_E=e.O()}]);