"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunkXD2OIZABjs = require('./chunk-XD2OIZAB.js');var L={};_chunkXD2OIZABjs.b.call(void 0, L,{default:()=>$});var k,$,F=_chunkXD2OIZABjs.a.call(void 0, ()=>{"use strict";k=function(){var t=[{defaultValue:10,kind:"LocalArgument",name:"count"},{defaultValue:null,kind:"LocalArgument",name:"cursor"},{defaultValue:null,kind:"LocalArgument",name:"userName"}],a={kind:"Variable",name:"userName",variableName:"userName"},e=[{kind:"Variable",name:"after",variableName:"cursor"},{kind:"Variable",name:"first",variableName:"count"},a],n={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},o={alias:null,args:null,kind:"ScalarField",name:"url",storageKey:null};return{fragment:{argumentDefinitions:t,kind:"Fragment",metadata:null,name:"ActivityLogsPaginationQuery",selections:[{args:[{kind:"Variable",name:"count",variableName:"count"},{kind:"Variable",name:"cursor",variableName:"cursor"},a],kind:"FragmentSpread",name:"ActivityLogsFragment"}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:t,kind:"Operation",name:"ActivityLogsPaginationQuery",selections:[{alias:null,args:e,concreteType:"ActivityLogConnection",kind:"LinkedField",name:"activityLogs",plural:!1,selections:[{alias:null,args:null,concreteType:"ActivityLogEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:null,args:null,concreteType:"ActivityLog",kind:"LinkedField",name:"node",plural:!1,selections:[n,{alias:null,args:null,kind:"ScalarField",name:"createdAt",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"verb",storageKey:null},o,{alias:null,args:null,concreteType:"User",kind:"LinkedField",name:"user",plural:!1,selections:[n,{alias:null,args:null,kind:"ScalarField",name:"fullName",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"email",storageKey:null},{alias:null,args:[{kind:"Literal",name:"height",value:48},{kind:"Literal",name:"width",value:48}],concreteType:"File",kind:"LinkedField",name:"avatar",plural:!1,selections:[o],storageKey:"avatar(height:48,width:48)"}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"cursor",storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"PageInfo",kind:"LinkedField",name:"pageInfo",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"endCursor",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"hasNextPage",storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:e,filters:["userName"],handle:"connection",key:"ActivityLogs_activityLogs",kind:"LinkedHandle",name:"activityLogs"}]},params:{cacheID:"e0144e7ded781597d8d6bb739897328d",id:null,metadata:{},name:"ActivityLogsPaginationQuery",operationKind:"query",text:`query ActivityLogsPaginationQuery(
  $count: Int = 10
  $cursor: String
  $userName: String = null
) {
  ...ActivityLogsFragment_1nuDWg
}

fragment ActivityLogsFragment_1nuDWg on Query {
  activityLogs(first: $count, after: $cursor, userName: $userName) {
    edges {
      node {
        id
        createdAt
        verb
        url
        user {
          id
          fullName
          email
          avatar(width: 48, height: 48) {
            url
          }
        }
        __typename
      }
      cursor
    }
    pageInfo {
      endCursor
      hasNextPage
    }
  }
}
`}}}();k.hash="89365a3b6109a48bbc293c75f9d7174a";$=k});var h={};_chunkXD2OIZABjs.b.call(void 0, h,{default:()=>P});var A,P,b=_chunkXD2OIZABjs.a.call(void 0, ()=>{"use strict";A=function(){var t=["activityLogs"],a={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},e={alias:null,args:null,kind:"ScalarField",name:"url",storageKey:null};return{argumentDefinitions:[{defaultValue:10,kind:"LocalArgument",name:"count"},{defaultValue:null,kind:"LocalArgument",name:"cursor"},{defaultValue:null,kind:"LocalArgument",name:"userName"}],kind:"Fragment",metadata:{connection:[{count:"count",cursor:"cursor",direction:"forward",path:t}],refetch:{connection:{forward:{count:"count",cursor:"cursor"},backward:null,path:t},fragmentPathInResult:[],operation:(F(),_chunkXD2OIZABjs.c.call(void 0, L))}},name:"ActivityLogsFragment",selections:[{alias:"activityLogs",args:[{kind:"Variable",name:"userName",variableName:"userName"}],concreteType:"ActivityLogConnection",kind:"LinkedField",name:"__ActivityLogs_activityLogs_connection",plural:!1,selections:[{alias:null,args:null,concreteType:"ActivityLogEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:null,args:null,concreteType:"ActivityLog",kind:"LinkedField",name:"node",plural:!1,selections:[a,{alias:null,args:null,kind:"ScalarField",name:"createdAt",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"verb",storageKey:null},e,{alias:null,args:null,concreteType:"User",kind:"LinkedField",name:"user",plural:!1,selections:[a,{alias:null,args:null,kind:"ScalarField",name:"fullName",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"email",storageKey:null},{alias:null,args:[{kind:"Literal",name:"height",value:48},{kind:"Literal",name:"width",value:48}],concreteType:"File",kind:"LinkedField",name:"avatar",plural:!1,selections:[e],storageKey:"avatar(height:48,width:48)"}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"cursor",storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"PageInfo",kind:"LinkedField",name:"pageInfo",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"endCursor",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"hasNextPage",storageKey:null}],storageKey:null}],storageKey:null}],type:"Query",abstractKey:null}}();A.hash="89365a3b6109a48bbc293c75f9d7174a";P=A});var _react = require('react');var _reactrelay = require('react-relay');var i,R= exports.a =(i!==void 0||(i=(b(),_chunkXD2OIZABjs.c.call(void 0, h)),i.hash&&i.hash!=="89365a3b6109a48bbc293c75f9d7174a"&&console.error("The definition of 'ActivityLogsFragment' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data.")),i),I= exports.b =function(a){var e=_reactrelay.usePaginationFragment.call(void 0, R,a),n=e.data,o=e.loadNext,K=e.isLoadingNext,N=e.hasNext,S=e.refetch,x=_react.useMemo.call(void 0, function(){var r,d={};n==null||(r=n.activityLogs)===null||r===void 0||(r=r.edges)===null||r===void 0||r.forEach(function(s){var u,l=_optionalChain([s, 'optionalAccess', _2 => _2.node]);if(l){var m=(u=l.user)===null||u===void 0?void 0:u.id,T=new Date(l.createdAt).getTime();d[m]||(d[m]=[]);var g=d[m];if(g){var c=g[g.length-1];!c||T-new Date(c.lastActivityTimestamp).getTime()>15*60*1e3?g.push({lastActivityTimestamp:l.createdAt,logs:[l]}):(c.logs.unshift(l),c.lastActivityTimestamp=l.createdAt)}}});var y=Object.values(d).flat();return y.sort(function(s,u){return new Date(u.lastActivityTimestamp).getTime()-new Date(s.lastActivityTimestamp).getTime()}),y},[n]);return{logGroups:x,loadNext:o,isLoadingNext:K,hasNext:N,refetch:S}};exports.a = R; exports.b = I;
//# sourceMappingURL=chunk-3SMO7LWD.js.map