import{m as g,c as p,w as c,a as t,b as y,u as o,l as v,d as x,p as w,g as a,e as l,i as m,v as u,o as n,t as i,F as h,r as k,h as V}from"./app-iLLm8RtX.js";import{_ as C}from"./Layout-C0f8t0-G.js";/* empty css            */const N={class:"py-12"},_={class:"max-w-2xl mx-auto sm:px-6 lg:px-8"},B={class:"bg-white overflow-hidden shadow-sm sm:rounded-lg"},P={class:"p-6 text-gray-900"},S={class:"flex justify-between items-center mb-6"},U={class:"mb-4"},q={key:0,class:"text-red-600 text-sm mt-1"},F={class:"mb-4"},M={key:0,class:"text-red-600 text-sm mt-1"},T={class:"mb-4"},j=["value"],A={key:0,class:"text-red-600 text-sm mt-1"},D={class:"mb-4"},E={key:0,class:"text-red-600 text-sm mt-1"},O=["disabled"],H={__name:"CreatePartner",props:{centers:Array,errors:Object},setup(d){const r=g({name:"",email:"",center_id:"",phone:""}),f=()=>{r.post("/admin/partners/store")},{processing:b}=r;return(L,e)=>(n(),p(C,null,{default:c(()=>[t("div",N,[t("div",_,[t("div",B,[t("div",P,[t("div",S,[e[5]||(e[5]=t("h2",{class:"text-2xl font-bold"},"Create New Partner",-1)),y(o(v),{href:"/admin/partners/index",class:"bg-gray-600 hover:bg-gray-700 text-white font-bold py-2 px-4 rounded"},{default:c(()=>[...e[4]||(e[4]=[x(" Back to Partners ",-1)])]),_:1})]),t("form",{onSubmit:w(f,["prevent"])},[t("div",U,[e[6]||(e[6]=t("label",{class:"block text-sm font-medium text-gray-700 mb-2"},"Name",-1)),a(t("input",{"onUpdate:modelValue":e[0]||(e[0]=s=>o(r).name=s),type:"text",class:"w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-indigo-500 focus:border-indigo-500",required:""},null,512),[[u,o(r).name]]),d.errors.name?(n(),l("div",q,i(d.errors.name),1)):m("",!0)]),t("div",F,[e[7]||(e[7]=t("label",{class:"block text-sm font-medium text-gray-700 mb-2"},"Email",-1)),a(t("input",{"onUpdate:modelValue":e[1]||(e[1]=s=>o(r).email=s),type:"email",class:"w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-indigo-500 focus:border-indigo-500",required:""},null,512),[[u,o(r).email]]),d.errors.email?(n(),l("div",M,i(d.errors.email),1)):m("",!0)]),t("div",T,[e[9]||(e[9]=t("label",{class:"block text-sm font-medium text-gray-700 mb-2"},"Center",-1)),a(t("select",{"onUpdate:modelValue":e[2]||(e[2]=s=>o(r).center_id=s),class:"w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-indigo-500 focus:border-indigo-500",required:""},[e[8]||(e[8]=t("option",{value:""},"Select a center",-1)),(n(!0),l(h,null,k(d.centers,s=>(n(),l("option",{key:s.id,value:s.id},i(s.name),9,j))),128))],512),[[V,o(r).center_id]]),d.errors.center_id?(n(),l("div",A,i(d.errors.center_id),1)):m("",!0)]),t("div",D,[e[10]||(e[10]=t("label",{class:"block text-sm font-medium text-gray-700 mb-2"},"Phone (Optional)",-1)),a(t("input",{"onUpdate:modelValue":e[3]||(e[3]=s=>o(r).phone=s),type:"text",class:"w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-indigo-500 focus:border-indigo-500"},null,512),[[u,o(r).phone]]),d.errors.phone?(n(),l("div",E,i(d.errors.phone),1)):m("",!0)]),e[11]||(e[11]=t("div",{class:"bg-blue-50 p-4 rounded-md mb-6"},[t("p",{class:"text-sm text-blue-800"},[t("strong",null,"Note:"),x(" An access code will be automatically generated for this partner. They will use their email and access code to log in. ")])],-1)),t("button",{type:"submit",disabled:o(b),class:"w-full bg-blue-600 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded disabled:opacity-50"},i(o(b)?"Creating...":"Create Partner"),9,O)],32)])])])])]),_:1}))}};export{H as default};
