import{_}from"./BPigo5_n.js";import{f,g as h,r as y,h as l,n as m,i as p,j as v,s as b,_ as g,o as w,c as N,a as o,d as U,t as $,b as u,k as x}from"./qGWCsquX.js";import{u as F}from"./koeG6dC5.js";import{u as T}from"./CvqZkrWf.js";import{u as k}from"./DjfSO2bY.js";import{i as R}from"./D2p94zMK.js";import"./BNEsDCLV.js";const S=f({async setup(){let e,t;const c=[{name:"General",icon:"fas fa-bars",urlSuffix:""},{name:"Clients",icon:"fa-solid fa-ghost",urlSuffix:"/clients"}],a=k(),d=h(),s=y(null);try{s.value=([e,t]=l(()=>T().scope.getOne(d.params.id)),e=await e,t(),e)}catch{throw[e,t]=l(()=>m({path:"/admin/scopes"})),await e,t(),p({})}const i=v(),{realmManagement:r}=b(i);if(!R(r.value,s.value.realm_id))throw[e,t]=l(()=>m({path:"/admin/scopes"})),await e,t(),p({});return{entity:s,items:c,handleUpdated:n=>{a&&a.show({variant:"success",body:"The scope was successfully updated."}),F(s,n)},handleFailed:n=>{a&&a.show({variant:"warning",body:n.message})}}}},"$U47Hf8heHt"),A={class:"title no-border mb-3"},B=o("i",{class:"fa-solid fa-meteor me-1"},null,-1),D=o("span",{class:"sub-title ms-1"},"Details",-1),E={class:"mb-2"};function P(e,t,c,a,d,s){const i=_,r=x;return w(),N("div",null,[o("h1",A,[B,U(" "+$(e.entity.name)+" ",1),D]),o("div",E,[u(i,{path:"/admin/scopes/"+e.entity.id,items:e.items,"prev-link":!0},null,8,["path","items"])]),o("div",null,[u(r,{entity:e.entity,onUpdated:e.handleUpdated,onFailed:e.handleFailed},null,8,["entity","onUpdated","onFailed"])])])}const q=g(S,[["render",P]]);export{q as default};
