import{d as _,H as y,K as z,b,c as O,e as c,x as w,z as k,F as h,q as v}from"./registerWidgets.7afd6438.js";import{f as x,g as C}from"./icons.0ae396f2.js";import{a as I}from"./asyncComputed.b60ddd9a.js";import"./gateway.2390ee89.js";import{O as d}from"./organization.89788a5f.js";import"./index.9e389ffd.js";import{C as N}from"./CrudView.ab882a67.js";import{N as D}from"./Navbar.17af34a4.js";import"./passwordlessManager.7da7ab9e.js";import"./pubsub.9805d82b.js";import"./activeRecord.e140ff8e.js";import"./DropdownMenu.90d44aab.js";import"./Modal.94284cfc.js";import"./LoadingIndicator.b2e0f173.js";import"./lottie.36f8e1f2.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]="05f4eb94-7f02-4aca-aaa4-8c119a2016e9",n._sentryDebugIdIdentifier="sentry-dbid-05f4eb94-7f02-4aca-aaa4-8c119a2016e9")}catch{}})();const A={class:"organizations"},B=_({__name:"Organizations",setup(n){const o=[{key:"name",label:"Organization Name"}],i=y(),{loading:l,result:r,refetch:m}=I(()=>d.list()),s=({key:e})=>{i.push({name:"organization",params:{organizationId:e}})},p=async e=>{const a=await d.create(e.name);s({key:a.id})},u=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()),m())},g=z(()=>{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:x,label:"Delete",onClick:u,dangerous:!0},{icon:C,label:"Edit Organization",onClick:s}]}]})))!=null?a:[]}});return(e,a)=>(b(),O(h,null,[c(D),w("div",A,[c(N,{"entity-name":"organization",loading:k(l),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:g.value,fields:o,onCreate:p},null,8,["loading","table"])])],64))}});const Q=v(B,[["__scopeId","data-v-360ce05c"]]);export{Q as default};
//# sourceMappingURL=Organizations.becaa1a0.js.map
