import{_ as f}from"./DomainEntityNav.WTBtLm35.js";import{f as _,q as h,l as y,s as l,v as c,x as m,y as v,z as b,_ as w,o as g,c as x,a as o,d as N,t as $,b as p,B as R}from"./entry.eQZ3auYG.js";import{u as B}from"./object.9wxptNlh.js";import{u as F}from"./api.2o71dS_j.js";import{u as S}from"./toast.xQvLCn8q.js";import{i as T}from"./utils.kGqDb192.js";import"./nuxt-link.f01z1rl7.js";const U=_({components:{DomainEntityNav:f},async setup(){let e,s;const d=[{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"}],t=S(),u=h(),a=y(null);try{a.value=([e,s]=l(()=>F().user.getOne(u.params.id,{fields:["+email"]})),e=await e,s(),e)}catch{throw[e,s]=l(()=>c({path:"/admin/users"})),await e,s(),m({})}const i=v(),{realmManagement:r}=b(i);if(!T(r.value,a.value.realm_id))throw[e,s]=l(()=>c({path:"/admin/users"})),await e,s(),m({});return{items:d,entity:a,handleUpdated:n=>{t&&t.show({variant:"success",body:"The user was successfully updated."}),B(a,n)},handleFailed:n=>{t&&t.show({variant:"warning",body:n.message})}}}},"$2mGreBrdRV"),D={class:"title no-border mb-3"},E=o("i",{class:"fa fa-user me-1"},null,-1),P=o("span",{class:"sub-title ms-1"}," Details ",-1),V={class:"mb-2"};function k(e,s,d,t,u,a){const i=f,r=R;return g(),x("div",null,[o("h1",D,[E,N(" "+$(e.entity.name)+" ",1),P]),o("div",V,[p(i,{items:e.items,path:`/admin/users/${e.entity.id}`,"prev-link":!0},null,8,["items","path"])]),o("div",null,[p(r,{entity:e.entity,onUpdated:e.handleUpdated,onFailed:e.handleFailed},null,8,["entity","onUpdated","onFailed"])])])}const W=w(U,[["render",k]]);export{W as default};
