1/* @license GPL-2.0-or-later https://www.drupal.org/licensing/faq */ 2(function($){var lastUpdatedFormat='h:mma M/D/YYYY';function CovidTrackerMap($element,caseData,featureLabel,geojsonUrl,styleId,center,zoom,lastImport){mapboxgl.accessToken='pk.eyJ1IjoibXVoZWFsdGgiLCJhIjoiY2tpNjh0M2RmMDgzbjJybjR0YzFmcnhsayJ9.NUUm-bykMabagdbgFlpCRA';var map=new mapboxgl.Map({container:$element.find('.covid-map .map')[0],style:'mapbox://styles/muhealth/'+styleId,center,zoom,minZoom:zoom,maxZoom:zoom,scrollZoom:false,doubleClickZoom:false,pitchWithRotate:false,touchZoomRotate:false});var $minCases=$element.find('.key .pre');var $maxCases=$element.find('.key .post');var $lastImport=$element.find('.updated');map.on('load',function(){$.getJSON(geojsonUrl).then(function(counties){var max=0;var min;for(var i in counties.features){counties.features[i].properties.cases=-1;if(!caseData.hasOwnProperty(counties.features[i].properties.NAME))continue;var cases=parseInt(caseData[counties.features[i].properties.NAME]);if(isNaN(cases))continue;counties.features[i].properties.cases=cases;if(min===undefined)min=cases;min=Math.min(min,cases);max=Math.max(max,cases);}$minCases.text(0);$maxCases.text(max);$lastImport.text('Last updated at: '+moment.unix(lastImport).format(lastUpdatedFormat));map.addSource('features',{type:'geojson',data:counties});map.addLayer({"id":"features-fills-cases","type":"fill","layout":{},"source":"features","paint":{'fill-opacity':['step',["to-number",["get","cases"]],0,0,1],'fill-color':['interpolate',['exponential',0.5],['ln',["to-number",["get","cases"]]],min===0?0:Math.log(min),'#FFFFFF',Math.log(max/2),'#77B3FF',Math.log(max),'#004299']}},'placeholder');var popup=new mapboxgl.Popup({closeButton:false,closeOnClick:false});var hoverOrTouchCallback=function(e){map.getCanvas().style.cursor='pointer';if(e.features.length>0){var cases=e.features[0].properties.cases>=0?e.features[0].properties.cases:'unknown';var label=featureLabel?' '+featureLabel:'';popup.setLngLat(e.lngLat).setHTML(e.features[0].properties.NAME+label+': '+cases+' cases').addTo(map);}};map.on('mousemove','features-fills-cases',hoverOrTouchCallback);map.on('touchstart','features-fills-cases',hoverOrTouchCallback);map.on('mouseleave','features',function(e){map.getCanvas().style.cursor='';popup.remove();});});});}Drupal.behaviors.covid_tracker={attach:function(context,settings){$.getJSON('/api/covid?token='+encodeURIComponent(settings.muhc_covid_tracker.csrf_token),function(data){$('.paragraph--type--covid-tracker-counties-map',context).each(function(){var map=new CovidTrackerMap($(this),data.missouri_counties,'','/modules/custom/muhc_covid_tracker/js/counties.json','ckihey2ad0ihd19szfigo7pek',[-92.59,38.35],screen.availWidth>=991?5.7:5.0,data.last_import);});$('.paragraph--type--covid-tracker-states-map',context).each(function(){var map=new CovidTrackerMap($(this),data.us_daily,'','/modules/custom/muhc_covid_tracker/js/states.json','ckigdszh352o119p94je4a3rq',[-95.409,38.739],screen.availWidth>=991?2.6:2.0,data.last_import);});$('.paragraph--type--covid-tracker-info-box',context).each(function(){$('.totalTests',this).text(data.missouri.totalTests);$('.missouriPositive',this).text(data.missouri.positive);$('.inpatientPositive',this).text(data.inpatient.positive);$('.inpatientPending',this).text(data.inpatient.pending);$('.lastImport',this).text(moment.unix(data.last_import).format(lastUpdatedFormat));});$('.paragraph--type--covid-inpatient',context).each(function(){var $this=$(this);var formatter=function(data,key){$('[data-covid="'+key+'"]',$this).each(function(){var points='';points+='<span class="vax"></span>'.repeat(data[key+'_vaccinated']);points+='<span class="uvax"></span>'.repeat(data[key+'_not_vaccinated']);$('.points',this).html(points);var vax=data[key+'_vaccinated'];var unvax=data[key+'_not_vaccinated'];var total=vax+unvax;$('p',this).html('<strong>'+(total)+'</strong> total<br /><strong>'+vax+'</strong> vaccinated<br /><strong>'+unvax+'</strong> unvaccinated');});};formatter(data.inpatient_vaccinated,'inpatient');formatter(data.inpatient_vaccinated,'inpatient_icu');formatter(data.inpatient_vaccinated,'inpatient_vent');$('.lastImport',this).text(moment.unix(data.last_import).format(lastUpdatedFormat));});});}};})(jQuery);;
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.