import{_ as A}from"./nuxt-link.CpFeHJNO.js";import{f as D,D as x,q as P,C as S,E as T,as as k,F as E,l,j as g,s as R,P as y,_ as q,o as B,m as N,w as o,b as a,a as $}from"./entry.2l8qV6vk.js";import{i as v}from"./utils.RlM3h-HS.js";const V=D({components:{ATitle:x,APagination:P,ASearch:S,BTable:T,AScopes:k,AEntityDelete:E},emits:["deleted"],setup(s,{emit:u}){l("ScopeList");const _=n=>{u("deleted",n)},i=g(),{realm:b,realmManagementId:f}=R(i),r={filter:{realm_id:[f.value,null]}},c=n=>v(b.value,n.realm_id),m=i.has(y.SCOPE_EDIT),d=i.has(y.SCOPE_DROP);return{fields:[{key:"id",label:"ID",thClass:"text-left",tdClass:"text-left"},{key:"name",label:"Name",thClass:"text-left",tdClass:"text-left"},{key:"created_at",label:"Created at",thClass:"text-center",tdClass:"text-center"},{key:"updated_at",label:"Updated at",thClass:"text-left",tdClass:"text-left"},{key:"options",label:"",tdClass:"text-left"}],isResourceWritable:c,hasEditPermission:m,hasDropPermission:d,handleDeleted:_,query:r}}},"$D8SzSqXfX6"),W=$("i",{class:"fa-solid fa-bars"},null,-1);function w(s,u,_,i,b,f){const r=l("ATitle"),c=l("ASearch"),m=l("APagination"),d=l("VCTimeago"),p=A,n=l("AEntityDelete"),h=l("BTable"),C=l("AScopes");return B(),N(C,{query:s.query,onDeleted:s.handleDeleted},{header:o(e=>[a(r),a(c,{load:e.load,busy:e.busy},null,8,["load","busy"])]),footer:o(e=>[a(m,{busy:e.busy,meta:e.meta,load:e.load},null,8,["busy","meta","load"])]),body:o(e=>[a(h,{items:e.data,fields:s.fields,busy:e.busy,"head-variant":"'dark'",outlined:""},{"cell(created_at)":o(t=>[a(d,{datetime:t.item.created_at},null,8,["datetime"])]),"cell(updated_at)":o(t=>[a(d,{datetime:t.item.created_at},null,8,["datetime"])]),"cell(options)":o(t=>[a(p,{to:"/admin/scopes/"+t.item.id,class:"btn btn-xs btn-outline-primary me-1",disabled:!s.hasEditPermission||!s.isResourceWritable(t.item)},{default:o(()=>[W]),_:2},1032,["to","disabled"]),a(n,{class:"btn btn-xs btn-outline-danger","entity-id":t.item.id,"entity-type":"scope","with-text":!1,disabled:t.item.built_in||!s.hasDropPermission||!s.isResourceWritable(t.item),onDeleted:e.deleted},null,8,["entity-id","disabled","onDeleted"])]),_:2},1032,["items","fields","busy"])]),_:1},8,["query","onDeleted"])}const X=q(V,[["render",w]]);export{X as default};
