import{u as f}from"./object.62d64729.js";import{u as c}from"./api.160776dd.js";import{a as p,j as d,k as b,b as v,l as o,m as h,s as g,h as s,N as x}from"./entry.e097670d.js";import{i as y}from"./utils.c307b373.js";/* empty css                    */import{b as R}from"./enity-nav.bde0d636.js";import"./nuxt-link.1a4e25e4.js";const j=p({async setup(){const i=[{name:"General",icon:"fas fa-bars",urlSuffix:""},{name:"Users",icon:"fas fa-user",urlSuffix:"users"},{name:"Robots",icon:"fas fa-robot",urlSuffix:"robots"},{name:"Roles",icon:"fas fa-user-group",urlSuffix:"roles"}],t=d(),r=b(),e=v(null);try{e.value=await c().permission.getOne(r.params.id)}catch{return o({path:"/admin/permissions"})}const n=h(),{realmManagement:u}=g(n);if(!y(u.value,e.value.realm_id))return o({path:"/admin/permissions"});const m=a=>{t.success("The permission was successfully updated."),f(e,a)},l=a=>{t.warning(a.message)};return()=>s("div",[s("h1",{class:"title no-border mb-3"},[s("i",{class:"fa fa-robot me-1"}),e.value.name,s("span",{class:"sub-title ms-1"},["Details"])]),s("div",{class:"mb-2"},[R(`/admin/permissions/${e.value.id}`,i,{prevLink:!0})]),s("div",[s(x,{onUpdated:m,onFailed:l,entity:e.value})])])}});export{j as default};
