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