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