import{u as c}from"./api.160776dd.js";import{a as d,j as f,k as p,b as v,l as i,m as b,s as h,h as e,N as g}from"./entry.e097670d.js";import{i as x}from"./utils.c307b373.js";/* empty css                    */import{b as y}from"./enity-nav.bde0d636.js";import{u as R}from"./object.62d64729.js";import"./nuxt-link.1a4e25e4.js";const _=d({async setup(){const n=[{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"}],t=f(),o=p(),a=v(null);try{a.value=await c().client.getOne(o.params.id,{fields:["+secret"]})}catch{return i({path:"/admin/clients"})}const r=b(),{realmManagement:l}=h(r);if(!x(l.value,a.value.realm_id))return i({path:"/admin/clients"});const u=s=>{t.success("The client was successfully updated."),R(a,s)},m=s=>{t.warning(s.message)};return()=>e("div",[e("h1",{class:"title no-border mb-3"},[e("i",{class:"fa-solid fa-ghost me-1"}),a.value.name,e("span",{class:"sub-title ms-1"},["Details"])]),e("div",{class:"mb-2"},[y(`/admin/clients/${a.value.id}`,n,{prevLink:!0})]),e("div",[e(g,{onUpdated:u,onFailed:m,entity:a.value})])])}});export{_ as default};
