text: (window.webpackJsonp=window.webpackJsonp||[]).push([[6],{mycG:function(e,n,t){"use strict";t.r(n),t.d(n,"InventoryModule",function(){return V});var o=t("ofXK"),i=t("tyNb"),c=t("R0Ic"),a=t("jtHE"),r=t("2Vo4"),s=t("/uUt"),p=t("wO+i"),l=t("1G5W"),d=t("eIep"),m=t("lJxs"),g=t("vkgz"),b=t("v8Ou"),k=t("fXoL"),h=t("l7P3"),O=t("IzEk"),u=t("tk/3");let f=(()=>{class e{constructor(e){this.http=e}getPokemonList(e){return this.http.get(e)}getPokemonDetail(e){return this.http.get(e)}}return e.\u0275fac=function(n){return new(n||e)(k.Xb(u.b))},e.\u0275prov=k.Jb({token:e,factory:e.\u0275fac,providedIn:"root"}),e})(),C=(()=>{class e{constructor(e,n){this.inventoryHttpService=e,this.store=n}callPokemonList(e){this.inventoryHttpService.getPokemonList(e).pipe(Object(s.a)(),Object(p.a)("pokemon_entries"),Object(g.a)(e=>this.store.dispatch(b.c({inventory:e}))),Object(O.a)(1)).subscribe(e=>console.log("[SERVICE] Call pokemon list"))}callPokemonDetail(e){this.inventoryHttpService.getPokemonDetail(e).pipe(Object(s.a)(),Object(g.a)(e=>this.store.dispatch(b.b({pokemon:e}))),Object(g.a)(e=>localStorage.setItem("pokemon",JSON.stringify(e))),Object(O.a)(1)).subscribe(e=>console.log("[SERVICE] Call pokemon detail"))}}return e.\u0275fac=function(n){return new(n||e)(k.Xb(f),k.Xb(h.h))},e.\u0275prov=k.Jb({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();var P=t("Y58K"),_=t("XiUz"),M=t("bTqV");let y=(()=>{class e{constructor(){}ngOnInit(){this.region.name.split("-")[1]?(this.name=this.region.name.split("-")[1],"central"===this.region.name.split("-")[1]&&(this.name=this.region.name.split("-")[0])):this.name=this.region.name}}return e.\u0275fac=function(n){return new(n||e)},e.\u0275cmp=k.Hb({type:e,selectors:[["app-region-card"]],inputs:{region:"region",isSelected:"isSelected"},decls:5,vars:7,consts:[["mat-button","",1,"region-card"],[1,"region-container"],[1,"region-background"],[1,"region-name"]],template:function(e,n){1&e&&(k.Tb(0,"button",0),k.Tb(1,"div",1),k.Ob(2,"div",2),k.Sb(),k.Sb(),k.Tb(3,"p",3),k.Ac(4),k.Sb()),2&e&&(k.Fb("mat-elevation-z4",n.isSelected),k.Cb(2),k.vc("background-image","url("+n.region.image+")"),k.Cb(1),k.Fb("region-selected",n.isSelected),k.Cb(1),k.Bc(n.name))},directives:[M.a],styles:[".region-card[_ngcontent-%COMP%]{height:7.5rem;width:7.5rem;margin:0 1em;border-radius:50%;padding:0;overflow:hidden;transition:.5s;border:inset #8b0000}.region-card[_ngcontent-%COMP%]   .region-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100%;width:100%}.region-card[_ngcontent-%COMP%]   .region-container[_ngcontent-%COMP%]   .region-background[_ngcontent-%COMP%]{height:100%;width:100%;background-position:50%;background-size:cover;background-origin:content-box;background-repeat:no-repeat}.region-name[_ngcontent-%COMP%]{text-transform:capitalize;color:grey;font-size:large;overflow:hidden;text-overflow:ellipsis;text-align:center}.region-selected[_ngcontent-%COMP%]{font-weight:600}@media only screen and (max-width:1024px){.region-card[_ngcontent-%COMP%]{width:5rem;height:5rem;padding:0}.region-name[_ngcontent-%COMP%]{font-size:80%!important}}@media only screen and (max-width:600px){.region-card[_ngcontent-%COMP%]{width:5rem;height:5rem;padding:0}}"]}),e})();var v=t("zkoq");let w=(()=>{class e{constructor(e){this.el=e,this.srcAttr=null}ngAfterViewInit(){this.canLazyLoad()?this.lazyLoadImage():this.loadImage()}canLazyLoad(){return window&&"IntersectionObserver"in window}lazyLoadImage(){const e=new IntersectionObserver(n=>{n.forEach(({isIntersecting:n})=>{n&&(this.loadImage(),e.unobserve(this.el.nativeElement))})});e.observe(this.el.nativeElement)}loadImage(){this.srcAttr=this.src}}return e.\u0275fac=function(n){return new(n||e)(k.Nb(k.l))},e.\u0275dir=k.Ib({type:e,selectors:[["img","appLazyLoadImage",""]],hostVars:1,hostBindings:function(e,n){2&e&&k.Db("src",n.srcAttr,k.tc)},inputs:{src:"src"}}),e})();const x=function(e,n){return[e,n]};let S=(()=>{class e{constructor(e,n){this.router=e,this.inventoryservice=n}goPokemonDetail(e){const n=e.pokemon_species.url;this.inventoryservice.callPokemonDetail(n.includes("pokemon-species")?n.replace("pokemon-species","pokemon"):n),this.router.navigate(["/inventory/"+e.entry_number])}ngOnInit(){}}return e.\u0275fac=function(n){return new(n||e)(k.Nb(i.a),k.Nb(C))},e.\u0275cmp=k.Hb({type:e,selectors:[["app-pokemon-card"]],inputs:{pokemon:"pokemon"},decls:5,vars:7,consts:[["mat-button","","routerLinkActive","router-link-active",1,"pokemon-card",3,"routerLink","click"],[1,"pokemon-container"],["appLazyLoadImage","",1,"pokemon-background",3,"src"],[1,"pokemon-name"]],template:function(e,n){1&e&&(k.Tb(0,"button",0),k.bc("click",function(){return n.goPokemonDetail(n.pokemon)}),k.Tb(1,"div",1),k.Ob(2,"img",2),k.Tb(3,"p",3),k.Ac(4),k.Sb(),k.Sb(),k.Sb()),2&e&&(k.kc("routerLink",k.nc(4,x,n.pokemon.entry_number,n.pokemon.pokemon_species.url)),k.Cb(2),k.kc("src","https://img.pokemondb.net/artwork/"+n.pokemon.pokemon_species.name+".jpg",k.tc),k.Cb(2),k.Dc("#",n.pokemon.entry_number," ",n.pokemon.pokemon_species.name,""))},directives:[M.a,i.c,i.b,w],styles:[".pokemon-card[_ngcontent-%COMP%]{width:10rem;height:200px;transition:transform .2s}.pokemon-card[_ngcontent-%COMP%]   .pokemon-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100%;width:100%}.pokemon-card[_ngcontent-%COMP%]   .pokemon-container[_ngcontent-%COMP%]   .pokemon-background[_ngcontent-%COMP%]{height:100%;width:100%;max-height:150px;max-width:125px;-o-object-fit:contain;object-fit:contain}.pokemon-card[_ngcontent-%COMP%]   .pokemon-container[_ngcontent-%COMP%]   .pokemon-name[_ngcontent-%COMP%]{text-transform:capitalize;color:grey;font-size:large;overflow:hidden;text-overflow:ellipsis}.pokemon-card[_ngcontent-%COMP%]:hover{transform:scale(1.05)}@media only screen and (max-width:600px){.pokemon-card[_ngcontent-%COMP%]{width:auto;height:auto}.pokemon-card[_ngcontent-%COMP%]   .pokemon-name[_ngcontent-%COMP%]{font-size:100%!important}}"]}),e})();function j(e,n){if(1&e){const e=k.Ub();k.Tb(0,"app-region-card",7),k.bc("click",function(){k.sc(e);const n=k.fc(2).$implicit;return k.fc(2).goRegion(n)}),k.Sb()}if(2&e){const e=k.fc().ngIf,n=k.fc().$implicit;k.kc("region",n)("isSelected",e.name===n.name)}}function I(e,n){if(1&e&&(k.Tb(0,"div"),k.yc(1,j,1,2,"app-region-card",6),k.Sb()),2&e){const e=k.fc().$implicit;k.Cb(1),k.kc("ngIf",e.image)}}function L(e,n){if(1&e&&(k.Tb(0,"div"),k.yc(1,I,2,1,"div",5),k.gc(2,"async"),k.Sb()),2&e){const e=k.fc(2);k.Cb(1),k.kc("ngIf",k.hc(2,1,e.regionSelected$))}}function z(e,n){if(1&e&&(k.Tb(0,"div",3),k.yc(1,L,3,3,"div",4),k.Sb()),2&e){const e=n.ngIf;k.Cb(1),k.kc("ngForOf",e.results)}}function T(e,n){if(1&e&&(k.Tb(0,"mat-grid-tile"),k.Ob(1,"app-pokemon-card",9),k.Sb()),2&e){const e=n.$implicit;k.kc("@items",void 0),k.Cb(1),k.kc("pokemon",e)}}function $(e,n){if(1&e&&(k.Tb(0,"mat-grid-list",8),k.yc(1,T,2,2,"mat-grid-tile",4),k.Sb()),2&e){const e=n.ngIf,t=k.fc();k.kc("@list",void 0)("cols",t.listColumns),k.Cb(1),k.kc("ngForOf",e)}}let A=(()=>{class e{constructor(e,n,t){this.store=e,this.inventoryService=n,this.regionService=t,this.destroy$=new a.a(1),this.pokemonFilterSubject$=new r.a(null)}onResize(e){this.changeColumnsList(e.target.innerWidth)}goRegion(e){this.regionService.selectRegion(e),this.store.dispatch(b.k())}changeColumnsList(e){this.listColumns=e<=600?1:e<=768?4:e<=1024?5:e<=1440?6:9}ngOnInit(){console.log("[INIT] List"),this.changeColumnsList(window.screen.width),this.inventory$=this.store.select("inventory").pipe(Object(s.a)(),Object(p.a)("pokemonFilter"),Object(l.a)(this.destroy$),Object(d.a)(e=>this.store.select("inventory").pipe(Object(p.a)("inventory"),Object(m.a)(n=>e?n.filter(n=>{if(n.pokemon_species.name.includes(e))return n}):n))),Object(l.a)(this.destroy$)),this.regionResponse$=this.store.select("regions").pipe(Object(g.a)(e=>{e.responseRegions||this.regionService.callRegionsList(null)}),Object(s.a)(),Object(p.a)("responseRegions"),Object(l.a)(this.destroy$)),this.regionSelected$=this.store.select("regions").pipe(Object(s.a)(),Object(p.a)("region"),Object(l.a)(this.destroy$)),this.regionSelected$.subscribe(e=>{e&&this.inventoryService.callPokemonList(e.url)})}ngOnDestroy(){console.log("[DESTROY] List"),this.destroy$.next(!0),this.destroy$.complete()}}return e.\u0275fac=function(n){return new(n||e)(k.Nb(h.h),k.Nb(C),k.Nb(P.a))},e.\u0275cmp=k.Hb({type:e,selectors:[["app-list"]],hostBindings:function(e,n){1&e&&k.bc("resize",function(e){return n.onResize(e)},!1,k.rc)},decls:5,vars:6,consts:[["fxLayout","column",1,"container"],["class","region-container","fxLayout","row wrap","fxLayoutAlign","center",4,"ngIf"],["rowHeight","200px",3,"cols",4,"ngIf"],["fxLayout","row wrap","fxLayoutAlign","center",1,"region-container"],[4,"ngFor","ngForOf"],[4,"ngIf"],[3,"region","isSelected","click",4,"ngIf"],[3,"region","isSelected","click"],["rowHeight","200px",3,"cols"],[3,"pokemon"]],template:function(e,n){1&e&&(k.Tb(0,"div",0),k.yc(1,z,2,1,"div",1),k.gc(2,"async"),k.yc(3,$,2,3,"mat-grid-list",2),k.gc(4,"async"),k.Sb()),2&e&&(k.Cb(1),k.kc("ngIf",k.hc(2,2,n.regionResponse$)),k.Cb(2),k.kc("ngIf",k.hc(4,4,n.inventory$)))},directives:[_.b,o.l,_.a,o.k,y,v.a,v.c,S],pipes:[o.b],styles:[".container[_ngcontent-%COMP%]{padding:1rem 2rem;margin:auto}.container[_ngcontent-%COMP%]   .list-bottom-bar[_ngcontent-%COMP%]{padding:2rem 4rem}.region-container[_ngcontent-%COMP%]{overflow:auto;margin:auto}@media only screen and (max-width:768px){.region-container[_ngcontent-%COMP%]{max-width:600px}}@media only screen and (max-width:600px){.region-container[_ngcontent-%COMP%]{flex-flow:row!important;place-content:stretch!important}}"],data:{animation:[Object(c.n)("list",[Object(c.m)(":enter",[Object(c.h)("@items",Object(c.j)(100,Object(c.f)()))])]),Object(c.n)("items",[Object(c.m)(":enter",[Object(c.l)({transform:"scale(0.5)",opacity:0}),Object(c.e)("1s cubic-bezier(.8,-0.6,0.2,1.5)",Object(c.l)({transform:"scale(1)",opacity:1}))]),Object(c.m)(":leave",[Object(c.l)({transform:"scale(1)",opacity:1,height:"*"}),Object(c.e)("1s cubic-bezier(.8,-0.6,0.2,1.5)",Object(c.l)({transform:"scale(0.5)",opacity:0,height:"0px",margin:"0px"}))])])]}}),e})();var N=t("A5z7");function R(e,n){if(1&e&&(k.Tb(0,"mat-chip",14),k.Ac(1),k.Sb()),2&e){const e=n.$implicit;k.Cb(1),k.Bc(e.type.name)}}function D(e,n){if(1&e&&(k.Tb(0,"div",1),k.Tb(1,"div",2),k.Tb(2,"div",3),k.Tb(3,"div",4),k.Tb(4,"div",5),k.Tb(5,"h1",6),k.Ac(6),k.Sb(),k.Tb(7,"span",7),k.Ac(8),k.Sb(),k.Sb(),k.Tb(9,"div",8),k.Tb(10,"mat-chip-list"),k.yc(11,R,2,1,"mat-chip",9),k.Sb(),k.Sb(),k.Tb(12,"div",10),k.Ob(13,"img",11),k.Sb(),k.Sb(),k.Sb(),k.Tb(14,"div",12),k.Tb(15,"p",13),k.Ac(16),k.gc(17,"json"),k.Sb(),k.Sb(),k.Sb(),k.Sb()),2&e){const e=n.ngIf;k.kc("className",e.types[0].type.name+"-type pokemon-detail"),k.Cb(6),k.Bc(e.name),k.Cb(2),k.Cc("#",e.order,""),k.Cb(3),k.kc("ngForOf",e.types),k.Cb(2),k.kc("src","https://img.pokemondb.net/artwork/"+e.name+".jpg",k.tc),k.Cb(3),k.Bc(k.hc(17,6,e))}}const F=[{path:"",component:A},{path:":id",component:(()=>{class e{constructor(e){this.store=e}ngOnInit(){this.pokemon$=this.store.select("inventory").pipe(Object(p.a)("pokemon")),localStorage.getItem("pokemon")&&this.store.dispatch(b.b({pokemon:JSON.parse(localStorage.getItem("pokemon"))}))}}return e.\u0275fac=function(n){return new(n||e)(k.Nb(h.h))},e.\u0275cmp=k.Hb({type:e,selectors:[["app-detail"]],decls:2,vars:3,consts:[[3,"className",4,"ngIf"],[3,"className"],[1,"pokemon-detail-container"],[1,"pokemon-detail-header"],[1,"aux-header"],[1,"pokemon-detail-subheader"],[1,"pokemon-detail-name"],[1,"pokemon-detail-order"],[1,"pokemon-detail-types"],["class","capitalize",4,"ngFor","ngForOf"],[1,"pokemon-detail-image"],["appLazyLoadImage","",1,"pokemon-image","mix-blend-mode-multiply",3,"src"],[1,"pokemon-detail-body"],[2,"white-space","pre","overflow","hidden"],[1,"capitalize"]],template:function(e,n){1&e&&(k.yc(0,D,18,8,"div",0),k.gc(1,"async")),2&e&&k.kc("ngIf",k.hc(1,1,n.pokemon$))},directives:[o.l,N.b,o.k,N.a],pipes:[o.b,o.f],styles:[".pokemon-detail[_ngcontent-%COMP%]   .pokemon-detail-container[_ngcontent-%COMP%]{position:relative}.pokemon-detail[_ngcontent-%COMP%]   .pokemon-detail-container[_ngcontent-%COMP%]   .pokemon-detail-header[_ngcontent-%COMP%]{padding:5%;color:#fff;box-shadow:0 10px 10px 0 rgba(0,0,0,.2);position:relative}.pokemon-detail[_ngcontent-%COMP%]   .pokemon-detail-container[_ngcontent-%COMP%]   .pokemon-detail-header[_ngcontent-%COMP%]   .mat-chip.mat-standard-chip[_ngcontent-%COMP%]{background-color:rgba(0,0,0,.15);color:#fff}.pokemon-detail[_ngcontent-%COMP%]   .pokemon-detail-container[_ngcontent-%COMP%]   .pokemon-detail-header[_ngcontent-%COMP%]   .aux-header[_ngcontent-%COMP%]{max-width:600px;margin:auto}.pokemon-detail[_ngcontent-%COMP%]   .pokemon-detail-container[_ngcontent-%COMP%]   .pokemon-detail-header[_ngcontent-%COMP%]   .pokemon-detail-subheader[_ngcontent-%COMP%]{display:flex;flex-direction:row}.pokemon-detail[_ngcontent-%COMP%]   .pokemon-detail-container[_ngcontent-%COMP%]   .pokemon-detail-header[_ngcontent-%COMP%]   .pokemon-detail-subheader[_ngcontent-%COMP%]   .pokemon-detail-name[_ngcontent-%COMP%]{width:100%;text-transform:capitalize;font-size:xx-large}.pokemon-detail[_ngcontent-%COMP%]   .pokemon-detail-container[_ngcontent-%COMP%]   .pokemon-detail-header[_ngcontent-%COMP%]   .pokemon-detail-subheader[_ngcontent-%COMP%]   .pokemon-detail-order[_ngcontent-%COMP%]{font-size:xx-large}.pokemon-detail[_ngcontent-%COMP%]   .pokemon-detail-container[_ngcontent-%COMP%]   .pokemon-detail-header[_ngcontent-%COMP%]   .pokemon-detail-image[_ngcontent-%COMP%]{display:flex}.pokemon-detail[_ngcontent-%COMP%]   .pokemon-detail-container[_ngcontent-%COMP%]   .pokemon-detail-header[_ngcontent-%COMP%]   .pokemon-detail-image[_ngcontent-%COMP%]   .pokemon-image[_ngcontent-%COMP%]{margin:auto}@media only screen and (max-width:600px){.pokemon-detail[_ngcontent-%COMP%]   .pokemon-detail-container[_ngcontent-%COMP%]   .pokemon-detail-header[_ngcontent-%COMP%]   .pokemon-detail-image[_ngcontent-%COMP%]   .pokemon-image[_ngcontent-%COMP%]{width:100%}}.pokemon-detail[_ngcontent-%COMP%]   .pokemon-detail-container[_ngcontent-%COMP%]   .pokemon-detail-header[_ngcontent-%COMP%]   .pokemon-detail-sprites[_ngcontent-%COMP%]{position:relative;width:200px;height:200px}.pokemon-detail[_ngcontent-%COMP%]   .pokemon-detail-container[_ngcontent-%COMP%]   .pokemon-detail-header[_ngcontent-%COMP%]   .pokemon-detail-sprites[_ngcontent-%COMP%]   .pokemon-detail-sprites-subcontainer[_ngcontent-%COMP%]{position:relative}.pokemon-detail[_ngcontent-%COMP%]   .pokemon-detail-container[_ngcontent-%COMP%]   .pokemon-detail-header[_ngcontent-%COMP%]   .pokemon-detail-sprites[_ngcontent-%COMP%]   .pokemon-detail-sprites-subcontainer[_ngcontent-%COMP%]   .pokemon-detail-sprites-front[_ngcontent-%COMP%]{position:absolute;z-index:3;min-width:200px;min-height:200px;transition:all .8s;-webkit-backface-visibility:hidden;backface-visibility:hidden}.pokemon-detail[_ngcontent-%COMP%]   .pokemon-detail-container[_ngcontent-%COMP%]   .pokemon-detail-header[_ngcontent-%COMP%]   .pokemon-detail-sprites[_ngcontent-%COMP%]   .pokemon-detail-sprites-subcontainer[_ngcontent-%COMP%]   .pokemon-detail-sprites-back[_ngcontent-%COMP%]{position:absolute;z-index:2;min-width:200px;min-height:200px;transform:rotateY(180deg);transition:all .8s;-webkit-backface-visibility:hidden;backface-visibility:hidden}.pokemon-detail[_ngcontent-%COMP%]   .pokemon-detail-container[_ngcontent-%COMP%]   .pokemon-detail-header[_ngcontent-%COMP%]   .pokemon-detail-sprites[_ngcontent-%COMP%]   .pokemon-detail-sprites-subcontainer[_ngcontent-%COMP%]:hover   .pokemon-detail-sprites-front[_ngcontent-%COMP%]{transform:rotateY(180deg)}.pokemon-detail[_ngcontent-%COMP%]   .pokemon-detail-container[_ngcontent-%COMP%]   .pokemon-detail-header[_ngcontent-%COMP%]   .pokemon-detail-sprites[_ngcontent-%COMP%]   .pokemon-detail-sprites-subcontainer[_ngcontent-%COMP%]:hover   .pokemon-detail-sprites-back[_ngcontent-%COMP%]{transform:rotateY(0deg);z-index:3}.pokemon-detail[_ngcontent-%COMP%]   .pokemon-detail-container[_ngcontent-%COMP%]   .pokemon-detail-body[_ngcontent-%COMP%]{background-color:#fff;display:flex;flex-direction:column;padding:2rem}"]}),e})()}];let E=(()=>{class e{}return e.\u0275mod=k.Lb({type:e}),e.\u0275inj=k.Kb({factory:function(n){return new(n||e)},imports:[[i.d.forChild(F)],i.d]}),e})();var H=t("vvyD"),J=t("LTI8"),B=t("YUcS");let V=(()=>{class e{}return e.\u0275mod=k.Lb({type:e}),e.\u0275inj=k.Kb({factory:function(n){return new(n||e)},imports:[[o.c,H.a,J.a,E,B.a]]}),e})()}}]);