import{_ as D}from"./BNEsDCLV.js";import{f as k,D as g,q as R,C as P,E as T,F as E,U as M,M as B,j as N,s as V,P as h,_ as $,l as n,o as p,m as v,w as l,b as a,c as w,W as I,X as S,a as y}from"./qGWCsquX.js";import{i as L}from"./D2p94zMK.js";const W=k({components:{ATitle:g,APagination:R,ASearch:P,BTable:T,AEntityDelete:E,ARealms:M,VCTimeago:B},emits:["deleted"],setup(s,{emit:_}){const o=N(),{realm:u,realmManagementId:b}=V(o),f=i=>{_("deleted",i)},d=i=>L(u.value,i.id),m=o.has(h.REALM_EDIT),c=o.has(h.REALM_DROP);return{fields:[{key:"id",label:"ID",thClass:"text-left",tdClass:"text-left"},{key:"name",label:"Name",thClass:"text-left",tdClass:"text-left"},{key:"updated_at",label:"Updated At",thClass:"text-center",tdClass:"text-center"},{key:"created_at",label:"Created At",thClass:"text-center",tdClass:"text-center"},{key:"options",label:"",tdClass:"text-left"}],isResourceWritable:d,hasEditPermission:m,hasDropPermission:c,handleDeleted:f,realmManagementId:b,setRealmManagement:o.setRealmManagement}}},"$5Pfr7dJVmY"),U=["onClick"],j=y("i",{class:"fa-solid fa-check"},null,-1),q=[j],F=y("i",{class:"fa-solid fa-bars"},null,-1);function J(s,_,o,u,b,f){const d=n("ATitle"),m=n("ASearch"),c=n("APagination"),r=n("VCTimeago"),i=D,A=n("AEntityDelete"),C=n("BTable"),x=n("ARealms");return p(),v(x,{onDeleted:s.handleDeleted},{header:l(e=>[a(d),a(m,{load:e.load,busy:e.busy},null,8,["load","busy"])]),footer:l(e=>[a(c,{busy:e.busy,meta:e.meta,load:e.load},null,8,["busy","meta","load"])]),body:l(e=>[a(C,{items:e.data,fields:s.fields,busy:e.busy,"head-variant":"'dark'",outlined:""},{"cell(created_at)":l(t=>[a(r,{datetime:t.item.created_at},null,8,["datetime"])]),"cell(updated_at)":l(t=>[a(r,{datetime:t.item.created_at},null,8,["datetime"])]),"cell(options)":l(t=>[s.realmManagementId!==t.item.id?(p(),w("button",{key:0,class:"btn btn-xs btn-primary me-1",onClick:I(O=>s.setRealmManagement(t.item),["prevent"])},q,8,U)):S("",!0),a(i,{to:"/admin/realms/"+t.item.id,class:"btn btn-xs btn-outline-primary me-1",disabled:!s.hasEditPermission},{default:l(()=>[F]),_:2},1032,["to","disabled"]),a(A,{class:"btn btn-xs btn-outline-danger","entity-id":t.item.id,"entity-type":"realm","with-text":!1,disabled:!t.item.built_in||!s.hasDropPermission,onDeleted:e.deleted},null,8,["entity-id","disabled","onDeleted"])]),_:2},1032,["items","fields","busy"])]),_:1},8,["onDeleted"])}const G=$(W,[["render",J]]);export{G as default};
