import{C as g}from"./CrudView.ea3cf78e.js";import{a as m}from"./ant-design.c8a1aa1d.js";import{a as b}from"./asyncComputed.eac0df71.js";import{d as w,ea as _,eo as h,f as I,o as k,c as v,u as x,ep as z}from"./vue-router.00a420cb.js";import{a as C}from"./gateway.3775a912.js";import{M as n}from"./member.6d9b10fb.js";import"./tables.95e1ed3a.js";import"./router.70041753.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.465b2cc4.js";import"./BookOutlined.df18764f.js";import"./url.fed57a6c.js";import"./PhDotsThreeVertical.vue.8b39bb89.js";import"./Badge.84a2436a.js";import"./index.b00d735b.js";import"./popupNotifcation.6aec82b8.js";import"./record.149dcd57.js";import"./string.110ad283.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},o=new Error().stack;o&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[o]="f9e8e2cc-35aa-4293-95d7-5e8aaadac835",a._sentryDebugIdIdentifier="sentry-dbid-f9e8e2cc-35aa-4293-95d7-5e8aaadac835")}catch{}})();const P=w({__name:"Editors",setup(a){const o=_(),s=h(),r=o.params.organizationId,d=[{key:"email",label:"Email"}],l=async e=>{await n.create(r,e.email),c()};async function u(e){var t;if(((t=C.getAuthor())==null?void 0:t.claims.email)===e.email&&await m("You are about to remove your own access. You won't be able to access this organization anymore. Are you sure?")){await n.delete(r,e.authorId),await s.push({name:"organizations"});return}await m("Are you sure you want to remove this member's access?")&&(await n.delete(r,e.authorId),c())}const{loading:p,result:f,refetch:c}=b(()=>n.list(r)),y=I(()=>{var e,i;return{columns:[{name:"Email",align:"left"},{name:"Role"},{name:"",align:"right"}],rows:(i=(e=f.value)==null?void 0:e.map(t=>({key:t.email,cells:[{type:"text",text:t.email},{type:"text",text:t.role},{type:"actions",actions:[{icon:z,label:"Remove access",onClick:()=>u(t),dangerous:!0}]}]})))!=null?i:[]}});return(e,i)=>(k(),v(g,{"entity-name":"editors",loading:x(p),title:"Organization editors",description:"List all organization editors.","empty-title":"No editors yet",table:y.value,"create-button-text":"Add editors",fields:d,create:l},null,8,["loading","table"]))}});export{P as default};
//# sourceMappingURL=Editors.6d2d36df.js.map
