import{d as y,ex as b,H as z,b as O,d2 as w,f as d,e as h,u as k,bu as v,v as x}from"./registerWidgets.d6e66474.js";import{a as C,e as I}from"./icons.4be6cb33.js";import{a as N}from"./asyncComputed.5c362931.js";import"./gateway.651c554e.js";import{O as c}from"./organization.dccc1664.js";import"./index.0eed7dd2.js";import{C as D}from"./CrudView.62da965d.js";import{N as A}from"./Navbar.f12dce0a.js";import"./passwordlessManager.a2051844.js";import"./pubsub.9e806cff.js";import"./storage.d7eb729a.js";import"./activeRecord.1009e596.js";import"./DropdownMenu.687dee5a.js";import"./Modal.87772a38.js";import"./LoadingIndicator.d52fa99a.js";import"./lottie.b059da2e.js";import"./logo.084e5d7c.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},o=new Error().stack;o&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[o]="d6792d80-3010-4904-8420-061f32f05630",n._sentryDebugIdIdentifier="sentry-dbid-d6792d80-3010-4904-8420-061f32f05630")}catch{}})();const B={class:"organizations"},E=y({__name:"Organizations",setup(n){const o=[{label:"My organizations",path:"/organizations"}],i=[{key:"name",label:"Organization Name"}],l=b(),{loading:m,result:r,refetch:u}=N(()=>c.list()),s=({key:e})=>{l.push({name:"organization",params:{organizationId:e}})},p=async e=>{const t=await c.create(e.name);s({key:t.id})},g=async({key:e})=>{var t,a;confirm("Are you sure you want to delete this organization?")&&(await((a=(t=r.value)==null?void 0:t.find(_=>_.id===e))==null?void 0:a.delete()),u())},f=z(()=>{var e,t;return{columns:[{name:"Organization Name"},{name:"Path"},{name:"Organization Actions"}],rows:(t=(e=r.value)==null?void 0:e.map(a=>({key:a.id,cells:[{text:a.name,classes:["title","centered"],link:`/organizations/${encodeURIComponent(a.id)}`},{text:a.id},{text:"",classes:["centered"],actions:[{icon:C,label:"Delete",onClick:g,dangerous:!0},{icon:I,label:"Edit Organization",onClick:s}]}]})))!=null?t:[]}});return(e,t)=>(O(),w(v,null,[d(A,{breadcrumb:o}),h("div",B,[d(D,{"entity-name":"organization",loading:k(m),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:f.value,fields:i,onCreate:p},null,8,["loading","table"])])],64))}});const W=x(E,[["__scopeId","data-v-29b5921d"]]);export{W as default};
//# sourceMappingURL=Organizations.3b39ad50.js.map
