(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,33543,e=>{"use strict";var r=e.i(43476),o=e.i(48148),t=e.i(71645);e.s(["ReserveForm",0,function(){let e=(0,o.useTranslations)("reserve"),[s,d]=(0,t.useState)("idle"),[n,l]=(0,t.useState)(!1);async function a(e){e.preventDefault(),l(!0),d("idle");let r=e.currentTarget,o=new FormData(r),t=String(o.get("date")),s={name:String(o.get("name")),email:String(o.get("email")),phone:String(o.get("phone")),partySize:Number(o.get("partySize")),date:new Date(`${t}T12:00:00`).toISOString(),time:String(o.get("time")),message:o.get("message")?String(o.get("message")):void 0};try{if(!(await fetch("/api/reservations",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)})).ok)throw Error("fail");d("ok"),r.reset()}catch{d("err")}finally{l(!1)}}return(0,r.jsxs)("form",{onSubmit:a,className:"mx-auto mt-8 grid max-w-lg gap-4 rounded-xl border border-border bg-card/60 p-6 shadow-[0_0_40px_rgba(201,162,39,0.06)] backdrop-blur",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"mb-1 block text-sm text-muted",children:e("name")}),(0,r.jsx)("input",{required:!0,name:"name",className:"w-full rounded-md border border-border bg-background px-3 py-2 text-foreground focus:border-gold focus:outline-none focus:ring-1 focus:ring-gold"})]}),(0,r.jsxs)("div",{className:"grid gap-4 sm:grid-cols-2",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"mb-1 block text-sm text-muted",children:e("email")}),(0,r.jsx)("input",{required:!0,type:"email",name:"email",className:"w-full rounded-md border border-border bg-background px-3 py-2 text-foreground focus:border-gold focus:outline-none focus:ring-1 focus:ring-gold"})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"mb-1 block text-sm text-muted",children:e("phone")}),(0,r.jsx)("input",{required:!0,name:"phone",className:"w-full rounded-md border border-border bg-background px-3 py-2 text-foreground focus:border-gold focus:outline-none focus:ring-1 focus:ring-gold"})]})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"mb-1 block text-sm text-muted",children:e("partySize")}),(0,r.jsx)("input",{required:!0,type:"number",min:1,max:50,name:"partySize",defaultValue:2,className:"w-full rounded-md border border-border bg-background px-3 py-2 text-foreground focus:border-gold focus:outline-none focus:ring-1 focus:ring-gold"})]}),(0,r.jsxs)("div",{className:"grid gap-4 sm:grid-cols-2",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"mb-1 block text-sm text-muted",children:e("date")}),(0,r.jsx)("input",{required:!0,type:"date",name:"date",className:"w-full rounded-md border border-border bg-background px-3 py-2 text-foreground focus:border-gold focus:outline-none focus:ring-1 focus:ring-gold"})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"mb-1 block text-sm text-muted",children:e("time")}),(0,r.jsx)("input",{required:!0,type:"time",name:"time",className:"w-full rounded-md border border-border bg-background px-3 py-2 text-foreground focus:border-gold focus:outline-none focus:ring-1 focus:ring-gold"})]})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"mb-1 block text-sm text-muted",children:e("message")}),(0,r.jsx)("textarea",{name:"message",rows:3,className:"w-full rounded-md border border-border bg-background px-3 py-2 text-foreground focus:border-gold focus:outline-none focus:ring-1 focus:ring-gold"})]}),"ok"===s&&(0,r.jsx)("p",{className:"text-sm text-gold",role:"status",children:e("success")}),"err"===s&&(0,r.jsx)("p",{className:"text-sm text-red-400",role:"alert",children:e("error")}),(0,r.jsx)("button",{type:"submit",disabled:n,className:"rounded-md bg-gold px-4 py-3 text-sm font-medium text-background transition hover:bg-gold-hover disabled:opacity-60",children:n?"…":e("submit")})]})}])}]);