import{An as e,D as t,F as n,Ht as r,L as i,Nn as a,Zt as o,_n as s,an as c,en as l,g as u,k 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-6 sm:col-span-3`},C={class:`col-span-6 sm:col-span-3`},w={class:`col-span-6 sm:col-span-3`},T={class:`col-span-6 sm:col-span-3`},E={class:`col-span-6 sm:col-span-3`},D={class:`col-span-6 sm:col-span-3`},O={class:`col-span-6 sm:col-span-3`},k={class:`col-span-6 sm:col-span-3`},A={class:`col-span-6`},j={class:`flex flex-row justify-end bg-gray-100 px-6 py-4 text-end dark:bg-gray-950`},M={__name:`Form`,props:[`current`,`stores`,`users`],emits:[`close`,`done`],setup(M,{emit:N}){let P=M,F=N,I=r({_method:P.current?.id?`put`:`post`,user_id:P.current?.user_id||null,store_id:P.current?.store_id||null,department:P.current?.department||``,job_title:P.current?.job_title||``,hire_date:P.current?.hire_date||``,basic_salary:P.current?.basic_salary??0,working_days_per_month:P.current?.working_days_per_month??26,working_hours_per_day:P.current?.working_hours_per_day??8,notes:P.current?.notes||``});function L(){I.post(P.current?.id?route(`employees.update`,P.current.id):route(`employees.store`),{preserveScroll:!0,onSuccess:e=>{F(`done`,e.props.flash?.data),F(`close`)}})}return(r,N)=>(s(),p(`form`,{onSubmit:o(L,[`prevent`])},[l(`div`,g,[l(`div`,_,[l(`div`,v,[l(`h1`,y,a(M.current?.id?r.$t(`Edit {x}`,{x:r.$t(`Employee`)}):r.$t(`Add {x}`,{x:r.$t(`Employee`)})),1),l(`p`,b,a(r.$t(`Please fill the form below to {action} {record}.`,{record:r.$t(`employee`),action:M.current?.id?r.$t(`edit`):r.$t(`add`)})),1)])])]),l(`div`,x,[l(`div`,S,[f(e(i),{json:!0,label:r.$t(`Store`),suggestions:M.stores,modelValue:e(I).store_id,"onUpdate:modelValue":N[0]||=t=>e(I).store_id=t,error:e(I).errors.store_id,placeholder:r.$t(`Select store`)},null,8,[`label`,`suggestions`,`modelValue`,`error`,`placeholder`])]),l(`div`,C,[f(e(i),{json:!0,label:r.$t(`User`),suggestions:M.users,modelValue:e(I).user_id,"onUpdate:modelValue":N[1]||=t=>e(I).user_id=t,error:e(I).errors.user_id,placeholder:r.$t(`Select employee user`)},null,8,[`label`,`suggestions`,`modelValue`,`error`,`placeholder`])]),l(`div`,w,[f(e(t),{label:r.$t(`Department`),modelValue:e(I).department,"onUpdate:modelValue":N[2]||=t=>e(I).department=t,error:e(I).errors.department},null,8,[`label`,`modelValue`,`error`])]),l(`div`,T,[f(e(t),{label:r.$t(`Job Title`),modelValue:e(I).job_title,"onUpdate:modelValue":N[3]||=t=>e(I).job_title=t,error:e(I).errors.job_title},null,8,[`label`,`modelValue`,`error`])]),l(`div`,E,[f(e(d),{type:`date`,label:r.$t(`Hire Date`),modelValue:e(I).hire_date,"onUpdate:modelValue":N[4]||=t=>e(I).hire_date=t,error:e(I).errors.hire_date},null,8,[`label`,`modelValue`,`error`])]),l(`div`,D,[f(e(t),{type:`number`,label:r.$t(`Basic Salary`),modelValue:e(I).basic_salary,"onUpdate:modelValue":N[5]||=t=>e(I).basic_salary=t,error:e(I).errors.basic_salary},null,8,[`label`,`modelValue`,`error`])]),l(`div`,O,[f(e(t),{type:`number`,required:!0,label:r.$t(`Working Days/Month`),modelValue:e(I).working_days_per_month,"onUpdate:modelValue":N[6]||=t=>e(I).working_days_per_month=t,error:e(I).errors.working_days_per_month},null,8,[`label`,`modelValue`,`error`])]),l(`div`,k,[f(e(t),{type:`number`,required:!0,label:r.$t(`Working Hours/Day`),modelValue:e(I).working_hours_per_day,"onUpdate:modelValue":N[7]||=t=>e(I).working_hours_per_day=t,error:e(I).errors.working_hours_per_day},null,8,[`label`,`modelValue`,`error`])]),l(`div`,A,[f(e(u),{rows:`2`,label:r.$t(`Notes`),modelValue:e(I).notes,"onUpdate:modelValue":N[8]||=t=>e(I).notes=t,error:e(I).errors.notes},null,8,[`label`,`modelValue`,`error`])])]),l(`div`,j,[f(e(h),{onClick:N[9]||=e=>r.$emit(`close`)},{default:m(()=>[c(a(r.$t(`Cancel`)),1)]),_:1}),f(e(n),{class:`ms-3`,loading:e(I).processing},{default:m(()=>[c(a(r.$t(`Save`)),1)]),_:1},8,[`loading`])])],32))}};export{M as default};