import{_ as f}from"./DomainEntityNav.BAO77Cju.js";import{f as _,g as h,r as b,h as l,n as u,i as m,j as y,s as v,_ as g,o as w,c as x,a as o,d as N,t as $,b as p,k as F}from"./entry.2l8qV6vk.js";import{u as R}from"./object.koeG6dC5.js";import{u as S}from"./api.HNdnc-09.js";import{u as T}from"./toast.Duw7-oGa.js";import{i as U}from"./utils.RlM3h-HS.js";import"./nuxt-link.CpFeHJNO.js";const k=_({async setup(){let e,t;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"}],s=T(),c=h(),a=b(null);try{a.value=([e,t]=l(()=>S().robot.getOne(c.params.id,{fields:["+secret"]})),e=await e,t(),e)}catch{[e,t]=l(()=>u({path:"/admin/robots"})),await e,t(),m({})}const i=y(),{realmManagement:r}=v(i);return U(r.value,a.value.realm_id)||([e,t]=l(()=>u({path:"/admin/robots"})),await e,t(),m({})),{entity:a,items:d,handleUpdated:n=>{s&&s.show({variant:"success",body:"The robot was successfully updated."}),R(a,n)},handleFailed:n=>{s&&s.show({variant:"warning",body:n.message})}}}},"$m3bphLu3X1"),P={class:"title no-border mb-3"},A=o("i",{class:"fa-solid fa-robot me-1"},null,-1),B=o("span",{class:"sub-title ms-1"},"Details",-1),D={class:"mb-2"};function E(e,t,d,s,c,a){const i=f,r=F;return w(),x("div",null,[o("h1",P,[A,N(" "+$(e.entity.name)+" ",1),B]),o("div",D,[p(i,{path:"/admin/robots/"+e.entity.id,items:e.items,"prev-link":!0},null,8,["path","items"])]),o("div",null,[p(r,{entity:e.entity,onUpdated:e.handleUpdated,onFailed:e.handleFailed},null,8,["entity","onUpdated","onFailed"])])])}const X=g(k,[["render",E]]);export{X as default};
