(window.__LOADABLE_LOADED_CHUNKS__=window.__LOADABLE_LOADED_CHUNKS__||[]).push([[7],{
/***/1:
/***/function(t,e){
/* (ignored) */
/***/},
/***/2:
/***/function(t,e){
/* (ignored) */
/***/},
/***/LRir:
/***/function(t,e,r){"use strict";
// UNUSED EXPORTS: Graph
// EXTERNAL MODULE: /Users/paulcowan/projects/cuttingedge/node_modules/react/jsx-runtime.js
var n=r("jg1C"),a=r("ERkP"),o=r("ZRWK"),c=r("xpE9"),i=r("jyTu"),u=r("IQD4"),l=r("QMGZ"),s=r("lbg7"),d=r("gPvS"),f=r("Poh/"),v=r("BQ33"),b=r.n(v),h=r("qfda"),O=r("rLzt"),p=r("9h7U"),y=r("qF7a"),j=r("IAlb"),E=r("zCf4"),g=r("daAW"),x=r("8e7h"),m="graph__container",R="graph__links",S="graph__active",D="graph__legend",A="graph__chart",w=function(){return(w=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var a in e=arguments[r])Object.prototype.hasOwnProperty.call(e,a)&&(t[a]=e[a]);return t}).apply(this,arguments)};
// EXTERNAL MODULE: /Users/paulcowan/projects/cuttingedge/node_modules/react/index.js
e.a=function(t){var e=t.result,r=t.yAxisLabel,v=t.labels,C=t.heading,k=t.xTickFormat,T=void 0===k?function(t,e,r){return e%2===0||e===r.length-1?""+b()(t).format("DD/MM"):""}:k,N=t.yTickFormat,_=void 0===N?function(t){return t}:N,P=Object(E.g)(),Y=Object(a.useRef)(null),B=Object(a.useRef)(null),I="undefined"!==typeof window&&window.screen.availWidth>500,L=Object(o.a)(Y,{debounceDelay:50}),U=L.width,q=L.height,F=Object(o.a)(B,{debounceDelay:50}),M=F.width,Q=F.height;return Object(n.jsx)(h.a,w({heading:C,showFooter:!0},{children:Object(n.jsxs)("div",w({className:m},{children:[Object(n.jsx)("ul",w({className:R},{children:[{url:j.d,text:"Daily increase in deaths (Scotland)"},{url:j.h,text:"Daily increase in deaths (World)"}].map((function(t){return P.pathname===t.url?Object(n.jsx)("li",{children:t.text},t.url):Object(n.jsx)("li",{children:Object(n.jsx)(g.b,w({activeClassName:S,to:t.url,exact:!0},{children:t.text}),void 0)},t.url)}))}),void 0),Object(n.jsx)("div",w({className:D,ref:Y},{children:Object(n.jsx)(p.c,w({height:q,width:U},{children:Object(n.jsx)(c.a,{x:0,y:0,height:q,width:U,centerTitle:I,standalone:!1,orientation:"horizontal",itemsPerRow:I?8:4,gutter:20,style:{labels:{fill:y.a},title:{fill:"#fff"}},data:Object.keys(y.b).filter((function(t){return P.pathname!==j.d||["SCO"].includes(t)})).map((function(t){return{name:y.b[t].longName,symbol:{fill:y.b[t].color}}}))},void 0)}),void 0)}),void 0),Object(n.jsx)("div",w({className:A,ref:B},{children:"undefined"===typeof(null===e||void 0===e?void 0:e.data)?Object(n.jsx)(O.d,{busy:!0,darkMode:!0},void 0):Object(n.jsx)(p.c,w({width:M,height:Q},{children:Object(n.jsxs)(i.a,w({width:M,height:Q,standalone:!1,theme:{axis:{style:{axis:{stroke:y.a},tickLabels:{color:y.a,fill:y.a},grid:{stroke:"#fff",strokeOpacity:.2}}}}},{children:[Object(n.jsx)(u.a,{dependentAxis:!0,label:r+" up until "+b()().subtract(1,"day").format("DD/MM/YYYY"),orientation:"left",standalone:!1,style:{axisLabel:{fill:y.a,fillOpacity:.5}},tickFormat:_},void 0),Object(n.jsx)(u.a,{orientation:"bottom",standalone:!1,style:{tickLabels:{angle:I?45:90,verticalAnchor:"middle",textAnchor:"start"}},tickFormat:T},void 0),Object.keys(e.data).map((function(t){var r,a;Object(x.assert)(null===(r=e.data)||void 0===r?void 0:r[t],"No country data "+t);var o=null===(a=e.data)||void 0===a?void 0:a[t];return Object(n.jsxs)(l.a,w({color:null===o||void 0===o?void 0:o.color,standalone:!1,labels:v,labelComponent:Object(n.jsx)(s.a,{style:{fontSize:15,paddingRight:4},renderInPortal:!1,constrainToVisibleArea:!0,flyoutWidth:200},void 0),data:null===o||void 0===o?void 0:o.data},{children:[Object(n.jsx)(d.a,{interpolation:"natural",style:{data:{strokeWidth:["SCO"].includes(t)?7:2}},standalone:!1},void 0),Object(n.jsx)(f.a,{standalone:!1,size:function(){return["SCO"].includes(t)?7:3}},void 0)]}),t)}))]}),void 0)}),void 0)}),void 0)]}),void 0)}),void 0)}},
/***/PdIv:
/***/function(t,e,r){"use strict";
/* WEBPACK VAR INJECTION */(function(t,n){/* harmony export (binding) */r.d(e,"a",(function(){return q}));
/* harmony import */var a=r("2h71"),o=r("zygG"),c=r("VtSi"),i=r.n(c),u=r("ERkP"),l=r("eklX"),s=r("zjfJ"),d=r("rpJ/"),f=r("JHJv"),v=r("Czhu"),b=r("HbGN"),h=r("fN3Q"),O=r("HX+Y"),p=r("5xIM"),y=r.n(p),j=r("o0Ri"),E=r("8e7h"),g=r("fGyu"),x=r("9fIP"),m=r("8K1b"),R=r("AqVP"),S=r("+lMt");
/* harmony import */!function(){var e={NODE_ENV:"production"};try{if(t)return t.env=Object.assign({},t.env),void Object.assign(t.env,e)}catch(e){}globalThis.process={env:e}}();var D={type:"START"},A={type:"ABORT"},w=function(t){return{type:"ERROR",error:t}},C=function(t){return{type:"RESET",payload:t}},k=function(t){return{type:"SUCCESS",payload:t}},T=function(t){var e,r,n={data:t.initialState,error:void 0};return Object(d.a)({id:"fetchable",initial:"READY",states:(r={},Object(s.a)(r,"READY",{on:{START:"LOADING"}}),Object(s.a)(r,"LOADING",{on:(e={},Object(s.a)(e,"SUCCESS",{target:"SUCCEEDED",actions:function(t,e){t.data=e.payload}}),Object(s.a)(e,"ERROR",{target:["ERROR"],actions:function(t,e){t.error=e.error}}),Object(s.a)(e,"ABORT",{target:["ABORTED"]}),e)}),Object(s.a)(r,"SUCCEEDED",{on:Object(s.a)({},"RESET",{target:"READY"})}),Object(s.a)(r,"ERROR",{on:Object(s.a)({},"RESET",{target:"READY",actions:function(t,e){return n}})}),Object(s.a)(r,"ABORTED",{on:Object(s.a)({},"RESET",{target:"READY",actions:function(t,e){return n}})}),r)})},N=["initialState","onQueryError","onQuerySuccess","contentType","method"],_=["url"],P=function(t){return JSON.stringify(t)};function Y(t,e){var r,n={jobs:[],addFetchRequest:function(t){var r,n,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=a.initialState,c=a.onQueryError,i=a.onQuerySuccess,u=a.contentType,l=void 0===u?"json":u,s=a.method,d=void 0===s?"GET":s,f=Object(b.a)(a,N),O=P(t);if(this.jobs.find((function(t){return t.key===O})))return this;if("string"==typeof t)r=t,n={};else{var p=t;r=p.url,n=Object(b.a)(p,_)}return this.jobs.push({uuid:Object(h.v4)(),key:O,state:"READY",fetch:{request:r,init:Object(v.a)(Object(v.a)({signal:e.signal,method:d,headers:{"Content-Type":"application/".concat(l)}},f),n),contentType:l,initialState:o,onQueryError:c,onQuerySuccess:i}}),this}};if(r=t,!1===Array.isArray(r)&&"function"!=typeof r)n.addFetchRequest(t);else if(Array.isArray(t)){var o,c=Object(a.a)(t);try{for(c.s();!(o=c.n()).done;)n.addFetchRequest(o.value)}catch(i){c.e(i)}finally{c.f()}}else"function"==typeof t&&(n=t(n));return n}var B="undefined"==typeof window?u.useEffect:u.useLayoutEffect;function I(t){return Array.isArray(t)?function(t,e){return[].concat(Object(g.a)(t),[e])}:function(t,e){return e}}var L=function(){},U=function(t){Object(m.a)(r,t);var e=Object(R.a)(r);function r(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",a=arguments.length>1?arguments[1]:void 0,o=arguments.length>2?arguments[2]:void 0,c=arguments.length>3?arguments[3]:void 0;return Object(x.a)(this,r),(t=e.call(this,n)).body=void 0,t.bodyParseError=void 0,t.status=void 0,t.status=a,t.body=o,t.bodyParseError=null!=c?c:null,t}return r}(Object(S.a)(Error));function q(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.accumulator,n=e.initialState,c=e.onSuccess,s=void 0===c?j.a:c,d=e.onError,v=void 0===d?console.error:d,b=e.onAbort,h=void 0===b?L:b,p=e.onQuerySuccess,g=void 0===p?j.a:p,x=e.onQueryError,m=void 0===x?L:x,R=e.fetchType,S=void 0===R?"fetch":R,N=e.executeOnMount,_=void 0===N||N,P=e.retryAttempts,q=void 0===P?3:P,F=e.retryDelay,M=void 0===F?500:F,Q=e.timeout,G=void 0===Q?18e4:Q,z=Object(l.a)(T({initialState:n})),W=Object(o.a)(z,2),J=W[0],K=W[1],H=Object(u.useRef)(new AbortController),V=Object(u.useRef)(Y(t,H.current)),X=Object(u.useRef)(0),Z=Object(u.useRef)(),$=Object(u.useRef)(0),tt=Object(u.useRef)(null!=G?G:void 0),et=Object(u.useRef)(n),rt=null!=r?r:I(n),nt=Object(u.useCallback)((function(t){h(t),K(A)}),[h,K]),at=Object(u.useCallback)((function(){console.log("aborting at ".concat(J.value)),H.current.abort()}),[H.current,J.value]),ot=Object(u.useCallback)((function(){var e;null===(e=Z.current)||void 0===e||e.halt(),X.current=0,H.current=new AbortController,V.current=Y(t,H.current),et.current=n,K(C(n))}),[t,n,K]),ct=Object(u.useCallback)((function(){Z.current=Object(f.run)(i.a.mark((function t(e){var r,n,o;return i.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:X.current+=1,K(D),t.prev=2,r=Object(a.a)(V.current.jobs),t.prev=4,o=i.a.mark((function t(){var r,a,o,c,u,l,s,d,v,b,h,p,x,R;return i.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=(a=(r=n.value).fetch).request,c=a.init,u=a.contentType,s=void 0===(l=a.onQuerySuccess)?g:l,v=void 0===(d=a.onQueryError)?m:d,tt.current=G||void 0,e.spawn(i.a.mark((function t(){return i.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("number"==typeof tt.current){t.next=2;break}return t.abrupt("return");case 2:return t.next=4,Object(f.sleep)(tt.current);case 4:console.log("\nRequest ".concat(o," did not complete in ").concat(tt.current,"ms.\ntimeout is currently ").concat(G," and there are ").concat(V.current.jobs.length," jobs")),H.current.abort();case 6:case"end":return t.stop()}}),t)}))),$.current=q,r.state="LOADING",b="fetch"===S?O.fetch:y.a,t.next=9,b(o,c);case 9:h=t.sent;case 10:if(h.ok||!($.current>0)){t.next=21;break}return t.next=13,Object(f.sleep)(M);case 13:return--$.current,console.log("request ".concat(o," failed, ").concat(h.status,": ").concat(h.statusText," -- retrying")),console.log("retry attempts left ".concat($.current)),t.next=18,b(o,c);case 18:h=t.sent,t.next=10;break;case 21:if(h.ok){t.next=26;break}throw r.state="ERROR",p=new U(h.statusText,h.status,null),v(p),p;case 26:return r.state="SUCCEEDED",t.next=29,h[u]();case 29:if(x=t.sent,Object(E.assert)(void 0!==rt,"no accumulator function present"),R=rt(et.current,x,{request:o,fetcher:b}),!Object(j.c)(R)){t.next=38;break}return t.next=35,R;case 35:t.t0=t.sent,t.next=39;break;case 38:t.t0=R;case 39:et.current=t.t0,s(x);case 41:case"end":return t.stop()}}),t)})),r.s();case 7:if((n=r.n()).done){t.next=11;break}return t.delegateYield(o(),"t0",9);case 9:t.next=7;break;case 11:t.next=16;break;case 13:t.prev=13,t.t1=t.catch(4),r.e(t.t1);case 16:return t.prev=16,r.f(),t.finish(16);case 19:K(k(et.current)),s(et.current),t.next=31;break;case 23:if(t.prev=23,t.t2=t.catch(2),"AbortError"!==(null==t.t2?void 0:t.t2.name)){t.next=28;break}return nt(t.t2),t.abrupt("return");case 28:return v(t.t2),K(w(t.t2)),t.abrupt("return");case 31:return t.prev=31,H.current.abort(),t.finish(31);case 34:case"end":return t.stop()}}),t,null,[[2,23,31,34],[4,13,16,19]])})))}),[K,G,s,g,m,q,S,rt,M,v,nt,H]);B((function(){return _&&void 0!==ct&&"READY"===J.value&&ct(),function(){var t;["SUCCEEDED","ERROR","ABORTED"].includes(J.value)&&(null===(t=Z.current)||void 0===t||t.halt())}}),[_,J.value,ct]);var it=Object(u.useMemo)((function(){switch(J.value){case"READY":return{state:"READY",run:ct,reset:ot,abort:at,data:void 0,error:void 0,counter:X.current};case"LOADING":return{state:"LOADING",run:ct,reset:ot,abort:at,data:void 0,error:void 0,counter:X.current};case"SUCCEEDED":return{state:"SUCCEEDED",run:ct,reset:ot,abort:at,data:J.context.data,error:void 0,counter:X.current};case"ERROR":return{state:"ERROR",error:J.context.error,data:void 0,run:ct,reset:ot,abort:at,counter:X.current};case"ABORTED":return{state:"ABORTED",data:void 0,error:void 0,run:ct,reset:ot,abort:at,counter:X.current};default:throw new Error("unknown state ".concat(J.value))}}),[J.value,J.context.data,J.context.error,ct,ot,at]);return it}"undefined"==typeof window&&(n.fetch=r("iDU1"),r("tusI"))}).call(this,r("F63i"),r("fRV1"))
/***/},
/***/qF7a:
/***/function(t,e,r){"use strict";
/* harmony export (binding) */r.d(e,"b",(function(){return n})),
/* harmony export (binding) */r.d(e,"a",(function(){return a}));var n={
// DEU: {
//   longName: 'Germany',
//   color: '#038D44',
//   population: 83000000,
// },
TUR:{longName:"Turkey",color:"#038D44",population:82e6},
// FRA: {
//   longName: 'France',
//   color: 'pink',
//   population: 67000000,
// },
ITA:{longName:"Italy",color:"#99ccff",population:6e7},
// BRA: {
//   longName: 'Brazil',
//   color: '#FEDF00',
//   population: 210000000,
// },
IND:{longName:"India",color:"#964B00",population:1366e6},USA:{longName:"USA",color:"#BF0A30",population:383e6},SWE:{longName:"Sweden",color:"#FEDF00",population:11e6},SCO:{longName:"Scotland",color:"#2C67B7",population:555e4},
// ESP: {
//   longName: 'Spain',
//   color: '#00FF00',
//   population: 47000000,
// },
GBR:{longName:"UK",color:"#fff",population:67e6}},a="#fff"},
/***/zju2:
/***/function(t,e,r){"use strict";
/* unused harmony export transform */
/* unused harmony export BreakPoint */
/* harmony export (binding) */r.d(e,"a",(function(){return E}));
/* harmony import */var n=r("qF7a"),a=r("PdIv"),o=r("BQ33"),c=r.n(o),i=r("o0Ri"),u=r("aPkM"),l=r.n(u),s=r("noK1"),d=r.n(s),f=r("8e7h"),v=r.n(f),b=r("ERkP"),h=function(){return(h=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var a in e=arguments[r])Object.prototype.hasOwnProperty.call(e,a)&&(t[a]=e[a]);return t}).apply(this,arguments)},O=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var a=0;for(n=Object.getOwnPropertySymbols(t);a<n.length;a++)e.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(t,n[a])&&(r[n[a]]=t[n[a]])}return r},p=function(t,e){var r="function"===typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,a,o=r.call(t),c=[];try{for(;(void 0===e||e-- >0)&&!(n=o.next()).done;)c.push(n.value)}catch(i){a={error:i}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(a)throw a.error}}return c},y=function(t){var e="function"===typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"===typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};
/* harmony import */c.a.extend(l.a);// documenter.getpostman.com/view/2568274/SzS8rjbe?version=latest
var j=function(t,e){var r=t.result.map((function(t,r){var n=t.date,a=t.deaths,o=O(t,["date","deaths"]);return h({x:c.a.utc(n).format(),y:a,index:r,country:e,deaths:a},o)}));return r.map((function(t,e){return h(h({},t),{delta:0===e?0:t.confirmed-r[e-1].confirmed,deltaDeaths:0===e?0:t.y-r[e-1].y})}))},E=function(t){var e,r,o,u,l=(void 0===t?{startDate:"2020-03-01"}:t).startDate,s=p(Object(b.useState)(),2),f=s[0],O=s[1],E=Object.keys(n.b).filter((function(t){return"SCO"!==t})).map((function(t){return d()("https://covidapi.info/api/v1/country",t.toUpperCase(),"timeseries",l,c()().format("YYYY-MM-DD"))})),g=Object(a.a)(E,{accumulator:function(t,e,r){var a=r.request;e.result=Object(i.e)(e.result,(function(t){return t.date})),v()("string"===typeof a,"unexpected request in accumulation context "+a);var o=a.split("/")[6],u=n.b[o];return t[o]={data:j(e,u).filter((function(t,e){return c()().diff(c()(t.x),"d")<=10||e%14===0})),color:u.color,name:u.longName},t},initialState:{},executeOnMount:!0}).data,x=Object(a.a)("https://www.opendata.nhs.scot/api/3/action/datastore_search?resource_id=287fc645-4352-4477-9c8c-55bc054b7e76&limit=1000&sort=Date%20desc",{fetchType:"fetchJsonp",executeOnMount:!0,initialState:{},accumulator:function(t,e){var r,a,o=[];try{for(var c=y(e.result.records.reverse()),i=c.next();!i.done;i=c.next()){var u=i.value,l=u.Date.toString(),s=l.substr(0,4)+"-"+l.substr(4,2)+"-"+l.substr(6,2);o.push({date:s,deaths:u.Deaths,recovered:0,confirmed:u.CumulativeCases})}}catch(d){r={error:d}}finally{try{i&&!i.done&&(a=c.return)&&a.call(c)}finally{if(r)throw r.error}}return t.SCO={data:j({result:o},n.b.SCO),color:n.b.SCO.color,name:n.b.SCO.longName},t}}).data;return Object(b.useEffect)((function(){var t,e,r,n,a;if(!f&&(null===(e=null===(t=null===x||void 0===x?void 0:x.SCO)||void 0===t?void 0:t.data)||void 0===e?void 0:e.length)&&(null===(n=null===(r=null===g||void 0===g?void 0:g.GBR)||void 0===r?void 0:r.data)||void 0===n?void 0:n.length)){var o=(null===(a=null===g||void 0===g?void 0:g.GBR)||void 0===a?void 0:a.data.map((function(t){return t.x})))||[];x.SCO.data=x.SCO.data.filter((function(t){return o.includes(t.x)})),O(h(h({},g),x))}}),[null===(r=null===(e=null===g||void 0===g?void 0:g.GBR)||void 0===e?void 0:e.data)||void 0===r?void 0:r.length,null===(u=null===(o=null===x||void 0===x?void 0:x.SCO)||void 0===o?void 0:o.data)||void 0===u?void 0:u.length]),{data:f}}}}]);
//# sourceMappingURL=7c2fe9ca71d2d4c839914525b72b580d6be96835-493df0b3.7d873d69.chunk.js.map