-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain-PNCZIOV3.js
1 lines (1 loc) · 7.89 KB
/
main-PNCZIOV3.js
1
import{a as X,b as K,c as Q,d as ee,f as te,g as ne,h as oe,i as ie,j as re,k as ae,l as se,m as ce,n as h,o as le,p as pe}from"./chunk-5PRWH3IR.js";import{$ as w,B as y,Eb as m,Fb as g,Gb as v,Jb as q,Ma as k,Oa as r,Pa as u,Qa as T,Sa as j,T as S,Tb as J,U as I,X as A,Xa as f,Xb as W,_ as d,ab as z,db as $,ea as R,fa as D,hb as H,la as F,lb as V,mb as B,nb as G,o as O,oa as E,ob as a,pb as c,qb as l,sb as L,t as b,ub as M,w as x,wa as N,wb as Y,ya as U,zb as Z}from"./chunk-IN3Y2CJX.js";var _e=(i,t)=>t.id;function ye(i,t){if(i&1){let e=L();a(0,"article",4),M("click",function(){let o=R(e).$implicit,s=Y();return D(s.onCardClick(o))}),a(1,"aside"),l(2,"img",5),c(),a(3,"section",6)(4,"header",7)(5,"h2"),m(6),c(),a(7,"section")(8,"h3"),l(9,"mat-icon",8),m(10),c(),a(11,"h3"),l(12,"mat-icon",9),m(13),c()()(),a(14,"h3"),m(15),c(),a(16,"h4"),m(17),c(),a(18,"p"),m(19),c()()()}if(i&2){let e=t.$implicit;r(2),Z("src",e.avatar_url,k),r(4),g(e.name),r(4),v(" ",e.public_repos||0," "),r(3),v(" ",e.followers||0," "),r(2),g(e.login),r(2),g(e.location||"Unknown"),r(2),g(e.email||"Unavailable")}}function Me(i,t){i&1&&l(0,"app-footer",3)}var C=class i{constructor(t,e,n){this.githubService=t;this.router=e;this.notificationService=n}since=1;userDetails=[];loading=!1;repoSubscription$;ngOnInit(){this.loadUserData(0)}loadUserData(t){this.loading=!0,this.repoSubscription$=this.githubService.getUsers(t).pipe(y(e=>this.handleError(e)),b(e=>{let n=e.map(o=>this.githubService.getUserByUsername(o.login));return x(n).pipe(y(o=>this.handleError(o)))})).subscribe(e=>{this.userDetails.push(...e),this.loading=!1})}handleError(t){return this.loading=!1,this.notificationService.showError(t),O(()=>new Error(t))}onCardClick(t){let{login:e,name:n,type:o}=t;this.router.navigate(["/user-repos"],{queryParams:{login:e,name:n,type:o}})}onScrollLoad(){let t=this.userDetails[this.userDetails.length-1].id;this.since!==t&&(this.since=t,this.loadUserData(this.since))}ngOnDestroy(){this.repoSubscription$.unsubscribe()}static \u0275fac=function(e){return new(e||i)(u(le),u(ne),u(pe))};static \u0275cmp=f({type:i,selectors:[["app-users"]],decls:5,vars:2,consts:[[3,"title"],["appScrollable","",1,"container",3,"triggerReached"],[1,"card"],[1,"section-footer"],[1,"card",3,"click"],[3,"src"],[1,"detail"],[1,"detail-header"],["fontIcon","source"],["fontIcon","people"]],template:function(e,n){e&1&&(l(0,"app-header",0),a(1,"section",1),M("triggerReached",function(){return n.onScrollLoad()}),B(2,ye,20,7,"article",2,_e),z(4,Me,1,0,"app-footer",3),c()),e&2&&(H("title"," - Github Users"),r(2),G(n.userDetails),r(2),V(n.loading?4:-1))},dependencies:[W,re,ie,ae,se,ce],styles:[".container[_ngcontent-%COMP%]{flex-direction:row;flex-wrap:wrap}.container[_ngcontent-%COMP%] .card[_ngcontent-%COMP%]{cursor:pointer;flex:40%}.container[_ngcontent-%COMP%] .card[_ngcontent-%COMP%]:hover{box-shadow:0 10px 20px #000c}.container[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] aside[_ngcontent-%COMP%]{border-radius:10px 0 0 10px;background-color:#2a265f;color:#fff;width:150px;padding:30px}.container[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] aside[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{border-radius:50%;display:inline-block;height:150px;overflow:hidden;width:150px}.container[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] .detail[_ngcontent-%COMP%]{display:flex;flex-direction:column;flex:1;padding:16px}.container[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] .detail[_ngcontent-%COMP%] h3[_ngcontent-%COMP%], .container[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] .detail[_ngcontent-%COMP%] h4[_ngcontent-%COMP%], .container[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] .detail[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:8px 0}.container[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] .detail[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{opacity:.5}.container[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] .detail-header[_ngcontent-%COMP%]{display:flex}.container[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] .detail-header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{flex:1}.container[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] .detail-header[_ngcontent-%COMP%] section[_ngcontent-%COMP%]{display:flex}.container[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] .detail-header[_ngcontent-%COMP%] section[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{align-items:center;display:flex;padding-right:8px}"]})};var me=[{path:"",component:C},{path:"user-repos",loadComponent:()=>import("./chunk-WJGFV4QM.js").then(i=>i.UserReposComponent)}];var ve="@",Pe=(()=>{class i{doc;delegate;zone;animationType;moduleImpl;_rendererFactoryPromise=null;scheduler=d(F,{optional:!0});loadingSchedulerFn=d(Oe,{optional:!0});_engine;constructor(e,n,o,s,p){this.doc=e,this.delegate=n,this.zone=o,this.animationType=s,this.moduleImpl=p}ngOnDestroy(){this._engine?.flush()}loadImpl(){let e=()=>this.moduleImpl??import("./chunk-UEALJGNL.js").then(o=>o),n;return this.loadingSchedulerFn?n=this.loadingSchedulerFn(e):n=e(),n.catch(o=>{throw new S(5300,!1)}).then(({\u0275createEngine:o,\u0275AnimationRendererFactory:s})=>{this._engine=o(this.animationType,this.doc);let p=new s(this.delegate,this._engine,this.zone);return this.delegate=p,p})}createRenderer(e,n){let o=this.delegate.createRenderer(e,n);if(o.\u0275type===0)return o;typeof o.throwOnSyntheticProps=="boolean"&&(o.throwOnSyntheticProps=!1);let s=new P(o);return n?.data?.animation&&!this._rendererFactoryPromise&&(this._rendererFactoryPromise=this.loadImpl()),this._rendererFactoryPromise?.then(p=>{let fe=p.createRenderer(e,n);s.use(fe),this.scheduler?.notify(11)}).catch(p=>{s.use(o)}),s}begin(){this.delegate.begin?.()}end(){this.delegate.end?.()}whenRenderingDone(){return this.delegate.whenRenderingDone?.()??Promise.resolve()}static \u0275fac=function(n){T()};static \u0275prov=I({token:i,factory:i.\u0275fac})}return i})(),P=class{delegate;replay=[];\u0275type=1;constructor(t){this.delegate=t}use(t){if(this.delegate=t,this.replay!==null){for(let e of this.replay)e(t);this.replay=null}}get data(){return this.delegate.data}destroy(){this.replay=null,this.delegate.destroy()}createElement(t,e){return this.delegate.createElement(t,e)}createComment(t){return this.delegate.createComment(t)}createText(t){return this.delegate.createText(t)}get destroyNode(){return this.delegate.destroyNode}appendChild(t,e){this.delegate.appendChild(t,e)}insertBefore(t,e,n,o){this.delegate.insertBefore(t,e,n,o)}removeChild(t,e,n){this.delegate.removeChild(t,e,n)}selectRootElement(t,e){return this.delegate.selectRootElement(t,e)}parentNode(t){return this.delegate.parentNode(t)}nextSibling(t){return this.delegate.nextSibling(t)}setAttribute(t,e,n,o){this.delegate.setAttribute(t,e,n,o)}removeAttribute(t,e,n){this.delegate.removeAttribute(t,e,n)}addClass(t,e){this.delegate.addClass(t,e)}removeClass(t,e){this.delegate.removeClass(t,e)}setStyle(t,e,n,o){this.delegate.setStyle(t,e,n,o)}removeStyle(t,e,n){this.delegate.removeStyle(t,e,n)}setProperty(t,e,n){this.shouldReplay(e)&&this.replay.push(o=>o.setProperty(t,e,n)),this.delegate.setProperty(t,e,n)}setValue(t,e){this.delegate.setValue(t,e)}listen(t,e,n){return this.shouldReplay(e)&&this.replay.push(o=>o.listen(t,e,n)),this.delegate.listen(t,e,n)}shouldReplay(t){return this.replay!==null&&t.startsWith(ve)}},Oe=new A("");function ge(i="animations"){return U("NgAsyncAnimations"),w([{provide:j,useFactory:(t,e,n)=>new Pe(t,e,n,i),deps:[J,Q,E]},{provide:N,useValue:i==="noop"?"NoopAnimations":"BrowserAnimations"}])}var he=(i,t)=>{let e=i,n=d(h);return n.get("token")&&(e=i.clone({setHeaders:{Authorization:`Bearer ${n.get("token")}`}})),t(e)};var ue={providers:[h,q({eventCoalescing:!0}),oe(me),ge(),X(K([he])),$(()=>d(h).loadConfig())]};var _=class i{title="help-a-friend";static \u0275fac=function(e){return new(e||i)};static \u0275cmp=f({type:i,selectors:[["app-root"]],decls:1,vars:0,template:function(e,n){e&1&&l(0,"router-outlet")},dependencies:[te],styles:["*[_ngcontent-%COMP%]{margin:0;padding:0;box-sizing:border-box}"]})};ee(_,ue).catch(i=>console.error(i));