import{u as g,c as _,b as o,t as d,a as n,g as e,w as m,d as u,l as $,o as v,P as p}from"./app-CYVHboi-.js";import{_ as h}from"./SecondaryButton-CHQvCfls.js";import{_ as y}from"./LoadingButton-CH88QwYm.js";import{_ as V}from"./CheckBox-FJj299Iw.js";import{_ as k}from"./Input-VvJHlcSh.js";import{_ as w}from"./Textarea-D40HahXW.js";import"./browser-BwNzv7vE.js";import"./InputError-u5FIXCwc.js";import"./Keyboard-VWzCpVN-.js";import"./composable-DK3kcOvi.js";import"./InputLabel-dHPaqRUC.js";const x={class:"border-b border-gray-200 px-6 py-4 dark:border-gray-700"},C={class:"sm:flex sm:items-baseline sm:justify-between"},S={class:"sm:w-0 sm:flex-1"},A={class:"text-focus text-base font-semibold"},N={class:"text-mute mt-1 truncate text-sm"},B={class:"grid grid-cols-6 gap-6 p-6"},U={class:"col-span-full"},j={class:"col-span-full"},D={class:"col-span-full"},E={class:"flex flex-row justify-end bg-gray-100 px-6 py-4 text-end dark:bg-gray-950"},L={__name:"Form",props:["current"],emits:["close","done"],setup(l,{emit:f}){const c=f,a=l,s=g({_method:a.current?.id?"put":"post",name:a.current?.name,description:a.current?.description,active:a.current?.id?a.current?.active==1:!0});function b(){s.post(a.current?.id?p("asset-categories.update",a.current.id):p("asset-categories.store"),{onSuccess:()=>{c("done"),c("close")}})}return(t,r)=>(v(),_("form",{onSubmit:$(b,["prevent"])},[o("div",x,[o("div",C,[o("div",S,[o("h1",A,d(l.current?.id?t.$t("Edit {x}",{x:t.$t("Asset Category")}):t.$t("Add {x}",{x:t.$t("Asset Category")})),1),o("p",N,d(t.$t("Please fill the form below to {action} {record}.",{record:t.$t("asset category"),action:l.current?.id?t.$t("edit"):t.$t("add")})),1)])])]),o("div",B,[o("div",U,[n(e(k),{id:"name",label:t.$t("Name"),modelValue:e(s).name,"onUpdate:modelValue":r[0]||(r[0]=i=>e(s).name=i),error:e(s).errors.name},null,8,["label","modelValue","error"])]),o("div",j,[n(e(w),{id:"description",label:t.$t("Description"),modelValue:e(s).description,"onUpdate:modelValue":r[1]||(r[1]=i=>e(s).description=i),error:e(s).errors.description},null,8,["label","modelValue","error"])]),o("div",D,[n(e(V),{id:"active",error:e(s).errors.active,checked:e(s).active,"onUpdate:checked":r[2]||(r[2]=i=>e(s).active=i),label:t.$t("Active")},null,8,["error","checked","label"])])]),o("div",E,[n(e(h),{onClick:r[3]||(r[3]=i=>c("close"))},{default:m(()=>[u(d(t.$t("Cancel")),1)]),_:1}),n(e(y),{class:"ms-3",loading:e(s).processing},{default:m(()=>[u(d(t.$t("Save")),1)]),_:1},8,["loading"])])],32))}};export{L as default};
