import{d as _,K as y,b as z,c as O,e as c,x as w,z as d,F as k,H as h,q as x}from"./registerWidgets.f2c3b5e5.js";import{f as C,g as v}from"./icons.b35b2de6.js";import{a as I}from"./asyncComputed.fa58da50.js";import"./gateway.5ce246f2.js";import{O as l}from"./organization.396a9a90.js";import"./index.d362f0ad.js";import{C as N}from"./CrudView.2f7a4d54.js";import{N as D}from"./Navbar.a0d1f16d.js";import"./passwordlessManager.d3eddc95.js";import"./pubsub.63528b2e.js";import"./activeRecord.55d1a6e1.js";import"./DropdownMenu.c39b37be.js";import"./Modal.201e370f.js";import"./LoadingIndicator.6255a904.js";import"./lottie.fe21059c.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]="abd5a940-7ab4-45eb-89b7-328ea69a6b68",n._sentryDebugIdIdentifier="sentry-dbid-abd5a940-7ab4-45eb-89b7-328ea69a6b68")}catch{}})();const A={class:"organizations"},B=_({__name:"Organizations",setup(n){const o=[{key:"name",label:"Organization Name"}],i=h(),{loading:m,result:r,refetch:p}=I(()=>l.list()),s=({key:e})=>{i.push({name:"organization",params:{organizationId:e}})},u=async e=>{const a=await l.create(e.name);s({key:a.id})},g=async({key:e})=>{var a,t;confirm("Are you sure you want to delete this organization?")&&(await((t=(a=r.value)==null?void 0:a.find(f=>f.id===e))==null?void 0:t.delete()),p())},b=y(()=>{var e,a;return{columns:[{name:"Organization Name"},{name:"Path"},{name:"Organization Actions"}],rows:(a=(e=r.value)==null?void 0:e.map(t=>({key:t.id,cells:[{text:t.name,classes:["title","centered"],link:`/organizations/${encodeURIComponent(t.id)}`},{text:t.id},{text:"",classes:["centered"],actions:[{icon:C,label:"Delete",onClick:g,dangerous:!0},{icon:v,label:"Edit Organization",onClick:s}]}]})))!=null?a:[]}});return(e,a)=>(z(),O(k,null,[c(D),w("div",A,[c(N,{"entity-name":"organization",loading:d(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:d(b),fields:o,onCreate:u},null,8,["loading","table"])])],64))}});const Q=x(B,[["__scopeId","data-v-360ce05c"]]);export{Q as default};
//# sourceMappingURL=Organizations.74b012f9.js.map
