(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,17658,e=>{"use strict";var t=e.i(43476);function i(...e){return e.filter(Boolean).join(" ")}e.i(22016);let n={primary:"bg-brand-green text-white hover:bg-brand-green-deep focus-visible:ring-brand-green",secondary:"border border-be-border bg-be-surface text-be-text hover:bg-be-surface-2 focus-visible:ring-brand-green",ghost:"text-be-muted hover:text-be-text hover:bg-be-surface-2 focus-visible:ring-brand-green",danger:"bg-[color:var(--pill-danger-fg)] text-white hover:opacity-90 focus-visible:ring-[color:var(--pill-danger-fg)]"};e.s(["Card",0,function({className:e,children:n}){return(0,t.jsx)("div",{className:i("be-card p-5",e),children:n})},"buttonClass",0,function(e="primary",t){return i("inline-flex items-center justify-center gap-1.5 rounded-lg px-4 py-2 text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-offset-be-bg disabled:opacity-50 disabled:pointer-events-none",n[e],t)}])},75023,e=>{"use strict";var t=e.i(43476),i=e.i(71645),n=e.i(18566),r=e.i(11795),a=e.i(17658);function s({label:e,children:i}){return(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"block text-sm font-medium mb-1 text-be-text",children:e}),i]})}e.s(["default",0,function(){let e=(0,n.useRouter)(),l=(0,r.createClient)(),[o,u]=(0,i.useState)({full_name:"",email:"",phone:""}),[c,d]=(0,i.useState)(null),[b,m]=(0,i.useState)(!1);async function g(t){t.preventDefault(),m(!0),d(null);let{data:i}=await l.auth.getUser();if(!i.user){d("Not signed in"),m(!1);return}let{data:n,error:r}=await l.from("customers").insert({organizer_id:i.user.id,email:o.email.trim().toLowerCase(),full_name:o.full_name||null,phone:o.phone||null}).select().single();if(r){d("23505"===r.code?"You already have a customer with this email.":r.message),m(!1);return}e.push(`/dashboard/customers/${n.id}`)}return(0,t.jsxs)("form",{onSubmit:g,className:"space-y-4",children:[(0,t.jsx)(s,{label:"Full name",children:(0,t.jsx)("input",{value:o.full_name,onChange:e=>u({...o,full_name:e.target.value}),className:"input"})}),(0,t.jsx)(s,{label:"Email",children:(0,t.jsx)("input",{required:!0,type:"email",value:o.email,onChange:e=>u({...o,email:e.target.value}),className:"input"})}),(0,t.jsx)(s,{label:"Phone",children:(0,t.jsx)("input",{value:o.phone,onChange:e=>u({...o,phone:e.target.value}),className:"input"})}),c&&(0,t.jsx)("p",{className:"text-sm text-red-600",children:c}),(0,t.jsx)("button",{type:"submit",disabled:b,className:(0,a.buttonClass)("primary"),children:b?"Adding…":"Add customer"})]})}])}]);