(this.webpackJsonpclient=this.webpackJsonpclient||[]).push([[0],{484:function(e,t){},485:function(e,t,a){"use strict";a.r(t);var n=a(0),c=a.n(n),s=a(32),i=a.n(s),r=a(43),o=a(601),l=a(57),d=a(12),j=a(600),h=a(597),b=a(496),u=a(604),x=a(575),O=a(175),g=a.n(O),m=a(24),p=a.n(m),f=a(304),v=a(583);const y=Object(r.b)({key:"userState",default:null});var k=a(602),w=a(603),C=a(280),S=a.n(C),_=a(167),F=a.n(_),I=a(281),E=a.n(I),R=a(114),T=a.n(R),P=a(589),A=a(1);var D=e=>{let{to:t,linkText:a,color:n,startIcon:c}=e;return Object(A.jsx)(l.b,{to:t,style:{textDecoration:"none",color:n},children:Object(A.jsx)(P.a,{color:n,startIcon:c,children:a})})},z=a(282),L=a.n(z),N=a(305);const B="90vh",G="#102424",W=Object(N.a)(.05,"#4a6dc5"),H="#5d89f7",X="#dee7fd",M="#f5f5f5";var K=a(60),U=a.n(K);const q=async()=>await U()({method:"GET",url:"flask/followed",headers:{Authorization:"Bearer "+localStorage.getItem("access_token")}}),Y=async(e,t)=>await U()({method:"POST",url:"http://forks-insight.com/flask/forklist",headers:{Authorization:"Bearer "+localStorage.getItem("access_token")},data:{repo:e,index:t}}),Z=async e=>await U.a.post("flask/auth",{code:e}),J=async e=>await fetch(e).then((e=>e.json())).then((e=>e.items)),V=async e=>await U()({method:"POST",url:"flask/search",headers:{Authorization:"Bearer "+localStorage.getItem("access_token")},data:{repo:e}}),Q=async e=>await U()({method:"POST",url:"flask/follow",headers:{Authorization:"Bearer "+localStorage.getItem("access_token")},data:{repo:e}}),$=async e=>await U()({method:"DELETE",url:"flask/followed",headers:{Authorization:"Bearer "+localStorage.getItem("access_token")},data:{repo:e}});var ee=()=>{const e=Object(r.d)(y),t=Object(d.p)(),[a,c]=Object(n.useState)(!1);Object(n.useEffect)((()=>{const e=window.location.href,t=e.includes("?code=");if(console.log("hasCode",t),t){const t=e.split("?code=")[1];console.log("url",t),s(t)}}),[Z]);const s=async a=>{c(!0);try{var n;const c=await Z(a);console.log("res",c),null!==c&&void 0!==c&&null!==(n=c.data)&&void 0!==n&&n.access_token&&(localStorage.setItem("access_token",c.data.access_token),localStorage.setItem("username",c.data.username),e({username:c.data.username}),t("/"))}catch(s){console.log("unable to login"),t("/")}c(!1)};return Object(A.jsx)(A.Fragment,{children:a?Object(A.jsx)(P.a,{color:"inherit",onClick:()=>{},children:"Logging In..."}):Object(A.jsx)(P.a,{color:"inherit",onClick:()=>{window.location.href="https://github.com/login/oauth/authorize?scope=user:email&client_id=b97b95129ce435e40a29"},children:"Login"})})};var te=()=>{const e=Object(r.d)(y),t=Object(d.p)();return Object(A.jsx)(P.a,{color:"inherit",onClick:()=>{localStorage.removeItem("access_token"),localStorage.removeItem("username"),e(null),t("/")},children:"Logout"})};var ae=e=>{let{onOpenDrawer:t}=e;const a=Object(r.c)(y);return console.log("appheader current",a),Object(A.jsx)(o.a,{sx:{flexGrow:1},children:Object(A.jsx)(k.a,{position:"static",style:{background:W},children:Object(A.jsxs)(w.a,{children:[Object(A.jsx)(u.a,{size:"large",edge:"start",color:"inherit","aria-label":"menu",sx:{mr:2},onClick:t,children:Object(A.jsx)(S.a,{})}),Object(A.jsx)(b.a,{variant:"h6",component:"div",sx:{flexGrow:1},children:"INFOX - Forks Insight"}),Object(A.jsx)(D,{to:"/followed",linkText:"Followed Repositories",color:"inherit",startIcon:Object(A.jsx)(F.a,{})}),Object(A.jsx)(D,{to:"/import",linkText:"Import Repositories",color:"inherit",startIcon:Object(A.jsx)(E.a,{})}),Object(A.jsx)(D,{to:"/search",linkText:"Search Github",color:"inherit",startIcon:Object(A.jsx)(T.a,{})}),Object(A.jsx)(D,{to:"/aboutus",linkText:"About Us",color:"inherit",startIcon:Object(A.jsx)(L.a,{})}),a?Object(A.jsx)(te,{}):Object(A.jsx)(ee,{})]})})})},ne=a(582),ce=a(605);const se=e=>{let{loadingMessage:t}=e;return Object(A.jsxs)(h.a,{container:!0,direction:"column",alignItems:"center",justifyContent:"center",style:{minHeight:"100%"},children:[Object(A.jsx)(ce.a,{}),Object(A.jsx)(o.a,{children:t?Object(A.jsx)(b.a,{variant:"h6",children:t}):null})]})};se.defaultProps={loadingMessage:null};var ie=se;var re=e=>{let{text:t}=e;return Object(A.jsx)(h.a,{container:!0,direction:"column",alignItems:"center",children:Object(A.jsx)(h.a,{item:!0,children:Object(A.jsx)(o.a,{children:Object(A.jsx)(b.a,{variant:"h3",color:G,children:t})})})})},oe=a(590),le=a(580),de=a(608),je=a(586),he=a(136),be=a.n(he),ue=a(117),xe=a.n(ue),Oe=a(610),ge=a(135),me=a.n(ge),pe=a(84);var fe=e=>{let{filters:t,setFilters:a,setSearch:c}=e;const[s,i]=Object(n.useState)(null),[r,l]=Object(n.useState)(null),[d,j]=Object(n.useState)([]),[x,O]=Object(n.useState)([]),[g,m]=Object(n.useState)("");Object(n.useEffect)((()=>{a(x)}),[x,a]),Object(n.useEffect)((()=>{c(g)}),[g,c]);const f=e=>{let{filter:t,value:a}=e;return Object(A.jsx)(h.a,{item:!0,children:Object(A.jsx)(o.a,{sx:{border:4,borderRadius:12},style:{borderColor:H,background:X},padding:1,children:Object(A.jsxs)(h.a,{container:!0,direction:"row",alignItems:"center",children:[Object(A.jsx)(h.a,{item:!0,children:Object(A.jsx)(u.a,{onClick:()=>{((e,t)=>{O(x.filter((a=>!(a.display===e&&a.value===t))))})(t,a)},children:Object(A.jsx)(xe.a,{})})}),Object(A.jsx)(h.a,{item:!0,children:Object(A.jsx)(o.a,{fontWeight:"bold",children:Object(A.jsxs)(b.a,{children:[t,": ",a]})})})]})})})};return Object(A.jsx)(o.a,{children:Object(A.jsxs)(h.a,{container:!0,direction:"row",justifyContent:"flex-start",alignItems:"center",spacing:1,children:[Object(A.jsx)(h.a,{item:!0,children:Object(A.jsx)(b.a,{variant:"h5",children:"Search by name"})}),Object(A.jsx)(h.a,{item:!0,children:Object(A.jsx)(oe.a,{onChange:e=>{m(e.target.value)},placeholder:"Search",InputProps:{startAdornment:Object(A.jsx)(Oe.a,{position:"start",children:Object(A.jsx)(T.a,{})})}})}),Object(A.jsxs)(h.a,{item:!0,children:[Object(A.jsx)(o.a,{sx:{border:4,borderRadius:12},style:{borderColor:H,background:X},padding:1,children:Object(A.jsx)(le.a,{onClick:e=>{i(e.currentTarget)},children:Object(A.jsxs)(h.a,{container:!0,direction:"row",alignItems:"center",children:[Object(A.jsx)(h.a,{item:!0,children:Object(A.jsx)(be.a,{})}),Object(A.jsx)(h.a,{item:!0,children:Object(A.jsx)(o.a,{fontWeight:"bold",children:Object(A.jsx)(b.a,{children:"Add Filter"})})})]})})}),Object(A.jsx)(de.b,{anchorEl:s,open:!!s,id:s?"simple-popover":void 0,onClose:()=>{i(null)},anchorOrigin:{vertical:"bottom",horizontal:"left"},children:Object(A.jsxs)(o.a,{sx:{border:4},style:{borderColor:H},padding:1,children:[Object(A.jsx)(o.a,{paddingBottom:1,children:Object(A.jsx)(b.a,{variant:"h5",children:"Filter by"})}),Object(A.jsxs)(h.a,{container:!0,spacing:1,padding:1,children:[Object(A.jsx)(h.a,{item:!0,border:1,style:{borderColor:H},children:Object(A.jsx)(o.a,{sx:{display:"flex"},children:Object(A.jsx)(o.a,{paddingRight:1,style:{overflow:"auto",maxHeight:"200px"},children:Object.values(t).map((e=>Object(A.jsxs)(h.a,{container:!0,direction:"row",alignItems:"center",children:[Object(A.jsx)(h.a,{item:!0,children:Object(A.jsx)(je.a,{onChange:()=>{(e=>{j([]),r&&r.display===e.display?l(null):l(e)})(e)},checked:(null===r||void 0===r?void 0:r.display)===e.display})}),Object(A.jsx)(h.a,{item:!0,children:Object(A.jsx)(b.a,{children:e.display})})]},e.display)))})})}),Object(A.jsx)(h.a,{item:!0,paddingRight:1,border:1,style:{borderColor:H},children:r?Object(A.jsx)(o.a,{paddingRight:1,style:{overflow:"auto",maxHeight:"200px"},children:r.values.map((e=>Object(A.jsxs)(h.a,{container:!0,direction:"row",alignItems:"center",children:[Object(A.jsx)(h.a,{item:!0,children:Object(A.jsx)(je.a,{onChange:()=>{(e=>{if(d.some((t=>t===e))){const t=d.filter((t=>t!==e));j(t)}else j([...d,e])})(e)},checked:d.some((t=>t===e))})}),Object(A.jsx)(h.a,{item:!0,children:Object(A.jsx)(b.a,{children:e})})]},e)))}):Object(A.jsx)(o.a,{paddingTop:1,children:Object(A.jsx)(b.a,{children:"Select a filter from the left side"})})})]}),Object(A.jsx)(o.a,{children:Object(A.jsx)(P.a,{variant:"contained",disabled:p()(d),onClick:()=>{const e=d.map((e=>({display:r.display,value:e,type:r.type,key:r.key}))),t=me()(e,x,pe.isEqual);O([...x,...t])},children:"Add Filters"})})]})})]}),Object(A.jsx)(h.a,{container:!0,direction:"row",spacing:1,children:x.map((e=>Object(A.jsx)(f,{filter:e.display,value:e.value},"".concat(e.display,"+").concat(e.value))))})]})})},ve=a(587),ye=a(611),ke=a(612),we=a(170),Ce=a.n(we);var Se=e=>{let{onClickRemove:t}=e;return Object(A.jsx)(P.a,{style:{color:W,background:M},onClick:e=>{t(e)},children:"Remove"})};var _e=e=>{let{repo:t,description:a,language:n,timesForked:c,updated:s,onClickRemove:i}=e;const r=Object(d.p)();return Object(A.jsx)(o.a,{paddingY:1,children:Object(A.jsxs)(ve.a,{children:[Object(A.jsx)(ye.a,{style:{background:H},expandIcon:Object(A.jsx)(Ce.a,{sx:{color:"white"}}),children:Object(A.jsxs)(h.a,{container:!0,direction:"row",alignItems:"center",children:[Object(A.jsx)(h.a,{item:!0,xs:9,children:Object(A.jsx)(b.a,{color:"white",children:t})}),Object(A.jsx)(h.a,{item:!0,xs:2,children:Object(A.jsx)(o.a,{style:{textAlign:"right"},children:Object(A.jsx)(P.a,{color:"inherit",startIcon:Object(A.jsx)(F.a,{}),onClick:()=>{console.log("repo nav",t),r("/forks/".concat(t),{replace:!0})},style:{background:M},children:"View Forks"})})}),Object(A.jsx)(h.a,{item:!0,xs:1,children:Object(A.jsx)(o.a,{style:{textAlign:"center"},children:Object(A.jsx)(Se,{onClickRemove:e=>{e.stopPropagation(),$(t),i(t)}})})})]})}),Object(A.jsxs)(ke.a,{style:{background:X},children:[Object(A.jsxs)(h.a,{container:!0,children:[Object(A.jsx)(h.a,{item:!0,xs:4,children:Object(A.jsxs)(b.a,{children:["Language: ",n]})}),Object(A.jsx)(h.a,{item:!0,xs:4,style:{textAlign:"center"},children:Object(A.jsxs)(b.a,{children:["Times Forked: ",c]})}),Object(A.jsx)(h.a,{item:!0,xs:4,style:{textAlign:"right"},children:Object(A.jsxs)(b.a,{children:["Last Updated: ",s]})})]}),Object(A.jsxs)(b.a,{children:["Project Description: ",a]})]})]})})};var Fe=()=>{const[e,t]=Object(n.useState)(null);console.log(e);const[a,c]=Object(n.useState)(!0),[s,i]=Object(n.useState)(null),[r,l]=Object(n.useState)([]),[d,j]=Object(n.useState)(""),[u,x]=Object(n.useState)(e),[O,g]=Object(n.useState)(u),[m,f]=Object(n.useState)(1),[v,y]=Object(n.useState)(1);console.log("filters",r),console.log("search",d),console.log("filterswihvalues",s);const k=Object(n.useCallback)((async()=>{const e=await q();console.log("followed projects",e),t(e.data),console.log("res",e),c(!1)}),[]),w=a=>{t(e.filter((e=>e.repo!==a)))};return Object(n.useEffect)((()=>{g(null===u||void 0===u?void 0:u.slice(10*(m-1),10*m))}),[m,u]),Object(n.useEffect)((()=>{k()}),[k]),Object(n.useEffect)((()=>{y(Math.ceil((null===u||void 0===u?void 0:u.length)/10)),f(1)}),[u]),Object(n.useEffect)((()=>{const t=[];let a=!1;e&&!p()(s)?(e.forEach((e=>{let n=!1;p()(r)?n=!0:(a=!0,r.forEach((t=>{e[t.key]===t.value&&(n=!0)}))),""!==d&&(a=!0,n=!!e.repo.includes(d)),n&&t.push(e)})),x(t)):x(e)}),[r,d,e]),Object(n.useEffect)((()=>{if(!p()(e)){const t={language:{key:"language",display:"Language",type:"string",values:[]},timesForked:{key:"timesForked",display:"Times Forked",type:"numeric",values:[]},updated:{key:"updated",display:"Last Updated",type:"date",values:[]}};e.forEach((e=>{let{language:a,timesForked:n,updated:c}=e;t.language.values.some((e=>e===a))||t.language.values.push(a),t.timesForked.values.some((e=>e===n))||t.timesForked.values.push(n),t.updated.values.some((e=>e===c))||t.updated.values.push(c)})),i(t)}}),[e]),Object(A.jsx)(o.a,{children:a?Object(A.jsx)(o.a,{height:B,children:Object(A.jsx)(ie,{})}):Object(A.jsxs)(o.a,{width:"100%",children:[Object(A.jsx)(re,{text:"Followed Repositories"}),Object(A.jsx)(o.a,{paddingLeft:"4px",children:p()(e)?Object(A.jsx)(A.Fragment,{children:Object(A.jsx)(o.a,{children:Object(A.jsxs)(h.a,{container:!0,direction:"column",alignItems:"center",justifyContent:"center",style:{minHeight:"70vh"},children:[Object(A.jsx)(b.a,{variant:"h4",children:"You are not following any repositories!"}),Object(A.jsx)(b.a,{children:'Go to the "Search Github" tab to search for repositories to follow'})]})})}):Object(A.jsx)(A.Fragment,{children:p()(O)?Object(A.jsxs)(A.Fragment,{children:[Object(A.jsx)(o.a,{children:Object(A.jsx)(fe,{filters:s,setFilters:e=>{l(e)},setSearch:e=>{j(e)}})}),Object(A.jsx)(o.a,{children:Object(A.jsxs)(h.a,{container:!0,direction:"column",alignItems:"center",justifyContent:"center",style:{minHeight:"70vh"},children:[Object(A.jsx)(b.a,{variant:"h4",children:"Search result not found!"}),Object(A.jsx)(b.a,{children:'Go to the "Search Github" tab to follow desired repositories'})]})})]}):Object(A.jsxs)(A.Fragment,{children:[Object(A.jsx)(o.a,{children:Object(A.jsx)(fe,{filters:s,setFilters:e=>{l(e)},setSearch:e=>{j(e)}})}),Object(A.jsx)(o.a,{children:null===O||void 0===O?void 0:O.map((e=>{let{repo:t,language:a,description:n,updated:c,timesForked:s}=e;return Object(A.jsx)(_e,{repo:t,language:a,description:n,updated:c,timesForked:s,onClickRemove:w},t)}))}),Object(A.jsx)(h.a,{container:!0,direction:"column",alignItems:"center",justifyContent:"center",children:Object(A.jsx)(ne.a,{count:v,page:m,onChange:(e,t)=>{f(t)}})})]})})})]})})};var Ie=e=>{let{name:t,description:a,language:c,timesForked:s,followedRepos:i,onFollow:r,onRemoveRepo:l}=e;const[d,j]=Object(n.useState)(!1);return Object(A.jsx)(o.a,{paddingY:1,children:Object(A.jsxs)(ve.a,{children:[Object(A.jsx)(ye.a,{style:{background:H},expandIcon:Object(A.jsx)(Ce.a,{sx:{color:"white"}}),children:Object(A.jsxs)(h.a,{container:!0,direction:"row",alignItems:"center",children:[Object(A.jsx)(h.a,{item:!0,xs:11,children:Object(A.jsx)(b.a,{color:"white",children:t})}),Object(A.jsx)(h.a,{item:!0,xs:1,children:null!==i&&void 0!==i&&i.some((e=>e.repo===t))?Object(A.jsx)(P.a,{variant:"contained",color:"error",onClick:e=>{e.stopPropagation(),$(t),l(t)},children:"Remove"}):Object(A.jsx)(P.a,{variant:"outlined",onClick:async e=>{e.stopPropagation(),j(!0);const a=await Q(t);console.log("res",a),r(a.data),j(!1)},style:{color:W,background:M},disabled:d,children:d?"Following...":"Follow"})})]})}),Object(A.jsx)(ke.a,{style:{background:X},children:Object(A.jsxs)(h.a,{container:!0,children:[Object(A.jsxs)(h.a,{item:!0,xs:4,children:[" ",Object(A.jsxs)(b.a,{children:["Project Description: ",a]})]}),Object(A.jsx)(h.a,{item:!0,xs:4,style:{textAlign:"center"},children:Object(A.jsxs)(b.a,{children:["Language: ",c]})}),Object(A.jsx)(h.a,{item:!0,xs:4,style:{textAlign:"right"},children:Object(A.jsxs)(b.a,{children:["Times Forked: ",s]})})]})})]})})},Ee=a(613),Re=a(588),Te=a(584);const Pe=c.a.forwardRef((function(e,t){return Object(A.jsx)(Te.a,{elevation:6,ref:t,variant:"filled",...e})}));var Ae=()=>{const[e,t]=Object(n.useState)(null),[a,c]=Object(n.useState)(!1),[s,i]=Object(n.useState)(null),[r,l]=Object(n.useState)(null);console.log(s);const[d,j]=Object(n.useState)(!0),[h,u]=Object(n.useState)(!0),[x,O]=Object(n.useState)(!0),[g,m]=Object(n.useState)(null),[f,v]=Object(n.useState)([]),[y,k]=Object(n.useState)(""),[w,C]=Object(n.useState)(s);console.log("filters",f),console.log("search",y),console.log("filterswihvalues",g);const S=Object(n.useCallback)((async()=>{const e=await(async()=>await U()({method:"GET",url:"flask/import",headers:{Authorization:"Bearer "+localStorage.getItem("access_token")}}))();i(e.data.importRepositories),console.log("imported projects",e),u(!1)}),[]),_=Object(n.useCallback)((async()=>{const e=await q();console.log("followed projects",e),l(e.data),console.log("res",e),O(!1)}),[]);return Object(n.useEffect)((()=>{h||x||j(!1)}),[x,h]),Object(n.useEffect)((()=>{S()}),[S]),Object(n.useEffect)((()=>{_()}),[_]),Object(n.useEffect)((()=>{const e=[];let t=!1;s&&!p()(g)?(s.forEach((a=>{let n=!1;p()(f)?n=!0:(t=!0,f.forEach((e=>{a[e.key]===e.value&&(n=!0)}))),""!==y&&(t=!0,n=!!a.repo.includes(y)),n&&e.push(a)})),C(e)):C(s)}),[f,y,s]),Object(n.useEffect)((()=>{if(!p()(s)){const e={language:{key:"language",display:"Language",type:"string",values:[]},timesForked:{key:"timesForked",display:"Times Forked",type:"numeric",values:[]}};s.forEach((t=>{let{language:a,timesForked:n}=t;e.language.values.some((e=>e===a))||e.language.values.push(a),e.timesForked.values.some((e=>e===n))||e.timesForked.values.push(n)})),m(e)}}),[s]),Object(A.jsxs)(o.a,{children:[d?Object(A.jsx)(o.a,{height:B,children:Object(A.jsx)(ie,{})}):Object(A.jsxs)(o.a,{width:"100%",children:[Object(A.jsx)(re,{text:"Import Repositories"}),Object(A.jsx)(o.a,{paddingLeft:"4px",children:p()(s)?Object(A.jsx)(A.Fragment,{children:Object(A.jsx)(o.a,{children:Object(A.jsx)(b.a,{variant:"h5",textAlign:"center",children:"No public repositories found in account."})})}):Object(A.jsxs)(A.Fragment,{children:[Object(A.jsx)(o.a,{children:Object(A.jsx)(fe,{filters:g,setFilters:e=>{v(e)},setSearch:e=>{k(e)}})}),Object(A.jsx)(o.a,{children:null===w||void 0===w?void 0:w.map((e=>{let{repo:a,language:n,description:s,updated:i,timesForked:o}=e;return Object(A.jsx)(Ie,{name:a,language:n,description:s,timesForked:o,onFollow:e=>{t(e.msg),c(!0),l([...r,e.repo])},onRemoveRepo:e=>{l(r.filter((t=>t.repo!==e)))},followedRepos:r},a)}))})]})})]}),Object(A.jsx)(Ee.a,{spacing:2,sx:{width:"100%"},children:Object(A.jsx)(Re.a,{open:a,autoHideDuration:6e3,onClose:(e,t)=>{"clickaway"!==t&&c(!1)},children:Object(A.jsx)(Pe,{onClose:(e,t)=>{"clickaway"!==t&&c(!1)},severity:"success",sx:{width:"100%"},children:e})})})]})},De=a(617),ze=a(618),Le=a(619),Ne=a(614),Be=a(615),Ge=a(616),We=a(598);var He=e=>{let{name:t,language:a,forks:c,updated:s,onFollow:i,onRemoveRepo:r,followedRepos:o}=e;const[l,d]=Object(n.useState)(!1);return Object(A.jsxs)(Ne.a,{children:[Object(A.jsx)(Be.a,{children:Object(A.jsxs)(Ge.a,{sx:{padding:1},children:[Object(A.jsx)(We.a,{target:"_blank",to:"",children:t}),Object(A.jsxs)(h.a,{container:!0,spacing:1,children:[Object(A.jsxs)(h.a,{item:!0,xs:4,children:["Language: ",a]}),Object(A.jsxs)(h.a,{item:!0,xs:4,children:["Forked on Github: ",c]}),Object(A.jsxs)(h.a,{item:!0,xs:4,children:["Updated at: ",s]})]}),Object(A.jsx)(b.a,{})]})}),Object(A.jsx)(Be.a,{children:null!==o&&void 0!==o&&o.some((e=>e.repo===t))?Object(A.jsx)(P.a,{variant:"contained",color:"error",onClick:()=>{$(t),r(t)},children:"Remove"}):Object(A.jsx)(P.a,{variant:"outlined",onClick:async()=>{d(!0);const e=await Q(t);console.log("res",e),i(e.data),d(!1)},disabled:l,children:l?"Following...":"Follow"})})]})};const Xe=c.a.forwardRef((function(e,t){return Object(A.jsx)(Te.a,{elevation:6,ref:t,variant:"filled",...e})}));var Me=()=>{const[e,t]=Object(n.useState)(0),[a,c]=Object(n.useState)(5),[s,i]=Object(n.useState)(""),[r,l]=Object(n.useState)(!1),[j,u]=Object(n.useState)(!1),[x,O]=Object(n.useState)(null),[g,m]=Object(n.useState)(null),[p,f]=Object(n.useState)(null),[v,y]=Object(n.useState)(!1),[k,w]=Object(n.useState)(null),[C,S]=Object(n.useState)([]),[_,F]=Object(n.useState)([]),[I,E]=Object(n.useState)(!1),R=(Object(d.p)(),Object(n.useCallback)((async()=>{const e=await q();w(e.data)}),[])),T=async()=>{if(!r){const e=[],t=[],a="https://api.github.com/search/repositories?q=forks:%3E0&sort=forks&per_page=5",n="https://api.github.com/search/repositories?q=forks:%3E0&sort=stars&per_page=5",c=await J(a),s=await J(n);for(let i=0;i{u(!0);for(var t=[],a=0;a{E(!0);for(var t=[],a=0;a{T(),R()}),[R]),Object(A.jsxs)(o.a,{sx:{display:"flex",flexDirection:"column"},children:[Object(A.jsxs)(o.a,{sx:{display:"flex",flexDirection:"column",borderBottom:1,padding:3},children:[Object(A.jsx)(b.a,{variant:"h5",sx:{marginTop:1},children:"Search on GitHub"}),Object(A.jsx)("form",{onSubmit:async e=>{if(e.preventDefault(),0===s.length)return void O("Please enter a value!");O(null),l(!0),console.log("values",s);const t=await V(s);console.log("resp",t),m(t.data),l(!1)},children:Object(A.jsxs)(h.a,{container:!0,alignItems:"center",paddingBottom:1,children:[Object(A.jsx)(h.a,{item:!0,paddingRight:1,children:Object(A.jsx)(oe.a,{variant:"standard",label:"Repository",value:s,onChange:e=>{i(e.target.value)}})}),Object(A.jsx)(h.a,{item:!0,marginTop:1,children:Object(A.jsx)(P.a,{variant:"contained",type:"submit",children:"Search"})})]})}),x&&Object(A.jsx)(b.a,{variant:"caption",color:"red",children:x}),Object(A.jsx)(o.a,{children:r?Object(A.jsx)(h.a,{container:!0,direction:"column",alignItems:"center",justifyContent:"center",children:Object(A.jsx)(ce.a,{})}):Object(A.jsx)(o.a,{children:g?Object(A.jsx)(o.a,{children:Object(A.jsxs)(De.a,{children:[Object(A.jsx)(ze.a,{}),Object(A.jsx)(Le.a,{children:g.map((e=>Object(A.jsx)(He,{name:e.full_name,language:e.language,forks:e.forks,updated:e.updated_at,onFollow:e=>{f(e.msg),y(!0),w([...k,e.repo])},followedRepos:k,onRemoveRepo:e=>{w(k.filter((t=>t.repo!==e)))}})))})]})}):null})})]}),Object(A.jsxs)(o.a,{sx:{display:"flex",flexDirection:"column",padding:3},children:[Object(A.jsx)(b.a,{variant:"h5",children:"Most Forked Repositories"}),j?Object(A.jsx)(h.a,{container:!0,direction:"column",alignItems:"center",justifyContent:"center",children:Object(A.jsx)(ce.a,{})}):Object(A.jsx)(o.a,{children:C?Object(A.jsx)(o.a,{children:Object(A.jsxs)(De.a,{children:[Object(A.jsx)(ze.a,{}),Object(A.jsx)(Le.a,{children:C.map((e=>Object(A.jsx)(He,{name:e.full_name,language:e.language,forks:e.forks,updated:e.updated_at,onFollow:e=>{f(e.msg),y(!0),w([...k,e.repo])},followedRepos:k,onRemoveRepo:e=>{w(k.filter((t=>t.repo!==e)))}})))})]})}):null})]}),Object(A.jsxs)(o.a,{sx:{display:"flex",flexDirection:"column",padding:3},children:[Object(A.jsx)(b.a,{variant:"h5",children:"Most Starred Repositories"}),I?Object(A.jsx)(h.a,{container:!0,direction:"column",alignItems:"center",justifyContent:"center",children:Object(A.jsx)(ce.a,{})}):Object(A.jsx)(o.a,{children:_?Object(A.jsx)(o.a,{children:Object(A.jsxs)(De.a,{children:[Object(A.jsx)(ze.a,{}),Object(A.jsx)(Le.a,{children:_.map((e=>Object(A.jsx)(He,{name:e.full_name,language:e.language,forks:e.forks,updated:e.updated_at,onFollow:e=>{f(e.msg),y(!0),w([...k,e.repo])},followedRepos:k,onRemoveRepo:e=>{w(k.filter((t=>t.repo!==e)))}})))})]})}):null})]}),Object(A.jsx)(Ee.a,{spacing:2,sx:{width:"100%"},children:Object(A.jsx)(Re.a,{open:v,autoHideDuration:6e3,onClose:(e,t)=>{"clickaway"!==t&&y(!1)},children:Object(A.jsx)(Xe,{onClose:(e,t)=>{"clickaway"!==t&&y(!1)},severity:"success",sx:{width:"100%"},children:p})})})]})};var Ke=()=>Object(A.jsxs)(o.a,{sx:{display:"flex",flexDirection:"column",alignItems:"center"},children:[Object(A.jsxs)(Ge.a,{sx:{padding:2,marginBottom:1,marginTop:1,width:"95%"},children:[Object(A.jsx)(b.a,{variant:"h4",children:"About"}),Object(A.jsx)(b.a,{paragraph:!0,variant:"body1",children:"INFOX comes out of a research project at Carnegie Mellon University, in collaboration with researchers from the IT University Copenhagen, Peking University, and the University of Passau, exploring how to improve collaboration and coordination in open-source and variant-rich software development."}),Object(A.jsx)(b.a,{paragraph:!0,variant:"body1",children:"Given the overwhelming numbers of forks in many popular repositories, we observed redundant development and lost contributions at scale and heard from interviewed developers that they were interested in activities in forks but overwhelmed by the sheer scale of the task and the lack of adequate tools. INFOX set out to understand activities in forks and provide insights to interested observers of a project and all its forks. The current beta release focuses on simple analytics, but we plan many more functions as we move along."}),Object(A.jsxs)(b.a,{paragraph:!0,variant:"body1",children:["INFOX is open source (MIT license) and ",Object(A.jsx)(We.a,{href:"https://github.com/FancyCoder0/INFOX",children:"hosted on GitHub."})," Forks and pull requests are welcome of course. :)"]})]}),Object(A.jsxs)(Ge.a,{sx:{padding:2,marginBottom:1,width:"95%"},children:[Object(A.jsx)(b.a,{variant:"h4",children:"People"}),Object(A.jsx)(b.a,{variant:"body1",children:Object(A.jsx)(We.a,{href:"http://luyaoren.com/",target:"_blank",children:"Luyao Ren"})}),Object(A.jsx)(b.a,{variant:"body1",children:Object(A.jsx)(We.a,{href:"https://www.cs.cmu.edu/~shuruiz/",target:"_blank",children:"Shurui Zhou"})}),Object(A.jsx)(b.a,{variant:"body1",children:Object(A.jsx)(We.a,{href:"https://www.cs.cmu.edu/~ckaestne/",target:"_blank",children:"Christian K\xe4stner"})}),Object(A.jsx)(b.a,{variant:"body1",children:Object(A.jsx)(We.a,{href:"http://www.itu.dk/people/wasowski/",target:"_blank",children:"Andrzej W\u0105sowski"})}),Object(A.jsx)(b.a,{variant:"body1",children:Object(A.jsx)(We.a,{href:"https://www.linkedin.com/in/xinyan-he/",target:"_blank",children:"Xinyan He"})}),Object(A.jsx)(b.a,{variant:"body1",children:Object(A.jsx)(We.a,{href:"https://www.linkedin.com/in/laithhanania/",target:"_blank",children:"Laith Hanania"})}),Object(A.jsx)(b.a,{variant:"body1",children:Object(A.jsx)(We.a,{href:"https://www.linkedin.com/in/johnperry99/",target:"_blank",children:"John Perry"})}),Object(A.jsx)(b.a,{variant:"body1",children:Object(A.jsx)(We.a,{href:"https://www.linkedin.com/in/cansin-varol-5b8532165/",target:"_blank",children:"Cansin Varol"})}),Object(A.jsx)(b.a,{variant:"body1",children:Object(A.jsx)(We.a,{href:"https://www.linkedin.com/in/john-espedido/",target:"_blank",children:"John Melric Espedido"})}),Object(A.jsx)(b.a,{variant:"body1",children:Object(A.jsx)(We.a,{href:"https://www.linkedin.com/in/ron-hu-8aba60177/",target:"_blank",children:"Ron Hu"})}),Object(A.jsx)(b.a,{variant:"body1",children:Object(A.jsx)(We.a,{href:"https://www.linkedin.com/in/andrew-minyoung-kim/",target:"_blank",children:"Andrew Kim"})}),Object(A.jsx)(b.a,{variant:"body1",children:Object(A.jsx)(We.a,{href:"https://www.linkedin.com/in/ron-thomas-9260bb1b0/",target:"_blank",children:"Ron Thomas"})})]}),Object(A.jsxs)(Ge.a,{sx:{padding:2,width:"95%"},children:[Object(A.jsx)(b.a,{variant:"h4",children:"Publication"}),Object(A.jsxs)(b.a,{variant:"body1",children:[Object(A.jsx)(We.a,{href:"http://luyaoren.com/",children:"L. Ren"}),",",Object(A.jsx)(We.a,{href:"https://www.cs.cmu.edu/~shuruiz/",children:" S. Zhou"}),",",Object(A.jsx)(We.a,{href:"https://www.cs.cmu.edu/~ckaestne/",children:" C. K\xe4stner"}),", and ",Object(A.jsx)(We.a,{href:"http://www.itu.dk/people/wasowski/",children:"A. W\u0105sowski"}),".",Object(A.jsx)("b",{children:"Identifying Redundancies in Fork-based Development. "}),"In Proceedings of the 27th IEEE International Conference on Software Analysis, Evolution and Reengineering (SANER) [ ",Object(A.jsx)(We.a,{href:"https://www.cs.cmu.edu/~ckaestne/pdf/saner19.pdf",children:"paper "}),"]"]}),Object(A.jsxs)(b.a,{variant:"body1",children:[Object(A.jsx)(We.a,{href:"http://luyaoren.com/",children:"L. Ren"}),", ",Object(A.jsx)(We.a,{href:"https://www.cs.cmu.edu/~shuruiz/",children:" S. Zhou"}),", and ",Object(A.jsx)(We.a,{href:"https://www.cs.cmu.edu/~ckaestne/",children:" C. K\xe4stner"}),". ",Object(A.jsx)("b",{children:"Poster: Forks Insight: Providing an Overview of GitHub Forks. "}),"In Proceedings of the 40th International Conference on Software Engineering (ICSE) [ poster ] [ paper ]"]}),Object(A.jsxs)(b.a,{variant:"body1",children:[Object(A.jsx)(We.a,{href:"https://www.cs.cmu.edu/~shuruiz/",children:" S. Zhou"}),", ",Object(A.jsx)(We.a,{href:"http://www.itu.dk/people/scas/webpage/index.html",children:"\u0218. St\u0103nciulescu"}),", ",Object(A.jsx)(We.a,{href:"https://www.infosun.fim.uni-passau.de/spl/people-lessenich.php",children:"O. Le\xdfenich"}),", ",Object(A.jsx)(We.a,{href:"http://sei.pku.edu.cn/~xiongyf04/",children:"Y. Xiong"}),",",Object(A.jsx)(We.a,{href:"http://www.itu.dk/people/wasowski/",children:"A. W\u0105sowski"}),", and ",Object(A.jsx)(We.a,{href:"https://www.cs.cmu.edu/~ckaestne/",children:" C. K\xe4stner"}),". ",Object(A.jsx)("b",{children:"Identifying Features in Forks."}),"In Proceedings of the 40th International Conference on Software Engineering (ICSE), New York, NY: ACM Press, May 2018. Acceptance rate: 21 % (105/502). [ pdf ]"]})]}),Object(A.jsxs)(Ge.a,{sx:{display:"flex",marginTop:1,width:"50%",justifyContent:"space-evenly"},children:[Object(A.jsx)(P.a,{variant:"text",target:"_blank",href:"http://forks-insight.com/aboutus",children:"Contact Us"}),Object(A.jsx)(P.a,{variant:"text",target:"_blank",href:"https://github.com/FancyCoder0/INFOX",children:"INFOX on GitHub"}),Object(A.jsx)(P.a,{variant:"text",target:"_blank",href:"https://github.com/FancyCoder0/INFOX/issues",children:"Open An Issue"})]})]}),Ue=a(626),qe=a.p+"static/media/network.f7220782.jpg",Ye=a.p+"static/media/overview.20faaa4f.png",Ze=a.p+"static/media/tagging.a4f4020b.png";const Je={paperContainer:{height:650,width:"100%",backgroundImage:"url(".concat(qe,")"),backgroundSize:"cover",backgroundPositionX:"center"},boxContainer:{width:"20%",backgroundImage:"url(".concat(Ye,")"),backgroundSize:"contain",backgroundPositionX:"center",backgroundRepeat:"no-repeat"},boxContainer1:{width:"30%",backgroundImage:"url(".concat(Ze,")"),backgroundSize:"contain",backgroundPositionX:"center",backgroundRepeat:"no-repeat"},flexCenteredColumns:{display:"flex",flexDirection:"column",justifyContent:"center"},flexSpaceEvenRows:{display:"flex",flexDirection:"row",justifyContent:"space-evenly"}};var Ve=()=>Object(A.jsxs)(Ue.a,{sx:{display:"flex",justifyContent:"center",flexDirection:"column",alignItems:"center"},children:[Object(A.jsx)(Ue.a,{variant:"elevated",style:Je.paperContainer,children:Object(A.jsxs)(Ue.a,{variant:"elevated",style:Je.flexCenteredColumns,sx:{background:"rgba(0, 0, 0, 0.6)",height:650},children:[Object(A.jsxs)(b.a,{variant:"h1",color:"white",textAlign:"center",children:["INFOX ",Object(A.jsx)("sub",{children:"beta"})]}),Object(A.jsx)(b.a,{variant:"h2",color:"white",textAlign:"center",children:"Insights into Forks"}),Object(A.jsx)("br",{}),Object(A.jsx)("br",{}),Object(A.jsx)("br",{}),Object(A.jsx)(b.a,{variant:"body1",color:"white",textAlign:"center",children:"Overwhelmed with the activities in forks of a project?"}),Object(A.jsx)(b.a,{variant:"body1",color:"white",textAlign:"center",children:"Which forks are active?"}),Object(A.jsx)(b.a,{variant:"body1",color:"white",textAlign:"center",children:"Which contain interesting ideas?"}),Object(A.jsx)(b.a,{variant:"body1",color:"white",textAlign:"center",children:"Which contain already finished features to build upon, rather than reimplement?"})]})}),Object(A.jsxs)(Ge.a,{style:Je.flexSpaceEvenRows,sx:{padding:2,marginTop:2},children:[Object(A.jsx)(Ue.a,{style:Je.boxContainer}),Object(A.jsxs)(b.a,{variant:"h4",width:"30%",children:["Concise Overview of a Project's Forks",Object(A.jsx)(b.a,{variant:"body1",paragraph:!0,children:"Explore a compact list of all forks highlighting key insights, rather than scrolling forever in a network graph. We sift all forks and summarize changes with statistics and representative keywords. Sort forks by activity volume and recency or search for keywords."})]})]}),Object(A.jsxs)(Ge.a,{style:Je.flexSpaceEvenRows,sx:{padding:2,marginTop:2},children:[Object(A.jsxs)(b.a,{variant:"h4",width:"20%",children:["Label and Monitor Forks",Object(A.jsx)(b.a,{variant:"body1",paragraph:!0,children:"Identify and label forks with interesting activities, for example to scout for ideas and pull requests. Monitor interesting forks to keep up with changes. Track the activity of an entire community on GitHub. Get started by signing in with your GitHub account."})]}),Object(A.jsx)(Ue.a,{style:Je.boxContainer1})]}),Object(A.jsx)(Ge.a,{style:Je.flexSpaceEvenRows,sx:{padding:2,marginTop:2},children:Object(A.jsxs)(b.a,{variant:"h4",sx:{width:"67%"},children:["Research and Contribution ",Object(A.jsxs)(b.a,{variant:"body1",paragraph:!0,children:["INFOX comes out of an NSF-funded research project at Carnegie Mellon University, exploring how to improve collaboration and coordination in open-source software development. INFOX is open source and hosted for the community. We would love to hear your ideas and feedback. Explore the",Object(A.jsx)(We.a,{target:"_blank",href:"https://github.com/FancyCoder0/INFOX",children:" source"})," or ",Object(A.jsx)(We.a,{target:"_blank",href:"https://github.com/FancyCoder0/INFOX/issues",children:"open an issue."})," "]})]})}),Object(A.jsxs)(Ge.a,{variant:"elevated",sx:{display:"flex",marginTop:1,width:"100%",justifyContent:"space-evenly"},children:[Object(A.jsx)(P.a,{variant:"text",target:"_blank",href:"http://forks-insight.com/aboutus",children:"Contact Us"}),Object(A.jsx)(P.a,{variant:"text",target:"_blank",href:"https://github.com/FancyCoder0/INFOX",children:"INFOX on GitHub"}),Object(A.jsx)(P.a,{variant:"text",target:"_blank",href:"https://github.com/FancyCoder0/INFOX/issues",children:"Open An Issue"})]})]}),Qe=a(620),$e=a(571),et=a(621),tt=a(287),at=a.n(tt);var nt=()=>{const e=Object(d.p)(),t=()=>{e("/")};return Object(A.jsx)(o.a,{children:Object(A.jsxs)(Qe.a,{open:!0,variant:"outlined",onClose:t,maxWidth:"xs",BackdropProps:{style:{backgroundColor:"#212121",opacity:.9}},children:[Object(A.jsxs)($e.a,{children:[Object(A.jsx)(b.a,{variant:"h5",color:G,children:"Please Log In"}),Object(A.jsx)(u.a,{"aria-label":"close",onClick:t,sx:{position:"absolute",right:8,top:8,color:e=>e.palette.grey[500]},children:Object(A.jsx)(g.a,{})})]}),Object(A.jsxs)(et.a,{children:[Object(A.jsx)(o.a,{paddingBottom:2,children:Object(A.jsx)(b.a,{children:"Please login /or sign up using your Github account to access the full list of features!"})}),Object(A.jsx)(h.a,{container:!0,direction:"column",alignItems:"center",justifyContent:"center",children:Object(A.jsxs)(P.a,{style:{background:"#424242",color:"white"},variant:"contained",onClick:()=>{window.location.href="https://github.com/login/oauth/authorize?scope=user:email&client_id=b97b95129ce435e40a29"},children:[Object(A.jsx)(o.a,{paddingRight:1,children:Object(A.jsx)(at.a,{})}),"Log in with Github"]})})]})]})})},ct=a(302),st=a(303),it=a(607),rt=a(591),ot=a(581),lt=a(622),dt=a(577);var jt=e=>{let{onClickRemoveFilter:t,value:a}=e;return Object(A.jsx)(h.a,{item:!0,children:Object(A.jsx)(o.a,{sx:{border:4,borderRadius:12},style:{borderColor:H,background:X},padding:1,children:Object(A.jsxs)(h.a,{container:!0,direction:"row",alignItems:"center",children:[Object(A.jsx)(h.a,{item:!0,children:Object(A.jsx)(u.a,{onClick:()=>{t(a)},children:Object(A.jsx)(xe.a,{})})}),Object(A.jsx)(h.a,{item:!0,children:Object(A.jsx)(o.a,{fontWeight:"bold",children:Object(A.jsx)(b.a,{children:a})})})]})})})};const ht={colors:["#A31FF0","#FAF061","#2ca02c","#d62728","#9467bd","#8c564b"],enableTooltip:!0,deterministic:!1,fontSizes:[20,100],fontStyle:"normal",fontWeight:"normal",padding:1,rotations:3,rotationAngles:[0],scale:"sqrt",spiral:"archimedean",transitionDuration:1e3};var bt=()=>{const[e,t]=Object(n.useState)(null),[a,c]=Object(n.useState)(null),[s,i]=Object(n.useState)(""),[r,l]=Object(n.useState)(!1),[j,u]=Object(n.useState)(!0),[x,O]=Object(n.useState)(!0),[g,m]=Object(n.useState)(!0),[p,f]=Object(n.useState)(!1),[v,y]=Object(n.useState)(10),[k,w]=Object(n.useState)([]),[C,S]=Object(n.useState)(""),[_,F]=Object(n.useState)({}),[I,E]=Object(n.useState)(!1),R=Object(d.p)();return Object(A.jsxs)(o.a,{children:[Object(A.jsx)(o.a,{children:Object(A.jsxs)("form",{onSubmit:async e=>{e.preventDefault(),l(!0);const a={repo:s,analyzeCode:j,analyzeFiles:x,analyzeCommits:g,clusterNumber:v,updatedData:p,userInputWords:k};try{const e=await(async e=>{let{repo:t,analyzeCode:a,analyzeFiles:n,analyzeCommits:c,clusterNumber:s,updatedData:i,userInputWords:r}=e;return await U()({method:"GET",url:"flask/cluster?repo=".concat(t,"&analyzeCode=").concat(a,"&analyzeFiles=").concat(n,"&analyzeCommits=").concat(c,"&clusterNumber=").concat(s,"&updateData=").concat(i,"&userInputWords=").concat(r),headers:{Authorization:"Bearer "+localStorage.getItem("access_token")}})})(a);console.log("resp",e),t(e.data);let n=[];e.data.nodes.forEach((e=>{1===e.height&&n.push({type:"circle",match:{id:e.id},note:e.id,noteX:10,noteY:30,offset:2,noteTextOffset:3})})),console.log("Here 2"),c(n);let s={};s=e.data.wordcloud.map((e=>({text:e.slice(0)[0],value:e.slice(-1)[0].length}))),console.log("Here 3"),F(s),E(!1)}catch{E(!0)}l(!1)},children:[Object(A.jsxs)(h.a,{container:!0,alignItems:"center",paddingBottom:1,children:[Object(A.jsx)(h.a,{item:!0,paddingRight:1,children:Object(A.jsx)(oe.a,{variant:"standard",label:"Repository",value:s,onChange:e=>{i(e.target.value)}})}),Object(A.jsx)(h.a,{item:!0,marginTop:1,children:Object(A.jsx)(P.a,{variant:"contained",type:"submit",children:"Search"})}),Object(A.jsx)(h.a,{item:!0,marginTop:1,children:Object(A.jsxs)(h.a,{container:!0,children:[Object(A.jsx)(h.a,{item:!0,children:Object(A.jsxs)(h.a,{container:!0,children:[Object(A.jsx)(h.a,{item:!0,children:Object(A.jsx)(je.a,{checked:j,onChange:e=>{u(e.target.checked)}})}),Object(A.jsx)(h.a,{item:!0,marginTop:1,children:Object(A.jsx)(b.a,{children:"Analyze Code Changes"})})]})}),Object(A.jsx)(h.a,{item:!0,children:Object(A.jsxs)(h.a,{container:!0,children:[Object(A.jsx)(h.a,{item:!0,children:Object(A.jsx)(je.a,{checked:x,onChange:e=>{O(e.target.checked)}})}),Object(A.jsx)(h.a,{item:!0,marginTop:1,children:Object(A.jsx)(b.a,{children:"Analyze Files Changed"})})]})}),Object(A.jsx)(h.a,{item:!0,children:Object(A.jsxs)(h.a,{container:!0,children:[Object(A.jsx)(h.a,{item:!0,children:Object(A.jsx)(je.a,{checked:g,onChange:e=>{m(e.target.checked)}})}),Object(A.jsx)(h.a,{item:!0,marginTop:1,children:Object(A.jsx)(b.a,{children:"Analyze Commit Messages"})})]})}),Object(A.jsx)(h.a,{item:!0,children:Object(A.jsxs)(h.a,{container:!0,children:[Object(A.jsx)(h.a,{item:!0,children:Object(A.jsx)(je.a,{checked:p,onChange:e=>{f(e.target.checked)}})}),Object(A.jsx)(h.a,{item:!0,marginTop:1,children:Object(A.jsx)(b.a,{children:"Use Most Recent Data to Cluster"})})]})})]})}),Object(A.jsx)(h.a,{item:!0,xs:1,marginTop:1,paddingLeft:1,children:Object(A.jsxs)(it.a,{fullWidth:!0,children:[Object(A.jsx)(rt.a,{id:"clusterNumber",children:"Clusters"}),Object(A.jsxs)(ot.a,{id:"clusterNumber",label:"Clusters",value:v,onChange:e=>{y(e.target.value)},children:[Object(A.jsx)(lt.a,{value:5,children:"Five"}),Object(A.jsx)(lt.a,{value:10,children:"Ten"}),Object(A.jsx)(lt.a,{value:15,children:"Fifteen"}),Object(A.jsx)(lt.a,{value:20,children:"Twenty"})]})]})})]}),Object(A.jsx)(o.a,{children:Object(A.jsxs)(h.a,{container:!0,children:[Object(A.jsx)(h.a,{item:!0,paddingRight:1,children:Object(A.jsx)(oe.a,{variant:"standard",label:"Exclude Key Words",value:C,onChange:e=>{S(e.target.value)}})}),Object(A.jsx)(h.a,{item:!0,marginTop:1,children:Object(A.jsx)(P.a,{variant:"contained",type:"submit",onClick:e=>{w([...k,C]),S("")},children:"Add"})}),Object(A.jsx)(h.a,{container:!0,children:Object(pe.isEmpty)(k)?null:Object(A.jsx)(h.a,{container:!0,children:k.map((e=>Object(A.jsx)(jt,{value:e,onClickRemoveFilter:()=>{w(k.filter((t=>t!==e)))}})))})})]})})]})}),r?Object(A.jsx)(o.a,{height:"80vh",children:Object(A.jsx)(ie,{loadingMessage:"Please wait. This may take a few minutes."})}):I?Object(A.jsx)(o.a,{children:"Clustering in progess! Please check back soon..."}):e?Object(A.jsxs)("div",{style:{height:"100vh"},children:[Object(A.jsx)(P.a,{variant:"outlined",onClick:()=>(e=>{console.log(e),R("/forks/".concat(e))})(e.repo),sx:{m:2},children:"Go to fork list"}),Object(A.jsx)(ct.a,{data:e,margin:{top:0,right:0,bottom:0,left:0},linkDistance:function(e){return e.distance},centeringStrength:.4,repulsivity:500,iterations:260,nodeColor:function(e){return e.color},nodeBorderWidth:1,nodeBorderColor:{from:"color",modifiers:[["darker",.8]]},linkThickness:function(e){return 2+2*e.target.data.height},annotations:a,motionConfig:"wobbly"}),Object(A.jsx)(dt.a,{columns:e.table_columns,rows:e.table_rows,autoHeight:!0}),Object(A.jsx)(h.a,{children:Object(A.jsx)(st.a,{options:ht,words:_})})]}):null]})},ut=a(495),xt=a(624),Ot=a(594),gt=a(599),mt=a(596),pt=a(623),ft=a(300),vt=a.n(ft),yt=a(301),kt=a.n(yt),wt=a(576);var Ct=e=>{let{filters:t,setFilters:a,setSearch:c,externalKeyword:s,externalFileName:i}=e;const[r,l]=Object(n.useState)(null),[d,j]=Object(n.useState)(null),[x,O]=Object(n.useState)([]),[g,m]=Object(n.useState)([]),[f,v]=Object(n.useState)("");Object(n.useEffect)((()=>{i&&(m([...g,...i]),console.log("External file name:",i))}),[i]),Object(n.useEffect)((()=>{s&&(m([...g,...s]),console.log("External keyword name",s))}),[s]),Object(n.useEffect)((()=>{a(g)}),[g,a]),Object(n.useEffect)((()=>{c(f)}),[f,c]);const y=e=>{let{filter:t,value:a}=e;return Object(A.jsx)(h.a,{item:!0,children:Object(A.jsx)(o.a,{sx:{border:4,borderRadius:12},style:{borderColor:H,background:X},padding:1,children:Object(A.jsxs)(h.a,{container:!0,direction:"row",alignItems:"center",children:[Object(A.jsx)(h.a,{item:!0,children:Object(A.jsx)(u.a,{onClick:()=>{((e,t)=>{m(g.filter((a=>!(a.display===e&&a.value===t))))})(t,a)},children:Object(A.jsx)(xe.a,{})})}),Object(A.jsx)(h.a,{item:!0,children:Object(A.jsx)(o.a,{fontWeight:"bold",children:Object(A.jsxs)(b.a,{children:[t,": ",a]})})})]})})})};return Object(A.jsx)(o.a,{children:Object(A.jsxs)(h.a,{container:!0,direction:"row",justifyContent:"flex-start",alignItems:"center",spacing:1,children:[Object(A.jsx)(h.a,{item:!0}),Object(A.jsx)(h.a,{item:!0}),Object(A.jsxs)(h.a,{item:!0,children:[Object(A.jsx)(o.a,{sx:{border:4,borderRadius:12},style:{borderColor:H,background:X},padding:1,children:Object(A.jsx)(le.a,{onClick:e=>{l(e.currentTarget)},children:Object(A.jsxs)(h.a,{container:!0,direction:"row",alignItems:"center",children:[Object(A.jsx)(h.a,{item:!0,children:Object(A.jsx)(be.a,{})}),Object(A.jsx)(h.a,{item:!0,children:Object(A.jsx)(o.a,{fontWeight:"bold",children:Object(A.jsx)(b.a,{children:"Add Filter"})})})]})})}),Object(A.jsx)(de.b,{anchorEl:r,open:!!r,id:r?"simple-popover":void 0,onClose:()=>{l(null)},anchorOrigin:{vertical:"bottom",horizontal:"left"},children:Object(A.jsxs)(o.a,{sx:{border:4},style:{borderColor:H},padding:1,children:[Object(A.jsx)(o.a,{paddingBottom:1,children:Object(A.jsx)(b.a,{variant:"h5",children:"Filter by"})}),Object(A.jsxs)(h.a,{container:!0,spacing:1,padding:1,children:[Object(A.jsx)(h.a,{item:!0,border:1,style:{borderColor:H},children:Object(A.jsx)(o.a,{sx:{display:"flex"},children:Object(A.jsx)(o.a,{paddingRight:1,style:{overflow:"auto",maxHeight:"200px"},children:Object.values(t).map((e=>Object(A.jsxs)(h.a,{container:!0,direction:"row",alignItems:"center",children:[Object(A.jsx)(h.a,{item:!0,children:Object(A.jsx)(je.a,{onChange:()=>{(e=>{O([]),d&&d.display===e.display?j(null):j(e)})(e)},checked:(null===d||void 0===d?void 0:d.display)===e.display})}),Object(A.jsx)(h.a,{item:!0,children:Object(A.jsx)(b.a,{children:e.display})})]},e.display)))})})}),Object(A.jsx)(h.a,{item:!0,paddingRight:1,border:1,style:{borderColor:H},children:d?Object(A.jsx)(o.a,{paddingRight:1,style:{overflow:"auto",maxHeight:"200px"},children:d.values.map((e=>Object(A.jsxs)(h.a,{container:!0,direction:"row",alignItems:"center",children:[Object(A.jsx)(h.a,{item:!0,children:Object(A.jsx)(je.a,{onChange:()=>{(e=>{if(x.some((t=>t===e))){const t=x.filter((t=>t!==e));O(t)}else O([...x,e])})(e)},checked:x.some((t=>t===e))})}),Object(A.jsx)(h.a,{item:!0,children:Object(A.jsx)(b.a,{children:e})})]},e)))}):Object(A.jsx)(o.a,{paddingTop:1,children:Object(A.jsx)(b.a,{children:"Select a filter from the left side"})})})]}),Object(A.jsx)(o.a,{children:Object(A.jsx)(P.a,{variant:"contained",disabled:p()(x),onClick:()=>{const e=x.map((e=>({display:d.display,value:e,type:d.type,key:d.key}))),t=me()(e,g,pe.isEqual);m([...g,...t])},children:"Add Filters"})})]})})]}),Object(A.jsx)(h.a,{container:!0,direction:"row",spacing:1,marginLeft:2,marginTop:1,marginBottom:1,children:g.map((e=>Object(A.jsx)(y,{filter:e.display,value:e.value},"".concat(e.display,"+").concat(e.value))))})]})})};function St(e,t,a){return t[a]e[a]?1:0}function _t(e,t){return"desc"===e?(e,a)=>St(e,a,t):(e,a)=>-St(e,a,t)}function Ft(e,t){const a=e.map(((e,t)=>[e,t]));return a.sort(((e,a)=>{const n=t(e[0],a[0]);return 0!==n?n:e[1]-a[1]})),a.map((e=>e[0]))}const It=[{id:"fork_name",numeric:!1,disablePadding:!0,label:"Fork"},{id:"num_changed_files",numeric:!1,disablePadding:!1,label:"# Changed Files"},{id:"changed_files",numeric:!1,disablePadding:!1,label:"File List"},{id:"num_changed_lines",numeric:!1,disablePadding:!1,label:"# Changed Lines"},{id:"total_commit_number",numeric:!1,disablePadding:!1,label:"# Commits"},{id:"keywords",numeric:!1,disablePadding:!1,label:"Keywords"},{id:"last_committed_time",numeric:!1,disablePadding:!1,label:"Last Commit Time"},{id:"created_time",numeric:!1,disablePadding:!1,label:"Creation Date"}];function Et(e){const{onSelectAllClick:t,order:a,orderBy:n,numSelected:c,rowCount:s,onRequestSort:i}=e;return Object(A.jsx)(ze.a,{children:Object(A.jsxs)(Ne.a,{children:[Object(A.jsx)(Be.a,{padding:"checkbox",children:Object(A.jsx)(je.a,{color:"primary",indeterminate:c>0&&c0&&c===s,onChange:t,inputProps:{"aria-label":"select all desserts"}})}),It.map((e=>{return Object(A.jsx)(Be.a,{align:e.numeric?"right":"left",padding:e.disablePadding?"none":"normal",sortDirection:n===e.id&&a,children:Object(A.jsxs)(gt.a,{active:n===e.id,direction:n===e.id?a:"asc",onClick:(t=e.id,e=>{i(e,t)}),children:[e.label,n===e.id?Object(A.jsx)(o.a,{component:"span",sx:wt.a,children:"desc"===a?"sorted descending":"sorted ascending"}):null]})},e.id);var t}))]})})}const Rt=e=>{const{numSelected:t}=e;return Object(A.jsxs)(w.a,{sx:{pl:{sm:2},pr:{xs:1,sm:1},...t>0&&{bgcolor:e=>Object(ut.a)(e.palette.primary.main,e.palette.action.activatedOpacity)}},children:[t>0?Object(A.jsxs)(b.a,{sx:{flex:"1 1 100%"},color:"inherit",variant:"subtitle1",component:"div",children:[t," selected"]}):Object(A.jsx)(b.a,{sx:{flex:"1 1 100%"},variant:"h6",id:"tableTitle",component:"div"}),t>0?Object(A.jsx)(A.Fragment,{children:Object(A.jsx)(pt.a,{title:"Delete",children:Object(A.jsx)(u.a,{onClick:e.onDelete,children:Object(A.jsx)(vt.a,{})})})}):Object(A.jsx)(pt.a,{title:"Filter list",children:Object(A.jsx)(u.a,{children:Object(A.jsx)(kt.a,{})})})]})},Tt=e=>{let{data:t}=e;console.log("data",t);const a=[];t.forEach((e=>{var t,n,c;a.push(function(e,t,a,n,c,s,i,r){let o=[];for(let d=0;d{S(!0)};const U=j>0?Math.max(0,(1+j)*u-O.length):0;Object(n.useEffect)((()=>{const e=[];let t=!1;!a||p()(I)||p()(_)?(T(a),g(a)):(a.forEach((a=>{let n=!1;p()(_)||(t=!0,_.forEach((e=>{console.log("filt:",e),"changed_files"==e.key?(console.log("filter value",e.value),a[e.key].forEach((t=>{t===e.value&&(n=!0)}))):"key_words"==e.key?(console.log("filter value",e.value),a[e.key].forEach((t=>{t===e.value&&(n=!0)}))):a[e.key]===e.value&&(n=!0)}))),""!==D&&n&&(t=!0,a.repo.includes(D)||(n=!1)),n&&e.push(a)})),console.log("Filtered rows list:",e),console.log("Filters: ",_),T(e),g(e))}),[_,D,t]),Object(n.useEffect)((()=>{const e={changedFiles:{key:"num_changed_files",display:"# of Changed Files",type:"numeric",values:[]},fileName:{key:"changed_files",display:"File Name",type:"string",values:[]},changedLines:{key:"num_changed_lines",display:"# of Changed Lines",type:"numeric",values:[]},numCommits:{key:"total_commit_number",display:"# of Commits",type:"numeric",values:[]},keyword:{key:"key_words",display:"Keyword",type:"string",values:[]},updated:{key:"last_committed_time",display:"Last Updated",type:"date",values:[]},created:{key:"created_time",display:"Created",type:"date",values:[]}};null===a||void 0===a||a.forEach((t=>{e.changedFiles.values.some((e=>e===t.num_changed_files))||e.changedFiles.values.push(t.num_changed_files),t.changed_files.forEach((t=>{e.fileName.values.some((e=>e===t))||e.fileName.values.push(t)})),e.changedLines.values.some((e=>e===t.num_changed_lines))||e.changedLines.values.push(t.num_changed_lines),e.numCommits.values.some((e=>e===t.total_commit_number))||e.numCommits.values.push(t.total_commit_number),t.key_words.forEach((t=>{e.keyword.values.some((e=>e===t))||e.keyword.values.push(t)})),e.updated.values.some((e=>e===t.last_committed_time))||e.updated.values.push(t.last_committed_time),e.created.values.some((e=>e===t.created_time))||e.created.values.push(t.created_time)})),E(e),console.log("Initial filters: ",e)}),[t]);const q=e=>{""!=L&&H([{key:"key_words",display:"Keyword",type:"string",value:L}])},Y=e=>{""!=B&&M([{key:"changed_files",display:"File Name",type:"string",value:B}])};return Object(A.jsxs)(o.a,{sx:{width:"100%"},children:[Object(A.jsx)(b.a,{variant:"h3",sx:{m:2},children:window.location.pathname.split("/")[2].concat("/").concat(window.location.pathname.split("/")[3])}),Object(A.jsxs)(mt.a,{sx:{width:"100%",mb:2,mt:1},children:[Object(A.jsx)(o.a,{children:p()(I)?null:Object(A.jsx)(o.a,{children:Object(A.jsx)(Ct,{filters:I,setFilters:e=>{F(e)},setSearch:e=>{z(e)},externalKeyword:W,externalFileName:X})})}),Object(A.jsx)(Rt,{numSelected:l.length,onDelete:()=>{const e=O.filter((e=>!l.includes(e)));g(e),d([])}}),l.length>0&&Object(A.jsx)(P.a,{onClick:()=>{console.log("Selected forks:",l);let e=[];for(let i=0;ie[i].includes(t)));let n=[];for(let i=1;it[i].includes(e)));let c=[];for(let i=0;i{if(e.target.checked){const e=O.map((e=>e));d(e)}else d([])},onRequestSort:(e,t)=>{s(i===t&&"asc"===c?"desc":"asc"),r(t)},rowCount:O.length}),Object(A.jsxs)(Le.a,{children:[Ft(O,_t(c,i)).slice(j*u,j*u+u).map(((e,t)=>{const a=(n=e,-1!==l.indexOf(n));var n;const c="enhanced-table-checkbox-".concat(t);return Object(A.jsxs)(Ne.a,{hover:!0,onClick:t=>((e,t)=>{const a=l.indexOf(t);let n=[];-1===a?n=n.concat(l,t):0===a?n=n.concat(l.slice(1)):a===l.length-1?n=n.concat(l.slice(0,-1)):a>0&&(n=n.concat(l.slice(0,a),l.slice(a+1))),d(n)})(0,e),role:"checkbox","aria-checked":a,tabIndex:-1,selected:a,children:[Object(A.jsx)(Be.a,{padding:"checkbox",children:Object(A.jsx)(je.a,{color:"primary",checked:a,inputProps:{"aria-labelledby":c}})}),Object(A.jsx)(Be.a,{component:"th",id:c,scope:"row",padding:"none",children:e.fork_name}),Object(A.jsx)(Be.a,{align:"left",children:e.num_changed_files}),Object(A.jsx)(Be.a,{align:"left",children:e.parsed_files}),Object(A.jsx)(Be.a,{align:"left",children:e.num_changed_lines}),Object(A.jsx)(Be.a,{align:"left",children:e.total_commit_number}),Object(A.jsx)(Be.a,{align:"left",children:e.parsed_words}),Object(A.jsx)(Be.a,{align:"left",children:e.last_committed_time}),Object(A.jsx)(Be.a,{align:"left",children:e.created_time})]},e.fork_name)})),U>0&&Object(A.jsx)(Ne.a,{style:{height:53*U},children:Object(A.jsx)(Be.a,{colSpan:6})})]})]})}),Object(A.jsx)(Ot.a,{rowsPerPageOptions:[5,10,25],component:"div",count:O.length,rowsPerPage:u,page:j,onPageChange:(e,t)=>{h(t)},onRowsPerPageChange:e=>{x(parseInt(e.target.value,10)),h(0)}})]}),Object(A.jsxs)(o.a,{sx:{display:"flex",justifyContent:"center"},children:[Object(A.jsxs)(o.a,{sx:{display:"flex",flexDirection:"column"},children:[Object(A.jsx)(oe.a,{onKeyPress:e=>{"Enter"===e.key&&(q(),e.preventDefault())},placeholder:"Search for custom keyword",onChange:e=>{N(e.target.value),console.log("Keyword search term:",e.target.value)}}),Object(A.jsx)(P.a,{onClick:q,children:"Search"})]}),Object(A.jsxs)(o.a,{sx:{display:"flex",flexDirection:"column"},children:[Object(A.jsx)(oe.a,{onKeyPress:e=>{"Enter"===e.key&&(Y(),e.preventDefault())},sx:{marginLeft:1},placeholder:"Search for custom file name",onChange:e=>{G(e.target.value),console.log("File name search term:",e.target.value)}}),Object(A.jsx)(P.a,{onClick:Y,children:"Search"})]})]}),Object(A.jsx)(Pt,{open:C,commonFiles:v,commonKeywords:m,onClose:()=>{S(!1)}})]})},Pt=e=>{let{open:t,commonKeywords:a,commonFiles:n,onClose:c}=e;return Object(A.jsxs)(Qe.a,{open:t,onClose:()=>{c()},maxWidth:"lg",fullWidth:!0,children:[Object(A.jsx)($e.a,{children:"Fork Comparison"}),Object(A.jsx)(et.a,{children:Object(A.jsxs)(o.a,{sx:{display:"flex"},children:[a.length>0&&Object(A.jsxs)(mt.a,{sx:{width:"50%",padding:1,marginRight:1},children:[Object(A.jsx)(b.a,{variant:"h6",children:"Common Words from Selected Forks"}),Object(A.jsx)(b.a,{paragraph:!0,children:a})]}),n.length>0&&Object(A.jsxs)(mt.a,{sx:{width:"50%",padding:1},children:[Object(A.jsx)(b.a,{variant:"h6",children:"Common Files Changed from Selected Forks"}),Object(A.jsx)(b.a,{paragraph:!0,children:n})]})]})})]})};var At=()=>{const{repo1:e,repo2:t}=Object(d.r)(),[a,c]=Object(n.useState)(null),[s,i]=Object(n.useState)(0),[r,o]=Object(n.useState)(0),l=Object(n.useCallback)((async a=>{console.log("repo1",e),console.log("repo2",t);const n=await(async e=>await U()({method:"GET",url:"http://forks-insight.com/flask/forklist?repo=".concat(e),headers:{Authorization:"Bearer "+localStorage.getItem("access_token")}}))(a);console.log("Active forks number is ",n.data),o(n.data);let s=[],r=0;for(;r{l(e+"/"+t)}),[l]),Object(A.jsx)(A.Fragment,{children:a?Object(A.jsx)(Tt,{data:a}):Object(A.jsx)(ie,{loadingMessage:"There are "+r+" active forks in total, currently "+s+" analyzed."})})},Dt=a(625);var zt=e=>{let{title:t,description:a,link:c,onCloseDrawer:s}=e;const[i,r]=Object(n.useState)("white"),l=Object(d.p)();return Object(A.jsx)(o.a,{padding:1,children:Object(A.jsx)(le.a,{onClick:()=>{s(),l(c)},children:Object(A.jsx)(Ge.a,{variant:"outlined",style:{backgroundColor:i},onMouseOver:()=>{r(X)},onMouseLeave:()=>{r("white")},children:Object(A.jsx)(Dt.a,{children:Object(A.jsxs)(o.a,{textAlign:"left",width:400,children:[Object(A.jsx)(b.a,{variant:"h6",color:W,children:Object(A.jsx)("b",{children:t})}),Object(A.jsx)(b.a,{sx:{mb:1.5},color:"text.secondary",children:a})]})})})})})};const Lt=Object(f.a)({typography:{fontFamily:"Zilla Slab"}});var Nt=()=>{const e=Object(r.d)(y),t=Object(r.c)(y),[a,c]=Object(n.useState)(!0),[s,i]=Object(n.useState)(!1),O=Object(n.useCallback)((async()=>{c(!0),console.log("fetchUser");const t=localStorage.getItem("access_token"),a=localStorage.getItem("username");if(console.log(t,a),t){const t=await(async()=>await U()({method:"GET",url:"flask/auth",headers:{Authorization:"Bearer "+localStorage.getItem("access_token")}}))();console.log("test",t),null!==t&&void 0!==t&&t.data?(localStorage.setItem("username",t.data.username),e(t)):(e(null),localStorage.removeItem("access_token"),localStorage.removeItem("username"))}else e(null);c(!1)}),[e]);Object(n.useEffect)((()=>{O()}),[O]);const m=()=>{i(!1)};return Object(A.jsx)(v.a,{theme:Lt,children:Object(A.jsx)(o.a,{children:Object(A.jsxs)(l.a,{children:[Object(A.jsx)(ae,{onOpenDrawer:()=>{i(!0)}}),Object(A.jsxs)(j.a,{anchor:"left",open:s,onClose:m,children:[Object(A.jsxs)(h.a,{container:!0,padding:2,children:[Object(A.jsx)(h.a,{item:!0,xs:11,children:Object(A.jsx)(b.a,{variant:"h4",children:"Fork Analysis"})}),Object(A.jsx)(h.a,{item:!0,xs:1,children:Object(A.jsx)(u.a,{onClick:m,children:Object(A.jsx)(g.a,{})})})]}),Object(A.jsx)(x.a,{}),Object(A.jsx)(zt,{title:"Fork Clustering",description:"Cluster forks of a respository according to keywords in their commit messages.",link:"/cluster",onCloseDrawer:m}),Object(A.jsx)(zt,{title:"Fork Comparison",description:"Compare forks against each other in terms of code changes. Includes: files changed, number of commits, lines changes, etc.",onCloseDrawer:m,link:"/compare"}),Object(A.jsx)(zt,{title:"Fork Conflict Detection",description:"Check for possible conflicts for a fork",onCloseDrawer:m,link:"/conflict"})]}),Object(A.jsxs)(d.d,{children:[Object(A.jsx)(d.b,{path:"/",element:Object(A.jsx)(Ve,{})}),Object(A.jsx)(d.b,{path:"/login",element:Object(A.jsx)(nt,{})}),Object(A.jsx)(d.b,{path:"/private",element:p()(t)?Object(A.jsx)(d.a,{to:"/login"}):Object(A.jsx)("div",{children:"private"})}),Object(A.jsx)(d.b,{path:"/followed",element:p()(t)?Object(A.jsx)(d.a,{to:"/login"}):Object(A.jsx)(Fe,{})}),Object(A.jsx)(d.b,{path:"/import",element:p()(t)?Object(A.jsx)(d.a,{to:"/login"}):Object(A.jsx)(Ae,{})}),Object(A.jsx)(d.b,{path:"/search",element:p()(t)?Object(A.jsx)(d.a,{to:"/login"}):Object(A.jsx)(Me,{})}),Object(A.jsx)(d.b,{path:"/aboutus",element:Object(A.jsx)(Ke,{})}),Object(A.jsx)(d.b,{path:"/cluster",element:p()(t)?Object(A.jsx)(d.a,{to:"/login"}):Object(A.jsx)(bt,{})}),Object(A.jsx)(d.b,{path:"/forks/:repo1/:repo2",element:p()(t)?Object(A.jsx)(d.a,{to:"/followed"}):Object(A.jsx)(At,{})})]})]})})})};var Bt=e=>{e&&e instanceof Function&&a.e(3).then(a.bind(null,627)).then((t=>{let{getCLS:a,getFID:n,getFCP:c,getLCP:s,getTTFB:i}=t;a(e),n(e),c(e),s(e),i(e)}))};i.a.render(Object(A.jsx)(c.a.StrictMode,{children:Object(A.jsx)(r.a,{children:Object(A.jsx)(Nt,{})})}),document.getElementById("root")),Bt()}},[[485,1,2]]]); //# sourceMappingURL=main.894aeb44.chunk.js.map