(self["webpackJsonp@lyrio/ui"]=self["webpackJsonp@lyrio/ui"]||[]).push([[174],{1558:function(e,r,t){"use strict";t.r(r);var a,n=t(10),c=t.n(n),s=t(19),o=t(29),l=t(15),u=t(1),i=t(0),j=t(618),b=t(1795),d=t(99),m=t(55),O=t(39),p=t(1559),h=t.n(p),x=t(181),g=t(22),f=t(9),C=t(737),y=t(720),v=t(779),P=t(183),w=t(37),k=t(109),B=t(771),N=f.a.serverPreference.pagination.userList;function U(e,r){return q.apply(this,arguments)}function q(){return(q=Object(l.a)(c.a.mark((function e(r,t){var a,n,s;return c.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,x.c.user.getUserList({sortBy:r,skipCount:N*(t-1),takeCount:N});case 2:if(a=e.sent,n=a.requestError,s=a.response,!n){e.next=9;break}throw new P.a(n,{showRefresh:!0,showBack:!0});case 9:if(!s.error){e.next=11;break}throw new P.a(Object(w.c)("users.error.".concat(s.error)));case 11:return e.abrupt("return",[s.userMetas,s.count]);case 12:case"end":return e.stop()}}),e)})))).apply(this,arguments)}!function(e){e.rating="rating",e.acceptedProblemCount="acceptedProblemCount"}(a||(a={}));var H=function(e){var r=Object(g.i)("users"),t=Object(g.k)(),n=Object(O.e)();Object(i.useEffect)((function(){f.a.enterNewPage(r(".title"),"members")}),[f.a.locale]);var c=document.documentElement;return Object(i.useEffect)((function(){c.scrollTop=0}),[e.currentPage]),Object(u.jsxs)(u.Fragment,{children:[Object(u.jsxs)("div",{className:h.a.header,children:[Object(u.jsx)(v.a,{onResultSelect:function(e){return t.navigate("/u/".concat(e.username))}}),f.a.currentUserHasPrivilege("ManageUserGroup")&&Object(u.jsx)("div",{className:h.a.manageGroups,children:Object(u.jsx)(j.a,{primary:!0,content:r(".manage_groups"),as:g.a,href:"/groups"})})]}),Object(u.jsxs)(b.a,{unstackable:!0,basic:"very",textAlign:"center",className:h.a.table,children:[Object(u.jsx)(b.a.Header,{children:Object(u.jsxs)(b.a.Row,{children:[Object(u.jsx)(b.a.HeaderCell,{className:h.a.columnRank,children:r(".rank")}),Object(u.jsx)(b.a.HeaderCell,{className:h.a.columnUsername,children:r(".username")}),Object(u.jsx)(b.a.HeaderCell,{className:h.a.columnBio,children:r(".bio")}),Object(u.jsx)(b.a.HeaderCell,{className:h.a.columnAcceptedProblemCount,children:e.sortBy===a.acceptedProblemCount?Object(u.jsxs)(u.Fragment,{children:[r(".accepted_problem_count"),Object(u.jsx)(d.a,{name:"angle down"})]}):Object(u.jsx)(g.a,{className:h.a.link,href:{query:{sortBy:a.acceptedProblemCount}},children:r(".accepted_problem_count")})}),Object(u.jsx)(b.a.HeaderCell,{className:h.a.columnRating,children:e.sortBy===a.rating?Object(u.jsxs)(u.Fragment,{children:[r(".rating"),Object(u.jsx)(d.a,{name:"angle down"})]}):Object(u.jsx)(g.a,{className:h.a.link,href:{query:{sortBy:a.rating}},children:r(".rating")})})]})}),Object(u.jsx)(b.a.Body,{children:e.users.map((function(r,t){return Object(u.jsxs)(b.a.Row,{children:[Object(u.jsx)(b.a.Cell,{children:Object(u.jsx)("strong",{children:(e.currentPage-1)*N+t+1})}),Object(u.jsx)(b.a.Cell,{children:Object(u.jsx)(y.a,{user:r})}),Object(u.jsx)(b.a.Cell,{className:h.a.columnBio,children:f.a.serverPreference.misc.renderMarkdownInUserBio?Object(u.jsx)(B.default,{content:r.bio,dontUseContentFont:!0}):Object(u.jsx)(k.a,{children:Object(u.jsx)("div",{children:r.bio})})}),Object(u.jsx)(b.a.Cell,{children:r.acceptedProblemCount}),Object(u.jsx)(b.a.Cell,{children:r.rating})]},r.id)}))})]}),e.totalCount<=N?null:Object(u.jsx)("div",{className:h.a.pagination,children:Object(u.jsx)(C.a,{totalCount:e.totalCount,currentPage:e.currentPage,itemsPerPage:N,pageUrl:function(e){return{query:Object(o.a)(Object(o.a)({},n.url.query),{},{page:e.toString()})}}})})]})};H=Object(m.a)(H),r.default=Object(P.c)(function(){var e=Object(l.a)(c.a.mark((function e(r){var t,n,o,l,i,j;return c.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(t=parseInt(r.query.page)||1)<1&&(t=1),(n=r.query.sortBy)in a||(n=f.a.serverPreference.misc.sortUserByRating?a.rating:a.acceptedProblemCount),e.next=6,U(n,t);case 6:return o=e.sent,l=Object(s.a)(o,2),i=l[0],j=l[1],e.abrupt("return",Object(u.jsx)(H,{sortBy:n,users:i,totalCount:j,currentPage:t}));case 11:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}())}}]);
//# sourceMappingURL=174.07fb4ff3.chunk.js.map