import{u as l}from"./object.62d64729.js";import{u as f}from"./api.4ad3383d.js";import{y as c,u as d,t as b}from"./auth.8c936e9a.js";import{i as v}from"./utils.2e24de1e.js";import{u as h}from"./entry.0b5898f4.js";import"./components.client.8c0e2f0e.js";import{l as g,n as r}from"./nuxt-link.a91ddf68.js";import"./app.config.5ff5ca90.js";import{b as x}from"./enity-nav.95a7d016.js";import y from"./page.16487999.js";import{r as R,h as s}from"./runtime-core.esm-bundler.24b58585.js";import"./composables.050e3231.js";import"./utils.61cc85c6.js";import"./layout.1eaf47bc.js";import"./_plugin-vue_export-helper.c27b6911.js";import"./header.vue.a5725157.js";import"./sidebar.vue.f4078c43.js";import"./AccountSVG.3eaa8808.js";import"./LoginSVG.52eb3125.js";/* empty css                    */import"./nuxt-error-boundary.eaaf5a22.js";import"./client-only.eb4a3450.js";import"./dev-only.ae8b1c36.js";import"./server-placeholder.93f5b750.js";import"./nuxt-loading-indicator.65caef1d.js";import"./components.da5780c2.js";const K=c({async setup(){const a=[{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"}],o=h(),i=g(),t=R(null);try{t.value=await f().permission.getOne(i.params.id)}catch{return r({path:"/admin/permissions"})}const m=d(),{realmManagement:n}=b(m);if(!v(n.value,t.value.realm_id))return r({path:"/admin/permissions"});const u=e=>{o.success("The permission was successfully updated."),l(t,e)},p=e=>{o.warning(e.message)};return()=>s("div",[s("h1",{class:"title no-border mb-3"},[s("i",{class:"fa fa-robot me-1"}),t.value.name,s("span",{class:"sub-title ms-1"},["Details"])]),s("div",{class:"mb-2"},[x(`/admin/permissions/${t.value.id}`,a,{prevLink:!0})]),s("div",[s(y,{onUpdated:u,onFailed:p,entity:t.value})])])}});export{K as default};
