import{d as v,T as b,c as i,o as l,a as s,t,l as d,i as m,v as p,u as o,A as _,F as w,g,b as h,x as k,E as y}from"./app-Do7K7VDV.js";import{_ as E}from"./AdminLayout-DeT_GLTC.js";import{_ as V}from"./SpinnerBtn-C-rqKjUt.js";import"./AssetModal-C18ToIEK.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./InputFieldError-0BmYlL24.js";import"./ToastrContainer-CtYDvNPN.js";const S={class:"space-y-6"},U={class:"grid grid-cols-1 gap-4 lg:grid-cols-12"},A={class:"lg:col-span-5"},N={class:"lg:col-span-7"},P={class:"card"},q={class:"card-body"},B={class:"mb-2"},C={for:"name"},D={key:0,class:"invalid-feedback text-danger d-block"},M={class:"mb-2"},F={for:"email"},T={key:0,class:"invalid-feedback text-danger d-block"},$={class:"mb-2"},j={for:"password"},I={key:0,class:"invalid-feedback text-danger d-block"},L={class:"mb-2"},O={for:"password_confirmation"},R={key:0,class:"invalid-feedback text-danger d-block"},x={class:"mb-2"},z=["value"],G={key:0,class:"invalid-feedback text-danger d-block"},H={class:"mb-2"},J={value:""},K={value:1},Q={value:0},W={class:"mb-2 mt-3"},X={class:"col-lg-12"},Y=v({layout:E}),ns=Object.assign(Y,{__name:"Edit",props:["roles","user"],setup(u){const c=u,e=b({name:c.user.name,email:c.user.email,password:null,password_confirmation:null,status:c.user.status,roles:c.user.roles[0].name}),f=()=>{const r=route("admin.admin.update",c.user.id);e.put(r,{preserveScroll:!0,onSuccess:()=>{y.success(trans("Sub admin profile updated"))}})};return(r,n)=>(l(),i("div",S,[s("form",{onSubmit:k(f,["prevent"])},[s("div",U,[s("div",A,[s("strong",null,t(r.trans("Edit Admin")),1),s("p",null,t(r.trans("Edit admin profile information")),1)]),s("div",N,[s("div",P,[s("div",q,[s("div",B,[s("label",C,t(r.trans("Name")),1),d(s("input",{type:"text",placeholder:"Doe","onUpdate:modelValue":n[0]||(n[0]=a=>o(e).name=a),class:"input",id:"name",required:"",autocomplete:"off"},null,512),[[p,o(e).name]]),o(e).errors.name?(l(),i("div",D,t(o(e).errors.name),1)):m("",!0)]),s("div",M,[s("label",F,t(r.trans("Email")),1),d(s("input",{type:"email",placeholder:"Enter Email","onUpdate:modelValue":n[1]||(n[1]=a=>o(e).email=a),name:"email",class:"input",id:"email",required:"",autocomplete:"off"},null,512),[[p,o(e).email]]),o(e).errors.email?(l(),i("div",T,t(o(e).errors.email),1)):m("",!0)]),s("div",$,[s("label",j,t(r.trans("Password")),1),d(s("input",{type:"password",placeholder:"Enter password","onUpdate:modelValue":n[2]||(n[2]=a=>o(e).password=a),name:"password",class:"input",id:"password",autocomplete:"off"},null,512),[[p,o(e).password]]),o(e).errors.password?(l(),i("div",I,t(o(e).errors.password),1)):m("",!0)]),s("div",L,[s("label",O,t(r.trans("Password")),1),d(s("input",{type:"password",placeholder:"Confirm Password","onUpdate:modelValue":n[3]||(n[3]=a=>o(e).password_confirmation=a),name:"password_confirmation",class:"input",id:"password_confirmation",autocomplete:"off"},null,512),[[p,o(e).password_confirmation]]),o(e).errors.password_confirmation?(l(),i("div",R,t(o(e).errors.password_confirmation),1)):m("",!0)]),s("div",x,[s("label",null,t(r.trans("Assign Roles")),1),d(s("select",{required:"","onUpdate:modelValue":n[4]||(n[4]=a=>o(e).roles=a),id:"roles",class:"select"},[(l(!0),i(w,null,g(u.roles,a=>(l(),i("option",{key:a.id,value:a.name},t(a.name),9,z))),128))],512),[[_,o(e).roles]]),o(e).errors.roles?(l(),i("div",G,t(o(e).errors.roles),1)):m("",!0)]),s("div",H,[s("label",null,t(r.trans("Status")),1),d(s("select",{name:"status",class:"select","onUpdate:modelValue":n[5]||(n[5]=a=>o(e).status=a)},[s("option",J,t(r.trans("Select")),1),s("option",K,t(r.trans("Active")),1),s("option",Q,t(r.trans("Inactive")),1)],512),[[_,o(e).status]])]),s("div",W,[s("div",X,[h(V,{processing:o(e).processing,"btn-text":r.trans("Update Profile")},null,8,["processing","btn-text"])])])])])])])],32)]))}});export{ns as default};
