import{_ as f}from"./DomainEntityNav.05a2f50d.js";import{f as _,n as h,q as y,k as b,s as l,v as m,x as u,y as v,z as g,_ as w,o as x,c as U,a as n,d as N,t as $,b as p,A as k}from"./entry.c7cd0af6.js";import{u as F}from"./api.45358b0b.js";import{i as S}from"./utils.1db1ba01.js";import"./index.20c05cdd.js";import{u as A}from"./object.62d64729.js";import"./nuxt-link.40687dc5.js";const P=_({async setup(){let e,s;const d=[{name:"General",icon:"fas fa-bars",urlSuffix:""},{name:"Permissions",icon:"fas fa-user-secret",urlSuffix:"permissions"},{name:"Users",icon:"fas fa-users",urlSuffix:"users"}],t=h(),c=y(),a=b(null);try{a.value=([e,s]=l(()=>F().role.getOne(c.params.id)),e=await e,s(),e)}catch{throw[e,s]=l(()=>m({path:"/admin/roles"})),await e,s(),u({})}const i=v(),{realmManagement:r}=g(i);if(!S(r.value,a.value.realm_id))throw[e,s]=l(()=>m({path:"/admin/roles"})),await e,s(),u({});return{entity:a,items:d,handleUpdated:o=>{t&&t.success({body:"The role was successfully updated."}),A(a,o)},handleFailed:o=>{t&&t.warning({body:o.message})}}}},"$661tUZZfJV"),R={class:"title no-border mb-3"},T=n("i",{class:"fa-solid fa-theater-masks me-1"},null,-1),V=n("span",{class:"sub-title ms-1"},"Details",-1),B={class:"mb-2"};function D(e,s,d,t,c,a){const i=f,r=k;return x(),U("div",null,[n("h1",R,[T,N(" "+$(e.entity.name)+" ",1),V]),n("div",B,[p(i,{path:"/admin/roles/"+e.entity.id,items:e.items,"prev-link":!0},null,8,["path","items"])]),n("div",null,[p(r,{entity:e.entity,onUpdated:e.handleUpdated,onFailed:e.handleFailed},null,8,["entity","onUpdated","onFailed"])])])}const J=w(P,[["render",D]]);export{J as default};
