import{Dn as e,Kt as t,M as n,O as r,Q as i,R as a,Tn as o,Y as s,at as c,i as l,it as u,o as d,or as f,r as p,st as m}from"./dist-CoD0k1Bd.js";import{t as h}from"./Label-DKn3cyeE.js";import{t as g}from"./arrow-left-GfHRP_1N.js";import{t as _}from"./Input-C3DwKNOf.js";import{t as v}from"./button-mN_poAXs.js";import{t as y}from"./routes-BZ4t1sNs.js";import{t as b}from"./Heading-CCd5Tysh.js";import{t as x}from"./InputError-BY5lDrFd.js";var S={class:`flex flex-col space-y-6`},C={class:`grid gap-2`},w={class:`grid gap-2`},T={class:`grid gap-2`},E={class:`flex justify-end gap-2`},D=m({layout:{breadcrumbs:[{title:`Dashboard`,href:y()},{title:`Bank`,href:`/banks`},{title:`Edit`,href:`/banks`}]},__name:`Edit`,props:{bank:{}},setup(m){let y=m,D=d({kode:y.bank.kode,keterangan:y.bank.keterangan,status:y.bank.status}),O=()=>D.put(`/banks/${y.bank.id}`);return(d,m)=>(t(),i(a,null,[c(f(p),{title:`Edit Bank`}),s(`div`,S,[s(`div`,null,[c(f(v),{"as-child":``,variant:`ghost`,size:`sm`,class:`mb-2`},{default:o(()=>[c(f(l),{href:`/banks`},{default:o(()=>[c(f(g),{class:`size-4`}),m[3]||=u(` Kembali`,-1)]),_:1})]),_:1}),c(b,{title:`Edit: ${y.bank.kode}`,description:`Ubah rekening bank`},null,8,[`title`])]),s(`form`,{onSubmit:n(O,[`prevent`]),class:`max-w-2xl space-y-6`},[s(`div`,C,[c(f(h),{for:`kode`},{default:o(()=>[...m[4]||=[u(`Kode `,-1),s(`span`,{class:`text-destructive`},`*`,-1)]]),_:1}),c(f(_),{id:`kode`,modelValue:f(D).kode,"onUpdate:modelValue":m[0]||=e=>f(D).kode=e,required:``},null,8,[`modelValue`]),c(x,{message:f(D).errors.kode},null,8,[`message`])]),s(`div`,w,[c(f(h),{for:`keterangan`},{default:o(()=>[...m[5]||=[u(`Keterangan `,-1),s(`span`,{class:`text-destructive`},`*`,-1)]]),_:1}),c(f(_),{id:`keterangan`,modelValue:f(D).keterangan,"onUpdate:modelValue":m[1]||=e=>f(D).keterangan=e,required:``},null,8,[`modelValue`]),c(x,{message:f(D).errors.keterangan},null,8,[`message`])]),s(`div`,T,[c(f(h),{for:`status`},{default:o(()=>[...m[6]||=[u(`Status`,-1)]]),_:1}),e(s(`select`,{id:`status`,"onUpdate:modelValue":m[2]||=e=>f(D).status=e,class:`mt-1 block w-full rounded-md border border-input bg-background px-3 py-2 text-sm`},[...m[7]||=[s(`option`,{value:!0},`Aktif`,-1),s(`option`,{value:!1},`Nonaktif`,-1)]],512),[[r,f(D).status]])]),s(`div`,E,[c(f(v),{"as-child":``,variant:`outline`,type:`button`},{default:o(()=>[c(f(l),{href:`/banks`},{default:o(()=>[...m[8]||=[u(`Batal`,-1)]]),_:1})]),_:1}),c(f(v),{type:`submit`,disabled:f(D).processing},{default:o(()=>[...m[9]||=[u(`Simpan`,-1)]]),_:1},8,[`disabled`])])],32)])],64))}});export{D as default};