import{An as e,D as t,F as n,Ht as r,Lt as i,N as a,Nn as o,Zt as s,_n as c,an as l,en as u,g as d,on as f,rn as p,wn as m,wt as h}from"./app-4kCgdoJR.js";var g={class:`border-b border-gray-200 px-6 py-4 dark:border-gray-700`},_={class:`sm:flex sm:items-baseline sm:justify-between`},v={class:`sm:w-0 sm:flex-1`},y={class:`text-focus text-base font-semibold`},b={class:`text-mute mt-1 truncate text-sm`},x={class:`grid grid-cols-6 gap-6 p-6`},S={class:`col-span-full`},C={class:`col-span-full`},w={class:`col-span-full`},T={class:`flex flex-row justify-end bg-gray-100 px-6 py-4 text-end dark:bg-gray-950`},E={__name:`Form`,props:[`current`],emits:[`close`,`done`],setup(E,{emit:D}){let O=D,k=E,A=r({_method:k.current?.id?`put`:`post`,name:k.current?.name,description:k.current?.description,active:k.current?.id?k.current?.active==1:!0});function j(){A.post(k.current?.id?i(`asset-categories.update`,k.current.id):i(`asset-categories.store`),{onSuccess:()=>{O(`done`),O(`close`)}})}return(r,i)=>(c(),p(`form`,{onSubmit:s(j,[`prevent`])},[u(`div`,g,[u(`div`,_,[u(`div`,v,[u(`h1`,y,o(E.current?.id?r.$t(`Edit {x}`,{x:r.$t(`Asset Category`)}):r.$t(`Add {x}`,{x:r.$t(`Asset Category`)})),1),u(`p`,b,o(r.$t(`Please fill the form below to {action} {record}.`,{record:r.$t(`asset category`),action:E.current?.id?r.$t(`edit`):r.$t(`add`)})),1)])])]),u(`div`,x,[u(`div`,S,[f(e(t),{id:`name`,label:r.$t(`Name`),modelValue:e(A).name,"onUpdate:modelValue":i[0]||=t=>e(A).name=t,error:e(A).errors.name},null,8,[`label`,`modelValue`,`error`])]),u(`div`,C,[f(e(d),{id:`description`,label:r.$t(`Description`),modelValue:e(A).description,"onUpdate:modelValue":i[1]||=t=>e(A).description=t,error:e(A).errors.description},null,8,[`label`,`modelValue`,`error`])]),u(`div`,w,[f(e(a),{id:`active`,error:e(A).errors.active,checked:e(A).active,"onUpdate:checked":i[2]||=t=>e(A).active=t,label:r.$t(`Active`)},null,8,[`error`,`checked`,`label`])])]),u(`div`,T,[f(e(h),{onClick:i[3]||=e=>O(`close`)},{default:m(()=>[l(o(r.$t(`Cancel`)),1)]),_:1}),f(e(n),{class:`ms-3`,loading:e(A).processing},{default:m(()=>[l(o(r.$t(`Save`)),1)]),_:1},8,[`loading`])])],32))}};export{E as default};