import{u as l,ax as u,p as m,q as f,s as v,ag as p,j as s,m as w,l as x,ah as _}from"./main-BiT4j4N5.js";import{c as b}from"./Heading-CvufBt0-.js";import{F as g,B as S,E as h}from"./Filter-Dk-lkHif.js";import{B as d}from"./ButtonLink-MFNyI4rM.js";import"./_commonjsHelpers-DaWZu8wl.js";/* empty css               */import"./LastActive-Ceb4QxH0.js";import"./EndBrowserSessionButton-Di6zgty2.js";import"./computer-BrA2K14l.js";const y=6,j=x(`
  query BrowserSessionList(
    $first: Int
    $after: String
    $last: Int
    $before: String
    $lastActive: DateFilter
  ) {
    viewerSession {
      __typename
      ... on BrowserSession {
        id

        user {
          id

          browserSessions(
            first: $first
            after: $after
            last: $last
            before: $before
            lastActive: $lastActive
            state: ACTIVE
          ) {
            totalCount

            edges {
              cursor
              node {
                id
                ...BrowserSession_session
              }
            }

            pageInfo {
              hasNextPage
              hasPreviousPage
              startCursor
              endCursor
            }
          }
        }
      }
    }
  }
`),q=(e,r)=>f({queryKey:["browserSessionList",r,e],queryFn:({signal:o})=>w({query:j,variables:{lastActive:r?{before:_()}:void 0,...e},signal:o})});function k(){const{t:e}=l(),{inactive:r,pagination:o}=u.useLoaderDeps(),{data:{viewerSession:t}}=m(q(o,r));if(t.__typename!=="BrowserSession")throw v();const[i,n]=p(o,t.user.browserSessions.pageInfo,y),c=[...t.user.browserSessions.edges].reverse();return s.jsxs("div",{className:"flex flex-col gap-6",children:[s.jsx(b,{children:e("frontend.browser_sessions_overview.heading")}),s.jsx("div",{className:"flex gap-2 items-start",children:s.jsx(g,{to:"/sessions/browsers",enabled:r,search:{inactive:r?void 0:!0},children:e("frontend.last_active.inactive_90_days")})}),c.map(a=>s.jsx(S,{session:a.node,isCurrent:t.id===a.node.id},a.cursor)),t.user.browserSessions.totalCount===0&&s.jsx(h,{children:e(r?"frontend.browser_sessions_overview.no_active_sessions.inactive_90_days":"frontend.browser_sessions_overview.no_active_sessions.default")}),(n||i)&&s.jsxs("div",{className:"flex *:flex-1",children:[s.jsx(d,{kind:"secondary",size:"sm",disabled:!n,to:"/sessions/browsers",search:n||o,resetScroll:!0,children:e("common.previous")}),s.jsx("div",{}),s.jsx(d,{kind:"secondary",size:"sm",disabled:!i,to:"/sessions/browsers",search:i||o,resetScroll:!0,children:e("common.next")})]})]})}export{k as component};
//# sourceMappingURL=_account.sessions.browsers-C5TE5519.js.map
