1import{u as C,a as E,b as A,h as D,r as I,R as a,L as P,c as N,d as m,A as f,E as g,g as x,H as _,B as L,D as S,N as k,e as R}from"./index-9Wgw656h.js";import{S as F}from"./SearchField-SyAB7m52.js";import{u as M,c as T}from"./useCustomerAccounts-CEbt6y_9.js";import{p as G}from"./dates-B1eCd1nJ.js";import{u as H}from"./useTableQueryParams-0YWSFn91.js";import"./useQueryParams-BhvwBSrA.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new t.Error().stack;o&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[o]="88d5107f-58c3-4584-a969-431ee303218d",t._sentryDebugIdIdentifier="sentry-dbid-88d5107f-58c3-4584-a969-431ee303218d")}catch{}})();const W=()=>{const t=C(),o=E(),{showAllAccounts:s}=A(),n=D(t,[R.planet_admin]),{page:l,pageSize:r,search:p,handlePaginationModelChange:h}=H(),{data:i,isFetching:y,isLoading:c,error:d}=M({limit:r,offset:l*r,...T(p)},{keepPreviousData:!0,enabled:s&&n&&r>0}),b=I.useMemo(()=>[{field:"name",headerName:"Account Name",flex:1.25,renderCell:e=>a.createElement(P,{component:N,to:m(f,{accountId:e.row.id}),variant:"body2",onClick:w=>w.stopPropagation(),underline:"hover"},e.value)},{field:"id",headerName:"ID",flex:.85},{field:"created_at",headerName:"Created At",flex:.85,valueGetter:e=>G(e.row?.created_at)},{field:"sfdc_id",headerName:"SFDC ID",flex:.75,valueGetter:e=>e.value||"--"},{field:"program_id",headerName:"Program ID",flex:.5,valueGetter:e=>e.value||"--"}],[]),u=i?.results||[],v=e=>o.push(m(f,{accountId:e.id}));return!s||!n?a.createElement(g,{statusCode:404}):d?a.createElement(g,{...x(d)}):a.createElement(a.Fragment,null,a.createElement(_,{name:"All Accounts"}),a.createElement(L,{display:"flex",justifyContent:"space-between",mb:2,flexWrap:"wrap"},a.createElement(F,{placeholder:"Search by name or account ID"})),a.createElement(S,{columns:b,disableColumnSorting:!0,onPaginationModelChange:h,onRowClick:v,pagination:!0,paginationMode:"server",paginationModel:{page:l,pageSize:r},rowCount:u.length?i?.meta?.count:0,rows:u,slotProps:{noRowsOverlay:{message:"No accounts"},noResultsOverlay:{message:"No results"}},loading:c||y}),a.createElement(k,{open:c,message:"Loading accounts...",progress:!0}))};export{W as default}; 2//# sourceMappingURL=AccountsPage-inNRGKJd.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.