text: (window.webpackJsonp=window.webpackJsonp||[]).push([[5],{BAW5:function(e,t,s){"use strict";s.r(t),s.d(t,"articlesRoutes",(function(){return _})),s.d(t,"ArticlesModule",(function(){return Z}));var r=s("tyNb"),n=s("ofXK"),o=s("fXoL"),a=s("LRne"),i=s("HDdC"),l=s("bOdf"),h=s("pLZG"),c=s("lJxs");class u{}class d{}class p{constructor(e){this.normalizedNames=new Map,this.lazyUpdate=null,e?this.lazyInit="string"==typeof e?()=>{this.headers=new Map,e.split("\n").forEach(e=>{const t=e.indexOf(":");if(t>0){const s=e.slice(0,t),r=s.toLowerCase(),n=e.slice(t+1).trim();this.maybeSetNormalizedName(s,r),this.headers.has(r)?this.headers.get(r).push(n):this.headers.set(r,[n])}})}:()=>{this.headers=new Map,Object.keys(e).forEach(t=>{let s=e[t];const r=t.toLowerCase();"string"==typeof s&&(s=[s]),s.length>0&&(this.headers.set(r,s),this.maybeSetNormalizedName(t,r))})}:this.headers=new Map}has(e){return this.init(),this.headers.has(e.toLowerCase())}get(e){this.init();const t=this.headers.get(e.toLowerCase());return t&&t.length>0?t[0]:null}keys(){return this.init(),Array.from(this.normalizedNames.values())}getAll(e){return this.init(),this.headers.get(e.toLowerCase())||null}append(e,t){return this.clone({name:e,value:t,op:"a"})}set(e,t){return this.clone({name:e,value:t,op:"s"})}delete(e,t){return this.clone({name:e,value:t,op:"d"})}maybeSetNormalizedName(e,t){this.normalizedNames.has(t)||this.normalizedNames.set(t,e)}init(){this.lazyInit&&(this.lazyInit instanceof p?this.copyFrom(this.lazyInit):this.lazyInit(),this.lazyInit=null,this.lazyUpdate&&(this.lazyUpdate.forEach(e=>this.applyUpdate(e)),this.lazyUpdate=null))}copyFrom(e){e.init(),Array.from(e.headers.keys()).forEach(t=>{this.headers.set(t,e.headers.get(t)),this.normalizedNames.set(t,e.normalizedNames.get(t))})}clone(e){const t=new p;return t.lazyInit=this.lazyInit&&this.lazyInit instanceof p?this.lazyInit:this,t.lazyUpdate=(this.lazyUpdate||[]).concat([e]),t}applyUpdate(e){const t=e.name.toLowerCase();switch(e.op){case"a":case"s":let s=e.value;if("string"==typeof s&&(s=[s]),0===s.length)return;this.maybeSetNormalizedName(e.name,t);const r=("a"===e.op?this.headers.get(t):void 0)||[];r.push(...s),this.headers.set(t,r);break;case"d":const n=e.value;if(n){let e=this.headers.get(t);if(!e)return;e=e.filter(e=>-1===n.indexOf(e)),0===e.length?(this.headers.delete(t),this.normalizedNames.delete(t)):this.headers.set(t,e)}else this.headers.delete(t),this.normalizedNames.delete(t)}}forEach(e){this.init(),Array.from(this.normalizedNames.keys()).forEach(t=>e(this.normalizedNames.get(t),this.headers.get(t)))}}class y{encodeKey(e){return f(e)}encodeValue(e){return f(e)}decodeKey(e){return decodeURIComponent(e)}decodeValue(e){return decodeURIComponent(e)}}function f(e){return encodeURIComponent(e).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/gi,"$").replace(/%2C/gi,",").replace(/%3B/gi,";").replace(/%2B/gi,"+").replace(/%3D/gi,"=").replace(/%3F/gi,"?").replace(/%2F/gi,"/")}class m{constructor(e={}){if(this.updates=null,this.cloneFrom=null,this.encoder=e.encoder||new y,e.fromString){if(e.fromObject)throw new Error("Cannot specify both fromString and fromObject.");this.map=function(e,t){const s=new Map;return e.length>0&&e.split("&").forEach(e=>{const r=e.indexOf("="),[n,o]=-1==r?[t.decodeKey(e),""]:[t.decodeKey(e.slice(0,r)),t.decodeValue(e.slice(r+1))],a=s.get(n)||[];a.push(o),s.set(n,a)}),s}(e.fromString,this.encoder)}else e.fromObject?(this.map=new Map,Object.keys(e.fromObject).forEach(t=>{const s=e.fromObject[t];this.map.set(t,Array.isArray(s)?s:[s])})):this.map=null}has(e){return this.init(),this.map.has(e)}get(e){this.init();const t=this.map.get(e);return t?t[0]:null}getAll(e){return this.init(),this.map.get(e)||null}keys(){return this.init(),Array.from(this.map.keys())}append(e,t){return this.clone({param:e,value:t,op:"a"})}set(e,t){return this.clone({param:e,value:t,op:"s"})}delete(e,t){return this.clone({param:e,value:t,op:"d"})}toString(){return this.init(),this.keys().map(e=>{const t=this.encoder.encodeKey(e);return this.map.get(e).map(e=>t+"="+this.encoder.encodeValue(e)).join("&")}).filter(e=>""!==e).join("&")}clone(e){const t=new m({encoder:this.encoder});return t.cloneFrom=this.cloneFrom||this,t.updates=(this.updates||[]).concat([e]),t}init(){null===this.map&&(this.map=new Map),null!==this.cloneFrom&&(this.cloneFrom.init(),this.cloneFrom.keys().forEach(e=>this.map.set(e,this.cloneFrom.map.get(e))),this.updates.forEach(e=>{switch(e.op){case"a":case"s":const t=("a"===e.op?this.map.get(e.param):void 0)||[];t.push(e.value),this.map.set(e.param,t);break;case"d":if(void 0===e.value){this.map.delete(e.param);break}{let t=this.map.get(e.param)||[];const s=t.indexOf(e.value);-1!==s&&t.splice(s,1),t.length>0?this.map.set(e.param,t):this.map.delete(e.param)}}}),this.cloneFrom=this.updates=null)}}function b(e){return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer}function g(e){return"undefined"!=typeof Blob&&e instanceof Blob}function w(e){return"undefined"!=typeof FormData&&e instanceof FormData}class v{constructor(e,t,s,r){let n;if(this.url=t,this.body=null,this.reportProgress=!1,this.withCredentials=!1,this.responseType="json",this.method=e.toUpperCase(),function(e){switch(e){case"DELETE":case"GET":case"HEAD":case"OPTIONS":case"JSONP":return!1;default:return!0}}(this.method)||r?(this.body=void 0!==s?s:null,n=r):n=s,n&&(this.reportProgress=!!n.reportProgress,this.withCredentials=!!n.withCredentials,n.responseType&&(this.responseType=n.responseType),n.headers&&(this.headers=n.headers),n.params&&(this.params=n.params)),this.headers||(this.headers=new p),this.params){const e=this.params.toString();if(0===e.length)this.urlWithParams=t;else{const s=t.indexOf("?");this.urlWithParams=t+(-1===s?"?":s<t.length-1?"&":"")+e}}else this.params=new m,this.urlWithParams=t}serializeBody(){return null===this.body?null:b(this.body)||g(this.body)||w(this.body)||"string"==typeof this.body?this.body:this.body instanceof m?this.body.toString():"object"==typeof this.body||"boolean"==typeof this.body||Array.isArray(this.body)?JSON.stringify(this.body):this.body.toString()}detectContentTypeHeader(){return null===this.body||w(this.body)?null:g(this.body)?this.body.type||null:b(this.body)?null:"string"==typeof this.body?"text/plain":this.body instanceof m?"application/x-www-form-urlencoded;charset=UTF-8":"object"==typeof this.body||"number"==typeof this.body||Array.isArray(this.body)?"application/json":null}clone(e={}){const t=e.method||this.method,s=e.url||this.url,r=e.responseType||this.responseType,n=void 0!==e.body?e.body:this.body,o=void 0!==e.withCredentials?e.withCredentials:this.withCredentials,a=void 0!==e.reportProgress?e.reportProgress:this.reportProgress;let i=e.headers||this.headers,l=e.params||this.params;return void 0!==e.setHeaders&&(i=Object.keys(e.setHeaders).reduce((t,s)=>t.set(s,e.setHeaders[s]),i)),e.setParams&&(l=Object.keys(e.setParams).reduce((t,s)=>t.set(s,e.setParams[s]),l)),new v(t,s,n,{params:l,headers:i,reportProgress:a,responseType:r,withCredentials:o})}}const T=function(){var e={Sent:0,UploadProgress:1,ResponseHeader:2,DownloadProgress:3,Response:4,User:5};return e[e.Sent]="Sent",e[e.UploadProgress]="UploadProgress",e[e.ResponseHeader]="ResponseHeader",e[e.DownloadProgress]="DownloadProgress",e[e.Response]="Response",e[e.User]="User",e}();class E{constructor(e,t=200,s="OK"){this.headers=e.headers||new p,this.status=void 0!==e.status?e.status:t,this.statusText=e.statusText||s,this.url=e.url||null,this.ok=this.status>=200&&this.status<300}}class O extends E{constructor(e={}){super(e),this.type=T.ResponseHeader}clone(e={}){return new O({headers:e.headers||this.headers,status:void 0!==e.status?e.status:this.status,statusText:e.statusText||this.statusText,url:e.url||this.url||void 0})}}class S extends E{constructor(e={}){super(e),this.type=T.Response,this.body=void 0!==e.body?e.body:null}clone(e={}){return new S({body:void 0!==e.body?e.body:this.body,headers:e.headers||this.headers,status:void 0!==e.status?e.status:this.status,statusText:e.statusText||this.statusText,url:e.url||this.url||void 0})}}class C extends E{constructor(e){super(e,0,"Unknown Error"),this.name="HttpErrorResponse",this.ok=!1,this.message=this.status>=200&&this.status<300?"Http failure during parsing for "+(e.url||"(unknown url)"):`Http failure response for ${e.url||"(unknown url)"}: ${e.status} ${e.statusText}`,this.error=e.error||null}}function k(e,t){return{body:t,headers:e.headers,observe:e.observe,params:e.params,reportProgress:e.reportProgress,responseType:e.responseType,withCredentials:e.withCredentials}}let x=(()=>{class e{constructor(e){this.handler=e}request(e,t,s={}){let r;if(e instanceof v)r=e;else{let n=void 0;n=s.headers instanceof p?s.headers:new p(s.headers);let o=void 0;s.params&&(o=s.params instanceof m?s.params:new m({fromObject:s.params})),r=new v(e,t,void 0!==s.body?s.body:null,{headers:n,params:o,reportProgress:s.reportProgress,responseType:s.responseType||"json",withCredentials:s.withCredentials})}const n=Object(a.a)(r).pipe(Object(l.a)(e=>this.handler.handle(e)));if(e instanceof v||"events"===s.observe)return n;const o=n.pipe(Object(h.a)(e=>e instanceof S));switch(s.observe||"body"){case"body":switch(r.responseType){case"arraybuffer":return o.pipe(Object(c.a)(e=>{if(null!==e.body&&!(e.body instanceof ArrayBuffer))throw new Error("Response is not an ArrayBuffer.");return e.body}));case"blob":return o.pipe(Object(c.a)(e=>{if(null!==e.body&&!(e.body instanceof Blob))throw new Error("Response is not a Blob.");return e.body}));case"text":return o.pipe(Object(c.a)(e=>{if(null!==e.body&&"string"!=typeof e.body)throw new Error("Response is not a string.");return e.body}));case"json":default:return o.pipe(Object(c.a)(e=>e.body))}case"response":return o;default:throw new Error(`Unreachable: unhandled observe type ${s.observe}}`)}}delete(e,t={}){return this.request("DELETE",e,t)}get(e,t={}){return this.request("GET",e,t)}head(e,t={}){return this.request("HEAD",e,t)}jsonp(e,t){return this.request("JSONP",e,{params:(new m).append(t,"JSONP_CALLBACK"),observe:"body",responseType:"json"})}options(e,t={}){return this.request("OPTIONS",e,t)}patch(e,t,s={}){return this.request("PATCH",e,k(s,t))}post(e,t,s={}){return this.request("POST",e,k(s,t))}put(e,t,s={}){return this.request("PUT",e,k(s,t))}}return e.\u0275fac=function(t){return new(t||e)(o.Jb(u))},e.\u0275prov=o.Ab({token:e,factory:e.\u0275fac}),e})();class A{constructor(e,t){this.next=e,this.interceptor=t}handle(e){return this.interceptor.intercept(e,this.next)}}const N=new o.q("HTTP_INTERCEPTORS");let P=(()=>{class e{intercept(e,t){return t.handle(e)}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=o.Ab({token:e,factory:e.\u0275fac}),e})();const j=/^\)\]\}',?\n/;class R{}let z=(()=>{class e{constructor(){}build(){return new XMLHttpRequest}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=o.Ab({token:e,factory:e.\u0275fac}),e})(),L=(()=>{class e{constructor(e){this.xhrFactory=e}handle(e){if("JSONP"===e.method)throw new Error("Attempted to construct Jsonp request without JsonpClientModule installed.");return new i.a(t=>{const s=this.xhrFactory.build();if(s.open(e.method,e.urlWithParams),e.withCredentials&&(s.withCredentials=!0),e.headers.forEach((e,t)=>s.setRequestHeader(e,t.join(","))),e.headers.has("Accept")||s.setRequestHeader("Accept","application/json, text/plain, */*"),!e.headers.has("Content-Type")){const t=e.detectContentTypeHeader();null!==t&&s.setRequestHeader("Content-Type",t)}if(e.responseType){const t=e.responseType.toLowerCase();s.responseType="json"!==t?t:"text"}const r=e.serializeBody();let n=null;const o=()=>{if(null!==n)return n;const t=1223===s.status?204:s.status,r=s.statusText||"OK",o=new p(s.getAllResponseHeaders()),a=function(e){return"responseURL"in e&&e.responseURL?e.responseURL:/^X-Request-URL:/m.test(e.getAllResponseHeaders())?e.getResponseHeader("X-Request-URL"):null}(s)||e.url;return n=new O({headers:o,status:t,statusText:r,url:a}),n},a=()=>{let{headers:r,status:n,statusText:a,url:i}=o(),l=null;204!==n&&(l=void 0===s.response?s.responseText:s.response),0===n&&(n=l?200:0);let h=n>=200&&n<300;if("json"===e.responseType&&"string"==typeof l){const e=l;l=l.replace(j,"");try{l=""!==l?JSON.parse(l):null}catch(c){l=e,h&&(h=!1,l={error:c,text:l})}}h?(t.next(new S({body:l,headers:r,status:n,statusText:a,url:i||void 0})),t.complete()):t.error(new C({error:l,headers:r,status:n,statusText:a,url:i||void 0}))},i=e=>{const{url:r}=o(),n=new C({error:e,status:s.status||0,statusText:s.statusText||"Unknown Error",url:r||void 0});t.error(n)};let l=!1;const h=r=>{l||(t.next(o()),l=!0);let n={type:T.DownloadProgress,loaded:r.loaded};r.lengthComputable&&(n.total=r.total),"text"===e.responseType&&s.responseText&&(n.partialText=s.responseText),t.next(n)},c=e=>{let s={type:T.UploadProgress,loaded:e.loaded};e.lengthComputable&&(s.total=e.total),t.next(s)};return s.addEventListener("load",a),s.addEventListener("error",i),e.reportProgress&&(s.addEventListener("progress",h),null!==r&&s.upload&&s.upload.addEventListener("progress",c)),s.send(r),t.next({type:T.Sent}),()=>{s.removeEventListener("error",i),s.removeEventListener("load",a),e.reportProgress&&(s.removeEventListener("progress",h),null!==r&&s.upload&&s.upload.removeEventListener("progress",c)),s.abort()}})}}return e.\u0275fac=function(t){return new(t||e)(o.Jb(R))},e.\u0275prov=o.Ab({token:e,factory:e.\u0275fac}),e})();const U=new o.q("XSRF_COOKIE_NAME"),H=new o.q("XSRF_HEADER_NAME");class J{}let F=(()=>{class e{constructor(e,t,s){this.doc=e,this.platform=t,this.cookieName=s,this.lastCookieString="",this.lastToken=null,this.parseCount=0}getToken(){if("server"===this.platform)return null;const e=this.doc.cookie||"";return e!==this.lastCookieString&&(this.parseCount++,this.lastToken=Object(n.n)(e,this.cookieName),this.lastCookieString=e),this.lastToken}}return e.\u0275fac=function(t){return new(t||e)(o.Jb(n.c),o.Jb(o.B),o.Jb(U))},e.\u0275prov=o.Ab({token:e,factory:e.\u0275fac}),e})(),I=(()=>{class e{constructor(e,t){this.tokenService=e,this.headerName=t}intercept(e,t){const s=e.url.toLowerCase();if("GET"===e.method||"HEAD"===e.method||s.startsWith("http://")||s.startsWith("https://"))return t.handle(e);const r=this.tokenService.getToken();return null===r||e.headers.has(this.headerName)||(e=e.clone({headers:e.headers.set(this.headerName,r)})),t.handle(e)}}return e.\u0275fac=function(t){return new(t||e)(o.Jb(J),o.Jb(H))},e.\u0275prov=o.Ab({token:e,factory:e.\u0275fac}),e})(),q=(()=>{class e{constructor(e,t){this.backend=e,this.injector=t,this.chain=null}handle(e){if(null===this.chain){const e=this.injector.get(N,[]);this.chain=e.reduceRight((e,t)=>new A(e,t),this.backend)}return this.chain.handle(e)}}return e.\u0275fac=function(t){return new(t||e)(o.Jb(d),o.Jb(o.r))},e.\u0275prov=o.Ab({token:e,factory:e.\u0275fac}),e})(),D=(()=>{class e{static disable(){return{ngModule:e,providers:[{provide:I,useClass:P}]}}static withOptions(t={}){return{ngModule:e,providers:[t.cookieName?{provide:U,useValue:t.cookieName}:[],t.headerName?{provide:H,useValue:t.headerName}:[]]}}}return e.\u0275mod=o.Cb({type:e}),e.\u0275inj=o.Bb({factory:function(t){return new(t||e)},providers:[I,{provide:N,useExisting:I,multi:!0},{provide:J,useClass:F},{provide:U,useValue:"XSRF-TOKEN"},{provide:H,useValue:"X-XSRF-TOKEN"}]}),e})(),B=(()=>{class e{}return e.\u0275mod=o.Cb({type:e}),e.\u0275inj=o.Bb({factory:function(t){return new(t||e)},providers:[x,{provide:u,useClass:q},L,{provide:d,useExisting:L},z,{provide:R,useExisting:z}],imports:[[D.withOptions({cookieName:"XSRF-TOKEN",headerName:"X-XSRF-TOKEN"})]]}),e})(),M=(()=>{class e{constructor(e){this.http=e}getArticle$(e){return this.http.get("https://jsonplaceholder.typicode.com/todos/"+e)}}return e.\u0275fac=function(t){return new(t||e)(o.Jb(x))},e.\u0275prov=o.Ab({token:e,factory:e.\u0275fac,providedIn:"root"}),e})(),K=(()=>{class e{constructor(e){this.articlesService=e}resolve(e){const t=e.paramMap.get("id")||1;return this.articlesService.getArticle$(t)}}return e.\u0275fac=function(t){return new(t||e)(o.Jb(M))},e.\u0275prov=o.Ab({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();function X(...e){const t=e.length;if(0===t)throw new Error("list of properties cannot be empty.");return s=>Object(c.a)(function(e,t){return s=>{let r=s;for(let n=0;n<t;n++){const t=r[e[n]];if(void 0===t)return;r=t}return r}}(e,t))(s)}var $=s("jhN1");let V=(()=>{class e{constructor(e,t,s){this.dom=e,this.titleSvc=t,this.metaSvc=s}updateTitle(e){this.titleSvc.setTitle(e)}updateDescription(e){this.metaSvc.updateTag({name:"description",content:e})}createCanonicalLink(e){let t=this.dom.createElement("link");t.setAttribute("rel","canonical"),t.setAttribute("href",e),this.dom.head.appendChild(t)}}return e.\u0275fac=function(t){return new(t||e)(o.Jb(n.c),o.Jb($.c),o.Jb($.b))},e.\u0275prov=o.Ab({token:e,factory:e.\u0275fac,providedIn:"root"}),e})(),W=(()=>{class e{constructor(e,t){this.SEOService=e,this.route=t,this.articles$=this.route.data.pipe(X("articles"))}ngOnInit(){const{meta:e}=this.route.snapshot.data;this.SEOService.updateTitle(e.title),this.SEOService.updateDescription(e.description)}}return e.\u0275fac=function(t){return new(t||e)(o.Eb(V),o.Eb(r.a))},e.\u0275cmp=o.yb({type:e,selectors:[["app-articles"]],decls:2,vars:0,template:function(e,t){1&e&&(o.Hb(0,"p"),o.Sb(1,"Articles Component Page"),o.Gb())},styles:[""],changeDetection:0}),e})();var G=s("vkgz");const _=[{path:"",component:W},{path:":id",resolve:{article:K},component:(()=>{class e{constructor(e,t){this.SEOSvc=e,this.route=t,this.article$=this.route.data.pipe(X("article"),Object(G.a)(e=>this.updatePageMeta(e))),this.route.data.subscribe(e=>this.updatePageMeta(e.article))}updatePageMeta(e){console.log(e),this.SEOSvc.updateTitle(e.title),this.SEOSvc.updateDescription(e.title)}ngOnInit(){}}return e.\u0275fac=function(t){return new(t||e)(o.Eb(V),o.Eb(r.a))},e.\u0275cmp=o.yb({type:e,selectors:[["app-article"]],decls:2,vars:0,template:function(e,t){1&e&&(o.Hb(0,"p"),o.Sb(1,"article works with id!"),o.Gb())},styles:[""],changeDetection:0}),e})()}];let Z=(()=>{class e{}return e.\u0275mod=o.Cb({type:e}),e.\u0275inj=o.Bb({factory:function(t){return new(t||e)},providers:[K,M],imports:[[n.b,B,r.b.forChild(_)]]}),e})()}}]);