import{u as m}from"./api.31efd825.js";import{x as d,k as c,b as f,y as p,h as e,N as v}from"./entry.83e061d6.js";import{d as b}from"./component.13bf56b8.js";import"./components.client.581405d2.js";import{b as y}from"./enity-nav.b8302727.js";import"./composables.633e7485.js";import"./sidebar.vue_vue_type_script_lang.36571436.js";import"./LoginSVG.06b0ff46.js";const T=b({async setup(){const r=[{name:"General",icon:"fas fa-bars",urlSuffix:""},{name:"Permissions",icon:"fas fa-user-secret",urlSuffix:"permissions"},{name:"Roles",icon:"fa-solid fa-user-group",urlSuffix:"roles"}],o=d(),n=c(),s=f(null);try{s.value=await m().user.getOne(n.params.id,{fields:["+email"]})}catch{return p({path:"/admin/roles"})}const u=a=>{o.success("The user was successfully updated.");const i=Object.keys(a);for(let t=0;t<i.length;t++)s.value[i[t]]=a[i[t]]},l=a=>{o.warning(a.message)};return()=>e("div",[e("h1",{class:"title no-border mb-3"},[e("i",{class:"fa fa-user me-1"}),s.value.name,e("span",{class:"sub-title ms-1"},["Details"])]),e("div",{class:"mb-2"},[y(`/admin/users/${s.value.id}`,r,{prevLink:!0})]),e("div",[e(v,{onUpdated:u,onFailed:l,entity:s.value})])])}});export{T as default};
