(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[289],{1707:function(e,t,a){(window.__NEXT_P=window.__NEXT_P||[]).push(["/turbo",function(){return a(240)}])},240:function(e,t,a){"use strict";a.r(t),a.d(t,{default:function(){return v}});var r=a(7458),s=a(4676),n=a(8034),o=a(6256),l=a(2983),d=a(5333),i=a(4274);let u=l.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)(d.f,{ref:t,className:(0,i.cn)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",a),...s})});u.displayName=d.f.displayName;let c=l.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)("input",{className:(0,i.cn)("flex h-10 w-full rounded-md border border-slate-300 bg-transparent py-2 px-3 text-sm placeholder:text-slate-400 focus:outline-none focus:ring-2 focus:ring-slate-400 focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 dark:border-slate-700 dark:text-slate-50 dark:focus:ring-slate-400 dark:focus:ring-offset-slate-900",a),ref:t,...s})});c.displayName="Input";let f=e=>{let{label:t,inputProps:a,error:s}=e;return(0,r.jsxs)("div",{className:"grid w-full max-w-sm items-center gap-3",children:[(0,r.jsx)(u,{htmlFor:a.id,children:t}),(0,r.jsx)(c,{...a}),(0,r.jsx)("p",{className:"!mt-0 text-sm text-red-500",children:s})]})};var m=a(4033);let p=(0,m.j)("active:scale-95 inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-slate-400 focus:ring-offset-2 dark:hover:bg-slate-800 dark:hover:text-slate-100 disabled:opacity-50 dark:focus:ring-slate-400 disabled:pointer-events-none dark:focus:ring-offset-slate-900 data-[state=open]:bg-slate-100 dark:data-[state=open]:bg-slate-800",{variants:{variant:{default:"bg-slate-900 text-white hover:bg-slate-700 dark:bg-slate-50 dark:text-slate-900",destructive:"bg-red-500 text-white hover:bg-red-600 dark:hover:bg-red-600",outline:"bg-transparent border border-slate-200 hover:bg-slate-100 dark:border-slate-700 dark:text-slate-100",subtle:"bg-slate-100 text-slate-900 hover:bg-slate-200 dark:bg-slate-700 dark:text-slate-100",ghost:"bg-transparent hover:bg-slate-100 dark:hover:bg-slate-800 dark:text-slate-100 dark:hover:text-slate-100 data-[state=open]:bg-transparent dark:data-[state=open]:bg-transparent",link:"bg-transparent dark:bg-transparent underline-offset-4 hover:underline text-slate-900 dark:text-slate-100 hover:bg-transparent dark:hover:bg-transparent"},size:{default:"h-10 py-2 px-4",sm:"h-9 px-2 rounded-md",lg:"h-11 px-8 rounded-md"}},defaultVariants:{variant:"default",size:"default"}}),g=l.forwardRef((e,t)=>{let{className:a,variant:s,size:n,...o}=e;return(0,r.jsx)("button",{className:(0,i.cn)(p({variant:s,size:n,className:a})),ref:t,...o})});g.displayName="Button";var h=a(148),b=a(3040);let x=()=>{var e,t,a;let{register:d,handleSubmit:i,watch:u,formState:{errors:c},setValue:m}=(0,s.cI)({resolver:(0,n.F)(o.z.object({name:o.z.string().regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/,{message:"Name should only contain lowercase characters and dashes"}).min(1),projectPath:o.z.string().min(2)})),defaultValues:{name:"",projectPath:null!==(a=localStorage.getItem("__T3_UI_DIR__"))&&void 0!==a?a:"/home/peter/Programming/create-t3-ui"}}),p=(0,h.useRouter)(),x=i(async e=>{localStorage.setItem("__T3_UI_DATA__",JSON.stringify({...e,appType:b.Apptype.TURBO})),await p.push("/setup")}),v=u("name"),[_,k]=(0,l.useState)("");return(0,l.useEffect)(()=>{{let e=localStorage.getItem("__T3_UI_DIR__")||"/home/peter/Programming/create-t3-ui",t="".concat(e,"/").concat(v);k(t),m("projectPath",t)}},[_,v,m]),(0,r.jsx)(r.Fragment,{children:(0,r.jsxs)("div",{children:[(0,r.jsx)("h1",{children:"Create T3 Turbo"}),(0,r.jsx)("p",{children:"There's not much configuration to do here. Just fill in the data, click the create button and wait for your project!"}),(0,r.jsx)("div",{className:"mt-12",children:(0,r.jsxs)("form",{className:"flex w-auto flex-col gap-6 sm:w-96",onSubmit:x,children:[(0,r.jsx)(f,{inputProps:d("name"),label:"Project name",error:null===(e=c.name)||void 0===e?void 0:e.message}),(0,r.jsx)(f,{inputProps:{disabled:!0,value:_},label:"Path to your project",error:null===(t=c.projectPath)||void 0===t?void 0:t.message}),(0,r.jsx)(g,{type:"submit",className:"mt-6",children:"Create project"})]})})]})})};var v=x},4274:function(e,t,a){"use strict";a.d(t,{cn:function(){return n}});var r=a(4517),s=a(4015);let n=function(){for(var e=arguments.length,t=Array(e),a=0;a<e;a++)t[a]=arguments[a];return(0,s.m)((0,r.W)(t))}}},function(e){e.O(0,[868,230,774,888,179],function(){return e(e.s=1707)}),_N_E=e.O()}]);