import{T as h,c as i,a as v,b as s,w as g,t,d,v as u,u as o,e as c,f as b,F as k,r as y,g as E,o as l}from"./app-13978987.js";import{_ as V}from"./AdminLayout-bd13ff9d.js";import{_ as U}from"./SpinnerBtn-cb152833.js";import{_ as N}from"./PageHeader-8c638686.js";import"./dropdown-45d66330.js";const A={class:"container p-4 sm:p-6"},P={class:"space-y-6"},S={class:"grid grid-cols-12"},q={class:"col-span-5"},B={class:"col-span-7"},C={class:"card"},D={class:"card-body"},M={class:"mb-2"},$={for:"name"},F={key:0,class:"invalid-feedback text-danger d-block"},T={class:"mb-2"},j={for:"email"},L={key:0,class:"invalid-feedback text-danger d-block"},O={class:"mb-2"},R={for:"password"},z={key:0,class:"invalid-feedback text-danger d-block"},G={class:"mb-2"},H={for:"password_confirmation"},I={key:0,class:"invalid-feedback text-danger d-block"},J={class:"mb-2"},K=["value"],Q={key:0,class:"invalid-feedback text-danger d-block"},W={class:"mb-2"},X={value:"true"},Y={value:"false"},Z={class:"mb-2 mt-3"},x={class:"col-lg-12"},ss=E({layout:V}),rs=Object.assign(ss,{__name:"Edit",props:["segments","buttons","roles","user"],setup(p){var _,f;const m=p,e=h({name:m.user.name,email:m.user.email,password:null,password_confirmation:null,status:!!m.user.status,roles:(f=(_=m.user.roles)==null?void 0:_[0])==null?void 0:f.name}),w=()=>{const n=route("admin.admin.update",m.user.id);e.put(n)};return(n,r)=>(l(),i("main",A,[v(N,{title:n.trans("Edit Admin"),buttons:p.buttons},null,8,["title","buttons"]),s("div",P,[s("form",{onSubmit:g(w,["prevent"])},[s("div",S,[s("div",q,[s("strong",null,t(n.trans("Edit Admin")),1),s("p",null,t(n.trans("Edit admin profile information")),1)]),s("div",B,[s("div",C,[s("div",D,[s("div",M,[s("label",$,t(n.trans("Name")),1),d(s("input",{type:"text",placeholder:"Enter Name","onUpdate:modelValue":r[0]||(r[0]=a=>o(e).name=a),class:"input",id:"name",required:"",autocomplete:"off"},null,512),[[u,o(e).name]]),o(e).errors.name?(l(),i("div",F,t(o(e).errors.name),1)):c("",!0)]),s("div",T,[s("label",j,t(n.trans("Email")),1),d(s("input",{type:"email",placeholder:"Enter Email","onUpdate:modelValue":r[1]||(r[1]=a=>o(e).email=a),name:"email",class:"input",id:"email",required:"",autocomplete:"off"},null,512),[[u,o(e).email]]),o(e).errors.email?(l(),i("div",L,t(o(e).errors.email),1)):c("",!0)]),s("div",O,[s("label",R,t(n.trans("Password")),1),d(s("input",{type:"password",placeholder:"Enter password","onUpdate:modelValue":r[2]||(r[2]=a=>o(e).password=a),name:"password",class:"input",id:"password",autocomplete:"off"},null,512),[[u,o(e).password]]),o(e).errors.password?(l(),i("div",z,t(o(e).errors.password),1)):c("",!0)]),s("div",G,[s("label",H,t(n.trans("Password")),1),d(s("input",{type:"password",placeholder:"Confirm Password","onUpdate:modelValue":r[3]||(r[3]=a=>o(e).password_confirmation=a),name:"password_confirmation",class:"input",id:"password_confirmation",autocomplete:"off"},null,512),[[u,o(e).password_confirmation]]),o(e).errors.password_confirmation?(l(),i("div",I,t(o(e).errors.password_confirmation),1)):c("",!0)]),s("div",J,[s("label",null,t(n.trans("Assign Roles")),1),d(s("select",{required:"","onUpdate:modelValue":r[4]||(r[4]=a=>o(e).roles=a),id:"roles",class:"select"},[(l(!0),i(k,null,y(p.roles,a=>(l(),i("option",{key:a.id,value:a.name},t(a.name),9,K))),128))],512),[[b,o(e).roles]]),o(e).errors.roles?(l(),i("div",Q,t(o(e).errors.roles),1)):c("",!0)]),s("div",W,[s("label",null,t(n.trans("Status")),1),d(s("select",{name:"status",class:"select","onUpdate:modelValue":r[5]||(r[5]=a=>o(e).status=a)},[s("option",X,t(n.trans("Active")),1),s("option",Y,t(n.trans("Deactivate")),1)],512),[[b,o(e).status]])]),s("div",Z,[s("div",x,[v(U,{processing:o(e).processing,"btn-text":n.trans("Update Profile")},null,8,["processing","btn-text"])])])])])])])],32)])]))}});export{rs as default};
