import{d as _,ex as w,H as h,b as k,c as O,w as c,f as d,u as C}from"./registerWidgets.9fce82a0.js";import{e as x,b as I}from"./icons.1992e13b.js";import{a as v}from"./asyncComputed.a4b709a3.js";import"./gateway.6deb8468.js";import{O as l}from"./organization.7ba59110.js";import"./index.75e03e08.js";import{_ as D}from"./Navbar.vue_vue_type_script_setup_true_lang.01cff821.js";import{_ as A}from"./CrudView.vue_vue_type_script_setup_true_lang.ac5a77d6.js";import{B}from"./BaseLayout.ec0601c1.js";import{a as N}from"./ant-design.cd2520f8.js";import"./passwordlessManager.eda842b8.js";import"./pubsub.025cc397.js";import"./storage.ae287dfa.js";import"./activeRecord.872f4269.js";import"./logo.084e5d7c.js";import"./index.2c964e80.js";import"./Title.26974edb.js";import"./index.e8158c16.js";import"./index.b9dfa5e6.js";import"./Form.413853c0.js";import"./index.eed9c711.js";import"./index.30c35b37.js";import"./index.c9f7f8f0.js";import"./index.db5cf0e6.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},n=new Error().stack;n&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[n]="75d79aba-1edd-4e21-8347-84257850481b",o._sentryDebugIdIdentifier="sentry-dbid-75d79aba-1edd-4e21-8347-84257850481b")}catch{}})();const at=_({__name:"Organizations",setup(o){const n=[{label:"My organizations",path:"/organizations"}],i=[{key:"name",label:"Organization Name"}],p=w(),{loading:u,result:r,refetch:g}=v(()=>l.list()),s=({key:t})=>{p.push({name:"organization",params:{organizationId:t}})},f=async t=>{const a=await l.create(t.name);s({key:a.id})},b=async({key:t})=>{var e,m;await N("Are you sure you want to delete this organization?")&&(await((m=(e=r.value)==null?void 0:e.find(z=>z.id===t))==null?void 0:m.delete()),g())},y=h(()=>{var t,a;return{columns:[{name:"Organization Name"},{name:"Path"},{name:"Actions",align:"right"}],rows:(a=(t=r.value)==null?void 0:t.map(e=>({key:e.id,cells:[{text:e.name,link:`/organizations/${encodeURIComponent(e.id)}`},{text:e.id},{text:"",actions:[{icon:x,label:"Edit Organization",onClick:s},{icon:I,label:"Delete",onClick:b,dangerous:!0}]}]})))!=null?a:[]}});return(t,a)=>(k(),O(B,null,{navbar:c(()=>[d(D,{breadcrumb:n})]),content:c(()=>[d(A,{"entity-name":"organization",loading:C(u),title:"My organizations",description:"An organization is your company\u2019s account. Add co-workers, manage their access, organize projects and billing.","create-button-text":"Create Organization","empty-title":"No organizations here yet",table:y.value,fields:i,onCreate:f},null,8,["loading","table"])]),_:1}))}});export{at as default};
//# sourceMappingURL=Organizations.0a4d6a4d.js.map
