From 0331de8b8ab85e9db94fee77091c925e98981c4b Mon Sep 17 00:00:00 2001 From: Matt Walsh Date: Wed, 7 Dec 2022 11:06:51 -0600 Subject: [PATCH] distribution --- dist/index.html | 2 +- dist/resources/ws.min.js | 3 +-- dist/resources/ws.min.js.map | 1 - 3 files changed, 2 insertions(+), 4 deletions(-) delete mode 100644 dist/resources/ws.min.js.map diff --git a/dist/index.html b/dist/index.html index 3acd23a..f4dc6a3 100644 --- a/dist/index.html +++ b/dist/index.html @@ -1 +1 @@ -WeatherStar 4000+

WeatherStar 4000+
Enter your location above to continue
WeatherStar
4000+ v5.1.1
Current Conditions
Hourly Forecast
TEMP
WIND
Travel Forecast
For
LOW
HIGH
Current
Conditions
Wind:
Humidity:
Dewpoint:
Ceiling:
Visibility:
Pressure:
Local
Forecast
Latest
Observations
°F
°C
Weather
Wind
Regional
Observations
Almanac
Monday
Tuesday
Sunrise:
6:24 am
6:25 am
Sunset:
6:24 am
6:25 am
Moon Data:
Extended
Forecast
Lo
Hi
Local
Radar
PRECIP
Light
Heavy

More information
Selected displays
Location:
Station Id:
Radar Id:
Zone Id:
Last Update: (None)
\ No newline at end of file +WeatherStar 4000+

WeatherStar 4000+
Enter your location above to continue
WeatherStar
4000+ v5.2.0
Current Conditions
Hourly Forecast
TEMP
WIND
Travel Forecast
For
LOW
HIGH
Current
Conditions
Wind:
Humidity:
Dewpoint:
Ceiling:
Visibility:
Pressure:
Local
Forecast
Latest
Observations
°F
°C
Weather
Wind
Regional
Observations
Almanac
Monday
Tuesday
Sunrise:
6:24 am
6:25 am
Sunset:
6:24 am
6:25 am
Moon Data:
Extended
Forecast
Lo
Hi
Local
Radar
PRECIP
Light
Heavy

More information
Selected displays
Location:
Station Id:
Radar Id:
Zone Id:
Last Update: (None)
\ No newline at end of file diff --git a/dist/resources/ws.min.js b/dist/resources/ws.min.js index 8ac89f7..1fb8106 100644 --- a/dist/resources/ws.min.js +++ b/dist/resources/ws.min.js @@ -1,2 +1 @@ -(()=>{"use strict";var e={"./server/scripts/index.mjs":(e,t,s)=>{s.r(t);var r=s("./server/scripts/modules/utils/fetch.mjs"),n=s("./server/scripts/modules/utils/nosleep.mjs"),a=s("./server/scripts/modules/navigation.mjs");document.addEventListener("DOMContentLoaded",(()=>{c()}));const i={};let o=!1,l=!1;const u=["Land Features","Bay","Channel","Cove","Dam","Delta","Gulf","Lagoon","Lake","Ocean","Reef","Reservoir","Sea","Sound","Strait","Waterfall","Wharf","Amusement Park","Historical Monument","Landmark","Tourist Attraction","Zoo","College","Beach","Campground","Golf Course","Harbor","Nature Reserve","Other Parks and Outdoors","Park","Racetrack","Scenic Overlook","Ski Resort","Sports Center","Sports Field","Wildlife Reserve","Airport","Ferry","Marina","Pier","Port","Resort","Postal","Populated Place"].join(","),c=()=>{document.getElementById("txtAddress").addEventListener("focus",(e=>{e.target.select()})),(0,a.registerRefreshData)(y),document.getElementById("NavigateMenu").addEventListener("click",p),document.getElementById("NavigateRefresh").addEventListener("click",w),document.getElementById("NavigateNext").addEventListener("click",S),document.getElementById("NavigatePrevious").addEventListener("click",T),document.getElementById("NavigatePlay").addEventListener("click",D),document.getElementById("ToggleFullScreen").addEventListener("click",h),document.getElementById("btnGetGps").addEventListener("click",x),document.getElementById("divTwc").addEventListener("click",(()=>{document.fullscreenElement&&C()})),document.addEventListener("keydown",I),document.addEventListener("touchmove",(e=>{l&&e.preventDefault()})),$("#frmGetLatLng #txtAddress").devbridgeAutocomplete({serviceUrl:"https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/suggest",deferRequestBy:300,paramName:"text",params:{f:"json",countryCode:"USA",category:u,maxSuggestions:10},dataType:"json",transformResult:t=>(o&&(o=!1,window.setTimeout((()=>{$(e.suggestionsContainer.children[0]).click()}),1)),{suggestions:$.map(t.suggestions,(e=>({value:e.text,data:e.magicKey})))}),minChars:3,showNoSuggestionNotice:!0,noSuggestionNotice:"No results found. Please try a different search string.",onSelect(e){d(e,this)},width:490});const e=$("#frmGetLatLng #txtAddress").devbridgeAutocomplete();$("#frmGetLatLng").on("submit",(()=>(e.suggestions[0]&&$(e.suggestionsContainer.children[0]).click(),!1)));const t=localStorage.getItem("TwcQuery");if(t){o=!0;const e=document.getElementById("txtAddress");e.value=t,e.blur(),e.focus()}const s=localStorage.getItem("TwcPlay");null!==s&&"true"!==s||M("navButton","play"),document.getElementById("btnClearQuery").addEventListener("click",(()=>{document.getElementById("spanCity").innerHTML="",document.getElementById("spanState").innerHTML="",document.getElementById("spanStationId").innerHTML="",document.getElementById("spanRadarId").innerHTML="",document.getElementById("spanZoneId").innerHTML="",localStorage.removeItem("TwcScrollText"),localStorage.removeItem("TwcScrollTextChecked"),document.getElementById("chkAutoRefresh").checked=!0,localStorage.removeItem("TwcAutoRefresh"),document.getElementById("radEnglish").checked=!0,localStorage.removeItem("TwcPlay"),M("navButton","play"),localStorage.removeItem("TwcQuery")})),document.getElementById("container").addEventListener("swiped-left",(()=>v("left"))),document.getElementById("container").addEventListener("swiped-right",(()=>v("right")))},d=async(e,t)=>{if(t.previousSuggestionValue!==e.value)if(i[e.value])m(i[e.value]);else{const t=(await(0,r.json)("https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/find",{data:{text:e.value,magicKey:e.data,f:"json"}})).locations[0];t?m(t.feature.geometry):console.error("An unexpected error occurred. Please try a different search string.")}},m=e=>{const t={lat:Math.round2(e.y,4),lon:Math.round2(e.x,4)};y(t),localStorage.setItem("TwcQuery",document.getElementById("txtAddress").value)},h=()=>(document.fullscreenElement?g():f(),(0,a.isPlaying)()?(0,n.default)(!0):(0,n.default)(!1),C(),!1),f=()=>{const e=document.getElementById("divTwc"),t=e.requestFullScreen||e.webkitRequestFullScreen||e.mozRequestFullScreen||e.msRequestFullscreen;t?t.call(e,{navigationUI:"hide"}):(window.scrollTo(0,0),l=!0),(0,a.resize)(),C(),document.getElementById("ToggleFullScreen").title="Exit fullscreen"},g=()=>{l&&(l=!1),document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.msExitFullscreen&&document.msExitFullscreen(),(0,a.resize)(),document.getElementById("ToggleFullScreen").title="Enter fullscreen"},p=()=>(M("navButton","menu"),C(),!1),y=e=>{e&&(y.latLon=e);const{latLon:t}=y;t&&(document.getElementById("txtAddress").blur(),(0,a.stopAutoRefreshTimer)(),(0,a.latLonReceived)(t))},v=e=>{if("left"===e)S();else T()},w=()=>((0,a.resetStatuses)(),y(),C(),!1),S=()=>(M("navButton","next"),C(),!1),T=()=>(M("navButton","previous"),C(),!1);let b=null;const C=()=>{document.activeElement.blur(),document.getElementById("divTwcBottom").classList.remove("hidden"),document.getElementById("divTwcBottom").classList.add("visible"),b&&(clearTimeout(b),b=null),b=setTimeout((()=>{document.fullscreenElement&&(document.getElementById("divTwcBottom").classList.remove("visible"),document.getElementById("divTwcBottom").classList.add("hidden"))}),2e3)},I=e=>{const t=e.keyCode||e.which;if((Date.now()-I.lastButton??0)<200)return!1;if(I.lastButton=Date.now(),document.fullscreenElement||document.activeElement===document.body)switch(t){case 32:return D(),!1;case 39:case 34:return S(),!1;case 37:case 33:return T(),!1;case 36:return p(),!1;case 48:return w(),!1;case 70:return h(),!1}return!1};Math.round2=(e,t)=>Number(`${Math.round(`${e}e${t}`)}e-${t}`);const D=()=>(M("navButton","playToggle"),C(),!1),M=(e,t={})=>{(0,a.message)({type:e,message:t})},x=async()=>{if(!navigator.geolocation)return;const e=await new Promise((e=>{navigator.geolocation.getCurrentPosition(e)})),{latitude:t,longitude:s}=e.coords;let n;try{n=await(0,r.json)("https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/reverseGeocode",{data:{location:`${s},${t}`,distance:1e3,f:"json"}})}catch(e){console.error("Unable to fetch reverse geocode"),console.error(e.status,e.responseJSONe)}const a=n.address.Postal,{City:i}=n.address,o=`${a}, ${i}, ${states.getTwoDigitCode(n.address.Region)}, ${n.address.CountryCode}`,l=document.getElementById("txtAddress");l.value=o,l.blur(),l.focus(),localStorage.setItem("TwcQuery",o)}},"./server/scripts/modules/almanac.mjs":(e,t,s)=>{s.r(t),s.d(t,{default:()=>c});var r=s("./server/scripts/modules/utils/image.mjs"),n=s("./server/scripts/vendor/auto/luxon.mjs"),a=s("./server/scripts/modules/status.mjs"),i=s("./server/scripts/modules/weatherdisplay.mjs"),o=s("./server/scripts/modules/navigation.mjs");class l extends i.default{constructor(e,t){super(e,t,"Almanac",!0),this.backgroundImage0=(0,r.loadImg)("images/BackGround3_1.png"),(0,r.preloadImg)("images/2/Full-Moon.gif"),(0,r.preloadImg)("images/2/Last-Quarter.gif"),(0,r.preloadImg)("images/2/New-Moon.gif"),(0,r.preloadImg)("images/2/First-Quarter.gif"),this.timing.totalScreens=1}async getData(e){super.getData(e);const t=e??this.weatherParameters,{sun:s,moon:r}=this.calcSunMoonData(t);this.data={sun:s,moon:r},this.setStatus(a.default.loaded),this.getDataCallback()}calcSunMoonData(e){const t=[SunCalc.getTimes(new Date,e.latitude,e.longitude),SunCalc.getTimes(n.DateTime.local().plus({days:1}).toJSDate(),e.latitude,e.longitude)],s=[];let r=n.DateTime.local().minus({days:1}),{phase:a}=SunCalc.getMoonIllumination(r.toJSDate()),i=0;do{const e=a;r=r.plus({days:1}),a=SunCalc.getMoonIllumination(r.toJSDate()).phase,e<.25&&a>=.25&&s.push(this.getMoonTransition(.25,"First",r)),e<.5&&a>=.5&&s.push(this.getMoonTransition(.5,"Full",r)),e<.75&&a>=.75&&s.push(this.getMoonTransition(.75,"Last",r)),e>a&&s.push(this.getMoonTransition(0,"New",r)),i+=1}while(i<=30&&s.length<4);return{sun:t,moon:s}}getMoonTransition(e,t,s,r=0){let n=s,{phase:a}=SunCalc.getMoonIllumination(n.toJSDate()),i=0;const o={hours:0===r?-1:0,minutes:1===r?1:0,seconds:2===r?-1:0,milliseconds:3===r?1:0};let l=(t,s)=>t=e;r%2==0&&(l=(t,s)=>t>e&&s<=e);do{const s=a;if(n=n.plus(o),a=SunCalc.getMoonIllumination(n.toJSDate()).phase,a>.9&&(a-=1),l(s,a)){if(r>=3)break;return this.getMoonTransition(e,t,n,r+1)}i+=1}while(i<1e3);return{phase:t,date:n}}async drawCanvas(){super.drawCanvas();const e=this.data,t=n.DateTime.local(),s=t.plus({days:1});this.elem.querySelector(".day-1").innerHTML=t.toLocaleString({weekday:"long"}),this.elem.querySelector(".day-2").innerHTML=s.toLocaleString({weekday:"long"}),this.elem.querySelector(".rise-1").innerHTML=n.DateTime.fromJSDate(e.sun[0].sunrise).toLocaleString(n.DateTime.TIME_SIMPLE).toLowerCase(),this.elem.querySelector(".rise-2").innerHTML=n.DateTime.fromJSDate(e.sun[1].sunrise).toLocaleString(n.DateTime.TIME_SIMPLE).toLowerCase(),this.elem.querySelector(".set-1").innerHTML=n.DateTime.fromJSDate(e.sun[0].sunset).toLocaleString(n.DateTime.TIME_SIMPLE).toLowerCase(),this.elem.querySelector(".set-2").innerHTML=n.DateTime.fromJSDate(e.sun[1].sunset).toLocaleString(n.DateTime.TIME_SIMPLE).toLowerCase();const r=e.moon.map((e=>{const t={},s=e.date.toLocaleString({month:"short",day:"numeric"});return t.date=s,t.type=e.phase,t.icon={type:"img",src:l.imageName(e.Phase)},this.fillTemplate("day",t)})),a=this.elem.querySelector(".moon .days");a.innerHTML="",a.append(...r),this.finishDraw()}static imageName(e){switch(e){case"Full":return"images/2/Full-Moon.gif";case"Last":return"images/2/Last-Quarter.gif";case"New":return"images/2/New-Moon.gif";default:return"images/2/First-Quarter.gif"}}async getSun(){return new Promise((e=>{this.data&&e(this.data),this.getDataCallbacks.push(e)}))}}const u=new l(7,"almanac");(0,o.registerDisplay)(u);const c=u.getSun.bind(u)},"./server/scripts/modules/currentweather.mjs":(e,t,s)=>{s.r(t),s.d(t,{default:()=>f});var r=s("./server/scripts/modules/status.mjs"),n=s("./server/scripts/modules/utils/image.mjs"),a=s("./server/scripts/modules/utils/fetch.mjs"),i=s("./server/scripts/modules/utils/calc.mjs"),o=s("./server/scripts/modules/utils/string.mjs"),l=s("./server/scripts/modules/icons.mjs"),u=s("./server/scripts/modules/weatherdisplay.mjs"),c=s("./server/scripts/modules/navigation.mjs"),d=s("./server/scripts/modules/utils/units.mjs");class m extends u.default{constructor(e,t){super(e,t,"Current Conditions",!0),this.backgroundImage=(0,n.loadImg)("images/BackGround1_1.png")}async getData(e){super.getData(e);const t=e??this.weatherParameters;let s,i,o=0;for(;!s&&o150&&(e.PressureDirection="R"),s<-150&&(e.PressureDirection="F"),e.Temperature=(0,d.celsiusToFahrenheit)(e.Temperature),e.TemperatureUnit="F",e.DewPoint=(0,d.celsiusToFahrenheit)(e.DewPoint),e.Ceiling=100*Math.round((0,d.metersToFeet)(e.Ceiling)/100),e.CeilingUnit="ft.",e.Visibility=(0,d.kilometersToMiles)(t.visibility.value/1e3),e.VisibilityUnit=" mi.",e.WindSpeed=(0,d.kphToMph)(e.WindSpeed),e.WindUnit="MPH",e.Pressure=(0,d.pascalToInHg)(e.Pressure).toFixed(2),e.HeatIndex=(0,d.celsiusToFahrenheit)(e.HeatIndex),e.WindChill=(0,d.celsiusToFahrenheit)(e.WindChill),e.WindGust=(0,d.kphToMph)(e.WindGust),e}async drawCanvas(){super.drawCanvas();const e={},t=this.parseData();e.temp=t.Temperature+String.fromCharCode(176);let s=t.observations.textDescription;s.length>15&&(s=this.shortConditions(s)),e.condition=s,e.wind=t.WindDirection.padEnd(3,"")+t.WindSpeed.toString().padStart(3," "),t.WindGust&&(e["wind-gusts"]=`Gusts to ${t.WindGust}`),e.location=(0,o.locationCleanup)(this.data.station.properties.name).substr(0,20),e.humidity=`${t.Humidity}%`,e.dewpoint=t.DewPoint+String.fromCharCode(176),e.ceiling=0===t.Ceiling?"Unlimited":t.Ceiling+t.CeilingUnit,e.visibility=t.Visibility+t.VisibilityUnit,e.pressure=`${t.Pressure} ${t.PressureDirection}`,t.observations.heatIndex.value&&t.HeatIndex!==t.Temperature?(e["heat-index-label"]="Heat Index:",e["heat-index"]=t.HeatIndex+String.fromCharCode(176)):t.observations.windChill.value&&""!==t.WindChill&&t.WindChill{this.data&&e(this.parseData()),this.getDataCallbacks.push((()=>e(this.parseData())))}))}static shortConditions(e){let t=e;return t=t.replace(/Light/g,"L"),t=t.replace(/Heavy/g,"H"),t=t.replace(/Partly/g,"P"),t=t.replace(/Mostly/g,"M"),t=t.replace(/Few/g,"F"),t=t.replace(/Thunderstorm/g,"T'storm"),t=t.replace(/ in /g,""),t=t.replace(/Vicinity/g,""),t=t.replace(/ and /g," "),t=t.replace(/Freezing Rain/g,"Frz Rn"),t=t.replace(/Freezing/g,"Frz"),t=t.replace(/Unknown Precip/g,""),t=t.replace(/L Snow Fog/g,"L Snw/Fog"),t=t.replace(/ with /g,"/"),t}}const h=new m(0,"current-weather");(0,c.registerDisplay)(h);const f=h.getCurrentWeather.bind(h)},"./server/scripts/modules/currentweatherscroll.mjs":(e,t,s)=>{s.r(t);var r=s("./server/scripts/modules/utils/string.mjs"),n=s("./server/scripts/modules/utils/elem.mjs"),a=s("./server/scripts/modules/currentweather.mjs"),i=s("./server/scripts/modules/navigation.mjs");const o=String.fromCharCode(176);let l,u=0;const c=()=>{const e=(0,i.currentDisplay)();e?.okToDrawCurrentConditions?(u=(u+1)%m.length,d()):"progress"===e?.elemId&&(u=0)},d=async()=>{const e=await(0,a.default)();e&&h(m[u](e))},m=[e=>`Conditions at ${(0,r.locationCleanup)(e.station.properties.name).substr(0,20)}`,e=>{let t=`Temp: ${e.Temperature}${o} ${e.TemperatureUnit}`;return e.observations.heatIndex.value?t+=` Heat Index: ${e.HeatIndex}${o} ${e.TemperatureUnit}`:e.observations.windChill.value&&(t+=` Wind Chill: ${e.WindChill}${o} ${e.TemperatureUnit}`),t},e=>`Humidity: ${e.Humidity}${o} ${e.TemperatureUnit} Dewpoint: ${e.DewPoint}${o} ${e.TemperatureUnit}`,e=>`Barometric Pressure: ${e.Pressure} ${e.PressureDirection}`,e=>{let t="";return t=e.WindSpeed>0?`Wind: ${e.WindDirection} ${e.WindSpeed} ${e.WindUnit}`:"Wind: Calm",e.WindGust>0&&(t+=` Gusts to ${e.WindGust}`),t},e=>`Visib: ${e.Visibility} ${e.VisibilityUnit} Ceiling: ${0===e.Ceiling?"Unlimited":`${e.Ceiling} ${e.CeilingUnit}`}`],h=e=>{(0,n.elemForEach)(".weather-display .scroll .fixed",(t=>{t.innerHTML=e}))};document.addEventListener("DOMContentLoaded",(()=>{l||(l=setInterval(c,4e3)),d()}))},"./server/scripts/modules/extendedforecast.mjs":(e,t,s)=>{s.r(t);var r=s("./server/scripts/modules/status.mjs"),n=s("./server/scripts/modules/utils/fetch.mjs"),a=s("./server/scripts/vendor/auto/luxon.mjs"),i=s("./server/scripts/modules/icons.mjs"),o=s("./server/scripts/modules/utils/image.mjs"),l=s("./server/scripts/modules/weatherdisplay.mjs"),u=s("./server/scripts/modules/navigation.mjs");class c extends l.default{constructor(e,t){super(e,t,"Extended Forecast",!0),this.timing.totalScreens=2}async getData(e){super.getData(e);const t=e??this.weatherParameters;let s;try{s=await(0,n.json)(t.forecast,{data:{units:"us"}})}catch(e){return console.error("Unable to get extended forecast"),console.error(e.status,e.responseJSON),void this.setStatus(r.default.failed)}this.data=c.parse(s.properties.periods),this.screenIndex=0,this.setStatus(r.default.loaded)}static parse(e){const t=[0,1,2,3,4,5,6].map((e=>a.DateTime.local().startOf("day").plus({days:e}).toLocaleString({weekday:"short"})));let s=0;const r=[];return e.forEach((e=>{r[s]||r.push({dayName:"",low:void 0,high:void 0,text:void 0,icon:void 0});const n=r[s];n.icon=(0,i.getWeatherIconFromIconLink)(e.icon),n.text=c.shortenExtendedForecastText(e.shortForecast),n.dayName=t[s],(0,o.preloadImg)(n.icon),e.isDaytime?(n.high=e.temperature,s+=1):n.low=e.temperature})),r}static shortenExtendedForecastText(e){const t=[[/ and /gi," "],[/Slight /gi,""],[/Chance /gi,""],[/Very /gi,""],[/Patchy /gi,""],[/Areas /gi,""],[/Dense /gi,""],[/Thunderstorm/g,"T'Storm"]].reduce(((e,[t,s])=>e.replace(t,s)),e);let s=t.split(" ");-1!==t.indexOf("then")&&(s=t.split(" then "),s=s[1].split(" "));let r=s[0].substr(0,10),n="";s[1]&&(r.endsWith(".")?r=r.replace(/\./,""):n=s[1].substr(0,10),"Blowing"===n&&(n=""));let a=r;return""!==n&&(a+=` ${n}`),a}async drawCanvas(){super.drawCanvas();const e=this.data.slice(0+3*this.screenIndex,3+3*this.screenIndex).map((e=>{const t={};t.date=e.dayName;const{low:s}=e;void 0!==s&&(t["value-lo"]=Math.round(s));const{high:r}=e;return t["value-hi"]=Math.round(r),t.condition=e.text,t.icon={type:"img",src:e.icon},this.fillTemplate("day",t)})),t=this.elem.querySelector(".day-container");t.innerHTML="",t.append(...e),this.finishDraw()}}(0,u.registerDisplay)(new c(6,"extended-forecast"))},"./server/scripts/modules/hourly.mjs":(e,t,s)=>{s.r(t);var r=s("./server/scripts/modules/status.mjs"),n=s("./server/scripts/vendor/auto/luxon.mjs"),a=s("./server/scripts/modules/utils/fetch.mjs"),i=s("./server/scripts/modules/utils/units.mjs"),o=s("./server/scripts/modules/icons.mjs"),l=s("./server/scripts/modules/utils/calc.mjs"),u=s("./server/scripts/modules/weatherdisplay.mjs"),c=s("./server/scripts/modules/navigation.mjs"),d=s("./server/scripts/modules/almanac.mjs");class m extends u.default{constructor(e,t,s){super(e,t,"Hourly Forecast",s),this.timing.baseDelay=20;this.timing.delay=[450];for(let e=0;e<4;e+=1)this.timing.delay.push(300);this.timing.delay.push(150)}async getData(e){if(!super.getData(e))return;let t;try{t=await(0,a.json)(e.forecastGridData)}catch(e){return console.error("Get hourly forecast failed"),console.error(e.status,e.responseJSON),void this.setStatus(r.default.failed)}this.data=await m.parseForecast(t.properties),this.setStatus(r.default.loaded),this.drawLongCanvas()}static async parseForecast(e){const t=m.expand(e.temperature.values),s=m.expand(e.apparentTemperature.values),r=m.expand(e.windSpeed.values),n=m.expand(e.windDirection.values),a=m.expand(e.skyCover.values),o=m.expand(e.weather.values),u=m.expand(e.iceAccumulation.values),c=m.expand(e.probabilityOfPrecipitation.values),d=m.expand(e.snowfallAmount.values),h=await m.determineIcon(a,o,u,c,d,r);return t.map(((e,a)=>({temperature:(0,i.celsiusToFahrenheit)(t[a]),apparentTemperature:(0,i.celsiusToFahrenheit)(s[a]),windSpeed:(0,i.kilometersToMiles)(r[a]),windDirection:(0,l.directionToNSEW)(n[a]),icon:h[a]})))}static async determineIcon(e,t,s,r,a,i){const l=n.DateTime.local().startOf("hour"),u=(await(0,d.default)()).sun,c=n.Interval.fromDateTimes(n.DateTime.fromJSDate(u[0].sunset),n.DateTime.fromJSDate(u[1].sunrise)),m=n.DateTime.fromJSDate(u[1].sunset);return e.map(((n,u)=>{const d=l.plus({hours:u}),h=c.contains(d)||d>m;return(0,o.getHourlyIcon)(e[u],t[u],s[u],r[u],a[u],i[u],h)}))}static expand(e){const t=n.DateTime.utc().startOf("hour").toMillis(),s=[];return e.forEach((e=>{let r=Date.parse(e.validTime.substr(0,e.validTime.indexOf("/")));const a=r+n.Duration.fromISO(e.validTime.substr(e.validTime.indexOf("/")+1)).shiftTo("milliseconds").values.milliseconds;do{r>=t&&s.length<24&&s.push(e.value),r+=36e5}while(r{const r={},n=t.plus({hours:s}).toLocaleString({weekday:"short",hour:"numeric"});r.hour=n;const a=Math.round(e.temperature).toString().padStart(3),i=Math.round(e.apparentTemperature).toString().padStart(3);r.temp=a,a!==i&&(r.like=i);let o="Calm";if(e.windSpeed>0){const t=Math.round(e.windSpeed).toString();o=e.windDirection+Array(6-e.windDirection.length-t.length).join(" ")+t}return r.wind=o,r.icon={type:"img",src:e.icon},this.fillTemplate("hourly-row",r)}));e.append(...s)}drawCanvas(){super.drawCanvas(),this.finishDraw()}showCanvas(){this.drawCanvas(),super.showCanvas()}screenIndexChange(){this.baseCountChange(this.navBaseCount)}baseCountChange(e){let t=Math.min(this.elem.querySelector(".hourly-lines").getBoundingClientRect().height-289,e-150);t<0&&(t=0),this.elem.querySelector(".main").scrollTo(0,t)}static getTravelCitiesDayName(e){return e.reduce(((e,t)=>{if(t&&""===e){return n.DateTime.local().plus({days:t.today?0:1}).toLocaleString({weekday:"long"})}return e}),"")}}(0,c.registerDisplay)(new m(2,"hourly"))},"./server/scripts/modules/icons.mjs":(e,t,s)=>{s.r(t),s.d(t,{getHourlyIcon:()=>a,getWeatherIconFromIconLink:()=>n,getWeatherRegionalIconFromIconLink:()=>r});const r=(e,t)=>{const s=t??e.indexOf("/night/")>=0,r=e=>`images/r/${e}`;let n=e.toLowerCase().match(/[^/]+$/)[0].match(/(.*?)[,?&.]/)[1];const a=+(e.match(/,(\d{2,3})/)??[0,100])[1];if("dualimage"===n){const t=e.match(/&j=(.*)&/);[,n]=t}switch(n+(s?"-n":"")){case"skc":case"hot":case"haze":return r("Sunny.gif");case"skc-n":case"nskc":case"nskc-n":case"cold-n":return r("Clear-1992.gif");case"bkn":return r("Mostly-Cloudy-1994-2.gif");case"bkn-n":case"few-n":case"nfew-n":case"nfew":return r("Partly-Clear-1994-2.gif");case"sct":case"few":return r("Partly-Cloudy.gif");case"sct-n":case"nsct":case"nsct-n":return r("Mostly-Clear.gif");case"ovc":case"ovc-n":return r("Cloudy.gif");case"fog":case"fog-n":return r("Fog.gif");case"rain_sleet":case"sleet":case"sleet-n":return r("Sleet.gif");case"rain_showers":case"rain_showers_high":return r("Scattered-Showers-1994-2.gif");case"rain_showers-n":case"rain_showers_high-n":return r("Scattered-Showers-Night-1994-2.gif");case"rain":case"rain-n":return r("Rain-1992.gif");case"snow":case"snow-n":return r(a>50?"Heavy-Snow-1994-2.gif":"Light-Snow.gif");case"rain_snow":return r("Rain-Snow-1992.gif");case"snow_fzra":case"snow_fzra-n":return r("Freezing-Rain-Snow-1992.gif");case"fzra":case"fzra-n":return r("Freezing-Rain-1992.gif");case"snow_sleet":case"snow_sleet-n":return r("Snow and Sleet.gif");case"tsra_sct":case"tsra":return r("Scattered-Tstorms-1994-2.gif");case"tsra_sct-n":case"tsra-n":return r("Scattered-Tstorms-Night-1994-2.gif");case"tsra_hi":case"tsra_hi-n":case"hurricane":case"tropical_storm":return r("Thunderstorm.gif");case"wind_few":case"wind_sct":case"wind_bkn":case"wind_ovc":return r("Wind.gif");case"wind_skc":return r("Sunny-Wind-1994.gif");case"wind_skc-n":case"wind_sct-n":return r("Clear-Wind-1994.gif");case"blizzard":return r("Blowing Snow.gif");case"cold":return r("cold.gif");default:return console.log(`Unable to locate regional icon for ${n} ${e} ${s}`),!1}},n=(e,t)=>{if(!e)return!1;const s=e=>`images/${e}`,r=t??e.indexOf("/night/")>=0;let n=e.toLowerCase().match(/[^/]+$/)[0].match(/(.*?)[,?&.]/)[1];const a=+(e.match(/,(\d{2,3})/)??[0,100])[1];if("dualimage"===n){const t=e.match(/&j=(.*)&/);[,n]=t}switch(n+(r?"-n":"")){case"skc":case"hot":case"haze":case"cold":return s("CC_Clear1.gif");case"skc-n":case"nskc":case"nskc-n":case"cold-n":return s("CC_Clear0.gif");case"sct":case"few":case"bkn":return s("CC_PartlyCloudy1.gif");case"bkn-n":case"few-n":case"nfew-n":case"nfew":case"sct-n":case"nsct":case"nsct-n":return s("CC_PartlyCloudy0.gif");case"ovc":case"novc":case"ovc-n":return s("CC_Cloudy.gif");case"fog":case"fog-n":return s("CC_Fog.gif");case"rain_sleet":return s("Sleet.gif");case"rain_showers":case"rain_showers_high":case"rain_showers-n":case"rain_showers_high-n":return s("CC_Showers.gif");case"rain":case"rain-n":return s("CC_Rain.gif");case"snow":case"snow-n":return s(a>50?"CC_Snow.gif":"CC_SnowShowers.gif");case"rain_snow":return s("CC_RainSnow.gif");case"snow_fzra":case"snow_fzra-n":case"fzra":case"fzra-n":return s("CC_FreezingRain.gif");case"snow_sleet":return s("Snow-Sleet.gif");case"tsra_sct":case"tsra":return s("EF_ScatTstorms.gif");case"tsra_sct-n":case"tsra-n":case"tsra_hi":case"tsra_hi-n":case"hurricane":case"tropical_storm":return s("CC_TStorm.gif");case"wind_few":case"wind_sct":case"wind_bkn":case"wind_ovc":case"wind_skc":case"wind_skc-n":case"wind_sct-n":return s("CC_Windy.gif");case"blizzard":return s("Blowing-Snow.gif");default:return console.log(`Unable to locate icon for ${n} ${e} ${r}`),!1}},a=(e,t,s,r,n,a,i=!1)=>{const o=e=>`images/r/${e}`;let l=!1,u=!1,c=!1,d=!1,m=!1;return t.forEach((e=>{e.weather&&(e.weather.toLowerCase().includes("thunder")&&(l=!0),e.weather.toLowerCase().includes("snow")&&(u=!0),e.weather.toLowerCase().includes("ice")&&(c=!0),e.weather.toLowerCase().includes("fog")&&(d=!0),e.weather.toLowerCase().includes("wind")&&(m=!0))})),o(s>0||c?"Freezing-Rain-1992.gif":n>10?a>30||m?"Blowing Snow.gif":"Heavy-Snow-1994.gif":(n>0||u)&&l?"ThunderSnow.gif":n>0||u?"Light-Snow.gif":l?"Thunderstorm.gif":r>70?"Rain-1992.gif":r>50?"Shower.gif":r>30?i?"Scattered-Showers-Night.gif":"Scattered-Showers-1994.gif":d?"Fog.gif":e>70?"Cloudy.gif":e>50?i?"Partly-Clear-1994.gif":"Mostly-Cloudy-1994.gif":e>30?i?"Mostly-Clear.gif":"Partly-Cloudy.gif":i?"Clear-1992.gif":"Sunny.gif")}},"./server/scripts/modules/latestobservations.mjs":(e,t,s)=>{s.r(t);var r=s("./server/scripts/modules/utils/calc.mjs"),n=s("./server/scripts/modules/utils/fetch.mjs"),a=s("./server/scripts/modules/status.mjs"),i=s("./server/scripts/modules/utils/string.mjs"),o=s("./server/scripts/modules/utils/units.mjs"),l=s("./server/scripts/modules/weatherdisplay.mjs"),u=s("./server/scripts/modules/navigation.mjs");class c extends l.default{constructor(e,t){super(e,t,"Latest Observations",!0),this.MaximumRegionalStations=7}async getData(e){super.getData(e);const t=e??this.weatherParameters,s=Object.keys(StationInfo).map((e=>{const s=StationInfo[e],n=(0,r.distance)(s.lat,s.lon,t.latitude,t.longitude);return{...s,distance:n}})).sort(((e,t)=>e.distance-t.distance)).slice(0,30),i=(await Promise.all(s.map((async e=>{try{const t=await(0,n.json)(`https://api.weather.gov/stations/${e.id}/observations/latest`);return null!==t.properties.temperature.value&&""!==t.properties.textDescription&&null!==t.properties.windSpeed.value&&{...t.properties,StationId:e.id,city:e.city}}catch(t){return console.log(`Unable to get latest observations for ${e.id}`),!1}})))).filter((e=>e));this.data=i.slice(0,this.MaximumRegionalStations),this.data.length<1?this.setStatus(a.default.noData):this.setStatus(a.default.loaded)}async drawCanvas(){super.drawCanvas();const e=this.data.sort(((e,t)=>e.Name{const t=(0,r.directionToNSEW)(e.windDirection.value),s=Math.round((0,o.celsiusToFahrenheit)(e.temperature.value)),n=Math.round((0,o.kphToMph)(e.windSpeed.value)),a={};return a.location=(0,i.locationCleanup)(e.city).substr(0,14),a.temp=s,a.weather=c.shortenCurrentConditions(e.textDescription).substr(0,9),a.wind=n>0?t+Array(6-t.length-n.toString().length).join(" ")+n.toString():"NA"===n?"NA":"Calm",this.fillTemplate("observation-row",a)})),s=this.elem.querySelector(".observation-lines");s.innerHTML="",s.append(...t),this.finishDraw()}static shortenCurrentConditions(e){let t=e;return t=t.replace(/Light/,"L"),t=t.replace(/Heavy/,"H"),t=t.replace(/Partly/,"P"),t=t.replace(/Mostly/,"M"),t=t.replace(/Few/,"F"),t=t.replace(/Thunderstorm/,"T'storm"),t=t.replace(/ in /,""),t=t.replace(/Vicinity/,""),t=t.replace(/ and /," "),t=t.replace(/Freezing Rain/,"Frz Rn"),t=t.replace(/Freezing/,"Frz"),t=t.replace(/Unknown Precip/,""),t=t.replace(/L Snow Fog/,"L Snw/Fog"),t=t.replace(/ with /,"/"),t}}(0,u.registerDisplay)(new c(1,"latest-observations"))},"./server/scripts/modules/localforecast.mjs":(e,t,s)=>{s.r(t);var r=s("./server/scripts/modules/status.mjs"),n=s("./server/scripts/modules/utils/fetch.mjs"),a=s("./server/scripts/modules/weatherdisplay.mjs"),i=s("./server/scripts/modules/navigation.mjs");class o extends a.default{constructor(e,t){super(e,t,"Local Forecast",!0),this.timing.baseDelay=5e3}async getData(e){super.getData(e);const t=e??this.weatherParameters,s=await this.getRawData(t);if(!s)return void this.setStatus(r.default.failed);const n=o.parse(s);this.screenTexts=n.map((e=>{let t=`${e.DayName.toUpperCase()}...`;return t+=e.Text.toUpperCase().replace("..."," "),t}));const a=this.screenTexts.map((e=>this.fillTemplate("forecast",{text:e}))),i=this.elem.querySelector(".forecasts");i.innerHTML="",i.append(...a),this.pageHeight=i.parentNode.getBoundingClientRect().height,a.forEach((e=>{const t=Math.ceil(e.scrollHeight/this.pageHeight)*this.pageHeight;e.style.height=`${t}px`})),this.timing.totalScreens=i.scrollHeight/this.pageHeight,this.calcNavTiming(),this.setStatus(r.default.loaded)}async getRawData(e){try{return await(0,n.json)(e.forecast,{data:{units:"us"}})}catch(t){return console.error(`GetWeatherForecast failed: ${e.forecast}`),console.error(t.status,t.responseJSON),this.setStatus(r.default.failed),!1}}async drawCanvas(){super.drawCanvas();const e=-this.screenIndex*this.pageHeight;this.elem.querySelector(".forecasts").style.top=`${e}px`,this.finishDraw()}static parse(e){return e.properties.periods.slice(0,6).map((e=>({DayName:e.name.toUpperCase(),Text:e.detailedForecast})))}}(0,i.registerDisplay)(new o(5,"local-forecast"))},"./server/scripts/modules/navigation.mjs":(e,t,s)=>{s.r(t),s.d(t,{currentDisplay:()=>M,displayNavMessage:()=>b,getDisplay:()=>k,isPlaying:()=>S,latLonReceived:()=>_,message:()=>p,msg:()=>T,registerDisplay:()=>O,registerProgress:()=>j,registerRefreshData:()=>B,resetStatuses:()=>N,resize:()=>E,stopAutoRefreshTimer:()=>P,updateStatus:()=>y});var r=s("./server/scripts/modules/utils/nosleep.mjs"),n=s("./server/scripts/modules/status.mjs"),a=s("./server/scripts/modules/utils/calc.mjs"),i=s("./server/scripts/modules/utils/fetch.mjs"),o=s("./server/scripts/modules/utils/weather.mjs");document.addEventListener("DOMContentLoaded",(()=>{g()}));const l=[];let u,c=!1;const d={},m=6e5;let h=null,f=0;const g=async()=>{window.addEventListener("resize",E);const e=localStorage.getItem("TwcAutoRefresh");document.getElementById("chkAutoRefresh").checked=!e||"true"===e,document.getElementById("chkAutoRefresh").addEventListener("change",V),F()},p=e=>{if(e.type)if("navButton"===e.type)L(e.message);else console.error(`Unknown event ${e.type}`)},y=e=>{e.id<0||u&&(u.drawCanvas(l,v()),S()&&0===e.id&&e.status===n.default.loaded&&C(T.command.firstFrame),v()l.reduce(((e,t)=>t.status!==n.default.loading?e+1:e),0),w=()=>{l.forEach((e=>e.hideCanvas()))},S=()=>c,T={response:{previous:Symbol("previous"),inProgress:Symbol("inProgress"),next:Symbol("next")},command:{firstFrame:Symbol("firstFrame"),previousFrame:Symbol("previousFrame"),nextFrame:Symbol("nextFrame"),lastFrame:Symbol("lastFrame")}},b=e=>{e.type===T.response.previous&&I(-1),e.type===T.response.next&&I(1)},C=e=>{const t=M();if(u.hideCanvas(),t)e===T.command.nextFrame&&M().navNext(),e===T.command.previousFrame&&M().navPrev();else{let e,t=0;do{l[t].status===n.default.loaded&&(e=l[t]),t+=1}while(!e&&t{const t=l.length,s=D();let r;for(let i=0;i0&&i.showCanvas(T.command.firstFrame)},D=()=>l.findIndex((e=>e.isActive())),M=()=>l[D()],x=e=>{c=e;const t=document.getElementById("NavigatePlay");localStorage.setItem("TwcPlay",c),c?((0,r.default)(!0),t.title="Pause",t.src="images/nav/ic_pause_white_24dp_1x.png"):((0,r.default)(!1),t.title="Play",t.src="images/nav/ic_play_arrow_white_24dp_1x.png"),u&&c&&!M()&&C(T.command.firstFrame)},L=e=>{switch(e){case"play":x(!0);break;case"playToggle":x(!c);break;case"stop":x(!1);break;case"next":x(!1),C(T.command.nextFrame);break;case"previous":x(!1),C(T.command.previousFrame);break;case"menu":x(!1),u.showCanvas(),w();break;default:console.error(`Unknown navButton ${e}`)}},k=e=>l[e],E=()=>{const e=window.innerWidth/640,t=window.innerHeight/480,s=Math.min(e,t);s<1||document.fullscreenElement?document.getElementById("container").style.zoom=s:document.getElementById("container").style.zoom=1},N=()=>{l.forEach((e=>{e.status=n.default.loading}))},O=e=>{l[e.navId]=e,F()},F=()=>{const e=document.getElementById("enabledDisplays");if(!e)return;const t=l.map((e=>e.generateCheckbox())).filter((e=>e));e.innerHTML="",e.append(...t)},j=e=>{u=e},$=e=>{document.getElementById("spanCity").innerHTML=`${e.city}, `,document.getElementById("spanState").innerHTML=e.state,document.getElementById("spanStationId").innerHTML=e.stationId,document.getElementById("spanRadarId").innerHTML=e.radarId,document.getElementById("spanZoneId").innerHTML=e.zoneId},V=e=>{const{checked:t}=e.target;t?A():P(),localStorage.setItem("TwcAutoRefresh",t)},H=e=>{e?(document.getElementById("spanLastRefresh").innerHTML=e.toLocaleString("en-US",{weekday:"short",month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}),document.getElementById("chkAutoRefresh").checked&&A()):document.getElementById("spanLastRefresh").innerHTML="(none)"},_=e=>{(async e=>{const t=await(0,o.getPoint)(e.lat,e.lon),s=await(0,i.json)(t.properties.observationStations),r=s.features[0].properties.stationIdentifier;let{city:n}=t.properties.relativeLocation.properties;r in StationInfo&&(n=StationInfo[r].city,[n]=n.split("/")),d.latitude=e.lat,d.longitude=e.lon,d.zoneId=t.properties.forecastZone.substr(-6),d.radarId=t.properties.radarStation.substr(-3),d.stationId=r,d.weatherOffice=t.properties.cwa,d.city=n,d.state=t.properties.relativeLocation.properties.state,d.timeZone=t.properties.relativeLocation.properties.timeZone,d.forecast=t.properties.forecast,d.forecastGridData=t.properties.forecastGridData,d.stations=s.features,$(d),w(),document.getElementById("loading").style.display="none",u&&(await u.drawCanvas(),u.showCanvas()),l.forEach((e=>e.getData(d)))})(e),H(null)},A=()=>{if(h)return;f=0;const e=()=>{f+=500;let e=m-f;e<0&&(e=0);const t=new Date(e);document.getElementById("spanRefreshCountDown").innerHTML=`${t.getMinutes()<10?`0${t.getMinutes()}`:t.getMinutes()}:${t.getSeconds()<10?`0${t.getSeconds()}`:t.getSeconds()}`,f>=m&&!S()&&z()};h=window.setInterval(e,500),e()},P=()=>{h&&(window.clearInterval(h),document.getElementById("spanRefreshCountDown").innerHTML="--:--",h=null)},R=()=>f>=m&&(z(),!0),z=()=>{z.callback&&z.callback()},B=e=>{z.callback=e}},"./server/scripts/modules/progress.mjs":(e,t,s)=>{s.r(t);var r=s("./server/scripts/modules/utils/image.mjs"),n=s("./server/scripts/modules/status.mjs"),a=s("./server/scripts/modules/weatherdisplay.mjs"),i=s("./server/scripts/modules/navigation.mjs");class o extends a.default{constructor(e,t){super(e,t,"",!1),this.backgroundImage=(0,r.loadImg)("images/BackGround1_1.png"),this.timing=!1,document.addEventListener("DOMContentLoaded",(()=>{this.version=document.getElementById("version").innerHTML,this.elem.querySelector(".container").addEventListener("click",this.lineClick.bind(this))})),this.okToDrawCurrentConditions=!1}async drawCanvas(e,t){if(super.drawCanvas(),this.progressCover||(this.progressCover=this.elem.querySelector(".scroll .cover")),!e)return;const s=e.map(((e,t)=>{const s={};let r;switch(s.name=e.name,e.status){case n.default.loading:r="loading";break;case n.default.loaded:r="press-here";break;case n.default.failed:r="failed";break;case n.default.noData:r="no-data";break;case n.default.disabled:r="disabled"}const a=this.fillTemplate("item",s);if(!a)return!1;const i=a.querySelector(".links");return i.classList.remove("loading"),i.classList.add(r),i.dataset.index=t,a})).filter((e=>e)),r=this.elem.querySelector(".container");r.innerHTML="",r.append(...s),this.finishDraw();const a=t/e.length;this.progressCover.style.width=100*(1-a)+"%",a<1?this.progressCover.parentNode.classList.add("show"):setTimeout((()=>this.progressCover.parentNode.classList.remove("show")),1e3)}lineClick(e){const t=e.target?.parentNode?.dataset?.index;if(void 0===t)return;const s=+t;(0,i.message)("navButton");const r=(0,i.getDisplay)(s);r&&r.status===n.default.loaded&&(r.showCanvas(i.msg.command.firstFrame),this.elem.classList.remove("show"))}}const l=new o(-1,"progress");(0,i.registerProgress)(l)},"./server/scripts/modules/radar.mjs":(e,t,s)=>{s.r(t);var r=s("./server/scripts/modules/status.mjs"),n=s("./server/scripts/vendor/auto/luxon.mjs"),a=s("./server/scripts/modules/utils/image.mjs"),i=s("./server/scripts/modules/utils/fetch.mjs"),o=s("./server/scripts/modules/utils/cors.mjs"),l=s("./server/scripts/modules/weatherdisplay.mjs"),u=s("./server/scripts/modules/navigation.mjs");class c extends l.default{constructor(e,t){super(e,t,"Local Radar",!0),this.okToDrawCurrentConditions=!1,this.okToDrawCurrentDateTime=!1,this.dopplerRadarImageMax=6,this.timing.baseDelay=350,this.timing.delay=[{time:4,si:5},{time:1,si:0},{time:1,si:1},{time:1,si:2},{time:1,si:3},{time:1,si:4},{time:4,si:5},{time:1,si:0},{time:1,si:1},{time:1,si:2},{time:1,si:3},{time:1,si:4},{time:4,si:5},{time:1,si:0},{time:1,si:1},{time:1,si:2},{time:1,si:3},{time:1,si:4},{time:12,si:5}]}async getData(e){super.getData(e);const t=e??this.weatherParameters;if("AK"===t.state||"HI"===t.state)return void this.setStatus(r.default.noData);let s="images/4000RadarMap2.jpg";"HI"===t.State&&(s="images/HawaiiRadarMap2.png"),this.baseMap=await(0,a.loadImg)(s);const l=[];let u=n.DateTime.utc().minus({days:1}).startOf("day");for(;u<=n.DateTime.utc().startOf("day");)l.push(`https://mesonet.agron.iastate.edu/archive/data/${u.toFormat("yyyy/LL/dd")}/GIS/uscomp/`),u=u.plus({days:1});const d=(await Promise.all(l.map((async e=>{try{return await(0,i.text)(e,{cors:!0})}catch(e){return console.log("Unable to get list of radars"),console.error(e),this.setStatus(r.default.failed),!1}})))).filter((e=>e)).map(((e,t)=>{const s=(new DOMParser).parseFromString(e,"text/html"),r=s.createElement("base");r.href=l[t],s.head.append(r);const n=s.getElementsByTagName("a"),a=[];return Array.from(n).forEach((e=>{e.innerHTML?.includes(".png")&&e.innerHTML?.includes("n0r_")&&a.push(e.href)})),a})).flat(),m=d.sort(((e,t)=>Date(e){const t=document.createElement("canvas");t.width=640,t.height=367;const s=t.getContext("2d");s.imageSmoothingEnabled=!1;const r=await fetch((0,o.rewriteUrl)(e));if(!r.ok)throw new Error(`Unable to fetch radar error ${r.status} ${r.statusText} from ${r.url}`);const i=await r.blob(),l=e.match(/_(\d{4})(\d\d)(\d\d)(\d\d)(\d\d)\./);let u;if(l){const[,e,t,s,r,a]=l;u=n.DateTime.fromObject({year:e,month:t,day:s,hour:r,minute:a},{zone:"UTC"}).setZone()}else u=n.DateTime.fromHTTP(r.headers.get("last-modified")).setZone();const d=await(0,a.loadImg)(i);v.clearRect(0,0,g,1600),v.drawImage(d,0,0,g,1600),s.drawImage(await this.baseMap,p.x,p.y,480,276,0,0,640,367);const m=document.createElement("canvas");m.width=640,m.height=367;const h=m.getContext("2d",{willReadFrequently:!0});h.imageSmoothingEnabled=!1,h.drawImage(y,S,T,240,163.1,0,0,640,367),c.removeDopplerRadarImageNoise(h),c.mergeDopplerRadarImage(s,h);const f=this.fillTemplate("frame",{map:{type:"img",src:t.toDataURL()}});return{canvas:t,time:u,elem:f}}))),C=this.elem.querySelector(".scroll-area");C.innerHTML="",C.append(...b.map((e=>e.elem))),this.timing.totalScreens=b.length,this.data=b.map((e=>e.canvas)),this.times=b.map((e=>e.time)),this.setStatus(r.default.loaded)}async drawCanvas(){super.drawCanvas();const e=this.times[this.screenIndex].toLocaleString(n.DateTime.TIME_SIMPLE),t=e.length>=8?e:` ${e}`;this.elem.querySelector(".header .right .time").innerHTML=t,this.elem.querySelector(".scroll-area").style.top=371*-this.screenIndex+"px",this.finishDraw()}static getXYFromLatitudeLongitudeMap(e,t,s){let r=0,n=0;return r=55.2*(51.75-e.latitude),r-=s,r>3200-2*s?r=3200-2*s:r<0&&(r=0),n=41.775*(-130.37-e.longitude)*-1,n-=t,n>5100-2*t?n=5100-2*t:n<0&&(n=0),{x:2*n,y:2*r}}static getXYFromLatitudeLongitudeDoppler(e,t,s){let r=0,n=0;return r=61.4481*(51-e.latitude),r-=s,r>6e3-2*s?r=6e3-2*s:r<0&&(r=0),n=42.1768*(-129.138-e.longitude)*-1,n-=t,n>2800-2*t?n=2800-2*t:n<0&&(n=0),{x:2*n,y:2*r}}static removeDopplerRadarImageNoise(e){const t=e.getImageData(0,0,e.canvas.width,e.canvas.height);for(let e=0;e{s.r(t);var r=s("./server/scripts/modules/status.mjs"),n=s("./server/scripts/modules/utils/calc.mjs"),a=s("./server/scripts/modules/utils/fetch.mjs"),i=s("./server/scripts/modules/utils/units.mjs"),o=s("./server/scripts/modules/icons.mjs"),l=s("./server/scripts/modules/utils/image.mjs"),u=s("./server/scripts/vendor/auto/luxon.mjs"),c=s("./server/scripts/modules/weatherdisplay.mjs"),d=s("./server/scripts/modules/navigation.mjs");class m extends c.default{constructor(e,t){super(e,t,"Regional Forecast",!0),this.timing.totalScreens=3}async getData(e){super.getData(e);const t=e??this.weatherParameters;let s="images/Basemap2.png";"HI"===t.state?s="images/HawaiiRadarMap4.png":"AK"===t.state&&(s="images/AlaskaRadarMap6.png"),this.elem.querySelector(".map img").src=s;const u={x:240,y:117},c=m.getXYFromLatitudeLongitude(t.latitude,t.longitude,u.x,u.y,t.state),d=m.getMinMaxLatitudeLongitude(c.x,c.y,u.x,u.y,t.state);let h=2.5;"HI"===t.state&&(h=1);const f=Object.values(StationInfo).map((e=>({...e,targetDistance:h}))),g=[...RegionalCities,...f],p=[];g.forEach((e=>{if(e.lat>d.minLat&&e.latd.minLon&&e.lon{const a=(0,n.distance)(e.lon,e.lat,r.lon,r.lat);return s&&a>=t}),!0)&&p.push(e)}}));const y=(await Promise.all(p.map((async e=>{try{if(!e.point)throw new Error("No pre-loaded point");const s=m.getRegionalObservation(e.point,e),r=await(0,a.json)(`https://api.weather.gov/gridpoints/${e.point.wfo}/${e.point.x},${e.point.y}/forecast`),n=m.getXYForCity(e,d.maxLat,d.minLon,t.state),u=await s,c={daytime:!!u.icon.match(/\/day\//),temperature:(0,i.celsiusToFahrenheit)(u.temperature.value),name:m.formatCity(e.city),icon:u.icon,x:n.x,y:n.y};return(0,l.preloadImg)((0,o.getWeatherRegionalIconFromIconLink)(c.icon,!c.daytime)),[c,m.buildForecast(r.properties.periods[1],e,n),m.buildForecast(r.properties.periods[2],e,n)]}catch(t){return console.log(`No regional forecast data for '${e.name??e.city}'`),console.log(t),!1}})))).filter((e=>e));0!==y.length?(this.data={regionalData:y,offsetXY:u,sourceXY:c},this.setStatus(r.default.loaded)):this.setStatus(r.default.noData)}static buildForecast(e,t,s){return{daytime:e.isDaytime,temperature:e.temperature||0,name:m.formatCity(t.city),icon:e.icon,x:s.x,y:s.y,time:e.startTime}}static async getRegionalObservation(e,t){try{const e=(await(0,a.json)(`https://api.weather.gov/gridpoints/${t.point.wfo}/${t.point.x},${t.point.y}/stations`)).features[0].id,s=await(0,a.json)(`${e}/observations/latest`);return!!s.properties.icon&&((0,l.preloadImg)((0,o.getWeatherRegionalIconFromIconLink)(s.properties.icon,!s.properties.daytime)),s.properties)}catch(e){return console.log(`Unable to get regional observations for ${t.Name??t.city}`),console.error(e.status,e.responseJSON),!1}}static getXYFromLatitudeLongitude(e,t,s,r,n){if("AK"===n)return m.getXYFromLatitudeLongitudeAK(e,t,s,r);if("HI"===n)return m.getXYFromLatitudeLongitudeHI(e,t,s,r);let a=0,i=0;return a=55.2*(50.5-e),a-=r,a>1600-2*r?a=1600-2*r:a<0&&(a=0),i=41.775*(-127.5-t)*-1,i-=s,i>2550-2*s?i=2550-2*s:i<0&&(i=0),{x:i,y:a}}static getXYFromLatitudeLongitudeAK(e,t,s,r){let n=0,a=0;return n=56*(73-e),n-=r,n>1142-2*r?n=1142-2*r:n<0&&(n=0),a=25*(-175-t)*-1,a-=s,a>1200-2*s?a=1200-2*s:a<0&&(a=0),{x:a,y:n}}static getXYFromLatitudeLongitudeHI(e,t,s,r){let n=0,a=0;return n=55.2*(25-e),n-=r,n>571-2*r?n=571-2*r:n<0&&(n=0),a=41.775*(-164.5-t)*-1,a-=s,a>600-2*s?a=600-2*s:a<0&&(a=0),{x:a,y:n}}static getMinMaxLatitudeLongitude(e,t,s,r,n){if("AK"===n)return m.getMinMaxLatitudeLongitudeAK(e,t,s,r);if("HI"===n)return m.getMinMaxLatitudeLongitudeHI(e,t,s,r);return{minLat:-1*((t+2*r)/55.2-50.5),maxLat:-1*(t/55.2-50.5),minLon:-1*(-1*e/41.775+127.5),maxLon:-1*(-1*(e+2*s)/41.775+127.5)}}static getMinMaxLatitudeLongitudeAK(e,t,s,r){return{minLat:-1*((t+2*r)/56-73),maxLat:-1*(t/56-73),minLon:-1*(-1*e/25+175),maxLon:-1*(-1*(e+2*s)/25+175)}}static getMinMaxLatitudeLongitudeHI(e,t,s,r){return{minLat:-1*((t+2*r)/55.2-25),maxLat:-1*(t/55.2-25),minLon:-1*(-1*e/41.775+164.5),maxLon:-1*(-1*(e+2*s)/41.775+164.5)}}static getXYForCity(e,t,s,r){"AK"===r&&m.getXYForCityAK(e,t,s),"HI"===r&&m.getXYForCityHI(e,t,s);let n=57*(e.lon-s),a=70*(t-e.lat);return a<30&&(a=30),a>282&&(a=282),n<40&&(n=40),n>580&&(n=580),{x:n,y:a}}static getXYForCityAK(e,t,s){let r=37*(e.lon-s),n=70*(t-e.lat);return n<30&&(n=30),n>282&&(n=282),r<40&&(r=40),r>580&&(r=580),{x:r,y:n}}static getXYForCityHI(e,t,s){let r=57*(e.lon-s),n=70*(t-e.lat);return n<30&&(n=30),n>282&&(n=282),r<40&&(r=40),r>580&&(r=580),{x:r,y:n}}static formatCity(e){return e.match(/[^-;/\\,]*/)[0].substr(0,12)}drawCanvas(){super.drawCanvas();const{regionalData:e,sourceXY:t,offsetXY:s}=this.data,r=this.elem.querySelector(".title.dual .top"),n=this.elem.querySelector(".title.dual .bottom");if(0===this.screenIndex)r.innerHTML="Regional",n.innerHTML="Observations";else{const t=u.DateTime.fromISO(e[0][this.screenIndex].time).toLocaleString({weekday:"long"});r.innerHTML="Forecast for",e[0][this.screenIndex].daytime?n.innerHTML=t:n.innerHTML=`${t} Night`}const a=640/(2*s.x),i=this.elem.querySelector(".map");i.style.zoom=a,i.style.top=`-${t.y}px`,i.style.left=`-${t.x}px`;const l=e.map((e=>{const t={},s=e[this.screenIndex];t.icon={type:"img",src:(0,o.getWeatherRegionalIconFromIconLink)(s.icon,!s.daytime)},t.city=s.name;const{temperature:r}=s;t.temp=r;const n=this.fillTemplate("location",t);return n.style.left=`${s.x}px`,n.style.top=`${s.y}px`,n})),c=this.elem.querySelector(".location-container");c.innerHTML="",c.append(...l),this.finishDraw()}}(0,d.registerDisplay)(new m(4,"regional-forecast"))},"./server/scripts/modules/status.mjs":(e,t,s)=>{s.r(t),s.d(t,{default:()=>r});const r={loading:Symbol("loading"),loaded:Symbol("loaded"),failed:Symbol("failed"),noData:Symbol("noData"),disabled:Symbol("disabled")}},"./server/scripts/modules/travelforecast.mjs":(e,t,s)=>{s.r(t);var r=s("./server/scripts/modules/status.mjs"),n=s("./server/scripts/modules/utils/fetch.mjs"),a=s("./server/scripts/modules/icons.mjs"),i=s("./server/scripts/vendor/auto/luxon.mjs"),o=s("./server/scripts/modules/weatherdisplay.mjs"),l=s("./server/scripts/modules/navigation.mjs");class u extends o.default{constructor(e,t,s){super(e,t,"Travel Forecast",s),this.timing.baseDelay=20;const r=TravelCities.length/4,n=Math.floor(r)-2,a=n%1;this.timing.delay=[450];for(let e=0;e{try{if(!e.point)throw new Error("No pre-loaded point");const t=await(0,n.json)(`https://api.weather.gov/gridpoints/${e.point.wfo}/${e.point.x},${e.point.y}/forecast`),s=t.properties.periods[0].isDaytime?0:1;return{today:0===s,high:t.properties.periods[s].temperature,low:t.properties.periods[s+1].temperature,name:e.Name,icon:(0,a.getWeatherRegionalIconFromIconLink)(t.properties.periods[s].icon)}}catch(t){return console.error(`GetTravelWeather for ${e.Name} failed`),console.error(t.status,t.responseJSON),{name:e.Name,error:!0}}})),t=await Promise.all(e);this.data=t;this.data.reduce(((e,t)=>e||t.high),!1)?(this.setStatus(r.default.loaded),this.drawLongCanvas()):this.setStatus(r.default.noData)}async drawLongCanvas(){const e=this.elem.querySelector(".travel-lines");e.innerHTML="";const t=this.data.map((e=>{if(e.error)return!1;const t={};if(t.city=e,e.icon){t.city=e.name;const{low:s,high:r}=e,n=Math.round(s).toString(),a=Math.round(r).toString();t.low=n,t.high=a,t.icon={type:"img",src:e.icon}}else t.error="NO TRAVEL DATA AVAILABLE";return this.fillTemplate("travel-row",t)})).filter((e=>e));e.append(...t)}async drawCanvas(){super.drawCanvas();const e=this.data;this.elem.querySelector(".header .title.dual .bottom").innerHTML=`For ${u.getTravelCitiesDayName(e)}`,this.finishDraw()}async showCanvas(){await this.drawCanvas(),super.showCanvas()}screenIndexChange(){this.baseCountChange(this.navBaseCount)}baseCountChange(e){let t=Math.min(this.elem.querySelector(".travel-lines").getBoundingClientRect().height-289,e-150);t<0&&(t=0),this.elem.querySelector(".main").scrollTo(0,t)}static getTravelCitiesDayName(e){return e.reduce(((e,t)=>{if(t&&""===e){return i.DateTime.local().plus({days:t.today?0:1}).toLocaleString({weekday:"long"})}return e}),"")}getLongCanvas(){return this.longCanvas}}(0,l.registerDisplay)(new u(3,"travel",!1))},"./server/scripts/modules/utils/calc.mjs":(e,t,s)=>{s.r(t),s.d(t,{directionToNSEW:()=>i,distance:()=>o,heatIndex:()=>n,relativeHumidity:()=>r,windChill:()=>a,wrap:()=>l});const r=(e,t)=>{const s=e,r=t;return Math.round(Math.exp(17.625*r/(243.04+r))/Math.exp(17.625*s/(243.04+s))*100)},n=(e,t)=>{const s=e,r=t;let n,a=.5*(s+61+1.2*(s-68)+.094*r);return s>=80&&(a=2.04901523*s-42.379+10.14333127*r-.22475541*s*r-.00683783*s*s-.05481717*r*r+.00122874*s*s*r+85282e-8*s*r*r-199e-8*s*s*r*r,r<13&&s>80&&s<112?(n=(13-r)/4*Math.sqrt((17-Math.abs(s-95))/17),a-=n):r>85&&s>80&&s<87&&(n=(r-85)/10*((87-s)/5),a+=n)),a{if("0"===t||"Calm"===t||"NA"===t)return"";const s=e,r=t;return Math.round(35.74+.6215*s-35.75*r**.16+.4275*s*r**.16)},i=e=>["N","NNE","NE","ENE","E","ESE","SE","SSE","S","SSW","SW","WSW","W","WNW","NW","NNW"][Math.floor(e/22.5+.5)%16],o=(e,t,s,r)=>Math.sqrt((s-e)**2+(r-t)**2),l=(e,t)=>(e%t+t)%t},"./server/scripts/modules/utils/cors.mjs":(e,t,s)=>{s.r(t),s.d(t,{rewriteUrl:()=>r});const r=e=>{let t=e;return t=t.replace("https://api.weather.gov/",window.location.href),t=t.replace("https://www.cpc.ncep.noaa.gov/",window.location.href),t}},"./server/scripts/modules/utils/elem.mjs":(e,t,s)=>{s.r(t),s.d(t,{elemForEach:()=>r});const r=(e,t)=>{[...document.querySelectorAll(e)].forEach(t)}},"./server/scripts/modules/utils/fetch.mjs":(e,t,s)=>{s.r(t),s.d(t,{blob:()=>o,json:()=>n,raw:()=>i,text:()=>a});var r=s("./server/scripts/modules/utils/cors.mjs");const n=(e,t)=>l(e,"json",t),a=(e,t)=>l(e,"text",t),i=(e,t)=>l(e,"",t),o=(e,t)=>l(e,"blob",t),l=async(e,t,s={})=>{const n={method:"GET",mode:"cors",type:"GET",...s};let a=e;!0===n.cors&&(a=(0,r.rewriteUrl)(e));const i=new URL(a,`${window.location.origin}/`);i.protocol="localhost"!==window.location.hostname?window.location.protocol:i.protocol,n.data&&Object.keys(n.data).forEach((e=>{const t=n.data[e];i.searchParams.append(e,t)}));const o=await fetch(i,n);if(!o.ok)throw new Error(`Fetch error ${o.status} ${o.statusText} while fetching ${o.url}`);switch(t){case"json":return o.json();case"text":return o.text();case"blob":return o.blob();default:return o}}},"./server/scripts/modules/utils/image.mjs":(e,t,s)=>{s.r(t),s.d(t,{loadImg:()=>a,preloadImg:()=>o});var r=s("./server/scripts/modules/utils/fetch.mjs"),n=s("./server/scripts/modules/utils/cors.mjs");const a=(e,t=!1)=>new Promise((s=>{const r=new Image;if(r.onload=e=>{s(e.target)},e instanceof Blob)r.src=window.URL.createObjectURL(e);else{let s=e;t&&(s=(0,n.rewriteUrl)(e)),r.src=s}})),i=[],o=e=>!i.includes(e)&&((0,r.blob)(e),!0)},"./server/scripts/modules/utils/nosleep.mjs":(e,t,s)=>{s.r(t),s.d(t,{default:()=>a});let r=!1;const n=(e=!1)=>(n.controller||(n.controller=new NoSleep),r!==e&&(r=e,e?n.controller.enable():n.controller.disable())),a=n},"./server/scripts/modules/utils/string.mjs":(e,t,s)=>{s.r(t),s.d(t,{locationCleanup:()=>r});const r=e=>[/^[A-Za-z ]+ \/ /,/^[A-Za-z ]+\//,/^[A-Za-z ]+, /].reduce(((e,t)=>e.replace(t,"")),e)},"./server/scripts/modules/utils/units.mjs":(e,t,s)=>{s.r(t),s.d(t,{celsiusToFahrenheit:()=>n,kilometersToMiles:()=>a,kphToMph:()=>r,metersToFeet:()=>i,pascalToInHg:()=>o});const r=e=>Math.round(e/1.60934),n=e=>Math.round(9*e/5+32),a=e=>Math.round(e/1.60934),i=e=>Math.round(e/.3048),o=e=>{return t=2953e-7*e,s=2,Number(`${Math.round(`${t}e${s}`)}e-${s}`);var t,s}},"./server/scripts/modules/utils/weather.mjs":(e,t,s)=>{s.r(t),s.d(t,{getPoint:()=>n});var r=s("./server/scripts/modules/utils/fetch.mjs");const n=async(e,t)=>{try{return await(0,r.json)(`https://api.weather.gov/points/${e},${t}`)}catch(s){return console.log(`Unable to get point ${e}, ${t}`),console.error(s),!1}}},"./server/scripts/modules/weatherdisplay.mjs":(e,t,s)=>{s.r(t),s.d(t,{default:()=>o});var r=s("./server/scripts/modules/status.mjs"),n=s("./server/scripts/vendor/auto/luxon.mjs"),a=s("./server/scripts/modules/utils/elem.mjs"),i=s("./server/scripts/modules/navigation.mjs");const o=class{constructor(e,t,s,n){this.navId=e,this.elemId=void 0,this.gifs=[],this.data=void 0,this.loadingStatus=r.default.loading,this.name=s??t,this.getDataCallbacks=[],this.defaultEnabled=n,this.okToDrawCurrentConditions=!0,this.okToDrawCurrentDateTime=!0,this.timing={totalScreens:1,baseDelay:9e3,delay:1},this.navBaseCount=0,this.screenIndex=-1,this.storeElemId(t),this.enabled?this.setStatus(r.default.loading):this.setStatus(r.default.disabled),this.startNavCount(),document.addEventListener("DOMContentLoaded",(()=>{this.loadTemplates()}))}generateCheckbox(e=!0){if("progress"===this.elemId)return!1;let t=window.localStorage.getItem(`${this.elemId}Enabled`);null===t&&(t=e),this.enabled="true"===t||!0===t,window.localStorage.setItem(`${this.elemId}Enabled`,this.enabled);const s=document.createElement("template");return s.innerHTML=``,s.content.firstChild.addEventListener("change",(e=>this.checkboxChange(e))),s.content.firstChild}checkboxChange(e){this.enabled=e.target.checked,window.localStorage.setItem(`${this.elemId}Enabled`,this.enabled),this.getData()}setStatus(e){this.status=e,(0,i.updateStatus)({id:this.navId,status:this.status})}get status(){return this.loadingStatus}set status(e){this.loadingStatus=e}storeElemId(e){this.elemId||(this.elemId=e)}getData(e){return this.data=void 0,e&&(this.weatherParameters=e),this.enabled?(this.setStatus(r.default.loading),this.calcNavTiming(),!0):(this.setStatus(r.default.disabled),!1)}getDataCallback(){this.getDataCallbacks.forEach((e=>e(this.data))),this.getDataCallbacks=[]}drawCanvas(){this.screenIndex<0&&(this.screenIndex=0)}finishDraw(){this.okToDrawCurrentDateTime&&(this.drawCurrentDateTime(),this.dateTimeInterval||setInterval((()=>this.drawCurrentDateTime()),100))}drawCurrentDateTime(){if(!this.isActive())return;const e=n.DateTime.local(),t=e.toLocaleString(n.DateTime.TIME_WITH_SECONDS).padStart(11," ");this.lastTime!==t&&(0,a.elemForEach)(".date-time.time",(e=>{e.innerHTML=t.toUpperCase()})),this.lastTime=t;const s=e.toFormat(" ccc LLL ")+e.day.toString().padStart(2," ");this.lastDate!==s&&(0,a.elemForEach)(".date-time.date",(e=>{e.innerHTML=s.toUpperCase()})),this.lastDate=s}showCanvas(e){e===i.msg.command.firstFrame&&this.navNext(e),e===i.msg.command.lastFrame&&this.navPrev(e),this.startNavCount(),this.elem.classList.add("show")}hideCanvas(){this.resetNavBaseCount(),this.elem.classList.remove("show")}isActive(){return 0!==this.elem.offsetHeight}isEnabled(){return this.enabled}navBaseTime(){(0,i.isPlaying)()&&this.isActive()&&(this.navBaseCount+=1,this.baseCountChange&&this.baseCountChange(this.navBaseCount),this.updateScreenFromBaseCount())}async updateScreenFromBaseCount(){const e=this.screenIndexFromBaseCount();!1!==e?e!==this.screenIndex&&(this.screenIndex=-1===e?0:e,this.screenIndexChange?this.screenIndexChange(this.screenIndex):(await this.drawCanvas(),this.showCanvas())):this.sendNavDisplayMessage(i.msg.response.next)}calcNavTiming(){if(!1===this.timing)return;Array.isArray(this.timing.delay)&&(this.timing.totalScreens=this.timing.delay.length);let e=[];if("number"==typeof this.timing.delay)for(let t=0;t"object"==typeof e?e.time:e));let t=0;if(this.timing.fullDelay=e.map((e=>{const s=t+e;return t+=e,s})),Array.isArray(this.timing.delay)&&"object"==typeof this.timing.delay[0])this.timing.screenIndexes=this.timing.delay.map((e=>e.si));else{this.timing.screenIndexes=[];for(let e=0;ee>this.navBaseCount));this.navBaseCount=e}this.updateScreenFromBaseCount()}navPrev(e){if(e===i.msg.command.lastFrame)this.navBaseCount=this.timing.fullDelay[this.timing.totalScreens-1]-1;else{const e=this.timing.fullDelay.reduce(((e,t)=>te>this.navBaseCount));return-1!==e&&this.timing.screenIndexes[e]}startNavCount(){this.navInterval||(this.navInterval=setInterval((()=>this.navBaseTime()),this.timing.baseDelay))}resetNavBaseCount(){this.navBaseCount=0,this.screenIndex=-1,this.navInterval&&(clearInterval(this.navInterval),this.navInterval=void 0)}sendNavDisplayMessage(e){(0,i.displayNavMessage)({id:this.navId,type:e})}loadTemplates(){if(this.templates={},this.elem=document.getElementById(`${this.elemId}-html`),!this.elem)return;this.elem.querySelectorAll(".template").forEach((e=>{const t=e.classList[0],s=e.cloneNode(!0);s.classList.remove("template"),this.templates[t]=s,e.remove()}))}fillTemplate(e,t){const s=this.templates[e];if(!s)return!1;const r=s.cloneNode(!0);return Object.entries(t).forEach((([e,t])=>{const s=r.querySelector(`.${e}`);s&&("string"==typeof t||"number"==typeof t?s.innerHTML=t:"img"===t?.type&&(s.querySelector("img").src=t.src))})),r}}},"./server/scripts/vendor/auto/luxon.mjs":(e,t,s)=>{s.r(t),s.d(t,{DateTime:()=>Ks,Duration:()=>Gt,FixedOffsetZone:()=>Oe,IANAZone:()=>Ee,Info:()=>Xt,Interval:()=>Jt,InvalidZone:()=>Fe,Settings:()=>Re,SystemZone:()=>Me,VERSION:()=>er,Zone:()=>Ie});class r extends Error{}class n extends r{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}}class a extends r{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}}class i extends r{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}}class o extends r{}class l extends r{constructor(e){super(`Invalid unit ${e}`)}}class u extends r{}class c extends r{constructor(){super("Zone is an abstract class")}}const d="numeric",m="short",h="long",f={year:d,month:d,day:d},g={year:d,month:m,day:d},p={year:d,month:m,day:d,weekday:m},y={year:d,month:h,day:d},v={year:d,month:h,day:d,weekday:h},w={hour:d,minute:d},S={hour:d,minute:d,second:d},T={hour:d,minute:d,second:d,timeZoneName:m},b={hour:d,minute:d,second:d,timeZoneName:h},C={hour:d,minute:d,hourCycle:"h23"},I={hour:d,minute:d,second:d,hourCycle:"h23"},D={hour:d,minute:d,second:d,hourCycle:"h23",timeZoneName:m},M={hour:d,minute:d,second:d,hourCycle:"h23",timeZoneName:h},x={year:d,month:d,day:d,hour:d,minute:d},L={year:d,month:d,day:d,hour:d,minute:d,second:d},k={year:d,month:m,day:d,hour:d,minute:d},E={year:d,month:m,day:d,hour:d,minute:d,second:d},N={year:d,month:m,day:d,weekday:m,hour:d,minute:d},O={year:d,month:h,day:d,hour:d,minute:d,timeZoneName:m},F={year:d,month:h,day:d,hour:d,minute:d,second:d,timeZoneName:m},j={year:d,month:h,day:d,weekday:h,hour:d,minute:d,timeZoneName:h},$={year:d,month:h,day:d,weekday:h,hour:d,minute:d,second:d,timeZoneName:h};function V(e){return void 0===e}function H(e){return"number"==typeof e}function _(e){return"number"==typeof e&&e%1==0}function A(){try{return"undefined"!=typeof Intl&&!!Intl.RelativeTimeFormat}catch(e){return!1}}function P(e,t,s){if(0!==e.length)return e.reduce(((e,r)=>{const n=[t(r),r];return e&&s(e[0],n[0])===e[0]?e:n}),null)[1]}function R(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function z(e,t,s){return _(e)&&e>=t&&e<=s}function B(e,t=2){let s;return s=e<0?"-"+(""+-e).padStart(t,"0"):(""+e).padStart(t,"0"),s}function Z(e){return V(e)||null===e||""===e?void 0:parseInt(e,10)}function q(e){return V(e)||null===e||""===e?void 0:parseFloat(e)}function W(e){if(!V(e)&&null!==e&&""!==e){const t=1e3*parseFloat("0."+e);return Math.floor(t)}}function U(e,t,s=!1){const r=10**t;return(s?Math.trunc:Math.round)(e*r)/r}function G(e){return e%4==0&&(e%100!=0||e%400==0)}function Y(e){return G(e)?366:365}function J(e,t){const s=function(e,t){return e-t*Math.floor(e/t)}(t-1,12)+1;return 2===s?G(e+(t-s)/12)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][s-1]}function X(e){let t=Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,e.second,e.millisecond);return e.year<100&&e.year>=0&&(t=new Date(t),t.setUTCFullYear(t.getUTCFullYear()-1900)),+t}function K(e){const t=(e+Math.floor(e/4)-Math.floor(e/100)+Math.floor(e/400))%7,s=e-1,r=(s+Math.floor(s/4)-Math.floor(s/100)+Math.floor(s/400))%7;return 4===t||3===r?53:52}function Q(e){return e>99?e:e>60?1900+e:2e3+e}function ee(e,t,s,r=null){const n=new Date(e),a={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};r&&(a.timeZone=r);const i={timeZoneName:t,...a},o=new Intl.DateTimeFormat(s,i).formatToParts(n).find((e=>"timezonename"===e.type.toLowerCase()));return o?o.value:null}function te(e,t){let s=parseInt(e,10);Number.isNaN(s)&&(s=0);const r=parseInt(t,10)||0;return 60*s+(s<0||Object.is(s,-0)?-r:r)}function se(e){const t=Number(e);if("boolean"==typeof e||""===e||Number.isNaN(t))throw new u(`Invalid unit value ${e}`);return t}function re(e,t){const s={};for(const r in e)if(R(e,r)){const n=e[r];if(null==n)continue;s[t(r)]=se(n)}return s}function ne(e,t){const s=Math.trunc(Math.abs(e/60)),r=Math.trunc(Math.abs(e%60)),n=e>=0?"+":"-";switch(t){case"short":return`${n}${B(s,2)}:${B(r,2)}`;case"narrow":return`${n}${s}${r>0?`:${r}`:""}`;case"techie":return`${n}${B(s,2)}${B(r,2)}`;default:throw new RangeError(`Value format ${t} is out of range for property format`)}}function ae(e){return function(e,t){return t.reduce(((t,s)=>(t[s]=e[s],t)),{})}(e,["hour","minute","second","millisecond"])}const ie=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/,oe=["January","February","March","April","May","June","July","August","September","October","November","December"],le=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],ue=["J","F","M","A","M","J","J","A","S","O","N","D"];function ce(e){switch(e){case"narrow":return[...ue];case"short":return[...le];case"long":return[...oe];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const de=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],me=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],he=["M","T","W","T","F","S","S"];function fe(e){switch(e){case"narrow":return[...he];case"short":return[...me];case"long":return[...de];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const ge=["AM","PM"],pe=["Before Christ","Anno Domini"],ye=["BC","AD"],ve=["B","A"];function we(e){switch(e){case"narrow":return[...ve];case"short":return[...ye];case"long":return[...pe];default:return null}}function Se(e,t){let s="";for(const r of e)r.literal?s+=r.val:s+=t(r.val);return s}const Te={D:f,DD:g,DDD:y,DDDD:v,t:w,tt:S,ttt:T,tttt:b,T:C,TT:I,TTT:D,TTTT:M,f:x,ff:k,fff:O,ffff:j,F:L,FF:E,FFF:F,FFFF:$};class be{static create(e,t={}){return new be(e,t)}static parseFormat(e){let t=null,s="",r=!1;const n=[];for(let a=0;a0&&n.push({literal:r,val:s}),t=null,s="",r=!r):r||i===t?s+=i:(s.length>0&&n.push({literal:!1,val:s}),s=i,t=i)}return s.length>0&&n.push({literal:r,val:s}),n}static macroTokenToFormatOpts(e){return Te[e]}constructor(e,t){this.opts=t,this.loc=e,this.systemLoc=null}formatWithSystemDefault(e,t){null===this.systemLoc&&(this.systemLoc=this.loc.redefaultToSystem());return this.systemLoc.dtFormatter(e,{...this.opts,...t}).format()}formatDateTime(e,t={}){return this.loc.dtFormatter(e,{...this.opts,...t}).format()}formatDateTimeParts(e,t={}){return this.loc.dtFormatter(e,{...this.opts,...t}).formatToParts()}resolvedOptions(e,t={}){return this.loc.dtFormatter(e,{...this.opts,...t}).resolvedOptions()}num(e,t=0){if(this.opts.forceSimple)return B(e,t);const s={...this.opts};return t>0&&(s.padTo=t),this.loc.numberFormatter(s).format(e)}formatDateTimeFromString(e,t){const s="en"===this.loc.listingMode(),r=this.loc.outputCalendar&&"gregory"!==this.loc.outputCalendar,n=(t,s)=>this.loc.extract(e,t,s),a=t=>e.isOffsetFixed&&0===e.offset&&t.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,t.format):"",i=()=>s?function(e){return ge[e.hour<12?0:1]}(e):n({hour:"numeric",hourCycle:"h12"},"dayperiod"),o=(t,r)=>s?function(e,t){return ce(t)[e.month-1]}(e,t):n(r?{month:t}:{month:t,day:"numeric"},"month"),l=(t,r)=>s?function(e,t){return fe(t)[e.weekday-1]}(e,t):n(r?{weekday:t}:{weekday:t,month:"long",day:"numeric"},"weekday"),u=t=>{const s=be.macroTokenToFormatOpts(t);return s?this.formatWithSystemDefault(e,s):t},c=t=>s?function(e,t){return we(t)[e.year<0?0:1]}(e,t):n({era:t},"era");return Se(be.parseFormat(t),(t=>{switch(t){case"S":return this.num(e.millisecond);case"u":case"SSS":return this.num(e.millisecond,3);case"s":return this.num(e.second);case"ss":return this.num(e.second,2);case"uu":return this.num(Math.floor(e.millisecond/10),2);case"uuu":return this.num(Math.floor(e.millisecond/100));case"m":return this.num(e.minute);case"mm":return this.num(e.minute,2);case"h":return this.num(e.hour%12==0?12:e.hour%12);case"hh":return this.num(e.hour%12==0?12:e.hour%12,2);case"H":return this.num(e.hour);case"HH":return this.num(e.hour,2);case"Z":return a({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return a({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return a({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return e.zone.offsetName(e.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return e.zone.offsetName(e.ts,{format:"long",locale:this.loc.locale});case"z":return e.zoneName;case"a":return i();case"d":return r?n({day:"numeric"},"day"):this.num(e.day);case"dd":return r?n({day:"2-digit"},"day"):this.num(e.day,2);case"c":case"E":return this.num(e.weekday);case"ccc":return l("short",!0);case"cccc":return l("long",!0);case"ccccc":return l("narrow",!0);case"EEE":return l("short",!1);case"EEEE":return l("long",!1);case"EEEEE":return l("narrow",!1);case"L":return r?n({month:"numeric",day:"numeric"},"month"):this.num(e.month);case"LL":return r?n({month:"2-digit",day:"numeric"},"month"):this.num(e.month,2);case"LLL":return o("short",!0);case"LLLL":return o("long",!0);case"LLLLL":return o("narrow",!0);case"M":return r?n({month:"numeric"},"month"):this.num(e.month);case"MM":return r?n({month:"2-digit"},"month"):this.num(e.month,2);case"MMM":return o("short",!1);case"MMMM":return o("long",!1);case"MMMMM":return o("narrow",!1);case"y":return r?n({year:"numeric"},"year"):this.num(e.year);case"yy":return r?n({year:"2-digit"},"year"):this.num(e.year.toString().slice(-2),2);case"yyyy":return r?n({year:"numeric"},"year"):this.num(e.year,4);case"yyyyyy":return r?n({year:"numeric"},"year"):this.num(e.year,6);case"G":return c("short");case"GG":return c("long");case"GGGGG":return c("narrow");case"kk":return this.num(e.weekYear.toString().slice(-2),2);case"kkkk":return this.num(e.weekYear,4);case"W":return this.num(e.weekNumber);case"WW":return this.num(e.weekNumber,2);case"o":return this.num(e.ordinal);case"ooo":return this.num(e.ordinal,3);case"q":return this.num(e.quarter);case"qq":return this.num(e.quarter,2);case"X":return this.num(Math.floor(e.ts/1e3));case"x":return this.num(e.ts);default:return u(t)}}))}formatDurationFromString(e,t){const s=e=>{switch(e[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},r=be.parseFormat(t),n=r.reduce(((e,{literal:t,val:s})=>t?e:e.concat(s)),[]);return Se(r,(e=>t=>{const r=s(t);return r?this.num(e.get(r),t.length):t})(e.shiftTo(...n.map(s).filter((e=>e)))))}}class Ce{constructor(e,t){this.reason=e,this.explanation=t}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}class Ie{get type(){throw new c}get name(){throw new c}get ianaName(){return this.name}get isUniversal(){throw new c}offsetName(e,t){throw new c}formatOffset(e,t){throw new c}offset(e){throw new c}equals(e){throw new c}get isValid(){throw new c}}let De=null;class Me extends Ie{static get instance(){return null===De&&(De=new Me),De}get type(){return"system"}get name(){return(new Intl.DateTimeFormat).resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:t,locale:s}){return ee(e,t,s)}formatOffset(e,t){return ne(this.offset(e),t)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return"system"===e.type}get isValid(){return!0}}let xe={};const Le={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};let ke={};class Ee extends Ie{static create(e){return ke[e]||(ke[e]=new Ee(e)),ke[e]}static resetCache(){ke={},xe={}}static isValidSpecifier(e){return this.isValidZone(e)}static isValidZone(e){if(!e)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:e}).format(),!0}catch(e){return!1}}constructor(e){super(),this.zoneName=e,this.valid=Ee.isValidZone(e)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(e,{format:t,locale:s}){return ee(e,t,s,this.name)}formatOffset(e,t){return ne(this.offset(e),t)}offset(e){const t=new Date(e);if(isNaN(t))return NaN;const s=(r=this.name,xe[r]||(xe[r]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:r,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),xe[r]);var r;let[n,a,i,o,l,u,c]=s.formatToParts?function(e,t){const s=e.formatToParts(t),r=[];for(let e=0;e=0?m:1e3+m,(X({year:n,month:a,day:i,hour:24===l?0:l,minute:u,second:c,millisecond:0})-d)/6e4}equals(e){return"iana"===e.type&&e.name===this.name}get isValid(){return this.valid}}let Ne=null;class Oe extends Ie{static get utcInstance(){return null===Ne&&(Ne=new Oe(0)),Ne}static instance(e){return 0===e?Oe.utcInstance:new Oe(e)}static parseSpecifier(e){if(e){const t=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(t)return new Oe(te(t[1],t[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return 0===this.fixed?"UTC":`UTC${ne(this.fixed,"narrow")}`}get ianaName(){return 0===this.fixed?"Etc/UTC":`Etc/GMT${ne(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,t){return ne(this.fixed,t)}get isUniversal(){return!0}offset(){return this.fixed}equals(e){return"fixed"===e.type&&e.fixed===this.fixed}get isValid(){return!0}}class Fe extends Ie{constructor(e){super(),this.zoneName=e}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function je(e,t){if(V(e)||null===e)return t;if(e instanceof Ie)return e;if("string"==typeof e){const s=e.toLowerCase();return"default"===s?t:"local"===s||"system"===s?Me.instance:"utc"===s||"gmt"===s?Oe.utcInstance:Oe.parseSpecifier(s)||Ee.create(e)}return H(e)?Oe.instance(e):"object"==typeof e&&e.offset&&"number"==typeof e.offset?e:new Fe(e)}let $e,Ve=()=>Date.now(),He="system",_e=null,Ae=null,Pe=null;class Re{static get now(){return Ve}static set now(e){Ve=e}static set defaultZone(e){He=e}static get defaultZone(){return je(He,Me.instance)}static get defaultLocale(){return _e}static set defaultLocale(e){_e=e}static get defaultNumberingSystem(){return Ae}static set defaultNumberingSystem(e){Ae=e}static get defaultOutputCalendar(){return Pe}static set defaultOutputCalendar(e){Pe=e}static get throwOnInvalid(){return $e}static set throwOnInvalid(e){$e=e}static resetCaches(){Ke.resetCache(),Ee.resetCache()}}let ze={};let Be={};function Ze(e,t={}){const s=JSON.stringify([e,t]);let r=Be[s];return r||(r=new Intl.DateTimeFormat(e,t),Be[s]=r),r}let qe={};let We={};let Ue=null;function Ge(e,t,s,r,n){const a=e.listingMode(s);return"error"===a?null:"en"===a?r(t):n(t)}class Ye{constructor(e,t,s){this.padTo=s.padTo||0,this.floor=s.floor||!1;const{padTo:r,floor:n,...a}=s;if(!t||Object.keys(a).length>0){const t={useGrouping:!1,...s};s.padTo>0&&(t.minimumIntegerDigits=s.padTo),this.inf=function(e,t={}){const s=JSON.stringify([e,t]);let r=qe[s];return r||(r=new Intl.NumberFormat(e,t),qe[s]=r),r}(e,t)}}format(e){if(this.inf){const t=this.floor?Math.floor(e):e;return this.inf.format(t)}return B(this.floor?Math.floor(e):U(e,3),this.padTo)}}class Je{constructor(e,t,s){let r;if(this.opts=s,e.zone.isUniversal){const t=e.offset/60*-1,n=t>=0?`Etc/GMT+${t}`:`Etc/GMT${t}`;0!==e.offset&&Ee.create(n).valid?(r=n,this.dt=e):(r="UTC",s.timeZoneName?this.dt=e:this.dt=0===e.offset?e:Ks.fromMillis(e.ts+60*e.offset*1e3))}else"system"===e.zone.type?this.dt=e:(this.dt=e,r=e.zone.name);const n={...this.opts};r&&(n.timeZone=r),this.dtf=Ze(t,n)}format(){return this.dtf.format(this.dt.toJSDate())}formatToParts(){return this.dtf.formatToParts(this.dt.toJSDate())}resolvedOptions(){return this.dtf.resolvedOptions()}}class Xe{constructor(e,t,s){this.opts={style:"long",...s},!t&&A()&&(this.rtf=function(e,t={}){const{base:s,...r}=t,n=JSON.stringify([e,r]);let a=We[n];return a||(a=new Intl.RelativeTimeFormat(e,t),We[n]=a),a}(e,s))}format(e,t){return this.rtf?this.rtf.format(e,t):function(e,t,s="always",r=!1){const n={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},a=-1===["hours","minutes","seconds"].indexOf(e);if("auto"===s&&a){const s="days"===e;switch(t){case 1:return s?"tomorrow":`next ${n[e][0]}`;case-1:return s?"yesterday":`last ${n[e][0]}`;case 0:return s?"today":`this ${n[e][0]}`}}const i=Object.is(t,-0)||t<0,o=Math.abs(t),l=1===o,u=n[e],c=r?l?u[1]:u[2]||u[1]:l?n[e][0]:e;return i?`${o} ${c} ago`:`in ${o} ${c}`}(t,e,this.opts.numeric,"long"!==this.opts.style)}formatToParts(e,t){return this.rtf?this.rtf.formatToParts(e,t):[]}}class Ke{static fromOpts(e){return Ke.create(e.locale,e.numberingSystem,e.outputCalendar,e.defaultToEN)}static create(e,t,s,r=!1){const n=e||Re.defaultLocale,a=n||(r?"en-US":Ue||(Ue=(new Intl.DateTimeFormat).resolvedOptions().locale,Ue)),i=t||Re.defaultNumberingSystem,o=s||Re.defaultOutputCalendar;return new Ke(a,i,o,n)}static resetCache(){Ue=null,Be={},qe={},We={}}static fromObject({locale:e,numberingSystem:t,outputCalendar:s}={}){return Ke.create(e,t,s)}constructor(e,t,s,r){const[n,a,i]=function(e){const t=e.indexOf("-u-");if(-1===t)return[e];{let s;const r=e.substring(0,t);try{s=Ze(e).resolvedOptions()}catch(e){s=Ze(r).resolvedOptions()}const{numberingSystem:n,calendar:a}=s;return[r,n,a]}}(e);this.locale=n,this.numberingSystem=t||a||null,this.outputCalendar=s||i||null,this.intl=function(e,t,s){return s||t?(e+="-u",s&&(e+=`-ca-${s}`),t&&(e+=`-nu-${t}`),e):e}(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=r,this.fastNumbersCached=null}get fastNumbers(){var e;return null==this.fastNumbersCached&&(this.fastNumbersCached=(!(e=this).numberingSystem||"latn"===e.numberingSystem)&&("latn"===e.numberingSystem||!e.locale||e.locale.startsWith("en")||"latn"===new Intl.DateTimeFormat(e.intl).resolvedOptions().numberingSystem)),this.fastNumbersCached}listingMode(){const e=this.isEnglish(),t=!(null!==this.numberingSystem&&"latn"!==this.numberingSystem||null!==this.outputCalendar&&"gregory"!==this.outputCalendar);return e&&t?"en":"intl"}clone(e){return e&&0!==Object.getOwnPropertyNames(e).length?Ke.create(e.locale||this.specifiedLocale,e.numberingSystem||this.numberingSystem,e.outputCalendar||this.outputCalendar,e.defaultToEN||!1):this}redefaultToEN(e={}){return this.clone({...e,defaultToEN:!0})}redefaultToSystem(e={}){return this.clone({...e,defaultToEN:!1})}months(e,t=!1,s=!0){return Ge(this,e,s,ce,(()=>{const s=t?{month:e,day:"numeric"}:{month:e},r=t?"format":"standalone";return this.monthsCache[r][e]||(this.monthsCache[r][e]=function(e){const t=[];for(let s=1;s<=12;s++){const r=Ks.utc(2016,s,1);t.push(e(r))}return t}((e=>this.extract(e,s,"month")))),this.monthsCache[r][e]}))}weekdays(e,t=!1,s=!0){return Ge(this,e,s,fe,(()=>{const s=t?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},r=t?"format":"standalone";return this.weekdaysCache[r][e]||(this.weekdaysCache[r][e]=function(e){const t=[];for(let s=1;s<=7;s++){const r=Ks.utc(2016,11,13+s);t.push(e(r))}return t}((e=>this.extract(e,s,"weekday")))),this.weekdaysCache[r][e]}))}meridiems(e=!0){return Ge(this,void 0,e,(()=>ge),(()=>{if(!this.meridiemCache){const e={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[Ks.utc(2016,11,13,9),Ks.utc(2016,11,13,19)].map((t=>this.extract(t,e,"dayperiod")))}return this.meridiemCache}))}eras(e,t=!0){return Ge(this,e,t,we,(()=>{const t={era:e};return this.eraCache[e]||(this.eraCache[e]=[Ks.utc(-40,1,1),Ks.utc(2017,1,1)].map((e=>this.extract(e,t,"era")))),this.eraCache[e]}))}extract(e,t,s){const r=this.dtFormatter(e,t).formatToParts().find((e=>e.type.toLowerCase()===s));return r?r.value:null}numberFormatter(e={}){return new Ye(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,t={}){return new Je(e,this.intl,t)}relFormatter(e={}){return new Xe(this.intl,this.isEnglish(),e)}listFormatter(e={}){return function(e,t={}){const s=JSON.stringify([e,t]);let r=ze[s];return r||(r=new Intl.ListFormat(e,t),ze[s]=r),r}(this.intl,e)}isEnglish(){return"en"===this.locale||"en-us"===this.locale.toLowerCase()||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}equals(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar}}function Qe(...e){const t=e.reduce(((e,t)=>e+t.source),"");return RegExp(`^${t}$`)}function et(...e){return t=>e.reduce((([e,s,r],n)=>{const[a,i,o]=n(t,r);return[{...e,...a},i||s,o]}),[{},null,1]).slice(0,2)}function tt(e,...t){if(null==e)return[null,null];for(const[s,r]of t){const t=s.exec(e);if(t)return r(t)}return[null,null]}function st(...e){return(t,s)=>{const r={};let n;for(n=0;nvoid 0!==e&&(t||e&&c)?-e:e;return[{years:m(q(s)),months:m(q(r)),weeks:m(q(n)),days:m(q(a)),hours:m(q(i)),minutes:m(q(o)),seconds:m(q(l),"-0"===l),milliseconds:m(W(u),d)}]}const vt={GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function wt(e,t,s,r,n,a,i){const o={year:2===t.length?Q(Z(t)):Z(t),month:le.indexOf(s)+1,day:Z(r),hour:Z(n),minute:Z(a)};return i&&(o.second=Z(i)),e&&(o.weekday=e.length>3?de.indexOf(e)+1:me.indexOf(e)+1),o}const St=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function Tt(e){const[,t,s,r,n,a,i,o,l,u,c,d]=e,m=wt(t,n,r,s,a,i,o);let h;return h=l?vt[l]:u?0:te(c,d),[m,new Oe(h)]}const bt=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,Ct=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,It=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function Dt(e){const[,t,s,r,n,a,i,o]=e;return[wt(t,n,r,s,a,i,o),Oe.utcInstance]}function Mt(e){const[,t,s,r,n,a,i,o]=e;return[wt(t,o,s,r,n,a,i),Oe.utcInstance]}const xt=Qe(/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,it),Lt=Qe(/(\d{4})-?W(\d\d)(?:-?(\d))?/,it),kt=Qe(/(\d{4})-?(\d{3})/,it),Et=Qe(at),Nt=et((function(e,t){return[{year:dt(e,t),month:dt(e,t+1,1),day:dt(e,t+2,1)},null,t+3]}),mt,ht,ft),Ot=et(ot,mt,ht,ft),Ft=et(lt,mt,ht,ft),jt=et(mt,ht,ft);const $t=et(mt);const Vt=Qe(/(\d{4})-(\d\d)-(\d\d)/,ct),Ht=Qe(ut),_t=et(mt,ht,ft);const At={weeks:{days:7,hours:168,minutes:10080,seconds:604800,milliseconds:6048e5},days:{hours:24,minutes:1440,seconds:86400,milliseconds:864e5},hours:{minutes:60,seconds:3600,milliseconds:36e5},minutes:{seconds:60,milliseconds:6e4},seconds:{milliseconds:1e3}},Pt={years:{quarters:4,months:12,weeks:52,days:365,hours:8760,minutes:525600,seconds:31536e3,milliseconds:31536e6},quarters:{months:3,weeks:13,days:91,hours:2184,minutes:131040,seconds:7862400,milliseconds:78624e5},months:{weeks:4,days:30,hours:720,minutes:43200,seconds:2592e3,milliseconds:2592e6},...At},Rt=365.2425,zt=30.436875,Bt={years:{quarters:4,months:12,weeks:52.1775,days:Rt,hours:8765.82,minutes:525949.2,seconds:525949.2*60,milliseconds:525949.2*60*1e3},quarters:{months:3,weeks:13.044375,days:91.310625,hours:2191.455,minutes:131487.3,seconds:525949.2*60/4,milliseconds:7889237999.999999},months:{weeks:4.3481250000000005,days:zt,hours:730.485,minutes:43829.1,seconds:2629746,milliseconds:2629746e3},...At},Zt=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],qt=Zt.slice(0).reverse();function Wt(e,t,s=!1){const r={values:s?t.values:{...e.values,...t.values||{}},loc:e.loc.clone(t.loc),conversionAccuracy:t.conversionAccuracy||e.conversionAccuracy,matrix:t.matrix||e.matrix};return new Gt(r)}function Ut(e,t,s,r,n){const a=e[n][s],i=t[s]/a,o=!(Math.sign(i)===Math.sign(r[n]))&&0!==r[n]&&Math.abs(i)<=1?function(e){return e<0?Math.floor(e):Math.ceil(e)}(i):Math.trunc(i);r[n]+=o,t[s]-=o*a}class Gt{constructor(e){const t="longterm"===e.conversionAccuracy||!1;let s=t?Bt:Pt;e.matrix&&(s=e.matrix),this.values=e.values,this.loc=e.loc||Ke.create(),this.conversionAccuracy=t?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=s,this.isLuxonDuration=!0}static fromMillis(e,t){return Gt.fromObject({milliseconds:e},t)}static fromObject(e,t={}){if(null==e||"object"!=typeof e)throw new u("Duration.fromObject: argument expected to be an object, got "+(null===e?"null":typeof e));return new Gt({values:re(e,Gt.normalizeUnit),loc:Ke.fromObject(t),conversionAccuracy:t.conversionAccuracy,matrix:t.matrix})}static fromDurationLike(e){if(H(e))return Gt.fromMillis(e);if(Gt.isDuration(e))return e;if("object"==typeof e)return Gt.fromObject(e);throw new u(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,t){const[s]=function(e){return tt(e,[pt,yt])}(e);return s?Gt.fromObject(s,t):Gt.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static fromISOTime(e,t){const[s]=function(e){return tt(e,[gt,$t])}(e);return s?Gt.fromObject(s,t):Gt.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,t=null){if(!e)throw new u("need to specify a reason the Duration is invalid");const s=e instanceof Ce?e:new Ce(e,t);if(Re.throwOnInvalid)throw new i(s);return new Gt({invalid:s})}static normalizeUnit(e){const t={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[e?e.toLowerCase():e];if(!t)throw new l(e);return t}static isDuration(e){return e&&e.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(e,t={}){const s={...t,floor:!1!==t.round&&!1!==t.floor};return this.isValid?be.create(this.loc,s).formatDurationFromString(this,e):"Invalid Duration"}toHuman(e={}){const t=Zt.map((t=>{const s=this.values[t];return V(s)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...e,unit:t.slice(0,-1)}).format(s)})).filter((e=>e));return this.loc.listFormatter({type:"conjunction",style:e.listStyle||"narrow",...e}).format(t)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let e="P";return 0!==this.years&&(e+=this.years+"Y"),0===this.months&&0===this.quarters||(e+=this.months+3*this.quarters+"M"),0!==this.weeks&&(e+=this.weeks+"W"),0!==this.days&&(e+=this.days+"D"),0===this.hours&&0===this.minutes&&0===this.seconds&&0===this.milliseconds||(e+="T"),0!==this.hours&&(e+=this.hours+"H"),0!==this.minutes&&(e+=this.minutes+"M"),0===this.seconds&&0===this.milliseconds||(e+=U(this.seconds+this.milliseconds/1e3,3)+"S"),"P"===e&&(e+="T0S"),e}toISOTime(e={}){if(!this.isValid)return null;const t=this.toMillis();if(t<0||t>=864e5)return null;e={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...e};const s=this.shiftTo("hours","minutes","seconds","milliseconds");let r="basic"===e.format?"hhmm":"hh:mm";e.suppressSeconds&&0===s.seconds&&0===s.milliseconds||(r+="basic"===e.format?"ss":":ss",e.suppressMilliseconds&&0===s.milliseconds||(r+=".SSS"));let n=s.toFormat(r);return e.includePrefix&&(n="T"+n),n}toJSON(){return this.toISO()}toString(){return this.toISO()}toMillis(){return this.as("milliseconds")}valueOf(){return this.toMillis()}plus(e){if(!this.isValid)return this;const t=Gt.fromDurationLike(e),s={};for(const e of Zt)(R(t.values,e)||R(this.values,e))&&(s[e]=t.get(e)+this.get(e));return Wt(this,{values:s},!0)}minus(e){if(!this.isValid)return this;const t=Gt.fromDurationLike(e);return this.plus(t.negate())}mapUnits(e){if(!this.isValid)return this;const t={};for(const s of Object.keys(this.values))t[s]=se(e(this.values[s],s));return Wt(this,{values:t},!0)}get(e){return this[Gt.normalizeUnit(e)]}set(e){if(!this.isValid)return this;return Wt(this,{values:{...this.values,...re(e,Gt.normalizeUnit)}})}reconfigure({locale:e,numberingSystem:t,conversionAccuracy:s,matrix:r}={}){return Wt(this,{loc:this.loc.clone({locale:e,numberingSystem:t}),matrix:r,conversionAccuracy:s})}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;const e=this.toObject();return function(e,t){qt.reduce(((s,r)=>V(t[r])?s:(s&&Ut(e,t,s,t,r),r)),null)}(this.matrix,e),Wt(this,{values:e},!0)}rescale(){if(!this.isValid)return this;return Wt(this,{values:function(e){const t={};for(const[s,r]of Object.entries(e))0!==r&&(t[s]=r);return t}(this.normalize().shiftToAll().toObject())},!0)}shiftTo(...e){if(!this.isValid)return this;if(0===e.length)return this;e=e.map((e=>Gt.normalizeUnit(e)));const t={},s={},r=this.toObject();let n;for(const a of Zt)if(e.indexOf(a)>=0){n=a;let e=0;for(const t in s)e+=this.matrix[t][a]*s[t],s[t]=0;H(r[a])&&(e+=r[a]);const i=Math.trunc(e);t[a]=i,s[a]=(1e3*e-1e3*i)/1e3;for(const e in r)Zt.indexOf(e)>Zt.indexOf(a)&&Ut(this.matrix,r,e,t,a)}else H(r[a])&&(s[a]=r[a]);for(const e in s)0!==s[e]&&(t[n]+=e===n?s[e]:s[e]/this.matrix[n][e]);return Wt(this,{values:t},!0).normalize()}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;const e={};for(const t of Object.keys(this.values))e[t]=0===this.values[t]?0:-this.values[t];return Wt(this,{values:e},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return null===this.invalid}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(e){if(!this.isValid||!e.isValid)return!1;if(!this.loc.equals(e.loc))return!1;for(const r of Zt)if(t=this.values[r],s=e.values[r],!(void 0===t||0===t?void 0===s||0===s:t===s))return!1;var t,s;return!0}}const Yt="Invalid Interval";class Jt{constructor(e){this.s=e.start,this.e=e.end,this.invalid=e.invalid||null,this.isLuxonInterval=!0}static invalid(e,t=null){if(!e)throw new u("need to specify a reason the Interval is invalid");const s=e instanceof Ce?e:new Ce(e,t);if(Re.throwOnInvalid)throw new a(s);return new Jt({invalid:s})}static fromDateTimes(e,t){const s=Qs(e),r=Qs(t),n=function(e,t){return e&&e.isValid?t&&t.isValid?te}isBefore(e){return!!this.isValid&&this.e<=e}contains(e){return!!this.isValid&&(this.s<=e&&this.e>e)}set({start:e,end:t}={}){return this.isValid?Jt.fromDateTimes(e||this.s,t||this.e):this}splitAt(...e){if(!this.isValid)return[];const t=e.map(Qs).filter((e=>this.contains(e))).sort(),s=[];let{s:r}=this,n=0;for(;r+this.e?this.e:e;s.push(Jt.fromDateTimes(r,a)),r=a,n+=1}return s}splitBy(e){const t=Gt.fromDurationLike(e);if(!this.isValid||!t.isValid||0===t.as("milliseconds"))return[];let s,{s:r}=this,n=1;const a=[];for(;re*n)));s=+e>+this.e?this.e:e,a.push(Jt.fromDateTimes(r,s)),r=s,n+=1}return a}divideEqually(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]}overlaps(e){return this.e>e.s&&this.s=e.e)}equals(e){return!(!this.isValid||!e.isValid)&&(this.s.equals(e.s)&&this.e.equals(e.e))}intersection(e){if(!this.isValid)return this;const t=this.s>e.s?this.s:e.s,s=this.e=s?null:Jt.fromDateTimes(t,s)}union(e){if(!this.isValid)return this;const t=this.se.e?this.e:e.e;return Jt.fromDateTimes(t,s)}static merge(e){const[t,s]=e.sort(((e,t)=>e.s-t.s)).reduce((([e,t],s)=>t?t.overlaps(s)||t.abutsStart(s)?[e,t.union(s)]:[e.concat([t]),s]:[e,s]),[[],null]);return s&&t.push(s),t}static xor(e){let t=null,s=0;const r=[],n=e.map((e=>[{time:e.s,type:"s"},{time:e.e,type:"e"}])),a=Array.prototype.concat(...n).sort(((e,t)=>e.time-t.time));for(const e of a)s+="s"===e.type?1:-1,1===s?t=e.time:(t&&+t!=+e.time&&r.push(Jt.fromDateTimes(t,e.time)),t=null);return Jt.merge(r)}difference(...e){return Jt.xor([this].concat(e)).map((e=>this.intersection(e))).filter((e=>e&&!e.isEmpty()))}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:Yt}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:Yt}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:Yt}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:Yt}toFormat(e,{separator:t=" – "}={}){return this.isValid?`${this.s.toFormat(e)}${t}${this.e.toFormat(e)}`:Yt}toDuration(e,t){return this.isValid?this.e.diff(this.s,e,t):Gt.invalid(this.invalidReason)}mapEndpoints(e){return Jt.fromDateTimes(e(this.s),e(this.e))}}class Xt{static hasDST(e=Re.defaultZone){const t=Ks.now().setZone(e).set({month:12});return!e.isUniversal&&t.offset!==t.set({month:6}).offset}static isValidIANAZone(e){return Ee.isValidZone(e)}static normalizeZone(e){return je(e,Re.defaultZone)}static months(e="long",{locale:t=null,numberingSystem:s=null,locObj:r=null,outputCalendar:n="gregory"}={}){return(r||Ke.create(t,s,n)).months(e)}static monthsFormat(e="long",{locale:t=null,numberingSystem:s=null,locObj:r=null,outputCalendar:n="gregory"}={}){return(r||Ke.create(t,s,n)).months(e,!0)}static weekdays(e="long",{locale:t=null,numberingSystem:s=null,locObj:r=null}={}){return(r||Ke.create(t,s,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:t=null,numberingSystem:s=null,locObj:r=null}={}){return(r||Ke.create(t,s,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return Ke.create(e).meridiems()}static eras(e="short",{locale:t=null}={}){return Ke.create(t,null,"gregory").eras(e)}static features(){return{relative:A()}}}function Kt(e,t){const s=e=>e.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),r=s(t)-s(e);return Math.floor(Gt.fromMillis(r).as("days"))}function Qt(e,t,s,r){let[n,a,i,o]=function(e,t,s){const r=[["years",(e,t)=>t.year-e.year],["quarters",(e,t)=>t.quarter-e.quarter+4*(t.year-e.year)],["months",(e,t)=>t.month-e.month+12*(t.year-e.year)],["weeks",(e,t)=>{const s=Kt(e,t);return(s-s%7)/7}],["days",Kt]],n={};let a,i;for(const[o,l]of r)if(s.indexOf(o)>=0){a=o;let s=l(e,t);i=e.plus({[o]:s}),i>t?(e=e.plus({[o]:s-1}),s-=1):e=i,n[o]=s}return[e,n,i,a]}(e,t,s);const l=t-n,u=s.filter((e=>["hours","minutes","seconds","milliseconds"].indexOf(e)>=0));0===u.length&&(i0?Gt.fromMillis(l,r).shiftTo(...u).plus(c):c}const es={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},ts={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},ss=es.hanidec.replace(/[\[|\]]/g,"").split("");function rs({numberingSystem:e},t=""){return new RegExp(`${es[e||"latn"]}${t}`)}function ns(e,t=(e=>e)){return{regex:e,deser:([e])=>t(function(e){let t=parseInt(e,10);if(isNaN(t)){t="";for(let s=0;s=s&&r<=n&&(t+=r-s)}}return parseInt(t,10)}return t}(e))}}const as=`[ ${String.fromCharCode(160)}]`,is=new RegExp(as,"g");function os(e){return e.replace(/\./g,"\\.?").replace(is,as)}function ls(e){return e.replace(/\./g,"").replace(is," ").toLowerCase()}function us(e,t){return null===e?null:{regex:RegExp(e.map(os).join("|")),deser:([s])=>e.findIndex((e=>ls(s)===ls(e)))+t}}function cs(e,t){return{regex:e,deser:([,e,t])=>te(e,t),groups:t}}function ds(e){return{regex:e,deser:([e])=>e}}const ms={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour:{numeric:"h","2-digit":"hh"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};let hs=null;function fs(e,t){return Array.prototype.concat(...e.map((e=>function(e,t){if(e.literal)return e;const s=ps(be.macroTokenToFormatOpts(e.val),t);return null==s||s.includes(void 0)?e:s}(e,t))))}function gs(e,t,s){const r=fs(be.parseFormat(s),e),n=r.map((t=>function(e,t){const s=rs(t),r=rs(t,"{2}"),n=rs(t,"{3}"),a=rs(t,"{4}"),i=rs(t,"{6}"),o=rs(t,"{1,2}"),l=rs(t,"{1,3}"),u=rs(t,"{1,6}"),c=rs(t,"{1,9}"),d=rs(t,"{2,4}"),m=rs(t,"{4,6}"),h=e=>{return{regex:RegExp((t=e.val,t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&"))),deser:([e])=>e,literal:!0};var t},f=(f=>{if(e.literal)return h(f);switch(f.val){case"G":return us(t.eras("short",!1),0);case"GG":return us(t.eras("long",!1),0);case"y":return ns(u);case"yy":case"kk":return ns(d,Q);case"yyyy":case"kkkk":return ns(a);case"yyyyy":return ns(m);case"yyyyyy":return ns(i);case"M":case"L":case"d":case"H":case"h":case"m":case"q":case"s":case"W":return ns(o);case"MM":case"LL":case"dd":case"HH":case"hh":case"mm":case"qq":case"ss":case"WW":return ns(r);case"MMM":return us(t.months("short",!0,!1),1);case"MMMM":return us(t.months("long",!0,!1),1);case"LLL":return us(t.months("short",!1,!1),1);case"LLLL":return us(t.months("long",!1,!1),1);case"o":case"S":return ns(l);case"ooo":case"SSS":return ns(n);case"u":return ds(c);case"uu":return ds(o);case"uuu":case"E":case"c":return ns(s);case"a":return us(t.meridiems(),0);case"EEE":return us(t.weekdays("short",!1,!1),1);case"EEEE":return us(t.weekdays("long",!1,!1),1);case"ccc":return us(t.weekdays("short",!0,!1),1);case"cccc":return us(t.weekdays("long",!0,!1),1);case"Z":case"ZZ":return cs(new RegExp(`([+-]${o.source})(?::(${r.source}))?`),2);case"ZZZ":return cs(new RegExp(`([+-]${o.source})(${r.source})?`),2);case"z":return ds(/[a-z_+-/]{1,256}?/i);default:return h(f)}})(e)||{invalidReason:"missing Intl.DateTimeFormat.formatToParts support"};return f.token=e,f}(t,e))),a=n.find((e=>e.invalidReason));if(a)return{input:t,tokens:r,invalidReason:a.invalidReason};{const[e,s]=function(e){return[`^${e.map((e=>e.regex)).reduce(((e,t)=>`${e}(${t.source})`),"")}$`,e]}(n),a=RegExp(e,"i"),[i,l]=function(e,t,s){const r=e.match(t);if(r){const e={};let t=1;for(const n in s)if(R(s,n)){const a=s[n],i=a.groups?a.groups+1:1;!a.literal&&a.token&&(e[a.token.val[0]]=a.deser(r.slice(t,t+i))),t+=i}return[r,e]}return[r,{}]}(t,a,s),[u,c,d]=l?function(e){let t,s=null;return V(e.z)||(s=Ee.create(e.z)),V(e.Z)||(s||(s=new Oe(e.Z)),t=e.Z),V(e.q)||(e.M=3*(e.q-1)+1),V(e.h)||(e.h<12&&1===e.a?e.h+=12:12===e.h&&0===e.a&&(e.h=0)),0===e.G&&e.y&&(e.y=-e.y),V(e.u)||(e.S=W(e.u)),[Object.keys(e).reduce(((t,s)=>{const r=(e=>{switch(e){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}})(s);return r&&(t[r]=e[s]),t}),{}),s,t]}(l):[null,null,void 0];if(R(l,"a")&&R(l,"H"))throw new o("Can't include meridiem when specifying 24-hour format");return{input:t,tokens:r,regex:a,rawMatches:i,matches:l,result:u,zone:c,specificOffset:d}}}function ps(e,t){if(!e)return null;return be.create(t,e).formatDateTimeParts((hs||(hs=Ks.fromMillis(1555555555555)),hs)).map((t=>function(e,t,s){const{type:r,value:n}=e;if("literal"===r)return{literal:!0,val:n};const a=s[r];let i=ms[r];return"object"==typeof i&&(i=i[a]),i?{literal:!1,val:i}:void 0}(t,0,e)))}const ys=[0,31,59,90,120,151,181,212,243,273,304,334],vs=[0,31,60,91,121,152,182,213,244,274,305,335];function ws(e,t){return new Ce("unit out of range",`you specified ${t} (of type ${typeof t}) as a ${e}, which is invalid`)}function Ss(e,t,s){const r=new Date(Date.UTC(e,t-1,s));e<100&&e>=0&&r.setUTCFullYear(r.getUTCFullYear()-1900);const n=r.getUTCDay();return 0===n?7:n}function Ts(e,t,s){return s+(G(e)?vs:ys)[t-1]}function bs(e,t){const s=G(e)?vs:ys,r=s.findIndex((e=>eK(t)?(i=t+1,o=1):i=t,{weekYear:i,weekNumber:o,weekday:a,...ae(e)}}function Is(e){const{weekYear:t,weekNumber:s,weekday:r}=e,n=Ss(t,1,4),a=Y(t);let i,o=7*s+r-n-3;o<1?(i=t-1,o+=Y(i)):o>a?(i=t+1,o-=Y(t)):i=t;const{month:l,day:u}=bs(i,o);return{year:i,month:l,day:u,...ae(e)}}function Ds(e){const{year:t,month:s,day:r}=e;return{year:t,ordinal:Ts(t,s,r),...ae(e)}}function Ms(e){const{year:t,ordinal:s}=e,{month:r,day:n}=bs(t,s);return{year:t,month:r,day:n,...ae(e)}}function xs(e){const t=_(e.year),s=z(e.month,1,12),r=z(e.day,1,J(e.year,e.month));return t?s?!r&&ws("day",e.day):ws("month",e.month):ws("year",e.year)}function Ls(e){const{hour:t,minute:s,second:r,millisecond:n}=e,a=z(t,0,23)||24===t&&0===s&&0===r&&0===n,i=z(s,0,59),o=z(r,0,59),l=z(n,0,999);return a?i?o?!l&&ws("millisecond",n):ws("second",r):ws("minute",s):ws("hour",t)}const ks="Invalid DateTime",Es=864e13;function Ns(e){return new Ce("unsupported zone",`the zone "${e.name}" is not supported`)}function Os(e){return null===e.weekData&&(e.weekData=Cs(e.c)),e.weekData}function Fs(e,t){const s={ts:e.ts,zone:e.zone,c:e.c,o:e.o,loc:e.loc,invalid:e.invalid};return new Ks({...s,...t,old:s})}function js(e,t,s){let r=e-60*t*1e3;const n=s.offset(r);if(t===n)return[r,t];r-=60*(n-t)*1e3;const a=s.offset(r);return n===a?[r,n]:[e-60*Math.min(n,a)*1e3,Math.max(n,a)]}function $s(e,t){const s=new Date(e+=60*t*1e3);return{year:s.getUTCFullYear(),month:s.getUTCMonth()+1,day:s.getUTCDate(),hour:s.getUTCHours(),minute:s.getUTCMinutes(),second:s.getUTCSeconds(),millisecond:s.getUTCMilliseconds()}}function Vs(e,t,s){return js(X(e),t,s)}function Hs(e,t){const s=e.o,r=e.c.year+Math.trunc(t.years),n=e.c.month+Math.trunc(t.months)+3*Math.trunc(t.quarters),a={...e.c,year:r,month:n,day:Math.min(e.c.day,J(r,n))+Math.trunc(t.days)+7*Math.trunc(t.weeks)},i=Gt.fromObject({years:t.years-Math.trunc(t.years),quarters:t.quarters-Math.trunc(t.quarters),months:t.months-Math.trunc(t.months),weeks:t.weeks-Math.trunc(t.weeks),days:t.days-Math.trunc(t.days),hours:t.hours,minutes:t.minutes,seconds:t.seconds,milliseconds:t.milliseconds}).as("milliseconds"),o=X(a);let[l,u]=js(o,s,e.zone);return 0!==i&&(l+=i,u=e.zone.offset(l)),{ts:l,o:u}}function _s(e,t,s,r,n,a){const{setZone:i,zone:o}=s;if(e&&0!==Object.keys(e).length){const r=t||o,n=Ks.fromObject(e,{...s,zone:r,specificOffset:a});return i?n:n.setZone(o)}return Ks.invalid(new Ce("unparsable",`the input "${n}" can't be parsed as ${r}`))}function As(e,t,s=!0){return e.isValid?be.create(Ke.create("en-US"),{allowZ:s,forceSimple:!0}).formatDateTimeFromString(e,t):null}function Ps(e,t){const s=e.c.year>9999||e.c.year<0;let r="";return s&&e.c.year>=0&&(r+="+"),r+=B(e.c.year,s?6:4),t?(r+="-",r+=B(e.c.month),r+="-",r+=B(e.c.day)):(r+=B(e.c.month),r+=B(e.c.day)),r}function Rs(e,t,s,r,n,a){let i=B(e.c.hour);return t?(i+=":",i+=B(e.c.minute),0===e.c.second&&s||(i+=":")):i+=B(e.c.minute),0===e.c.second&&s||(i+=B(e.c.second),0===e.c.millisecond&&r||(i+=".",i+=B(e.c.millisecond,3))),n&&(e.isOffsetFixed&&0===e.offset&&!a?i+="Z":e.o<0?(i+="-",i+=B(Math.trunc(-e.o/60)),i+=":",i+=B(Math.trunc(-e.o%60))):(i+="+",i+=B(Math.trunc(e.o/60)),i+=":",i+=B(Math.trunc(e.o%60)))),a&&(i+="["+e.zone.ianaName+"]"),i}const zs={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},Bs={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},Zs={ordinal:1,hour:0,minute:0,second:0,millisecond:0},qs=["year","month","day","hour","minute","second","millisecond"],Ws=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],Us=["year","ordinal","hour","minute","second","millisecond"];function Gs(e){const t={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[e.toLowerCase()];if(!t)throw new l(e);return t}function Ys(e,t){const s=je(t.zone,Re.defaultZone),r=Ke.fromObject(t),n=Re.now();let a,i;if(V(e.year))a=n;else{for(const t of qs)V(e[t])&&(e[t]=zs[t]);const t=xs(e)||Ls(e);if(t)return Ks.invalid(t);const r=s.offset(n);[a,i]=Vs(e,r,s)}return new Ks({ts:a,zone:s,loc:r,o:i})}function Js(e,t,s){const r=!!V(s.round)||s.round,n=(e,n)=>{e=U(e,r||s.calendary?0:2,!0);return t.loc.clone(s).relFormatter(s).format(e,n)},a=r=>s.calendary?t.hasSame(e,r)?0:t.startOf(r).diff(e.startOf(r),r).get(r):t.diff(e,r).get(r);if(s.unit)return n(a(s.unit),s.unit);for(const e of s.units){const t=a(e);if(Math.abs(t)>=1)return n(t,e)}return n(e>t?-0:0,s.units[s.units.length-1])}function Xs(e){let t,s={};return e.length>0&&"object"==typeof e[e.length-1]?(s=e[e.length-1],t=Array.from(e).slice(0,e.length-1)):t=Array.from(e),[s,t]}class Ks{constructor(e){const t=e.zone||Re.defaultZone;let s=e.invalid||(Number.isNaN(e.ts)?new Ce("invalid input"):null)||(t.isValid?null:Ns(t));this.ts=V(e.ts)?Re.now():e.ts;let r=null,n=null;if(!s){if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(t))[r,n]=[e.old.c,e.old.o];else{const e=t.offset(this.ts);r=$s(this.ts,e),s=Number.isNaN(r.year)?new Ce("invalid input"):null,r=s?null:r,n=s?null:e}}this._zone=t,this.loc=e.loc||Ke.create(),this.invalid=s,this.weekData=null,this.c=r,this.o=n,this.isLuxonDateTime=!0}static now(){return new Ks({})}static local(){const[e,t]=Xs(arguments),[s,r,n,a,i,o,l]=t;return Ys({year:s,month:r,day:n,hour:a,minute:i,second:o,millisecond:l},e)}static utc(){const[e,t]=Xs(arguments),[s,r,n,a,i,o,l]=t;return e.zone=Oe.utcInstance,Ys({year:s,month:r,day:n,hour:a,minute:i,second:o,millisecond:l},e)}static fromJSDate(e,t={}){const s=(r=e,"[object Date]"===Object.prototype.toString.call(r)?e.valueOf():NaN);var r;if(Number.isNaN(s))return Ks.invalid("invalid input");const n=je(t.zone,Re.defaultZone);return n.isValid?new Ks({ts:s,zone:n,loc:Ke.fromObject(t)}):Ks.invalid(Ns(n))}static fromMillis(e,t={}){if(H(e))return e<-Es||e>Es?Ks.invalid("Timestamp out of range"):new Ks({ts:e,zone:je(t.zone,Re.defaultZone),loc:Ke.fromObject(t)});throw new u(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,t={}){if(H(e))return new Ks({ts:1e3*e,zone:je(t.zone,Re.defaultZone),loc:Ke.fromObject(t)});throw new u("fromSeconds requires a numerical input")}static fromObject(e,t={}){e=e||{};const s=je(t.zone,Re.defaultZone);if(!s.isValid)return Ks.invalid(Ns(s));const r=Re.now(),n=V(t.specificOffset)?s.offset(r):t.specificOffset,a=re(e,Gs),i=!V(a.ordinal),l=!V(a.year),u=!V(a.month)||!V(a.day),c=l||u,d=a.weekYear||a.weekNumber,m=Ke.fromObject(t);if((c||i)&&d)throw new o("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(u&&i)throw new o("Can't mix ordinal dates with month/day");const h=d||a.weekday&&!c;let f,g,p=$s(r,n);h?(f=Ws,g=Bs,p=Cs(p)):i?(f=Us,g=Zs,p=Ds(p)):(f=qs,g=zs);let y=!1;for(const e of f){V(a[e])?a[e]=y?g[e]:p[e]:y=!0}const v=h?function(e){const t=_(e.weekYear),s=z(e.weekNumber,1,K(e.weekYear)),r=z(e.weekday,1,7);return t?s?!r&&ws("weekday",e.weekday):ws("week",e.week):ws("weekYear",e.weekYear)}(a):i?function(e){const t=_(e.year),s=z(e.ordinal,1,Y(e.year));return t?!s&&ws("ordinal",e.ordinal):ws("year",e.year)}(a):xs(a),w=v||Ls(a);if(w)return Ks.invalid(w);const S=h?Is(a):i?Ms(a):a,[T,b]=Vs(S,n,s),C=new Ks({ts:T,zone:s,o:b,loc:m});return a.weekday&&c&&e.weekday!==C.weekday?Ks.invalid("mismatched weekday",`you can't specify both a weekday of ${a.weekday} and a date of ${C.toISO()}`):C}static fromISO(e,t={}){const[s,r]=function(e){return tt(e,[xt,Nt],[Lt,Ot],[kt,Ft],[Et,jt])}(e);return _s(s,r,t,"ISO 8601",e)}static fromRFC2822(e,t={}){const[s,r]=function(e){return tt(function(e){return e.replace(/\([^)]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}(e),[St,Tt])}(e);return _s(s,r,t,"RFC 2822",e)}static fromHTTP(e,t={}){const[s,r]=function(e){return tt(e,[bt,Dt],[Ct,Dt],[It,Mt])}(e);return _s(s,r,t,"HTTP",t)}static fromFormat(e,t,s={}){if(V(e)||V(t))throw new u("fromFormat requires an input string and a format");const{locale:r=null,numberingSystem:n=null}=s,a=Ke.fromOpts({locale:r,numberingSystem:n,defaultToEN:!0}),[i,o,l,c]=function(e,t,s){const{result:r,zone:n,specificOffset:a,invalidReason:i}=gs(e,t,s);return[r,n,a,i]}(a,e,t);return c?Ks.invalid(c):_s(i,o,s,`format ${t}`,e,l)}static fromString(e,t,s={}){return Ks.fromFormat(e,t,s)}static fromSQL(e,t={}){const[s,r]=function(e){return tt(e,[Vt,Nt],[Ht,_t])}(e);return _s(s,r,t,"SQL",e)}static invalid(e,t=null){if(!e)throw new u("need to specify a reason the DateTime is invalid");const s=e instanceof Ce?e:new Ce(e,t);if(Re.throwOnInvalid)throw new n(s);return new Ks({invalid:s})}static isDateTime(e){return e&&e.isLuxonDateTime||!1}static parseFormatForOpts(e,t={}){const s=ps(e,Ke.fromObject(t));return s?s.map((e=>e?e.val:null)).join(""):null}static expandFormat(e,t={}){return fs(be.parseFormat(e),Ke.fromObject(t)).map((e=>e.val)).join("")}get(e){return this[e]}get isValid(){return null===this.invalid}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?Os(this).weekYear:NaN}get weekNumber(){return this.isValid?Os(this).weekNumber:NaN}get weekday(){return this.isValid?Os(this).weekday:NaN}get ordinal(){return this.isValid?Ds(this.c).ordinal:NaN}get monthShort(){return this.isValid?Xt.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?Xt.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?Xt.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?Xt.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return!this.isOffsetFixed&&(this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset)}get isInLeapYear(){return G(this.year)}get daysInMonth(){return J(this.year,this.month)}get daysInYear(){return this.isValid?Y(this.year):NaN}get weeksInWeekYear(){return this.isValid?K(this.weekYear):NaN}resolvedLocaleOptions(e={}){const{locale:t,numberingSystem:s,calendar:r}=be.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:t,numberingSystem:s,outputCalendar:r}}toUTC(e=0,t={}){return this.setZone(Oe.instance(e),t)}toLocal(){return this.setZone(Re.defaultZone)}setZone(e,{keepLocalTime:t=!1,keepCalendarTime:s=!1}={}){if((e=je(e,Re.defaultZone)).equals(this.zone))return this;if(e.isValid){let r=this.ts;if(t||s){const t=e.offset(this.ts),s=this.toObject();[r]=Vs(s,t,e)}return Fs(this,{ts:r,zone:e})}return Ks.invalid(Ns(e))}reconfigure({locale:e,numberingSystem:t,outputCalendar:s}={}){return Fs(this,{loc:this.loc.clone({locale:e,numberingSystem:t,outputCalendar:s})})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;const t=re(e,Gs),s=!V(t.weekYear)||!V(t.weekNumber)||!V(t.weekday),r=!V(t.ordinal),n=!V(t.year),a=!V(t.month)||!V(t.day),i=n||a,l=t.weekYear||t.weekNumber;if((i||r)&&l)throw new o("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(a&&r)throw new o("Can't mix ordinal dates with month/day");let u;s?u=Is({...Cs(this.c),...t}):V(t.ordinal)?(u={...this.toObject(),...t},V(t.day)&&(u.day=Math.min(J(u.year,u.month),u.day))):u=Ms({...Ds(this.c),...t});const[c,d]=Vs(u,this.o,this.zone);return Fs(this,{ts:c,o:d})}plus(e){if(!this.isValid)return this;return Fs(this,Hs(this,Gt.fromDurationLike(e)))}minus(e){if(!this.isValid)return this;return Fs(this,Hs(this,Gt.fromDurationLike(e).negate()))}startOf(e){if(!this.isValid)return this;const t={},s=Gt.normalizeUnit(e);switch(s){case"years":t.month=1;case"quarters":case"months":t.day=1;case"weeks":case"days":t.hour=0;case"hours":t.minute=0;case"minutes":t.second=0;case"seconds":t.millisecond=0}if("weeks"===s&&(t.weekday=1),"quarters"===s){const e=Math.ceil(this.month/3);t.month=3*(e-1)+1}return this.set(t)}endOf(e){return this.isValid?this.plus({[e]:1}).startOf(e).minus(1):this}toFormat(e,t={}){return this.isValid?be.create(this.loc.redefaultToEN(t)).formatDateTimeFromString(this,e):ks}toLocaleString(e=f,t={}){return this.isValid?be.create(this.loc.clone(t),e).formatDateTime(this):ks}toLocaleParts(e={}){return this.isValid?be.create(this.loc.clone(e),e).formatDateTimeParts(this):[]}toISO({format:e="extended",suppressSeconds:t=!1,suppressMilliseconds:s=!1,includeOffset:r=!0,extendedZone:n=!1}={}){if(!this.isValid)return null;const a="extended"===e;let i=Ps(this,a);return i+="T",i+=Rs(this,a,t,s,r,n),i}toISODate({format:e="extended"}={}){return this.isValid?Ps(this,"extended"===e):null}toISOWeekDate(){return As(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:e=!1,suppressSeconds:t=!1,includeOffset:s=!0,includePrefix:r=!1,extendedZone:n=!1,format:a="extended"}={}){if(!this.isValid)return null;return(r?"T":"")+Rs(this,"extended"===a,t,e,s,n)}toRFC2822(){return As(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return As(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?Ps(this,!0):null}toSQLTime({includeOffset:e=!0,includeZone:t=!1,includeOffsetSpace:s=!0}={}){let r="HH:mm:ss.SSS";return(t||e)&&(s&&(r+=" "),t?r+="z":e&&(r+="ZZ")),As(this,r,!0)}toSQL(e={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(e)}`:null}toString(){return this.isValid?this.toISO():ks}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(e={}){if(!this.isValid)return{};const t={...this.c};return e.includeConfig&&(t.outputCalendar=this.outputCalendar,t.numberingSystem=this.loc.numberingSystem,t.locale=this.loc.locale),t}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(e,t="milliseconds",s={}){if(!this.isValid||!e.isValid)return Gt.invalid("created by diffing an invalid DateTime");const r={locale:this.locale,numberingSystem:this.numberingSystem,...s},n=(o=t,Array.isArray(o)?o:[o]).map(Gt.normalizeUnit),a=e.valueOf()>this.valueOf(),i=Qt(a?this:e,a?e:this,n,r);var o;return a?i.negate():i}diffNow(e="milliseconds",t={}){return this.diff(Ks.now(),e,t)}until(e){return this.isValid?Jt.fromDateTimes(this,e):this}hasSame(e,t){if(!this.isValid)return!1;const s=e.valueOf(),r=this.setZone(e.zone,{keepLocalTime:!0});return r.startOf(t)<=s&&s<=r.endOf(t)}equals(e){return this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)}toRelative(e={}){if(!this.isValid)return null;const t=e.base||Ks.fromObject({},{zone:this.zone}),s=e.padding?thise.valueOf()),Math.min)}static max(...e){if(!e.every(Ks.isDateTime))throw new u("max requires all arguments be DateTimes");return P(e,(e=>e.valueOf()),Math.max)}static fromFormatExplain(e,t,s={}){const{locale:r=null,numberingSystem:n=null}=s;return gs(Ke.fromOpts({locale:r,numberingSystem:n,defaultToEN:!0}),e,t)}static fromStringExplain(e,t,s={}){return Ks.fromFormatExplain(e,t,s)}static get DATE_SHORT(){return f}static get DATE_MED(){return g}static get DATE_MED_WITH_WEEKDAY(){return p}static get DATE_FULL(){return y}static get DATE_HUGE(){return v}static get TIME_SIMPLE(){return w}static get TIME_WITH_SECONDS(){return S}static get TIME_WITH_SHORT_OFFSET(){return T}static get TIME_WITH_LONG_OFFSET(){return b}static get TIME_24_SIMPLE(){return C}static get TIME_24_WITH_SECONDS(){return I}static get TIME_24_WITH_SHORT_OFFSET(){return D}static get TIME_24_WITH_LONG_OFFSET(){return M}static get DATETIME_SHORT(){return x}static get DATETIME_SHORT_WITH_SECONDS(){return L}static get DATETIME_MED(){return k}static get DATETIME_MED_WITH_SECONDS(){return E}static get DATETIME_MED_WITH_WEEKDAY(){return N}static get DATETIME_FULL(){return O}static get DATETIME_FULL_WITH_SECONDS(){return F}static get DATETIME_HUGE(){return j}static get DATETIME_HUGE_WITH_SECONDS(){return $}}function Qs(e){if(Ks.isDateTime(e))return e;if(e&&e.valueOf&&H(e.valueOf()))return Ks.fromJSDate(e);if(e&&"object"==typeof e)return Ks.fromObject(e);throw new u(`Unknown datetime argument: ${e}, of type ${typeof e}`)}const er="3.1.0"}},t={};function s(r){var n=t[r];if(void 0!==n)return n.exports;var a=t[r]={exports:{}};return e[r](a,a.exports,s),a.exports}s.d=(e,t)=>{for(var r in t)s.o(t,r)&&!s.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),s.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s("./server/scripts/modules/currentweatherscroll.mjs"),s("./server/scripts/modules/currentweather.mjs"),s("./server/scripts/modules/almanac.mjs"),s("./server/scripts/modules/icons.mjs"),s("./server/scripts/modules/extendedforecast.mjs"),s("./server/scripts/modules/hourly.mjs"),s("./server/scripts/modules/latestobservations.mjs"),s("./server/scripts/modules/localforecast.mjs"),s("./server/scripts/modules/radar.mjs"),s("./server/scripts/modules/regionalforecast.mjs"),s("./server/scripts/modules/travelforecast.mjs"),s("./server/scripts/modules/progress.mjs");s("./server/scripts/index.mjs")})(); -//# sourceMappingURL=ws.min.js.map \ No newline at end of file +(()=>{"use strict";var e={407:(e,t,n)=>{var s=n(929),r=n(739),a=n(69);document.addEventListener("DOMContentLoaded",(()=>{c()}));const i={};let o=!1,l=!1;const u=["Land Features","Bay","Channel","Cove","Dam","Delta","Gulf","Lagoon","Lake","Ocean","Reef","Reservoir","Sea","Sound","Strait","Waterfall","Wharf","Amusement Park","Historical Monument","Landmark","Tourist Attraction","Zoo","College","Beach","Campground","Golf Course","Harbor","Nature Reserve","Other Parks and Outdoors","Park","Racetrack","Scenic Overlook","Ski Resort","Sports Center","Sports Field","Wildlife Reserve","Airport","Ferry","Marina","Pier","Port","Resort","Postal","Populated Place"].join(","),c=()=>{document.getElementById("txtAddress").addEventListener("focus",(e=>{e.target.select()})),(0,a.uL)(p),document.getElementById("NavigateMenu").addEventListener("click",y),document.getElementById("NavigateRefresh").addEventListener("click",v),document.getElementById("NavigateNext").addEventListener("click",S),document.getElementById("NavigatePrevious").addEventListener("click",T),document.getElementById("NavigatePlay").addEventListener("click",M),document.getElementById("ToggleFullScreen").addEventListener("click",m),document.getElementById("btnGetGps").addEventListener("click",x),document.getElementById("divTwc").addEventListener("click",(()=>{document.fullscreenElement&&C()})),document.addEventListener("keydown",I),document.addEventListener("touchmove",(e=>{l&&e.preventDefault()})),$("#frmGetLatLng #txtAddress").devbridgeAutocomplete({serviceUrl:"https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/suggest",deferRequestBy:300,paramName:"text",params:{f:"json",countryCode:"USA",category:u,maxSuggestions:10},dataType:"json",transformResult:t=>(o&&(o=!1,window.setTimeout((()=>{$(e.suggestionsContainer.children[0]).click()}),1)),{suggestions:$.map(t.suggestions,(e=>({value:e.text,data:e.magicKey})))}),minChars:3,showNoSuggestionNotice:!0,noSuggestionNotice:"No results found. Please try a different search string.",onSelect(e){d(e,this)},width:490});const e=$("#frmGetLatLng #txtAddress").devbridgeAutocomplete();$("#frmGetLatLng").on("submit",(()=>(e.suggestions[0]&&$(e.suggestionsContainer.children[0]).click(),!1)));const t=localStorage.getItem("TwcQuery");if(t){o=!0;const e=document.getElementById("txtAddress");e.value=t,e.blur(),e.focus()}const n=localStorage.getItem("TwcPlay");null!==n&&"true"!==n||D("navButton","play"),document.getElementById("btnClearQuery").addEventListener("click",(()=>{document.getElementById("spanCity").innerHTML="",document.getElementById("spanState").innerHTML="",document.getElementById("spanStationId").innerHTML="",document.getElementById("spanRadarId").innerHTML="",document.getElementById("spanZoneId").innerHTML="",localStorage.removeItem("TwcScrollText"),localStorage.removeItem("TwcScrollTextChecked"),document.getElementById("chkAutoRefresh").checked=!0,localStorage.removeItem("TwcAutoRefresh"),document.getElementById("radEnglish").checked=!0,localStorage.removeItem("TwcPlay"),D("navButton","play"),localStorage.removeItem("TwcQuery")})),document.getElementById("container").addEventListener("swiped-left",(()=>w("left"))),document.getElementById("container").addEventListener("swiped-right",(()=>w("right")))},d=async(e,t)=>{if(t.previousSuggestionValue!==e.value)if(i[e.value])h(i[e.value]);else{const t=(await(0,s.AV)("https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/find",{data:{text:e.value,magicKey:e.data,f:"json"}})).locations[0];t?h(t.feature.geometry):console.error("An unexpected error occurred. Please try a different search string.")}},h=e=>{const t={lat:Math.round2(e.y,4),lon:Math.round2(e.x,4)};p(t),localStorage.setItem("TwcQuery",document.getElementById("txtAddress").value)},m=()=>(document.fullscreenElement?g():f(),(0,a.yA)()?(0,r.Z)(!0):(0,r.Z)(!1),C(),!1),f=()=>{const e=document.getElementById("divTwc"),t=e.requestFullScreen||e.webkitRequestFullScreen||e.mozRequestFullScreen||e.msRequestFullscreen;t?t.call(e,{navigationUI:"hide"}):(window.scrollTo(0,0),l=!0),(0,a.SI)(),C(),document.getElementById("ToggleFullScreen").title="Exit fullscreen"},g=()=>{l&&(l=!1),document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.msExitFullscreen&&document.msExitFullscreen(),(0,a.SI)(),document.getElementById("ToggleFullScreen").title="Enter fullscreen"},y=()=>(D("navButton","menu"),C(),!1),p=e=>{e&&(p.latLon=e);const{latLon:t}=p;t&&(document.getElementById("txtAddress").blur(),(0,a.QE)(),(0,a.un)(t))},w=e=>{if("left"===e)S();else T()},v=()=>((0,a.HC)(),p(),C(),!1),S=()=>(D("navButton","next"),C(),!1),T=()=>(D("navButton","previous"),C(),!1);let b=null;const C=()=>{document.activeElement.blur(),document.getElementById("divTwcBottom").classList.remove("hidden"),document.getElementById("divTwcBottom").classList.add("visible"),b&&(clearTimeout(b),b=null),b=setTimeout((()=>{document.fullscreenElement&&(document.getElementById("divTwcBottom").classList.remove("visible"),document.getElementById("divTwcBottom").classList.add("hidden"))}),2e3)},I=e=>{const t=e.keyCode||e.which;if((Date.now()-I.lastButton??0)<200)return!1;if(I.lastButton=Date.now(),document.fullscreenElement||document.activeElement===document.body)switch(t){case 32:return M(),!1;case 39:case 34:return S(),!1;case 37:case 33:return T(),!1;case 36:return y(),!1;case 48:return v(),!1;case 70:return m(),!1}return!1};Math.round2=(e,t)=>Number(`${Math.round(`${e}e${t}`)}e-${t}`);const M=()=>(D("navButton","playToggle"),C(),!1),D=(e,t={})=>{(0,a.yw)({type:e,message:t})},x=async()=>{if(!navigator.geolocation)return;const e=await new Promise((e=>{navigator.geolocation.getCurrentPosition(e)})),{latitude:t,longitude:n}=e.coords;let r;try{r=await(0,s.AV)("https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/reverseGeocode",{data:{location:`${n},${t}`,distance:1e3,f:"json"}})}catch(e){console.error("Unable to fetch reverse geocode"),console.error(e.status,e.responseJSONe)}const a=r.address.Postal,{City:i}=r.address,o=`${a}, ${i}, ${states.getTwoDigitCode(r.address.Region)}, ${r.address.CountryCode}`,l=document.getElementById("txtAddress");l.value=o,l.blur(),l.focus(),localStorage.setItem("TwcQuery",o)}},428:(e,t,n)=>{n.d(t,{Z:()=>c});var s=n(138),r=n(732),a=n(38),i=n(159),o=n(69);class l extends i.Z{constructor(e,t){super(e,t,"Almanac",!0),this.backgroundImage0=(0,s.a)("images/BackGround3_1.png"),(0,s.b)("images/2/Full-Moon.gif"),(0,s.b)("images/2/Last-Quarter.gif"),(0,s.b)("images/2/New-Moon.gif"),(0,s.b)("images/2/First-Quarter.gif"),this.timing.totalScreens=1}async getData(e){if(!super.getData(e))return;const t=e??this.weatherParameters,{sun:n,moon:s}=this.calcSunMoonData(t);this.data={sun:n,moon:s},this.setStatus(a.Z.loaded),this.getDataCallback()}calcSunMoonData(e){const t=[SunCalc.getTimes(new Date,e.latitude,e.longitude),SunCalc.getTimes(r.ou.local().plus({days:1}).toJSDate(),e.latitude,e.longitude)],n=[];let s=r.ou.local().minus({days:1}),{phase:a}=SunCalc.getMoonIllumination(s.toJSDate()),i=0;do{const e=a;s=s.plus({days:1}),a=SunCalc.getMoonIllumination(s.toJSDate()).phase,e<.25&&a>=.25&&n.push(this.getMoonTransition(.25,"First",s)),e<.5&&a>=.5&&n.push(this.getMoonTransition(.5,"Full",s)),e<.75&&a>=.75&&n.push(this.getMoonTransition(.75,"Last",s)),e>a&&n.push(this.getMoonTransition(0,"New",s)),i+=1}while(i<=30&&n.length<4);return{sun:t,moon:n}}getMoonTransition(e,t,n,s=0){let r=n,{phase:a}=SunCalc.getMoonIllumination(r.toJSDate()),i=0;const o={hours:0===s?-1:0,minutes:1===s?1:0,seconds:2===s?-1:0,milliseconds:3===s?1:0};let l=(t,n)=>t=e;s%2==0&&(l=(t,n)=>t>e&&n<=e);do{const n=a;if(r=r.plus(o),a=SunCalc.getMoonIllumination(r.toJSDate()).phase,a>.9&&(a-=1),l(n,a)){if(s>=3)break;return this.getMoonTransition(e,t,r,s+1)}i+=1}while(i<1e3);return{phase:t,date:r}}async drawCanvas(){super.drawCanvas();const e=this.data,t=r.ou.local(),n=t.plus({days:1});this.elem.querySelector(".day-1").innerHTML=t.toLocaleString({weekday:"long"}),this.elem.querySelector(".day-2").innerHTML=n.toLocaleString({weekday:"long"}),this.elem.querySelector(".rise-1").innerHTML=r.ou.fromJSDate(e.sun[0].sunrise).toLocaleString(r.ou.TIME_SIMPLE).toLowerCase(),this.elem.querySelector(".rise-2").innerHTML=r.ou.fromJSDate(e.sun[1].sunrise).toLocaleString(r.ou.TIME_SIMPLE).toLowerCase(),this.elem.querySelector(".set-1").innerHTML=r.ou.fromJSDate(e.sun[0].sunset).toLocaleString(r.ou.TIME_SIMPLE).toLowerCase(),this.elem.querySelector(".set-2").innerHTML=r.ou.fromJSDate(e.sun[1].sunset).toLocaleString(r.ou.TIME_SIMPLE).toLowerCase();const s=e.moon.map((e=>{const t={},n=e.date.toLocaleString({month:"short",day:"numeric"});return t.date=n,t.type=e.phase,t.icon={type:"img",src:l.imageName(e.Phase)},this.fillTemplate("day",t)})),a=this.elem.querySelector(".moon .days");a.innerHTML="",a.append(...s),this.finishDraw()}static imageName(e){switch(e){case"Full":return"images/2/Full-Moon.gif";case"Last":return"images/2/Last-Quarter.gif";case"New":return"images/2/New-Moon.gif";default:return"images/2/First-Quarter.gif"}}async getSun(){return new Promise((e=>{this.data&&e(this.data),this.getDataCallbacks.push(e)}))}}const u=new l(7,"almanac");(0,o.G1)(u);const c=u.getSun.bind(u)},172:(e,t,n)=>{n.d(t,{Z:()=>f});var s=n(38),r=n(138),a=n(929),i=n(791),o=n(206),l=n(372),u=n(159),c=n(69),d=n(594);class h extends u.Z{constructor(e,t){super(e,t,"Current Conditions",!0),this.backgroundImage=(0,r.a)("images/BackGround1_1.png")}async getData(e){if(!super.getData(e))return;const t=e??this.weatherParameters;let n,i,o=0;for(;!n&&o150&&(e.PressureDirection="R"),n<-150&&(e.PressureDirection="F"),e.Temperature=(0,d.NE)(e.Temperature),e.TemperatureUnit="F",e.DewPoint=(0,d.NE)(e.DewPoint),e.Ceiling=100*Math.round((0,d.AD)(e.Ceiling)/100),e.CeilingUnit="ft.",e.Visibility=(0,d.dp)(t.visibility.value/1e3),e.VisibilityUnit=" mi.",e.WindSpeed=(0,d.Kh)(e.WindSpeed),e.WindUnit="MPH",e.Pressure=(0,d.MO)(e.Pressure).toFixed(2),e.HeatIndex=(0,d.NE)(e.HeatIndex),e.WindChill=(0,d.NE)(e.WindChill),e.WindGust=(0,d.Kh)(e.WindGust),e}async drawCanvas(){super.drawCanvas();const e={},t=this.parseData();e.temp=t.Temperature+String.fromCharCode(176);let n=t.observations.textDescription;n.length>15&&(n=this.shortConditions(n)),e.condition=n,e.wind=t.WindDirection.padEnd(3,"")+t.WindSpeed.toString().padStart(3," "),t.WindGust&&(e["wind-gusts"]=`Gusts to ${t.WindGust}`),e.location=(0,o.a)(this.data.station.properties.name).substr(0,20),e.humidity=`${t.Humidity}%`,e.dewpoint=t.DewPoint+String.fromCharCode(176),e.ceiling=0===t.Ceiling?"Unlimited":t.Ceiling+t.CeilingUnit,e.visibility=t.Visibility+t.VisibilityUnit,e.pressure=`${t.Pressure} ${t.PressureDirection}`,t.observations.heatIndex.value&&t.HeatIndex!==t.Temperature?(e["heat-index-label"]="Heat Index:",e["heat-index"]=t.HeatIndex+String.fromCharCode(176)):t.observations.windChill.value&&""!==t.WindChill&&t.WindChill{this.data&&e(this.parseData()),this.getDataCallbacks.push((()=>e(this.parseData())))}))}static shortConditions(e){let t=e;return t=t.replace(/Light/g,"L"),t=t.replace(/Heavy/g,"H"),t=t.replace(/Partly/g,"P"),t=t.replace(/Mostly/g,"M"),t=t.replace(/Few/g,"F"),t=t.replace(/Thunderstorm/g,"T'storm"),t=t.replace(/ in /g,""),t=t.replace(/Vicinity/g,""),t=t.replace(/ and /g," "),t=t.replace(/Freezing Rain/g,"Frz Rn"),t=t.replace(/Freezing/g,"Frz"),t=t.replace(/Unknown Precip/g,""),t=t.replace(/L Snow Fog/g,"L Snw/Fog"),t=t.replace(/ with /g,"/"),t}}const m=new h(0,"current-weather");(0,c.G1)(m);const f=m.getCurrentWeather.bind(m)},496:(e,t,n)=>{var s=n(206),r=n(946),a=n(172),i=n(69);const o=String.fromCharCode(176);let l,u=0;const c=()=>{const e=(0,i.Dw)();e?.okToDrawCurrentConditions?(u=(u+1)%h.length,d()):"progress"===e?.elemId&&(u=0)},d=async()=>{const e=await(0,a.Z)();e&&m(h[u](e))},h=[e=>`Conditions at ${(0,s.a)(e.station.properties.name).substr(0,20)}`,e=>{let t=`Temp: ${e.Temperature}${o} ${e.TemperatureUnit}`;return e.observations.heatIndex.value?t+=` Heat Index: ${e.HeatIndex}${o} ${e.TemperatureUnit}`:e.observations.windChill.value&&(t+=` Wind Chill: ${e.WindChill}${o} ${e.TemperatureUnit}`),t},e=>`Humidity: ${e.Humidity}${o} ${e.TemperatureUnit} Dewpoint: ${e.DewPoint}${o} ${e.TemperatureUnit}`,e=>`Barometric Pressure: ${e.Pressure} ${e.PressureDirection}`,e=>{let t="";return t=e.WindSpeed>0?`Wind: ${e.WindDirection} ${e.WindSpeed} ${e.WindUnit}`:"Wind: Calm",e.WindGust>0&&(t+=` Gusts to ${e.WindGust}`),t},e=>`Visib: ${e.Visibility} ${e.VisibilityUnit} Ceiling: ${0===e.Ceiling?"Unlimited":`${e.Ceiling} ${e.CeilingUnit}`}`],m=e=>{(0,r.T)(".weather-display .scroll .fixed",(t=>{t.innerHTML=e}))};document.addEventListener("DOMContentLoaded",(()=>{l||(l=setInterval(c,4e3)),d()}))},582:(e,t,n)=>{var s=n(38),r=n(929),a=n(732),i=n(372),o=n(138),l=n(159),u=n(69);class c extends l.Z{constructor(e,t){super(e,t,"Extended Forecast",!0),this.timing.totalScreens=2}async getData(e){if(!super.getData(e))return;const t=e??this.weatherParameters;let n;try{n=await(0,r.AV)(t.forecast,{data:{units:"us"}})}catch(e){return console.error("Unable to get extended forecast"),console.error(e.status,e.responseJSON),void this.setStatus(s.Z.failed)}this.data=c.parse(n.properties.periods),this.screenIndex=0,this.setStatus(s.Z.loaded)}static parse(e){const t=[0,1,2,3,4,5,6].map((e=>a.ou.local().startOf("day").plus({days:e}).toLocaleString({weekday:"short"})));let n=0;const s=[];return e.forEach((e=>{s[n]||s.push({dayName:"",low:void 0,high:void 0,text:void 0,icon:void 0});const r=s[n];r.icon=(0,i.H8)(e.icon),r.text=c.shortenExtendedForecastText(e.shortForecast),r.dayName=t[n],(0,o.b)(r.icon),e.isDaytime?(r.high=e.temperature,n+=1):r.low=e.temperature})),s}static shortenExtendedForecastText(e){const t=[[/ and /gi," "],[/Slight /gi,""],[/Chance /gi,""],[/Very /gi,""],[/Patchy /gi,""],[/Areas /gi,""],[/Dense /gi,""],[/Thunderstorm/g,"T'Storm"]].reduce(((e,[t,n])=>e.replace(t,n)),e);let n=t.split(" ");-1!==t.indexOf("then")&&(n=t.split(" then "),n=n[1].split(" "));let s=n[0].substr(0,10),r="";n[1]&&(s.endsWith(".")?s=s.replace(/\./,""):r=n[1].substr(0,10),"Blowing"===r&&(r=""));let a=s;return""!==r&&(a+=` ${r}`),a}async drawCanvas(){super.drawCanvas();const e=this.data.slice(0+3*this.screenIndex,3+3*this.screenIndex).map((e=>{const t={};t.date=e.dayName;const{low:n}=e;void 0!==n&&(t["value-lo"]=Math.round(n));const{high:s}=e;return t["value-hi"]=Math.round(s),t.condition=e.text,t.icon={type:"img",src:e.icon},this.fillTemplate("day",t)})),t=this.elem.querySelector(".day-container");t.innerHTML="",t.append(...e),this.finishDraw()}}(0,u.G1)(new c(6,"extended-forecast"))},583:(e,t,n)=>{var s=n(38),r=n(732),a=n(929),i=n(594),o=n(372),l=n(791),u=n(159),c=n(69),d=n(428);class h extends u.Z{constructor(e,t,n){super(e,t,"Hourly Forecast",n),this.timing.baseDelay=20;this.timing.delay=[450];for(let e=0;e<4;e+=1)this.timing.delay.push(300);this.timing.delay.push(150)}async getData(e){if(!super.getData(e))return;let t;try{t=await(0,a.AV)(e.forecastGridData)}catch(e){return console.error("Get hourly forecast failed"),console.error(e.status,e.responseJSON),void this.setStatus(s.Z.failed)}this.data=await h.parseForecast(t.properties),this.setStatus(s.Z.loaded),this.drawLongCanvas()}static async parseForecast(e){const t=h.expand(e.temperature.values),n=h.expand(e.apparentTemperature.values),s=h.expand(e.windSpeed.values),r=h.expand(e.windDirection.values),a=h.expand(e.skyCover.values),o=h.expand(e.weather.values),u=h.expand(e.iceAccumulation.values),c=h.expand(e.probabilityOfPrecipitation.values),d=h.expand(e.snowfallAmount.values),m=await h.determineIcon(a,o,u,c,d,s);return t.map(((e,a)=>({temperature:(0,i.NE)(t[a]),apparentTemperature:(0,i.NE)(n[a]),windSpeed:(0,i.dp)(s[a]),windDirection:(0,l.mt)(r[a]),icon:m[a]})))}static async determineIcon(e,t,n,s,a,i){const l=r.ou.local().startOf("hour"),u=(await(0,d.Z)()).sun,c=r.Xp.fromDateTimes(r.ou.fromJSDate(u[0].sunset),r.ou.fromJSDate(u[1].sunrise)),h=r.ou.fromJSDate(u[1].sunset);return e.map(((r,u)=>{const d=l.plus({hours:u}),m=c.contains(d)||d>h;return(0,o.V6)(e[u],t[u],n[u],s[u],a[u],i[u],m)}))}static expand(e){const t=r.ou.utc().startOf("hour").toMillis(),n=[];return e.forEach((e=>{let s=Date.parse(e.validTime.substr(0,e.validTime.indexOf("/")));const a=s+r.nL.fromISO(e.validTime.substr(e.validTime.indexOf("/")+1)).shiftTo("milliseconds").values.milliseconds;do{s>=t&&n.length<24&&n.push(e.value),s+=36e5}while(s{const s={},r=t.plus({hours:n}).toLocaleString({weekday:"short",hour:"numeric"});s.hour=r;const a=Math.round(e.temperature).toString().padStart(3),i=Math.round(e.apparentTemperature).toString().padStart(3);s.temp=a,a!==i&&(s.like=i);let o="Calm";if(e.windSpeed>0){const t=Math.round(e.windSpeed).toString();o=e.windDirection+Array(6-e.windDirection.length-t.length).join(" ")+t}return s.wind=o,s.icon={type:"img",src:e.icon},this.fillTemplate("hourly-row",s)}));e.append(...n)}drawCanvas(){super.drawCanvas(),this.finishDraw()}showCanvas(){this.drawCanvas(),super.showCanvas()}screenIndexChange(){this.baseCountChange(this.navBaseCount)}baseCountChange(e){let t=Math.min(this.elem.querySelector(".hourly-lines").getBoundingClientRect().height-289,e-150);t<0&&(t=0),this.elem.querySelector(".main").scrollTo(0,t)}static getTravelCitiesDayName(e){return e.reduce(((e,t)=>{if(t&&""===e){return r.ou.local().plus({days:t.today?0:1}).toLocaleString({weekday:"long"})}return e}),"")}}(0,c.G1)(new h(2,"hourly"))},372:(e,t,n)=>{n.d(t,{H8:()=>r,V6:()=>a,gD:()=>s});const s=(e,t)=>{const n=t??e.indexOf("/night/")>=0,s=e=>`images/r/${e}`;let r=e.toLowerCase().match(/[^/]+$/)[0].match(/(.*?)[,?&.]/)[1];const a=+(e.match(/,(\d{2,3})/)??[0,100])[1];if("dualimage"===r){const t=e.match(/&j=(.*)&/);[,r]=t}switch(r+(n?"-n":"")){case"skc":case"hot":case"haze":return s("Sunny.gif");case"skc-n":case"nskc":case"nskc-n":case"cold-n":return s("Clear-1992.gif");case"bkn":return s("Mostly-Cloudy-1994-2.gif");case"bkn-n":case"few-n":case"nfew-n":case"nfew":return s("Partly-Clear-1994-2.gif");case"sct":case"few":return s("Partly-Cloudy.gif");case"sct-n":case"nsct":case"nsct-n":return s("Mostly-Clear.gif");case"ovc":case"ovc-n":return s("Cloudy.gif");case"fog":case"fog-n":return s("Fog.gif");case"rain_sleet":case"sleet":case"sleet-n":return s("Sleet.gif");case"rain_showers":case"rain_showers_high":return s("Scattered-Showers-1994-2.gif");case"rain_showers-n":case"rain_showers_high-n":return s("Scattered-Showers-Night-1994-2.gif");case"rain":case"rain-n":return s("Rain-1992.gif");case"snow":case"snow-n":return s(a>50?"Heavy-Snow-1994-2.gif":"Light-Snow.gif");case"rain_snow":return s("Rain-Snow-1992.gif");case"snow_fzra":case"snow_fzra-n":return s("Freezing-Rain-Snow-1992.gif");case"fzra":case"fzra-n":return s("Freezing-Rain-1992.gif");case"snow_sleet":case"snow_sleet-n":return s("Snow and Sleet.gif");case"tsra_sct":case"tsra":return s("Scattered-Tstorms-1994-2.gif");case"tsra_sct-n":case"tsra-n":return s("Scattered-Tstorms-Night-1994-2.gif");case"tsra_hi":case"tsra_hi-n":case"hurricane":case"tropical_storm":return s("Thunderstorm.gif");case"wind_few":case"wind_sct":case"wind_bkn":case"wind_ovc":return s("Wind.gif");case"wind_skc":return s("Sunny-Wind-1994.gif");case"wind_skc-n":case"wind_sct-n":return s("Clear-Wind-1994.gif");case"blizzard":return s("Blowing Snow.gif");case"cold":return s("cold.gif");default:return console.log(`Unable to locate regional icon for ${r} ${e} ${n}`),!1}},r=(e,t)=>{if(!e)return!1;const n=e=>`images/${e}`,s=t??e.indexOf("/night/")>=0;let r=e.toLowerCase().match(/[^/]+$/)[0].match(/(.*?)[,?&.]/)[1];const a=+(e.match(/,(\d{2,3})/)??[0,100])[1];if("dualimage"===r){const t=e.match(/&j=(.*)&/);[,r]=t}switch(r+(s?"-n":"")){case"skc":case"hot":case"haze":case"cold":return n("CC_Clear1.gif");case"skc-n":case"nskc":case"nskc-n":case"cold-n":return n("CC_Clear0.gif");case"sct":case"few":case"bkn":return n("CC_PartlyCloudy1.gif");case"bkn-n":case"few-n":case"nfew-n":case"nfew":case"sct-n":case"nsct":case"nsct-n":return n("CC_PartlyCloudy0.gif");case"ovc":case"novc":case"ovc-n":return n("CC_Cloudy.gif");case"fog":case"fog-n":return n("CC_Fog.gif");case"rain_sleet":return n("Sleet.gif");case"rain_showers":case"rain_showers_high":case"rain_showers-n":case"rain_showers_high-n":return n("CC_Showers.gif");case"rain":case"rain-n":return n("CC_Rain.gif");case"snow":case"snow-n":return n(a>50?"CC_Snow.gif":"CC_SnowShowers.gif");case"rain_snow":return n("CC_RainSnow.gif");case"snow_fzra":case"snow_fzra-n":case"fzra":case"fzra-n":return n("CC_FreezingRain.gif");case"snow_sleet":return n("Snow-Sleet.gif");case"tsra_sct":case"tsra":return n("EF_ScatTstorms.gif");case"tsra_sct-n":case"tsra-n":case"tsra_hi":case"tsra_hi-n":case"hurricane":case"tropical_storm":return n("CC_TStorm.gif");case"wind_few":case"wind_sct":case"wind_bkn":case"wind_ovc":case"wind_skc":case"wind_skc-n":case"wind_sct-n":return n("CC_Windy.gif");case"blizzard":return n("Blowing-Snow.gif");default:return console.log(`Unable to locate icon for ${r} ${e} ${s}`),!1}},a=(e,t,n,s,r,a,i=!1)=>{const o=e=>`images/r/${e}`;let l=!1,u=!1,c=!1,d=!1,h=!1;return t.forEach((e=>{e.weather&&(e.weather.toLowerCase().includes("thunder")&&(l=!0),e.weather.toLowerCase().includes("snow")&&(u=!0),e.weather.toLowerCase().includes("ice")&&(c=!0),e.weather.toLowerCase().includes("fog")&&(d=!0),e.weather.toLowerCase().includes("wind")&&(h=!0))})),o(n>0||c?"Freezing-Rain-1992.gif":r>10?a>30||h?"Blowing Snow.gif":"Heavy-Snow-1994.gif":(r>0||u)&&l?"ThunderSnow.gif":r>0||u?"Light-Snow.gif":l?"Thunderstorm.gif":s>70?"Rain-1992.gif":s>50?"Shower.gif":s>30?i?"Scattered-Showers-Night.gif":"Scattered-Showers-1994.gif":d?"Fog.gif":e>70?"Cloudy.gif":e>50?i?"Partly-Clear-1994.gif":"Mostly-Cloudy-1994.gif":e>30?i?"Mostly-Clear.gif":"Partly-Cloudy.gif":i?"Clear-1992.gif":"Sunny.gif")}},495:(e,t,n)=>{var s=n(791),r=n(929),a=n(38),i=n(206),o=n(594),l=n(159),u=n(69);class c extends l.Z{constructor(e,t){super(e,t,"Latest Observations",!0),this.MaximumRegionalStations=7}async getData(e){if(!super.getData(e))return;const t=e??this.weatherParameters,n=Object.keys(StationInfo).map((e=>{const n=StationInfo[e],r=(0,s.TE)(n.lat,n.lon,t.latitude,t.longitude);return{...n,distance:r}})).sort(((e,t)=>e.distance-t.distance)).slice(0,30),i=(await Promise.all(n.map((async e=>{try{const t=await(0,r.AV)(`https://api.weather.gov/stations/${e.id}/observations/latest`);return null!==t.properties.temperature.value&&""!==t.properties.textDescription&&null!==t.properties.windSpeed.value&&{...t.properties,StationId:e.id,city:e.city}}catch(t){return console.log(`Unable to get latest observations for ${e.id}`),!1}})))).filter((e=>e));this.data=i.slice(0,this.MaximumRegionalStations),this.data.length<1?this.setStatus(a.Z.noData):this.setStatus(a.Z.loaded)}async drawCanvas(){super.drawCanvas();const e=this.data.sort(((e,t)=>e.Name{const t=(0,s.mt)(e.windDirection.value),n=Math.round((0,o.NE)(e.temperature.value)),r=Math.round((0,o.Kh)(e.windSpeed.value)),a={};return a.location=(0,i.a)(e.city).substr(0,14),a.temp=n,a.weather=c.shortenCurrentConditions(e.textDescription).substr(0,9),a.wind=r>0?t+Array(6-t.length-r.toString().length).join(" ")+r.toString():"NA"===r?"NA":"Calm",this.fillTemplate("observation-row",a)})),n=this.elem.querySelector(".observation-lines");n.innerHTML="",n.append(...t),this.finishDraw()}static shortenCurrentConditions(e){let t=e;return t=t.replace(/Light/,"L"),t=t.replace(/Heavy/,"H"),t=t.replace(/Partly/,"P"),t=t.replace(/Mostly/,"M"),t=t.replace(/Few/,"F"),t=t.replace(/Thunderstorm/,"T'storm"),t=t.replace(/ in /,""),t=t.replace(/Vicinity/,""),t=t.replace(/ and /," "),t=t.replace(/Freezing Rain/,"Frz Rn"),t=t.replace(/Freezing/,"Frz"),t=t.replace(/Unknown Precip/,""),t=t.replace(/L Snow Fog/,"L Snw/Fog"),t=t.replace(/ with /,"/"),t}}(0,u.G1)(new c(1,"latest-observations"))},748:(e,t,n)=>{var s=n(38),r=n(929),a=n(159),i=n(69);class o extends a.Z{constructor(e,t){super(e,t,"Local Forecast",!0),this.timing.baseDelay=5e3}async getData(e){if(!super.getData(e))return;const t=e??this.weatherParameters,n=await this.getRawData(t);if(!n)return void this.setStatus(s.Z.failed);const r=o.parse(n);this.screenTexts=r.map((e=>{let t=`${e.DayName.toUpperCase()}...`;return t+=e.Text.toUpperCase().replace("..."," "),t}));const a=this.screenTexts.map((e=>this.fillTemplate("forecast",{text:e}))),i=this.elem.querySelector(".forecasts");i.innerHTML="",i.append(...a),this.pageHeight=i.parentNode.getBoundingClientRect().height,a.forEach((e=>{const t=Math.ceil(e.scrollHeight/this.pageHeight)*this.pageHeight;e.style.height=`${t}px`})),this.timing.totalScreens=i.scrollHeight/this.pageHeight,this.calcNavTiming(),this.setStatus(s.Z.loaded)}async getRawData(e){try{return await(0,r.AV)(e.forecast,{data:{units:"us"}})}catch(t){return console.error(`GetWeatherForecast failed: ${e.forecast}`),console.error(t.status,t.responseJSON),this.setStatus(s.Z.failed),!1}}async drawCanvas(){super.drawCanvas();const e=-this.screenIndex*this.pageHeight;this.elem.querySelector(".forecasts").style.top=`${e}px`,this.finishDraw()}static parse(e){return e.properties.periods.slice(0,6).map((e=>({DayName:e.name.toUpperCase(),Text:e.detailedForecast})))}}(0,i.G1)(new o(5,"local-forecast"))},69:(e,t,n)=>{n.d(t,{Dw:()=>D,Pl:()=>b,nI:()=>k,yA:()=>S,un:()=>H,yw:()=>g,WI:()=>T,G1:()=>O,Gw:()=>$,uL:()=>q,HC:()=>N,SI:()=>E,QE:()=>P,Nf:()=>p});var s=n(739),r=n(38),a=n(791),i=n(929);document.addEventListener("DOMContentLoaded",(()=>{f()}));const o=[];let l,u=!1;const c={},d=6e5;let h=null,m=0;const f=async()=>{window.addEventListener("resize",E);const e=localStorage.getItem("TwcAutoRefresh");document.getElementById("chkAutoRefresh").checked=!e||"true"===e,document.getElementById("chkAutoRefresh").addEventListener("change",V),F()},g=e=>{if(e.type)if("navButton"===e.type)L(e.message);else console.error(`Unknown event ${e.type}`)},y=async e=>{const t=await(async(e,t)=>{try{return await(0,i.AV)(`https://api.weather.gov/points/${e},${t}`)}catch(n){return console.log(`Unable to get point ${e}, ${t}`),console.error(n),!1}})(e.lat,e.lon),n=await(0,i.AV)(t.properties.observationStations),s=n.features[0].properties.stationIdentifier;let{city:r}=t.properties.relativeLocation.properties;s in StationInfo&&(r=StationInfo[s].city,[r]=r.split("/")),c.latitude=e.lat,c.longitude=e.lon,c.zoneId=t.properties.forecastZone.substr(-6),c.radarId=t.properties.radarStation.substr(-3),c.stationId=s,c.weatherOffice=t.properties.cwa,c.city=r,c.state=t.properties.relativeLocation.properties.state,c.timeZone=t.properties.relativeLocation.properties.timeZone,c.forecast=t.properties.forecast,c.forecastGridData=t.properties.forecastGridData,c.stations=n.features,Z(c),v(),document.getElementById("loading").style.display="none",l&&(await l.drawCanvas(),l.showCanvas()),o.forEach((e=>e.getData(c)))},p=e=>{e.id<0||l&&(l.drawCanvas(o,w()),S()&&0===e.id&&e.status===r.Z.loaded&&C(T.command.firstFrame),w()o.reduce(((e,t)=>t.status!==r.Z.loading?e+1:e),0),v=()=>{o.forEach((e=>e.hideCanvas()))},S=()=>u,T={response:{previous:Symbol("previous"),inProgress:Symbol("inProgress"),next:Symbol("next")},command:{firstFrame:Symbol("firstFrame"),previousFrame:Symbol("previousFrame"),nextFrame:Symbol("nextFrame"),lastFrame:Symbol("lastFrame")}},b=e=>{e.type===T.response.previous&&I(-1),e.type===T.response.next&&I(1)},C=e=>{const t=D();if(l.hideCanvas(),t)e===T.command.nextFrame&&D().navNext(),e===T.command.previousFrame&&D().navPrev();else{let e,t=0;do{o[t].status===r.Z.loaded&&(e=o[t]),t+=1}while(!e&&t{const t=o.length,n=M();let s;for(let i=0;i0&&i.showCanvas(T.command.firstFrame)},M=()=>o.findIndex((e=>e.isActive())),D=()=>o[M()],x=e=>{u=e;const t=document.getElementById("NavigatePlay");localStorage.setItem("TwcPlay",u),u?((0,s.Z)(!0),t.title="Pause",t.src="images/nav/ic_pause_white_24dp_1x.png"):((0,s.Z)(!1),t.title="Play",t.src="images/nav/ic_play_arrow_white_24dp_1x.png"),l&&u&&!D()&&C(T.command.firstFrame)},L=e=>{switch(e){case"play":x(!0);break;case"playToggle":x(!u);break;case"stop":x(!1);break;case"next":x(!1),C(T.command.nextFrame);break;case"previous":x(!1),C(T.command.previousFrame);break;case"menu":x(!1),l.showCanvas(),v();break;default:console.error(`Unknown navButton ${e}`)}},k=e=>o[e],E=()=>{const e=window.innerWidth/640,t=window.innerHeight/480,n=Math.min(e,t);n<1||document.fullscreenElement?document.getElementById("container").style.zoom=n:document.getElementById("container").style.zoom=1},N=()=>{o.forEach((e=>{e.status=r.Z.loading}))},O=e=>{o[e.navId]=e,F()},F=()=>{const e=document.getElementById("enabledDisplays");if(!e)return;const t=o.map((e=>e.generateCheckbox())).filter((e=>e));e.innerHTML="",e.append(...t)},$=e=>{l=e},Z=e=>{document.getElementById("spanCity").innerHTML=`${e.city}, `,document.getElementById("spanState").innerHTML=e.state,document.getElementById("spanStationId").innerHTML=e.stationId,document.getElementById("spanRadarId").innerHTML=e.radarId,document.getElementById("spanZoneId").innerHTML=e.zoneId},V=e=>{const{checked:t}=e.target;t?_():P(),localStorage.setItem("TwcAutoRefresh",t)},A=e=>{e?(document.getElementById("spanLastRefresh").innerHTML=e.toLocaleString("en-US",{weekday:"short",month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}),document.getElementById("chkAutoRefresh").checked&&_()):document.getElementById("spanLastRefresh").innerHTML="(none)"},H=e=>{y(e),A(null)},_=()=>{if(h)return;m=0;const e=()=>{m+=500;let e=d-m;e<0&&(e=0);const t=new Date(e);document.getElementById("spanRefreshCountDown").innerHTML=`${t.getMinutes()<10?`0${t.getMinutes()}`:t.getMinutes()}:${t.getSeconds()<10?`0${t.getSeconds()}`:t.getSeconds()}`,m>=d&&!S()&&B()};h=window.setInterval(e,500),e()},P=()=>{h&&(window.clearInterval(h),document.getElementById("spanRefreshCountDown").innerHTML="--:--",h=null)},z=()=>m>=d&&(B(),!0),B=()=>{B.callback&&B.callback()},q=e=>{B.callback=e}},846:(e,t,n)=>{var s=n(138),r=n(38),a=n(159),i=n(69);class o extends a.Z{constructor(e,t){super(e,t,"",!1),this.backgroundImage=(0,s.a)("images/BackGround1_1.png"),this.timing=!1,document.addEventListener("DOMContentLoaded",(()=>{this.version=document.getElementById("version").innerHTML,this.elem.querySelector(".container").addEventListener("click",this.lineClick.bind(this))})),this.okToDrawCurrentConditions=!1}async drawCanvas(e,t){if(super.drawCanvas(),this.progressCover||(this.progressCover=this.elem.querySelector(".scroll .cover")),!e)return;const n=e.map(((e,t)=>{const n={};let s;switch(n.name=e.name,e.status){case r.Z.loading:s="loading";break;case r.Z.loaded:s="press-here";break;case r.Z.failed:s="failed";break;case r.Z.noData:s="no-data";break;case r.Z.disabled:s="disabled"}const a=this.fillTemplate("item",n);if(!a)return!1;const i=a.querySelector(".links");return i.classList.remove("loading"),i.classList.add(s),i.dataset.index=t,a})).filter((e=>e)),s=this.elem.querySelector(".container");s.innerHTML="",s.append(...n),this.finishDraw();const a=t/e.length;this.progressCover.style.width=100*(1-a)+"%",a<1?this.progressCover.parentNode.classList.add("show"):setTimeout((()=>this.progressCover.parentNode.classList.remove("show")),1e3)}lineClick(e){const t=e.target?.parentNode?.dataset?.index;if(void 0===t)return;const n=+t;(0,i.yw)("navButton");const s=(0,i.nI)(n);s&&s.status===r.Z.loaded&&(s.showCanvas(i.WI.command.firstFrame),this.elem.classList.remove("show"))}}const l=new o(-1,"progress");(0,i.Gw)(l)},873:(e,t,n)=>{var s=n(38),r=n(732),a=n(138),i=n(929),o=n(737),l=n(159),u=n(69);class c extends l.Z{constructor(e,t){super(e,t,"Local Radar",!0),this.okToDrawCurrentConditions=!1,this.okToDrawCurrentDateTime=!1,this.dopplerRadarImageMax=6,this.timing.baseDelay=350,this.timing.delay=[{time:4,si:5},{time:1,si:0},{time:1,si:1},{time:1,si:2},{time:1,si:3},{time:1,si:4},{time:4,si:5},{time:1,si:0},{time:1,si:1},{time:1,si:2},{time:1,si:3},{time:1,si:4},{time:4,si:5},{time:1,si:0},{time:1,si:1},{time:1,si:2},{time:1,si:3},{time:1,si:4},{time:12,si:5}]}async getData(e){if(!super.getData(e))return;const t=e??this.weatherParameters;if("AK"===t.state||"HI"===t.state)return void this.setStatus(s.Z.noData);let n="images/4000RadarMap2.jpg";"HI"===t.State&&(n="images/HawaiiRadarMap2.png"),this.baseMap=await(0,a.a)(n);const l=[];let u=r.ou.utc().minus({days:1}).startOf("day");for(;u<=r.ou.utc().startOf("day");)l.push(`https://mesonet.agron.iastate.edu/archive/data/${u.toFormat("yyyy/LL/dd")}/GIS/uscomp/`),u=u.plus({days:1});const d=(await Promise.all(l.map((async e=>{try{return await(0,i.fL)(e,{cors:!0})}catch(e){return console.log("Unable to get list of radars"),console.error(e),this.setStatus(s.Z.failed),!1}})))).filter((e=>e)).map(((e,t)=>{const n=(new DOMParser).parseFromString(e,"text/html"),s=n.createElement("base");s.href=l[t],n.head.append(s);const r=n.getElementsByTagName("a"),a=[];return Array.from(r).forEach((e=>{e.innerHTML?.includes(".png")&&e.innerHTML?.includes("n0r_")&&a.push(e.href)})),a})).flat(),h=d.sort(((e,t)=>Date(e){const t=document.createElement("canvas");t.width=640,t.height=367;const n=t.getContext("2d");n.imageSmoothingEnabled=!1;const s=await fetch((0,o.d)(e));if(!s.ok)throw new Error(`Unable to fetch radar error ${s.status} ${s.statusText} from ${s.url}`);const i=await s.blob(),l=e.match(/_(\d{4})(\d\d)(\d\d)(\d\d)(\d\d)\./);let u;if(l){const[,e,t,n,s,a]=l;u=r.ou.fromObject({year:e,month:t,day:n,hour:s,minute:a},{zone:"UTC"}).setZone()}else u=r.ou.fromHTTP(s.headers.get("last-modified")).setZone();const d=await(0,a.a)(i);w.clearRect(0,0,g,1600),w.drawImage(d,0,0,g,1600),n.drawImage(await this.baseMap,y.x,y.y,480,276,0,0,640,367);const h=document.createElement("canvas");h.width=640,h.height=367;const m=h.getContext("2d",{willReadFrequently:!0});m.imageSmoothingEnabled=!1,m.drawImage(p,S,T,240,163.1,0,0,640,367),c.removeDopplerRadarImageNoise(m),c.mergeDopplerRadarImage(n,m);const f=this.fillTemplate("frame",{map:{type:"img",src:t.toDataURL()}});return{canvas:t,time:u,elem:f}}))),C=this.elem.querySelector(".scroll-area");C.innerHTML="",C.append(...b.map((e=>e.elem))),this.timing.totalScreens=b.length,this.data=b.map((e=>e.canvas)),this.times=b.map((e=>e.time)),this.setStatus(s.Z.loaded)}async drawCanvas(){super.drawCanvas();const e=this.times[this.screenIndex].toLocaleString(r.ou.TIME_SIMPLE),t=e.length>=8?e:` ${e}`;this.elem.querySelector(".header .right .time").innerHTML=t,this.elem.querySelector(".scroll-area").style.top=371*-this.screenIndex+"px",this.finishDraw()}static getXYFromLatitudeLongitudeMap(e,t,n){let s=0,r=0;return s=55.2*(51.75-e.latitude),s-=n,s>3200-2*n?s=3200-2*n:s<0&&(s=0),r=41.775*(-130.37-e.longitude)*-1,r-=t,r>5100-2*t?r=5100-2*t:r<0&&(r=0),{x:2*r,y:2*s}}static getXYFromLatitudeLongitudeDoppler(e,t,n){let s=0,r=0;return s=61.4481*(51-e.latitude),s-=n,s>6e3-2*n?s=6e3-2*n:s<0&&(s=0),r=42.1768*(-129.138-e.longitude)*-1,r-=t,r>2800-2*t?r=2800-2*t:r<0&&(r=0),{x:2*r,y:2*s}}static removeDopplerRadarImageNoise(e){const t=e.getImageData(0,0,e.canvas.width,e.canvas.height);for(let e=0;e{var s=n(38),r=n(791),a=n(929),i=n(594),o=n(372),l=n(138),u=n(732),c=n(159),d=n(69);class h extends c.Z{constructor(e,t){super(e,t,"Regional Forecast",!0),this.timing.totalScreens=3}async getData(e){if(!super.getData(e))return;const t=e??this.weatherParameters;let n="images/Basemap2.png";"HI"===t.state?n="images/HawaiiRadarMap4.png":"AK"===t.state&&(n="images/AlaskaRadarMap6.png"),this.elem.querySelector(".map img").src=n;const u={x:240,y:117},c=h.getXYFromLatitudeLongitude(t.latitude,t.longitude,u.x,u.y,t.state),d=h.getMinMaxLatitudeLongitude(c.x,c.y,u.x,u.y,t.state);let m=2.5;"HI"===t.state&&(m=1);const f=Object.values(StationInfo).map((e=>({...e,targetDistance:m}))),g=[...RegionalCities,...f],y=[];g.forEach((e=>{if(e.lat>d.minLat&&e.latd.minLon&&e.lon{const a=(0,r.TE)(e.lon,e.lat,s.lon,s.lat);return n&&a>=t}),!0)&&y.push(e)}}));const p=(await Promise.all(y.map((async e=>{try{if(!e.point)throw new Error("No pre-loaded point");const n=h.getRegionalObservation(e.point,e),s=await(0,a.AV)(`https://api.weather.gov/gridpoints/${e.point.wfo}/${e.point.x},${e.point.y}/forecast`),r=h.getXYForCity(e,d.maxLat,d.minLon,t.state),u=await n,c={daytime:!!u.icon.match(/\/day\//),temperature:(0,i.NE)(u.temperature.value),name:h.formatCity(e.city),icon:u.icon,x:r.x,y:r.y};return(0,l.b)((0,o.gD)(c.icon,!c.daytime)),[c,h.buildForecast(s.properties.periods[1],e,r),h.buildForecast(s.properties.periods[2],e,r)]}catch(t){return console.log(`No regional forecast data for '${e.name??e.city}'`),console.log(t),!1}})))).filter((e=>e));0!==p.length?(this.data={regionalData:p,offsetXY:u,sourceXY:c},this.setStatus(s.Z.loaded)):this.setStatus(s.Z.noData)}static buildForecast(e,t,n){return{daytime:e.isDaytime,temperature:e.temperature||0,name:h.formatCity(t.city),icon:e.icon,x:n.x,y:n.y,time:e.startTime}}static async getRegionalObservation(e,t){try{const e=(await(0,a.AV)(`https://api.weather.gov/gridpoints/${t.point.wfo}/${t.point.x},${t.point.y}/stations`)).features[0].id,n=await(0,a.AV)(`${e}/observations/latest`);return!!n.properties.icon&&((0,l.b)((0,o.gD)(n.properties.icon,!n.properties.daytime)),n.properties)}catch(e){return console.log(`Unable to get regional observations for ${t.Name??t.city}`),console.error(e.status,e.responseJSON),!1}}static getXYFromLatitudeLongitude(e,t,n,s,r){if("AK"===r)return h.getXYFromLatitudeLongitudeAK(e,t,n,s);if("HI"===r)return h.getXYFromLatitudeLongitudeHI(e,t,n,s);let a=0,i=0;return a=55.2*(50.5-e),a-=s,a>1600-2*s?a=1600-2*s:a<0&&(a=0),i=41.775*(-127.5-t)*-1,i-=n,i>2550-2*n?i=2550-2*n:i<0&&(i=0),{x:i,y:a}}static getXYFromLatitudeLongitudeAK(e,t,n,s){let r=0,a=0;return r=56*(73-e),r-=s,r>1142-2*s?r=1142-2*s:r<0&&(r=0),a=25*(-175-t)*-1,a-=n,a>1200-2*n?a=1200-2*n:a<0&&(a=0),{x:a,y:r}}static getXYFromLatitudeLongitudeHI(e,t,n,s){let r=0,a=0;return r=55.2*(25-e),r-=s,r>571-2*s?r=571-2*s:r<0&&(r=0),a=41.775*(-164.5-t)*-1,a-=n,a>600-2*n?a=600-2*n:a<0&&(a=0),{x:a,y:r}}static getMinMaxLatitudeLongitude(e,t,n,s,r){if("AK"===r)return h.getMinMaxLatitudeLongitudeAK(e,t,n,s);if("HI"===r)return h.getMinMaxLatitudeLongitudeHI(e,t,n,s);return{minLat:-1*((t+2*s)/55.2-50.5),maxLat:-1*(t/55.2-50.5),minLon:-1*(-1*e/41.775+127.5),maxLon:-1*(-1*(e+2*n)/41.775+127.5)}}static getMinMaxLatitudeLongitudeAK(e,t,n,s){return{minLat:-1*((t+2*s)/56-73),maxLat:-1*(t/56-73),minLon:-1*(-1*e/25+175),maxLon:-1*(-1*(e+2*n)/25+175)}}static getMinMaxLatitudeLongitudeHI(e,t,n,s){return{minLat:-1*((t+2*s)/55.2-25),maxLat:-1*(t/55.2-25),minLon:-1*(-1*e/41.775+164.5),maxLon:-1*(-1*(e+2*n)/41.775+164.5)}}static getXYForCity(e,t,n,s){"AK"===s&&h.getXYForCityAK(e,t,n),"HI"===s&&h.getXYForCityHI(e,t,n);let r=57*(e.lon-n),a=70*(t-e.lat);return a<30&&(a=30),a>282&&(a=282),r<40&&(r=40),r>580&&(r=580),{x:r,y:a}}static getXYForCityAK(e,t,n){let s=37*(e.lon-n),r=70*(t-e.lat);return r<30&&(r=30),r>282&&(r=282),s<40&&(s=40),s>580&&(s=580),{x:s,y:r}}static getXYForCityHI(e,t,n){let s=57*(e.lon-n),r=70*(t-e.lat);return r<30&&(r=30),r>282&&(r=282),s<40&&(s=40),s>580&&(s=580),{x:s,y:r}}static formatCity(e){return e.match(/[^-;/\\,]*/)[0].substr(0,12)}drawCanvas(){super.drawCanvas();const{regionalData:e,sourceXY:t,offsetXY:n}=this.data,s=this.elem.querySelector(".title.dual .top"),r=this.elem.querySelector(".title.dual .bottom");if(0===this.screenIndex)s.innerHTML="Regional",r.innerHTML="Observations";else{const t=u.ou.fromISO(e[0][this.screenIndex].time).toLocaleString({weekday:"long"});s.innerHTML="Forecast for",e[0][this.screenIndex].daytime?r.innerHTML=t:r.innerHTML=`${t} Night`}const a=640/(2*n.x),i=this.elem.querySelector(".map");i.style.zoom=a,i.style.top=`-${t.y}px`,i.style.left=`-${t.x}px`;const l=e.map((e=>{const t={},n=e[this.screenIndex];t.icon={type:"img",src:(0,o.gD)(n.icon,!n.daytime)},t.city=n.name;const{temperature:s}=n;t.temp=s;const r=this.fillTemplate("location",t);return r.style.left=`${n.x}px`,r.style.top=`${n.y}px`,r})),c=this.elem.querySelector(".location-container");c.innerHTML="",c.append(...l),this.finishDraw()}}(0,d.G1)(new h(4,"regional-forecast"))},38:(e,t,n)=>{n.d(t,{Z:()=>s});const s={loading:Symbol("loading"),loaded:Symbol("loaded"),failed:Symbol("failed"),noData:Symbol("noData"),disabled:Symbol("disabled")}},449:(e,t,n)=>{var s=n(38),r=n(929),a=n(372),i=n(732),o=n(159),l=n(69);class u extends o.Z{constructor(e,t,n){super(e,t,"Travel Forecast",n),this.timing.baseDelay=20;const s=TravelCities.length/4,r=Math.floor(s)-2,a=r%1;this.timing.delay=[450];for(let e=0;e{try{if(!e.point)throw new Error("No pre-loaded point");const t=await(0,r.AV)(`https://api.weather.gov/gridpoints/${e.point.wfo}/${e.point.x},${e.point.y}/forecast`),n=t.properties.periods[0].isDaytime?0:1;return{today:0===n,high:t.properties.periods[n].temperature,low:t.properties.periods[n+1].temperature,name:e.Name,icon:(0,a.gD)(t.properties.periods[n].icon)}}catch(t){return console.error(`GetTravelWeather for ${e.Name} failed`),console.error(t.status,t.responseJSON),{name:e.Name,error:!0}}})),t=await Promise.all(e);this.data=t;this.data.reduce(((e,t)=>e||t.high),!1)?(this.setStatus(s.Z.loaded),this.drawLongCanvas()):this.setStatus(s.Z.noData)}async drawLongCanvas(){const e=this.elem.querySelector(".travel-lines");e.innerHTML="";const t=this.data.map((e=>{if(e.error)return!1;const t={};if(t.city=e,e.icon){t.city=e.name;const{low:n,high:s}=e,r=Math.round(n).toString(),a=Math.round(s).toString();t.low=r,t.high=a,t.icon={type:"img",src:e.icon}}else t.error="NO TRAVEL DATA AVAILABLE";return this.fillTemplate("travel-row",t)})).filter((e=>e));e.append(...t)}async drawCanvas(){super.drawCanvas();const e=this.data;this.elem.querySelector(".header .title.dual .bottom").innerHTML=`For ${u.getTravelCitiesDayName(e)}`,this.finishDraw()}async showCanvas(){await this.drawCanvas(),super.showCanvas()}screenIndexChange(){this.baseCountChange(this.navBaseCount)}baseCountChange(e){let t=Math.min(this.elem.querySelector(".travel-lines").getBoundingClientRect().height-289,e-150);t<0&&(t=0),this.elem.querySelector(".main").scrollTo(0,t)}static getTravelCitiesDayName(e){return e.reduce(((e,t)=>{if(t&&""===e){return i.ou.local().plus({days:t.today?0:1}).toLocaleString({weekday:"long"})}return e}),"")}getLongCanvas(){return this.longCanvas}}(0,l.G1)(new u(3,"travel",!1))},791:(e,t,n)=>{n.d(t,{TE:()=>r,mt:()=>s,re:()=>a});const s=e=>["N","NNE","NE","ENE","E","ESE","SE","SSE","S","SSW","SW","WSW","W","WNW","NW","NNW"][Math.floor(e/22.5+.5)%16],r=(e,t,n,s)=>Math.sqrt((n-e)**2+(s-t)**2),a=(e,t)=>(e%t+t)%t},737:(e,t,n)=>{n.d(t,{d:()=>s});const s=e=>{let t=e;return t=t.replace("https://api.weather.gov/",window.location.href),t=t.replace("https://www.cpc.ncep.noaa.gov/",window.location.href),t}},946:(e,t,n)=>{n.d(t,{T:()=>s});const s=(e,t)=>{[...document.querySelectorAll(e)].forEach(t)}},929:(e,t,n)=>{n.d(t,{AV:()=>r,Ik:()=>i,fL:()=>a});var s=n(737);const r=(e,t)=>o(e,"json",t),a=(e,t)=>o(e,"text",t),i=(e,t)=>o(e,"blob",t),o=async(e,t,n={})=>{const r={method:"GET",mode:"cors",type:"GET",...n};let a=e;!0===r.cors&&(a=(0,s.d)(e));const i=new URL(a,`${window.location.origin}/`);i.protocol="localhost"!==window.location.hostname?window.location.protocol:i.protocol,r.data&&Object.keys(r.data).forEach((e=>{const t=r.data[e];i.searchParams.append(e,t)}));const o=await fetch(i,r);if(!o.ok)throw new Error(`Fetch error ${o.status} ${o.statusText} while fetching ${o.url}`);switch(t){case"json":return o.json();case"text":return o.text();case"blob":return o.blob();default:return o}}},138:(e,t,n)=>{n.d(t,{a:()=>a,b:()=>o});var s=n(929),r=n(737);const a=(e,t=!1)=>new Promise((n=>{const s=new Image;if(s.onload=e=>{n(e.target)},e instanceof Blob)s.src=window.URL.createObjectURL(e);else{let n=e;t&&(n=(0,r.d)(e)),s.src=n}})),i=[],o=e=>!i.includes(e)&&((0,s.Ik)(e),!0)},739:(e,t,n)=>{n.d(t,{Z:()=>a});let s=!1;const r=(e=!1)=>(r.controller||(r.controller=new NoSleep),s!==e&&(s=e,e?r.controller.enable():r.controller.disable())),a=r},206:(e,t,n)=>{n.d(t,{a:()=>s});const s=e=>[/^[A-Za-z ]+ \/ /,/^[A-Za-z ]+\//,/^[A-Za-z ]+, /].reduce(((e,t)=>e.replace(t,"")),e)},594:(e,t,n)=>{n.d(t,{AD:()=>i,Kh:()=>s,MO:()=>o,NE:()=>r,dp:()=>a});const s=e=>Math.round(e/1.60934),r=e=>Math.round(9*e/5+32),a=e=>Math.round(e/1.60934),i=e=>Math.round(e/.3048),o=e=>{return t=2953e-7*e,n=2,Number(`${Math.round(`${t}e${n}`)}e-${n}`);var t,n}},159:(e,t,n)=>{n.d(t,{Z:()=>o});var s=n(38),r=n(732),a=n(946),i=n(69);const o=class{constructor(e,t,n,r){this.navId=e,this.elemId=void 0,this.gifs=[],this.data=void 0,this.loadingStatus=s.Z.loading,this.name=n??t,this.getDataCallbacks=[],this.defaultEnabled=r,this.okToDrawCurrentConditions=!0,this.okToDrawCurrentDateTime=!0,this.timing={totalScreens:1,baseDelay:9e3,delay:1},this.navBaseCount=0,this.screenIndex=-1,this.storeElemId(t),this.enabled?this.setStatus(s.Z.loading):this.setStatus(s.Z.disabled),this.startNavCount(),document.addEventListener("DOMContentLoaded",(()=>{this.loadTemplates()}))}generateCheckbox(e=!0){if("progress"===this.elemId)return!1;let t=window.localStorage.getItem(`${this.elemId}Enabled`);null===t&&(t=e),this.enabled="true"===t||!0===t,window.localStorage.setItem(`${this.elemId}Enabled`,this.enabled);const n=document.createElement("template");return n.innerHTML=``,n.content.firstChild.addEventListener("change",(e=>this.checkboxChange(e))),n.content.firstChild}checkboxChange(e){this.enabled=e.target.checked,window.localStorage.setItem(`${this.elemId}Enabled`,this.enabled),this.getData()}setStatus(e){this.status=e,(0,i.Nf)({id:this.navId,status:this.status})}get status(){return this.loadingStatus}set status(e){this.loadingStatus=e}storeElemId(e){this.elemId||(this.elemId=e)}getData(e){return this.data=void 0,e&&(this.weatherParameters=e),this.enabled?(this.setStatus(s.Z.loading),this.calcNavTiming(),!0):(this.setStatus(s.Z.disabled),!1)}getDataCallback(){this.getDataCallbacks.forEach((e=>e(this.data))),this.getDataCallbacks=[]}drawCanvas(){this.screenIndex<0&&(this.screenIndex=0)}finishDraw(){this.okToDrawCurrentDateTime&&(this.drawCurrentDateTime(),this.dateTimeInterval||setInterval((()=>this.drawCurrentDateTime()),100))}drawCurrentDateTime(){if(!this.isActive())return;const e=r.ou.local(),t=e.toLocaleString(r.ou.TIME_WITH_SECONDS).padStart(11," ");this.lastTime!==t&&(0,a.T)(".date-time.time",(e=>{e.innerHTML=t.toUpperCase()})),this.lastTime=t;const n=e.toFormat(" ccc LLL ")+e.day.toString().padStart(2," ");this.lastDate!==n&&(0,a.T)(".date-time.date",(e=>{e.innerHTML=n.toUpperCase()})),this.lastDate=n}showCanvas(e){e===i.WI.command.firstFrame&&this.navNext(e),e===i.WI.command.lastFrame&&this.navPrev(e),this.startNavCount(),this.elem.classList.add("show")}hideCanvas(){this.resetNavBaseCount(),this.elem.classList.remove("show")}isActive(){return 0!==this.elem.offsetHeight}isEnabled(){return this.enabled}navBaseTime(){(0,i.yA)()&&this.isActive()&&(this.navBaseCount+=1,this.baseCountChange&&this.baseCountChange(this.navBaseCount),this.updateScreenFromBaseCount())}async updateScreenFromBaseCount(){const e=this.screenIndexFromBaseCount();!1!==e?e!==this.screenIndex&&(this.screenIndex=-1===e?0:e,this.screenIndexChange?this.screenIndexChange(this.screenIndex):(await this.drawCanvas(),this.showCanvas())):this.sendNavDisplayMessage(i.WI.response.next)}calcNavTiming(){if(!1===this.timing)return;Array.isArray(this.timing.delay)&&(this.timing.totalScreens=this.timing.delay.length);let e=[];if("number"==typeof this.timing.delay)for(let t=0;t"object"==typeof e?e.time:e));let t=0;if(this.timing.fullDelay=e.map((e=>{const n=t+e;return t+=e,n})),Array.isArray(this.timing.delay)&&"object"==typeof this.timing.delay[0])this.timing.screenIndexes=this.timing.delay.map((e=>e.si));else{this.timing.screenIndexes=[];for(let e=0;ee>this.navBaseCount));this.navBaseCount=e}this.updateScreenFromBaseCount()}navPrev(e){if(e===i.WI.command.lastFrame)this.navBaseCount=this.timing.fullDelay[this.timing.totalScreens-1]-1;else{const e=this.timing.fullDelay.reduce(((e,t)=>te>this.navBaseCount));return-1!==e&&this.timing.screenIndexes[e]}startNavCount(){this.navInterval||(this.navInterval=setInterval((()=>this.navBaseTime()),this.timing.baseDelay))}resetNavBaseCount(){this.navBaseCount=0,this.screenIndex=-1,this.navInterval&&(clearInterval(this.navInterval),this.navInterval=void 0)}sendNavDisplayMessage(e){(0,i.Pl)({id:this.navId,type:e})}loadTemplates(){if(this.templates={},this.elem=document.getElementById(`${this.elemId}-html`),!this.elem)return;this.elem.querySelectorAll(".template").forEach((e=>{const t=e.classList[0],n=e.cloneNode(!0);n.classList.remove("template"),this.templates[t]=n,e.remove()}))}fillTemplate(e,t){const n=this.templates[e];if(!n)return!1;const s=n.cloneNode(!0);return Object.entries(t).forEach((([e,t])=>{const n=s.querySelector(`.${e}`);n&&("string"==typeof t||"number"==typeof t?n.innerHTML=t:"img"===t?.type&&(n.querySelector("img").src=t.src))})),s}}},732:(e,t,n)=>{n.d(t,{Xp:()=>Jt,nL:()=>Gt,ou:()=>Qn});class s extends Error{}class r extends s{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}}class a extends s{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}}class i extends s{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}}class o extends s{}class l extends s{constructor(e){super(`Invalid unit ${e}`)}}class u extends s{}class c extends s{constructor(){super("Zone is an abstract class")}}const d="numeric",h="short",m="long",f={year:d,month:d,day:d},g={year:d,month:h,day:d},y={year:d,month:h,day:d,weekday:h},p={year:d,month:m,day:d},w={year:d,month:m,day:d,weekday:m},v={hour:d,minute:d},S={hour:d,minute:d,second:d},T={hour:d,minute:d,second:d,timeZoneName:h},b={hour:d,minute:d,second:d,timeZoneName:m},C={hour:d,minute:d,hourCycle:"h23"},I={hour:d,minute:d,second:d,hourCycle:"h23"},M={hour:d,minute:d,second:d,hourCycle:"h23",timeZoneName:h},D={hour:d,minute:d,second:d,hourCycle:"h23",timeZoneName:m},x={year:d,month:d,day:d,hour:d,minute:d},L={year:d,month:d,day:d,hour:d,minute:d,second:d},k={year:d,month:h,day:d,hour:d,minute:d},E={year:d,month:h,day:d,hour:d,minute:d,second:d},N={year:d,month:h,day:d,weekday:h,hour:d,minute:d},O={year:d,month:m,day:d,hour:d,minute:d,timeZoneName:h},F={year:d,month:m,day:d,hour:d,minute:d,second:d,timeZoneName:h},$={year:d,month:m,day:d,weekday:m,hour:d,minute:d,timeZoneName:m},Z={year:d,month:m,day:d,weekday:m,hour:d,minute:d,second:d,timeZoneName:m};function V(e){return void 0===e}function A(e){return"number"==typeof e}function H(e){return"number"==typeof e&&e%1==0}function _(){try{return"undefined"!=typeof Intl&&!!Intl.RelativeTimeFormat}catch(e){return!1}}function P(e,t,n){if(0!==e.length)return e.reduce(((e,s)=>{const r=[t(s),s];return e&&n(e[0],r[0])===e[0]?e:r}),null)[1]}function z(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function B(e,t,n){return H(e)&&e>=t&&e<=n}function q(e,t=2){let n;return n=e<0?"-"+(""+-e).padStart(t,"0"):(""+e).padStart(t,"0"),n}function R(e){return V(e)||null===e||""===e?void 0:parseInt(e,10)}function W(e){return V(e)||null===e||""===e?void 0:parseFloat(e)}function U(e){if(!V(e)&&null!==e&&""!==e){const t=1e3*parseFloat("0."+e);return Math.floor(t)}}function j(e,t,n=!1){const s=10**t;return(n?Math.trunc:Math.round)(e*s)/s}function G(e){return e%4==0&&(e%100!=0||e%400==0)}function Y(e){return G(e)?366:365}function J(e,t){const n=function(e,t){return e-t*Math.floor(e/t)}(t-1,12)+1;return 2===n?G(e+(t-n)/12)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][n-1]}function X(e){let t=Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,e.second,e.millisecond);return e.year<100&&e.year>=0&&(t=new Date(t),t.setUTCFullYear(t.getUTCFullYear()-1900)),+t}function K(e){const t=(e+Math.floor(e/4)-Math.floor(e/100)+Math.floor(e/400))%7,n=e-1,s=(n+Math.floor(n/4)-Math.floor(n/100)+Math.floor(n/400))%7;return 4===t||3===s?53:52}function Q(e){return e>99?e:e>60?1900+e:2e3+e}function ee(e,t,n,s=null){const r=new Date(e),a={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};s&&(a.timeZone=s);const i={timeZoneName:t,...a},o=new Intl.DateTimeFormat(n,i).formatToParts(r).find((e=>"timezonename"===e.type.toLowerCase()));return o?o.value:null}function te(e,t){let n=parseInt(e,10);Number.isNaN(n)&&(n=0);const s=parseInt(t,10)||0;return 60*n+(n<0||Object.is(n,-0)?-s:s)}function ne(e){const t=Number(e);if("boolean"==typeof e||""===e||Number.isNaN(t))throw new u(`Invalid unit value ${e}`);return t}function se(e,t){const n={};for(const s in e)if(z(e,s)){const r=e[s];if(null==r)continue;n[t(s)]=ne(r)}return n}function re(e,t){const n=Math.trunc(Math.abs(e/60)),s=Math.trunc(Math.abs(e%60)),r=e>=0?"+":"-";switch(t){case"short":return`${r}${q(n,2)}:${q(s,2)}`;case"narrow":return`${r}${n}${s>0?`:${s}`:""}`;case"techie":return`${r}${q(n,2)}${q(s,2)}`;default:throw new RangeError(`Value format ${t} is out of range for property format`)}}function ae(e){return function(e,t){return t.reduce(((t,n)=>(t[n]=e[n],t)),{})}(e,["hour","minute","second","millisecond"])}const ie=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/,oe=["January","February","March","April","May","June","July","August","September","October","November","December"],le=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],ue=["J","F","M","A","M","J","J","A","S","O","N","D"];function ce(e){switch(e){case"narrow":return[...ue];case"short":return[...le];case"long":return[...oe];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const de=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],he=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],me=["M","T","W","T","F","S","S"];function fe(e){switch(e){case"narrow":return[...me];case"short":return[...he];case"long":return[...de];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const ge=["AM","PM"],ye=["Before Christ","Anno Domini"],pe=["BC","AD"],we=["B","A"];function ve(e){switch(e){case"narrow":return[...we];case"short":return[...pe];case"long":return[...ye];default:return null}}function Se(e,t){let n="";for(const s of e)s.literal?n+=s.val:n+=t(s.val);return n}const Te={D:f,DD:g,DDD:p,DDDD:w,t:v,tt:S,ttt:T,tttt:b,T:C,TT:I,TTT:M,TTTT:D,f:x,ff:k,fff:O,ffff:$,F:L,FF:E,FFF:F,FFFF:Z};class be{static create(e,t={}){return new be(e,t)}static parseFormat(e){let t=null,n="",s=!1;const r=[];for(let a=0;a0&&r.push({literal:s,val:n}),t=null,n="",s=!s):s||i===t?n+=i:(n.length>0&&r.push({literal:!1,val:n}),n=i,t=i)}return n.length>0&&r.push({literal:s,val:n}),r}static macroTokenToFormatOpts(e){return Te[e]}constructor(e,t){this.opts=t,this.loc=e,this.systemLoc=null}formatWithSystemDefault(e,t){null===this.systemLoc&&(this.systemLoc=this.loc.redefaultToSystem());return this.systemLoc.dtFormatter(e,{...this.opts,...t}).format()}formatDateTime(e,t={}){return this.loc.dtFormatter(e,{...this.opts,...t}).format()}formatDateTimeParts(e,t={}){return this.loc.dtFormatter(e,{...this.opts,...t}).formatToParts()}resolvedOptions(e,t={}){return this.loc.dtFormatter(e,{...this.opts,...t}).resolvedOptions()}num(e,t=0){if(this.opts.forceSimple)return q(e,t);const n={...this.opts};return t>0&&(n.padTo=t),this.loc.numberFormatter(n).format(e)}formatDateTimeFromString(e,t){const n="en"===this.loc.listingMode(),s=this.loc.outputCalendar&&"gregory"!==this.loc.outputCalendar,r=(t,n)=>this.loc.extract(e,t,n),a=t=>e.isOffsetFixed&&0===e.offset&&t.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,t.format):"",i=()=>n?function(e){return ge[e.hour<12?0:1]}(e):r({hour:"numeric",hourCycle:"h12"},"dayperiod"),o=(t,s)=>n?function(e,t){return ce(t)[e.month-1]}(e,t):r(s?{month:t}:{month:t,day:"numeric"},"month"),l=(t,s)=>n?function(e,t){return fe(t)[e.weekday-1]}(e,t):r(s?{weekday:t}:{weekday:t,month:"long",day:"numeric"},"weekday"),u=t=>{const n=be.macroTokenToFormatOpts(t);return n?this.formatWithSystemDefault(e,n):t},c=t=>n?function(e,t){return ve(t)[e.year<0?0:1]}(e,t):r({era:t},"era");return Se(be.parseFormat(t),(t=>{switch(t){case"S":return this.num(e.millisecond);case"u":case"SSS":return this.num(e.millisecond,3);case"s":return this.num(e.second);case"ss":return this.num(e.second,2);case"uu":return this.num(Math.floor(e.millisecond/10),2);case"uuu":return this.num(Math.floor(e.millisecond/100));case"m":return this.num(e.minute);case"mm":return this.num(e.minute,2);case"h":return this.num(e.hour%12==0?12:e.hour%12);case"hh":return this.num(e.hour%12==0?12:e.hour%12,2);case"H":return this.num(e.hour);case"HH":return this.num(e.hour,2);case"Z":return a({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return a({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return a({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return e.zone.offsetName(e.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return e.zone.offsetName(e.ts,{format:"long",locale:this.loc.locale});case"z":return e.zoneName;case"a":return i();case"d":return s?r({day:"numeric"},"day"):this.num(e.day);case"dd":return s?r({day:"2-digit"},"day"):this.num(e.day,2);case"c":case"E":return this.num(e.weekday);case"ccc":return l("short",!0);case"cccc":return l("long",!0);case"ccccc":return l("narrow",!0);case"EEE":return l("short",!1);case"EEEE":return l("long",!1);case"EEEEE":return l("narrow",!1);case"L":return s?r({month:"numeric",day:"numeric"},"month"):this.num(e.month);case"LL":return s?r({month:"2-digit",day:"numeric"},"month"):this.num(e.month,2);case"LLL":return o("short",!0);case"LLLL":return o("long",!0);case"LLLLL":return o("narrow",!0);case"M":return s?r({month:"numeric"},"month"):this.num(e.month);case"MM":return s?r({month:"2-digit"},"month"):this.num(e.month,2);case"MMM":return o("short",!1);case"MMMM":return o("long",!1);case"MMMMM":return o("narrow",!1);case"y":return s?r({year:"numeric"},"year"):this.num(e.year);case"yy":return s?r({year:"2-digit"},"year"):this.num(e.year.toString().slice(-2),2);case"yyyy":return s?r({year:"numeric"},"year"):this.num(e.year,4);case"yyyyyy":return s?r({year:"numeric"},"year"):this.num(e.year,6);case"G":return c("short");case"GG":return c("long");case"GGGGG":return c("narrow");case"kk":return this.num(e.weekYear.toString().slice(-2),2);case"kkkk":return this.num(e.weekYear,4);case"W":return this.num(e.weekNumber);case"WW":return this.num(e.weekNumber,2);case"o":return this.num(e.ordinal);case"ooo":return this.num(e.ordinal,3);case"q":return this.num(e.quarter);case"qq":return this.num(e.quarter,2);case"X":return this.num(Math.floor(e.ts/1e3));case"x":return this.num(e.ts);default:return u(t)}}))}formatDurationFromString(e,t){const n=e=>{switch(e[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},s=be.parseFormat(t),r=s.reduce(((e,{literal:t,val:n})=>t?e:e.concat(n)),[]);return Se(s,(e=>t=>{const s=n(t);return s?this.num(e.get(s),t.length):t})(e.shiftTo(...r.map(n).filter((e=>e)))))}}class Ce{constructor(e,t){this.reason=e,this.explanation=t}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}class Ie{get type(){throw new c}get name(){throw new c}get ianaName(){return this.name}get isUniversal(){throw new c}offsetName(e,t){throw new c}formatOffset(e,t){throw new c}offset(e){throw new c}equals(e){throw new c}get isValid(){throw new c}}let Me=null;class De extends Ie{static get instance(){return null===Me&&(Me=new De),Me}get type(){return"system"}get name(){return(new Intl.DateTimeFormat).resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:t,locale:n}){return ee(e,t,n)}formatOffset(e,t){return re(this.offset(e),t)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return"system"===e.type}get isValid(){return!0}}let xe={};const Le={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};let ke={};class Ee extends Ie{static create(e){return ke[e]||(ke[e]=new Ee(e)),ke[e]}static resetCache(){ke={},xe={}}static isValidSpecifier(e){return this.isValidZone(e)}static isValidZone(e){if(!e)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:e}).format(),!0}catch(e){return!1}}constructor(e){super(),this.zoneName=e,this.valid=Ee.isValidZone(e)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(e,{format:t,locale:n}){return ee(e,t,n,this.name)}formatOffset(e,t){return re(this.offset(e),t)}offset(e){const t=new Date(e);if(isNaN(t))return NaN;const n=(s=this.name,xe[s]||(xe[s]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:s,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),xe[s]);var s;let[r,a,i,o,l,u,c]=n.formatToParts?function(e,t){const n=e.formatToParts(t),s=[];for(let e=0;e=0?h:1e3+h,(X({year:r,month:a,day:i,hour:24===l?0:l,minute:u,second:c,millisecond:0})-d)/6e4}equals(e){return"iana"===e.type&&e.name===this.name}get isValid(){return this.valid}}let Ne=null;class Oe extends Ie{static get utcInstance(){return null===Ne&&(Ne=new Oe(0)),Ne}static instance(e){return 0===e?Oe.utcInstance:new Oe(e)}static parseSpecifier(e){if(e){const t=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(t)return new Oe(te(t[1],t[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return 0===this.fixed?"UTC":`UTC${re(this.fixed,"narrow")}`}get ianaName(){return 0===this.fixed?"Etc/UTC":`Etc/GMT${re(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,t){return re(this.fixed,t)}get isUniversal(){return!0}offset(){return this.fixed}equals(e){return"fixed"===e.type&&e.fixed===this.fixed}get isValid(){return!0}}class Fe extends Ie{constructor(e){super(),this.zoneName=e}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function $e(e,t){if(V(e)||null===e)return t;if(e instanceof Ie)return e;if("string"==typeof e){const n=e.toLowerCase();return"default"===n?t:"local"===n||"system"===n?De.instance:"utc"===n||"gmt"===n?Oe.utcInstance:Oe.parseSpecifier(n)||Ee.create(e)}return A(e)?Oe.instance(e):"object"==typeof e&&e.offset&&"number"==typeof e.offset?e:new Fe(e)}let Ze,Ve=()=>Date.now(),Ae="system",He=null,_e=null,Pe=null;class ze{static get now(){return Ve}static set now(e){Ve=e}static set defaultZone(e){Ae=e}static get defaultZone(){return $e(Ae,De.instance)}static get defaultLocale(){return He}static set defaultLocale(e){He=e}static get defaultNumberingSystem(){return _e}static set defaultNumberingSystem(e){_e=e}static get defaultOutputCalendar(){return Pe}static set defaultOutputCalendar(e){Pe=e}static get throwOnInvalid(){return Ze}static set throwOnInvalid(e){Ze=e}static resetCaches(){Ke.resetCache(),Ee.resetCache()}}let Be={};let qe={};function Re(e,t={}){const n=JSON.stringify([e,t]);let s=qe[n];return s||(s=new Intl.DateTimeFormat(e,t),qe[n]=s),s}let We={};let Ue={};let je=null;function Ge(e,t,n,s,r){const a=e.listingMode(n);return"error"===a?null:"en"===a?s(t):r(t)}class Ye{constructor(e,t,n){this.padTo=n.padTo||0,this.floor=n.floor||!1;const{padTo:s,floor:r,...a}=n;if(!t||Object.keys(a).length>0){const t={useGrouping:!1,...n};n.padTo>0&&(t.minimumIntegerDigits=n.padTo),this.inf=function(e,t={}){const n=JSON.stringify([e,t]);let s=We[n];return s||(s=new Intl.NumberFormat(e,t),We[n]=s),s}(e,t)}}format(e){if(this.inf){const t=this.floor?Math.floor(e):e;return this.inf.format(t)}return q(this.floor?Math.floor(e):j(e,3),this.padTo)}}class Je{constructor(e,t,n){let s;if(this.opts=n,e.zone.isUniversal){const t=e.offset/60*-1,r=t>=0?`Etc/GMT+${t}`:`Etc/GMT${t}`;0!==e.offset&&Ee.create(r).valid?(s=r,this.dt=e):(s="UTC",n.timeZoneName?this.dt=e:this.dt=0===e.offset?e:Qn.fromMillis(e.ts+60*e.offset*1e3))}else"system"===e.zone.type?this.dt=e:(this.dt=e,s=e.zone.name);const r={...this.opts};s&&(r.timeZone=s),this.dtf=Re(t,r)}format(){return this.dtf.format(this.dt.toJSDate())}formatToParts(){return this.dtf.formatToParts(this.dt.toJSDate())}resolvedOptions(){return this.dtf.resolvedOptions()}}class Xe{constructor(e,t,n){this.opts={style:"long",...n},!t&&_()&&(this.rtf=function(e,t={}){const{base:n,...s}=t,r=JSON.stringify([e,s]);let a=Ue[r];return a||(a=new Intl.RelativeTimeFormat(e,t),Ue[r]=a),a}(e,n))}format(e,t){return this.rtf?this.rtf.format(e,t):function(e,t,n="always",s=!1){const r={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},a=-1===["hours","minutes","seconds"].indexOf(e);if("auto"===n&&a){const n="days"===e;switch(t){case 1:return n?"tomorrow":`next ${r[e][0]}`;case-1:return n?"yesterday":`last ${r[e][0]}`;case 0:return n?"today":`this ${r[e][0]}`}}const i=Object.is(t,-0)||t<0,o=Math.abs(t),l=1===o,u=r[e],c=s?l?u[1]:u[2]||u[1]:l?r[e][0]:e;return i?`${o} ${c} ago`:`in ${o} ${c}`}(t,e,this.opts.numeric,"long"!==this.opts.style)}formatToParts(e,t){return this.rtf?this.rtf.formatToParts(e,t):[]}}class Ke{static fromOpts(e){return Ke.create(e.locale,e.numberingSystem,e.outputCalendar,e.defaultToEN)}static create(e,t,n,s=!1){const r=e||ze.defaultLocale,a=r||(s?"en-US":je||(je=(new Intl.DateTimeFormat).resolvedOptions().locale,je)),i=t||ze.defaultNumberingSystem,o=n||ze.defaultOutputCalendar;return new Ke(a,i,o,r)}static resetCache(){je=null,qe={},We={},Ue={}}static fromObject({locale:e,numberingSystem:t,outputCalendar:n}={}){return Ke.create(e,t,n)}constructor(e,t,n,s){const[r,a,i]=function(e){const t=e.indexOf("-u-");if(-1===t)return[e];{let n;const s=e.substring(0,t);try{n=Re(e).resolvedOptions()}catch(e){n=Re(s).resolvedOptions()}const{numberingSystem:r,calendar:a}=n;return[s,r,a]}}(e);this.locale=r,this.numberingSystem=t||a||null,this.outputCalendar=n||i||null,this.intl=function(e,t,n){return n||t?(e+="-u",n&&(e+=`-ca-${n}`),t&&(e+=`-nu-${t}`),e):e}(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=s,this.fastNumbersCached=null}get fastNumbers(){var e;return null==this.fastNumbersCached&&(this.fastNumbersCached=(!(e=this).numberingSystem||"latn"===e.numberingSystem)&&("latn"===e.numberingSystem||!e.locale||e.locale.startsWith("en")||"latn"===new Intl.DateTimeFormat(e.intl).resolvedOptions().numberingSystem)),this.fastNumbersCached}listingMode(){const e=this.isEnglish(),t=!(null!==this.numberingSystem&&"latn"!==this.numberingSystem||null!==this.outputCalendar&&"gregory"!==this.outputCalendar);return e&&t?"en":"intl"}clone(e){return e&&0!==Object.getOwnPropertyNames(e).length?Ke.create(e.locale||this.specifiedLocale,e.numberingSystem||this.numberingSystem,e.outputCalendar||this.outputCalendar,e.defaultToEN||!1):this}redefaultToEN(e={}){return this.clone({...e,defaultToEN:!0})}redefaultToSystem(e={}){return this.clone({...e,defaultToEN:!1})}months(e,t=!1,n=!0){return Ge(this,e,n,ce,(()=>{const n=t?{month:e,day:"numeric"}:{month:e},s=t?"format":"standalone";return this.monthsCache[s][e]||(this.monthsCache[s][e]=function(e){const t=[];for(let n=1;n<=12;n++){const s=Qn.utc(2016,n,1);t.push(e(s))}return t}((e=>this.extract(e,n,"month")))),this.monthsCache[s][e]}))}weekdays(e,t=!1,n=!0){return Ge(this,e,n,fe,(()=>{const n=t?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},s=t?"format":"standalone";return this.weekdaysCache[s][e]||(this.weekdaysCache[s][e]=function(e){const t=[];for(let n=1;n<=7;n++){const s=Qn.utc(2016,11,13+n);t.push(e(s))}return t}((e=>this.extract(e,n,"weekday")))),this.weekdaysCache[s][e]}))}meridiems(e=!0){return Ge(this,void 0,e,(()=>ge),(()=>{if(!this.meridiemCache){const e={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[Qn.utc(2016,11,13,9),Qn.utc(2016,11,13,19)].map((t=>this.extract(t,e,"dayperiod")))}return this.meridiemCache}))}eras(e,t=!0){return Ge(this,e,t,ve,(()=>{const t={era:e};return this.eraCache[e]||(this.eraCache[e]=[Qn.utc(-40,1,1),Qn.utc(2017,1,1)].map((e=>this.extract(e,t,"era")))),this.eraCache[e]}))}extract(e,t,n){const s=this.dtFormatter(e,t).formatToParts().find((e=>e.type.toLowerCase()===n));return s?s.value:null}numberFormatter(e={}){return new Ye(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,t={}){return new Je(e,this.intl,t)}relFormatter(e={}){return new Xe(this.intl,this.isEnglish(),e)}listFormatter(e={}){return function(e,t={}){const n=JSON.stringify([e,t]);let s=Be[n];return s||(s=new Intl.ListFormat(e,t),Be[n]=s),s}(this.intl,e)}isEnglish(){return"en"===this.locale||"en-us"===this.locale.toLowerCase()||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}equals(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar}}function Qe(...e){const t=e.reduce(((e,t)=>e+t.source),"");return RegExp(`^${t}$`)}function et(...e){return t=>e.reduce((([e,n,s],r)=>{const[a,i,o]=r(t,s);return[{...e,...a},i||n,o]}),[{},null,1]).slice(0,2)}function tt(e,...t){if(null==e)return[null,null];for(const[n,s]of t){const t=n.exec(e);if(t)return s(t)}return[null,null]}function nt(...e){return(t,n)=>{const s={};let r;for(r=0;rvoid 0!==e&&(t||e&&c)?-e:e;return[{years:h(W(n)),months:h(W(s)),weeks:h(W(r)),days:h(W(a)),hours:h(W(i)),minutes:h(W(o)),seconds:h(W(l),"-0"===l),milliseconds:h(U(u),d)}]}const wt={GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function vt(e,t,n,s,r,a,i){const o={year:2===t.length?Q(R(t)):R(t),month:le.indexOf(n)+1,day:R(s),hour:R(r),minute:R(a)};return i&&(o.second=R(i)),e&&(o.weekday=e.length>3?de.indexOf(e)+1:he.indexOf(e)+1),o}const St=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function Tt(e){const[,t,n,s,r,a,i,o,l,u,c,d]=e,h=vt(t,r,s,n,a,i,o);let m;return m=l?wt[l]:u?0:te(c,d),[h,new Oe(m)]}const bt=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,Ct=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,It=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function Mt(e){const[,t,n,s,r,a,i,o]=e;return[vt(t,r,s,n,a,i,o),Oe.utcInstance]}function Dt(e){const[,t,n,s,r,a,i,o]=e;return[vt(t,o,n,s,r,a,i),Oe.utcInstance]}const xt=Qe(/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,it),Lt=Qe(/(\d{4})-?W(\d\d)(?:-?(\d))?/,it),kt=Qe(/(\d{4})-?(\d{3})/,it),Et=Qe(at),Nt=et((function(e,t){return[{year:dt(e,t),month:dt(e,t+1,1),day:dt(e,t+2,1)},null,t+3]}),ht,mt,ft),Ot=et(ot,ht,mt,ft),Ft=et(lt,ht,mt,ft),$t=et(ht,mt,ft);const Zt=et(ht);const Vt=Qe(/(\d{4})-(\d\d)-(\d\d)/,ct),At=Qe(ut),Ht=et(ht,mt,ft);const _t={weeks:{days:7,hours:168,minutes:10080,seconds:604800,milliseconds:6048e5},days:{hours:24,minutes:1440,seconds:86400,milliseconds:864e5},hours:{minutes:60,seconds:3600,milliseconds:36e5},minutes:{seconds:60,milliseconds:6e4},seconds:{milliseconds:1e3}},Pt={years:{quarters:4,months:12,weeks:52,days:365,hours:8760,minutes:525600,seconds:31536e3,milliseconds:31536e6},quarters:{months:3,weeks:13,days:91,hours:2184,minutes:131040,seconds:7862400,milliseconds:78624e5},months:{weeks:4,days:30,hours:720,minutes:43200,seconds:2592e3,milliseconds:2592e6},..._t},zt=365.2425,Bt=30.436875,qt={years:{quarters:4,months:12,weeks:52.1775,days:zt,hours:8765.82,minutes:525949.2,seconds:525949.2*60,milliseconds:525949.2*60*1e3},quarters:{months:3,weeks:13.044375,days:91.310625,hours:2191.455,minutes:131487.3,seconds:525949.2*60/4,milliseconds:7889237999.999999},months:{weeks:4.3481250000000005,days:Bt,hours:730.485,minutes:43829.1,seconds:2629746,milliseconds:2629746e3},..._t},Rt=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],Wt=Rt.slice(0).reverse();function Ut(e,t,n=!1){const s={values:n?t.values:{...e.values,...t.values||{}},loc:e.loc.clone(t.loc),conversionAccuracy:t.conversionAccuracy||e.conversionAccuracy,matrix:t.matrix||e.matrix};return new Gt(s)}function jt(e,t,n,s,r){const a=e[r][n],i=t[n]/a,o=!(Math.sign(i)===Math.sign(s[r]))&&0!==s[r]&&Math.abs(i)<=1?function(e){return e<0?Math.floor(e):Math.ceil(e)}(i):Math.trunc(i);s[r]+=o,t[n]-=o*a}class Gt{constructor(e){const t="longterm"===e.conversionAccuracy||!1;let n=t?qt:Pt;e.matrix&&(n=e.matrix),this.values=e.values,this.loc=e.loc||Ke.create(),this.conversionAccuracy=t?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=n,this.isLuxonDuration=!0}static fromMillis(e,t){return Gt.fromObject({milliseconds:e},t)}static fromObject(e,t={}){if(null==e||"object"!=typeof e)throw new u("Duration.fromObject: argument expected to be an object, got "+(null===e?"null":typeof e));return new Gt({values:se(e,Gt.normalizeUnit),loc:Ke.fromObject(t),conversionAccuracy:t.conversionAccuracy,matrix:t.matrix})}static fromDurationLike(e){if(A(e))return Gt.fromMillis(e);if(Gt.isDuration(e))return e;if("object"==typeof e)return Gt.fromObject(e);throw new u(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,t){const[n]=function(e){return tt(e,[yt,pt])}(e);return n?Gt.fromObject(n,t):Gt.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static fromISOTime(e,t){const[n]=function(e){return tt(e,[gt,Zt])}(e);return n?Gt.fromObject(n,t):Gt.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,t=null){if(!e)throw new u("need to specify a reason the Duration is invalid");const n=e instanceof Ce?e:new Ce(e,t);if(ze.throwOnInvalid)throw new i(n);return new Gt({invalid:n})}static normalizeUnit(e){const t={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[e?e.toLowerCase():e];if(!t)throw new l(e);return t}static isDuration(e){return e&&e.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(e,t={}){const n={...t,floor:!1!==t.round&&!1!==t.floor};return this.isValid?be.create(this.loc,n).formatDurationFromString(this,e):"Invalid Duration"}toHuman(e={}){const t=Rt.map((t=>{const n=this.values[t];return V(n)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...e,unit:t.slice(0,-1)}).format(n)})).filter((e=>e));return this.loc.listFormatter({type:"conjunction",style:e.listStyle||"narrow",...e}).format(t)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let e="P";return 0!==this.years&&(e+=this.years+"Y"),0===this.months&&0===this.quarters||(e+=this.months+3*this.quarters+"M"),0!==this.weeks&&(e+=this.weeks+"W"),0!==this.days&&(e+=this.days+"D"),0===this.hours&&0===this.minutes&&0===this.seconds&&0===this.milliseconds||(e+="T"),0!==this.hours&&(e+=this.hours+"H"),0!==this.minutes&&(e+=this.minutes+"M"),0===this.seconds&&0===this.milliseconds||(e+=j(this.seconds+this.milliseconds/1e3,3)+"S"),"P"===e&&(e+="T0S"),e}toISOTime(e={}){if(!this.isValid)return null;const t=this.toMillis();if(t<0||t>=864e5)return null;e={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...e};const n=this.shiftTo("hours","minutes","seconds","milliseconds");let s="basic"===e.format?"hhmm":"hh:mm";e.suppressSeconds&&0===n.seconds&&0===n.milliseconds||(s+="basic"===e.format?"ss":":ss",e.suppressMilliseconds&&0===n.milliseconds||(s+=".SSS"));let r=n.toFormat(s);return e.includePrefix&&(r="T"+r),r}toJSON(){return this.toISO()}toString(){return this.toISO()}toMillis(){return this.as("milliseconds")}valueOf(){return this.toMillis()}plus(e){if(!this.isValid)return this;const t=Gt.fromDurationLike(e),n={};for(const e of Rt)(z(t.values,e)||z(this.values,e))&&(n[e]=t.get(e)+this.get(e));return Ut(this,{values:n},!0)}minus(e){if(!this.isValid)return this;const t=Gt.fromDurationLike(e);return this.plus(t.negate())}mapUnits(e){if(!this.isValid)return this;const t={};for(const n of Object.keys(this.values))t[n]=ne(e(this.values[n],n));return Ut(this,{values:t},!0)}get(e){return this[Gt.normalizeUnit(e)]}set(e){if(!this.isValid)return this;return Ut(this,{values:{...this.values,...se(e,Gt.normalizeUnit)}})}reconfigure({locale:e,numberingSystem:t,conversionAccuracy:n,matrix:s}={}){return Ut(this,{loc:this.loc.clone({locale:e,numberingSystem:t}),matrix:s,conversionAccuracy:n})}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;const e=this.toObject();return function(e,t){Wt.reduce(((n,s)=>V(t[s])?n:(n&&jt(e,t,n,t,s),s)),null)}(this.matrix,e),Ut(this,{values:e},!0)}rescale(){if(!this.isValid)return this;return Ut(this,{values:function(e){const t={};for(const[n,s]of Object.entries(e))0!==s&&(t[n]=s);return t}(this.normalize().shiftToAll().toObject())},!0)}shiftTo(...e){if(!this.isValid)return this;if(0===e.length)return this;e=e.map((e=>Gt.normalizeUnit(e)));const t={},n={},s=this.toObject();let r;for(const a of Rt)if(e.indexOf(a)>=0){r=a;let e=0;for(const t in n)e+=this.matrix[t][a]*n[t],n[t]=0;A(s[a])&&(e+=s[a]);const i=Math.trunc(e);t[a]=i,n[a]=(1e3*e-1e3*i)/1e3;for(const e in s)Rt.indexOf(e)>Rt.indexOf(a)&&jt(this.matrix,s,e,t,a)}else A(s[a])&&(n[a]=s[a]);for(const e in n)0!==n[e]&&(t[r]+=e===r?n[e]:n[e]/this.matrix[r][e]);return Ut(this,{values:t},!0).normalize()}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;const e={};for(const t of Object.keys(this.values))e[t]=0===this.values[t]?0:-this.values[t];return Ut(this,{values:e},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return null===this.invalid}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(e){if(!this.isValid||!e.isValid)return!1;if(!this.loc.equals(e.loc))return!1;for(const s of Rt)if(t=this.values[s],n=e.values[s],!(void 0===t||0===t?void 0===n||0===n:t===n))return!1;var t,n;return!0}}const Yt="Invalid Interval";class Jt{constructor(e){this.s=e.start,this.e=e.end,this.invalid=e.invalid||null,this.isLuxonInterval=!0}static invalid(e,t=null){if(!e)throw new u("need to specify a reason the Interval is invalid");const n=e instanceof Ce?e:new Ce(e,t);if(ze.throwOnInvalid)throw new a(n);return new Jt({invalid:n})}static fromDateTimes(e,t){const n=es(e),s=es(t),r=function(e,t){return e&&e.isValid?t&&t.isValid?te}isBefore(e){return!!this.isValid&&this.e<=e}contains(e){return!!this.isValid&&(this.s<=e&&this.e>e)}set({start:e,end:t}={}){return this.isValid?Jt.fromDateTimes(e||this.s,t||this.e):this}splitAt(...e){if(!this.isValid)return[];const t=e.map(es).filter((e=>this.contains(e))).sort(),n=[];let{s}=this,r=0;for(;s+this.e?this.e:e;n.push(Jt.fromDateTimes(s,a)),s=a,r+=1}return n}splitBy(e){const t=Gt.fromDurationLike(e);if(!this.isValid||!t.isValid||0===t.as("milliseconds"))return[];let n,{s}=this,r=1;const a=[];for(;se*r)));n=+e>+this.e?this.e:e,a.push(Jt.fromDateTimes(s,n)),s=n,r+=1}return a}divideEqually(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]}overlaps(e){return this.e>e.s&&this.s=e.e)}equals(e){return!(!this.isValid||!e.isValid)&&(this.s.equals(e.s)&&this.e.equals(e.e))}intersection(e){if(!this.isValid)return this;const t=this.s>e.s?this.s:e.s,n=this.e=n?null:Jt.fromDateTimes(t,n)}union(e){if(!this.isValid)return this;const t=this.se.e?this.e:e.e;return Jt.fromDateTimes(t,n)}static merge(e){const[t,n]=e.sort(((e,t)=>e.s-t.s)).reduce((([e,t],n)=>t?t.overlaps(n)||t.abutsStart(n)?[e,t.union(n)]:[e.concat([t]),n]:[e,n]),[[],null]);return n&&t.push(n),t}static xor(e){let t=null,n=0;const s=[],r=e.map((e=>[{time:e.s,type:"s"},{time:e.e,type:"e"}])),a=Array.prototype.concat(...r).sort(((e,t)=>e.time-t.time));for(const e of a)n+="s"===e.type?1:-1,1===n?t=e.time:(t&&+t!=+e.time&&s.push(Jt.fromDateTimes(t,e.time)),t=null);return Jt.merge(s)}difference(...e){return Jt.xor([this].concat(e)).map((e=>this.intersection(e))).filter((e=>e&&!e.isEmpty()))}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:Yt}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:Yt}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:Yt}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:Yt}toFormat(e,{separator:t=" – "}={}){return this.isValid?`${this.s.toFormat(e)}${t}${this.e.toFormat(e)}`:Yt}toDuration(e,t){return this.isValid?this.e.diff(this.s,e,t):Gt.invalid(this.invalidReason)}mapEndpoints(e){return Jt.fromDateTimes(e(this.s),e(this.e))}}class Xt{static hasDST(e=ze.defaultZone){const t=Qn.now().setZone(e).set({month:12});return!e.isUniversal&&t.offset!==t.set({month:6}).offset}static isValidIANAZone(e){return Ee.isValidZone(e)}static normalizeZone(e){return $e(e,ze.defaultZone)}static months(e="long",{locale:t=null,numberingSystem:n=null,locObj:s=null,outputCalendar:r="gregory"}={}){return(s||Ke.create(t,n,r)).months(e)}static monthsFormat(e="long",{locale:t=null,numberingSystem:n=null,locObj:s=null,outputCalendar:r="gregory"}={}){return(s||Ke.create(t,n,r)).months(e,!0)}static weekdays(e="long",{locale:t=null,numberingSystem:n=null,locObj:s=null}={}){return(s||Ke.create(t,n,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:t=null,numberingSystem:n=null,locObj:s=null}={}){return(s||Ke.create(t,n,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return Ke.create(e).meridiems()}static eras(e="short",{locale:t=null}={}){return Ke.create(t,null,"gregory").eras(e)}static features(){return{relative:_()}}}function Kt(e,t){const n=e=>e.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),s=n(t)-n(e);return Math.floor(Gt.fromMillis(s).as("days"))}function Qt(e,t,n,s){let[r,a,i,o]=function(e,t,n){const s=[["years",(e,t)=>t.year-e.year],["quarters",(e,t)=>t.quarter-e.quarter+4*(t.year-e.year)],["months",(e,t)=>t.month-e.month+12*(t.year-e.year)],["weeks",(e,t)=>{const n=Kt(e,t);return(n-n%7)/7}],["days",Kt]],r={};let a,i;for(const[o,l]of s)if(n.indexOf(o)>=0){a=o;let n=l(e,t);i=e.plus({[o]:n}),i>t?(e=e.plus({[o]:n-1}),n-=1):e=i,r[o]=n}return[e,r,i,a]}(e,t,n);const l=t-r,u=n.filter((e=>["hours","minutes","seconds","milliseconds"].indexOf(e)>=0));0===u.length&&(i0?Gt.fromMillis(l,s).shiftTo(...u).plus(c):c}const en={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},tn={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},nn=en.hanidec.replace(/[\[|\]]/g,"").split("");function sn({numberingSystem:e},t=""){return new RegExp(`${en[e||"latn"]}${t}`)}function rn(e,t=(e=>e)){return{regex:e,deser:([e])=>t(function(e){let t=parseInt(e,10);if(isNaN(t)){t="";for(let n=0;n=n&&s<=r&&(t+=s-n)}}return parseInt(t,10)}return t}(e))}}const an=`[ ${String.fromCharCode(160)}]`,on=new RegExp(an,"g");function ln(e){return e.replace(/\./g,"\\.?").replace(on,an)}function un(e){return e.replace(/\./g,"").replace(on," ").toLowerCase()}function cn(e,t){return null===e?null:{regex:RegExp(e.map(ln).join("|")),deser:([n])=>e.findIndex((e=>un(n)===un(e)))+t}}function dn(e,t){return{regex:e,deser:([,e,t])=>te(e,t),groups:t}}function hn(e){return{regex:e,deser:([e])=>e}}const mn={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour:{numeric:"h","2-digit":"hh"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};let fn=null;function gn(e,t){return Array.prototype.concat(...e.map((e=>function(e,t){if(e.literal)return e;const n=pn(be.macroTokenToFormatOpts(e.val),t);return null==n||n.includes(void 0)?e:n}(e,t))))}function yn(e,t,n){const s=gn(be.parseFormat(n),e),r=s.map((t=>function(e,t){const n=sn(t),s=sn(t,"{2}"),r=sn(t,"{3}"),a=sn(t,"{4}"),i=sn(t,"{6}"),o=sn(t,"{1,2}"),l=sn(t,"{1,3}"),u=sn(t,"{1,6}"),c=sn(t,"{1,9}"),d=sn(t,"{2,4}"),h=sn(t,"{4,6}"),m=e=>{return{regex:RegExp((t=e.val,t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&"))),deser:([e])=>e,literal:!0};var t},f=(f=>{if(e.literal)return m(f);switch(f.val){case"G":return cn(t.eras("short",!1),0);case"GG":return cn(t.eras("long",!1),0);case"y":return rn(u);case"yy":case"kk":return rn(d,Q);case"yyyy":case"kkkk":return rn(a);case"yyyyy":return rn(h);case"yyyyyy":return rn(i);case"M":case"L":case"d":case"H":case"h":case"m":case"q":case"s":case"W":return rn(o);case"MM":case"LL":case"dd":case"HH":case"hh":case"mm":case"qq":case"ss":case"WW":return rn(s);case"MMM":return cn(t.months("short",!0,!1),1);case"MMMM":return cn(t.months("long",!0,!1),1);case"LLL":return cn(t.months("short",!1,!1),1);case"LLLL":return cn(t.months("long",!1,!1),1);case"o":case"S":return rn(l);case"ooo":case"SSS":return rn(r);case"u":return hn(c);case"uu":return hn(o);case"uuu":case"E":case"c":return rn(n);case"a":return cn(t.meridiems(),0);case"EEE":return cn(t.weekdays("short",!1,!1),1);case"EEEE":return cn(t.weekdays("long",!1,!1),1);case"ccc":return cn(t.weekdays("short",!0,!1),1);case"cccc":return cn(t.weekdays("long",!0,!1),1);case"Z":case"ZZ":return dn(new RegExp(`([+-]${o.source})(?::(${s.source}))?`),2);case"ZZZ":return dn(new RegExp(`([+-]${o.source})(${s.source})?`),2);case"z":return hn(/[a-z_+-/]{1,256}?/i);default:return m(f)}})(e)||{invalidReason:"missing Intl.DateTimeFormat.formatToParts support"};return f.token=e,f}(t,e))),a=r.find((e=>e.invalidReason));if(a)return{input:t,tokens:s,invalidReason:a.invalidReason};{const[e,n]=function(e){return[`^${e.map((e=>e.regex)).reduce(((e,t)=>`${e}(${t.source})`),"")}$`,e]}(r),a=RegExp(e,"i"),[i,l]=function(e,t,n){const s=e.match(t);if(s){const e={};let t=1;for(const r in n)if(z(n,r)){const a=n[r],i=a.groups?a.groups+1:1;!a.literal&&a.token&&(e[a.token.val[0]]=a.deser(s.slice(t,t+i))),t+=i}return[s,e]}return[s,{}]}(t,a,n),[u,c,d]=l?function(e){let t,n=null;return V(e.z)||(n=Ee.create(e.z)),V(e.Z)||(n||(n=new Oe(e.Z)),t=e.Z),V(e.q)||(e.M=3*(e.q-1)+1),V(e.h)||(e.h<12&&1===e.a?e.h+=12:12===e.h&&0===e.a&&(e.h=0)),0===e.G&&e.y&&(e.y=-e.y),V(e.u)||(e.S=U(e.u)),[Object.keys(e).reduce(((t,n)=>{const s=(e=>{switch(e){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}})(n);return s&&(t[s]=e[n]),t}),{}),n,t]}(l):[null,null,void 0];if(z(l,"a")&&z(l,"H"))throw new o("Can't include meridiem when specifying 24-hour format");return{input:t,tokens:s,regex:a,rawMatches:i,matches:l,result:u,zone:c,specificOffset:d}}}function pn(e,t){if(!e)return null;return be.create(t,e).formatDateTimeParts((fn||(fn=Qn.fromMillis(1555555555555)),fn)).map((t=>function(e,t,n){const{type:s,value:r}=e;if("literal"===s)return{literal:!0,val:r};const a=n[s];let i=mn[s];return"object"==typeof i&&(i=i[a]),i?{literal:!1,val:i}:void 0}(t,0,e)))}const wn=[0,31,59,90,120,151,181,212,243,273,304,334],vn=[0,31,60,91,121,152,182,213,244,274,305,335];function Sn(e,t){return new Ce("unit out of range",`you specified ${t} (of type ${typeof t}) as a ${e}, which is invalid`)}function Tn(e,t,n){const s=new Date(Date.UTC(e,t-1,n));e<100&&e>=0&&s.setUTCFullYear(s.getUTCFullYear()-1900);const r=s.getUTCDay();return 0===r?7:r}function bn(e,t,n){return n+(G(e)?vn:wn)[t-1]}function Cn(e,t){const n=G(e)?vn:wn,s=n.findIndex((e=>eK(t)?(i=t+1,o=1):i=t,{weekYear:i,weekNumber:o,weekday:a,...ae(e)}}function Mn(e){const{weekYear:t,weekNumber:n,weekday:s}=e,r=Tn(t,1,4),a=Y(t);let i,o=7*n+s-r-3;o<1?(i=t-1,o+=Y(i)):o>a?(i=t+1,o-=Y(t)):i=t;const{month:l,day:u}=Cn(i,o);return{year:i,month:l,day:u,...ae(e)}}function Dn(e){const{year:t,month:n,day:s}=e;return{year:t,ordinal:bn(t,n,s),...ae(e)}}function xn(e){const{year:t,ordinal:n}=e,{month:s,day:r}=Cn(t,n);return{year:t,month:s,day:r,...ae(e)}}function Ln(e){const t=H(e.year),n=B(e.month,1,12),s=B(e.day,1,J(e.year,e.month));return t?n?!s&&Sn("day",e.day):Sn("month",e.month):Sn("year",e.year)}function kn(e){const{hour:t,minute:n,second:s,millisecond:r}=e,a=B(t,0,23)||24===t&&0===n&&0===s&&0===r,i=B(n,0,59),o=B(s,0,59),l=B(r,0,999);return a?i?o?!l&&Sn("millisecond",r):Sn("second",s):Sn("minute",n):Sn("hour",t)}const En="Invalid DateTime",Nn=864e13;function On(e){return new Ce("unsupported zone",`the zone "${e.name}" is not supported`)}function Fn(e){return null===e.weekData&&(e.weekData=In(e.c)),e.weekData}function $n(e,t){const n={ts:e.ts,zone:e.zone,c:e.c,o:e.o,loc:e.loc,invalid:e.invalid};return new Qn({...n,...t,old:n})}function Zn(e,t,n){let s=e-60*t*1e3;const r=n.offset(s);if(t===r)return[s,t];s-=60*(r-t)*1e3;const a=n.offset(s);return r===a?[s,r]:[e-60*Math.min(r,a)*1e3,Math.max(r,a)]}function Vn(e,t){const n=new Date(e+=60*t*1e3);return{year:n.getUTCFullYear(),month:n.getUTCMonth()+1,day:n.getUTCDate(),hour:n.getUTCHours(),minute:n.getUTCMinutes(),second:n.getUTCSeconds(),millisecond:n.getUTCMilliseconds()}}function An(e,t,n){return Zn(X(e),t,n)}function Hn(e,t){const n=e.o,s=e.c.year+Math.trunc(t.years),r=e.c.month+Math.trunc(t.months)+3*Math.trunc(t.quarters),a={...e.c,year:s,month:r,day:Math.min(e.c.day,J(s,r))+Math.trunc(t.days)+7*Math.trunc(t.weeks)},i=Gt.fromObject({years:t.years-Math.trunc(t.years),quarters:t.quarters-Math.trunc(t.quarters),months:t.months-Math.trunc(t.months),weeks:t.weeks-Math.trunc(t.weeks),days:t.days-Math.trunc(t.days),hours:t.hours,minutes:t.minutes,seconds:t.seconds,milliseconds:t.milliseconds}).as("milliseconds"),o=X(a);let[l,u]=Zn(o,n,e.zone);return 0!==i&&(l+=i,u=e.zone.offset(l)),{ts:l,o:u}}function _n(e,t,n,s,r,a){const{setZone:i,zone:o}=n;if(e&&0!==Object.keys(e).length){const s=t||o,r=Qn.fromObject(e,{...n,zone:s,specificOffset:a});return i?r:r.setZone(o)}return Qn.invalid(new Ce("unparsable",`the input "${r}" can't be parsed as ${s}`))}function Pn(e,t,n=!0){return e.isValid?be.create(Ke.create("en-US"),{allowZ:n,forceSimple:!0}).formatDateTimeFromString(e,t):null}function zn(e,t){const n=e.c.year>9999||e.c.year<0;let s="";return n&&e.c.year>=0&&(s+="+"),s+=q(e.c.year,n?6:4),t?(s+="-",s+=q(e.c.month),s+="-",s+=q(e.c.day)):(s+=q(e.c.month),s+=q(e.c.day)),s}function Bn(e,t,n,s,r,a){let i=q(e.c.hour);return t?(i+=":",i+=q(e.c.minute),0===e.c.second&&n||(i+=":")):i+=q(e.c.minute),0===e.c.second&&n||(i+=q(e.c.second),0===e.c.millisecond&&s||(i+=".",i+=q(e.c.millisecond,3))),r&&(e.isOffsetFixed&&0===e.offset&&!a?i+="Z":e.o<0?(i+="-",i+=q(Math.trunc(-e.o/60)),i+=":",i+=q(Math.trunc(-e.o%60))):(i+="+",i+=q(Math.trunc(e.o/60)),i+=":",i+=q(Math.trunc(e.o%60)))),a&&(i+="["+e.zone.ianaName+"]"),i}const qn={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},Rn={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},Wn={ordinal:1,hour:0,minute:0,second:0,millisecond:0},Un=["year","month","day","hour","minute","second","millisecond"],jn=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],Gn=["year","ordinal","hour","minute","second","millisecond"];function Yn(e){const t={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[e.toLowerCase()];if(!t)throw new l(e);return t}function Jn(e,t){const n=$e(t.zone,ze.defaultZone),s=Ke.fromObject(t),r=ze.now();let a,i;if(V(e.year))a=r;else{for(const t of Un)V(e[t])&&(e[t]=qn[t]);const t=Ln(e)||kn(e);if(t)return Qn.invalid(t);const s=n.offset(r);[a,i]=An(e,s,n)}return new Qn({ts:a,zone:n,loc:s,o:i})}function Xn(e,t,n){const s=!!V(n.round)||n.round,r=(e,r)=>{e=j(e,s||n.calendary?0:2,!0);return t.loc.clone(n).relFormatter(n).format(e,r)},a=s=>n.calendary?t.hasSame(e,s)?0:t.startOf(s).diff(e.startOf(s),s).get(s):t.diff(e,s).get(s);if(n.unit)return r(a(n.unit),n.unit);for(const e of n.units){const t=a(e);if(Math.abs(t)>=1)return r(t,e)}return r(e>t?-0:0,n.units[n.units.length-1])}function Kn(e){let t,n={};return e.length>0&&"object"==typeof e[e.length-1]?(n=e[e.length-1],t=Array.from(e).slice(0,e.length-1)):t=Array.from(e),[n,t]}class Qn{constructor(e){const t=e.zone||ze.defaultZone;let n=e.invalid||(Number.isNaN(e.ts)?new Ce("invalid input"):null)||(t.isValid?null:On(t));this.ts=V(e.ts)?ze.now():e.ts;let s=null,r=null;if(!n){if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(t))[s,r]=[e.old.c,e.old.o];else{const e=t.offset(this.ts);s=Vn(this.ts,e),n=Number.isNaN(s.year)?new Ce("invalid input"):null,s=n?null:s,r=n?null:e}}this._zone=t,this.loc=e.loc||Ke.create(),this.invalid=n,this.weekData=null,this.c=s,this.o=r,this.isLuxonDateTime=!0}static now(){return new Qn({})}static local(){const[e,t]=Kn(arguments),[n,s,r,a,i,o,l]=t;return Jn({year:n,month:s,day:r,hour:a,minute:i,second:o,millisecond:l},e)}static utc(){const[e,t]=Kn(arguments),[n,s,r,a,i,o,l]=t;return e.zone=Oe.utcInstance,Jn({year:n,month:s,day:r,hour:a,minute:i,second:o,millisecond:l},e)}static fromJSDate(e,t={}){const n=(s=e,"[object Date]"===Object.prototype.toString.call(s)?e.valueOf():NaN);var s;if(Number.isNaN(n))return Qn.invalid("invalid input");const r=$e(t.zone,ze.defaultZone);return r.isValid?new Qn({ts:n,zone:r,loc:Ke.fromObject(t)}):Qn.invalid(On(r))}static fromMillis(e,t={}){if(A(e))return e<-Nn||e>Nn?Qn.invalid("Timestamp out of range"):new Qn({ts:e,zone:$e(t.zone,ze.defaultZone),loc:Ke.fromObject(t)});throw new u(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,t={}){if(A(e))return new Qn({ts:1e3*e,zone:$e(t.zone,ze.defaultZone),loc:Ke.fromObject(t)});throw new u("fromSeconds requires a numerical input")}static fromObject(e,t={}){e=e||{};const n=$e(t.zone,ze.defaultZone);if(!n.isValid)return Qn.invalid(On(n));const s=ze.now(),r=V(t.specificOffset)?n.offset(s):t.specificOffset,a=se(e,Yn),i=!V(a.ordinal),l=!V(a.year),u=!V(a.month)||!V(a.day),c=l||u,d=a.weekYear||a.weekNumber,h=Ke.fromObject(t);if((c||i)&&d)throw new o("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(u&&i)throw new o("Can't mix ordinal dates with month/day");const m=d||a.weekday&&!c;let f,g,y=Vn(s,r);m?(f=jn,g=Rn,y=In(y)):i?(f=Gn,g=Wn,y=Dn(y)):(f=Un,g=qn);let p=!1;for(const e of f){V(a[e])?a[e]=p?g[e]:y[e]:p=!0}const w=m?function(e){const t=H(e.weekYear),n=B(e.weekNumber,1,K(e.weekYear)),s=B(e.weekday,1,7);return t?n?!s&&Sn("weekday",e.weekday):Sn("week",e.week):Sn("weekYear",e.weekYear)}(a):i?function(e){const t=H(e.year),n=B(e.ordinal,1,Y(e.year));return t?!n&&Sn("ordinal",e.ordinal):Sn("year",e.year)}(a):Ln(a),v=w||kn(a);if(v)return Qn.invalid(v);const S=m?Mn(a):i?xn(a):a,[T,b]=An(S,r,n),C=new Qn({ts:T,zone:n,o:b,loc:h});return a.weekday&&c&&e.weekday!==C.weekday?Qn.invalid("mismatched weekday",`you can't specify both a weekday of ${a.weekday} and a date of ${C.toISO()}`):C}static fromISO(e,t={}){const[n,s]=function(e){return tt(e,[xt,Nt],[Lt,Ot],[kt,Ft],[Et,$t])}(e);return _n(n,s,t,"ISO 8601",e)}static fromRFC2822(e,t={}){const[n,s]=function(e){return tt(function(e){return e.replace(/\([^)]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}(e),[St,Tt])}(e);return _n(n,s,t,"RFC 2822",e)}static fromHTTP(e,t={}){const[n,s]=function(e){return tt(e,[bt,Mt],[Ct,Mt],[It,Dt])}(e);return _n(n,s,t,"HTTP",t)}static fromFormat(e,t,n={}){if(V(e)||V(t))throw new u("fromFormat requires an input string and a format");const{locale:s=null,numberingSystem:r=null}=n,a=Ke.fromOpts({locale:s,numberingSystem:r,defaultToEN:!0}),[i,o,l,c]=function(e,t,n){const{result:s,zone:r,specificOffset:a,invalidReason:i}=yn(e,t,n);return[s,r,a,i]}(a,e,t);return c?Qn.invalid(c):_n(i,o,n,`format ${t}`,e,l)}static fromString(e,t,n={}){return Qn.fromFormat(e,t,n)}static fromSQL(e,t={}){const[n,s]=function(e){return tt(e,[Vt,Nt],[At,Ht])}(e);return _n(n,s,t,"SQL",e)}static invalid(e,t=null){if(!e)throw new u("need to specify a reason the DateTime is invalid");const n=e instanceof Ce?e:new Ce(e,t);if(ze.throwOnInvalid)throw new r(n);return new Qn({invalid:n})}static isDateTime(e){return e&&e.isLuxonDateTime||!1}static parseFormatForOpts(e,t={}){const n=pn(e,Ke.fromObject(t));return n?n.map((e=>e?e.val:null)).join(""):null}static expandFormat(e,t={}){return gn(be.parseFormat(e),Ke.fromObject(t)).map((e=>e.val)).join("")}get(e){return this[e]}get isValid(){return null===this.invalid}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?Fn(this).weekYear:NaN}get weekNumber(){return this.isValid?Fn(this).weekNumber:NaN}get weekday(){return this.isValid?Fn(this).weekday:NaN}get ordinal(){return this.isValid?Dn(this.c).ordinal:NaN}get monthShort(){return this.isValid?Xt.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?Xt.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?Xt.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?Xt.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return!this.isOffsetFixed&&(this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset)}get isInLeapYear(){return G(this.year)}get daysInMonth(){return J(this.year,this.month)}get daysInYear(){return this.isValid?Y(this.year):NaN}get weeksInWeekYear(){return this.isValid?K(this.weekYear):NaN}resolvedLocaleOptions(e={}){const{locale:t,numberingSystem:n,calendar:s}=be.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:t,numberingSystem:n,outputCalendar:s}}toUTC(e=0,t={}){return this.setZone(Oe.instance(e),t)}toLocal(){return this.setZone(ze.defaultZone)}setZone(e,{keepLocalTime:t=!1,keepCalendarTime:n=!1}={}){if((e=$e(e,ze.defaultZone)).equals(this.zone))return this;if(e.isValid){let s=this.ts;if(t||n){const t=e.offset(this.ts),n=this.toObject();[s]=An(n,t,e)}return $n(this,{ts:s,zone:e})}return Qn.invalid(On(e))}reconfigure({locale:e,numberingSystem:t,outputCalendar:n}={}){return $n(this,{loc:this.loc.clone({locale:e,numberingSystem:t,outputCalendar:n})})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;const t=se(e,Yn),n=!V(t.weekYear)||!V(t.weekNumber)||!V(t.weekday),s=!V(t.ordinal),r=!V(t.year),a=!V(t.month)||!V(t.day),i=r||a,l=t.weekYear||t.weekNumber;if((i||s)&&l)throw new o("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(a&&s)throw new o("Can't mix ordinal dates with month/day");let u;n?u=Mn({...In(this.c),...t}):V(t.ordinal)?(u={...this.toObject(),...t},V(t.day)&&(u.day=Math.min(J(u.year,u.month),u.day))):u=xn({...Dn(this.c),...t});const[c,d]=An(u,this.o,this.zone);return $n(this,{ts:c,o:d})}plus(e){if(!this.isValid)return this;return $n(this,Hn(this,Gt.fromDurationLike(e)))}minus(e){if(!this.isValid)return this;return $n(this,Hn(this,Gt.fromDurationLike(e).negate()))}startOf(e){if(!this.isValid)return this;const t={},n=Gt.normalizeUnit(e);switch(n){case"years":t.month=1;case"quarters":case"months":t.day=1;case"weeks":case"days":t.hour=0;case"hours":t.minute=0;case"minutes":t.second=0;case"seconds":t.millisecond=0}if("weeks"===n&&(t.weekday=1),"quarters"===n){const e=Math.ceil(this.month/3);t.month=3*(e-1)+1}return this.set(t)}endOf(e){return this.isValid?this.plus({[e]:1}).startOf(e).minus(1):this}toFormat(e,t={}){return this.isValid?be.create(this.loc.redefaultToEN(t)).formatDateTimeFromString(this,e):En}toLocaleString(e=f,t={}){return this.isValid?be.create(this.loc.clone(t),e).formatDateTime(this):En}toLocaleParts(e={}){return this.isValid?be.create(this.loc.clone(e),e).formatDateTimeParts(this):[]}toISO({format:e="extended",suppressSeconds:t=!1,suppressMilliseconds:n=!1,includeOffset:s=!0,extendedZone:r=!1}={}){if(!this.isValid)return null;const a="extended"===e;let i=zn(this,a);return i+="T",i+=Bn(this,a,t,n,s,r),i}toISODate({format:e="extended"}={}){return this.isValid?zn(this,"extended"===e):null}toISOWeekDate(){return Pn(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:e=!1,suppressSeconds:t=!1,includeOffset:n=!0,includePrefix:s=!1,extendedZone:r=!1,format:a="extended"}={}){if(!this.isValid)return null;return(s?"T":"")+Bn(this,"extended"===a,t,e,n,r)}toRFC2822(){return Pn(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return Pn(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?zn(this,!0):null}toSQLTime({includeOffset:e=!0,includeZone:t=!1,includeOffsetSpace:n=!0}={}){let s="HH:mm:ss.SSS";return(t||e)&&(n&&(s+=" "),t?s+="z":e&&(s+="ZZ")),Pn(this,s,!0)}toSQL(e={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(e)}`:null}toString(){return this.isValid?this.toISO():En}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(e={}){if(!this.isValid)return{};const t={...this.c};return e.includeConfig&&(t.outputCalendar=this.outputCalendar,t.numberingSystem=this.loc.numberingSystem,t.locale=this.loc.locale),t}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(e,t="milliseconds",n={}){if(!this.isValid||!e.isValid)return Gt.invalid("created by diffing an invalid DateTime");const s={locale:this.locale,numberingSystem:this.numberingSystem,...n},r=(o=t,Array.isArray(o)?o:[o]).map(Gt.normalizeUnit),a=e.valueOf()>this.valueOf(),i=Qt(a?this:e,a?e:this,r,s);var o;return a?i.negate():i}diffNow(e="milliseconds",t={}){return this.diff(Qn.now(),e,t)}until(e){return this.isValid?Jt.fromDateTimes(this,e):this}hasSame(e,t){if(!this.isValid)return!1;const n=e.valueOf(),s=this.setZone(e.zone,{keepLocalTime:!0});return s.startOf(t)<=n&&n<=s.endOf(t)}equals(e){return this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)}toRelative(e={}){if(!this.isValid)return null;const t=e.base||Qn.fromObject({},{zone:this.zone}),n=e.padding?thise.valueOf()),Math.min)}static max(...e){if(!e.every(Qn.isDateTime))throw new u("max requires all arguments be DateTimes");return P(e,(e=>e.valueOf()),Math.max)}static fromFormatExplain(e,t,n={}){const{locale:s=null,numberingSystem:r=null}=n;return yn(Ke.fromOpts({locale:s,numberingSystem:r,defaultToEN:!0}),e,t)}static fromStringExplain(e,t,n={}){return Qn.fromFormatExplain(e,t,n)}static get DATE_SHORT(){return f}static get DATE_MED(){return g}static get DATE_MED_WITH_WEEKDAY(){return y}static get DATE_FULL(){return p}static get DATE_HUGE(){return w}static get TIME_SIMPLE(){return v}static get TIME_WITH_SECONDS(){return S}static get TIME_WITH_SHORT_OFFSET(){return T}static get TIME_WITH_LONG_OFFSET(){return b}static get TIME_24_SIMPLE(){return C}static get TIME_24_WITH_SECONDS(){return I}static get TIME_24_WITH_SHORT_OFFSET(){return M}static get TIME_24_WITH_LONG_OFFSET(){return D}static get DATETIME_SHORT(){return x}static get DATETIME_SHORT_WITH_SECONDS(){return L}static get DATETIME_MED(){return k}static get DATETIME_MED_WITH_SECONDS(){return E}static get DATETIME_MED_WITH_WEEKDAY(){return N}static get DATETIME_FULL(){return O}static get DATETIME_FULL_WITH_SECONDS(){return F}static get DATETIME_HUGE(){return $}static get DATETIME_HUGE_WITH_SECONDS(){return Z}}function es(e){if(Qn.isDateTime(e))return e;if(e&&e.valueOf&&A(e.valueOf()))return Qn.fromJSDate(e);if(e&&"object"==typeof e)return Qn.fromObject(e);throw new u(`Unknown datetime argument: ${e}, of type ${typeof e}`)}}},t={};function n(s){var r=t[s];if(void 0!==r)return r.exports;var a=t[s]={exports:{}};return e[s](a,a.exports,n),a.exports}n.d=(e,t)=>{for(var s in t)n.o(t,s)&&!n.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n(496),n(172),n(428),n(372),n(582),n(583),n(495),n(748),n(873),n(121),n(449),n(846);n(407)})(); \ No newline at end of file diff --git a/dist/resources/ws.min.js.map b/dist/resources/ws.min.js.map deleted file mode 100644 index a360e53..0000000 --- a/dist/resources/ws.min.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ws.min.js","mappings":"6NAMAA,SAASC,iBAAiB,oBAAoB,KAC7CC,GAAM,IAGP,MAAMC,EAAY,CAAC,EAEnB,IAAIC,GAAkB,EAClBC,GAAqB,EAEzB,MAUMC,EAVa,CAClB,gBACA,MAAO,UAAW,OAAQ,MAAO,QAAS,OAAQ,SAAU,OAAQ,QAAS,OAAQ,YAAa,MAAO,QAAS,SAAU,YAAa,QACzI,iBAAkB,sBAAuB,WAAY,qBAAsB,MAC3E,UACA,QAAS,aAAc,cAAe,SAAU,iBAAkB,2BAA4B,OAAQ,YACtG,kBAAmB,aAAc,gBAAiB,eAAgB,mBAClE,UAAW,QAAS,SAAU,OAAQ,OAAQ,SAC9C,SAAU,mBAEaC,KAAK,KAEvBL,EAAO,KACZF,SAASQ,eAAe,cAAcP,iBAAiB,SAAUQ,IAChEA,EAAEC,OAAOC,QAAQ,KAGlB,IAAAC,qBAAoBC,GAEpBb,SAASQ,eAAe,gBAAgBP,iBAAiB,QAASa,GAClEd,SAASQ,eAAe,mBAAmBP,iBAAiB,QAASc,GACrEf,SAASQ,eAAe,gBAAgBP,iBAAiB,QAASe,GAClEhB,SAASQ,eAAe,oBAAoBP,iBAAiB,QAASgB,GACtEjB,SAASQ,eAAe,gBAAgBP,iBAAiB,QAASiB,GAClElB,SAASQ,eAAe,oBAAoBP,iBAAiB,QAASkB,GACtEnB,SAASQ,eAAe,aAAaP,iBAAiB,QAASmB,GAE/DpB,SAASQ,eAAe,UAAUP,iBAAiB,SAAS,KACvDD,SAASqB,mBAAmBC,GAA0B,IAG3DtB,SAASC,iBAAiB,UAAWsB,GACrCvB,SAASC,iBAAiB,aAAcQ,IAAYJ,GAAoBI,EAAEe,gBAAgB,IAE1FC,EAAE,6BAA6BC,sBAAsB,CACpDC,WAA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hBA,EAC/B,OAAOp4C,GAASoiC,WAAWgW,GAE3B,MAAM,IAAIxxB,EACR,8BAA8BwxB,qBAA+BA,IAGnE,CAEA,MAAME,GAAU,O,GCz8NZC,EAA2B,CAAC,EAGhC,SAASC,EAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C,QAAqBt0C,IAAjBu0C,EACH,OAAOA,EAAaC,QAGrB,IAAIC,EAASL,EAAyBE,GAAY,CAGjDE,QAAS,CAAC,GAOX,OAHAE,EAAoBJ,GAAUG,EAAQA,EAAOD,QAASH,GAG/CI,EAAOD,OACf,CCrBAH,EAAoB1jC,EAAI,CAAC6jC,EAASG,KACjC,IAAI,IAAIrpC,KAAOqpC,EACXN,EAAoB/vB,EAAEqwB,EAAYrpC,KAAS+oC,EAAoB/vB,EAAEkwB,EAASlpC,IAC5EH,OAAOypC,eAAeJ,EAASlpC,EAAK,CAAEupC,YAAY,EAAMv+B,IAAKq+B,EAAWrpC,IAE1E,ECND+oC,EAAoB/vB,EAAI,CAACa,EAAKC,IAAUja,OAAOka,UAAUH,eAAe/tB,KAAKguB,EAAKC,GCClFivB,EAAoBp9B,EAAKu9B,IACH,oBAAX/lC,QAA0BA,OAAOqmC,aAC1C3pC,OAAOypC,eAAeJ,EAAS/lC,OAAOqmC,YAAa,CAAEjhD,MAAO,WAE7DsX,OAAOypC,eAAeJ,EAAS,aAAc,CAAE3gD,OAAO,GAAO,ECH9DwgD,EAAoB,qDAEpBA,EAAoB,+CACpBA,EAAoB,wCACpBA,EAAoB,sCACpBA,EAAoB,iDACpBA,EAAoB,uCACpBA,EAAoB,mDACpBA,EAAoB,8CACpBA,EAAoB,sCACpBA,EAAoB,iDACpBA,EAAoB,+CACpBA,EAAoB,yCACMA,EAAoB,6B","sources":["webpack://ws4kp/./server/scripts/index.mjs","webpack://ws4kp/./server/scripts/modules/almanac.mjs","webpack://ws4kp/./server/scripts/modules/currentweather.mjs","webpack://ws4kp/./server/scripts/modules/currentweatherscroll.mjs","webpack://ws4kp/./server/scripts/modules/extendedforecast.mjs","webpack://ws4kp/./server/scripts/modules/hourly.mjs","webpack://ws4kp/./server/scripts/modules/icons.mjs","webpack://ws4kp/./server/scripts/modules/latestobservations.mjs","webpack://ws4kp/./server/scripts/modules/localforecast.mjs","webpack://ws4kp/./server/scripts/modules/navigation.mjs","webpack://ws4kp/./server/scripts/modules/progress.mjs","webpack://ws4kp/./server/scripts/modules/radar.mjs","webpack://ws4kp/./server/scripts/modules/regionalforecast.mjs","webpack://ws4kp/./server/scripts/modules/status.mjs","webpack://ws4kp/./server/scripts/modules/travelforecast.mjs","webpack://ws4kp/./server/scripts/modules/utils/calc.mjs","webpack://ws4kp/./server/scripts/modules/utils/cors.mjs","webpack://ws4kp/./server/scripts/modules/utils/elem.mjs","webpack://ws4kp/./server/scripts/modules/utils/fetch.mjs","webpack://ws4kp/./server/scripts/modules/utils/image.mjs","webpack://ws4kp/./server/scripts/modules/utils/nosleep.mjs","webpack://ws4kp/./server/scripts/modules/utils/string.mjs","webpack://ws4kp/./server/scripts/modules/utils/units.mjs","webpack://ws4kp/./server/scripts/modules/utils/weather.mjs","webpack://ws4kp/./server/scripts/modules/weatherdisplay.mjs","webpack://ws4kp/./server/scripts/vendor/auto/luxon.mjs","webpack://ws4kp/webpack/bootstrap","webpack://ws4kp/webpack/runtime/define property getters","webpack://ws4kp/webpack/runtime/hasOwnProperty shorthand","webpack://ws4kp/webpack/runtime/make namespace object","webpack://ws4kp/webpack/startup"],"sourcesContent":["import { json } from './modules/utils/fetch.mjs';\nimport noSleep from './modules/utils/nosleep.mjs';\nimport {\n\tmessage as navMessage, isPlaying, resize, resetStatuses, latLonReceived, stopAutoRefreshTimer, registerRefreshData,\n} from './modules/navigation.mjs';\n\ndocument.addEventListener('DOMContentLoaded', () => {\n\tinit();\n});\n\nconst overrides = {};\n\nlet AutoSelectQuery = false;\nlet FullScreenOverride = false;\n\nconst categories = [\n\t'Land Features',\n\t'Bay', 'Channel', 'Cove', 'Dam', 'Delta', 'Gulf', 'Lagoon', 'Lake', 'Ocean', 'Reef', 'Reservoir', 'Sea', 'Sound', 'Strait', 'Waterfall', 'Wharf', // Water Features\n\t'Amusement Park', 'Historical Monument', 'Landmark', 'Tourist Attraction', 'Zoo', // POI/Arts and Entertainment\n\t'College', // POI/Education\n\t'Beach', 'Campground', 'Golf Course', 'Harbor', 'Nature Reserve', 'Other Parks and Outdoors', 'Park', 'Racetrack',\n\t'Scenic Overlook', 'Ski Resort', 'Sports Center', 'Sports Field', 'Wildlife Reserve', // POI/Parks and Outdoors\n\t'Airport', 'Ferry', 'Marina', 'Pier', 'Port', 'Resort', // POI/Travel\n\t'Postal', 'Populated Place',\n];\nconst cats = categories.join(',');\n\nconst init = () => {\n\tdocument.getElementById('txtAddress').addEventListener('focus', (e) => {\n\t\te.target.select();\n\t});\n\n\tregisterRefreshData(LoadTwcData);\n\n\tdocument.getElementById('NavigateMenu').addEventListener('click', btnNavigateMenuClick);\n\tdocument.getElementById('NavigateRefresh').addEventListener('click', btnNavigateRefreshClick);\n\tdocument.getElementById('NavigateNext').addEventListener('click', btnNavigateNextClick);\n\tdocument.getElementById('NavigatePrevious').addEventListener('click', btnNavigatePreviousClick);\n\tdocument.getElementById('NavigatePlay').addEventListener('click', btnNavigatePlayClick);\n\tdocument.getElementById('ToggleFullScreen').addEventListener('click', btnFullScreenClick);\n\tdocument.getElementById('btnGetGps').addEventListener('click', btnGetGpsClick);\n\n\tdocument.getElementById('divTwc').addEventListener('click', () => {\n\t\tif (document.fullscreenElement) UpdateFullScreenNavigate();\n\t});\n\n\tdocument.addEventListener('keydown', documentKeydown);\n\tdocument.addEventListener('touchmove', (e) => { if (FullScreenOverride) e.preventDefault(); });\n\n\t$('#frmGetLatLng #txtAddress').devbridgeAutocomplete({\n\t\tserviceUrl: 'https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/suggest',\n\t\tdeferRequestBy: 300,\n\t\tparamName: 'text',\n\t\tparams: {\n\t\t\tf: 'json',\n\t\t\tcountryCode: 'USA', // 'USA,PRI,VIR,GUM,ASM',\n\t\t\tcategory: cats,\n\t\t\tmaxSuggestions: 10,\n\t\t},\n\t\tdataType: 'json',\n\t\ttransformResult: (response) => {\n\t\t\tif (AutoSelectQuery) {\n\t\t\t\tAutoSelectQuery = false;\n\t\t\t\twindow.setTimeout(() => {\n\t\t\t\t\t$(ac.suggestionsContainer.children[0]).click();\n\t\t\t\t}, 1);\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tsuggestions: $.map(response.suggestions, (i) => ({\n\t\t\t\t\tvalue: i.text,\n\t\t\t\t\tdata: i.magicKey,\n\t\t\t\t})),\n\t\t\t};\n\t\t},\n\t\tminChars: 3,\n\t\tshowNoSuggestionNotice: true,\n\t\tnoSuggestionNotice: 'No results found. Please try a different search string.',\n\t\tonSelect(suggestion) { autocompleteOnSelect(suggestion, this); },\n\t\twidth: 490,\n\t});\n\n\tconst ac = $('#frmGetLatLng #txtAddress').devbridgeAutocomplete();\n\t$('#frmGetLatLng').on('submit', () => {\n\t\tif (ac.suggestions[0]) $(ac.suggestionsContainer.children[0]).click();\n\t\treturn false;\n\t});\n\n\t// Auto load the previous query\n\tconst TwcQuery = localStorage.getItem('TwcQuery');\n\tif (TwcQuery) {\n\t\tAutoSelectQuery = true;\n\t\tconst txtAddress = document.getElementById('txtAddress');\n\t\ttxtAddress.value = TwcQuery;\n\t\ttxtAddress.blur();\n\t\ttxtAddress.focus();\n\t}\n\n\tconst TwcPlay = localStorage.getItem('TwcPlay');\n\tif (TwcPlay === null || TwcPlay === 'true') postMessage('navButton', 'play');\n\n\tdocument.getElementById('btnClearQuery').addEventListener('click', () => {\n\t\tdocument.getElementById('spanCity').innerHTML = '';\n\t\tdocument.getElementById('spanState').innerHTML = '';\n\t\tdocument.getElementById('spanStationId').innerHTML = '';\n\t\tdocument.getElementById('spanRadarId').innerHTML = '';\n\t\tdocument.getElementById('spanZoneId').innerHTML = '';\n\n\t\tlocalStorage.removeItem('TwcScrollText');\n\t\tlocalStorage.removeItem('TwcScrollTextChecked');\n\n\t\tdocument.getElementById('chkAutoRefresh').checked = true;\n\t\tlocalStorage.removeItem('TwcAutoRefresh');\n\n\t\tdocument.getElementById('radEnglish').checked = true;\n\n\t\tlocalStorage.removeItem('TwcPlay');\n\t\tpostMessage('navButton', 'play');\n\n\t\tlocalStorage.removeItem('TwcQuery');\n\t});\n\n\t// swipe functionality\n\tdocument.getElementById('container').addEventListener('swiped-left', () => swipeCallBack('left'));\n\tdocument.getElementById('container').addEventListener('swiped-right', () => swipeCallBack('right'));\n};\n\nconst autocompleteOnSelect = async (suggestion, elem) => {\n\t// Do not auto get the same city twice.\n\tif (elem.previousSuggestionValue === suggestion.value) return;\n\n\tif (overrides[suggestion.value]) {\n\t\tdoRedirectToGeometry(overrides[suggestion.value]);\n\t} else {\n\t\tconst data = await json('https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/find', {\n\t\t\tdata: {\n\t\t\t\ttext: suggestion.value,\n\t\t\t\tmagicKey: suggestion.data,\n\t\t\t\tf: 'json',\n\t\t\t},\n\t\t});\n\n\t\tconst loc = data.locations[0];\n\t\tif (loc) {\n\t\t\tdoRedirectToGeometry(loc.feature.geometry);\n\t\t} else {\n\t\t\tconsole.error('An unexpected error occurred. Please try a different search string.');\n\t\t}\n\t}\n};\n\nconst doRedirectToGeometry = (geom) => {\n\tconst latLon = { lat: Math.round2(geom.y, 4), lon: Math.round2(geom.x, 4) };\n\tLoadTwcData(latLon);\n\t// Save the query\n\tlocalStorage.setItem('TwcQuery', document.getElementById('txtAddress').value);\n};\n\nconst btnFullScreenClick = () => {\n\tif (!document.fullscreenElement) {\n\t\tEnterFullScreen();\n\t} else {\n\t\tExitFullscreen();\n\t}\n\n\tif (isPlaying()) {\n\t\tnoSleep(true);\n\t} else {\n\t\tnoSleep(false);\n\t}\n\n\tUpdateFullScreenNavigate();\n\n\treturn false;\n};\n\nconst EnterFullScreen = () => {\n\tconst element = document.getElementById('divTwc');\n\n\t// Supports most browsers and their versions.\n\tconst requestMethod = element.requestFullScreen || element.webkitRequestFullScreen\n\t\t\t|| element.mozRequestFullScreen || element.msRequestFullscreen;\n\n\tif (requestMethod) {\n\t\t// Native full screen.\n\t\trequestMethod.call(element, { navigationUI: 'hide' }); // https://bugs.chromium.org/p/chromium/issues/detail?id=933436#c7\n\t} else {\n\t\t// iOS doesn't support FullScreen API.\n\t\twindow.scrollTo(0, 0);\n\t\tFullScreenOverride = true;\n\t}\n\tresize();\n\tUpdateFullScreenNavigate();\n\n\t// change hover text\n\tdocument.getElementById('ToggleFullScreen').title = 'Exit fullscreen';\n};\n\nconst ExitFullscreen = () => {\n\t// exit full-screen\n\n\tif (FullScreenOverride) {\n\t\tFullScreenOverride = false;\n\t}\n\n\tif (document.exitFullscreen) {\n\t\t// Chrome 71 broke this if the user pressed F11 to enter full screen mode.\n\t\tdocument.exitFullscreen();\n\t} else if (document.webkitExitFullscreen) {\n\t\tdocument.webkitExitFullscreen();\n\t} else if (document.mozCancelFullScreen) {\n\t\tdocument.mozCancelFullScreen();\n\t} else if (document.msExitFullscreen) {\n\t\tdocument.msExitFullscreen();\n\t}\n\tresize();\n\t// change hover text\n\tdocument.getElementById('ToggleFullScreen').title = 'Enter fullscreen';\n};\n\nconst btnNavigateMenuClick = () => {\n\tpostMessage('navButton', 'menu');\n\tUpdateFullScreenNavigate();\n\treturn false;\n};\n\nconst LoadTwcData = (_latLon) => {\n\t// if latlon is provided store it locally\n\tif (_latLon) LoadTwcData.latLon = _latLon;\n\t// get the data\n\tconst { latLon } = LoadTwcData;\n\t// if there's no data stop\n\tif (!latLon) return;\n\n\tdocument.getElementById('txtAddress').blur();\n\tstopAutoRefreshTimer();\n\tlatLonReceived(latLon);\n};\n\nconst swipeCallBack = (direction) => {\n\tswitch (direction) {\n\tcase 'left':\n\t\tbtnNavigateNextClick();\n\t\tbreak;\n\n\tcase 'right':\n\tdefault:\n\t\tbtnNavigatePreviousClick();\n\t\tbreak;\n\t}\n};\n\nconst btnNavigateRefreshClick = () => {\n\tresetStatuses();\n\tLoadTwcData();\n\tUpdateFullScreenNavigate();\n\n\treturn false;\n};\n\nconst btnNavigateNextClick = () => {\n\tpostMessage('navButton', 'next');\n\tUpdateFullScreenNavigate();\n\n\treturn false;\n};\n\nconst btnNavigatePreviousClick = () => {\n\tpostMessage('navButton', 'previous');\n\tUpdateFullScreenNavigate();\n\n\treturn false;\n};\n\nlet NavigateFadeIntervalId = null;\n\nconst UpdateFullScreenNavigate = () => {\n\tdocument.activeElement.blur();\n\tdocument.getElementById('divTwcBottom').classList.remove('hidden');\n\tdocument.getElementById('divTwcBottom').classList.add('visible');\n\n\tif (NavigateFadeIntervalId) {\n\t\tclearTimeout(NavigateFadeIntervalId);\n\t\tNavigateFadeIntervalId = null;\n\t}\n\n\tNavigateFadeIntervalId = setTimeout(() => {\n\t\tif (document.fullscreenElement) {\n\t\t\tdocument.getElementById('divTwcBottom').classList.remove('visible');\n\t\t\tdocument.getElementById('divTwcBottom').classList.add('hidden');\n\t\t}\n\t}, 2000);\n};\n\nconst documentKeydown = (e) => {\n\tconst code = (e.keyCode || e.which);\n\n\t// 200ms repeat\n\tif ((Date.now() - documentKeydown.lastButton ?? 0) < 200) return false;\n\tdocumentKeydown.lastButton = Date.now();\n\n\tif (document.fullscreenElement || document.activeElement === document.body) {\n\t\tswitch (code) {\n\t\tcase 32: // Space\n\t\t\tbtnNavigatePlayClick();\n\t\t\treturn false;\n\n\t\tcase 39: // Right Arrow\n\t\tcase 34: // Page Down\n\t\t\tbtnNavigateNextClick();\n\t\t\treturn false;\n\n\t\tcase 37: // Left Arrow\n\t\tcase 33: // Page Up\n\t\t\tbtnNavigatePreviousClick();\n\t\t\treturn false;\n\n\t\tcase 36: // Home\n\t\t\tbtnNavigateMenuClick();\n\t\t\treturn false;\n\n\t\tcase 48: // Restart\n\t\t\tbtnNavigateRefreshClick();\n\t\t\treturn false;\n\n\t\tcase 70: // F\n\t\t\tbtnFullScreenClick();\n\t\t\treturn false;\n\n\t\tdefault:\n\t\t}\n\t}\n\treturn false;\n};\n\nMath.round2 = (value, decimals) => Number(`${Math.round(`${value}e${decimals}`)}e-${decimals}`);\n\nconst btnNavigatePlayClick = () => {\n\tpostMessage('navButton', 'playToggle');\n\tUpdateFullScreenNavigate();\n\n\treturn false;\n};\n\n// post a message to the iframe\nconst postMessage = (type, myMessage = {}) => {\n\tnavMessage({ type, message: myMessage });\n};\n\nconst btnGetGpsClick = async () => {\n\tif (!navigator.geolocation) return;\n\n\tconst position = await (() => new Promise((resolve) => {\n\t\tnavigator.geolocation.getCurrentPosition(resolve);\n\t}))();\n\tconst { latitude, longitude } = position.coords;\n\n\tlet data;\n\ttry {\n\t\tdata = await json('https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/reverseGeocode', {\n\t\t\tdata: {\n\t\t\t\tlocation: `${longitude},${latitude}`,\n\t\t\t\tdistance: 1000, // Find location up to 1 KM.\n\t\t\t\tf: 'json',\n\t\t\t},\n\t\t});\n\t} catch (e) {\n\t\tconsole.error('Unable to fetch reverse geocode');\n\t\tconsole.error(e.status, e.responseJSONe);\n\t}\n\tconst ZipCode = data.address.Postal;\n\tconst { City } = data.address;\n\tconst State = states.getTwoDigitCode(data.address.Region);\n\tconst Country = data.address.CountryCode;\n\tconst TwcQuery = `${ZipCode}, ${City}, ${State}, ${Country}`;\n\n\tconst txtAddress = document.getElementById('txtAddress');\n\ttxtAddress.value = TwcQuery;\n\ttxtAddress.blur();\n\ttxtAddress.focus();\n\n\t// Save the query\n\tlocalStorage.setItem('TwcQuery', TwcQuery);\n};\n","// display sun and moon data\nimport { loadImg, preloadImg } from './utils/image.mjs';\nimport { DateTime } from '../vendor/auto/luxon.mjs';\nimport STATUS from './status.mjs';\nimport WeatherDisplay from './weatherdisplay.mjs';\nimport { registerDisplay } from './navigation.mjs';\n\nclass Almanac extends WeatherDisplay {\n\tconstructor(navId, elemId) {\n\t\tsuper(navId, elemId, 'Almanac', true);\n\n\t\t// pre-load background images (returns promises)\n\t\tthis.backgroundImage0 = loadImg('images/BackGround3_1.png');\n\n\t\t// preload the moon images\n\t\tpreloadImg('images/2/Full-Moon.gif');\n\t\tpreloadImg('images/2/Last-Quarter.gif');\n\t\tpreloadImg('images/2/New-Moon.gif');\n\t\tpreloadImg('images/2/First-Quarter.gif');\n\n\t\tthis.timing.totalScreens = 1;\n\t}\n\n\tasync getData(_weatherParameters) {\n\t\tsuper.getData(_weatherParameters);\n\t\tconst weatherParameters = _weatherParameters ?? this.weatherParameters;\n\n\t\t// get sun/moon data\n\t\tconst { sun, moon } = this.calcSunMoonData(weatherParameters);\n\n\t\t// store the data\n\t\tthis.data = {\n\t\t\tsun,\n\t\t\tmoon,\n\t\t};\n\t\t// update status\n\t\tthis.setStatus(STATUS.loaded);\n\n\t\t// share data\n\t\tthis.getDataCallback();\n\t}\n\n\tcalcSunMoonData(weatherParameters) {\n\t\tconst sun = [\n\t\t\tSunCalc.getTimes(new Date(), weatherParameters.latitude, weatherParameters.longitude),\n\t\t\tSunCalc.getTimes(DateTime.local().plus({ days: 1 }).toJSDate(), weatherParameters.latitude, weatherParameters.longitude),\n\t\t];\n\n\t\t// brute force the moon phases by scanning the next 30 days\n\t\tconst moon = [];\n\t\t// start with yesterday\n\t\tlet moonDate = DateTime.local().minus({ days: 1 });\n\t\tlet { phase } = SunCalc.getMoonIllumination(moonDate.toJSDate());\n\t\tlet iterations = 0;\n\t\tdo {\n\t\t\t// get yesterday's moon info\n\t\t\tconst lastPhase = phase;\n\t\t\t// calculate new values\n\t\t\tmoonDate = moonDate.plus({ days: 1 });\n\t\t\tphase = SunCalc.getMoonIllumination(moonDate.toJSDate()).phase;\n\t\t\t// check for 4 cases\n\t\t\tif (lastPhase < 0.25 && phase >= 0.25) moon.push(this.getMoonTransition(0.25, 'First', moonDate));\n\t\t\tif (lastPhase < 0.50 && phase >= 0.50) moon.push(this.getMoonTransition(0.50, 'Full', moonDate));\n\t\t\tif (lastPhase < 0.75 && phase >= 0.75) moon.push(this.getMoonTransition(0.75, 'Last', moonDate));\n\t\t\tif (lastPhase > phase) moon.push(this.getMoonTransition(0.00, 'New', moonDate));\n\n\t\t\t// stop after 30 days or 4 moon phases\n\t\t\titerations += 1;\n\t\t} while (iterations <= 30 && moon.length < 4);\n\n\t\treturn {\n\t\t\tsun,\n\t\t\tmoon,\n\t\t};\n\t}\n\n\t// get moon transition from one phase to the next by drilling down by hours, minutes and seconds\n\tgetMoonTransition(threshold, phaseName, start, iteration = 0) {\n\t\tlet moonDate = start;\n\t\tlet { phase } = SunCalc.getMoonIllumination(moonDate.toJSDate());\n\t\tlet iterations = 0;\n\t\tconst step = {\n\t\t\thours: iteration === 0 ? -1 : 0,\n\t\t\tminutes: iteration === 1 ? 1 : 0,\n\t\t\tseconds: iteration === 2 ? -1 : 0,\n\t\t\tmilliseconds: iteration === 3 ? 1 : 0,\n\t\t};\n\n\t\t// increasing test\n\t\tlet test = (lastPhase, testPhase) => lastPhase < threshold && testPhase >= threshold;\n\t\t// decreasing test\n\t\tif (iteration % 2 === 0) test = (lastPhase, testPhase) => lastPhase > threshold && testPhase <= threshold;\n\n\t\tdo {\n\t\t// store last phase\n\t\t\tconst lastPhase = phase;\n\t\t\t// calculate new phase after step\n\t\t\tmoonDate = moonDate.plus(step);\n\t\t\tphase = SunCalc.getMoonIllumination(moonDate.toJSDate()).phase;\n\t\t\t// wrap phases > 0.9 to -0.1 for ease of detection\n\t\t\tif (phase > 0.9) phase -= 1.0;\n\t\t\t// compare\n\t\t\tif (test(lastPhase, phase)) {\n\t\t\t// last iteration is three, return value\n\t\t\t\tif (iteration >= 3) break;\n\t\t\t\t// iterate recursively\n\t\t\t\treturn this.getMoonTransition(threshold, phaseName, moonDate, iteration + 1);\n\t\t\t}\n\t\t\titerations += 1;\n\t\t} while (iterations < 1000);\n\n\t\treturn { phase: phaseName, date: moonDate };\n\t}\n\n\tasync drawCanvas() {\n\t\tsuper.drawCanvas();\n\t\tconst info = this.data;\n\t\tconst Today = DateTime.local();\n\t\tconst Tomorrow = Today.plus({ days: 1 });\n\n\t\t// sun and moon data\n\t\tthis.elem.querySelector('.day-1').innerHTML = Today.toLocaleString({ weekday: 'long' });\n\t\tthis.elem.querySelector('.day-2').innerHTML = Tomorrow.toLocaleString({ weekday: 'long' });\n\t\tthis.elem.querySelector('.rise-1').innerHTML = DateTime.fromJSDate(info.sun[0].sunrise).toLocaleString(DateTime.TIME_SIMPLE).toLowerCase();\n\t\tthis.elem.querySelector('.rise-2').innerHTML = DateTime.fromJSDate(info.sun[1].sunrise).toLocaleString(DateTime.TIME_SIMPLE).toLowerCase();\n\t\tthis.elem.querySelector('.set-1').innerHTML = DateTime.fromJSDate(info.sun[0].sunset).toLocaleString(DateTime.TIME_SIMPLE).toLowerCase();\n\t\tthis.elem.querySelector('.set-2').innerHTML = DateTime.fromJSDate(info.sun[1].sunset).toLocaleString(DateTime.TIME_SIMPLE).toLowerCase();\n\n\t\tconst days = info.moon.map((MoonPhase) => {\n\t\t\tconst fill = {};\n\n\t\t\tconst date = MoonPhase.date.toLocaleString({ month: 'short', day: 'numeric' });\n\n\t\t\tfill.date = date;\n\t\t\tfill.type = MoonPhase.phase;\n\t\t\tfill.icon = { type: 'img', src: Almanac.imageName(MoonPhase.Phase) };\n\n\t\t\treturn this.fillTemplate('day', fill);\n\t\t});\n\n\t\tconst daysContainer = this.elem.querySelector('.moon .days');\n\t\tdaysContainer.innerHTML = '';\n\t\tdaysContainer.append(...days);\n\n\t\tthis.finishDraw();\n\t}\n\n\tstatic imageName(type) {\n\t\tswitch (type) {\n\t\tcase 'Full':\n\t\t\treturn 'images/2/Full-Moon.gif';\n\t\tcase 'Last':\n\t\t\treturn 'images/2/Last-Quarter.gif';\n\t\tcase 'New':\n\t\t\treturn 'images/2/New-Moon.gif';\n\t\tcase 'First':\n\t\tdefault:\n\t\t\treturn 'images/2/First-Quarter.gif';\n\t\t}\n\t}\n\n\t// make sun and moon data available outside this class\n\t// promise allows for data to be requested before it is available\n\tasync getSun() {\n\t\treturn new Promise((resolve) => {\n\t\t\tif (this.data) resolve(this.data);\n\t\t\t// data not available, put it into the data callback queue\n\t\t\tthis.getDataCallbacks.push(resolve);\n\t\t});\n\t}\n}\n\n// register display\nconst display = new Almanac(7, 'almanac');\nregisterDisplay(display);\n\nexport default display.getSun.bind(display);\n","// current weather conditions display\nimport STATUS from './status.mjs';\nimport { loadImg, preloadImg } from './utils/image.mjs';\nimport { json } from './utils/fetch.mjs';\nimport { directionToNSEW } from './utils/calc.mjs';\nimport { locationCleanup } from './utils/string.mjs';\nimport { getWeatherIconFromIconLink } from './icons.mjs';\nimport WeatherDisplay from './weatherdisplay.mjs';\nimport { registerDisplay } from './navigation.mjs';\nimport {\n\tcelsiusToFahrenheit, kphToMph, pascalToInHg, metersToFeet, kilometersToMiles,\n} from './utils/units.mjs';\n\nclass CurrentWeather extends WeatherDisplay {\n\tconstructor(navId, elemId) {\n\t\tsuper(navId, elemId, 'Current Conditions', true);\n\t\t// pre-load background image (returns promise)\n\t\tthis.backgroundImage = loadImg('images/BackGround1_1.png');\n\t}\n\n\tasync getData(_weatherParameters) {\n\t\tsuper.getData(_weatherParameters);\n\t\tconst weatherParameters = _weatherParameters ?? this.weatherParameters;\n\n\t\t// Load the observations\n\t\tlet observations; let\n\t\t\tstation;\n\t\t// station number counter\n\t\tlet stationNum = 0;\n\t\twhile (!observations && stationNum < weatherParameters.stations.length) {\n\t\t\t// get the station\n\t\t\tstation = weatherParameters.stations[stationNum];\n\t\t\tstationNum += 1;\n\t\t\ttry {\n\t\t\t\t// station observations\n\t\t\t\t// eslint-disable-next-line no-await-in-loop\n\t\t\t\tobservations = await json(`${station.id}/observations`, {\n\t\t\t\t\tcors: true,\n\t\t\t\t\tdata: {\n\t\t\t\t\t\tlimit: 2,\n\t\t\t\t\t},\n\t\t\t\t});\n\n\t\t\t\t// test data quality\n\t\t\t\tif (observations.features[0].properties.temperature.value === null\n\t\t\t\t\t|| observations.features[0].properties.windSpeed.value === null\n\t\t\t\t\t|| observations.features[0].properties.textDescription === null) {\n\t\t\t\t\tobservations = undefined;\n\t\t\t\t\tthrow new Error(`Unable to get observations: ${station.properties.stationIdentifier}, trying next station`);\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\tconsole.error(e);\n\t\t\t}\n\t\t}\n\t\t// test for data received\n\t\tif (!observations) {\n\t\t\tconsole.error('All current weather stations exhausted');\n\t\t\tthis.setStatus(STATUS.failed);\n\t\t\treturn;\n\t\t}\n\t\t// preload the icon\n\t\tpreloadImg(getWeatherIconFromIconLink(observations.features[0].properties.icon));\n\n\t\t// we only get here if there was no error above\n\t\tthis.data = { ...observations, station };\n\t\tthis.setStatus(STATUS.loaded);\n\n\t\tthis.getDataCallback();\n\t}\n\n\t// format the data for use outside this function\n\tparseData() {\n\t\tif (!this.data) return false;\n\t\tconst data = {};\n\t\tconst observations = this.data.features[0].properties;\n\t\t// values from api are provided in metric\n\t\tdata.observations = observations;\n\t\tdata.Temperature = Math.round(observations.temperature.value);\n\t\tdata.TemperatureUnit = 'C';\n\t\tdata.DewPoint = Math.round(observations.dewpoint.value);\n\t\tdata.Ceiling = Math.round(observations.cloudLayers[0]?.base?.value ?? 0);\n\t\tdata.CeilingUnit = 'm.';\n\t\tdata.Visibility = Math.round(observations.visibility.value / 1000);\n\t\tdata.VisibilityUnit = ' km.';\n\t\tdata.WindSpeed = Math.round(observations.windSpeed.value);\n\t\tdata.WindDirection = directionToNSEW(observations.windDirection.value);\n\t\tdata.Pressure = Math.round(observations.barometricPressure.value);\n\t\tdata.HeatIndex = Math.round(observations.heatIndex.value);\n\t\tdata.WindChill = Math.round(observations.windChill.value);\n\t\tdata.WindGust = Math.round(observations.windGust.value);\n\t\tdata.WindUnit = 'KPH';\n\t\tdata.Humidity = Math.round(observations.relativeHumidity.value);\n\t\tdata.Icon = getWeatherIconFromIconLink(observations.icon);\n\t\tdata.PressureDirection = '';\n\t\tdata.TextConditions = observations.textDescription;\n\t\tdata.station = this.data.station;\n\n\t\t// difference since last measurement (pascals, looking for difference of more than 150)\n\t\tconst pressureDiff = (observations.barometricPressure.value - this.data.features[1].properties.barometricPressure.value);\n\t\tif (pressureDiff > 150) data.PressureDirection = 'R';\n\t\tif (pressureDiff < -150) data.PressureDirection = 'F';\n\n\t\tdata.Temperature = celsiusToFahrenheit(data.Temperature);\n\t\tdata.TemperatureUnit = 'F';\n\t\tdata.DewPoint = celsiusToFahrenheit(data.DewPoint);\n\t\tdata.Ceiling = Math.round(metersToFeet(data.Ceiling) / 100) * 100;\n\t\tdata.CeilingUnit = 'ft.';\n\t\tdata.Visibility = kilometersToMiles(observations.visibility.value / 1000);\n\t\tdata.VisibilityUnit = ' mi.';\n\t\tdata.WindSpeed = kphToMph(data.WindSpeed);\n\t\tdata.WindUnit = 'MPH';\n\t\tdata.Pressure = pascalToInHg(data.Pressure).toFixed(2);\n\t\tdata.HeatIndex = celsiusToFahrenheit(data.HeatIndex);\n\t\tdata.WindChill = celsiusToFahrenheit(data.WindChill);\n\t\tdata.WindGust = kphToMph(data.WindGust);\n\t\treturn data;\n\t}\n\n\tasync drawCanvas() {\n\t\tsuper.drawCanvas();\n\t\tconst fill = {};\n\t\t// parse each time to deal with a change in units if necessary\n\t\tconst data = this.parseData();\n\n\t\tfill.temp = data.Temperature + String.fromCharCode(176);\n\n\t\tlet Conditions = data.observations.textDescription;\n\t\tif (Conditions.length > 15) {\n\t\t\tConditions = this.shortConditions(Conditions);\n\t\t}\n\t\tfill.condition = Conditions;\n\n\t\tfill.wind = data.WindDirection.padEnd(3, '') + data.WindSpeed.toString().padStart(3, ' ');\n\t\tif (data.WindGust) fill['wind-gusts'] = `Gusts to ${data.WindGust}`;\n\n\t\tfill.location = locationCleanup(this.data.station.properties.name).substr(0, 20);\n\n\t\tfill.humidity = `${data.Humidity}%`;\n\t\tfill.dewpoint = data.DewPoint + String.fromCharCode(176);\n\t\tfill.ceiling = (data.Ceiling === 0 ? 'Unlimited' : data.Ceiling + data.CeilingUnit);\n\t\tfill.visibility = data.Visibility + data.VisibilityUnit;\n\t\tfill.pressure = `${data.Pressure} ${data.PressureDirection}`;\n\n\t\tif (data.observations.heatIndex.value && data.HeatIndex !== data.Temperature) {\n\t\t\tfill['heat-index-label'] = 'Heat Index:';\n\t\t\tfill['heat-index'] = data.HeatIndex + String.fromCharCode(176);\n\t\t} else if (data.observations.windChill.value && data.WindChill !== '' && data.WindChill < data.Temperature) {\n\t\t\tfill['heat-index-label'] = 'Wind Chill:';\n\t\t\tfill['heat-index'] = data.WindChill + String.fromCharCode(176);\n\t\t}\n\n\t\tfill.icon = { type: 'img', src: data.Icon };\n\n\t\tconst area = this.elem.querySelector('.main');\n\n\t\tarea.innerHTML = '';\n\t\tarea.append(this.fillTemplate('weather', fill));\n\n\t\tthis.finishDraw();\n\t}\n\n\t// make data available outside this class\n\t// promise allows for data to be requested before it is available\n\tasync getCurrentWeather() {\n\t\treturn new Promise((resolve) => {\n\t\t\tif (this.data) resolve(this.parseData());\n\t\t\t// data not available, put it into the data callback queue\n\t\t\tthis.getDataCallbacks.push(() => resolve(this.parseData()));\n\t\t});\n\t}\n\n\tstatic shortConditions(_condition) {\n\t\tlet condition = _condition;\n\t\tcondition = condition.replace(/Light/g, 'L');\n\t\tcondition = condition.replace(/Heavy/g, 'H');\n\t\tcondition = condition.replace(/Partly/g, 'P');\n\t\tcondition = condition.replace(/Mostly/g, 'M');\n\t\tcondition = condition.replace(/Few/g, 'F');\n\t\tcondition = condition.replace(/Thunderstorm/g, 'T\\'storm');\n\t\tcondition = condition.replace(/ in /g, '');\n\t\tcondition = condition.replace(/Vicinity/g, '');\n\t\tcondition = condition.replace(/ and /g, ' ');\n\t\tcondition = condition.replace(/Freezing Rain/g, 'Frz Rn');\n\t\tcondition = condition.replace(/Freezing/g, 'Frz');\n\t\tcondition = condition.replace(/Unknown Precip/g, '');\n\t\tcondition = condition.replace(/L Snow Fog/g, 'L Snw/Fog');\n\t\tcondition = condition.replace(/ with /g, '/');\n\t\treturn condition;\n\t}\n}\nconst display = new CurrentWeather(0, 'current-weather');\nregisterDisplay(display);\n\nexport default display.getCurrentWeather.bind(display);\n","import { locationCleanup } from './utils/string.mjs';\nimport { elemForEach } from './utils/elem.mjs';\nimport getCurrentWeather from './currentweather.mjs';\nimport { currentDisplay } from './navigation.mjs';\n\n// constants\nconst degree = String.fromCharCode(176);\n\n// local variables\nlet interval;\nlet screenIndex = 0;\n\n// start drawing conditions\n// reset starts from the first item in the text scroll list\nconst start = () => {\n\t// store see if the context is new\n\n\t// set up the interval if needed\n\tif (!interval) {\n\t\tinterval = setInterval(incrementInterval, 4000);\n\t}\n\n\t// draw the data\n\tdrawScreen();\n};\n\nconst stop = (reset) => {\n\tif (reset) screenIndex = 0;\n};\n\n// increment interval, roll over\nconst incrementInterval = () => {\n\t// test current screen\n\tconst display = currentDisplay();\n\tif (!display?.okToDrawCurrentConditions) {\n\t\tstop(display?.elemId === 'progress');\n\t\treturn;\n\t}\n\tscreenIndex = (screenIndex + 1) % (screens.length);\n\t// draw new text\n\tdrawScreen();\n};\n\nconst drawScreen = async () => {\n\t// get the conditions\n\tconst data = await getCurrentWeather();\n\n\t// nothing to do if there's no data yet\n\tif (!data) return;\n\n\tdrawCondition(screens[screenIndex](data));\n};\n\n// the \"screens\" are stored in an array for easy addition and removal\nconst screens = [\n\t// station name\n\t(data) => `Conditions at ${locationCleanup(data.station.properties.name).substr(0, 20)}`,\n\n\t// temperature\n\t(data) => {\n\t\tlet text = `Temp: ${data.Temperature}${degree} ${data.TemperatureUnit}`;\n\t\tif (data.observations.heatIndex.value) {\n\t\t\ttext += ` Heat Index: ${data.HeatIndex}${degree} ${data.TemperatureUnit}`;\n\t\t} else if (data.observations.windChill.value) {\n\t\t\ttext += ` Wind Chill: ${data.WindChill}${degree} ${data.TemperatureUnit}`;\n\t\t}\n\t\treturn text;\n\t},\n\n\t// humidity\n\t(data) => `Humidity: ${data.Humidity}${degree} ${data.TemperatureUnit} Dewpoint: ${data.DewPoint}${degree} ${data.TemperatureUnit}`,\n\n\t// barometric pressure\n\t(data) => `Barometric Pressure: ${data.Pressure} ${data.PressureDirection}`,\n\n\t// wind\n\t(data) => {\n\t\tlet text = '';\n\t\tif (data.WindSpeed > 0) {\n\t\t\ttext = `Wind: ${data.WindDirection} ${data.WindSpeed} ${data.WindUnit}`;\n\t\t} else {\n\t\t\ttext = 'Wind: Calm';\n\t\t}\n\t\tif (data.WindGust > 0) {\n\t\t\ttext += ` Gusts to ${data.WindGust}`;\n\t\t}\n\t\treturn text;\n\t},\n\n\t// visibility\n\t(data) => `Visib: ${data.Visibility} ${data.VisibilityUnit} Ceiling: ${data.Ceiling === 0 ? 'Unlimited' : `${data.Ceiling} ${data.CeilingUnit}`}`,\n];\n\n// internal draw function with preset parameters\nconst drawCondition = (text) => {\n\t// update all html scroll elements\n\telemForEach('.weather-display .scroll .fixed', (elem) => {\n\t\telem.innerHTML = text;\n\t});\n};\ndocument.addEventListener('DOMContentLoaded', () => {\n\tstart();\n});\n","// display extended forecast graphically\n// technically uses the same data as the local forecast, we'll let the browser do the caching of that\n\nimport STATUS from './status.mjs';\nimport { json } from './utils/fetch.mjs';\nimport { DateTime } from '../vendor/auto/luxon.mjs';\nimport { getWeatherIconFromIconLink } from './icons.mjs';\nimport { preloadImg } from './utils/image.mjs';\nimport WeatherDisplay from './weatherdisplay.mjs';\nimport { registerDisplay } from './navigation.mjs';\n\nclass ExtendedForecast extends WeatherDisplay {\n\tconstructor(navId, elemId) {\n\t\tsuper(navId, elemId, 'Extended Forecast', true);\n\n\t\t// set timings\n\t\tthis.timing.totalScreens = 2;\n\t}\n\n\tasync getData(_weatherParameters) {\n\t\tsuper.getData(_weatherParameters);\n\t\tconst weatherParameters = _weatherParameters ?? this.weatherParameters;\n\n\t\t// request us or si units\n\t\tlet forecast;\n\t\ttry {\n\t\t\tforecast = await json(weatherParameters.forecast, {\n\t\t\t\tdata: {\n\t\t\t\t\tunits: 'us',\n\t\t\t\t},\n\t\t\t});\n\t\t} catch (e) {\n\t\t\tconsole.error('Unable to get extended forecast');\n\t\t\tconsole.error(e.status, e.responseJSON);\n\t\t\tthis.setStatus(STATUS.failed);\n\t\t\treturn;\n\t\t}\n\t\t// we only get here if there was no error above\n\t\tthis.data = ExtendedForecast.parse(forecast.properties.periods);\n\t\tthis.screenIndex = 0;\n\t\tthis.setStatus(STATUS.loaded);\n\t}\n\n\t// the api provides the forecast in 12 hour increments, flatten to day increments with high and low temperatures\n\tstatic parse(fullForecast) {\n\t// create a list of days starting with today\n\t\tconst Days = [0, 1, 2, 3, 4, 5, 6];\n\n\t\tconst dates = Days.map((shift) => {\n\t\t\tconst date = DateTime.local().startOf('day').plus({ days: shift });\n\t\t\treturn date.toLocaleString({ weekday: 'short' });\n\t\t});\n\n\t\t// track the destination forecast index\n\t\tlet destIndex = 0;\n\t\tconst forecast = [];\n\t\tfullForecast.forEach((period) => {\n\t\t// create the destination object if necessary\n\t\t\tif (!forecast[destIndex]) {\n\t\t\t\tforecast.push({\n\t\t\t\t\tdayName: '', low: undefined, high: undefined, text: undefined, icon: undefined,\n\t\t\t\t});\n\t\t\t}\n\t\t\t// get the object to modify/populate\n\t\t\tconst fDay = forecast[destIndex];\n\t\t\t// high temperature will always be last in the source array so it will overwrite the low values assigned below\n\t\t\tfDay.icon = getWeatherIconFromIconLink(period.icon);\n\t\t\tfDay.text = ExtendedForecast.shortenExtendedForecastText(period.shortForecast);\n\t\t\tfDay.dayName = dates[destIndex];\n\n\t\t\t// preload the icon\n\t\t\tpreloadImg(fDay.icon);\n\n\t\t\tif (period.isDaytime) {\n\t\t\t// day time is the high temperature\n\t\t\t\tfDay.high = period.temperature;\n\t\t\t\tdestIndex += 1;\n\t\t\t} else {\n\t\t\t// low temperature\n\t\t\t\tfDay.low = period.temperature;\n\t\t\t}\n\t\t});\n\n\t\treturn forecast;\n\t}\n\n\tstatic shortenExtendedForecastText(long) {\n\t\tconst regexList = [\n\t\t\t[/ and /ig, ' '],\n\t\t\t[/Slight /ig, ''],\n\t\t\t[/Chance /ig, ''],\n\t\t\t[/Very /ig, ''],\n\t\t\t[/Patchy /ig, ''],\n\t\t\t[/Areas /ig, ''],\n\t\t\t[/Dense /ig, ''],\n\t\t\t[/Thunderstorm/g, 'T\\'Storm'],\n\t\t];\n\t\t// run all regexes\n\t\tconst short = regexList.reduce((working, [regex, replace]) => working.replace(regex, replace), long);\n\n\t\tlet conditions = short.split(' ');\n\t\tif (short.indexOf('then') !== -1) {\n\t\t\tconditions = short.split(' then ');\n\t\t\tconditions = conditions[1].split(' ');\n\t\t}\n\n\t\tlet short1 = conditions[0].substr(0, 10);\n\t\tlet short2 = '';\n\t\tif (conditions[1]) {\n\t\t\tif (!short1.endsWith('.')) {\n\t\t\t\tshort2 = conditions[1].substr(0, 10);\n\t\t\t} else {\n\t\t\t\tshort1 = short1.replace(/\\./, '');\n\t\t\t}\n\n\t\t\tif (short2 === 'Blowing') {\n\t\t\t\tshort2 = '';\n\t\t\t}\n\t\t}\n\t\tlet result = short1;\n\t\tif (short2 !== '') {\n\t\t\tresult += ` ${short2}`;\n\t\t}\n\n\t\treturn result;\n\t}\n\n\tasync drawCanvas() {\n\t\tsuper.drawCanvas();\n\n\t\t// determine bounds\n\t\t// grab the first three or second set of three array elements\n\t\tconst forecast = this.data.slice(0 + 3 * this.screenIndex, 3 + this.screenIndex * 3);\n\n\t\t// create each day template\n\t\tconst days = forecast.map((Day) => {\n\t\t\tconst fill = {};\n\t\t\tfill.date = Day.dayName;\n\n\t\t\tconst { low } = Day;\n\t\t\tif (low !== undefined) {\n\t\t\t\tfill['value-lo'] = Math.round(low);\n\t\t\t}\n\t\t\tconst { high } = Day;\n\t\t\tfill['value-hi'] = Math.round(high);\n\t\t\tfill.condition = Day.text;\n\n\t\t\t// draw the icon\n\t\t\tfill.icon = { type: 'img', src: Day.icon };\n\n\t\t\t// return the filled template\n\t\t\treturn this.fillTemplate('day', fill);\n\t\t});\n\n\t\t// empty and update the container\n\t\tconst dayContainer = this.elem.querySelector('.day-container');\n\t\tdayContainer.innerHTML = '';\n\t\tdayContainer.append(...days);\n\t\tthis.finishDraw();\n\t}\n}\n\n// register display\nregisterDisplay(new ExtendedForecast(6, 'extended-forecast'));\n","// hourly forecast list\n\nimport STATUS from './status.mjs';\nimport { DateTime, Interval, Duration } from '../vendor/auto/luxon.mjs';\nimport { json } from './utils/fetch.mjs';\nimport { celsiusToFahrenheit, kilometersToMiles } from './utils/units.mjs';\nimport { getHourlyIcon } from './icons.mjs';\nimport { directionToNSEW } from './utils/calc.mjs';\nimport WeatherDisplay from './weatherdisplay.mjs';\nimport { registerDisplay } from './navigation.mjs';\nimport getSun from './almanac.mjs';\n\nclass Hourly extends WeatherDisplay {\n\tconstructor(navId, elemId, defaultActive) {\n\t\t// special height and width for scrolling\n\t\tsuper(navId, elemId, 'Hourly Forecast', defaultActive);\n\n\t\t// set up the timing\n\t\tthis.timing.baseDelay = 20;\n\t\t// 24 hours = 6 pages\n\t\tconst pages = 4; // first page is already displayed, last page doesn't happen\n\t\tconst timingStep = 75 * 4;\n\t\tthis.timing.delay = [150 + timingStep];\n\t\t// add additional pages\n\t\tfor (let i = 0; i < pages; i += 1) this.timing.delay.push(timingStep);\n\t\t// add the final 3 second delay\n\t\tthis.timing.delay.push(150);\n\t}\n\n\tasync getData(weatherParameters) {\n\t\t// super checks for enabled\n\t\tif (!super.getData(weatherParameters)) return;\n\t\tlet forecast;\n\t\ttry {\n\t\t\t// get the forecast\n\t\t\tforecast = await json(weatherParameters.forecastGridData);\n\t\t} catch (e) {\n\t\t\tconsole.error('Get hourly forecast failed');\n\t\t\tconsole.error(e.status, e.responseJSON);\n\t\t\tthis.setStatus(STATUS.failed);\n\t\t\treturn;\n\t\t}\n\n\t\tthis.data = await Hourly.parseForecast(forecast.properties);\n\n\t\tthis.setStatus(STATUS.loaded);\n\t\tthis.drawLongCanvas();\n\t}\n\n\t// extract specific values from forecast and format as an array\n\tstatic async parseForecast(data) {\n\t\tconst temperature = Hourly.expand(data.temperature.values);\n\t\tconst apparentTemperature = Hourly.expand(data.apparentTemperature.values);\n\t\tconst windSpeed = Hourly.expand(data.windSpeed.values);\n\t\tconst windDirection = Hourly.expand(data.windDirection.values);\n\t\tconst skyCover = Hourly.expand(data.skyCover.values);\t// cloud icon\n\t\tconst weather = Hourly.expand(data.weather.values);\t// fog icon\n\t\tconst iceAccumulation = Hourly.expand(data.iceAccumulation.values); \t// ice icon\n\t\tconst probabilityOfPrecipitation = Hourly.expand(data.probabilityOfPrecipitation.values);\t// rain icon\n\t\tconst snowfallAmount = Hourly.expand(data.snowfallAmount.values);\t// snow icon\n\n\t\tconst icons = await Hourly.determineIcon(skyCover, weather, iceAccumulation, probabilityOfPrecipitation, snowfallAmount, windSpeed);\n\n\t\treturn temperature.map((val, idx) => ({\n\t\t\ttemperature: celsiusToFahrenheit(temperature[idx]),\n\t\t\tapparentTemperature: celsiusToFahrenheit(apparentTemperature[idx]),\n\t\t\twindSpeed: kilometersToMiles(windSpeed[idx]),\n\t\t\twindDirection: directionToNSEW(windDirection[idx]),\n\t\t\ticon: icons[idx],\n\t\t}));\n\t}\n\n\t// given forecast paramaters determine a suitable icon\n\tstatic async determineIcon(skyCover, weather, iceAccumulation, probabilityOfPrecipitation, snowfallAmount, windSpeed) {\n\t\tconst startOfHour = DateTime.local().startOf('hour');\n\t\tconst sunTimes = (await getSun()).sun;\n\t\tconst overnight = Interval.fromDateTimes(DateTime.fromJSDate(sunTimes[0].sunset), DateTime.fromJSDate(sunTimes[1].sunrise));\n\t\tconst tomorrowOvernight = DateTime.fromJSDate(sunTimes[1].sunset);\n\t\treturn skyCover.map((val, idx) => {\n\t\t\tconst hour = startOfHour.plus({ hours: idx });\n\t\t\tconst isNight = overnight.contains(hour) || (hour > tomorrowOvernight);\n\t\t\treturn getHourlyIcon(skyCover[idx], weather[idx], iceAccumulation[idx], probabilityOfPrecipitation[idx], snowfallAmount[idx], windSpeed[idx], isNight);\n\t\t});\n\t}\n\n\t// expand a set of values with durations to an hour-by-hour array\n\tstatic expand(data) {\n\t\tconst startOfHour = DateTime.utc().startOf('hour').toMillis();\n\t\tconst result = []; // resulting expanded values\n\t\tdata.forEach((item) => {\n\t\t\tlet startTime = Date.parse(item.validTime.substr(0, item.validTime.indexOf('/')));\n\t\t\tconst duration = Duration.fromISO(item.validTime.substr(item.validTime.indexOf('/') + 1)).shiftTo('milliseconds').values.milliseconds;\n\t\t\tconst endTime = startTime + duration;\n\t\t\t// loop through duration at one hour intervals\n\t\t\tdo {\n\t\t\t\t// test for timestamp greater than now\n\t\t\t\tif (startTime >= startOfHour && result.length < 24) {\n\t\t\t\t\tresult.push(item.value); // push data array\n\t\t\t\t} // timestamp is after now\n\t\t\t\t// increment start time by 1 hour\n\t\t\t\tstartTime += 3600000;\n\t\t\t} while (startTime < endTime && result.length < 24);\n\t\t}); // for each value\n\n\t\treturn result;\n\t}\n\n\tasync drawLongCanvas() {\n\t\t// get the list element and populate\n\t\tconst list = this.elem.querySelector('.hourly-lines');\n\t\tlist.innerHTML = '';\n\n\t\tconst startingHour = DateTime.local();\n\n\t\tconst lines = this.data.map((data, index) => {\n\t\t\tconst fillValues = {};\n\t\t\t// hour\n\t\t\tconst hour = startingHour.plus({ hours: index });\n\t\t\tconst formattedHour = hour.toLocaleString({ weekday: 'short', hour: 'numeric' });\n\t\t\tfillValues.hour = formattedHour;\n\n\t\t\t// temperatures, convert to strings with no decimal\n\t\t\tconst temperature = Math.round(data.temperature).toString().padStart(3);\n\t\t\tconst feelsLike = Math.round(data.apparentTemperature).toString().padStart(3);\n\t\t\tfillValues.temp = temperature;\n\t\t\t// only plot apparent temperature if there is a difference\n\t\t\t// if (temperature !== feelsLike) line.querySelector('.like').innerHTML = feelsLike;\n\t\t\tif (temperature !== feelsLike) fillValues.like = feelsLike;\n\n\t\t\t// wind\n\t\t\tlet wind = 'Calm';\n\t\t\tif (data.windSpeed > 0) {\n\t\t\t\tconst windSpeed = Math.round(data.windSpeed).toString();\n\t\t\t\twind = data.windDirection + (Array(6 - data.windDirection.length - windSpeed.length).join(' ')) + windSpeed;\n\t\t\t}\n\t\t\tfillValues.wind = wind;\n\n\t\t\t// image\n\t\t\tfillValues.icon = { type: 'img', src: data.icon };\n\n\t\t\treturn this.fillTemplate('hourly-row', fillValues);\n\t\t});\n\n\t\tlist.append(...lines);\n\t}\n\n\tdrawCanvas() {\n\t\tsuper.drawCanvas();\n\t\tthis.finishDraw();\n\t}\n\n\tshowCanvas() {\n\t\t// special to hourly to draw the remainder of the canvas\n\t\tthis.drawCanvas();\n\t\tsuper.showCanvas();\n\t}\n\n\t// screen index change callback just runs the base count callback\n\tscreenIndexChange() {\n\t\tthis.baseCountChange(this.navBaseCount);\n\t}\n\n\t// base count change callback\n\tbaseCountChange(count) {\n\t\t// calculate scroll offset and don't go past end\n\t\tlet offsetY = Math.min(this.elem.querySelector('.hourly-lines').getBoundingClientRect().height - 289, (count - 150));\n\n\t\t// don't let offset go negative\n\t\tif (offsetY < 0) offsetY = 0;\n\n\t\t// copy the scrolled portion of the canvas\n\t\tthis.elem.querySelector('.main').scrollTo(0, offsetY);\n\t}\n\n\tstatic getTravelCitiesDayName(cities) {\n\t\t// effectively returns early on the first found date\n\t\treturn cities.reduce((dayName, city) => {\n\t\t\tif (city && dayName === '') {\n\t\t\t\t// today or tomorrow\n\t\t\t\tconst day = DateTime.local().plus({ days: (city.today) ? 0 : 1 });\n\t\t\t\t// return the day\n\t\t\t\treturn day.toLocaleString({ weekday: 'long' });\n\t\t\t}\n\t\t\treturn dayName;\n\t\t}, '');\n\t}\n}\n\n// register display\nregisterDisplay(new Hourly(2, 'hourly'));\n","/* spell-checker: disable */\n\nconst getWeatherRegionalIconFromIconLink = (link, _isNightTime) => {\n\t// extract day or night if not provided\n\tconst isNightTime = _isNightTime ?? link.indexOf('/night/') >= 0;\n\t// internal function to add path to returned icon\n\tconst addPath = (icon) => `images/r/${icon}`;\n\n\t// grab everything after the last slash ending at any of these: ?&,\n\tconst afterLastSlash = link.toLowerCase().match(/[^/]+$/)[0];\n\tlet conditionName = afterLastSlash.match(/(.*?)[,?&.]/)[1];\n\t// using probability as a crude heavy/light indication where possible\n\tconst value = +(link.match(/,(\\d{2,3})/) ?? [0, 100])[1];\n\n\t// if a 'DualImage' is captured, adjust to just the j parameter\n\tif (conditionName === 'dualimage') {\n\t\tconst match = link.match(/&j=(.*)&/);\n\t\t[, conditionName] = match;\n\t}\n\n\t// find the icon\n\tswitch (conditionName + (isNightTime ? '-n' : '')) {\n\tcase 'skc':\n\tcase 'hot':\n\tcase 'haze':\n\t\treturn addPath('Sunny.gif');\n\n\tcase 'skc-n':\n\tcase 'nskc':\n\tcase 'nskc-n':\n\tcase 'cold-n':\n\t\treturn addPath('Clear-1992.gif');\n\n\tcase 'bkn':\n\t\treturn addPath('Mostly-Cloudy-1994-2.gif');\n\n\tcase 'bkn-n':\n\tcase 'few-n':\n\tcase 'nfew-n':\n\tcase 'nfew':\n\t\treturn addPath('Partly-Clear-1994-2.gif');\n\n\tcase 'sct':\n\tcase 'few':\n\t\treturn addPath('Partly-Cloudy.gif');\n\n\tcase 'sct-n':\n\tcase 'nsct':\n\tcase 'nsct-n':\n\t\treturn addPath('Mostly-Clear.gif');\n\n\tcase 'ovc':\n\tcase 'ovc-n':\n\t\treturn addPath('Cloudy.gif');\n\n\tcase 'fog':\n\tcase 'fog-n':\n\t\treturn addPath('Fog.gif');\n\n\tcase 'rain_sleet':\n\t\treturn addPath('Sleet.gif');\n\n\tcase 'rain_showers':\n\tcase 'rain_showers_high':\n\t\treturn addPath('Scattered-Showers-1994-2.gif');\n\n\tcase 'rain_showers-n':\n\tcase 'rain_showers_high-n':\n\t\treturn addPath('Scattered-Showers-Night-1994-2.gif');\n\n\tcase 'rain':\n\tcase 'rain-n':\n\t\treturn addPath('Rain-1992.gif');\n\n\t\t// case 'snow':\n\t\t// \treturn addPath('Light-Snow.gif');\n\t\t// \tbreak;\n\n\t\t// case 'cc_snowshowers.gif':\n\t\t// \t//case \"heavy-snow.gif\":\n\t\t// \treturn addPath('AM-Snow-1994.gif');\n\t\t// \tbreak;\n\n\tcase 'snow':\n\tcase 'snow-n':\n\t\tif (value > 50)\treturn addPath('Heavy-Snow-1994-2.gif');\n\t\treturn addPath('Light-Snow.gif');\n\n\tcase 'rain_snow':\n\t\treturn addPath('Rain-Snow-1992.gif');\n\n\tcase 'snow_fzra':\n\tcase 'snow_fzra-n':\n\t\treturn addPath('Freezing-Rain-Snow-1992.gif');\n\n\tcase 'fzra':\n\tcase 'fzra-n':\n\t\treturn addPath('Freezing-Rain-1992.gif');\n\n\tcase 'snow_sleet':\n\tcase 'snow_sleet-n':\n\t\treturn addPath('Snow and Sleet.gif');\n\n\tcase 'sleet':\n\tcase 'sleet-n':\n\t\treturn addPath('Sleet.gif');\n\n\tcase 'tsra_sct':\n\tcase 'tsra':\n\t\treturn addPath('Scattered-Tstorms-1994-2.gif');\n\n\tcase 'tsra_sct-n':\n\tcase 'tsra-n':\n\t\treturn addPath('Scattered-Tstorms-Night-1994-2.gif');\n\n\tcase 'tsra_hi':\n\tcase 'tsra_hi-n':\n\tcase 'hurricane':\n\tcase 'tropical_storm':\n\t\treturn addPath('Thunderstorm.gif');\n\n\tcase 'wind_few':\n\tcase 'wind_sct':\n\tcase 'wind_bkn':\n\tcase 'wind_ovc':\n\t\treturn addPath('Wind.gif');\n\n\tcase 'wind_skc':\n\t\treturn addPath('Sunny-Wind-1994.gif');\n\n\tcase 'wind_skc-n':\n\tcase 'wind_sct-n':\n\t\treturn addPath('Clear-Wind-1994.gif');\n\n\tcase 'blizzard':\n\t\treturn addPath('Blowing Snow.gif');\n\n\tcase 'cold':\n\t\treturn addPath('cold.gif');\n\n\tdefault:\n\t\tconsole.log(`Unable to locate regional icon for ${conditionName} ${link} ${isNightTime}`);\n\t\treturn false;\n\t}\n};\n\nconst getWeatherIconFromIconLink = (link, _isNightTime) => {\n\tif (!link) return false;\n\n\t// internal function to add path to returned icon\n\tconst addPath = (icon) => `images/${icon}`;\n\t// extract day or night if not provided\n\tconst isNightTime = _isNightTime ?? link.indexOf('/night/') >= 0;\n\n\t// grab everything after the last slash ending at any of these: ?&,\n\tconst afterLastSlash = link.toLowerCase().match(/[^/]+$/)[0];\n\tlet conditionName = afterLastSlash.match(/(.*?)[,?&.]/)[1];\n\t// using probability as a crude heavy/light indication where possible\n\tconst value = +(link.match(/,(\\d{2,3})/) ?? [0, 100])[1];\n\n\t// if a 'DualImage' is captured, adjust to just the j parameter\n\tif (conditionName === 'dualimage') {\n\t\tconst match = link.match(/&j=(.*)&/);\n\t\t[, conditionName] = match;\n\t}\n\n\t// find the icon\n\tswitch (conditionName + (isNightTime ? '-n' : '')) {\n\tcase 'skc':\n\tcase 'hot':\n\tcase 'haze':\n\tcase 'cold':\n\t\treturn addPath('CC_Clear1.gif');\n\n\tcase 'skc-n':\n\tcase 'nskc':\n\tcase 'nskc-n':\n\tcase 'cold-n':\n\t\treturn addPath('CC_Clear0.gif');\n\n\tcase 'sct':\n\tcase 'few':\n\tcase 'bkn':\n\t\treturn addPath('CC_PartlyCloudy1.gif');\n\n\tcase 'bkn-n':\n\tcase 'few-n':\n\tcase 'nfew-n':\n\tcase 'nfew':\n\tcase 'sct-n':\n\tcase 'nsct':\n\tcase 'nsct-n':\n\t\treturn addPath('CC_PartlyCloudy0.gif');\n\n\tcase 'ovc':\n\tcase 'novc':\n\tcase 'ovc-n':\n\t\treturn addPath('CC_Cloudy.gif');\n\n\tcase 'fog':\n\tcase 'fog-n':\n\t\treturn addPath('CC_Fog.gif');\n\n\tcase 'rain_sleet':\n\t\treturn addPath('Sleet.gif');\n\n\tcase 'rain_showers':\n\tcase 'rain_showers_high':\n\t\treturn addPath('CC_Showers.gif');\n\n\tcase 'rain_showers-n':\n\tcase 'rain_showers_high-n':\n\t\treturn addPath('CC_Showers.gif');\n\n\tcase 'rain':\n\tcase 'rain-n':\n\t\treturn addPath('CC_Rain.gif');\n\n\t\t// case 'snow':\n\t\t// \treturn addPath('Light-Snow.gif');\n\t\t// \tbreak;\n\n\t\t// case 'cc_snowshowers.gif':\n\t\t// \t//case \"heavy-snow.gif\":\n\t\t// \treturn addPath('AM-Snow-1994.gif');\n\t\t// \tbreak;\n\n\tcase 'snow':\n\tcase 'snow-n':\n\t\tif (value > 50)\treturn addPath('CC_Snow.gif');\n\t\treturn addPath('CC_SnowShowers.gif');\n\n\tcase 'rain_snow':\n\t\treturn addPath('CC_RainSnow.gif');\n\n\tcase 'snow_fzra':\n\tcase 'snow_fzra-n':\n\tcase 'fzra':\n\tcase 'fzra-n':\n\t\treturn addPath('CC_FreezingRain.gif');\n\n\tcase 'snow_sleet':\n\t\treturn addPath('Snow-Sleet.gif');\n\n\tcase 'tsra_sct':\n\tcase 'tsra':\n\t\treturn addPath('EF_ScatTstorms.gif');\n\n\tcase 'tsra_sct-n':\n\tcase 'tsra-n':\n\t\treturn addPath('CC_TStorm.gif');\n\n\tcase 'tsra_hi':\n\tcase 'tsra_hi-n':\n\tcase 'hurricane':\n\tcase 'tropical_storm':\n\t\treturn addPath('CC_TStorm.gif');\n\n\tcase 'wind_few':\n\tcase 'wind_sct':\n\tcase 'wind_bkn':\n\tcase 'wind_ovc':\n\t\treturn addPath('CC_Windy.gif');\n\n\tcase 'wind_skc':\n\tcase 'wind_skc-n':\n\tcase 'wind_sct-n':\n\t\treturn addPath('CC_Windy.gif');\n\n\tcase 'blizzard':\n\t\treturn addPath('Blowing-Snow.gif');\n\n\tdefault:\n\t\tconsole.log(`Unable to locate icon for ${conditionName} ${link} ${isNightTime}`);\n\t\treturn false;\n\t}\n};\n\nconst getHourlyIcon = (skyCover, weather, iceAccumulation, probabilityOfPrecipitation, snowfallAmount, windSpeed, isNight = false) => {\n\t// internal function to add path to returned icon\n\tconst addPath = (icon) => `images/r/${icon}`;\n\n\t// possible phenomenon\n\tlet thunder = false;\n\tlet snow = false;\n\tlet ice = false;\n\tlet fog = false;\n\tlet wind = false;\n\n\t// test the phenomenon for various value if it is provided.\n\tweather.forEach((phenomenon) => {\n\t\tif (!phenomenon.weather) return;\n\t\tif (phenomenon.weather.toLowerCase().includes('thunder')) thunder = true;\n\t\tif (phenomenon.weather.toLowerCase().includes('snow')) snow = true;\n\t\tif (phenomenon.weather.toLowerCase().includes('ice')) ice = true;\n\t\tif (phenomenon.weather.toLowerCase().includes('fog')) fog = true;\n\t\tif (phenomenon.weather.toLowerCase().includes('wind')) wind = true;\n\t});\n\n\t// first item in list is highest priority, units are metric where applicable\n\tif (iceAccumulation > 0 || ice) return addPath('Freezing-Rain-1992.gif');\n\tif (snowfallAmount > 10) {\n\t\tif (windSpeed > 30 || wind) return addPath('Blowing Snow.gif');\n\t\treturn addPath('Heavy-Snow-1994.gif');\n\t}\n\tif ((snowfallAmount > 0 || snow) && thunder) return addPath('ThunderSnow.gif');\n\tif (snowfallAmount > 0 || snow) return addPath('Light-Snow.gif');\n\tif (thunder) return (addPath('Thunderstorm.gif'));\n\tif (probabilityOfPrecipitation > 70) return addPath('Rain-1992.gif');\n\tif (probabilityOfPrecipitation > 50) return addPath('Shower.gif');\n\tif (probabilityOfPrecipitation > 30) {\n\t\tif (!isNight) return addPath('Scattered-Showers-1994.gif');\n\t\treturn addPath('Scattered-Showers-Night.gif');\n\t}\n\tif (fog) return addPath('Fog.gif');\n\tif (skyCover > 70) return addPath('Cloudy.gif');\n\tif (skyCover > 50) {\n\t\tif (!isNight) return addPath('Mostly-Cloudy-1994.gif');\n\t\treturn addPath('Partly-Clear-1994.gif');\n\t}\n\tif (skyCover > 30) {\n\t\tif (!isNight) return addPath('Partly-Cloudy.gif');\n\t\treturn addPath('Mostly-Clear.gif');\n\t}\n\tif (isNight) return addPath('Clear-1992.gif');\n\treturn addPath('Sunny.gif');\n};\n\nexport {\n\tgetWeatherIconFromIconLink,\n\tgetWeatherRegionalIconFromIconLink,\n\tgetHourlyIcon,\n};\n","// current weather conditions display\nimport { distance as calcDistance, directionToNSEW } from './utils/calc.mjs';\nimport { json } from './utils/fetch.mjs';\nimport STATUS from './status.mjs';\nimport { locationCleanup } from './utils/string.mjs';\nimport { celsiusToFahrenheit, kphToMph } from './utils/units.mjs';\nimport WeatherDisplay from './weatherdisplay.mjs';\nimport { registerDisplay } from './navigation.mjs';\n\nclass LatestObservations extends WeatherDisplay {\n\tconstructor(navId, elemId) {\n\t\tsuper(navId, elemId, 'Latest Observations', true);\n\n\t\t// constants\n\t\tthis.MaximumRegionalStations = 7;\n\t}\n\n\tasync getData(_weatherParameters) {\n\t\tsuper.getData(_weatherParameters);\n\t\tconst weatherParameters = _weatherParameters ?? this.weatherParameters;\n\n\t\t// calculate distance to each station\n\t\tconst stationsByDistance = Object.keys(StationInfo).map((key) => {\n\t\t\tconst station = StationInfo[key];\n\t\t\tconst distance = calcDistance(station.lat, station.lon, weatherParameters.latitude, weatherParameters.longitude);\n\t\t\treturn { ...station, distance };\n\t\t});\n\n\t\t// sort the stations by distance\n\t\tconst sortedStations = stationsByDistance.sort((a, b) => a.distance - b.distance);\n\t\t// try up to 30 regional stations\n\t\tconst regionalStations = sortedStations.slice(0, 30);\n\n\t\t// get data for regional stations\n\t\tconst allConditions = await Promise.all(regionalStations.map(async (station) => {\n\t\t\ttry {\n\t\t\t\tconst data = await json(`https://api.weather.gov/stations/${station.id}/observations/latest`);\n\t\t\t\t// test for temperature, weather and wind values present\n\t\t\t\tif (data.properties.temperature.value === null\n\t\t\t\t\t|| data.properties.textDescription === ''\n\t\t\t\t\t|| data.properties.windSpeed.value === null) return false;\n\t\t\t\t// format the return values\n\t\t\t\treturn {\n\t\t\t\t\t...data.properties,\n\t\t\t\t\tStationId: station.id,\n\t\t\t\t\tcity: station.city,\n\t\t\t\t};\n\t\t\t} catch (e) {\n\t\t\t\tconsole.log(`Unable to get latest observations for ${station.id}`);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}));\n\t\t// remove and stations that did not return data\n\t\tconst actualConditions = allConditions.filter((condition) => condition);\n\t\t// cut down to the maximum of 7\n\t\tthis.data = actualConditions.slice(0, this.MaximumRegionalStations);\n\n\t\t// test for at least one station\n\t\tif (this.data.length < 1) {\n\t\t\tthis.setStatus(STATUS.noData);\n\t\t\treturn;\n\t\t}\n\t\tthis.setStatus(STATUS.loaded);\n\t}\n\n\tasync drawCanvas() {\n\t\tsuper.drawCanvas();\n\t\tconst conditions = this.data;\n\n\t\t// sort array by station name\n\t\tconst sortedConditions = conditions.sort((a, b) => ((a.Name < b.Name) ? -1 : 1));\n\n\t\tthis.elem.querySelector('.column-headers .temp.english').classList.add('show');\n\t\tthis.elem.querySelector('.column-headers .temp.metric').classList.remove('show');\n\n\t\tconst lines = sortedConditions.map((condition) => {\n\t\t\tconst windDirection = directionToNSEW(condition.windDirection.value);\n\n\t\t\tconst\tTemperature = Math.round(celsiusToFahrenheit(condition.temperature.value));\n\t\t\tconst WindSpeed = Math.round(kphToMph(condition.windSpeed.value));\n\n\t\t\tconst fill = {};\n\t\t\tfill.location = locationCleanup(condition.city).substr(0, 14);\n\t\t\tfill.temp = Temperature;\n\t\t\tfill.weather = LatestObservations.shortenCurrentConditions(condition.textDescription).substr(0, 9);\n\t\t\tif (WindSpeed > 0) {\n\t\t\t\tfill.wind = windDirection + (Array(6 - windDirection.length - WindSpeed.toString().length).join(' ')) + WindSpeed.toString();\n\t\t\t} else if (WindSpeed === 'NA') {\n\t\t\t\tfill.wind = 'NA';\n\t\t\t} else {\n\t\t\t\tfill.wind = 'Calm';\n\t\t\t}\n\n\t\t\treturn this.fillTemplate('observation-row', fill);\n\t\t});\n\n\t\tconst linesContainer = this.elem.querySelector('.observation-lines');\n\t\tlinesContainer.innerHTML = '';\n\t\tlinesContainer.append(...lines);\n\n\t\tthis.finishDraw();\n\t}\n\n\tstatic shortenCurrentConditions(_condition) {\n\t\tlet condition = _condition;\n\t\tcondition = condition.replace(/Light/, 'L');\n\t\tcondition = condition.replace(/Heavy/, 'H');\n\t\tcondition = condition.replace(/Partly/, 'P');\n\t\tcondition = condition.replace(/Mostly/, 'M');\n\t\tcondition = condition.replace(/Few/, 'F');\n\t\tcondition = condition.replace(/Thunderstorm/, 'T\\'storm');\n\t\tcondition = condition.replace(/ in /, '');\n\t\tcondition = condition.replace(/Vicinity/, '');\n\t\tcondition = condition.replace(/ and /, ' ');\n\t\tcondition = condition.replace(/Freezing Rain/, 'Frz Rn');\n\t\tcondition = condition.replace(/Freezing/, 'Frz');\n\t\tcondition = condition.replace(/Unknown Precip/, '');\n\t\tcondition = condition.replace(/L Snow Fog/, 'L Snw/Fog');\n\t\tcondition = condition.replace(/ with /, '/');\n\t\treturn condition;\n\t}\n}\n// register display\nregisterDisplay(new LatestObservations(1, 'latest-observations'));\n","// display text based local forecast\n\nimport STATUS from './status.mjs';\nimport { json } from './utils/fetch.mjs';\nimport WeatherDisplay from './weatherdisplay.mjs';\nimport { registerDisplay } from './navigation.mjs';\n\nclass LocalForecast extends WeatherDisplay {\n\tconstructor(navId, elemId) {\n\t\tsuper(navId, elemId, 'Local Forecast', true);\n\n\t\t// set timings\n\t\tthis.timing.baseDelay = 5000;\n\t}\n\n\tasync getData(_weatherParameters) {\n\t\tsuper.getData(_weatherParameters);\n\t\tconst weatherParameters = _weatherParameters ?? this.weatherParameters;\n\n\t\t// get raw data\n\t\tconst rawData = await this.getRawData(weatherParameters);\n\t\t// check for data\n\t\tif (!rawData) {\n\t\t\tthis.setStatus(STATUS.failed);\n\t\t\treturn;\n\t\t}\n\t\t// parse raw data\n\t\tconst conditions = LocalForecast.parse(rawData);\n\n\t\t// read each text\n\t\tthis.screenTexts = conditions.map((condition) => {\n\t\t\t// process the text\n\t\t\tlet text = `${condition.DayName.toUpperCase()}...`;\n\t\t\tconst conditionText = condition.Text;\n\t\t\ttext += conditionText.toUpperCase().replace('...', ' ');\n\n\t\t\treturn text;\n\t\t});\n\n\t\t// fill the forecast texts\n\t\tconst templates = this.screenTexts.map((text) => this.fillTemplate('forecast', { text }));\n\t\tconst forecastsElem = this.elem.querySelector('.forecasts');\n\t\tforecastsElem.innerHTML = '';\n\t\tforecastsElem.append(...templates);\n\n\t\t// increase each forecast height to a multiple of container height\n\t\tthis.pageHeight = forecastsElem.parentNode.getBoundingClientRect().height;\n\t\ttemplates.forEach((forecast) => {\n\t\t\tconst newHeight = Math.ceil(forecast.scrollHeight / this.pageHeight) * this.pageHeight;\n\t\t\tforecast.style.height = `${newHeight}px`;\n\t\t});\n\n\t\tthis.timing.totalScreens = forecastsElem.scrollHeight / this.pageHeight;\n\t\tthis.calcNavTiming();\n\t\tthis.setStatus(STATUS.loaded);\n\t}\n\n\t// get the unformatted data (also used by extended forecast)\n\tasync getRawData(weatherParameters) {\n\t\t// request us or si units\n\t\ttry {\n\t\t\treturn await json(weatherParameters.forecast, {\n\t\t\t\tdata: {\n\t\t\t\t\tunits: 'us',\n\t\t\t\t},\n\t\t\t});\n\t\t} catch (e) {\n\t\t\tconsole.error(`GetWeatherForecast failed: ${weatherParameters.forecast}`);\n\t\t\tconsole.error(e.status, e.responseJSON);\n\t\t\tthis.setStatus(STATUS.failed);\n\t\t\treturn false;\n\t\t}\n\t}\n\n\tasync drawCanvas() {\n\t\tsuper.drawCanvas();\n\n\t\tconst top = -this.screenIndex * this.pageHeight;\n\t\tthis.elem.querySelector('.forecasts').style.top = `${top}px`;\n\n\t\tthis.finishDraw();\n\t}\n\n\t// format the forecast\n\tstatic parse(forecast) {\n\t\t// only use the first 6 lines\n\t\treturn forecast.properties.periods.slice(0, 6).map((text) => ({\n\t\t\t// format day and text\n\t\t\tDayName: text.name.toUpperCase(),\n\t\t\tText: text.detailedForecast,\n\t\t}));\n\t}\n}\n\n// register display\nregisterDisplay(new LocalForecast(5, 'local-forecast'));\n","// navigation handles progress, next/previous and initial load messages from the parent frame\nimport noSleep from './utils/nosleep.mjs';\nimport STATUS from './status.mjs';\nimport { wrap } from './utils/calc.mjs';\nimport { json } from './utils/fetch.mjs';\nimport { getPoint } from './utils/weather.mjs';\n\ndocument.addEventListener('DOMContentLoaded', () => {\n\tinit();\n});\n\nconst displays = [];\nlet playing = false;\nlet progress;\nconst weatherParameters = {};\n\n// auto refresh\nconst AUTO_REFRESH_INTERVAL_MS = 500;\nconst AUTO_REFRESH_TIME_MS = 600000; // 10 min.\nlet AutoRefreshIntervalId = null;\nlet AutoRefreshCountMs = 0;\n\nconst init = async () => {\n\t// set up resize handler\n\twindow.addEventListener('resize', resize);\n\n\t// auto refresh\n\tconst TwcAutoRefresh = localStorage.getItem('TwcAutoRefresh');\n\tif (!TwcAutoRefresh || TwcAutoRefresh === 'true') {\n\t\tdocument.getElementById('chkAutoRefresh').checked = true;\n\t} else {\n\t\tdocument.getElementById('chkAutoRefresh').checked = false;\n\t}\n\tdocument.getElementById('chkAutoRefresh').addEventListener('change', autoRefreshChange);\n\tgenerateCheckboxes();\n};\n\nconst message = (data) => {\n\t// dispatch event\n\tif (!data.type) return;\n\tswitch (data.type) {\n\tcase 'navButton':\n\t\thandleNavButton(data.message);\n\t\tbreak;\n\n\tdefault:\n\t\tconsole.error(`Unknown event ${data.type}`);\n\t}\n};\n\nconst getWeather = async (latLon) => {\n\t// get initial weather data\n\tconst point = await getPoint(latLon.lat, latLon.lon);\n\n\t// get stations\n\tconst stations = await json(point.properties.observationStations);\n\n\tconst StationId = stations.features[0].properties.stationIdentifier;\n\n\tlet { city } = point.properties.relativeLocation.properties;\n\n\tif (StationId in StationInfo) {\n\t\tcity = StationInfo[StationId].city;\n\t\t[city] = city.split('/');\n\t}\n\n\t// populate the weather parameters\n\tweatherParameters.latitude = latLon.lat;\n\tweatherParameters.longitude = latLon.lon;\n\tweatherParameters.zoneId = point.properties.forecastZone.substr(-6);\n\tweatherParameters.radarId = point.properties.radarStation.substr(-3);\n\tweatherParameters.stationId = StationId;\n\tweatherParameters.weatherOffice = point.properties.cwa;\n\tweatherParameters.city = city;\n\tweatherParameters.state = point.properties.relativeLocation.properties.state;\n\tweatherParameters.timeZone = point.properties.relativeLocation.properties.timeZone;\n\tweatherParameters.forecast = point.properties.forecast;\n\tweatherParameters.forecastGridData = point.properties.forecastGridData;\n\tweatherParameters.stations = stations.features;\n\n\t// update the main process for display purposes\n\tpopulateWeatherParameters(weatherParameters);\n\n\t// draw the progress canvas and hide others\n\thideAllCanvases();\n\tdocument.getElementById('loading').style.display = 'none';\n\tif (progress) {\n\t\tawait progress.drawCanvas();\n\t\tprogress.showCanvas();\n\t}\n\n\t// call for new data on each display\n\tdisplays.forEach((display) => display.getData(weatherParameters));\n};\n\n// receive a status update from a module {id, value}\nconst updateStatus = (value) => {\n\tif (value.id < 0) return;\n\tif (!progress) return;\n\tprogress.drawCanvas(displays, countLoadedCanvases());\n\n\t// if this is the first display and we're playing, load it up so it starts playing\n\tif (isPlaying() && value.id === 0 && value.status === STATUS.loaded) {\n\t\tnavTo(msg.command.firstFrame);\n\t}\n\n\t// send loaded messaged to parent\n\tif (countLoadedCanvases() < displays.length) return;\n\n\t// everything loaded, set timestamps\n\tAssignLastUpdate(new Date());\n};\n\nconst countLoadedCanvases = () => displays.reduce((acc, display) => {\n\tif (display.status !== STATUS.loading) return acc + 1;\n\treturn acc;\n}, 0);\n\nconst hideAllCanvases = () => {\n\tdisplays.forEach((display) => display.hideCanvas());\n};\n\n// is playing interface\nconst isPlaying = () => playing;\n\n// navigation message constants\nconst msg = {\n\tresponse: {\t// display to navigation\n\t\tprevious: Symbol('previous'),\t\t// already at first frame, calling function should switch to previous canvas\n\t\tinProgress: Symbol('inProgress'),\t// have data to display, calling function should do nothing\n\t\tnext: Symbol('next'),\t\t\t\t// end of frames reached, calling function should switch to next canvas\n\t},\n\tcommand: {\t// navigation to display\n\t\tfirstFrame: Symbol('firstFrame'),\n\t\tpreviousFrame: Symbol('previousFrame'),\n\t\tnextFrame: Symbol('nextFrame'),\n\t\tlastFrame: Symbol('lastFrame'),\t// used when navigating backwards from the begining of the next canvas\n\t},\n};\n\n// receive navigation messages from displays\nconst displayNavMessage = (myMessage) => {\n\tif (myMessage.type === msg.response.previous) loadDisplay(-1);\n\tif (myMessage.type === msg.response.next) loadDisplay(1);\n};\n\n// navigate to next or previous\nconst navTo = (direction) => {\n\t// test for a current display\n\tconst current = currentDisplay();\n\tprogress.hideCanvas();\n\tif (!current) {\n\t\t// special case for no active displays (typically on progress screen)\n\t\t// find the first ready display\n\t\tlet firstDisplay;\n\t\tlet displayCount = 0;\n\t\tdo {\n\t\t\tif (displays[displayCount].status === STATUS.loaded) firstDisplay = displays[displayCount];\n\t\t\tdisplayCount += 1;\n\t\t} while (!firstDisplay && displayCount < displays.length);\n\n\t\tif (!firstDisplay) return;\n\n\t\tfirstDisplay.navNext(msg.command.firstFrame);\n\t\treturn;\n\t}\n\tif (direction === msg.command.nextFrame) currentDisplay().navNext();\n\tif (direction === msg.command.previousFrame) currentDisplay().navPrev();\n};\n\n// find the next or previous available display\nconst loadDisplay = (direction) => {\n\tconst totalDisplays = displays.length;\n\tconst curIdx = currentDisplayIndex();\n\tlet idx;\n\tfor (let i = 0; i < totalDisplays; i += 1) {\n\t\t// convert form simple 0-10 to start at current display index +/-1 and wrap\n\t\tidx = wrap(curIdx + (i + 1) * direction, totalDisplays);\n\t\tif (displays[idx].status === STATUS.loaded) break;\n\t}\n\t// if new display index is less than current display a wrap occurred, test for reload timeout\n\tif (idx <= curIdx) {\n\t\tif (refreshCheck()) return;\n\t}\n\tconst newDisplay = displays[idx];\n\t// hide all displays\n\thideAllCanvases();\n\t// show the new display and navigate to an appropriate display\n\tif (direction < 0) newDisplay.showCanvas(msg.command.lastFrame);\n\tif (direction > 0) newDisplay.showCanvas(msg.command.firstFrame);\n};\n\n// get the current display index or value\nconst currentDisplayIndex = () => {\n\tconst index = displays.findIndex((display) => display.isActive());\n\treturn index;\n};\nconst currentDisplay = () => displays[currentDisplayIndex()];\n\nconst setPlaying = (newValue) => {\n\tplaying = newValue;\n\tconst playButton = document.getElementById('NavigatePlay');\n\tlocalStorage.setItem('TwcPlay', playing);\n\n\tif (playing) {\n\t\tnoSleep(true);\n\t\tplayButton.title = 'Pause';\n\t\tplayButton.src = 'images/nav/ic_pause_white_24dp_1x.png';\n\t} else {\n\t\tnoSleep(false);\n\t\tplayButton.title = 'Play';\n\t\tplayButton.src = 'images/nav/ic_play_arrow_white_24dp_1x.png';\n\t}\n\t// if we're playing and on the progress screen jump to the next screen\n\tif (!progress) return;\n\tif (playing && !currentDisplay()) navTo(msg.command.firstFrame);\n};\n\n// handle all navigation buttons\nconst handleNavButton = (button) => {\n\tswitch (button) {\n\tcase 'play':\n\t\tsetPlaying(true);\n\t\tbreak;\n\tcase 'playToggle':\n\t\tsetPlaying(!playing);\n\t\tbreak;\n\tcase 'stop':\n\t\tsetPlaying(false);\n\t\tbreak;\n\tcase 'next':\n\t\tsetPlaying(false);\n\t\tnavTo(msg.command.nextFrame);\n\t\tbreak;\n\tcase 'previous':\n\t\tsetPlaying(false);\n\t\tnavTo(msg.command.previousFrame);\n\t\tbreak;\n\tcase 'menu':\n\t\tsetPlaying(false);\n\t\tprogress.showCanvas();\n\t\thideAllCanvases();\n\t\tbreak;\n\tdefault:\n\t\tconsole.error(`Unknown navButton ${button}`);\n\t}\n};\n\n// return the specificed display\nconst getDisplay = (index) => displays[index];\n\n// resize the container on a page resize\nconst resize = () => {\n\tconst widthZoomPercent = window.innerWidth / 640;\n\tconst heightZoomPercent = window.innerHeight / 480;\n\n\tconst scale = Math.min(widthZoomPercent, heightZoomPercent);\n\n\tif (scale < 1.0 || document.fullscreenElement) {\n\t\tdocument.getElementById('container').style.zoom = scale;\n\t} else {\n\t\tdocument.getElementById('container').style.zoom = 1;\n\t}\n};\n\n// reset all statuses to loading on all displays, used to keep the progress bar accurate during refresh\nconst resetStatuses = () => {\n\tdisplays.forEach((display) => { display.status = STATUS.loading; });\n};\n\n// allow displays to register themselves\nconst registerDisplay = (display) => {\n\tdisplays[display.navId] = display;\n\n\t// generate checkboxes\n\tgenerateCheckboxes();\n};\n\nconst generateCheckboxes = () => {\n\tconst availableDisplays = document.getElementById('enabledDisplays');\n\n\tif (!availableDisplays) return;\n\t// generate checkboxes\n\tconst checkboxes = displays.map((d) => d.generateCheckbox()).filter((d) => d);\n\n\t// write to page\n\tavailableDisplays.innerHTML = '';\n\tavailableDisplays.append(...checkboxes);\n};\n\n// special registration method for progress display\nconst registerProgress = (_progress) => {\n\tprogress = _progress;\n};\n\nconst populateWeatherParameters = (params) => {\n\tdocument.getElementById('spanCity').innerHTML = `${params.city}, `;\n\tdocument.getElementById('spanState').innerHTML = params.state;\n\tdocument.getElementById('spanStationId').innerHTML = params.stationId;\n\tdocument.getElementById('spanRadarId').innerHTML = params.radarId;\n\tdocument.getElementById('spanZoneId').innerHTML = params.zoneId;\n};\n\nconst autoRefreshChange = (e) => {\n\tconst { checked } = e.target;\n\n\tif (checked) {\n\t\tstartAutoRefreshTimer();\n\t} else {\n\t\tstopAutoRefreshTimer();\n\t}\n\n\tlocalStorage.setItem('TwcAutoRefresh', checked);\n};\n\nconst AssignLastUpdate = (date) => {\n\tif (date) {\n\t\tdocument.getElementById('spanLastRefresh').innerHTML = date.toLocaleString('en-US', {\n\t\t\tweekday: 'short', month: 'short', day: 'numeric', year: 'numeric', hour: 'numeric', minute: 'numeric', second: 'numeric', timeZoneName: 'short',\n\t\t});\n\t\tif (document.getElementById('chkAutoRefresh').checked) startAutoRefreshTimer();\n\t} else {\n\t\tdocument.getElementById('spanLastRefresh').innerHTML = '(none)';\n\t}\n};\n\nconst latLonReceived = (data) => {\n\tgetWeather(data);\n\tAssignLastUpdate(null);\n};\n\nconst startAutoRefreshTimer = () => {\n\t// Ensure that any previous timer has already stopped.\n\t// check if timer is running\n\tif (AutoRefreshIntervalId) return;\n\n\t// Reset the time elapsed.\n\tAutoRefreshCountMs = 0;\n\n\tconst AutoRefreshTimer = () => {\n\t\t// Increment the total time elapsed.\n\t\tAutoRefreshCountMs += AUTO_REFRESH_INTERVAL_MS;\n\n\t\t// Display the count down.\n\t\tlet RemainingMs = (AUTO_REFRESH_TIME_MS - AutoRefreshCountMs);\n\t\tif (RemainingMs < 0) {\n\t\t\tRemainingMs = 0;\n\t\t}\n\t\tconst dt = new Date(RemainingMs);\n\t\tdocument.getElementById('spanRefreshCountDown').innerHTML = `${dt.getMinutes() < 10 ? `0${dt.getMinutes()}` : dt.getMinutes()}:${dt.getSeconds() < 10 ? `0${dt.getSeconds()}` : dt.getSeconds()}`;\n\n\t\t// Time has elapsed.\n\t\tif (AutoRefreshCountMs >= AUTO_REFRESH_TIME_MS && !isPlaying()) loadTwcData();\n\t};\n\tAutoRefreshIntervalId = window.setInterval(AutoRefreshTimer, AUTO_REFRESH_INTERVAL_MS);\n\tAutoRefreshTimer();\n};\nconst stopAutoRefreshTimer = () => {\n\tif (AutoRefreshIntervalId) {\n\t\twindow.clearInterval(AutoRefreshIntervalId);\n\t\tdocument.getElementById('spanRefreshCountDown').innerHTML = '--:--';\n\t\tAutoRefreshIntervalId = null;\n\t}\n};\n\nconst refreshCheck = () => {\n\t// Time has elapsed.\n\tif (AutoRefreshCountMs >= AUTO_REFRESH_TIME_MS) {\n\t\tloadTwcData();\n\t\treturn true;\n\t}\n\treturn false;\n};\n\nconst loadTwcData = () => {\n\tif (loadTwcData.callback) loadTwcData.callback();\n};\n\nconst registerRefreshData = (callback) => {\n\tloadTwcData.callback = callback;\n};\n\nexport {\n\tupdateStatus,\n\tdisplayNavMessage,\n\tresetStatuses,\n\tisPlaying,\n\tresize,\n\tregisterDisplay,\n\tregisterProgress,\n\tcurrentDisplay,\n\tgetDisplay,\n\tmsg,\n\tmessage,\n\tlatLonReceived,\n\tstopAutoRefreshTimer,\n\tregisterRefreshData,\n};\n","// regional forecast and observations\nimport { loadImg } from './utils/image.mjs';\nimport STATUS from './status.mjs';\nimport WeatherDisplay from './weatherdisplay.mjs';\nimport {\n\tregisterProgress, message, getDisplay, msg,\n} from './navigation.mjs';\n\nclass Progress extends WeatherDisplay {\n\tconstructor(navId, elemId) {\n\t\tsuper(navId, elemId, '', false);\n\n\t\t// pre-load background image (returns promise)\n\t\tthis.backgroundImage = loadImg('images/BackGround1_1.png');\n\n\t\t// disable any navigation timing\n\t\tthis.timing = false;\n\n\t\t// setup event listener for dom-required initialization\n\t\tdocument.addEventListener('DOMContentLoaded', () => {\n\t\t\tthis.version = document.getElementById('version').innerHTML;\n\t\t\tthis.elem.querySelector('.container').addEventListener('click', this.lineClick.bind(this));\n\t\t});\n\n\t\tthis.okToDrawCurrentConditions = false;\n\t}\n\n\tasync drawCanvas(displays, loadedCount) {\n\t\tsuper.drawCanvas();\n\n\t\t// get the progress bar cover (makes percentage)\n\t\tif (!this.progressCover) this.progressCover = this.elem.querySelector('.scroll .cover');\n\n\t\t// if no displays provided just draw the backgrounds (above)\n\t\tif (!displays) return;\n\t\tconst lines = displays.map((display, index) => {\n\t\t\tconst fill = {};\n\n\t\t\tfill.name = display.name;\n\n\t\t\tlet statusClass;\n\t\t\tswitch (display.status) {\n\t\t\tcase STATUS.loading:\n\t\t\t\tstatusClass = 'loading';\n\t\t\t\tbreak;\n\t\t\tcase STATUS.loaded:\n\t\t\t\tstatusClass = 'press-here';\n\t\t\t\tbreak;\n\t\t\tcase STATUS.failed:\n\t\t\t\tstatusClass = 'failed';\n\t\t\t\tbreak;\n\t\t\tcase STATUS.noData:\n\t\t\t\tstatusClass = 'no-data';\n\t\t\t\tbreak;\n\t\t\tcase STATUS.disabled:\n\t\t\t\tstatusClass = 'disabled';\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t}\n\n\t\t\t// make the line\n\t\t\tconst line = this.fillTemplate('item', fill);\n\t\t\t// because of timing, this might get called before the template is loaded\n\t\t\tif (!line) return false;\n\n\t\t\t// update the status\n\t\t\tconst links = line.querySelector('.links');\n\t\t\tlinks.classList.remove('loading');\n\t\t\tlinks.classList.add(statusClass);\n\t\t\tlinks.dataset.index = index;\n\t\t\treturn line;\n\t\t}).filter((d) => d);\n\n\t\t// get the container and update\n\t\tconst container = this.elem.querySelector('.container');\n\t\tcontainer.innerHTML = '';\n\t\tcontainer.append(...lines);\n\n\t\tthis.finishDraw();\n\n\t\t// calculate loaded percent\n\t\tconst loadedPercent = (loadedCount / displays.length);\n\n\t\tthis.progressCover.style.width = `${(1.0 - loadedPercent) * 100}%`;\n\t\tif (loadedPercent < 1.0) {\n\t\t\t// show the progress bar and set width\n\t\t\tthis.progressCover.parentNode.classList.add('show');\n\t\t} else {\n\t\t\t// hide the progressbar after 1 second (lines up with with width transition animation)\n\t\t\tsetTimeout(() => this.progressCover.parentNode.classList.remove('show'), 1000);\n\t\t}\n\t}\n\n\tlineClick(e) {\n\t\t// get index\n\t\tconst indexRaw = e.target?.parentNode?.dataset?.index;\n\t\tif (indexRaw === undefined) return;\n\t\tconst index = +indexRaw;\n\n\t\t// stop playing\n\t\tmessage('navButton');\n\t\t// use the y value to determine an index\n\t\tconst display = getDisplay(index);\n\t\tif (display && display.status === STATUS.loaded) {\n\t\t\tdisplay.showCanvas(msg.command.firstFrame);\n\t\t\tthis.elem.classList.remove('show');\n\t\t}\n\t}\n}\n\n// register our own display\nconst progress = new Progress(-1, 'progress');\nregisterProgress(progress);\n","// current weather conditions display\nimport STATUS from './status.mjs';\nimport { DateTime } from '../vendor/auto/luxon.mjs';\nimport { loadImg } from './utils/image.mjs';\nimport { text } from './utils/fetch.mjs';\nimport { rewriteUrl } from './utils/cors.mjs';\nimport WeatherDisplay from './weatherdisplay.mjs';\nimport { registerDisplay } from './navigation.mjs';\n\nclass Radar extends WeatherDisplay {\n\tconstructor(navId, elemId) {\n\t\tsuper(navId, elemId, 'Local Radar', true);\n\n\t\tthis.okToDrawCurrentConditions = false;\n\t\tthis.okToDrawCurrentDateTime = false;\n\n\t\t// set max images\n\t\tthis.dopplerRadarImageMax = 6;\n\t\t// update timing\n\t\tthis.timing.baseDelay = 350;\n\t\tthis.timing.delay = [\n\t\t\t{ time: 4, si: 5 },\n\t\t\t{ time: 1, si: 0 },\n\t\t\t{ time: 1, si: 1 },\n\t\t\t{ time: 1, si: 2 },\n\t\t\t{ time: 1, si: 3 },\n\t\t\t{ time: 1, si: 4 },\n\t\t\t{ time: 4, si: 5 },\n\t\t\t{ time: 1, si: 0 },\n\t\t\t{ time: 1, si: 1 },\n\t\t\t{ time: 1, si: 2 },\n\t\t\t{ time: 1, si: 3 },\n\t\t\t{ time: 1, si: 4 },\n\t\t\t{ time: 4, si: 5 },\n\t\t\t{ time: 1, si: 0 },\n\t\t\t{ time: 1, si: 1 },\n\t\t\t{ time: 1, si: 2 },\n\t\t\t{ time: 1, si: 3 },\n\t\t\t{ time: 1, si: 4 },\n\t\t\t{ time: 12, si: 5 },\n\t\t];\n\t}\n\n\tasync getData(_weatherParameters) {\n\t\tsuper.getData(_weatherParameters);\n\t\tconst weatherParameters = _weatherParameters ?? this.weatherParameters;\n\n\t\t// ALASKA AND HAWAII AREN'T SUPPORTED!\n\t\tif (weatherParameters.state === 'AK' || weatherParameters.state === 'HI') {\n\t\t\tthis.setStatus(STATUS.noData);\n\t\t\treturn;\n\t\t}\n\n\t\t// get the base map\n\t\tlet src = 'images/4000RadarMap2.jpg';\n\t\tif (weatherParameters.State === 'HI') src = 'images/HawaiiRadarMap2.png';\n\t\tthis.baseMap = await loadImg(src);\n\n\t\tconst baseUrl = 'https://mesonet.agron.iastate.edu/archive/data/';\n\t\tconst baseUrlEnd = '/GIS/uscomp/';\n\t\tconst baseUrls = [];\n\t\tlet date = DateTime.utc().minus({ days: 1 }).startOf('day');\n\n\t\t// make urls for yesterday and today\n\t\twhile (date <= DateTime.utc().startOf('day')) {\n\t\t\tbaseUrls.push(`${baseUrl}${date.toFormat('yyyy/LL/dd')}${baseUrlEnd}`);\n\t\t\tdate = date.plus({ days: 1 });\n\t\t}\n\n\t\tconst lists = (await Promise.all(baseUrls.map(async (url) => {\n\t\t\ttry {\n\t\t\t// get a list of available radars\n\t\t\t\tconst radarHtml = await text(url, { cors: true });\n\t\t\t\treturn radarHtml;\n\t\t\t} catch (e) {\n\t\t\t\tconsole.log('Unable to get list of radars');\n\t\t\t\tconsole.error(e);\n\t\t\t\tthis.setStatus(STATUS.failed);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}))).filter((d) => d);\n\n\t\t// convert to an array of gif urls\n\t\tconst pngs = lists.map((html, htmlIdx) => {\n\t\t\tconst parser = new DOMParser();\n\t\t\tconst xmlDoc = parser.parseFromString(html, 'text/html');\n\t\t\t// add the base url\n\t\t\tconst base = xmlDoc.createElement('base');\n\t\t\tbase.href = baseUrls[htmlIdx];\n\t\t\txmlDoc.head.append(base);\n\t\t\tconst anchors = xmlDoc.getElementsByTagName('a');\n\t\t\tconst urls = [];\n\t\t\tArray.from(anchors).forEach((elem) => {\n\t\t\t\tif (elem.innerHTML?.includes('.png') && elem.innerHTML?.includes('n0r_'))\t{\n\t\t\t\t\turls.push(elem.href);\n\t\t\t\t}\n\t\t\t});\n\t\t\treturn urls;\n\t\t}).flat();\n\n\t\t// get the last few images\n\t\tconst sortedPngs = pngs.sort((a, b) => (Date(a) < Date(b) ? -1 : 1));\n\t\tconst urls = sortedPngs.slice(-(this.dopplerRadarImageMax));\n\n\t\t// calculate offsets and sizes\n\t\tlet offsetX = 120;\n\t\tlet offsetY = 69;\n\t\tconst width = 2550;\n\t\tconst height = 1600;\n\t\toffsetX *= 2;\n\t\toffsetY *= 2;\n\t\tconst sourceXY = Radar.getXYFromLatitudeLongitudeMap(weatherParameters, offsetX, offsetY);\n\n\t\t// create working context for manipulation\n\t\tconst workingCanvas = document.createElement('canvas');\n\t\tworkingCanvas.width = width;\n\t\tworkingCanvas.height = height;\n\t\tconst workingContext = workingCanvas.getContext('2d');\n\t\tworkingContext.imageSmoothingEnabled = false;\n\n\t\t// calculate radar offsets\n\t\tconst radarOffsetX = 120;\n\t\tconst radarOffsetY = 70;\n\t\tconst radarSourceXY = Radar.getXYFromLatitudeLongitudeDoppler(weatherParameters, offsetX, offsetY);\n\t\tconst radarSourceX = radarSourceXY.x / 2;\n\t\tconst radarSourceY = radarSourceXY.y / 2;\n\n\t\t// Load the most recent doppler radar images.\n\t\tconst radarInfo = await Promise.all(urls.map(async (url) => {\n\t\t\t// create destination context\n\t\t\tconst canvas = document.createElement('canvas');\n\t\t\tcanvas.width = 640;\n\t\t\tcanvas.height = 367;\n\t\t\tconst context = canvas.getContext('2d');\n\t\t\tcontext.imageSmoothingEnabled = false;\n\n\t\t\t// get the image\n\t\t\tconst response = await fetch(rewriteUrl(url));\n\n\t\t\t// test response\n\t\t\tif (!response.ok) throw new Error(`Unable to fetch radar error ${response.status} ${response.statusText} from ${response.url}`);\n\n\t\t\t// get the blob\n\t\t\tconst blob = await response.blob();\n\n\t\t\t// store the time\n\t\t\tconst timeMatch = url.match(/_(\\d{4})(\\d\\d)(\\d\\d)(\\d\\d)(\\d\\d)\\./);\n\t\t\tlet time;\n\t\t\tif (timeMatch) {\n\t\t\t\tconst [, year, month, day, hour, minute] = timeMatch;\n\t\t\t\ttime = DateTime.fromObject({\n\t\t\t\t\tyear,\n\t\t\t\t\tmonth,\n\t\t\t\t\tday,\n\t\t\t\t\thour,\n\t\t\t\t\tminute,\n\t\t\t\t}, {\n\t\t\t\t\tzone: 'UTC',\n\t\t\t\t}).setZone();\n\t\t\t} else {\n\t\t\t\ttime = DateTime.fromHTTP(response.headers.get('last-modified')).setZone();\n\t\t\t}\n\n\t\t\t// assign to an html image element\n\t\t\tconst imgBlob = await loadImg(blob);\n\n\t\t\t// draw the entire image\n\t\t\tworkingContext.clearRect(0, 0, width, 1600);\n\t\t\tworkingContext.drawImage(imgBlob, 0, 0, width, 1600);\n\n\t\t\t// get the base map\n\t\t\tcontext.drawImage(await this.baseMap, sourceXY.x, sourceXY.y, offsetX * 2, offsetY * 2, 0, 0, 640, 367);\n\n\t\t\t// crop the radar image\n\t\t\tconst cropCanvas = document.createElement('canvas');\n\t\t\tcropCanvas.width = 640;\n\t\t\tcropCanvas.height = 367;\n\t\t\tconst cropContext = cropCanvas.getContext('2d', { willReadFrequently: true });\n\t\t\tcropContext.imageSmoothingEnabled = false;\n\t\t\tcropContext.drawImage(workingCanvas, radarSourceX, radarSourceY, (radarOffsetX * 2), (radarOffsetY * 2.33), 0, 0, 640, 367);\n\t\t\t// clean the image\n\t\t\tRadar.removeDopplerRadarImageNoise(cropContext);\n\n\t\t\t// merge the radar and map\n\t\t\tRadar.mergeDopplerRadarImage(context, cropContext);\n\n\t\t\tconst elem = this.fillTemplate('frame', { map: { type: 'img', src: canvas.toDataURL() } });\n\n\t\t\treturn {\n\t\t\t\tcanvas,\n\t\t\t\ttime,\n\t\t\t\telem,\n\t\t\t};\n\t\t}));\n\n\t\t// put the elements in the container\n\t\tconst scrollArea = this.elem.querySelector('.scroll-area');\n\t\tscrollArea.innerHTML = '';\n\t\tscrollArea.append(...radarInfo.map((r) => r.elem));\n\n\t\t// set max length\n\t\tthis.timing.totalScreens = radarInfo.length;\n\t\t// store the images\n\t\tthis.data = radarInfo.map((radar) => radar.canvas);\n\n\t\tthis.times = radarInfo.map((radar) => radar.time);\n\t\tthis.setStatus(STATUS.loaded);\n\t}\n\n\tasync drawCanvas() {\n\t\tsuper.drawCanvas();\n\t\tconst time = this.times[this.screenIndex].toLocaleString(DateTime.TIME_SIMPLE);\n\t\tconst timePadded = time.length >= 8 ? time : ` ${time}`;\n\t\tthis.elem.querySelector('.header .right .time').innerHTML = timePadded;\n\n\t\t// scroll to image\n\t\tthis.elem.querySelector('.scroll-area').style.top = `${-this.screenIndex * 371}px`;\n\n\t\tthis.finishDraw();\n\t}\n\n\tstatic getXYFromLatitudeLongitudeMap(pos, offsetX, offsetY) {\n\t\tlet y = 0;\n\t\tlet x = 0;\n\t\tconst imgHeight = 3200;\n\t\tconst imgWidth = 5100;\n\n\t\ty = (51.75 - pos.latitude) * 55.2;\n\t\t// center map\n\t\ty -= offsetY;\n\n\t\t// Do not allow the map to exceed the max/min coordinates.\n\t\tif (y > (imgHeight - (offsetY * 2))) {\n\t\t\ty = imgHeight - (offsetY * 2);\n\t\t} else if (y < 0) {\n\t\t\ty = 0;\n\t\t}\n\n\t\tx = ((-130.37 - pos.longitude) * 41.775) * -1;\n\t\t// center map\n\t\tx -= offsetX;\n\n\t\t// Do not allow the map to exceed the max/min coordinates.\n\t\tif (x > (imgWidth - (offsetX * 2))) {\n\t\t\tx = imgWidth - (offsetX * 2);\n\t\t} else if (x < 0) {\n\t\t\tx = 0;\n\t\t}\n\n\t\treturn { x: x * 2, y: y * 2 };\n\t}\n\n\tstatic getXYFromLatitudeLongitudeDoppler(pos, offsetX, offsetY) {\n\t\tlet y = 0;\n\t\tlet x = 0;\n\t\tconst imgHeight = 6000;\n\t\tconst imgWidth = 2800;\n\n\t\ty = (51 - pos.latitude) * 61.4481;\n\t\t// center map\n\t\ty -= offsetY;\n\n\t\t// Do not allow the map to exceed the max/min coordinates.\n\t\tif (y > (imgHeight - (offsetY * 2))) {\n\t\t\ty = imgHeight - (offsetY * 2);\n\t\t} else if (y < 0) {\n\t\t\ty = 0;\n\t\t}\n\n\t\tx = ((-129.138 - pos.longitude) * 42.1768) * -1;\n\t\t// center map\n\t\tx -= offsetX;\n\n\t\t// Do not allow the map to exceed the max/min coordinates.\n\t\tif (x > (imgWidth - (offsetX * 2))) {\n\t\t\tx = imgWidth - (offsetX * 2);\n\t\t} else if (x < 0) {\n\t\t\tx = 0;\n\t\t}\n\n\t\treturn { x: x * 2, y: y * 2 };\n\t}\n\n\tstatic removeDopplerRadarImageNoise(RadarContext) {\n\t\tconst RadarImageData = RadarContext.getImageData(0, 0, RadarContext.canvas.width, RadarContext.canvas.height);\n\n\t\t// examine every pixel,\n\t\t// change any old rgb to the new-rgb\n\t\tfor (let i = 0; i < RadarImageData.data.length; i += 4) {\n\t\t\t// i + 0 = red\n\t\t\t// i + 1 = green\n\t\t\t// i + 2 = blue\n\t\t\t// i + 3 = alpha (0 = transparent, 255 = opaque)\n\t\t\tlet R = RadarImageData.data[i];\n\t\t\tlet G = RadarImageData.data[i + 1];\n\t\t\tlet B = RadarImageData.data[i + 2];\n\t\t\tlet A = RadarImageData.data[i + 3];\n\n\t\t\t// is this pixel the old rgb?\n\t\t\tif ((R === 0 && G === 0 && B === 0)\n || (R === 0 && G === 236 && B === 236)\n || (R === 1 && G === 160 && B === 246)\n || (R === 0 && G === 0 && B === 246)) {\n\t\t\t\t// change to your new rgb\n\n\t\t\t\t// Transparent\n\t\t\t\tR = 0;\n\t\t\t\tG = 0;\n\t\t\t\tB = 0;\n\t\t\t\tA = 0;\n\t\t\t} else if ((R === 0 && G === 255 && B === 0)) {\n\t\t\t\t// Light Green 1\n\t\t\t\tR = 49;\n\t\t\t\tG = 210;\n\t\t\t\tB = 22;\n\t\t\t\tA = 255;\n\t\t\t} else if ((R === 0 && G === 200 && B === 0)) {\n\t\t\t\t// Light Green 2\n\t\t\t\tR = 0;\n\t\t\t\tG = 142;\n\t\t\t\tB = 0;\n\t\t\t\tA = 255;\n\t\t\t} else if ((R === 0 && G === 144 && B === 0)) {\n\t\t\t\t// Dark Green 1\n\t\t\t\tR = 20;\n\t\t\t\tG = 90;\n\t\t\t\tB = 15;\n\t\t\t\tA = 255;\n\t\t\t} else if ((R === 255 && G === 255 && B === 0)) {\n\t\t\t\t// Dark Green 2\n\t\t\t\tR = 10;\n\t\t\t\tG = 40;\n\t\t\t\tB = 10;\n\t\t\t\tA = 255;\n\t\t\t} else if ((R === 231 && G === 192 && B === 0)) {\n\t\t\t\t// Yellow\n\t\t\t\tR = 196;\n\t\t\t\tG = 179;\n\t\t\t\tB = 70;\n\t\t\t\tA = 255;\n\t\t\t} else if ((R === 255 && G === 144 && B === 0)) {\n\t\t\t\t// Orange\n\t\t\t\tR = 190;\n\t\t\t\tG = 72;\n\t\t\t\tB = 19;\n\t\t\t\tA = 255;\n\t\t\t} else if ((R === 214 && G === 0 && B === 0)\n || (R === 255 && G === 0 && B === 0)) {\n\t\t\t\t// Red\n\t\t\t\tR = 171;\n\t\t\t\tG = 14;\n\t\t\t\tB = 14;\n\t\t\t\tA = 255;\n\t\t\t} else if ((R === 192 && G === 0 && B === 0)\n || (R === 255 && G === 0 && B === 255)) {\n\t\t\t\t// Brown\n\t\t\t\tR = 115;\n\t\t\t\tG = 31;\n\t\t\t\tB = 4;\n\t\t\t\tA = 255;\n\t\t\t}\n\n\t\t\tRadarImageData.data[i] = R;\n\t\t\tRadarImageData.data[i + 1] = G;\n\t\t\tRadarImageData.data[i + 2] = B;\n\t\t\tRadarImageData.data[i + 3] = A;\n\t\t}\n\n\t\tRadarContext.putImageData(RadarImageData, 0, 0);\n\n\t\t// MapContext.drawImage(RadarContext.canvas, 0, 0);\n\t}\n\n\tstatic mergeDopplerRadarImage(mapContext, radarContext) {\n\t\tconst mapImageData = mapContext.getImageData(0, 0, mapContext.canvas.width, mapContext.canvas.height);\n\t\tconst radarImageData = radarContext.getImageData(0, 0, radarContext.canvas.width, radarContext.canvas.height);\n\n\t\t// examine every pixel,\n\t\t// change any old rgb to the new-rgb\n\t\tfor (let i = 0; i < radarImageData.data.length; i += 4) {\n\t\t\t// i + 0 = red\n\t\t\t// i + 1 = green\n\t\t\t// i + 2 = blue\n\t\t\t// i + 3 = alpha (0 = transparent, 255 = opaque)\n\n\t\t\t// is this pixel the old rgb?\n\t\t\tif ((mapImageData.data[i] < 116 && mapImageData.data[i + 1] < 116 && mapImageData.data[i + 2] < 116)) {\n\t\t\t\t// change to your new rgb\n\n\t\t\t\t// Transparent\n\t\t\t\tradarImageData.data[i] = 0;\n\t\t\t\tradarImageData.data[i + 1] = 0;\n\t\t\t\tradarImageData.data[i + 2] = 0;\n\t\t\t\tradarImageData.data[i + 3] = 0;\n\t\t\t}\n\t\t}\n\n\t\tradarContext.putImageData(radarImageData, 0, 0);\n\n\t\tmapContext.drawImage(radarContext.canvas, 0, 0);\n\t}\n}\n\n// register display\nregisterDisplay(new Radar(8, 'radar'));\n","// regional forecast and observations\n// type 0 = observations, 1 = first forecast, 2 = second forecast\n\nimport STATUS from './status.mjs';\nimport { distance as calcDistance } from './utils/calc.mjs';\nimport { json } from './utils/fetch.mjs';\nimport { celsiusToFahrenheit } from './utils/units.mjs';\nimport { getWeatherRegionalIconFromIconLink } from './icons.mjs';\nimport { preloadImg } from './utils/image.mjs';\nimport { DateTime } from '../vendor/auto/luxon.mjs';\nimport WeatherDisplay from './weatherdisplay.mjs';\nimport { registerDisplay } from './navigation.mjs';\n\nclass RegionalForecast extends WeatherDisplay {\n\tconstructor(navId, elemId) {\n\t\tsuper(navId, elemId, 'Regional Forecast', true);\n\n\t\t// timings\n\t\tthis.timing.totalScreens = 3;\n\t}\n\n\tasync getData(_weatherParameters) {\n\t\tsuper.getData(_weatherParameters);\n\t\tconst weatherParameters = _weatherParameters ?? this.weatherParameters;\n\n\t\t// pre-load the base map\n\t\tlet baseMap = 'images/Basemap2.png';\n\t\tif (weatherParameters.state === 'HI') {\n\t\t\tbaseMap = 'images/HawaiiRadarMap4.png';\n\t\t} else if (weatherParameters.state === 'AK') {\n\t\t\tbaseMap = 'images/AlaskaRadarMap6.png';\n\t\t}\n\t\tthis.elem.querySelector('.map img').src = baseMap;\n\n\t\t// map offset\n\t\tconst offsetXY = {\n\t\t\tx: 240,\n\t\t\ty: 117,\n\t\t};\n\t\t// get user's location in x/y\n\t\tconst sourceXY = RegionalForecast.getXYFromLatitudeLongitude(weatherParameters.latitude, weatherParameters.longitude, offsetXY.x, offsetXY.y, weatherParameters.state);\n\n\t\t// get latitude and longitude limits\n\t\tconst minMaxLatLon = RegionalForecast.getMinMaxLatitudeLongitude(sourceXY.x, sourceXY.y, offsetXY.x, offsetXY.y, weatherParameters.state);\n\n\t\t// get a target distance\n\t\tlet targetDistance = 2.5;\n\t\tif (weatherParameters.state === 'HI') targetDistance = 1;\n\n\t\t// make station info into an array\n\t\tconst stationInfoArray = Object.values(StationInfo).map((value) => ({ ...value, targetDistance }));\n\t\t// combine regional cities with station info for additional stations\n\t\t// stations are intentionally after cities to allow cities priority when drawing the map\n\t\tconst combinedCities = [...RegionalCities, ...stationInfoArray];\n\n\t\t// Determine which cities are within the max/min latitude/longitude.\n\t\tconst regionalCities = [];\n\t\tcombinedCities.forEach((city) => {\n\t\t\tif (city.lat > minMaxLatLon.minLat && city.lat < minMaxLatLon.maxLat\n\t\t\t\t\t\t&& city.lon > minMaxLatLon.minLon && city.lon < minMaxLatLon.maxLon - 1) {\n\t\t\t\t// default to 1 for cities loaded from RegionalCities, use value calculate above for remaining stations\n\t\t\t\tconst targetDist = city.targetDistance || 1;\n\t\t\t\t// Only add the city as long as it isn't within set distance degree of any other city already in the array.\n\t\t\t\tconst okToAddCity = regionalCities.reduce((acc, testCity) => {\n\t\t\t\t\tconst distance = calcDistance(city.lon, city.lat, testCity.lon, testCity.lat);\n\t\t\t\t\treturn acc && distance >= targetDist;\n\t\t\t\t}, true);\n\t\t\t\tif (okToAddCity) regionalCities.push(city);\n\t\t\t}\n\t\t});\n\n\t\t// get regional forecasts and observations (the two are intertwined due to the design of api.weather.gov)\n\t\tconst regionalDataAll = await Promise.all(regionalCities.map(async (city) => {\n\t\t\ttry {\n\t\t\t\tif (!city.point) throw new Error('No pre-loaded point');\n\n\t\t\t\t// start off the observation task\n\t\t\t\tconst observationPromise = RegionalForecast.getRegionalObservation(city.point, city);\n\n\t\t\t\tconst forecast = await json(`https://api.weather.gov/gridpoints/${city.point.wfo}/${city.point.x},${city.point.y}/forecast`);\n\n\t\t\t\t// get XY on map for city\n\t\t\t\tconst cityXY = RegionalForecast.getXYForCity(city, minMaxLatLon.maxLat, minMaxLatLon.minLon, weatherParameters.state);\n\n\t\t\t\t// wait for the regional observation if it's not done yet\n\t\t\t\tconst observation = await observationPromise;\n\t\t\t\t// format the observation the same as the forecast\n\t\t\t\tconst regionalObservation = {\n\t\t\t\t\tdaytime: !!observation.icon.match(/\\/day\\//),\n\t\t\t\t\ttemperature: celsiusToFahrenheit(observation.temperature.value),\n\t\t\t\t\tname: RegionalForecast.formatCity(city.city),\n\t\t\t\t\ticon: observation.icon,\n\t\t\t\t\tx: cityXY.x,\n\t\t\t\t\ty: cityXY.y,\n\t\t\t\t};\n\n\t\t\t\t// preload the icon\n\t\t\t\tpreloadImg(getWeatherRegionalIconFromIconLink(regionalObservation.icon, !regionalObservation.daytime));\n\n\t\t\t\t// return a pared-down forecast\n\t\t\t\t// 0th object is the current conditions\n\t\t\t\t// first object is the next period i.e. if it's daytime then it's the \"tonight\" forecast\n\t\t\t\t// second object is the following period\n\t\t\t\t// always skip the first forecast index because it's what's going on right now\n\t\t\t\treturn [\n\t\t\t\t\tregionalObservation,\n\t\t\t\t\tRegionalForecast.buildForecast(forecast.properties.periods[1], city, cityXY),\n\t\t\t\t\tRegionalForecast.buildForecast(forecast.properties.periods[2], city, cityXY),\n\t\t\t\t];\n\t\t\t} catch (e) {\n\t\t\t\tconsole.log(`No regional forecast data for '${city.name ?? city.city}'`);\n\t\t\t\tconsole.log(e);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}));\n\n\t\t// filter out any false (unavailable data)\n\t\tconst regionalData = regionalDataAll.filter((data) => data);\n\n\t\t// test for data present\n\t\tif (regionalData.length === 0) {\n\t\t\tthis.setStatus(STATUS.noData);\n\t\t\treturn;\n\t\t}\n\n\t\t// return the weather data and offsets\n\t\tthis.data = {\n\t\t\tregionalData,\n\t\t\toffsetXY,\n\t\t\tsourceXY,\n\t\t};\n\n\t\tthis.setStatus(STATUS.loaded);\n\t}\n\n\tstatic buildForecast(forecast, city, cityXY) {\n\t\treturn {\n\t\t\tdaytime: forecast.isDaytime,\n\t\t\ttemperature: forecast.temperature || 0,\n\t\t\tname: RegionalForecast.formatCity(city.city),\n\t\t\ticon: forecast.icon,\n\t\t\tx: cityXY.x,\n\t\t\ty: cityXY.y,\n\t\t\ttime: forecast.startTime,\n\t\t};\n\t}\n\n\tstatic async getRegionalObservation(point, city) {\n\t\ttry {\n\t\t\t// get stations\n\t\t\tconst stations = await json(`https://api.weather.gov/gridpoints/${city.point.wfo}/${city.point.x},${city.point.y}/stations`);\n\n\t\t\t// get the first station\n\t\t\tconst station = stations.features[0].id;\n\t\t\t// get the observation data\n\t\t\tconst observation = await json(`${station}/observations/latest`);\n\t\t\t// preload the image\n\t\t\tif (!observation.properties.icon) return false;\n\t\t\tpreloadImg(getWeatherRegionalIconFromIconLink(observation.properties.icon, !observation.properties.daytime));\n\t\t\t// return the observation\n\t\t\treturn observation.properties;\n\t\t} catch (e) {\n\t\t\tconsole.log(`Unable to get regional observations for ${city.Name ?? city.city}`);\n\t\t\tconsole.error(e.status, e.responseJSON);\n\t\t\treturn false;\n\t\t}\n\t}\n\n\t// utility latitude/pixel conversions\n\tstatic getXYFromLatitudeLongitude(Latitude, Longitude, OffsetX, OffsetY, state) {\n\t\tif (state === 'AK') return RegionalForecast.getXYFromLatitudeLongitudeAK(Latitude, Longitude, OffsetX, OffsetY);\n\t\tif (state === 'HI') return RegionalForecast.getXYFromLatitudeLongitudeHI(Latitude, Longitude, OffsetX, OffsetY);\n\t\tlet y = 0;\n\t\tlet x = 0;\n\t\tconst ImgHeight = 1600;\n\t\tconst ImgWidth = 2550;\n\n\t\ty = (50.5 - Latitude) * 55.2;\n\t\ty -= OffsetY; // Centers map.\n\t\t// Do not allow the map to exceed the max/min coordinates.\n\t\tif (y > (ImgHeight - (OffsetY * 2))) {\n\t\t\ty = ImgHeight - (OffsetY * 2);\n\t\t} else if (y < 0) {\n\t\t\ty = 0;\n\t\t}\n\n\t\tx = ((-127.5 - Longitude) * 41.775) * -1;\n\t\tx -= OffsetX; // Centers map.\n\t\t// Do not allow the map to exceed the max/min coordinates.\n\t\tif (x > (ImgWidth - (OffsetX * 2))) {\n\t\t\tx = ImgWidth - (OffsetX * 2);\n\t\t} else if (x < 0) {\n\t\t\tx = 0;\n\t\t}\n\n\t\treturn { x, y };\n\t}\n\n\tstatic getXYFromLatitudeLongitudeAK(Latitude, Longitude, OffsetX, OffsetY) {\n\t\tlet y = 0;\n\t\tlet x = 0;\n\t\tconst ImgHeight = 1142;\n\t\tconst ImgWidth = 1200;\n\n\t\ty = (73.0 - Latitude) * 56;\n\t\ty -= OffsetY; // Centers map.\n\t\t// Do not allow the map to exceed the max/min coordinates.\n\t\tif (y > (ImgHeight - (OffsetY * 2))) {\n\t\t\ty = ImgHeight - (OffsetY * 2);\n\t\t} else if (y < 0) {\n\t\t\ty = 0;\n\t\t}\n\n\t\tx = ((-175.0 - Longitude) * 25.0) * -1;\n\t\tx -= OffsetX; // Centers map.\n\t\t// Do not allow the map to exceed the max/min coordinates.\n\t\tif (x > (ImgWidth - (OffsetX * 2))) {\n\t\t\tx = ImgWidth - (OffsetX * 2);\n\t\t} else if (x < 0) {\n\t\t\tx = 0;\n\t\t}\n\n\t\treturn { x, y };\n\t}\n\n\tstatic getXYFromLatitudeLongitudeHI(Latitude, Longitude, OffsetX, OffsetY) {\n\t\tlet y = 0;\n\t\tlet x = 0;\n\t\tconst ImgHeight = 571;\n\t\tconst ImgWidth = 600;\n\n\t\ty = (25 - Latitude) * 55.2;\n\t\ty -= OffsetY; // Centers map.\n\t\t// Do not allow the map to exceed the max/min coordinates.\n\t\tif (y > (ImgHeight - (OffsetY * 2))) {\n\t\t\ty = ImgHeight - (OffsetY * 2);\n\t\t} else if (y < 0) {\n\t\t\ty = 0;\n\t\t}\n\n\t\tx = ((-164.5 - Longitude) * 41.775) * -1;\n\t\tx -= OffsetX; // Centers map.\n\t\t// Do not allow the map to exceed the max/min coordinates.\n\t\tif (x > (ImgWidth - (OffsetX * 2))) {\n\t\t\tx = ImgWidth - (OffsetX * 2);\n\t\t} else if (x < 0) {\n\t\t\tx = 0;\n\t\t}\n\n\t\treturn { x, y };\n\t}\n\n\tstatic getMinMaxLatitudeLongitude(X, Y, OffsetX, OffsetY, state) {\n\t\tif (state === 'AK') return RegionalForecast.getMinMaxLatitudeLongitudeAK(X, Y, OffsetX, OffsetY);\n\t\tif (state === 'HI') return RegionalForecast.getMinMaxLatitudeLongitudeHI(X, Y, OffsetX, OffsetY);\n\t\tconst maxLat = ((Y / 55.2) - 50.5) * -1;\n\t\tconst minLat = (((Y + (OffsetY * 2)) / 55.2) - 50.5) * -1;\n\t\tconst minLon = (((X * -1) / 41.775) + 127.5) * -1;\n\t\tconst maxLon = ((((X + (OffsetX * 2)) * -1) / 41.775) + 127.5) * -1;\n\n\t\treturn {\n\t\t\tminLat, maxLat, minLon, maxLon,\n\t\t};\n\t}\n\n\tstatic getMinMaxLatitudeLongitudeAK(X, Y, OffsetX, OffsetY) {\n\t\tconst maxLat = ((Y / 56) - 73.0) * -1;\n\t\tconst minLat = (((Y + (OffsetY * 2)) / 56) - 73.0) * -1;\n\t\tconst minLon = (((X * -1) / 25) + 175.0) * -1;\n\t\tconst maxLon = ((((X + (OffsetX * 2)) * -1) / 25) + 175.0) * -1;\n\n\t\treturn {\n\t\t\tminLat, maxLat, minLon, maxLon,\n\t\t};\n\t}\n\n\tstatic getMinMaxLatitudeLongitudeHI(X, Y, OffsetX, OffsetY) {\n\t\tconst maxLat = ((Y / 55.2) - 25) * -1;\n\t\tconst minLat = (((Y + (OffsetY * 2)) / 55.2) - 25) * -1;\n\t\tconst minLon = (((X * -1) / 41.775) + 164.5) * -1;\n\t\tconst maxLon = ((((X + (OffsetX * 2)) * -1) / 41.775) + 164.5) * -1;\n\n\t\treturn {\n\t\t\tminLat, maxLat, minLon, maxLon,\n\t\t};\n\t}\n\n\tstatic getXYForCity(City, MaxLatitude, MinLongitude, state) {\n\t\tif (state === 'AK') RegionalForecast.getXYForCityAK(City, MaxLatitude, MinLongitude);\n\t\tif (state === 'HI') RegionalForecast.getXYForCityHI(City, MaxLatitude, MinLongitude);\n\t\tlet x = (City.lon - MinLongitude) * 57;\n\t\tlet y = (MaxLatitude - City.lat) * 70;\n\n\t\tif (y < 30) y = 30;\n\t\tif (y > 282) y = 282;\n\n\t\tif (x < 40) x = 40;\n\t\tif (x > 580) x = 580;\n\n\t\treturn { x, y };\n\t}\n\n\tstatic getXYForCityAK(City, MaxLatitude, MinLongitude) {\n\t\tlet x = (City.lon - MinLongitude) * 37;\n\t\tlet y = (MaxLatitude - City.lat) * 70;\n\n\t\tif (y < 30) y = 30;\n\t\tif (y > 282) y = 282;\n\n\t\tif (x < 40) x = 40;\n\t\tif (x > 580) x = 580;\n\t\treturn { x, y };\n\t}\n\n\tstatic getXYForCityHI(City, MaxLatitude, MinLongitude) {\n\t\tlet x = (City.lon - MinLongitude) * 57;\n\t\tlet y = (MaxLatitude - City.lat) * 70;\n\n\t\tif (y < 30) y = 30;\n\t\tif (y > 282) y = 282;\n\n\t\tif (x < 40) x = 40;\n\t\tif (x > 580) x = 580;\n\n\t\treturn { x, y };\n\t}\n\n\t// to fit on the map, remove anything after punctuation and then limit to 15 characters\n\tstatic formatCity(city) {\n\t\treturn city.match(/[^-;/\\\\,]*/)[0].substr(0, 12);\n\t}\n\n\tdrawCanvas() {\n\t\tsuper.drawCanvas();\n\t\t// break up data into useful values\n\t\tconst { regionalData: data, sourceXY, offsetXY } = this.data;\n\n\t\t// draw the header graphics\n\n\t\t// draw the appropriate title\n\t\tconst titleTop = this.elem.querySelector('.title.dual .top');\n\t\tconst titleBottom = this.elem.querySelector('.title.dual .bottom');\n\t\tif (this.screenIndex === 0) {\n\t\t\ttitleTop.innerHTML = 'Regional';\n\t\t\ttitleBottom.innerHTML = 'Observations';\n\t\t} else {\n\t\t\tconst forecastDate = DateTime.fromISO(data[0][this.screenIndex].time);\n\n\t\t\t// get the name of the day\n\t\t\tconst dayName = forecastDate.toLocaleString({ weekday: 'long' });\n\t\t\ttitleTop.innerHTML = 'Forecast for';\n\t\t\t// draw the title\n\t\t\tif (data[0][this.screenIndex].daytime) {\n\t\t\t\ttitleBottom.innerHTML = dayName;\n\t\t\t} else {\n\t\t\t\ttitleBottom.innerHTML = `${dayName} Night`;\n\t\t\t}\n\t\t}\n\n\t\t// draw the map\n\t\tconst scale = 640 / (offsetXY.x * 2);\n\t\tconst map = this.elem.querySelector('.map');\n\t\tmap.style.zoom = scale;\n\t\tmap.style.top = `-${sourceXY.y}px`;\n\t\tmap.style.left = `-${sourceXY.x}px`;\n\n\t\tconst cities = data.map((city) => {\n\t\t\tconst fill = {};\n\t\t\tconst period = city[this.screenIndex];\n\n\t\t\tfill.icon = { type: 'img', src: getWeatherRegionalIconFromIconLink(period.icon, !period.daytime) };\n\t\t\tfill.city = period.name;\n\t\t\tconst { temperature } = period;\n\t\t\tfill.temp = temperature;\n\n\t\t\tconst elem = this.fillTemplate('location', fill);\n\t\t\telem.style.left = `${period.x}px`;\n\t\t\telem.style.top = `${period.y}px`;\n\n\t\t\treturn elem;\n\t\t});\n\n\t\tconst locationContainer = this.elem.querySelector('.location-container');\n\t\tlocationContainer.innerHTML = '';\n\t\tlocationContainer.append(...cities);\n\n\t\tthis.finishDraw();\n\t}\n}\n\n// register display\nregisterDisplay(new RegionalForecast(4, 'regional-forecast'));\n","const STATUS = {\n\tloading: Symbol('loading'),\n\tloaded: Symbol('loaded'),\n\tfailed: Symbol('failed'),\n\tnoData: Symbol('noData'),\n\tdisabled: Symbol('disabled'),\n};\n\nexport default STATUS;\n","// travel forecast display\nimport STATUS from './status.mjs';\nimport { json } from './utils/fetch.mjs';\nimport { getWeatherRegionalIconFromIconLink } from './icons.mjs';\nimport { DateTime } from '../vendor/auto/luxon.mjs';\nimport WeatherDisplay from './weatherdisplay.mjs';\nimport { registerDisplay } from './navigation.mjs';\n\nclass TravelForecast extends WeatherDisplay {\n\tconstructor(navId, elemId, defaultActive) {\n\t\t// special height and width for scrolling\n\t\tsuper(navId, elemId, 'Travel Forecast', defaultActive);\n\n\t\t// set up the timing\n\t\tthis.timing.baseDelay = 20;\n\t\t// page sizes are 4 cities, calculate the number of pages necessary plus overflow\n\t\tconst pagesFloat = TravelCities.length / 4;\n\t\tconst pages = Math.floor(pagesFloat) - 2; // first page is already displayed, last page doesn't happen\n\t\tconst extra = pages % 1;\n\t\tconst timingStep = 75 * 4;\n\t\tthis.timing.delay = [150 + timingStep];\n\t\t// add additional pages\n\t\tfor (let i = 0; i < pages; i += 1) this.timing.delay.push(timingStep);\n\t\t// add the extra (not exactly 4 pages portion)\n\t\tif (extra !== 0) this.timing.delay.push(Math.round(this.extra * this.cityHeight));\n\t\t// add the final 3 second delay\n\t\tthis.timing.delay.push(150);\n\t}\n\n\tasync getData() {\n\t\t// super checks for enabled\n\t\tif (!super.getData()) return;\n\t\tconst forecastPromises = TravelCities.map(async (city) => {\n\t\t\ttry {\n\t\t\t\t// get point then forecast\n\t\t\t\tif (!city.point) throw new Error('No pre-loaded point');\n\t\t\t\tconst forecast = await json(`https://api.weather.gov/gridpoints/${city.point.wfo}/${city.point.x},${city.point.y}/forecast`);\n\t\t\t\t// determine today or tomorrow (shift periods by 1 if tomorrow)\n\t\t\t\tconst todayShift = forecast.properties.periods[0].isDaytime ? 0 : 1;\n\t\t\t\t// return a pared-down forecast\n\t\t\t\treturn {\n\t\t\t\t\ttoday: todayShift === 0,\n\t\t\t\t\thigh: forecast.properties.periods[todayShift].temperature,\n\t\t\t\t\tlow: forecast.properties.periods[todayShift + 1].temperature,\n\t\t\t\t\tname: city.Name,\n\t\t\t\t\ticon: getWeatherRegionalIconFromIconLink(forecast.properties.periods[todayShift].icon),\n\t\t\t\t};\n\t\t\t} catch (e) {\n\t\t\t\tconsole.error(`GetTravelWeather for ${city.Name} failed`);\n\t\t\t\tconsole.error(e.status, e.responseJSON);\n\t\t\t\treturn { name: city.Name, error: true };\n\t\t\t}\n\t\t});\n\n\t\t// wait for all forecasts\n\t\tconst forecasts = await Promise.all(forecastPromises);\n\t\tthis.data = forecasts;\n\n\t\t// test for some data available in at least one forecast\n\t\tconst hasData = this.data.reduce((acc, forecast) => acc || forecast.high, false);\n\t\tif (!hasData) {\n\t\t\tthis.setStatus(STATUS.noData);\n\t\t\treturn;\n\t\t}\n\n\t\tthis.setStatus(STATUS.loaded);\n\t\tthis.drawLongCanvas();\n\t}\n\n\tasync drawLongCanvas() {\n\t\t// get the element and populate\n\t\tconst list = this.elem.querySelector('.travel-lines');\n\t\tlist.innerHTML = '';\n\n\t\t// set up variables\n\t\tconst cities = this.data;\n\n\t\tconst lines = cities.map((city) => {\n\t\t\tif (city.error) return false;\n\t\t\tconst fillValues = {};\n\n\t\t\t// city name\n\t\t\tfillValues.city = city;\n\n\t\t\t// check for forecast data\n\t\t\tif (city.icon) {\n\t\t\t\tfillValues.city = city.name;\n\t\t\t\t// get temperatures and convert if necessary\n\t\t\t\tconst { low, high } = city;\n\n\t\t\t\t// convert to strings with no decimal\n\t\t\t\tconst lowString = Math.round(low).toString();\n\t\t\t\tconst highString = Math.round(high).toString();\n\n\t\t\t\tfillValues.low = lowString;\n\t\t\t\tfillValues.high = highString;\n\n\t\t\t\tfillValues.icon = { type: 'img', src: city.icon };\n\t\t\t} else {\n\t\t\t\tfillValues.error = 'NO TRAVEL DATA AVAILABLE';\n\t\t\t}\n\t\t\treturn this.fillTemplate('travel-row', fillValues);\n\t\t}).filter((d) => d);\n\t\tlist.append(...lines);\n\t}\n\n\tasync drawCanvas() {\n\t\t// there are technically 2 canvases: the standard canvas and the extra-long canvas that contains the complete\n\t\t// list of cities. The second canvas is copied into the standard canvas to create the scroll\n\t\tsuper.drawCanvas();\n\n\t\t// set up variables\n\t\tconst cities = this.data;\n\n\t\tthis.elem.querySelector('.header .title.dual .bottom').innerHTML = `For ${TravelForecast.getTravelCitiesDayName(cities)}`;\n\n\t\tthis.finishDraw();\n\t}\n\n\tasync showCanvas() {\n\t\t// special to travel forecast to draw the remainder of the canvas\n\t\tawait this.drawCanvas();\n\t\tsuper.showCanvas();\n\t}\n\n\t// screen index change callback just runs the base count callback\n\tscreenIndexChange() {\n\t\tthis.baseCountChange(this.navBaseCount);\n\t}\n\n\t// base count change callback\n\tbaseCountChange(count) {\n\t\t// calculate scroll offset and don't go past end\n\t\tlet offsetY = Math.min(this.elem.querySelector('.travel-lines').getBoundingClientRect().height - 289, (count - 150));\n\n\t\t// don't let offset go negative\n\t\tif (offsetY < 0) offsetY = 0;\n\n\t\t// copy the scrolled portion of the canvas\n\t\tthis.elem.querySelector('.main').scrollTo(0, offsetY);\n\t}\n\n\tstatic getTravelCitiesDayName(cities) {\n\t\t// effectively returns early on the first found date\n\t\treturn cities.reduce((dayName, city) => {\n\t\t\tif (city && dayName === '') {\n\t\t\t\t// today or tomorrow\n\t\t\t\tconst day = DateTime.local().plus({ days: (city.today) ? 0 : 1 });\n\t\t\t\t// return the day\n\t\t\t\treturn day.toLocaleString({ weekday: 'long' });\n\t\t\t}\n\t\t\treturn dayName;\n\t\t}, '');\n\t}\n\n\t// necessary to get the lastest long canvas when scrolling\n\tgetLongCanvas() {\n\t\treturn this.longCanvas;\n\t}\n}\n\n// register display, not active by default\nregisterDisplay(new TravelForecast(3, 'travel', false));\n","const relativeHumidity = (Temperature, DewPoint) => {\n\tconst T = Temperature;\n\tconst TD = DewPoint;\n\treturn Math.round(100 * (Math.exp((17.625 * TD) / (243.04 + TD)) / Math.exp((17.625 * T) / (243.04 + T))));\n};\n\nconst heatIndex = (Temperature, RelativeHumidity) => {\n\tconst T = Temperature;\n\tconst RH = RelativeHumidity;\n\tlet HI = 0.5 * (T + 61.0 + ((T - 68.0) * 1.2) + (RH * 0.094));\n\tlet ADJUSTMENT;\n\n\tif (T >= 80) {\n\t\tHI = -42.379 + 2.04901523 * T + 10.14333127 * RH - 0.22475541 * T * RH - 0.00683783 * T * T - 0.05481717 * RH * RH + 0.00122874 * T * T * RH + 0.00085282 * T * RH * RH - 0.00000199 * T * T * RH * RH;\n\n\t\tif (RH < 13 && (T > 80 && T < 112)) {\n\t\t\tADJUSTMENT = ((13 - RH) / 4) * Math.sqrt((17 - Math.abs(T - 95)) / 17);\n\t\t\tHI -= ADJUSTMENT;\n\t\t} else if (RH > 85 && (T > 80 && T < 87)) {\n\t\t\tADJUSTMENT = ((RH - 85) / 10) * ((87 - T) / 5);\n\t\t\tHI += ADJUSTMENT;\n\t\t}\n\t}\n\n\tif (HI < Temperature) {\n\t\tHI = Temperature;\n\t}\n\n\treturn Math.round(HI);\n};\n\nconst windChill = (Temperature, WindSpeed) => {\n\tif (WindSpeed === '0' || WindSpeed === 'Calm' || WindSpeed === 'NA') {\n\t\treturn '';\n\t}\n\n\tconst T = Temperature;\n\tconst V = WindSpeed;\n\n\treturn Math.round(35.74 + (0.6215 * T) - (35.75 * (V ** 0.16)) + (0.4275 * T * (V ** 0.16)));\n};\n\n// wind direction\nconst directionToNSEW = (Direction) => {\n\tconst val = Math.floor((Direction / 22.5) + 0.5);\n\tconst arr = ['N', 'NNE', 'NE', 'ENE', 'E', 'ESE', 'SE', 'SSE', 'S', 'SSW', 'SW', 'WSW', 'W', 'WNW', 'NW', 'NNW'];\n\treturn arr[(val % 16)];\n};\n\nconst distance = (x1, y1, x2, y2) => Math.sqrt((x2 - x1) ** 2 + (y2 - y1) ** 2);\n\n// wrap a number to 0-m\nconst wrap = (x, m) => ((x % m) + m) % m;\n\nexport {\n\trelativeHumidity,\n\theatIndex,\n\twindChill,\n\tdirectionToNSEW,\n\tdistance,\n\twrap,\n};\n","// rewrite some urls for local server\nconst rewriteUrl = (_url) => {\n\tlet url = _url;\n\turl = url.replace('https://api.weather.gov/', window.location.href);\n\turl = url.replace('https://www.cpc.ncep.noaa.gov/', window.location.href);\n\treturn url;\n};\n\nexport {\n\t// eslint-disable-next-line import/prefer-default-export\n\trewriteUrl,\n};\n","const elemForEach = (selector, callback) => {\n\t[...document.querySelectorAll(selector)].forEach(callback);\n};\n\nexport {\n\t// eslint-disable-next-line import/prefer-default-export\n\telemForEach,\n};\n","import { rewriteUrl } from './cors.mjs';\n\nconst json = (url, params) => fetchAsync(url, 'json', params);\nconst text = (url, params) => fetchAsync(url, 'text', params);\nconst raw = (url, params) => fetchAsync(url, '', params);\nconst blob = (url, params) => fetchAsync(url, 'blob', params);\n\nconst fetchAsync = async (_url, responseType, _params = {}) => {\n\t// combine default and provided parameters\n\tconst params = {\n\t\tmethod: 'GET',\n\t\tmode: 'cors',\n\t\ttype: 'GET',\n\t\t..._params,\n\t};\n\t\t// build a url, including the rewrite for cors if necessary\n\tlet corsUrl = _url;\n\tif (params.cors === true) corsUrl = rewriteUrl(_url);\n\tconst url = new URL(corsUrl, `${window.location.origin}/`);\n\t// match the security protocol when not on localhost\n\turl.protocol = window.location.hostname !== 'localhost' ? window.location.protocol : url.protocol;\n\t// add parameters if necessary\n\tif (params.data) {\n\t\tObject.keys(params.data).forEach((key) => {\n\t\t\t// get the value\n\t\t\tconst value = params.data[key];\n\t\t\t// add to the url\n\t\t\turl.searchParams.append(key, value);\n\t\t});\n\t}\n\n\t// make the request\n\tconst response = await fetch(url, params);\n\n\t// check for ok response\n\tif (!response.ok) throw new Error(`Fetch error ${response.status} ${response.statusText} while fetching ${response.url}`);\n\t// return the requested response\n\tswitch (responseType) {\n\tcase 'json':\n\t\treturn response.json();\n\tcase 'text':\n\t\treturn response.text();\n\tcase 'blob':\n\t\treturn response.blob();\n\tdefault:\n\t\treturn response;\n\t}\n};\n\nexport {\n\tjson,\n\ttext,\n\traw,\n\tblob,\n};\n","import { blob } from './fetch.mjs';\nimport { rewriteUrl } from './cors.mjs';\n\n// ****************************** load images *********************************\n// load an image from a blob or url\nconst loadImg = (imgData, cors = false) => new Promise((resolve) => {\n\tconst img = new Image();\n\timg.onload = (e) => {\n\t\tresolve(e.target);\n\t};\n\tif (imgData instanceof Blob) {\n\t\timg.src = window.URL.createObjectURL(imgData);\n\t} else {\n\t\tlet url = imgData;\n\t\tif (cors) url = rewriteUrl(imgData);\n\t\timg.src = url;\n\t}\n});\n\n// preload an image\n// the goal is to get it in the browser's cache so it is available more quickly when the browser needs it\n// a list of cached icons is used to avoid hitting the cache multiple times\nconst cachedImages = [];\nconst preloadImg = (src) => {\n\tif (cachedImages.includes(src)) return false;\n\tblob(src);\n\t// cachedImages.push(src);\n\treturn true;\n};\n\nexport {\n\tloadImg,\n\tpreloadImg,\n};\n","// track state of nosleep locally to avoid a null case error\n// when nosleep.disable is called without first calling .enable\n\nlet wakeLock = false;\n\nconst noSleep = (enable = false) => {\n\t// get a nosleep controller\n\tif (!noSleep.controller) noSleep.controller = new NoSleep();\n\t// don't call anything if the states match\n\tif (wakeLock === enable) return false;\n\t// store the value\n\twakeLock = enable;\n\t// call the function\n\tif (enable) return noSleep.controller.enable();\n\treturn noSleep.controller.disable();\n};\n\nexport default noSleep;\n","const locationCleanup = (input) => {\n\t// regexes to run\n\tconst regexes = [\n\t\t// \"Chicago / West Chicago\", removes before slash\n\t\t/^[A-Za-z ]+ \\/ /,\n\t\t// \"Chicago/Waukegan\" removes before slash\n\t\t/^[A-Za-z ]+\\//,\n\t\t// \"Chicago, Chicago O'hare\" removes before comma\n\t\t/^[A-Za-z ]+, /,\n\t];\n\n\t// run all regexes\n\treturn regexes.reduce((value, regex) => value.replace(regex, ''), input);\n};\n\nexport {\n\t// eslint-disable-next-line import/prefer-default-export\n\tlocationCleanup,\n};\n","// *********************************** unit conversions ***********************\n\nconst round2 = (value, decimals) => Number(`${Math.round(`${value}e${decimals}`)}e-${decimals}`);\n\nconst kphToMph = (Kph) => Math.round(Kph / 1.60934);\nconst celsiusToFahrenheit = (Celsius) => Math.round((Celsius * 9) / 5 + 32);\nconst kilometersToMiles = (Kilometers) => Math.round(Kilometers / 1.60934);\nconst metersToFeet = (Meters) => Math.round(Meters / 0.3048);\nconst pascalToInHg = (Pascal) => round2(Pascal * 0.0002953, 2);\n\nexport {\n\tkphToMph,\n\tcelsiusToFahrenheit,\n\tkilometersToMiles,\n\tmetersToFeet,\n\tpascalToInHg,\n};\n","import { json } from './fetch.mjs';\n\nconst getPoint = async (lat, lon) => {\n\ttry {\n\t\treturn await json(`https://api.weather.gov/points/${lat},${lon}`);\n\t} catch (e) {\n\t\tconsole.log(`Unable to get point ${lat}, ${lon}`);\n\t\tconsole.error(e);\n\t\treturn false;\n\t}\n};\n\nexport {\n\t// eslint-disable-next-line import/prefer-default-export\n\tgetPoint,\n};\n","// base weather display class\n\nimport STATUS from './status.mjs';\nimport { DateTime } from '../vendor/auto/luxon.mjs';\nimport { elemForEach } from './utils/elem.mjs';\nimport {\n\tmsg, displayNavMessage, isPlaying, updateStatus,\n} from './navigation.mjs';\n\nclass WeatherDisplay {\n\tconstructor(navId, elemId, name, defaultEnabled) {\n\t\t// navId is used in messaging and sort order\n\t\tthis.navId = navId;\n\t\tthis.elemId = undefined;\n\t\tthis.gifs = [];\n\t\tthis.data = undefined;\n\t\tthis.loadingStatus = STATUS.loading;\n\t\tthis.name = name ?? elemId;\n\t\tthis.getDataCallbacks = [];\n\t\tthis.defaultEnabled = defaultEnabled;\n\t\tthis.okToDrawCurrentConditions = true;\n\t\tthis.okToDrawCurrentDateTime = true;\n\n\t\t// default navigation timing\n\t\tthis.timing = {\n\t\t\ttotalScreens: 1,\n\t\t\tbaseDelay: 9000, // 5 seconds\n\t\t\tdelay: 1, // 1*1second = 1 second total display time\n\t\t};\n\t\tthis.navBaseCount = 0;\n\t\tthis.screenIndex = -1;\t// special starting condition\n\n\t\t// store elemId once\n\t\tthis.storeElemId(elemId);\n\n\t\tif (this.enabled) {\n\t\t\tthis.setStatus(STATUS.loading);\n\t\t} else {\n\t\t\tthis.setStatus(STATUS.disabled);\n\t\t}\n\t\tthis.startNavCount();\n\n\t\t// get any templates\n\t\tdocument.addEventListener('DOMContentLoaded', () => {\n\t\t\tthis.loadTemplates();\n\t\t});\n\t}\n\n\tgenerateCheckbox(defaultEnabled = true) {\n\t\t// no checkbox if progress\n\t\tif (this.elemId === 'progress') return false;\n\n\t\t// get the saved status of the checkbox\n\t\tlet savedStatus = window.localStorage.getItem(`${this.elemId}Enabled`);\n\t\tif (savedStatus === null) savedStatus = defaultEnabled;\n\t\tif (savedStatus === 'true' || savedStatus === true) {\n\t\t\tthis.enabled = true;\n\t\t} else {\n\t\t\tthis.enabled = false;\n\t\t}\n\n\t\t// refresh (or initially store the state of the checkbox)\n\t\twindow.localStorage.setItem(`${this.elemId}Enabled`, this.enabled);\n\n\t\t// create a checkbox in the selected displays area\n\t\tconst checkbox = document.createElement('template');\n\t\tcheckbox.innerHTML = ``;\n\t\tcheckbox.content.firstChild.addEventListener('change', (e) => this.checkboxChange(e));\n\n\t\treturn checkbox.content.firstChild;\n\t}\n\n\tcheckboxChange(e) {\n\t\t// update the state\n\t\tthis.enabled = e.target.checked;\n\t\t// store the value for the next load\n\t\twindow.localStorage.setItem(`${this.elemId}Enabled`, this.enabled);\n\t\t// calling get data will update the status and actually get the data if we're set to enabled\n\t\tthis.getData();\n\t}\n\n\t// set data status and send update to navigation module\n\tsetStatus(value) {\n\t\tthis.status = value;\n\t\tupdateStatus({\n\t\t\tid: this.navId,\n\t\t\tstatus: this.status,\n\t\t});\n\t}\n\n\tget status() {\n\t\treturn this.loadingStatus;\n\t}\n\n\tset status(state) {\n\t\tthis.loadingStatus = state;\n\t}\n\n\tstoreElemId(elemId) {\n\t\t// only create it once\n\t\tif (this.elemId) return;\n\t\tthis.elemId = elemId;\n\t}\n\n\t// get necessary data for this display\n\tgetData(weatherParameters) {\n\t\t// clear current data\n\t\tthis.data = undefined;\n\n\t\t// store weatherParameters locally in case we need them later\n\t\tif (weatherParameters) this.weatherParameters = weatherParameters;\n\n\t\t// set status\n\t\tif (this.enabled) {\n\t\t\tthis.setStatus(STATUS.loading);\n\t\t} else {\n\t\t\tthis.setStatus(STATUS.disabled);\n\t\t\treturn false;\n\t\t}\n\n\t\t// recalculate navigation timing (in case it was modified in the constructor)\n\t\tthis.calcNavTiming();\n\t\treturn true;\n\t}\n\n\t// return any data requested before it was available\n\tgetDataCallback() {\n\t\t// call each callback\n\t\tthis.getDataCallbacks.forEach((fxn) => fxn(this.data));\n\t\t// clear the callbacks\n\t\tthis.getDataCallbacks = [];\n\t}\n\n\tdrawCanvas() {\n\t\t// clean up the first-run flag in screen index\n\t\tif (this.screenIndex < 0) this.screenIndex = 0;\n\t}\n\n\tfinishDraw() {\n\t\t// draw date and time\n\t\tif (this.okToDrawCurrentDateTime) {\n\t\t\tthis.drawCurrentDateTime();\n\t\t\t// auto clock refresh\n\t\t\tif (!this.dateTimeInterval) {\n\t\t\t\tsetInterval(() => this.drawCurrentDateTime(), 100);\n\t\t\t}\n\t\t}\n\t}\n\n\tdrawCurrentDateTime() {\n\t\t// only draw if canvas is active to conserve battery\n\t\tif (!this.isActive()) return;\n\t\t// Get the current date and time.\n\t\tconst now = DateTime.local();\n\n\t\t// time = \"11:35:08 PM\";\n\t\tconst time = now.toLocaleString(DateTime.TIME_WITH_SECONDS).padStart(11, ' ');\n\n\t\tif (this.lastTime !== time) {\n\t\t\telemForEach('.date-time.time', (elem) => { elem.innerHTML = time.toUpperCase(); });\n\t\t}\n\t\tthis.lastTime = time;\n\n\t\tconst date = now.toFormat(' ccc LLL ') + now.day.toString().padStart(2, ' ');\n\n\t\tif (this.lastDate !== date) {\n\t\t\telemForEach('.date-time.date', (elem) => { elem.innerHTML = date.toUpperCase(); });\n\t\t}\n\t\tthis.lastDate = date;\n\t}\n\n\t// show/hide the canvas and start/stop the navigation timer\n\tshowCanvas(navCmd) {\n\t\t// reset timing if enabled\n\t\t// if a nav command is present call it to set the screen index\n\t\tif (navCmd === msg.command.firstFrame) this.navNext(navCmd);\n\t\tif (navCmd === msg.command.lastFrame) this.navPrev(navCmd);\n\n\t\tthis.startNavCount();\n\n\t\tthis.elem.classList.add('show');\n\t}\n\n\thideCanvas() {\n\t\tthis.resetNavBaseCount();\n\t\tthis.elem.classList.remove('show');\n\t}\n\n\tisActive() {\n\t\treturn this.elem.offsetHeight !== 0;\n\t}\n\n\tisEnabled() {\n\t\treturn this.enabled;\n\t}\n\n\t// navigation timings\n\t// totalScreens = total number of screens that are available\n\t// baseDelay = ms to delay before re-evaluating screenIndex\n\t// delay: three options\n\t//\tinteger = each screen will display for this number of baseDelays\n\t//\t[integer, integer, ...] = screenIndex 0 displays for integer[0]*baseDelay, etc.\n\t//\t[{time, si}, ...] = time as above, si is specific screen index to display during this interval\n\t//\tif the array forms are used totalScreens is overwritten by the size of the array\n\tnavBaseTime() {\n\t\t// see if play is active and screen is active\n\t\tif (!isPlaying() || !this.isActive()) return;\n\t\t// increment the base count\n\t\tthis.navBaseCount += 1;\n\n\t\t// call base count change if available for this function\n\t\tif (this.baseCountChange) this.baseCountChange(this.navBaseCount);\n\n\t\t// handle base count/screen index changes\n\t\tthis.updateScreenFromBaseCount();\n\t}\n\n\tasync updateScreenFromBaseCount() {\n\t\t// get the next screen index\n\t\tconst nextScreenIndex = this.screenIndexFromBaseCount();\n\n\t\t// special cases for first and last frame\n\t\t// must compare with false as nextScreenIndex could be 0 which is valid\n\t\tif (nextScreenIndex === false) {\n\t\t\tthis.sendNavDisplayMessage(msg.response.next);\n\t\t\treturn;\n\t\t}\n\n\t\t// test for no change and exit early\n\t\tif (nextScreenIndex === this.screenIndex) return;\n\n\t\t// test for -1 (no screen displayed yet)\n\t\tif (nextScreenIndex === -1) {\n\t\t\tthis.screenIndex = 0;\n\t\t} else {\n\t\t\tthis.screenIndex = nextScreenIndex;\n\t\t}\n\n\t\t// call the appropriate screen index change method\n\t\tif (!this.screenIndexChange) {\n\t\t\tawait this.drawCanvas();\n\t\t\tthis.showCanvas();\n\t\t} else {\n\t\t\tthis.screenIndexChange(this.screenIndex);\n\t\t}\n\t}\n\n\t// take the three timing formats shown above and break them into arrays for consistent usage in navigation functions\n\t// this.timing.fullDelay = [end of screen index 0 in base counts, end of screen index 1...]\n\t// this.timing.screenIndexes = [screen index to use during this.timing.fullDelay[0], screen index to use during this.timing.fullDelay[1], ...]\n\tcalcNavTiming() {\n\t\tif (this.timing === false) return;\n\t\t// update total screens\n\t\tif (Array.isArray(this.timing.delay)) this.timing.totalScreens = this.timing.delay.length;\n\n\t\t// if the delay is provided as a single value, expand it to a series of the same value\n\t\tlet intermediateDelay = [];\n\t\tif (typeof this.timing.delay === 'number') {\n\t\t\tfor (let i = 0; i < this.timing.totalScreens; i += 1) intermediateDelay.push(this.timing.delay);\n\t\t} else {\n\t\t\t// map just the delays to the intermediate block\n\t\t\tintermediateDelay = this.timing.delay.map((delay) => {\n\t\t\t\tif (typeof delay === 'object') return delay.time;\n\t\t\t\treturn delay;\n\t\t\t});\n\t\t}\n\n\t\t// calculate the cumulative end point of each delay\n\t\tlet sum = 0;\n\t\tthis.timing.fullDelay = intermediateDelay.map((val) => {\n\t\t\tconst calc = sum + val;\n\t\t\tsum += val;\n\t\t\treturn calc;\n\t\t});\n\n\t\t// generate a list of screen either sequentially if not provided in an object or from the object\n\t\tif (Array.isArray(this.timing.delay) && typeof this.timing.delay[0] === 'object') {\n\t\t\t// extract screen indexes from objects\n\t\t\tthis.timing.screenIndexes = this.timing.delay.map((delay) => delay.si);\n\t\t} else {\n\t\t\t// generate sequential screen indexes\n\t\t\tthis.timing.screenIndexes = [];\n\t\t\tfor (let i = 0; i < this.timing.totalScreens; i += 1) this.timing.screenIndexes.push(i);\n\t\t}\n\t}\n\n\t// navigate to next screen\n\tnavNext(command) {\n\t\t// check for special 'first frame' command\n\t\tif (command === msg.command.firstFrame) {\n\t\t\tthis.resetNavBaseCount();\n\t\t} else {\n\t\t\t// set the base count to the next available frame\n\t\t\tconst newBaseCount = this.timing.fullDelay.find((delay) => delay > this.navBaseCount);\n\t\t\tthis.navBaseCount = newBaseCount;\n\t\t}\n\t\tthis.updateScreenFromBaseCount();\n\t}\n\n\t// navigate to previous screen\n\tnavPrev(command) {\n\t\t// check for special 'last frame' command\n\t\tif (command === msg.command.lastFrame) {\n\t\t\tthis.navBaseCount = this.timing.fullDelay[this.timing.totalScreens - 1] - 1;\n\t\t} else {\n\t\t\t// find the highest fullDelay that is less than the current base count\n\t\t\tconst newBaseCount = this.timing.fullDelay.reduce((acc, delay) => {\n\t\t\t\tif (delay < this.navBaseCount) return delay;\n\t\t\t\treturn acc;\n\t\t\t}, 0);\n\t\t\t// if the new base count is zero then we're already at the first screen\n\t\t\tif (newBaseCount === 0 && this.navBaseCount === 0) {\n\t\t\t\tthis.sendNavDisplayMessage(msg.response.previous);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.navBaseCount = newBaseCount;\n\t\t}\n\t\tthis.updateScreenFromBaseCount();\n\t}\n\n\t// get the screen index for the current base count, returns false if past end of timing array (go to next screen, stop timing)\n\tscreenIndexFromBaseCount() {\n\t\t// test for timing enabled\n\t\tif (!this.timing) return 0;\n\t\t// find the first timing in the timing array that is greater than the base count\n\t\tif (this.timing && !this.timing.fullDelay) this.calcNavTiming();\n\t\tconst timingIndex = this.timing.fullDelay.findIndex((delay) => delay > this.navBaseCount);\n\t\tif (timingIndex === -1) return false;\n\t\treturn this.timing.screenIndexes[timingIndex];\n\t}\n\n\t// start and stop base counter\n\tstartNavCount() {\n\t\tif (!this.navInterval) this.navInterval = setInterval(() => this.navBaseTime(), this.timing.baseDelay);\n\t}\n\n\tresetNavBaseCount() {\n\t\tthis.navBaseCount = 0;\n\t\tthis.screenIndex = -1;\n\t\t// reset the timing so we don't short-change the first screen\n\t\tif (this.navInterval) {\n\t\t\tclearInterval(this.navInterval);\n\t\t\tthis.navInterval = undefined;\n\t\t}\n\t}\n\n\tsendNavDisplayMessage(message) {\n\t\tdisplayNavMessage({\n\t\t\tid: this.navId,\n\t\t\ttype: message,\n\t\t});\n\t}\n\n\tloadTemplates() {\n\t\tthis.templates = {};\n\t\tthis.elem = document.getElementById(`${this.elemId}-html`);\n\t\tif (!this.elem) return;\n\t\tconst templates = this.elem.querySelectorAll('.template');\n\t\ttemplates.forEach((template) => {\n\t\t\tconst className = template.classList[0];\n\t\t\tconst node = template.cloneNode(true);\n\t\t\tnode.classList.remove('template');\n\t\t\tthis.templates[className] = node;\n\t\t\ttemplate.remove();\n\t\t});\n\t}\n\n\tfillTemplate(name, fillValues) {\n\t\t// get the template\n\t\tconst templateNode = this.templates[name];\n\t\tif (!templateNode) return false;\n\n\t\t// clone it\n\t\tconst template = templateNode.cloneNode(true);\n\n\t\tObject.entries(fillValues).forEach(([key, value]) => {\n\t\t\t// get the specified element\n\t\t\tconst elem = template.querySelector(`.${key}`);\n\t\t\tif (!elem) return;\n\n\t\t\t// fill based on type provided\n\t\t\tif (typeof value === 'string' || typeof value === 'number') {\n\t\t\t\t// string and number fill the first found selector\n\t\t\t\telem.innerHTML = value;\n\t\t\t} else if (value?.type === 'img') {\n\t\t\t\t// fill the image source\n\t\t\t\telem.querySelector('img').src = value.src;\n\t\t\t}\n\t\t});\n\n\t\treturn template;\n\t}\n}\n\nexport default WeatherDisplay;\n","// these aren't really private, but nor are they really useful to document\n\n/**\n * @private\n */\nclass LuxonError extends Error {}\n\n/**\n * @private\n */\nclass InvalidDateTimeError extends LuxonError {\n constructor(reason) {\n super(`Invalid DateTime: ${reason.toMessage()}`);\n }\n}\n\n/**\n * @private\n */\nclass InvalidIntervalError extends LuxonError {\n constructor(reason) {\n super(`Invalid Interval: ${reason.toMessage()}`);\n }\n}\n\n/**\n * @private\n */\nclass InvalidDurationError extends LuxonError {\n constructor(reason) {\n super(`Invalid Duration: ${reason.toMessage()}`);\n }\n}\n\n/**\n * @private\n */\nclass ConflictingSpecificationError extends LuxonError {}\n\n/**\n * @private\n */\nclass InvalidUnitError extends LuxonError {\n constructor(unit) {\n super(`Invalid unit ${unit}`);\n }\n}\n\n/**\n * @private\n */\nclass InvalidArgumentError extends LuxonError {}\n\n/**\n * @private\n */\nclass ZoneIsAbstractError extends LuxonError {\n constructor() {\n super(\"Zone is an abstract class\");\n }\n}\n\n/**\n * @private\n */\n\nconst n = \"numeric\",\n s = \"short\",\n l = \"long\";\n\nconst DATE_SHORT = {\n year: n,\n month: n,\n day: n,\n};\n\nconst DATE_MED = {\n year: n,\n month: s,\n day: n,\n};\n\nconst DATE_MED_WITH_WEEKDAY = {\n year: n,\n month: s,\n day: n,\n weekday: s,\n};\n\nconst DATE_FULL = {\n year: n,\n month: l,\n day: n,\n};\n\nconst DATE_HUGE = {\n year: n,\n month: l,\n day: n,\n weekday: l,\n};\n\nconst TIME_SIMPLE = {\n hour: n,\n minute: n,\n};\n\nconst TIME_WITH_SECONDS = {\n hour: n,\n minute: n,\n second: n,\n};\n\nconst TIME_WITH_SHORT_OFFSET = {\n hour: n,\n minute: n,\n second: n,\n timeZoneName: s,\n};\n\nconst TIME_WITH_LONG_OFFSET = {\n hour: n,\n minute: n,\n second: n,\n timeZoneName: l,\n};\n\nconst TIME_24_SIMPLE = {\n hour: n,\n minute: n,\n hourCycle: \"h23\",\n};\n\nconst TIME_24_WITH_SECONDS = {\n hour: n,\n minute: n,\n second: n,\n hourCycle: \"h23\",\n};\n\nconst TIME_24_WITH_SHORT_OFFSET = {\n hour: n,\n minute: n,\n second: n,\n hourCycle: \"h23\",\n timeZoneName: s,\n};\n\nconst TIME_24_WITH_LONG_OFFSET = {\n hour: n,\n minute: n,\n second: n,\n hourCycle: \"h23\",\n timeZoneName: l,\n};\n\nconst DATETIME_SHORT = {\n year: n,\n month: n,\n day: n,\n hour: n,\n minute: n,\n};\n\nconst DATETIME_SHORT_WITH_SECONDS = {\n year: n,\n month: n,\n day: n,\n hour: n,\n minute: n,\n second: n,\n};\n\nconst DATETIME_MED = {\n year: n,\n month: s,\n day: n,\n hour: n,\n minute: n,\n};\n\nconst DATETIME_MED_WITH_SECONDS = {\n year: n,\n month: s,\n day: n,\n hour: n,\n minute: n,\n second: n,\n};\n\nconst DATETIME_MED_WITH_WEEKDAY = {\n year: n,\n month: s,\n day: n,\n weekday: s,\n hour: n,\n minute: n,\n};\n\nconst DATETIME_FULL = {\n year: n,\n month: l,\n day: n,\n hour: n,\n minute: n,\n timeZoneName: s,\n};\n\nconst DATETIME_FULL_WITH_SECONDS = {\n year: n,\n month: l,\n day: n,\n hour: n,\n minute: n,\n second: n,\n timeZoneName: s,\n};\n\nconst DATETIME_HUGE = {\n year: n,\n month: l,\n day: n,\n weekday: l,\n hour: n,\n minute: n,\n timeZoneName: l,\n};\n\nconst DATETIME_HUGE_WITH_SECONDS = {\n year: n,\n month: l,\n day: n,\n weekday: l,\n hour: n,\n minute: n,\n second: n,\n timeZoneName: l,\n};\n\n/*\n This is just a junk drawer, containing anything used across multiple classes.\n Because Luxon is small(ish), this should stay small and we won't worry about splitting\n it up into, say, parsingUtil.js and basicUtil.js and so on. But they are divided up by feature area.\n*/\n\n/**\n * @private\n */\n\n// TYPES\n\nfunction isUndefined(o) {\n return typeof o === \"undefined\";\n}\n\nfunction isNumber(o) {\n return typeof o === \"number\";\n}\n\nfunction isInteger(o) {\n return typeof o === \"number\" && o % 1 === 0;\n}\n\nfunction isString(o) {\n return typeof o === \"string\";\n}\n\nfunction isDate(o) {\n return Object.prototype.toString.call(o) === \"[object Date]\";\n}\n\n// CAPABILITIES\n\nfunction hasRelative() {\n try {\n return typeof Intl !== \"undefined\" && !!Intl.RelativeTimeFormat;\n } catch (e) {\n return false;\n }\n}\n\n// OBJECTS AND ARRAYS\n\nfunction maybeArray(thing) {\n return Array.isArray(thing) ? thing : [thing];\n}\n\nfunction bestBy(arr, by, compare) {\n if (arr.length === 0) {\n return undefined;\n }\n return arr.reduce((best, next) => {\n const pair = [by(next), next];\n if (!best) {\n return pair;\n } else if (compare(best[0], pair[0]) === best[0]) {\n return best;\n } else {\n return pair;\n }\n }, null)[1];\n}\n\nfunction pick(obj, keys) {\n return keys.reduce((a, k) => {\n a[k] = obj[k];\n return a;\n }, {});\n}\n\nfunction hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}\n\n// NUMBERS AND STRINGS\n\nfunction integerBetween(thing, bottom, top) {\n return isInteger(thing) && thing >= bottom && thing <= top;\n}\n\n// x % n but takes the sign of n instead of x\nfunction floorMod(x, n) {\n return x - n * Math.floor(x / n);\n}\n\nfunction padStart(input, n = 2) {\n const isNeg = input < 0;\n let padded;\n if (isNeg) {\n padded = \"-\" + (\"\" + -input).padStart(n, \"0\");\n } else {\n padded = (\"\" + input).padStart(n, \"0\");\n }\n return padded;\n}\n\nfunction parseInteger(string) {\n if (isUndefined(string) || string === null || string === \"\") {\n return undefined;\n } else {\n return parseInt(string, 10);\n }\n}\n\nfunction parseFloating(string) {\n if (isUndefined(string) || string === null || string === \"\") {\n return undefined;\n } else {\n return parseFloat(string);\n }\n}\n\nfunction parseMillis(fraction) {\n // Return undefined (instead of 0) in these cases, where fraction is not set\n if (isUndefined(fraction) || fraction === null || fraction === \"\") {\n return undefined;\n } else {\n const f = parseFloat(\"0.\" + fraction) * 1000;\n return Math.floor(f);\n }\n}\n\nfunction roundTo(number, digits, towardZero = false) {\n const factor = 10 ** digits,\n rounder = towardZero ? Math.trunc : Math.round;\n return rounder(number * factor) / factor;\n}\n\n// DATE BASICS\n\nfunction isLeapYear(year) {\n return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);\n}\n\nfunction daysInYear(year) {\n return isLeapYear(year) ? 366 : 365;\n}\n\nfunction daysInMonth(year, month) {\n const modMonth = floorMod(month - 1, 12) + 1,\n modYear = year + (month - modMonth) / 12;\n\n if (modMonth === 2) {\n return isLeapYear(modYear) ? 29 : 28;\n } else {\n return [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][modMonth - 1];\n }\n}\n\n// covert a calendar object to a local timestamp (epoch, but with the offset baked in)\nfunction objToLocalTS(obj) {\n let d = Date.UTC(\n obj.year,\n obj.month - 1,\n obj.day,\n obj.hour,\n obj.minute,\n obj.second,\n obj.millisecond\n );\n\n // for legacy reasons, years between 0 and 99 are interpreted as 19XX; revert that\n if (obj.year < 100 && obj.year >= 0) {\n d = new Date(d);\n d.setUTCFullYear(d.getUTCFullYear() - 1900);\n }\n return +d;\n}\n\nfunction weeksInWeekYear(weekYear) {\n const p1 =\n (weekYear +\n Math.floor(weekYear / 4) -\n Math.floor(weekYear / 100) +\n Math.floor(weekYear / 400)) %\n 7,\n last = weekYear - 1,\n p2 = (last + Math.floor(last / 4) - Math.floor(last / 100) + Math.floor(last / 400)) % 7;\n return p1 === 4 || p2 === 3 ? 53 : 52;\n}\n\nfunction untruncateYear(year) {\n if (year > 99) {\n return year;\n } else return year > 60 ? 1900 + year : 2000 + year;\n}\n\n// PARSING\n\nfunction parseZoneInfo(ts, offsetFormat, locale, timeZone = null) {\n const date = new Date(ts),\n intlOpts = {\n hourCycle: \"h23\",\n year: \"numeric\",\n month: \"2-digit\",\n day: \"2-digit\",\n hour: \"2-digit\",\n minute: \"2-digit\",\n };\n\n if (timeZone) {\n intlOpts.timeZone = timeZone;\n }\n\n const modified = { timeZoneName: offsetFormat, ...intlOpts };\n\n const parsed = new Intl.DateTimeFormat(locale, modified)\n .formatToParts(date)\n .find((m) => m.type.toLowerCase() === \"timezonename\");\n return parsed ? parsed.value : null;\n}\n\n// signedOffset('-5', '30') -> -330\nfunction signedOffset(offHourStr, offMinuteStr) {\n let offHour = parseInt(offHourStr, 10);\n\n // don't || this because we want to preserve -0\n if (Number.isNaN(offHour)) {\n offHour = 0;\n }\n\n const offMin = parseInt(offMinuteStr, 10) || 0,\n offMinSigned = offHour < 0 || Object.is(offHour, -0) ? -offMin : offMin;\n return offHour * 60 + offMinSigned;\n}\n\n// COERCION\n\nfunction asNumber(value) {\n const numericValue = Number(value);\n if (typeof value === \"boolean\" || value === \"\" || Number.isNaN(numericValue))\n throw new InvalidArgumentError(`Invalid unit value ${value}`);\n return numericValue;\n}\n\nfunction normalizeObject(obj, normalizer) {\n const normalized = {};\n for (const u in obj) {\n if (hasOwnProperty(obj, u)) {\n const v = obj[u];\n if (v === undefined || v === null) continue;\n normalized[normalizer(u)] = asNumber(v);\n }\n }\n return normalized;\n}\n\nfunction formatOffset(offset, format) {\n const hours = Math.trunc(Math.abs(offset / 60)),\n minutes = Math.trunc(Math.abs(offset % 60)),\n sign = offset >= 0 ? \"+\" : \"-\";\n\n switch (format) {\n case \"short\":\n return `${sign}${padStart(hours, 2)}:${padStart(minutes, 2)}`;\n case \"narrow\":\n return `${sign}${hours}${minutes > 0 ? `:${minutes}` : \"\"}`;\n case \"techie\":\n return `${sign}${padStart(hours, 2)}${padStart(minutes, 2)}`;\n default:\n throw new RangeError(`Value format ${format} is out of range for property format`);\n }\n}\n\nfunction timeObject(obj) {\n return pick(obj, [\"hour\", \"minute\", \"second\", \"millisecond\"]);\n}\n\nconst ianaRegex =\n /[A-Za-z_+-]{1,256}(?::?\\/[A-Za-z0-9_+-]{1,256}(?:\\/[A-Za-z0-9_+-]{1,256})?)?/;\n\n/**\n * @private\n */\n\nconst monthsLong = [\n \"January\",\n \"February\",\n \"March\",\n \"April\",\n \"May\",\n \"June\",\n \"July\",\n \"August\",\n \"September\",\n \"October\",\n \"November\",\n \"December\",\n];\n\nconst monthsShort = [\n \"Jan\",\n \"Feb\",\n \"Mar\",\n \"Apr\",\n \"May\",\n \"Jun\",\n \"Jul\",\n \"Aug\",\n \"Sep\",\n \"Oct\",\n \"Nov\",\n \"Dec\",\n];\n\nconst monthsNarrow = [\"J\", \"F\", \"M\", \"A\", \"M\", \"J\", \"J\", \"A\", \"S\", \"O\", \"N\", \"D\"];\n\nfunction months(length) {\n switch (length) {\n case \"narrow\":\n return [...monthsNarrow];\n case \"short\":\n return [...monthsShort];\n case \"long\":\n return [...monthsLong];\n case \"numeric\":\n return [\"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"10\", \"11\", \"12\"];\n case \"2-digit\":\n return [\"01\", \"02\", \"03\", \"04\", \"05\", \"06\", \"07\", \"08\", \"09\", \"10\", \"11\", \"12\"];\n default:\n return null;\n }\n}\n\nconst weekdaysLong = [\n \"Monday\",\n \"Tuesday\",\n \"Wednesday\",\n \"Thursday\",\n \"Friday\",\n \"Saturday\",\n \"Sunday\",\n];\n\nconst weekdaysShort = [\"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\", \"Sun\"];\n\nconst weekdaysNarrow = [\"M\", \"T\", \"W\", \"T\", \"F\", \"S\", \"S\"];\n\nfunction weekdays(length) {\n switch (length) {\n case \"narrow\":\n return [...weekdaysNarrow];\n case \"short\":\n return [...weekdaysShort];\n case \"long\":\n return [...weekdaysLong];\n case \"numeric\":\n return [\"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\"];\n default:\n return null;\n }\n}\n\nconst meridiems = [\"AM\", \"PM\"];\n\nconst erasLong = [\"Before Christ\", \"Anno Domini\"];\n\nconst erasShort = [\"BC\", \"AD\"];\n\nconst erasNarrow = [\"B\", \"A\"];\n\nfunction eras(length) {\n switch (length) {\n case \"narrow\":\n return [...erasNarrow];\n case \"short\":\n return [...erasShort];\n case \"long\":\n return [...erasLong];\n default:\n return null;\n }\n}\n\nfunction meridiemForDateTime(dt) {\n return meridiems[dt.hour < 12 ? 0 : 1];\n}\n\nfunction weekdayForDateTime(dt, length) {\n return weekdays(length)[dt.weekday - 1];\n}\n\nfunction monthForDateTime(dt, length) {\n return months(length)[dt.month - 1];\n}\n\nfunction eraForDateTime(dt, length) {\n return eras(length)[dt.year < 0 ? 0 : 1];\n}\n\nfunction formatRelativeTime(unit, count, numeric = \"always\", narrow = false) {\n const units = {\n years: [\"year\", \"yr.\"],\n quarters: [\"quarter\", \"qtr.\"],\n months: [\"month\", \"mo.\"],\n weeks: [\"week\", \"wk.\"],\n days: [\"day\", \"day\", \"days\"],\n hours: [\"hour\", \"hr.\"],\n minutes: [\"minute\", \"min.\"],\n seconds: [\"second\", \"sec.\"],\n };\n\n const lastable = [\"hours\", \"minutes\", \"seconds\"].indexOf(unit) === -1;\n\n if (numeric === \"auto\" && lastable) {\n const isDay = unit === \"days\";\n switch (count) {\n case 1:\n return isDay ? \"tomorrow\" : `next ${units[unit][0]}`;\n case -1:\n return isDay ? \"yesterday\" : `last ${units[unit][0]}`;\n case 0:\n return isDay ? \"today\" : `this ${units[unit][0]}`;\n }\n }\n\n const isInPast = Object.is(count, -0) || count < 0,\n fmtValue = Math.abs(count),\n singular = fmtValue === 1,\n lilUnits = units[unit],\n fmtUnit = narrow\n ? singular\n ? lilUnits[1]\n : lilUnits[2] || lilUnits[1]\n : singular\n ? units[unit][0]\n : unit;\n return isInPast ? `${fmtValue} ${fmtUnit} ago` : `in ${fmtValue} ${fmtUnit}`;\n}\n\nfunction stringifyTokens(splits, tokenToString) {\n let s = \"\";\n for (const token of splits) {\n if (token.literal) {\n s += token.val;\n } else {\n s += tokenToString(token.val);\n }\n }\n return s;\n}\n\nconst macroTokenToFormatOpts = {\n D: DATE_SHORT,\n DD: DATE_MED,\n DDD: DATE_FULL,\n DDDD: DATE_HUGE,\n t: TIME_SIMPLE,\n tt: TIME_WITH_SECONDS,\n ttt: TIME_WITH_SHORT_OFFSET,\n tttt: TIME_WITH_LONG_OFFSET,\n T: TIME_24_SIMPLE,\n TT: TIME_24_WITH_SECONDS,\n TTT: TIME_24_WITH_SHORT_OFFSET,\n TTTT: TIME_24_WITH_LONG_OFFSET,\n f: DATETIME_SHORT,\n ff: DATETIME_MED,\n fff: DATETIME_FULL,\n ffff: DATETIME_HUGE,\n F: DATETIME_SHORT_WITH_SECONDS,\n FF: DATETIME_MED_WITH_SECONDS,\n FFF: DATETIME_FULL_WITH_SECONDS,\n FFFF: DATETIME_HUGE_WITH_SECONDS,\n};\n\n/**\n * @private\n */\n\nclass Formatter {\n static create(locale, opts = {}) {\n return new Formatter(locale, opts);\n }\n\n static parseFormat(fmt) {\n let current = null,\n currentFull = \"\",\n bracketed = false;\n const splits = [];\n for (let i = 0; i < fmt.length; i++) {\n const c = fmt.charAt(i);\n if (c === \"'\") {\n if (currentFull.length > 0) {\n splits.push({ literal: bracketed, val: currentFull });\n }\n current = null;\n currentFull = \"\";\n bracketed = !bracketed;\n } else if (bracketed) {\n currentFull += c;\n } else if (c === current) {\n currentFull += c;\n } else {\n if (currentFull.length > 0) {\n splits.push({ literal: false, val: currentFull });\n }\n currentFull = c;\n current = c;\n }\n }\n\n if (currentFull.length > 0) {\n splits.push({ literal: bracketed, val: currentFull });\n }\n\n return splits;\n }\n\n static macroTokenToFormatOpts(token) {\n return macroTokenToFormatOpts[token];\n }\n\n constructor(locale, formatOpts) {\n this.opts = formatOpts;\n this.loc = locale;\n this.systemLoc = null;\n }\n\n formatWithSystemDefault(dt, opts) {\n if (this.systemLoc === null) {\n this.systemLoc = this.loc.redefaultToSystem();\n }\n const df = this.systemLoc.dtFormatter(dt, { ...this.opts, ...opts });\n return df.format();\n }\n\n formatDateTime(dt, opts = {}) {\n const df = this.loc.dtFormatter(dt, { ...this.opts, ...opts });\n return df.format();\n }\n\n formatDateTimeParts(dt, opts = {}) {\n const df = this.loc.dtFormatter(dt, { ...this.opts, ...opts });\n return df.formatToParts();\n }\n\n resolvedOptions(dt, opts = {}) {\n const df = this.loc.dtFormatter(dt, { ...this.opts, ...opts });\n return df.resolvedOptions();\n }\n\n num(n, p = 0) {\n // we get some perf out of doing this here, annoyingly\n if (this.opts.forceSimple) {\n return padStart(n, p);\n }\n\n const opts = { ...this.opts };\n\n if (p > 0) {\n opts.padTo = p;\n }\n\n return this.loc.numberFormatter(opts).format(n);\n }\n\n formatDateTimeFromString(dt, fmt) {\n const knownEnglish = this.loc.listingMode() === \"en\",\n useDateTimeFormatter = this.loc.outputCalendar && this.loc.outputCalendar !== \"gregory\",\n string = (opts, extract) => this.loc.extract(dt, opts, extract),\n formatOffset = (opts) => {\n if (dt.isOffsetFixed && dt.offset === 0 && opts.allowZ) {\n return \"Z\";\n }\n\n return dt.isValid ? dt.zone.formatOffset(dt.ts, opts.format) : \"\";\n },\n meridiem = () =>\n knownEnglish\n ? meridiemForDateTime(dt)\n : string({ hour: \"numeric\", hourCycle: \"h12\" }, \"dayperiod\"),\n month = (length, standalone) =>\n knownEnglish\n ? monthForDateTime(dt, length)\n : string(standalone ? { month: length } : { month: length, day: \"numeric\" }, \"month\"),\n weekday = (length, standalone) =>\n knownEnglish\n ? weekdayForDateTime(dt, length)\n : string(\n standalone ? { weekday: length } : { weekday: length, month: \"long\", day: \"numeric\" },\n \"weekday\"\n ),\n maybeMacro = (token) => {\n const formatOpts = Formatter.macroTokenToFormatOpts(token);\n if (formatOpts) {\n return this.formatWithSystemDefault(dt, formatOpts);\n } else {\n return token;\n }\n },\n era = (length) =>\n knownEnglish ? eraForDateTime(dt, length) : string({ era: length }, \"era\"),\n tokenToString = (token) => {\n // Where possible: http://cldr.unicode.org/translation/date-time-1/date-time#TOC-Standalone-vs.-Format-Styles\n switch (token) {\n // ms\n case \"S\":\n return this.num(dt.millisecond);\n case \"u\":\n // falls through\n case \"SSS\":\n return this.num(dt.millisecond, 3);\n // seconds\n case \"s\":\n return this.num(dt.second);\n case \"ss\":\n return this.num(dt.second, 2);\n // fractional seconds\n case \"uu\":\n return this.num(Math.floor(dt.millisecond / 10), 2);\n case \"uuu\":\n return this.num(Math.floor(dt.millisecond / 100));\n // minutes\n case \"m\":\n return this.num(dt.minute);\n case \"mm\":\n return this.num(dt.minute, 2);\n // hours\n case \"h\":\n return this.num(dt.hour % 12 === 0 ? 12 : dt.hour % 12);\n case \"hh\":\n return this.num(dt.hour % 12 === 0 ? 12 : dt.hour % 12, 2);\n case \"H\":\n return this.num(dt.hour);\n case \"HH\":\n return this.num(dt.hour, 2);\n // offset\n case \"Z\":\n // like +6\n return formatOffset({ format: \"narrow\", allowZ: this.opts.allowZ });\n case \"ZZ\":\n // like +06:00\n return formatOffset({ format: \"short\", allowZ: this.opts.allowZ });\n case \"ZZZ\":\n // like +0600\n return formatOffset({ format: \"techie\", allowZ: this.opts.allowZ });\n case \"ZZZZ\":\n // like EST\n return dt.zone.offsetName(dt.ts, { format: \"short\", locale: this.loc.locale });\n case \"ZZZZZ\":\n // like Eastern Standard Time\n return dt.zone.offsetName(dt.ts, { format: \"long\", locale: this.loc.locale });\n // zone\n case \"z\":\n // like America/New_York\n return dt.zoneName;\n // meridiems\n case \"a\":\n return meridiem();\n // dates\n case \"d\":\n return useDateTimeFormatter ? string({ day: \"numeric\" }, \"day\") : this.num(dt.day);\n case \"dd\":\n return useDateTimeFormatter ? string({ day: \"2-digit\" }, \"day\") : this.num(dt.day, 2);\n // weekdays - standalone\n case \"c\":\n // like 1\n return this.num(dt.weekday);\n case \"ccc\":\n // like 'Tues'\n return weekday(\"short\", true);\n case \"cccc\":\n // like 'Tuesday'\n return weekday(\"long\", true);\n case \"ccccc\":\n // like 'T'\n return weekday(\"narrow\", true);\n // weekdays - format\n case \"E\":\n // like 1\n return this.num(dt.weekday);\n case \"EEE\":\n // like 'Tues'\n return weekday(\"short\", false);\n case \"EEEE\":\n // like 'Tuesday'\n return weekday(\"long\", false);\n case \"EEEEE\":\n // like 'T'\n return weekday(\"narrow\", false);\n // months - standalone\n case \"L\":\n // like 1\n return useDateTimeFormatter\n ? string({ month: \"numeric\", day: \"numeric\" }, \"month\")\n : this.num(dt.month);\n case \"LL\":\n // like 01, doesn't seem to work\n return useDateTimeFormatter\n ? string({ month: \"2-digit\", day: \"numeric\" }, \"month\")\n : this.num(dt.month, 2);\n case \"LLL\":\n // like Jan\n return month(\"short\", true);\n case \"LLLL\":\n // like January\n return month(\"long\", true);\n case \"LLLLL\":\n // like J\n return month(\"narrow\", true);\n // months - format\n case \"M\":\n // like 1\n return useDateTimeFormatter\n ? string({ month: \"numeric\" }, \"month\")\n : this.num(dt.month);\n case \"MM\":\n // like 01\n return useDateTimeFormatter\n ? string({ month: \"2-digit\" }, \"month\")\n : this.num(dt.month, 2);\n case \"MMM\":\n // like Jan\n return month(\"short\", false);\n case \"MMMM\":\n // like January\n return month(\"long\", false);\n case \"MMMMM\":\n // like J\n return month(\"narrow\", false);\n // years\n case \"y\":\n // like 2014\n return useDateTimeFormatter ? string({ year: \"numeric\" }, \"year\") : this.num(dt.year);\n case \"yy\":\n // like 14\n return useDateTimeFormatter\n ? string({ year: \"2-digit\" }, \"year\")\n : this.num(dt.year.toString().slice(-2), 2);\n case \"yyyy\":\n // like 0012\n return useDateTimeFormatter\n ? string({ year: \"numeric\" }, \"year\")\n : this.num(dt.year, 4);\n case \"yyyyyy\":\n // like 000012\n return useDateTimeFormatter\n ? string({ year: \"numeric\" }, \"year\")\n : this.num(dt.year, 6);\n // eras\n case \"G\":\n // like AD\n return era(\"short\");\n case \"GG\":\n // like Anno Domini\n return era(\"long\");\n case \"GGGGG\":\n return era(\"narrow\");\n case \"kk\":\n return this.num(dt.weekYear.toString().slice(-2), 2);\n case \"kkkk\":\n return this.num(dt.weekYear, 4);\n case \"W\":\n return this.num(dt.weekNumber);\n case \"WW\":\n return this.num(dt.weekNumber, 2);\n case \"o\":\n return this.num(dt.ordinal);\n case \"ooo\":\n return this.num(dt.ordinal, 3);\n case \"q\":\n // like 1\n return this.num(dt.quarter);\n case \"qq\":\n // like 01\n return this.num(dt.quarter, 2);\n case \"X\":\n return this.num(Math.floor(dt.ts / 1000));\n case \"x\":\n return this.num(dt.ts);\n default:\n return maybeMacro(token);\n }\n };\n\n return stringifyTokens(Formatter.parseFormat(fmt), tokenToString);\n }\n\n formatDurationFromString(dur, fmt) {\n const tokenToField = (token) => {\n switch (token[0]) {\n case \"S\":\n return \"millisecond\";\n case \"s\":\n return \"second\";\n case \"m\":\n return \"minute\";\n case \"h\":\n return \"hour\";\n case \"d\":\n return \"day\";\n case \"w\":\n return \"week\";\n case \"M\":\n return \"month\";\n case \"y\":\n return \"year\";\n default:\n return null;\n }\n },\n tokenToString = (lildur) => (token) => {\n const mapped = tokenToField(token);\n if (mapped) {\n return this.num(lildur.get(mapped), token.length);\n } else {\n return token;\n }\n },\n tokens = Formatter.parseFormat(fmt),\n realTokens = tokens.reduce(\n (found, { literal, val }) => (literal ? found : found.concat(val)),\n []\n ),\n collapsed = dur.shiftTo(...realTokens.map(tokenToField).filter((t) => t));\n return stringifyTokens(tokens, tokenToString(collapsed));\n }\n}\n\nclass Invalid {\n constructor(reason, explanation) {\n this.reason = reason;\n this.explanation = explanation;\n }\n\n toMessage() {\n if (this.explanation) {\n return `${this.reason}: ${this.explanation}`;\n } else {\n return this.reason;\n }\n }\n}\n\n/**\n * @interface\n */\nclass Zone {\n /**\n * The type of zone\n * @abstract\n * @type {string}\n */\n get type() {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * The name of this zone.\n * @abstract\n * @type {string}\n */\n get name() {\n throw new ZoneIsAbstractError();\n }\n\n get ianaName() {\n return this.name;\n }\n\n /**\n * Returns whether the offset is known to be fixed for the whole year.\n * @abstract\n * @type {boolean}\n */\n get isUniversal() {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Returns the offset's common name (such as EST) at the specified timestamp\n * @abstract\n * @param {number} ts - Epoch milliseconds for which to get the name\n * @param {Object} opts - Options to affect the format\n * @param {string} opts.format - What style of offset to return. Accepts 'long' or 'short'.\n * @param {string} opts.locale - What locale to return the offset name in.\n * @return {string}\n */\n offsetName(ts, opts) {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Returns the offset's value as a string\n * @abstract\n * @param {number} ts - Epoch milliseconds for which to get the offset\n * @param {string} format - What style of offset to return.\n * Accepts 'narrow', 'short', or 'techie'. Returning '+6', '+06:00', or '+0600' respectively\n * @return {string}\n */\n formatOffset(ts, format) {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Return the offset in minutes for this zone at the specified timestamp.\n * @abstract\n * @param {number} ts - Epoch milliseconds for which to compute the offset\n * @return {number}\n */\n offset(ts) {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Return whether this Zone is equal to another zone\n * @abstract\n * @param {Zone} otherZone - the zone to compare\n * @return {boolean}\n */\n equals(otherZone) {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Return whether this Zone is valid.\n * @abstract\n * @type {boolean}\n */\n get isValid() {\n throw new ZoneIsAbstractError();\n }\n}\n\nlet singleton$1 = null;\n\n/**\n * Represents the local zone for this JavaScript environment.\n * @implements {Zone}\n */\nclass SystemZone extends Zone {\n /**\n * Get a singleton instance of the local zone\n * @return {SystemZone}\n */\n static get instance() {\n if (singleton$1 === null) {\n singleton$1 = new SystemZone();\n }\n return singleton$1;\n }\n\n /** @override **/\n get type() {\n return \"system\";\n }\n\n /** @override **/\n get name() {\n return new Intl.DateTimeFormat().resolvedOptions().timeZone;\n }\n\n /** @override **/\n get isUniversal() {\n return false;\n }\n\n /** @override **/\n offsetName(ts, { format, locale }) {\n return parseZoneInfo(ts, format, locale);\n }\n\n /** @override **/\n formatOffset(ts, format) {\n return formatOffset(this.offset(ts), format);\n }\n\n /** @override **/\n offset(ts) {\n return -new Date(ts).getTimezoneOffset();\n }\n\n /** @override **/\n equals(otherZone) {\n return otherZone.type === \"system\";\n }\n\n /** @override **/\n get isValid() {\n return true;\n }\n}\n\nlet dtfCache = {};\nfunction makeDTF(zone) {\n if (!dtfCache[zone]) {\n dtfCache[zone] = new Intl.DateTimeFormat(\"en-US\", {\n hour12: false,\n timeZone: zone,\n year: \"numeric\",\n month: \"2-digit\",\n day: \"2-digit\",\n hour: \"2-digit\",\n minute: \"2-digit\",\n second: \"2-digit\",\n era: \"short\",\n });\n }\n return dtfCache[zone];\n}\n\nconst typeToPos = {\n year: 0,\n month: 1,\n day: 2,\n era: 3,\n hour: 4,\n minute: 5,\n second: 6,\n};\n\nfunction hackyOffset(dtf, date) {\n const formatted = dtf.format(date).replace(/\\u200E/g, \"\"),\n parsed = /(\\d+)\\/(\\d+)\\/(\\d+) (AD|BC),? (\\d+):(\\d+):(\\d+)/.exec(formatted),\n [, fMonth, fDay, fYear, fadOrBc, fHour, fMinute, fSecond] = parsed;\n return [fYear, fMonth, fDay, fadOrBc, fHour, fMinute, fSecond];\n}\n\nfunction partsOffset(dtf, date) {\n const formatted = dtf.formatToParts(date);\n const filled = [];\n for (let i = 0; i < formatted.length; i++) {\n const { type, value } = formatted[i];\n const pos = typeToPos[type];\n\n if (type === \"era\") {\n filled[pos] = value;\n } else if (!isUndefined(pos)) {\n filled[pos] = parseInt(value, 10);\n }\n }\n return filled;\n}\n\nlet ianaZoneCache = {};\n/**\n * A zone identified by an IANA identifier, like America/New_York\n * @implements {Zone}\n */\nclass IANAZone extends Zone {\n /**\n * @param {string} name - Zone name\n * @return {IANAZone}\n */\n static create(name) {\n if (!ianaZoneCache[name]) {\n ianaZoneCache[name] = new IANAZone(name);\n }\n return ianaZoneCache[name];\n }\n\n /**\n * Reset local caches. Should only be necessary in testing scenarios.\n * @return {void}\n */\n static resetCache() {\n ianaZoneCache = {};\n dtfCache = {};\n }\n\n /**\n * Returns whether the provided string is a valid specifier. This only checks the string's format, not that the specifier identifies a known zone; see isValidZone for that.\n * @param {string} s - The string to check validity on\n * @example IANAZone.isValidSpecifier(\"America/New_York\") //=> true\n * @example IANAZone.isValidSpecifier(\"Sport~~blorp\") //=> false\n * @deprecated This method returns false for some valid IANA names. Use isValidZone instead.\n * @return {boolean}\n */\n static isValidSpecifier(s) {\n return this.isValidZone(s);\n }\n\n /**\n * Returns whether the provided string identifies a real zone\n * @param {string} zone - The string to check\n * @example IANAZone.isValidZone(\"America/New_York\") //=> true\n * @example IANAZone.isValidZone(\"Fantasia/Castle\") //=> false\n * @example IANAZone.isValidZone(\"Sport~~blorp\") //=> false\n * @return {boolean}\n */\n static isValidZone(zone) {\n if (!zone) {\n return false;\n }\n try {\n new Intl.DateTimeFormat(\"en-US\", { timeZone: zone }).format();\n return true;\n } catch (e) {\n return false;\n }\n }\n\n constructor(name) {\n super();\n /** @private **/\n this.zoneName = name;\n /** @private **/\n this.valid = IANAZone.isValidZone(name);\n }\n\n /** @override **/\n get type() {\n return \"iana\";\n }\n\n /** @override **/\n get name() {\n return this.zoneName;\n }\n\n /** @override **/\n get isUniversal() {\n return false;\n }\n\n /** @override **/\n offsetName(ts, { format, locale }) {\n return parseZoneInfo(ts, format, locale, this.name);\n }\n\n /** @override **/\n formatOffset(ts, format) {\n return formatOffset(this.offset(ts), format);\n }\n\n /** @override **/\n offset(ts) {\n const date = new Date(ts);\n\n if (isNaN(date)) return NaN;\n\n const dtf = makeDTF(this.name);\n let [year, month, day, adOrBc, hour, minute, second] = dtf.formatToParts\n ? partsOffset(dtf, date)\n : hackyOffset(dtf, date);\n\n if (adOrBc === \"BC\") {\n year = -Math.abs(year) + 1;\n }\n\n // because we're using hour12 and https://bugs.chromium.org/p/chromium/issues/detail?id=1025564&can=2&q=%2224%3A00%22%20datetimeformat\n const adjustedHour = hour === 24 ? 0 : hour;\n\n const asUTC = objToLocalTS({\n year,\n month,\n day,\n hour: adjustedHour,\n minute,\n second,\n millisecond: 0,\n });\n\n let asTS = +date;\n const over = asTS % 1000;\n asTS -= over >= 0 ? over : 1000 + over;\n return (asUTC - asTS) / (60 * 1000);\n }\n\n /** @override **/\n equals(otherZone) {\n return otherZone.type === \"iana\" && otherZone.name === this.name;\n }\n\n /** @override **/\n get isValid() {\n return this.valid;\n }\n}\n\nlet singleton = null;\n\n/**\n * A zone with a fixed offset (meaning no DST)\n * @implements {Zone}\n */\nclass FixedOffsetZone extends Zone {\n /**\n * Get a singleton instance of UTC\n * @return {FixedOffsetZone}\n */\n static get utcInstance() {\n if (singleton === null) {\n singleton = new FixedOffsetZone(0);\n }\n return singleton;\n }\n\n /**\n * Get an instance with a specified offset\n * @param {number} offset - The offset in minutes\n * @return {FixedOffsetZone}\n */\n static instance(offset) {\n return offset === 0 ? FixedOffsetZone.utcInstance : new FixedOffsetZone(offset);\n }\n\n /**\n * Get an instance of FixedOffsetZone from a UTC offset string, like \"UTC+6\"\n * @param {string} s - The offset string to parse\n * @example FixedOffsetZone.parseSpecifier(\"UTC+6\")\n * @example FixedOffsetZone.parseSpecifier(\"UTC+06\")\n * @example FixedOffsetZone.parseSpecifier(\"UTC-6:00\")\n * @return {FixedOffsetZone}\n */\n static parseSpecifier(s) {\n if (s) {\n const r = s.match(/^utc(?:([+-]\\d{1,2})(?::(\\d{2}))?)?$/i);\n if (r) {\n return new FixedOffsetZone(signedOffset(r[1], r[2]));\n }\n }\n return null;\n }\n\n constructor(offset) {\n super();\n /** @private **/\n this.fixed = offset;\n }\n\n /** @override **/\n get type() {\n return \"fixed\";\n }\n\n /** @override **/\n get name() {\n return this.fixed === 0 ? \"UTC\" : `UTC${formatOffset(this.fixed, \"narrow\")}`;\n }\n\n get ianaName() {\n if (this.fixed === 0) {\n return \"Etc/UTC\";\n } else {\n return `Etc/GMT${formatOffset(-this.fixed, \"narrow\")}`;\n }\n }\n\n /** @override **/\n offsetName() {\n return this.name;\n }\n\n /** @override **/\n formatOffset(ts, format) {\n return formatOffset(this.fixed, format);\n }\n\n /** @override **/\n get isUniversal() {\n return true;\n }\n\n /** @override **/\n offset() {\n return this.fixed;\n }\n\n /** @override **/\n equals(otherZone) {\n return otherZone.type === \"fixed\" && otherZone.fixed === this.fixed;\n }\n\n /** @override **/\n get isValid() {\n return true;\n }\n}\n\n/**\n * A zone that failed to parse. You should never need to instantiate this.\n * @implements {Zone}\n */\nclass InvalidZone extends Zone {\n constructor(zoneName) {\n super();\n /** @private */\n this.zoneName = zoneName;\n }\n\n /** @override **/\n get type() {\n return \"invalid\";\n }\n\n /** @override **/\n get name() {\n return this.zoneName;\n }\n\n /** @override **/\n get isUniversal() {\n return false;\n }\n\n /** @override **/\n offsetName() {\n return null;\n }\n\n /** @override **/\n formatOffset() {\n return \"\";\n }\n\n /** @override **/\n offset() {\n return NaN;\n }\n\n /** @override **/\n equals() {\n return false;\n }\n\n /** @override **/\n get isValid() {\n return false;\n }\n}\n\n/**\n * @private\n */\n\nfunction normalizeZone(input, defaultZone) {\n if (isUndefined(input) || input === null) {\n return defaultZone;\n } else if (input instanceof Zone) {\n return input;\n } else if (isString(input)) {\n const lowered = input.toLowerCase();\n if (lowered === \"default\") return defaultZone;\n else if (lowered === \"local\" || lowered === \"system\") return SystemZone.instance;\n else if (lowered === \"utc\" || lowered === \"gmt\") return FixedOffsetZone.utcInstance;\n else return FixedOffsetZone.parseSpecifier(lowered) || IANAZone.create(input);\n } else if (isNumber(input)) {\n return FixedOffsetZone.instance(input);\n } else if (typeof input === \"object\" && input.offset && typeof input.offset === \"number\") {\n // This is dumb, but the instanceof check above doesn't seem to really work\n // so we're duck checking it\n return input;\n } else {\n return new InvalidZone(input);\n }\n}\n\nlet now = () => Date.now(),\n defaultZone = \"system\",\n defaultLocale = null,\n defaultNumberingSystem = null,\n defaultOutputCalendar = null,\n throwOnInvalid;\n\n/**\n * Settings contains static getters and setters that control Luxon's overall behavior. Luxon is a simple library with few options, but the ones it does have live here.\n */\nclass Settings {\n /**\n * Get the callback for returning the current timestamp.\n * @type {function}\n */\n static get now() {\n return now;\n }\n\n /**\n * Set the callback for returning the current timestamp.\n * The function should return a number, which will be interpreted as an Epoch millisecond count\n * @type {function}\n * @example Settings.now = () => Date.now() + 3000 // pretend it is 3 seconds in the future\n * @example Settings.now = () => 0 // always pretend it's Jan 1, 1970 at midnight in UTC time\n */\n static set now(n) {\n now = n;\n }\n\n /**\n * Set the default time zone to create DateTimes in. Does not affect existing instances.\n * Use the value \"system\" to reset this value to the system's time zone.\n * @type {string}\n */\n static set defaultZone(zone) {\n defaultZone = zone;\n }\n\n /**\n * Get the default time zone object currently used to create DateTimes. Does not affect existing instances.\n * The default value is the system's time zone (the one set on the machine that runs this code).\n * @type {Zone}\n */\n static get defaultZone() {\n return normalizeZone(defaultZone, SystemZone.instance);\n }\n\n /**\n * Get the default locale to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static get defaultLocale() {\n return defaultLocale;\n }\n\n /**\n * Set the default locale to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static set defaultLocale(locale) {\n defaultLocale = locale;\n }\n\n /**\n * Get the default numbering system to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static get defaultNumberingSystem() {\n return defaultNumberingSystem;\n }\n\n /**\n * Set the default numbering system to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static set defaultNumberingSystem(numberingSystem) {\n defaultNumberingSystem = numberingSystem;\n }\n\n /**\n * Get the default output calendar to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static get defaultOutputCalendar() {\n return defaultOutputCalendar;\n }\n\n /**\n * Set the default output calendar to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static set defaultOutputCalendar(outputCalendar) {\n defaultOutputCalendar = outputCalendar;\n }\n\n /**\n * Get whether Luxon will throw when it encounters invalid DateTimes, Durations, or Intervals\n * @type {boolean}\n */\n static get throwOnInvalid() {\n return throwOnInvalid;\n }\n\n /**\n * Set whether Luxon will throw when it encounters invalid DateTimes, Durations, or Intervals\n * @type {boolean}\n */\n static set throwOnInvalid(t) {\n throwOnInvalid = t;\n }\n\n /**\n * Reset Luxon's global caches. Should only be necessary in testing scenarios.\n * @return {void}\n */\n static resetCaches() {\n Locale.resetCache();\n IANAZone.resetCache();\n }\n}\n\n// todo - remap caching\n\nlet intlLFCache = {};\nfunction getCachedLF(locString, opts = {}) {\n const key = JSON.stringify([locString, opts]);\n let dtf = intlLFCache[key];\n if (!dtf) {\n dtf = new Intl.ListFormat(locString, opts);\n intlLFCache[key] = dtf;\n }\n return dtf;\n}\n\nlet intlDTCache = {};\nfunction getCachedDTF(locString, opts = {}) {\n const key = JSON.stringify([locString, opts]);\n let dtf = intlDTCache[key];\n if (!dtf) {\n dtf = new Intl.DateTimeFormat(locString, opts);\n intlDTCache[key] = dtf;\n }\n return dtf;\n}\n\nlet intlNumCache = {};\nfunction getCachedINF(locString, opts = {}) {\n const key = JSON.stringify([locString, opts]);\n let inf = intlNumCache[key];\n if (!inf) {\n inf = new Intl.NumberFormat(locString, opts);\n intlNumCache[key] = inf;\n }\n return inf;\n}\n\nlet intlRelCache = {};\nfunction getCachedRTF(locString, opts = {}) {\n const { base, ...cacheKeyOpts } = opts; // exclude `base` from the options\n const key = JSON.stringify([locString, cacheKeyOpts]);\n let inf = intlRelCache[key];\n if (!inf) {\n inf = new Intl.RelativeTimeFormat(locString, opts);\n intlRelCache[key] = inf;\n }\n return inf;\n}\n\nlet sysLocaleCache = null;\nfunction systemLocale() {\n if (sysLocaleCache) {\n return sysLocaleCache;\n } else {\n sysLocaleCache = new Intl.DateTimeFormat().resolvedOptions().locale;\n return sysLocaleCache;\n }\n}\n\nfunction parseLocaleString(localeStr) {\n // I really want to avoid writing a BCP 47 parser\n // see, e.g. https://github.com/wooorm/bcp-47\n // Instead, we'll do this:\n\n // a) if the string has no -u extensions, just leave it alone\n // b) if it does, use Intl to resolve everything\n // c) if Intl fails, try again without the -u\n\n const uIndex = localeStr.indexOf(\"-u-\");\n if (uIndex === -1) {\n return [localeStr];\n } else {\n let options;\n const smaller = localeStr.substring(0, uIndex);\n try {\n options = getCachedDTF(localeStr).resolvedOptions();\n } catch (e) {\n options = getCachedDTF(smaller).resolvedOptions();\n }\n\n const { numberingSystem, calendar } = options;\n // return the smaller one so that we can append the calendar and numbering overrides to it\n return [smaller, numberingSystem, calendar];\n }\n}\n\nfunction intlConfigString(localeStr, numberingSystem, outputCalendar) {\n if (outputCalendar || numberingSystem) {\n localeStr += \"-u\";\n\n if (outputCalendar) {\n localeStr += `-ca-${outputCalendar}`;\n }\n\n if (numberingSystem) {\n localeStr += `-nu-${numberingSystem}`;\n }\n return localeStr;\n } else {\n return localeStr;\n }\n}\n\nfunction mapMonths(f) {\n const ms = [];\n for (let i = 1; i <= 12; i++) {\n const dt = DateTime.utc(2016, i, 1);\n ms.push(f(dt));\n }\n return ms;\n}\n\nfunction mapWeekdays(f) {\n const ms = [];\n for (let i = 1; i <= 7; i++) {\n const dt = DateTime.utc(2016, 11, 13 + i);\n ms.push(f(dt));\n }\n return ms;\n}\n\nfunction listStuff(loc, length, defaultOK, englishFn, intlFn) {\n const mode = loc.listingMode(defaultOK);\n\n if (mode === \"error\") {\n return null;\n } else if (mode === \"en\") {\n return englishFn(length);\n } else {\n return intlFn(length);\n }\n}\n\nfunction supportsFastNumbers(loc) {\n if (loc.numberingSystem && loc.numberingSystem !== \"latn\") {\n return false;\n } else {\n return (\n loc.numberingSystem === \"latn\" ||\n !loc.locale ||\n loc.locale.startsWith(\"en\") ||\n new Intl.DateTimeFormat(loc.intl).resolvedOptions().numberingSystem === \"latn\"\n );\n }\n}\n\n/**\n * @private\n */\n\nclass PolyNumberFormatter {\n constructor(intl, forceSimple, opts) {\n this.padTo = opts.padTo || 0;\n this.floor = opts.floor || false;\n\n const { padTo, floor, ...otherOpts } = opts;\n\n if (!forceSimple || Object.keys(otherOpts).length > 0) {\n const intlOpts = { useGrouping: false, ...opts };\n if (opts.padTo > 0) intlOpts.minimumIntegerDigits = opts.padTo;\n this.inf = getCachedINF(intl, intlOpts);\n }\n }\n\n format(i) {\n if (this.inf) {\n const fixed = this.floor ? Math.floor(i) : i;\n return this.inf.format(fixed);\n } else {\n // to match the browser's numberformatter defaults\n const fixed = this.floor ? Math.floor(i) : roundTo(i, 3);\n return padStart(fixed, this.padTo);\n }\n }\n}\n\n/**\n * @private\n */\n\nclass PolyDateFormatter {\n constructor(dt, intl, opts) {\n this.opts = opts;\n\n let z;\n if (dt.zone.isUniversal) {\n // UTC-8 or Etc/UTC-8 are not part of tzdata, only Etc/GMT+8 and the like.\n // That is why fixed-offset TZ is set to that unless it is:\n // 1. Representing offset 0 when UTC is used to maintain previous behavior and does not become GMT.\n // 2. Unsupported by the browser:\n // - some do not support Etc/\n // - < Etc/GMT-14, > Etc/GMT+12, and 30-minute or 45-minute offsets are not part of tzdata\n const gmtOffset = -1 * (dt.offset / 60);\n const offsetZ = gmtOffset >= 0 ? `Etc/GMT+${gmtOffset}` : `Etc/GMT${gmtOffset}`;\n if (dt.offset !== 0 && IANAZone.create(offsetZ).valid) {\n z = offsetZ;\n this.dt = dt;\n } else {\n // Not all fixed-offset zones like Etc/+4:30 are present in tzdata.\n // So we have to make do. Two cases:\n // 1. The format options tell us to show the zone. We can't do that, so the best\n // we can do is format the date in UTC.\n // 2. The format options don't tell us to show the zone. Then we can adjust them\n // the time and tell the formatter to show it to us in UTC, so that the time is right\n // and the bad zone doesn't show up.\n z = \"UTC\";\n if (opts.timeZoneName) {\n this.dt = dt;\n } else {\n this.dt = dt.offset === 0 ? dt : DateTime.fromMillis(dt.ts + dt.offset * 60 * 1000);\n }\n }\n } else if (dt.zone.type === \"system\") {\n this.dt = dt;\n } else {\n this.dt = dt;\n z = dt.zone.name;\n }\n\n const intlOpts = { ...this.opts };\n if (z) {\n intlOpts.timeZone = z;\n }\n this.dtf = getCachedDTF(intl, intlOpts);\n }\n\n format() {\n return this.dtf.format(this.dt.toJSDate());\n }\n\n formatToParts() {\n return this.dtf.formatToParts(this.dt.toJSDate());\n }\n\n resolvedOptions() {\n return this.dtf.resolvedOptions();\n }\n}\n\n/**\n * @private\n */\nclass PolyRelFormatter {\n constructor(intl, isEnglish, opts) {\n this.opts = { style: \"long\", ...opts };\n if (!isEnglish && hasRelative()) {\n this.rtf = getCachedRTF(intl, opts);\n }\n }\n\n format(count, unit) {\n if (this.rtf) {\n return this.rtf.format(count, unit);\n } else {\n return formatRelativeTime(unit, count, this.opts.numeric, this.opts.style !== \"long\");\n }\n }\n\n formatToParts(count, unit) {\n if (this.rtf) {\n return this.rtf.formatToParts(count, unit);\n } else {\n return [];\n }\n }\n}\n\n/**\n * @private\n */\n\nclass Locale {\n static fromOpts(opts) {\n return Locale.create(opts.locale, opts.numberingSystem, opts.outputCalendar, opts.defaultToEN);\n }\n\n static create(locale, numberingSystem, outputCalendar, defaultToEN = false) {\n const specifiedLocale = locale || Settings.defaultLocale;\n // the system locale is useful for human readable strings but annoying for parsing/formatting known formats\n const localeR = specifiedLocale || (defaultToEN ? \"en-US\" : systemLocale());\n const numberingSystemR = numberingSystem || Settings.defaultNumberingSystem;\n const outputCalendarR = outputCalendar || Settings.defaultOutputCalendar;\n return new Locale(localeR, numberingSystemR, outputCalendarR, specifiedLocale);\n }\n\n static resetCache() {\n sysLocaleCache = null;\n intlDTCache = {};\n intlNumCache = {};\n intlRelCache = {};\n }\n\n static fromObject({ locale, numberingSystem, outputCalendar } = {}) {\n return Locale.create(locale, numberingSystem, outputCalendar);\n }\n\n constructor(locale, numbering, outputCalendar, specifiedLocale) {\n const [parsedLocale, parsedNumberingSystem, parsedOutputCalendar] = parseLocaleString(locale);\n\n this.locale = parsedLocale;\n this.numberingSystem = numbering || parsedNumberingSystem || null;\n this.outputCalendar = outputCalendar || parsedOutputCalendar || null;\n this.intl = intlConfigString(this.locale, this.numberingSystem, this.outputCalendar);\n\n this.weekdaysCache = { format: {}, standalone: {} };\n this.monthsCache = { format: {}, standalone: {} };\n this.meridiemCache = null;\n this.eraCache = {};\n\n this.specifiedLocale = specifiedLocale;\n this.fastNumbersCached = null;\n }\n\n get fastNumbers() {\n if (this.fastNumbersCached == null) {\n this.fastNumbersCached = supportsFastNumbers(this);\n }\n\n return this.fastNumbersCached;\n }\n\n listingMode() {\n const isActuallyEn = this.isEnglish();\n const hasNoWeirdness =\n (this.numberingSystem === null || this.numberingSystem === \"latn\") &&\n (this.outputCalendar === null || this.outputCalendar === \"gregory\");\n return isActuallyEn && hasNoWeirdness ? \"en\" : \"intl\";\n }\n\n clone(alts) {\n if (!alts || Object.getOwnPropertyNames(alts).length === 0) {\n return this;\n } else {\n return Locale.create(\n alts.locale || this.specifiedLocale,\n alts.numberingSystem || this.numberingSystem,\n alts.outputCalendar || this.outputCalendar,\n alts.defaultToEN || false\n );\n }\n }\n\n redefaultToEN(alts = {}) {\n return this.clone({ ...alts, defaultToEN: true });\n }\n\n redefaultToSystem(alts = {}) {\n return this.clone({ ...alts, defaultToEN: false });\n }\n\n months(length, format = false, defaultOK = true) {\n return listStuff(this, length, defaultOK, months, () => {\n const intl = format ? { month: length, day: \"numeric\" } : { month: length },\n formatStr = format ? \"format\" : \"standalone\";\n if (!this.monthsCache[formatStr][length]) {\n this.monthsCache[formatStr][length] = mapMonths((dt) => this.extract(dt, intl, \"month\"));\n }\n return this.monthsCache[formatStr][length];\n });\n }\n\n weekdays(length, format = false, defaultOK = true) {\n return listStuff(this, length, defaultOK, weekdays, () => {\n const intl = format\n ? { weekday: length, year: \"numeric\", month: \"long\", day: \"numeric\" }\n : { weekday: length },\n formatStr = format ? \"format\" : \"standalone\";\n if (!this.weekdaysCache[formatStr][length]) {\n this.weekdaysCache[formatStr][length] = mapWeekdays((dt) =>\n this.extract(dt, intl, \"weekday\")\n );\n }\n return this.weekdaysCache[formatStr][length];\n });\n }\n\n meridiems(defaultOK = true) {\n return listStuff(\n this,\n undefined,\n defaultOK,\n () => meridiems,\n () => {\n // In theory there could be aribitrary day periods. We're gonna assume there are exactly two\n // for AM and PM. This is probably wrong, but it's makes parsing way easier.\n if (!this.meridiemCache) {\n const intl = { hour: \"numeric\", hourCycle: \"h12\" };\n this.meridiemCache = [DateTime.utc(2016, 11, 13, 9), DateTime.utc(2016, 11, 13, 19)].map(\n (dt) => this.extract(dt, intl, \"dayperiod\")\n );\n }\n\n return this.meridiemCache;\n }\n );\n }\n\n eras(length, defaultOK = true) {\n return listStuff(this, length, defaultOK, eras, () => {\n const intl = { era: length };\n\n // This is problematic. Different calendars are going to define eras totally differently. What I need is the minimum set of dates\n // to definitely enumerate them.\n if (!this.eraCache[length]) {\n this.eraCache[length] = [DateTime.utc(-40, 1, 1), DateTime.utc(2017, 1, 1)].map((dt) =>\n this.extract(dt, intl, \"era\")\n );\n }\n\n return this.eraCache[length];\n });\n }\n\n extract(dt, intlOpts, field) {\n const df = this.dtFormatter(dt, intlOpts),\n results = df.formatToParts(),\n matching = results.find((m) => m.type.toLowerCase() === field);\n return matching ? matching.value : null;\n }\n\n numberFormatter(opts = {}) {\n // this forcesimple option is never used (the only caller short-circuits on it, but it seems safer to leave)\n // (in contrast, the rest of the condition is used heavily)\n return new PolyNumberFormatter(this.intl, opts.forceSimple || this.fastNumbers, opts);\n }\n\n dtFormatter(dt, intlOpts = {}) {\n return new PolyDateFormatter(dt, this.intl, intlOpts);\n }\n\n relFormatter(opts = {}) {\n return new PolyRelFormatter(this.intl, this.isEnglish(), opts);\n }\n\n listFormatter(opts = {}) {\n return getCachedLF(this.intl, opts);\n }\n\n isEnglish() {\n return (\n this.locale === \"en\" ||\n this.locale.toLowerCase() === \"en-us\" ||\n new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith(\"en-us\")\n );\n }\n\n equals(other) {\n return (\n this.locale === other.locale &&\n this.numberingSystem === other.numberingSystem &&\n this.outputCalendar === other.outputCalendar\n );\n }\n}\n\n/*\n * This file handles parsing for well-specified formats. Here's how it works:\n * Two things go into parsing: a regex to match with and an extractor to take apart the groups in the match.\n * An extractor is just a function that takes a regex match array and returns a { year: ..., month: ... } object\n * parse() does the work of executing the regex and applying the extractor. It takes multiple regex/extractor pairs to try in sequence.\n * Extractors can take a \"cursor\" representing the offset in the match to look at. This makes it easy to combine extractors.\n * combineExtractors() does the work of combining them, keeping track of the cursor through multiple extractions.\n * Some extractions are super dumb and simpleParse and fromStrings help DRY them.\n */\n\nfunction combineRegexes(...regexes) {\n const full = regexes.reduce((f, r) => f + r.source, \"\");\n return RegExp(`^${full}$`);\n}\n\nfunction combineExtractors(...extractors) {\n return (m) =>\n extractors\n .reduce(\n ([mergedVals, mergedZone, cursor], ex) => {\n const [val, zone, next] = ex(m, cursor);\n return [{ ...mergedVals, ...val }, zone || mergedZone, next];\n },\n [{}, null, 1]\n )\n .slice(0, 2);\n}\n\nfunction parse(s, ...patterns) {\n if (s == null) {\n return [null, null];\n }\n\n for (const [regex, extractor] of patterns) {\n const m = regex.exec(s);\n if (m) {\n return extractor(m);\n }\n }\n return [null, null];\n}\n\nfunction simpleParse(...keys) {\n return (match, cursor) => {\n const ret = {};\n let i;\n\n for (i = 0; i < keys.length; i++) {\n ret[keys[i]] = parseInteger(match[cursor + i]);\n }\n return [ret, null, cursor + i];\n };\n}\n\n// ISO and SQL parsing\nconst offsetRegex = /(?:(Z)|([+-]\\d\\d)(?::?(\\d\\d))?)/;\nconst isoExtendedZone = `(?:${offsetRegex.source}?(?:\\\\[(${ianaRegex.source})\\\\])?)?`;\nconst isoTimeBaseRegex = /(\\d\\d)(?::?(\\d\\d)(?::?(\\d\\d)(?:[.,](\\d{1,30}))?)?)?/;\nconst isoTimeRegex = RegExp(`${isoTimeBaseRegex.source}${isoExtendedZone}`);\nconst isoTimeExtensionRegex = RegExp(`(?:T${isoTimeRegex.source})?`);\nconst isoYmdRegex = /([+-]\\d{6}|\\d{4})(?:-?(\\d\\d)(?:-?(\\d\\d))?)?/;\nconst isoWeekRegex = /(\\d{4})-?W(\\d\\d)(?:-?(\\d))?/;\nconst isoOrdinalRegex = /(\\d{4})-?(\\d{3})/;\nconst extractISOWeekData = simpleParse(\"weekYear\", \"weekNumber\", \"weekDay\");\nconst extractISOOrdinalData = simpleParse(\"year\", \"ordinal\");\nconst sqlYmdRegex = /(\\d{4})-(\\d\\d)-(\\d\\d)/; // dumbed-down version of the ISO one\nconst sqlTimeRegex = RegExp(\n `${isoTimeBaseRegex.source} ?(?:${offsetRegex.source}|(${ianaRegex.source}))?`\n);\nconst sqlTimeExtensionRegex = RegExp(`(?: ${sqlTimeRegex.source})?`);\n\nfunction int(match, pos, fallback) {\n const m = match[pos];\n return isUndefined(m) ? fallback : parseInteger(m);\n}\n\nfunction extractISOYmd(match, cursor) {\n const item = {\n year: int(match, cursor),\n month: int(match, cursor + 1, 1),\n day: int(match, cursor + 2, 1),\n };\n\n return [item, null, cursor + 3];\n}\n\nfunction extractISOTime(match, cursor) {\n const item = {\n hours: int(match, cursor, 0),\n minutes: int(match, cursor + 1, 0),\n seconds: int(match, cursor + 2, 0),\n milliseconds: parseMillis(match[cursor + 3]),\n };\n\n return [item, null, cursor + 4];\n}\n\nfunction extractISOOffset(match, cursor) {\n const local = !match[cursor] && !match[cursor + 1],\n fullOffset = signedOffset(match[cursor + 1], match[cursor + 2]),\n zone = local ? null : FixedOffsetZone.instance(fullOffset);\n return [{}, zone, cursor + 3];\n}\n\nfunction extractIANAZone(match, cursor) {\n const zone = match[cursor] ? IANAZone.create(match[cursor]) : null;\n return [{}, zone, cursor + 1];\n}\n\n// ISO time parsing\n\nconst isoTimeOnly = RegExp(`^T?${isoTimeBaseRegex.source}$`);\n\n// ISO duration parsing\n\nconst isoDuration =\n /^-?P(?:(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)Y)?(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)M)?(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)W)?(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)D)?(?:T(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)H)?(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)M)?(?:(-?\\d{1,20})(?:[.,](-?\\d{1,20}))?S)?)?)$/;\n\nfunction extractISODuration(match) {\n const [s, yearStr, monthStr, weekStr, dayStr, hourStr, minuteStr, secondStr, millisecondsStr] =\n match;\n\n const hasNegativePrefix = s[0] === \"-\";\n const negativeSeconds = secondStr && secondStr[0] === \"-\";\n\n const maybeNegate = (num, force = false) =>\n num !== undefined && (force || (num && hasNegativePrefix)) ? -num : num;\n\n return [\n {\n years: maybeNegate(parseFloating(yearStr)),\n months: maybeNegate(parseFloating(monthStr)),\n weeks: maybeNegate(parseFloating(weekStr)),\n days: maybeNegate(parseFloating(dayStr)),\n hours: maybeNegate(parseFloating(hourStr)),\n minutes: maybeNegate(parseFloating(minuteStr)),\n seconds: maybeNegate(parseFloating(secondStr), secondStr === \"-0\"),\n milliseconds: maybeNegate(parseMillis(millisecondsStr), negativeSeconds),\n },\n ];\n}\n\n// These are a little braindead. EDT *should* tell us that we're in, say, America/New_York\n// and not just that we're in -240 *right now*. But since I don't think these are used that often\n// I'm just going to ignore that\nconst obsOffsets = {\n GMT: 0,\n EDT: -4 * 60,\n EST: -5 * 60,\n CDT: -5 * 60,\n CST: -6 * 60,\n MDT: -6 * 60,\n MST: -7 * 60,\n PDT: -7 * 60,\n PST: -8 * 60,\n};\n\nfunction fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr) {\n const result = {\n year: yearStr.length === 2 ? untruncateYear(parseInteger(yearStr)) : parseInteger(yearStr),\n month: monthsShort.indexOf(monthStr) + 1,\n day: parseInteger(dayStr),\n hour: parseInteger(hourStr),\n minute: parseInteger(minuteStr),\n };\n\n if (secondStr) result.second = parseInteger(secondStr);\n if (weekdayStr) {\n result.weekday =\n weekdayStr.length > 3\n ? weekdaysLong.indexOf(weekdayStr) + 1\n : weekdaysShort.indexOf(weekdayStr) + 1;\n }\n\n return result;\n}\n\n// RFC 2822/5322\nconst rfc2822 =\n /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\\s)?(\\d{1,2})\\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\\s(\\d{2,4})\\s(\\d\\d):(\\d\\d)(?::(\\d\\d))?\\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\\d\\d)(\\d\\d)))$/;\n\nfunction extractRFC2822(match) {\n const [\n ,\n weekdayStr,\n dayStr,\n monthStr,\n yearStr,\n hourStr,\n minuteStr,\n secondStr,\n obsOffset,\n milOffset,\n offHourStr,\n offMinuteStr,\n ] = match,\n result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr);\n\n let offset;\n if (obsOffset) {\n offset = obsOffsets[obsOffset];\n } else if (milOffset) {\n offset = 0;\n } else {\n offset = signedOffset(offHourStr, offMinuteStr);\n }\n\n return [result, new FixedOffsetZone(offset)];\n}\n\nfunction preprocessRFC2822(s) {\n // Remove comments and folding whitespace and replace multiple-spaces with a single space\n return s\n .replace(/\\([^)]*\\)|[\\n\\t]/g, \" \")\n .replace(/(\\s\\s+)/g, \" \")\n .trim();\n}\n\n// http date\n\nconst rfc1123 =\n /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\\d\\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\\d{4}) (\\d\\d):(\\d\\d):(\\d\\d) GMT$/,\n rfc850 =\n /^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\\d\\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\\d\\d) (\\d\\d):(\\d\\d):(\\d\\d) GMT$/,\n ascii =\n /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \\d|\\d\\d) (\\d\\d):(\\d\\d):(\\d\\d) (\\d{4})$/;\n\nfunction extractRFC1123Or850(match) {\n const [, weekdayStr, dayStr, monthStr, yearStr, hourStr, minuteStr, secondStr] = match,\n result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr);\n return [result, FixedOffsetZone.utcInstance];\n}\n\nfunction extractASCII(match) {\n const [, weekdayStr, monthStr, dayStr, hourStr, minuteStr, secondStr, yearStr] = match,\n result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr);\n return [result, FixedOffsetZone.utcInstance];\n}\n\nconst isoYmdWithTimeExtensionRegex = combineRegexes(isoYmdRegex, isoTimeExtensionRegex);\nconst isoWeekWithTimeExtensionRegex = combineRegexes(isoWeekRegex, isoTimeExtensionRegex);\nconst isoOrdinalWithTimeExtensionRegex = combineRegexes(isoOrdinalRegex, isoTimeExtensionRegex);\nconst isoTimeCombinedRegex = combineRegexes(isoTimeRegex);\n\nconst extractISOYmdTimeAndOffset = combineExtractors(\n extractISOYmd,\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\nconst extractISOWeekTimeAndOffset = combineExtractors(\n extractISOWeekData,\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\nconst extractISOOrdinalDateAndTime = combineExtractors(\n extractISOOrdinalData,\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\nconst extractISOTimeAndOffset = combineExtractors(\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\n\n/*\n * @private\n */\n\nfunction parseISODate(s) {\n return parse(\n s,\n [isoYmdWithTimeExtensionRegex, extractISOYmdTimeAndOffset],\n [isoWeekWithTimeExtensionRegex, extractISOWeekTimeAndOffset],\n [isoOrdinalWithTimeExtensionRegex, extractISOOrdinalDateAndTime],\n [isoTimeCombinedRegex, extractISOTimeAndOffset]\n );\n}\n\nfunction parseRFC2822Date(s) {\n return parse(preprocessRFC2822(s), [rfc2822, extractRFC2822]);\n}\n\nfunction parseHTTPDate(s) {\n return parse(\n s,\n [rfc1123, extractRFC1123Or850],\n [rfc850, extractRFC1123Or850],\n [ascii, extractASCII]\n );\n}\n\nfunction parseISODuration(s) {\n return parse(s, [isoDuration, extractISODuration]);\n}\n\nconst extractISOTimeOnly = combineExtractors(extractISOTime);\n\nfunction parseISOTimeOnly(s) {\n return parse(s, [isoTimeOnly, extractISOTimeOnly]);\n}\n\nconst sqlYmdWithTimeExtensionRegex = combineRegexes(sqlYmdRegex, sqlTimeExtensionRegex);\nconst sqlTimeCombinedRegex = combineRegexes(sqlTimeRegex);\n\nconst extractISOTimeOffsetAndIANAZone = combineExtractors(\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\n\nfunction parseSQL(s) {\n return parse(\n s,\n [sqlYmdWithTimeExtensionRegex, extractISOYmdTimeAndOffset],\n [sqlTimeCombinedRegex, extractISOTimeOffsetAndIANAZone]\n );\n}\n\nconst INVALID$2 = \"Invalid Duration\";\n\n// unit conversion constants\nconst lowOrderMatrix = {\n weeks: {\n days: 7,\n hours: 7 * 24,\n minutes: 7 * 24 * 60,\n seconds: 7 * 24 * 60 * 60,\n milliseconds: 7 * 24 * 60 * 60 * 1000,\n },\n days: {\n hours: 24,\n minutes: 24 * 60,\n seconds: 24 * 60 * 60,\n milliseconds: 24 * 60 * 60 * 1000,\n },\n hours: { minutes: 60, seconds: 60 * 60, milliseconds: 60 * 60 * 1000 },\n minutes: { seconds: 60, milliseconds: 60 * 1000 },\n seconds: { milliseconds: 1000 },\n },\n casualMatrix = {\n years: {\n quarters: 4,\n months: 12,\n weeks: 52,\n days: 365,\n hours: 365 * 24,\n minutes: 365 * 24 * 60,\n seconds: 365 * 24 * 60 * 60,\n milliseconds: 365 * 24 * 60 * 60 * 1000,\n },\n quarters: {\n months: 3,\n weeks: 13,\n days: 91,\n hours: 91 * 24,\n minutes: 91 * 24 * 60,\n seconds: 91 * 24 * 60 * 60,\n milliseconds: 91 * 24 * 60 * 60 * 1000,\n },\n months: {\n weeks: 4,\n days: 30,\n hours: 30 * 24,\n minutes: 30 * 24 * 60,\n seconds: 30 * 24 * 60 * 60,\n milliseconds: 30 * 24 * 60 * 60 * 1000,\n },\n\n ...lowOrderMatrix,\n },\n daysInYearAccurate = 146097.0 / 400,\n daysInMonthAccurate = 146097.0 / 4800,\n accurateMatrix = {\n years: {\n quarters: 4,\n months: 12,\n weeks: daysInYearAccurate / 7,\n days: daysInYearAccurate,\n hours: daysInYearAccurate * 24,\n minutes: daysInYearAccurate * 24 * 60,\n seconds: daysInYearAccurate * 24 * 60 * 60,\n milliseconds: daysInYearAccurate * 24 * 60 * 60 * 1000,\n },\n quarters: {\n months: 3,\n weeks: daysInYearAccurate / 28,\n days: daysInYearAccurate / 4,\n hours: (daysInYearAccurate * 24) / 4,\n minutes: (daysInYearAccurate * 24 * 60) / 4,\n seconds: (daysInYearAccurate * 24 * 60 * 60) / 4,\n milliseconds: (daysInYearAccurate * 24 * 60 * 60 * 1000) / 4,\n },\n months: {\n weeks: daysInMonthAccurate / 7,\n days: daysInMonthAccurate,\n hours: daysInMonthAccurate * 24,\n minutes: daysInMonthAccurate * 24 * 60,\n seconds: daysInMonthAccurate * 24 * 60 * 60,\n milliseconds: daysInMonthAccurate * 24 * 60 * 60 * 1000,\n },\n ...lowOrderMatrix,\n };\n\n// units ordered by size\nconst orderedUnits$1 = [\n \"years\",\n \"quarters\",\n \"months\",\n \"weeks\",\n \"days\",\n \"hours\",\n \"minutes\",\n \"seconds\",\n \"milliseconds\",\n];\n\nconst reverseUnits = orderedUnits$1.slice(0).reverse();\n\n// clone really means \"create another instance just like this one, but with these changes\"\nfunction clone$1(dur, alts, clear = false) {\n // deep merge for vals\n const conf = {\n values: clear ? alts.values : { ...dur.values, ...(alts.values || {}) },\n loc: dur.loc.clone(alts.loc),\n conversionAccuracy: alts.conversionAccuracy || dur.conversionAccuracy,\n matrix: alts.matrix || dur.matrix,\n };\n return new Duration(conf);\n}\n\nfunction antiTrunc(n) {\n return n < 0 ? Math.floor(n) : Math.ceil(n);\n}\n\n// NB: mutates parameters\nfunction convert(matrix, fromMap, fromUnit, toMap, toUnit) {\n const conv = matrix[toUnit][fromUnit],\n raw = fromMap[fromUnit] / conv,\n sameSign = Math.sign(raw) === Math.sign(toMap[toUnit]),\n // ok, so this is wild, but see the matrix in the tests\n added =\n !sameSign && toMap[toUnit] !== 0 && Math.abs(raw) <= 1 ? antiTrunc(raw) : Math.trunc(raw);\n toMap[toUnit] += added;\n fromMap[fromUnit] -= added * conv;\n}\n\n// NB: mutates parameters\nfunction normalizeValues(matrix, vals) {\n reverseUnits.reduce((previous, current) => {\n if (!isUndefined(vals[current])) {\n if (previous) {\n convert(matrix, vals, previous, vals, current);\n }\n return current;\n } else {\n return previous;\n }\n }, null);\n}\n\n// Remove all properties with a value of 0 from an object\nfunction removeZeroes(vals) {\n const newVals = {};\n for (const [key, value] of Object.entries(vals)) {\n if (value !== 0) {\n newVals[key] = value;\n }\n }\n return newVals;\n}\n\n/**\n * A Duration object represents a period of time, like \"2 months\" or \"1 day, 1 hour\". Conceptually, it's just a map of units to their quantities, accompanied by some additional configuration and methods for creating, parsing, interrogating, transforming, and formatting them. They can be used on their own or in conjunction with other Luxon types; for example, you can use {@link DateTime#plus} to add a Duration object to a DateTime, producing another DateTime.\n *\n * Here is a brief overview of commonly used methods and getters in Duration:\n *\n * * **Creation** To create a Duration, use {@link Duration.fromMillis}, {@link Duration.fromObject}, or {@link Duration.fromISO}.\n * * **Unit values** See the {@link Duration#years}, {@link Duration#months}, {@link Duration#weeks}, {@link Duration#days}, {@link Duration#hours}, {@link Duration#minutes}, {@link Duration#seconds}, {@link Duration#milliseconds} accessors.\n * * **Configuration** See {@link Duration#locale} and {@link Duration#numberingSystem} accessors.\n * * **Transformation** To create new Durations out of old ones use {@link Duration#plus}, {@link Duration#minus}, {@link Duration#normalize}, {@link Duration#set}, {@link Duration#reconfigure}, {@link Duration#shiftTo}, and {@link Duration#negate}.\n * * **Output** To convert the Duration into other representations, see {@link Duration#as}, {@link Duration#toISO}, {@link Duration#toFormat}, and {@link Duration#toJSON}\n *\n * There's are more methods documented below. In addition, for more information on subtler topics like internationalization and validity, see the external documentation.\n */\nclass Duration {\n /**\n * @private\n */\n constructor(config) {\n const accurate = config.conversionAccuracy === \"longterm\" || false;\n let matrix = accurate ? accurateMatrix : casualMatrix;\n\n if (config.matrix) {\n matrix = config.matrix;\n }\n\n /**\n * @access private\n */\n this.values = config.values;\n /**\n * @access private\n */\n this.loc = config.loc || Locale.create();\n /**\n * @access private\n */\n this.conversionAccuracy = accurate ? \"longterm\" : \"casual\";\n /**\n * @access private\n */\n this.invalid = config.invalid || null;\n /**\n * @access private\n */\n this.matrix = matrix;\n /**\n * @access private\n */\n this.isLuxonDuration = true;\n }\n\n /**\n * Create Duration from a number of milliseconds.\n * @param {number} count of milliseconds\n * @param {Object} opts - options for parsing\n * @param {string} [opts.locale='en-US'] - the locale to use\n * @param {string} opts.numberingSystem - the numbering system to use\n * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use\n * @return {Duration}\n */\n static fromMillis(count, opts) {\n return Duration.fromObject({ milliseconds: count }, opts);\n }\n\n /**\n * Create a Duration from a JavaScript object with keys like 'years' and 'hours'.\n * If this object is empty then a zero milliseconds duration is returned.\n * @param {Object} obj - the object to create the DateTime from\n * @param {number} obj.years\n * @param {number} obj.quarters\n * @param {number} obj.months\n * @param {number} obj.weeks\n * @param {number} obj.days\n * @param {number} obj.hours\n * @param {number} obj.minutes\n * @param {number} obj.seconds\n * @param {number} obj.milliseconds\n * @param {Object} [opts=[]] - options for creating this Duration\n * @param {string} [opts.locale='en-US'] - the locale to use\n * @param {string} opts.numberingSystem - the numbering system to use\n * @param {string} [opts.conversionAccuracy='casual'] - the preset conversion system to use\n * @param {string} [opts.matrix=Object] - the custom conversion system to use\n * @return {Duration}\n */\n static fromObject(obj, opts = {}) {\n if (obj == null || typeof obj !== \"object\") {\n throw new InvalidArgumentError(\n `Duration.fromObject: argument expected to be an object, got ${\n obj === null ? \"null\" : typeof obj\n }`\n );\n }\n\n return new Duration({\n values: normalizeObject(obj, Duration.normalizeUnit),\n loc: Locale.fromObject(opts),\n conversionAccuracy: opts.conversionAccuracy,\n matrix: opts.matrix,\n });\n }\n\n /**\n * Create a Duration from DurationLike.\n *\n * @param {Object | number | Duration} durationLike\n * One of:\n * - object with keys like 'years' and 'hours'.\n * - number representing milliseconds\n * - Duration instance\n * @return {Duration}\n */\n static fromDurationLike(durationLike) {\n if (isNumber(durationLike)) {\n return Duration.fromMillis(durationLike);\n } else if (Duration.isDuration(durationLike)) {\n return durationLike;\n } else if (typeof durationLike === \"object\") {\n return Duration.fromObject(durationLike);\n } else {\n throw new InvalidArgumentError(\n `Unknown duration argument ${durationLike} of type ${typeof durationLike}`\n );\n }\n }\n\n /**\n * Create a Duration from an ISO 8601 duration string.\n * @param {string} text - text to parse\n * @param {Object} opts - options for parsing\n * @param {string} [opts.locale='en-US'] - the locale to use\n * @param {string} opts.numberingSystem - the numbering system to use\n * @param {string} [opts.conversionAccuracy='casual'] - the preset conversion system to use\n * @param {string} [opts.matrix=Object] - the preset conversion system to use\n * @see https://en.wikipedia.org/wiki/ISO_8601#Durations\n * @example Duration.fromISO('P3Y6M1W4DT12H30M5S').toObject() //=> { years: 3, months: 6, weeks: 1, days: 4, hours: 12, minutes: 30, seconds: 5 }\n * @example Duration.fromISO('PT23H').toObject() //=> { hours: 23 }\n * @example Duration.fromISO('P5Y3M').toObject() //=> { years: 5, months: 3 }\n * @return {Duration}\n */\n static fromISO(text, opts) {\n const [parsed] = parseISODuration(text);\n if (parsed) {\n return Duration.fromObject(parsed, opts);\n } else {\n return Duration.invalid(\"unparsable\", `the input \"${text}\" can't be parsed as ISO 8601`);\n }\n }\n\n /**\n * Create a Duration from an ISO 8601 time string.\n * @param {string} text - text to parse\n * @param {Object} opts - options for parsing\n * @param {string} [opts.locale='en-US'] - the locale to use\n * @param {string} opts.numberingSystem - the numbering system to use\n * @param {string} [opts.conversionAccuracy='casual'] - the preset conversion system to use\n * @param {string} [opts.matrix=Object] - the conversion system to use\n * @see https://en.wikipedia.org/wiki/ISO_8601#Times\n * @example Duration.fromISOTime('11:22:33.444').toObject() //=> { hours: 11, minutes: 22, seconds: 33, milliseconds: 444 }\n * @example Duration.fromISOTime('11:00').toObject() //=> { hours: 11, minutes: 0, seconds: 0 }\n * @example Duration.fromISOTime('T11:00').toObject() //=> { hours: 11, minutes: 0, seconds: 0 }\n * @example Duration.fromISOTime('1100').toObject() //=> { hours: 11, minutes: 0, seconds: 0 }\n * @example Duration.fromISOTime('T1100').toObject() //=> { hours: 11, minutes: 0, seconds: 0 }\n * @return {Duration}\n */\n static fromISOTime(text, opts) {\n const [parsed] = parseISOTimeOnly(text);\n if (parsed) {\n return Duration.fromObject(parsed, opts);\n } else {\n return Duration.invalid(\"unparsable\", `the input \"${text}\" can't be parsed as ISO 8601`);\n }\n }\n\n /**\n * Create an invalid Duration.\n * @param {string} reason - simple string of why this datetime is invalid. Should not contain parameters or anything else data-dependent\n * @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information\n * @return {Duration}\n */\n static invalid(reason, explanation = null) {\n if (!reason) {\n throw new InvalidArgumentError(\"need to specify a reason the Duration is invalid\");\n }\n\n const invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation);\n\n if (Settings.throwOnInvalid) {\n throw new InvalidDurationError(invalid);\n } else {\n return new Duration({ invalid });\n }\n }\n\n /**\n * @private\n */\n static normalizeUnit(unit) {\n const normalized = {\n year: \"years\",\n years: \"years\",\n quarter: \"quarters\",\n quarters: \"quarters\",\n month: \"months\",\n months: \"months\",\n week: \"weeks\",\n weeks: \"weeks\",\n day: \"days\",\n days: \"days\",\n hour: \"hours\",\n hours: \"hours\",\n minute: \"minutes\",\n minutes: \"minutes\",\n second: \"seconds\",\n seconds: \"seconds\",\n millisecond: \"milliseconds\",\n milliseconds: \"milliseconds\",\n }[unit ? unit.toLowerCase() : unit];\n\n if (!normalized) throw new InvalidUnitError(unit);\n\n return normalized;\n }\n\n /**\n * Check if an object is a Duration. Works across context boundaries\n * @param {object} o\n * @return {boolean}\n */\n static isDuration(o) {\n return (o && o.isLuxonDuration) || false;\n }\n\n /**\n * Get the locale of a Duration, such 'en-GB'\n * @type {string}\n */\n get locale() {\n return this.isValid ? this.loc.locale : null;\n }\n\n /**\n * Get the numbering system of a Duration, such 'beng'. The numbering system is used when formatting the Duration\n *\n * @type {string}\n */\n get numberingSystem() {\n return this.isValid ? this.loc.numberingSystem : null;\n }\n\n /**\n * Returns a string representation of this Duration formatted according to the specified format string. You may use these tokens:\n * * `S` for milliseconds\n * * `s` for seconds\n * * `m` for minutes\n * * `h` for hours\n * * `d` for days\n * * `w` for weeks\n * * `M` for months\n * * `y` for years\n * Notes:\n * * Add padding by repeating the token, e.g. \"yy\" pads the years to two digits, \"hhhh\" pads the hours out to four digits\n * * Tokens can be escaped by wrapping with single quotes.\n * * The duration will be converted to the set of units in the format string using {@link Duration#shiftTo} and the Durations's conversion accuracy setting.\n * @param {string} fmt - the format string\n * @param {Object} opts - options\n * @param {boolean} [opts.floor=true] - floor numerical values\n * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat(\"y d s\") //=> \"1 6 2\"\n * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat(\"yy dd sss\") //=> \"01 06 002\"\n * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat(\"M S\") //=> \"12 518402000\"\n * @return {string}\n */\n toFormat(fmt, opts = {}) {\n // reverse-compat since 1.2; we always round down now, never up, and we do it by default\n const fmtOpts = {\n ...opts,\n floor: opts.round !== false && opts.floor !== false,\n };\n return this.isValid\n ? Formatter.create(this.loc, fmtOpts).formatDurationFromString(this, fmt)\n : INVALID$2;\n }\n\n /**\n * Returns a string representation of a Duration with all units included.\n * To modify its behavior use the `listStyle` and any Intl.NumberFormat option, though `unitDisplay` is especially relevant.\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat\n * @param opts - On option object to override the formatting. Accepts the same keys as the options parameter of the native `Int.NumberFormat` constructor, as well as `listStyle`.\n * @example\n * ```js\n * var dur = Duration.fromObject({ days: 1, hours: 5, minutes: 6 })\n * dur.toHuman() //=> '1 day, 5 hours, 6 minutes'\n * dur.toHuman({ listStyle: \"long\" }) //=> '1 day, 5 hours, and 6 minutes'\n * dur.toHuman({ unitDisplay: \"short\" }) //=> '1 day, 5 hr, 6 min'\n * ```\n */\n toHuman(opts = {}) {\n const l = orderedUnits$1\n .map((unit) => {\n const val = this.values[unit];\n if (isUndefined(val)) {\n return null;\n }\n return this.loc\n .numberFormatter({ style: \"unit\", unitDisplay: \"long\", ...opts, unit: unit.slice(0, -1) })\n .format(val);\n })\n .filter((n) => n);\n\n return this.loc\n .listFormatter({ type: \"conjunction\", style: opts.listStyle || \"narrow\", ...opts })\n .format(l);\n }\n\n /**\n * Returns a JavaScript object with this Duration's values.\n * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toObject() //=> { years: 1, days: 6, seconds: 2 }\n * @return {Object}\n */\n toObject() {\n if (!this.isValid) return {};\n return { ...this.values };\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this Duration.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Durations\n * @example Duration.fromObject({ years: 3, seconds: 45 }).toISO() //=> 'P3YT45S'\n * @example Duration.fromObject({ months: 4, seconds: 45 }).toISO() //=> 'P4MT45S'\n * @example Duration.fromObject({ months: 5 }).toISO() //=> 'P5M'\n * @example Duration.fromObject({ minutes: 5 }).toISO() //=> 'PT5M'\n * @example Duration.fromObject({ milliseconds: 6 }).toISO() //=> 'PT0.006S'\n * @return {string}\n */\n toISO() {\n // we could use the formatter, but this is an easier way to get the minimum string\n if (!this.isValid) return null;\n\n let s = \"P\";\n if (this.years !== 0) s += this.years + \"Y\";\n if (this.months !== 0 || this.quarters !== 0) s += this.months + this.quarters * 3 + \"M\";\n if (this.weeks !== 0) s += this.weeks + \"W\";\n if (this.days !== 0) s += this.days + \"D\";\n if (this.hours !== 0 || this.minutes !== 0 || this.seconds !== 0 || this.milliseconds !== 0)\n s += \"T\";\n if (this.hours !== 0) s += this.hours + \"H\";\n if (this.minutes !== 0) s += this.minutes + \"M\";\n if (this.seconds !== 0 || this.milliseconds !== 0)\n // this will handle \"floating point madness\" by removing extra decimal places\n // https://stackoverflow.com/questions/588004/is-floating-point-math-broken\n s += roundTo(this.seconds + this.milliseconds / 1000, 3) + \"S\";\n if (s === \"P\") s += \"T0S\";\n return s;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this Duration, formatted as a time of day.\n * Note that this will return null if the duration is invalid, negative, or equal to or greater than 24 hours.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Times\n * @param {Object} opts - options\n * @param {boolean} [opts.suppressMilliseconds=false] - exclude milliseconds from the format if they're 0\n * @param {boolean} [opts.suppressSeconds=false] - exclude seconds from the format if they're 0\n * @param {boolean} [opts.includePrefix=false] - include the `T` prefix\n * @param {string} [opts.format='extended'] - choose between the basic and extended format\n * @example Duration.fromObject({ hours: 11 }).toISOTime() //=> '11:00:00.000'\n * @example Duration.fromObject({ hours: 11 }).toISOTime({ suppressMilliseconds: true }) //=> '11:00:00'\n * @example Duration.fromObject({ hours: 11 }).toISOTime({ suppressSeconds: true }) //=> '11:00'\n * @example Duration.fromObject({ hours: 11 }).toISOTime({ includePrefix: true }) //=> 'T11:00:00.000'\n * @example Duration.fromObject({ hours: 11 }).toISOTime({ format: 'basic' }) //=> '110000.000'\n * @return {string}\n */\n toISOTime(opts = {}) {\n if (!this.isValid) return null;\n\n const millis = this.toMillis();\n if (millis < 0 || millis >= 86400000) return null;\n\n opts = {\n suppressMilliseconds: false,\n suppressSeconds: false,\n includePrefix: false,\n format: \"extended\",\n ...opts,\n };\n\n const value = this.shiftTo(\"hours\", \"minutes\", \"seconds\", \"milliseconds\");\n\n let fmt = opts.format === \"basic\" ? \"hhmm\" : \"hh:mm\";\n\n if (!opts.suppressSeconds || value.seconds !== 0 || value.milliseconds !== 0) {\n fmt += opts.format === \"basic\" ? \"ss\" : \":ss\";\n if (!opts.suppressMilliseconds || value.milliseconds !== 0) {\n fmt += \".SSS\";\n }\n }\n\n let str = value.toFormat(fmt);\n\n if (opts.includePrefix) {\n str = \"T\" + str;\n }\n\n return str;\n }\n\n /**\n * Returns an ISO 8601 representation of this Duration appropriate for use in JSON.\n * @return {string}\n */\n toJSON() {\n return this.toISO();\n }\n\n /**\n * Returns an ISO 8601 representation of this Duration appropriate for use in debugging.\n * @return {string}\n */\n toString() {\n return this.toISO();\n }\n\n /**\n * Returns an milliseconds value of this Duration.\n * @return {number}\n */\n toMillis() {\n return this.as(\"milliseconds\");\n }\n\n /**\n * Returns an milliseconds value of this Duration. Alias of {@link toMillis}\n * @return {number}\n */\n valueOf() {\n return this.toMillis();\n }\n\n /**\n * Make this Duration longer by the specified amount. Return a newly-constructed Duration.\n * @param {Duration|Object|number} duration - The amount to add. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject()\n * @return {Duration}\n */\n plus(duration) {\n if (!this.isValid) return this;\n\n const dur = Duration.fromDurationLike(duration),\n result = {};\n\n for (const k of orderedUnits$1) {\n if (hasOwnProperty(dur.values, k) || hasOwnProperty(this.values, k)) {\n result[k] = dur.get(k) + this.get(k);\n }\n }\n\n return clone$1(this, { values: result }, true);\n }\n\n /**\n * Make this Duration shorter by the specified amount. Return a newly-constructed Duration.\n * @param {Duration|Object|number} duration - The amount to subtract. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject()\n * @return {Duration}\n */\n minus(duration) {\n if (!this.isValid) return this;\n\n const dur = Duration.fromDurationLike(duration);\n return this.plus(dur.negate());\n }\n\n /**\n * Scale this Duration by the specified amount. Return a newly-constructed Duration.\n * @param {function} fn - The function to apply to each unit. Arity is 1 or 2: the value of the unit and, optionally, the unit name. Must return a number.\n * @example Duration.fromObject({ hours: 1, minutes: 30 }).mapUnits(x => x * 2) //=> { hours: 2, minutes: 60 }\n * @example Duration.fromObject({ hours: 1, minutes: 30 }).mapUnits((x, u) => u === \"hours\" ? x * 2 : x) //=> { hours: 2, minutes: 30 }\n * @return {Duration}\n */\n mapUnits(fn) {\n if (!this.isValid) return this;\n const result = {};\n for (const k of Object.keys(this.values)) {\n result[k] = asNumber(fn(this.values[k], k));\n }\n return clone$1(this, { values: result }, true);\n }\n\n /**\n * Get the value of unit.\n * @param {string} unit - a unit such as 'minute' or 'day'\n * @example Duration.fromObject({years: 2, days: 3}).get('years') //=> 2\n * @example Duration.fromObject({years: 2, days: 3}).get('months') //=> 0\n * @example Duration.fromObject({years: 2, days: 3}).get('days') //=> 3\n * @return {number}\n */\n get(unit) {\n return this[Duration.normalizeUnit(unit)];\n }\n\n /**\n * \"Set\" the values of specified units. Return a newly-constructed Duration.\n * @param {Object} values - a mapping of units to numbers\n * @example dur.set({ years: 2017 })\n * @example dur.set({ hours: 8, minutes: 30 })\n * @return {Duration}\n */\n set(values) {\n if (!this.isValid) return this;\n\n const mixed = { ...this.values, ...normalizeObject(values, Duration.normalizeUnit) };\n return clone$1(this, { values: mixed });\n }\n\n /**\n * \"Set\" the locale and/or numberingSystem. Returns a newly-constructed Duration.\n * @example dur.reconfigure({ locale: 'en-GB' })\n * @return {Duration}\n */\n reconfigure({ locale, numberingSystem, conversionAccuracy, matrix } = {}) {\n const loc = this.loc.clone({ locale, numberingSystem });\n const opts = { loc, matrix, conversionAccuracy };\n return clone$1(this, opts);\n }\n\n /**\n * Return the length of the duration in the specified unit.\n * @param {string} unit - a unit such as 'minutes' or 'days'\n * @example Duration.fromObject({years: 1}).as('days') //=> 365\n * @example Duration.fromObject({years: 1}).as('months') //=> 12\n * @example Duration.fromObject({hours: 60}).as('days') //=> 2.5\n * @return {number}\n */\n as(unit) {\n return this.isValid ? this.shiftTo(unit).get(unit) : NaN;\n }\n\n /**\n * Reduce this Duration to its canonical representation in its current units.\n * @example Duration.fromObject({ years: 2, days: 5000 }).normalize().toObject() //=> { years: 15, days: 255 }\n * @example Duration.fromObject({ hours: 12, minutes: -45 }).normalize().toObject() //=> { hours: 11, minutes: 15 }\n * @return {Duration}\n */\n normalize() {\n if (!this.isValid) return this;\n const vals = this.toObject();\n normalizeValues(this.matrix, vals);\n return clone$1(this, { values: vals }, true);\n }\n\n /**\n * Rescale units to its largest representation\n * @example Duration.fromObject({ milliseconds: 90000 }).rescale().toObject() //=> { minutes: 1, seconds: 30 }\n * @return {Duration}\n */\n rescale() {\n if (!this.isValid) return this;\n const vals = removeZeroes(this.normalize().shiftToAll().toObject());\n return clone$1(this, { values: vals }, true);\n }\n\n /**\n * Convert this Duration into its representation in a different set of units.\n * @example Duration.fromObject({ hours: 1, seconds: 30 }).shiftTo('minutes', 'milliseconds').toObject() //=> { minutes: 60, milliseconds: 30000 }\n * @return {Duration}\n */\n shiftTo(...units) {\n if (!this.isValid) return this;\n\n if (units.length === 0) {\n return this;\n }\n\n units = units.map((u) => Duration.normalizeUnit(u));\n\n const built = {},\n accumulated = {},\n vals = this.toObject();\n let lastUnit;\n\n for (const k of orderedUnits$1) {\n if (units.indexOf(k) >= 0) {\n lastUnit = k;\n\n let own = 0;\n\n // anything we haven't boiled down yet should get boiled to this unit\n for (const ak in accumulated) {\n own += this.matrix[ak][k] * accumulated[ak];\n accumulated[ak] = 0;\n }\n\n // plus anything that's already in this unit\n if (isNumber(vals[k])) {\n own += vals[k];\n }\n\n const i = Math.trunc(own);\n built[k] = i;\n accumulated[k] = (own * 1000 - i * 1000) / 1000;\n\n // plus anything further down the chain that should be rolled up in to this\n for (const down in vals) {\n if (orderedUnits$1.indexOf(down) > orderedUnits$1.indexOf(k)) {\n convert(this.matrix, vals, down, built, k);\n }\n }\n // otherwise, keep it in the wings to boil it later\n } else if (isNumber(vals[k])) {\n accumulated[k] = vals[k];\n }\n }\n\n // anything leftover becomes the decimal for the last unit\n // lastUnit must be defined since units is not empty\n for (const key in accumulated) {\n if (accumulated[key] !== 0) {\n built[lastUnit] +=\n key === lastUnit ? accumulated[key] : accumulated[key] / this.matrix[lastUnit][key];\n }\n }\n\n return clone$1(this, { values: built }, true).normalize();\n }\n\n /**\n * Shift this Duration to all available units.\n * Same as shiftTo(\"years\", \"months\", \"weeks\", \"days\", \"hours\", \"minutes\", \"seconds\", \"milliseconds\")\n * @return {Duration}\n */\n shiftToAll() {\n if (!this.isValid) return this;\n return this.shiftTo(\n \"years\",\n \"months\",\n \"weeks\",\n \"days\",\n \"hours\",\n \"minutes\",\n \"seconds\",\n \"milliseconds\"\n );\n }\n\n /**\n * Return the negative of this Duration.\n * @example Duration.fromObject({ hours: 1, seconds: 30 }).negate().toObject() //=> { hours: -1, seconds: -30 }\n * @return {Duration}\n */\n negate() {\n if (!this.isValid) return this;\n const negated = {};\n for (const k of Object.keys(this.values)) {\n negated[k] = this.values[k] === 0 ? 0 : -this.values[k];\n }\n return clone$1(this, { values: negated }, true);\n }\n\n /**\n * Get the years.\n * @type {number}\n */\n get years() {\n return this.isValid ? this.values.years || 0 : NaN;\n }\n\n /**\n * Get the quarters.\n * @type {number}\n */\n get quarters() {\n return this.isValid ? this.values.quarters || 0 : NaN;\n }\n\n /**\n * Get the months.\n * @type {number}\n */\n get months() {\n return this.isValid ? this.values.months || 0 : NaN;\n }\n\n /**\n * Get the weeks\n * @type {number}\n */\n get weeks() {\n return this.isValid ? this.values.weeks || 0 : NaN;\n }\n\n /**\n * Get the days.\n * @type {number}\n */\n get days() {\n return this.isValid ? this.values.days || 0 : NaN;\n }\n\n /**\n * Get the hours.\n * @type {number}\n */\n get hours() {\n return this.isValid ? this.values.hours || 0 : NaN;\n }\n\n /**\n * Get the minutes.\n * @type {number}\n */\n get minutes() {\n return this.isValid ? this.values.minutes || 0 : NaN;\n }\n\n /**\n * Get the seconds.\n * @return {number}\n */\n get seconds() {\n return this.isValid ? this.values.seconds || 0 : NaN;\n }\n\n /**\n * Get the milliseconds.\n * @return {number}\n */\n get milliseconds() {\n return this.isValid ? this.values.milliseconds || 0 : NaN;\n }\n\n /**\n * Returns whether the Duration is invalid. Invalid durations are returned by diff operations\n * on invalid DateTimes or Intervals.\n * @return {boolean}\n */\n get isValid() {\n return this.invalid === null;\n }\n\n /**\n * Returns an error code if this Duration became invalid, or null if the Duration is valid\n * @return {string}\n */\n get invalidReason() {\n return this.invalid ? this.invalid.reason : null;\n }\n\n /**\n * Returns an explanation of why this Duration became invalid, or null if the Duration is valid\n * @type {string}\n */\n get invalidExplanation() {\n return this.invalid ? this.invalid.explanation : null;\n }\n\n /**\n * Equality check\n * Two Durations are equal iff they have the same units and the same values for each unit.\n * @param {Duration} other\n * @return {boolean}\n */\n equals(other) {\n if (!this.isValid || !other.isValid) {\n return false;\n }\n\n if (!this.loc.equals(other.loc)) {\n return false;\n }\n\n function eq(v1, v2) {\n // Consider 0 and undefined as equal\n if (v1 === undefined || v1 === 0) return v2 === undefined || v2 === 0;\n return v1 === v2;\n }\n\n for (const u of orderedUnits$1) {\n if (!eq(this.values[u], other.values[u])) {\n return false;\n }\n }\n return true;\n }\n}\n\nconst INVALID$1 = \"Invalid Interval\";\n\n// checks if the start is equal to or before the end\nfunction validateStartEnd(start, end) {\n if (!start || !start.isValid) {\n return Interval.invalid(\"missing or invalid start\");\n } else if (!end || !end.isValid) {\n return Interval.invalid(\"missing or invalid end\");\n } else if (end < start) {\n return Interval.invalid(\n \"end before start\",\n `The end of an interval must be after its start, but you had start=${start.toISO()} and end=${end.toISO()}`\n );\n } else {\n return null;\n }\n}\n\n/**\n * An Interval object represents a half-open interval of time, where each endpoint is a {@link DateTime}. Conceptually, it's a container for those two endpoints, accompanied by methods for creating, parsing, interrogating, comparing, transforming, and formatting them.\n *\n * Here is a brief overview of the most commonly used methods and getters in Interval:\n *\n * * **Creation** To create an Interval, use {@link Interval.fromDateTimes}, {@link Interval.after}, {@link Interval.before}, or {@link Interval.fromISO}.\n * * **Accessors** Use {@link Interval#start} and {@link Interval#end} to get the start and end.\n * * **Interrogation** To analyze the Interval, use {@link Interval#count}, {@link Interval#length}, {@link Interval#hasSame}, {@link Interval#contains}, {@link Interval#isAfter}, or {@link Interval#isBefore}.\n * * **Transformation** To create other Intervals out of this one, use {@link Interval#set}, {@link Interval#splitAt}, {@link Interval#splitBy}, {@link Interval#divideEqually}, {@link Interval.merge}, {@link Interval.xor}, {@link Interval#union}, {@link Interval#intersection}, or {@link Interval#difference}.\n * * **Comparison** To compare this Interval to another one, use {@link Interval#equals}, {@link Interval#overlaps}, {@link Interval#abutsStart}, {@link Interval#abutsEnd}, {@link Interval#engulfs}\n * * **Output** To convert the Interval into other representations, see {@link Interval#toString}, {@link Interval#toISO}, {@link Interval#toISODate}, {@link Interval#toISOTime}, {@link Interval#toFormat}, and {@link Interval#toDuration}.\n */\nclass Interval {\n /**\n * @private\n */\n constructor(config) {\n /**\n * @access private\n */\n this.s = config.start;\n /**\n * @access private\n */\n this.e = config.end;\n /**\n * @access private\n */\n this.invalid = config.invalid || null;\n /**\n * @access private\n */\n this.isLuxonInterval = true;\n }\n\n /**\n * Create an invalid Interval.\n * @param {string} reason - simple string of why this Interval is invalid. Should not contain parameters or anything else data-dependent\n * @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information\n * @return {Interval}\n */\n static invalid(reason, explanation = null) {\n if (!reason) {\n throw new InvalidArgumentError(\"need to specify a reason the Interval is invalid\");\n }\n\n const invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation);\n\n if (Settings.throwOnInvalid) {\n throw new InvalidIntervalError(invalid);\n } else {\n return new Interval({ invalid });\n }\n }\n\n /**\n * Create an Interval from a start DateTime and an end DateTime. Inclusive of the start but not the end.\n * @param {DateTime|Date|Object} start\n * @param {DateTime|Date|Object} end\n * @return {Interval}\n */\n static fromDateTimes(start, end) {\n const builtStart = friendlyDateTime(start),\n builtEnd = friendlyDateTime(end);\n\n const validateError = validateStartEnd(builtStart, builtEnd);\n\n if (validateError == null) {\n return new Interval({\n start: builtStart,\n end: builtEnd,\n });\n } else {\n return validateError;\n }\n }\n\n /**\n * Create an Interval from a start DateTime and a Duration to extend to.\n * @param {DateTime|Date|Object} start\n * @param {Duration|Object|number} duration - the length of the Interval.\n * @return {Interval}\n */\n static after(start, duration) {\n const dur = Duration.fromDurationLike(duration),\n dt = friendlyDateTime(start);\n return Interval.fromDateTimes(dt, dt.plus(dur));\n }\n\n /**\n * Create an Interval from an end DateTime and a Duration to extend backwards to.\n * @param {DateTime|Date|Object} end\n * @param {Duration|Object|number} duration - the length of the Interval.\n * @return {Interval}\n */\n static before(end, duration) {\n const dur = Duration.fromDurationLike(duration),\n dt = friendlyDateTime(end);\n return Interval.fromDateTimes(dt.minus(dur), dt);\n }\n\n /**\n * Create an Interval from an ISO 8601 string.\n * Accepts `/`, `/`, and `/` formats.\n * @param {string} text - the ISO string to parse\n * @param {Object} [opts] - options to pass {@link DateTime#fromISO} and optionally {@link Duration#fromISO}\n * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals\n * @return {Interval}\n */\n static fromISO(text, opts) {\n const [s, e] = (text || \"\").split(\"/\", 2);\n if (s && e) {\n let start, startIsValid;\n try {\n start = DateTime.fromISO(s, opts);\n startIsValid = start.isValid;\n } catch (e) {\n startIsValid = false;\n }\n\n let end, endIsValid;\n try {\n end = DateTime.fromISO(e, opts);\n endIsValid = end.isValid;\n } catch (e) {\n endIsValid = false;\n }\n\n if (startIsValid && endIsValid) {\n return Interval.fromDateTimes(start, end);\n }\n\n if (startIsValid) {\n const dur = Duration.fromISO(e, opts);\n if (dur.isValid) {\n return Interval.after(start, dur);\n }\n } else if (endIsValid) {\n const dur = Duration.fromISO(s, opts);\n if (dur.isValid) {\n return Interval.before(end, dur);\n }\n }\n }\n return Interval.invalid(\"unparsable\", `the input \"${text}\" can't be parsed as ISO 8601`);\n }\n\n /**\n * Check if an object is an Interval. Works across context boundaries\n * @param {object} o\n * @return {boolean}\n */\n static isInterval(o) {\n return (o && o.isLuxonInterval) || false;\n }\n\n /**\n * Returns the start of the Interval\n * @type {DateTime}\n */\n get start() {\n return this.isValid ? this.s : null;\n }\n\n /**\n * Returns the end of the Interval\n * @type {DateTime}\n */\n get end() {\n return this.isValid ? this.e : null;\n }\n\n /**\n * Returns whether this Interval's end is at least its start, meaning that the Interval isn't 'backwards'.\n * @type {boolean}\n */\n get isValid() {\n return this.invalidReason === null;\n }\n\n /**\n * Returns an error code if this Interval is invalid, or null if the Interval is valid\n * @type {string}\n */\n get invalidReason() {\n return this.invalid ? this.invalid.reason : null;\n }\n\n /**\n * Returns an explanation of why this Interval became invalid, or null if the Interval is valid\n * @type {string}\n */\n get invalidExplanation() {\n return this.invalid ? this.invalid.explanation : null;\n }\n\n /**\n * Returns the length of the Interval in the specified unit.\n * @param {string} unit - the unit (such as 'hours' or 'days') to return the length in.\n * @return {number}\n */\n length(unit = \"milliseconds\") {\n return this.isValid ? this.toDuration(...[unit]).get(unit) : NaN;\n }\n\n /**\n * Returns the count of minutes, hours, days, months, or years included in the Interval, even in part.\n * Unlike {@link Interval#length} this counts sections of the calendar, not periods of time, e.g. specifying 'day'\n * asks 'what dates are included in this interval?', not 'how many days long is this interval?'\n * @param {string} [unit='milliseconds'] - the unit of time to count.\n * @return {number}\n */\n count(unit = \"milliseconds\") {\n if (!this.isValid) return NaN;\n const start = this.start.startOf(unit),\n end = this.end.startOf(unit);\n return Math.floor(end.diff(start, unit).get(unit)) + 1;\n }\n\n /**\n * Returns whether this Interval's start and end are both in the same unit of time\n * @param {string} unit - the unit of time to check sameness on\n * @return {boolean}\n */\n hasSame(unit) {\n return this.isValid ? this.isEmpty() || this.e.minus(1).hasSame(this.s, unit) : false;\n }\n\n /**\n * Return whether this Interval has the same start and end DateTimes.\n * @return {boolean}\n */\n isEmpty() {\n return this.s.valueOf() === this.e.valueOf();\n }\n\n /**\n * Return whether this Interval's start is after the specified DateTime.\n * @param {DateTime} dateTime\n * @return {boolean}\n */\n isAfter(dateTime) {\n if (!this.isValid) return false;\n return this.s > dateTime;\n }\n\n /**\n * Return whether this Interval's end is before the specified DateTime.\n * @param {DateTime} dateTime\n * @return {boolean}\n */\n isBefore(dateTime) {\n if (!this.isValid) return false;\n return this.e <= dateTime;\n }\n\n /**\n * Return whether this Interval contains the specified DateTime.\n * @param {DateTime} dateTime\n * @return {boolean}\n */\n contains(dateTime) {\n if (!this.isValid) return false;\n return this.s <= dateTime && this.e > dateTime;\n }\n\n /**\n * \"Sets\" the start and/or end dates. Returns a newly-constructed Interval.\n * @param {Object} values - the values to set\n * @param {DateTime} values.start - the starting DateTime\n * @param {DateTime} values.end - the ending DateTime\n * @return {Interval}\n */\n set({ start, end } = {}) {\n if (!this.isValid) return this;\n return Interval.fromDateTimes(start || this.s, end || this.e);\n }\n\n /**\n * Split this Interval at each of the specified DateTimes\n * @param {...DateTime} dateTimes - the unit of time to count.\n * @return {Array}\n */\n splitAt(...dateTimes) {\n if (!this.isValid) return [];\n const sorted = dateTimes\n .map(friendlyDateTime)\n .filter((d) => this.contains(d))\n .sort(),\n results = [];\n let { s } = this,\n i = 0;\n\n while (s < this.e) {\n const added = sorted[i] || this.e,\n next = +added > +this.e ? this.e : added;\n results.push(Interval.fromDateTimes(s, next));\n s = next;\n i += 1;\n }\n\n return results;\n }\n\n /**\n * Split this Interval into smaller Intervals, each of the specified length.\n * Left over time is grouped into a smaller interval\n * @param {Duration|Object|number} duration - The length of each resulting interval.\n * @return {Array}\n */\n splitBy(duration) {\n const dur = Duration.fromDurationLike(duration);\n\n if (!this.isValid || !dur.isValid || dur.as(\"milliseconds\") === 0) {\n return [];\n }\n\n let { s } = this,\n idx = 1,\n next;\n\n const results = [];\n while (s < this.e) {\n const added = this.start.plus(dur.mapUnits((x) => x * idx));\n next = +added > +this.e ? this.e : added;\n results.push(Interval.fromDateTimes(s, next));\n s = next;\n idx += 1;\n }\n\n return results;\n }\n\n /**\n * Split this Interval into the specified number of smaller intervals.\n * @param {number} numberOfParts - The number of Intervals to divide the Interval into.\n * @return {Array}\n */\n divideEqually(numberOfParts) {\n if (!this.isValid) return [];\n return this.splitBy(this.length() / numberOfParts).slice(0, numberOfParts);\n }\n\n /**\n * Return whether this Interval overlaps with the specified Interval\n * @param {Interval} other\n * @return {boolean}\n */\n overlaps(other) {\n return this.e > other.s && this.s < other.e;\n }\n\n /**\n * Return whether this Interval's end is adjacent to the specified Interval's start.\n * @param {Interval} other\n * @return {boolean}\n */\n abutsStart(other) {\n if (!this.isValid) return false;\n return +this.e === +other.s;\n }\n\n /**\n * Return whether this Interval's start is adjacent to the specified Interval's end.\n * @param {Interval} other\n * @return {boolean}\n */\n abutsEnd(other) {\n if (!this.isValid) return false;\n return +other.e === +this.s;\n }\n\n /**\n * Return whether this Interval engulfs the start and end of the specified Interval.\n * @param {Interval} other\n * @return {boolean}\n */\n engulfs(other) {\n if (!this.isValid) return false;\n return this.s <= other.s && this.e >= other.e;\n }\n\n /**\n * Return whether this Interval has the same start and end as the specified Interval.\n * @param {Interval} other\n * @return {boolean}\n */\n equals(other) {\n if (!this.isValid || !other.isValid) {\n return false;\n }\n\n return this.s.equals(other.s) && this.e.equals(other.e);\n }\n\n /**\n * Return an Interval representing the intersection of this Interval and the specified Interval.\n * Specifically, the resulting Interval has the maximum start time and the minimum end time of the two Intervals.\n * Returns null if the intersection is empty, meaning, the intervals don't intersect.\n * @param {Interval} other\n * @return {Interval}\n */\n intersection(other) {\n if (!this.isValid) return this;\n const s = this.s > other.s ? this.s : other.s,\n e = this.e < other.e ? this.e : other.e;\n\n if (s >= e) {\n return null;\n } else {\n return Interval.fromDateTimes(s, e);\n }\n }\n\n /**\n * Return an Interval representing the union of this Interval and the specified Interval.\n * Specifically, the resulting Interval has the minimum start time and the maximum end time of the two Intervals.\n * @param {Interval} other\n * @return {Interval}\n */\n union(other) {\n if (!this.isValid) return this;\n const s = this.s < other.s ? this.s : other.s,\n e = this.e > other.e ? this.e : other.e;\n return Interval.fromDateTimes(s, e);\n }\n\n /**\n * Merge an array of Intervals into a equivalent minimal set of Intervals.\n * Combines overlapping and adjacent Intervals.\n * @param {Array} intervals\n * @return {Array}\n */\n static merge(intervals) {\n const [found, final] = intervals\n .sort((a, b) => a.s - b.s)\n .reduce(\n ([sofar, current], item) => {\n if (!current) {\n return [sofar, item];\n } else if (current.overlaps(item) || current.abutsStart(item)) {\n return [sofar, current.union(item)];\n } else {\n return [sofar.concat([current]), item];\n }\n },\n [[], null]\n );\n if (final) {\n found.push(final);\n }\n return found;\n }\n\n /**\n * Return an array of Intervals representing the spans of time that only appear in one of the specified Intervals.\n * @param {Array} intervals\n * @return {Array}\n */\n static xor(intervals) {\n let start = null,\n currentCount = 0;\n const results = [],\n ends = intervals.map((i) => [\n { time: i.s, type: \"s\" },\n { time: i.e, type: \"e\" },\n ]),\n flattened = Array.prototype.concat(...ends),\n arr = flattened.sort((a, b) => a.time - b.time);\n\n for (const i of arr) {\n currentCount += i.type === \"s\" ? 1 : -1;\n\n if (currentCount === 1) {\n start = i.time;\n } else {\n if (start && +start !== +i.time) {\n results.push(Interval.fromDateTimes(start, i.time));\n }\n\n start = null;\n }\n }\n\n return Interval.merge(results);\n }\n\n /**\n * Return an Interval representing the span of time in this Interval that doesn't overlap with any of the specified Intervals.\n * @param {...Interval} intervals\n * @return {Array}\n */\n difference(...intervals) {\n return Interval.xor([this].concat(intervals))\n .map((i) => this.intersection(i))\n .filter((i) => i && !i.isEmpty());\n }\n\n /**\n * Returns a string representation of this Interval appropriate for debugging.\n * @return {string}\n */\n toString() {\n if (!this.isValid) return INVALID$1;\n return `[${this.s.toISO()} – ${this.e.toISO()})`;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this Interval.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals\n * @param {Object} opts - The same options as {@link DateTime#toISO}\n * @return {string}\n */\n toISO(opts) {\n if (!this.isValid) return INVALID$1;\n return `${this.s.toISO(opts)}/${this.e.toISO(opts)}`;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of date of this Interval.\n * The time components are ignored.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals\n * @return {string}\n */\n toISODate() {\n if (!this.isValid) return INVALID$1;\n return `${this.s.toISODate()}/${this.e.toISODate()}`;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of time of this Interval.\n * The date components are ignored.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals\n * @param {Object} opts - The same options as {@link DateTime#toISO}\n * @return {string}\n */\n toISOTime(opts) {\n if (!this.isValid) return INVALID$1;\n return `${this.s.toISOTime(opts)}/${this.e.toISOTime(opts)}`;\n }\n\n /**\n * Returns a string representation of this Interval formatted according to the specified format string.\n * @param {string} dateFormat - the format string. This string formats the start and end time. See {@link DateTime#toFormat} for details.\n * @param {Object} opts - options\n * @param {string} [opts.separator = ' – '] - a separator to place between the start and end representations\n * @return {string}\n */\n toFormat(dateFormat, { separator = \" – \" } = {}) {\n if (!this.isValid) return INVALID$1;\n return `${this.s.toFormat(dateFormat)}${separator}${this.e.toFormat(dateFormat)}`;\n }\n\n /**\n * Return a Duration representing the time spanned by this interval.\n * @param {string|string[]} [unit=['milliseconds']] - the unit or units (such as 'hours' or 'days') to include in the duration.\n * @param {Object} opts - options that affect the creation of the Duration\n * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use\n * @example Interval.fromDateTimes(dt1, dt2).toDuration().toObject() //=> { milliseconds: 88489257 }\n * @example Interval.fromDateTimes(dt1, dt2).toDuration('days').toObject() //=> { days: 1.0241812152777778 }\n * @example Interval.fromDateTimes(dt1, dt2).toDuration(['hours', 'minutes']).toObject() //=> { hours: 24, minutes: 34.82095 }\n * @example Interval.fromDateTimes(dt1, dt2).toDuration(['hours', 'minutes', 'seconds']).toObject() //=> { hours: 24, minutes: 34, seconds: 49.257 }\n * @example Interval.fromDateTimes(dt1, dt2).toDuration('seconds').toObject() //=> { seconds: 88489.257 }\n * @return {Duration}\n */\n toDuration(unit, opts) {\n if (!this.isValid) {\n return Duration.invalid(this.invalidReason);\n }\n return this.e.diff(this.s, unit, opts);\n }\n\n /**\n * Run mapFn on the interval start and end, returning a new Interval from the resulting DateTimes\n * @param {function} mapFn\n * @return {Interval}\n * @example Interval.fromDateTimes(dt1, dt2).mapEndpoints(endpoint => endpoint.toUTC())\n * @example Interval.fromDateTimes(dt1, dt2).mapEndpoints(endpoint => endpoint.plus({ hours: 2 }))\n */\n mapEndpoints(mapFn) {\n return Interval.fromDateTimes(mapFn(this.s), mapFn(this.e));\n }\n}\n\n/**\n * The Info class contains static methods for retrieving general time and date related data. For example, it has methods for finding out if a time zone has a DST, for listing the months in any supported locale, and for discovering which of Luxon features are available in the current environment.\n */\nclass Info {\n /**\n * Return whether the specified zone contains a DST.\n * @param {string|Zone} [zone='local'] - Zone to check. Defaults to the environment's local zone.\n * @return {boolean}\n */\n static hasDST(zone = Settings.defaultZone) {\n const proto = DateTime.now().setZone(zone).set({ month: 12 });\n\n return !zone.isUniversal && proto.offset !== proto.set({ month: 6 }).offset;\n }\n\n /**\n * Return whether the specified zone is a valid IANA specifier.\n * @param {string} zone - Zone to check\n * @return {boolean}\n */\n static isValidIANAZone(zone) {\n return IANAZone.isValidZone(zone);\n }\n\n /**\n * Converts the input into a {@link Zone} instance.\n *\n * * If `input` is already a Zone instance, it is returned unchanged.\n * * If `input` is a string containing a valid time zone name, a Zone instance\n * with that name is returned.\n * * If `input` is a string that doesn't refer to a known time zone, a Zone\n * instance with {@link Zone#isValid} == false is returned.\n * * If `input is a number, a Zone instance with the specified fixed offset\n * in minutes is returned.\n * * If `input` is `null` or `undefined`, the default zone is returned.\n * @param {string|Zone|number} [input] - the value to be converted\n * @return {Zone}\n */\n static normalizeZone(input) {\n return normalizeZone(input, Settings.defaultZone);\n }\n\n /**\n * Return an array of standalone month names.\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat\n * @param {string} [length='long'] - the length of the month representation, such as \"numeric\", \"2-digit\", \"narrow\", \"short\", \"long\"\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.numberingSystem=null] - the numbering system\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @param {string} [opts.outputCalendar='gregory'] - the calendar\n * @example Info.months()[0] //=> 'January'\n * @example Info.months('short')[0] //=> 'Jan'\n * @example Info.months('numeric')[0] //=> '1'\n * @example Info.months('short', { locale: 'fr-CA' } )[0] //=> 'janv.'\n * @example Info.months('numeric', { locale: 'ar' })[0] //=> '١'\n * @example Info.months('long', { outputCalendar: 'islamic' })[0] //=> 'Rabiʻ I'\n * @return {Array}\n */\n static months(\n length = \"long\",\n { locale = null, numberingSystem = null, locObj = null, outputCalendar = \"gregory\" } = {}\n ) {\n return (locObj || Locale.create(locale, numberingSystem, outputCalendar)).months(length);\n }\n\n /**\n * Return an array of format month names.\n * Format months differ from standalone months in that they're meant to appear next to the day of the month. In some languages, that\n * changes the string.\n * See {@link Info#months}\n * @param {string} [length='long'] - the length of the month representation, such as \"numeric\", \"2-digit\", \"narrow\", \"short\", \"long\"\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.numberingSystem=null] - the numbering system\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @param {string} [opts.outputCalendar='gregory'] - the calendar\n * @return {Array}\n */\n static monthsFormat(\n length = \"long\",\n { locale = null, numberingSystem = null, locObj = null, outputCalendar = \"gregory\" } = {}\n ) {\n return (locObj || Locale.create(locale, numberingSystem, outputCalendar)).months(length, true);\n }\n\n /**\n * Return an array of standalone week names.\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat\n * @param {string} [length='long'] - the length of the weekday representation, such as \"narrow\", \"short\", \"long\".\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.numberingSystem=null] - the numbering system\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @example Info.weekdays()[0] //=> 'Monday'\n * @example Info.weekdays('short')[0] //=> 'Mon'\n * @example Info.weekdays('short', { locale: 'fr-CA' })[0] //=> 'lun.'\n * @example Info.weekdays('short', { locale: 'ar' })[0] //=> 'الاثنين'\n * @return {Array}\n */\n static weekdays(length = \"long\", { locale = null, numberingSystem = null, locObj = null } = {}) {\n return (locObj || Locale.create(locale, numberingSystem, null)).weekdays(length);\n }\n\n /**\n * Return an array of format week names.\n * Format weekdays differ from standalone weekdays in that they're meant to appear next to more date information. In some languages, that\n * changes the string.\n * See {@link Info#weekdays}\n * @param {string} [length='long'] - the length of the month representation, such as \"narrow\", \"short\", \"long\".\n * @param {Object} opts - options\n * @param {string} [opts.locale=null] - the locale code\n * @param {string} [opts.numberingSystem=null] - the numbering system\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @return {Array}\n */\n static weekdaysFormat(\n length = \"long\",\n { locale = null, numberingSystem = null, locObj = null } = {}\n ) {\n return (locObj || Locale.create(locale, numberingSystem, null)).weekdays(length, true);\n }\n\n /**\n * Return an array of meridiems.\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @example Info.meridiems() //=> [ 'AM', 'PM' ]\n * @example Info.meridiems({ locale: 'my' }) //=> [ 'နံနက်', 'ညနေ' ]\n * @return {Array}\n */\n static meridiems({ locale = null } = {}) {\n return Locale.create(locale).meridiems();\n }\n\n /**\n * Return an array of eras, such as ['BC', 'AD']. The locale can be specified, but the calendar system is always Gregorian.\n * @param {string} [length='short'] - the length of the era representation, such as \"short\" or \"long\".\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @example Info.eras() //=> [ 'BC', 'AD' ]\n * @example Info.eras('long') //=> [ 'Before Christ', 'Anno Domini' ]\n * @example Info.eras('long', { locale: 'fr' }) //=> [ 'avant Jésus-Christ', 'après Jésus-Christ' ]\n * @return {Array}\n */\n static eras(length = \"short\", { locale = null } = {}) {\n return Locale.create(locale, null, \"gregory\").eras(length);\n }\n\n /**\n * Return the set of available features in this environment.\n * Some features of Luxon are not available in all environments. For example, on older browsers, relative time formatting support is not available. Use this function to figure out if that's the case.\n * Keys:\n * * `relative`: whether this environment supports relative time formatting\n * @example Info.features() //=> { relative: false }\n * @return {Object}\n */\n static features() {\n return { relative: hasRelative() };\n }\n}\n\nfunction dayDiff(earlier, later) {\n const utcDayStart = (dt) => dt.toUTC(0, { keepLocalTime: true }).startOf(\"day\").valueOf(),\n ms = utcDayStart(later) - utcDayStart(earlier);\n return Math.floor(Duration.fromMillis(ms).as(\"days\"));\n}\n\nfunction highOrderDiffs(cursor, later, units) {\n const differs = [\n [\"years\", (a, b) => b.year - a.year],\n [\"quarters\", (a, b) => b.quarter - a.quarter + (b.year - a.year) * 4],\n [\"months\", (a, b) => b.month - a.month + (b.year - a.year) * 12],\n [\n \"weeks\",\n (a, b) => {\n const days = dayDiff(a, b);\n return (days - (days % 7)) / 7;\n },\n ],\n [\"days\", dayDiff],\n ];\n\n const results = {};\n let lowestOrder, highWater;\n\n for (const [unit, differ] of differs) {\n if (units.indexOf(unit) >= 0) {\n lowestOrder = unit;\n\n let delta = differ(cursor, later);\n highWater = cursor.plus({ [unit]: delta });\n\n if (highWater > later) {\n cursor = cursor.plus({ [unit]: delta - 1 });\n delta -= 1;\n } else {\n cursor = highWater;\n }\n\n results[unit] = delta;\n }\n }\n\n return [cursor, results, highWater, lowestOrder];\n}\n\nfunction diff (earlier, later, units, opts) {\n let [cursor, results, highWater, lowestOrder] = highOrderDiffs(earlier, later, units);\n\n const remainingMillis = later - cursor;\n\n const lowerOrderUnits = units.filter(\n (u) => [\"hours\", \"minutes\", \"seconds\", \"milliseconds\"].indexOf(u) >= 0\n );\n\n if (lowerOrderUnits.length === 0) {\n if (highWater < later) {\n highWater = cursor.plus({ [lowestOrder]: 1 });\n }\n\n if (highWater !== cursor) {\n results[lowestOrder] = (results[lowestOrder] || 0) + remainingMillis / (highWater - cursor);\n }\n }\n\n const duration = Duration.fromObject(results, opts);\n\n if (lowerOrderUnits.length > 0) {\n return Duration.fromMillis(remainingMillis, opts)\n .shiftTo(...lowerOrderUnits)\n .plus(duration);\n } else {\n return duration;\n }\n}\n\nconst numberingSystems = {\n arab: \"[\\u0660-\\u0669]\",\n arabext: \"[\\u06F0-\\u06F9]\",\n bali: \"[\\u1B50-\\u1B59]\",\n beng: \"[\\u09E6-\\u09EF]\",\n deva: \"[\\u0966-\\u096F]\",\n fullwide: \"[\\uFF10-\\uFF19]\",\n gujr: \"[\\u0AE6-\\u0AEF]\",\n hanidec: \"[〇|一|二|三|四|五|六|七|八|九]\",\n khmr: \"[\\u17E0-\\u17E9]\",\n knda: \"[\\u0CE6-\\u0CEF]\",\n laoo: \"[\\u0ED0-\\u0ED9]\",\n limb: \"[\\u1946-\\u194F]\",\n mlym: \"[\\u0D66-\\u0D6F]\",\n mong: \"[\\u1810-\\u1819]\",\n mymr: \"[\\u1040-\\u1049]\",\n orya: \"[\\u0B66-\\u0B6F]\",\n tamldec: \"[\\u0BE6-\\u0BEF]\",\n telu: \"[\\u0C66-\\u0C6F]\",\n thai: \"[\\u0E50-\\u0E59]\",\n tibt: \"[\\u0F20-\\u0F29]\",\n latn: \"\\\\d\",\n};\n\nconst numberingSystemsUTF16 = {\n arab: [1632, 1641],\n arabext: [1776, 1785],\n bali: [6992, 7001],\n beng: [2534, 2543],\n deva: [2406, 2415],\n fullwide: [65296, 65303],\n gujr: [2790, 2799],\n khmr: [6112, 6121],\n knda: [3302, 3311],\n laoo: [3792, 3801],\n limb: [6470, 6479],\n mlym: [3430, 3439],\n mong: [6160, 6169],\n mymr: [4160, 4169],\n orya: [2918, 2927],\n tamldec: [3046, 3055],\n telu: [3174, 3183],\n thai: [3664, 3673],\n tibt: [3872, 3881],\n};\n\nconst hanidecChars = numberingSystems.hanidec.replace(/[\\[|\\]]/g, \"\").split(\"\");\n\nfunction parseDigits(str) {\n let value = parseInt(str, 10);\n if (isNaN(value)) {\n value = \"\";\n for (let i = 0; i < str.length; i++) {\n const code = str.charCodeAt(i);\n\n if (str[i].search(numberingSystems.hanidec) !== -1) {\n value += hanidecChars.indexOf(str[i]);\n } else {\n for (const key in numberingSystemsUTF16) {\n const [min, max] = numberingSystemsUTF16[key];\n if (code >= min && code <= max) {\n value += code - min;\n }\n }\n }\n }\n return parseInt(value, 10);\n } else {\n return value;\n }\n}\n\nfunction digitRegex({ numberingSystem }, append = \"\") {\n return new RegExp(`${numberingSystems[numberingSystem || \"latn\"]}${append}`);\n}\n\nconst MISSING_FTP = \"missing Intl.DateTimeFormat.formatToParts support\";\n\nfunction intUnit(regex, post = (i) => i) {\n return { regex, deser: ([s]) => post(parseDigits(s)) };\n}\n\nconst NBSP = String.fromCharCode(160);\nconst spaceOrNBSP = `[ ${NBSP}]`;\nconst spaceOrNBSPRegExp = new RegExp(spaceOrNBSP, \"g\");\n\nfunction fixListRegex(s) {\n // make dots optional and also make them literal\n // make space and non breakable space characters interchangeable\n return s.replace(/\\./g, \"\\\\.?\").replace(spaceOrNBSPRegExp, spaceOrNBSP);\n}\n\nfunction stripInsensitivities(s) {\n return s\n .replace(/\\./g, \"\") // ignore dots that were made optional\n .replace(spaceOrNBSPRegExp, \" \") // interchange space and nbsp\n .toLowerCase();\n}\n\nfunction oneOf(strings, startIndex) {\n if (strings === null) {\n return null;\n } else {\n return {\n regex: RegExp(strings.map(fixListRegex).join(\"|\")),\n deser: ([s]) =>\n strings.findIndex((i) => stripInsensitivities(s) === stripInsensitivities(i)) + startIndex,\n };\n }\n}\n\nfunction offset(regex, groups) {\n return { regex, deser: ([, h, m]) => signedOffset(h, m), groups };\n}\n\nfunction simple(regex) {\n return { regex, deser: ([s]) => s };\n}\n\nfunction escapeToken(value) {\n return value.replace(/[\\-\\[\\]{}()*+?.,\\\\\\^$|#\\s]/g, \"\\\\$&\");\n}\n\nfunction unitForToken(token, loc) {\n const one = digitRegex(loc),\n two = digitRegex(loc, \"{2}\"),\n three = digitRegex(loc, \"{3}\"),\n four = digitRegex(loc, \"{4}\"),\n six = digitRegex(loc, \"{6}\"),\n oneOrTwo = digitRegex(loc, \"{1,2}\"),\n oneToThree = digitRegex(loc, \"{1,3}\"),\n oneToSix = digitRegex(loc, \"{1,6}\"),\n oneToNine = digitRegex(loc, \"{1,9}\"),\n twoToFour = digitRegex(loc, \"{2,4}\"),\n fourToSix = digitRegex(loc, \"{4,6}\"),\n literal = (t) => ({ regex: RegExp(escapeToken(t.val)), deser: ([s]) => s, literal: true }),\n unitate = (t) => {\n if (token.literal) {\n return literal(t);\n }\n switch (t.val) {\n // era\n case \"G\":\n return oneOf(loc.eras(\"short\", false), 0);\n case \"GG\":\n return oneOf(loc.eras(\"long\", false), 0);\n // years\n case \"y\":\n return intUnit(oneToSix);\n case \"yy\":\n return intUnit(twoToFour, untruncateYear);\n case \"yyyy\":\n return intUnit(four);\n case \"yyyyy\":\n return intUnit(fourToSix);\n case \"yyyyyy\":\n return intUnit(six);\n // months\n case \"M\":\n return intUnit(oneOrTwo);\n case \"MM\":\n return intUnit(two);\n case \"MMM\":\n return oneOf(loc.months(\"short\", true, false), 1);\n case \"MMMM\":\n return oneOf(loc.months(\"long\", true, false), 1);\n case \"L\":\n return intUnit(oneOrTwo);\n case \"LL\":\n return intUnit(two);\n case \"LLL\":\n return oneOf(loc.months(\"short\", false, false), 1);\n case \"LLLL\":\n return oneOf(loc.months(\"long\", false, false), 1);\n // dates\n case \"d\":\n return intUnit(oneOrTwo);\n case \"dd\":\n return intUnit(two);\n // ordinals\n case \"o\":\n return intUnit(oneToThree);\n case \"ooo\":\n return intUnit(three);\n // time\n case \"HH\":\n return intUnit(two);\n case \"H\":\n return intUnit(oneOrTwo);\n case \"hh\":\n return intUnit(two);\n case \"h\":\n return intUnit(oneOrTwo);\n case \"mm\":\n return intUnit(two);\n case \"m\":\n return intUnit(oneOrTwo);\n case \"q\":\n return intUnit(oneOrTwo);\n case \"qq\":\n return intUnit(two);\n case \"s\":\n return intUnit(oneOrTwo);\n case \"ss\":\n return intUnit(two);\n case \"S\":\n return intUnit(oneToThree);\n case \"SSS\":\n return intUnit(three);\n case \"u\":\n return simple(oneToNine);\n case \"uu\":\n return simple(oneOrTwo);\n case \"uuu\":\n return intUnit(one);\n // meridiem\n case \"a\":\n return oneOf(loc.meridiems(), 0);\n // weekYear (k)\n case \"kkkk\":\n return intUnit(four);\n case \"kk\":\n return intUnit(twoToFour, untruncateYear);\n // weekNumber (W)\n case \"W\":\n return intUnit(oneOrTwo);\n case \"WW\":\n return intUnit(two);\n // weekdays\n case \"E\":\n case \"c\":\n return intUnit(one);\n case \"EEE\":\n return oneOf(loc.weekdays(\"short\", false, false), 1);\n case \"EEEE\":\n return oneOf(loc.weekdays(\"long\", false, false), 1);\n case \"ccc\":\n return oneOf(loc.weekdays(\"short\", true, false), 1);\n case \"cccc\":\n return oneOf(loc.weekdays(\"long\", true, false), 1);\n // offset/zone\n case \"Z\":\n case \"ZZ\":\n return offset(new RegExp(`([+-]${oneOrTwo.source})(?::(${two.source}))?`), 2);\n case \"ZZZ\":\n return offset(new RegExp(`([+-]${oneOrTwo.source})(${two.source})?`), 2);\n // we don't support ZZZZ (PST) or ZZZZZ (Pacific Standard Time) in parsing\n // because we don't have any way to figure out what they are\n case \"z\":\n return simple(/[a-z_+-/]{1,256}?/i);\n default:\n return literal(t);\n }\n };\n\n const unit = unitate(token) || {\n invalidReason: MISSING_FTP,\n };\n\n unit.token = token;\n\n return unit;\n}\n\nconst partTypeStyleToTokenVal = {\n year: {\n \"2-digit\": \"yy\",\n numeric: \"yyyyy\",\n },\n month: {\n numeric: \"M\",\n \"2-digit\": \"MM\",\n short: \"MMM\",\n long: \"MMMM\",\n },\n day: {\n numeric: \"d\",\n \"2-digit\": \"dd\",\n },\n weekday: {\n short: \"EEE\",\n long: \"EEEE\",\n },\n dayperiod: \"a\",\n dayPeriod: \"a\",\n hour: {\n numeric: \"h\",\n \"2-digit\": \"hh\",\n },\n minute: {\n numeric: \"m\",\n \"2-digit\": \"mm\",\n },\n second: {\n numeric: \"s\",\n \"2-digit\": \"ss\",\n },\n timeZoneName: {\n long: \"ZZZZZ\",\n short: \"ZZZ\",\n },\n};\n\nfunction tokenForPart(part, locale, formatOpts) {\n const { type, value } = part;\n\n if (type === \"literal\") {\n return {\n literal: true,\n val: value,\n };\n }\n\n const style = formatOpts[type];\n\n let val = partTypeStyleToTokenVal[type];\n if (typeof val === \"object\") {\n val = val[style];\n }\n\n if (val) {\n return {\n literal: false,\n val,\n };\n }\n\n return undefined;\n}\n\nfunction buildRegex(units) {\n const re = units.map((u) => u.regex).reduce((f, r) => `${f}(${r.source})`, \"\");\n return [`^${re}$`, units];\n}\n\nfunction match(input, regex, handlers) {\n const matches = input.match(regex);\n\n if (matches) {\n const all = {};\n let matchIndex = 1;\n for (const i in handlers) {\n if (hasOwnProperty(handlers, i)) {\n const h = handlers[i],\n groups = h.groups ? h.groups + 1 : 1;\n if (!h.literal && h.token) {\n all[h.token.val[0]] = h.deser(matches.slice(matchIndex, matchIndex + groups));\n }\n matchIndex += groups;\n }\n }\n return [matches, all];\n } else {\n return [matches, {}];\n }\n}\n\nfunction dateTimeFromMatches(matches) {\n const toField = (token) => {\n switch (token) {\n case \"S\":\n return \"millisecond\";\n case \"s\":\n return \"second\";\n case \"m\":\n return \"minute\";\n case \"h\":\n case \"H\":\n return \"hour\";\n case \"d\":\n return \"day\";\n case \"o\":\n return \"ordinal\";\n case \"L\":\n case \"M\":\n return \"month\";\n case \"y\":\n return \"year\";\n case \"E\":\n case \"c\":\n return \"weekday\";\n case \"W\":\n return \"weekNumber\";\n case \"k\":\n return \"weekYear\";\n case \"q\":\n return \"quarter\";\n default:\n return null;\n }\n };\n\n let zone = null;\n let specificOffset;\n if (!isUndefined(matches.z)) {\n zone = IANAZone.create(matches.z);\n }\n\n if (!isUndefined(matches.Z)) {\n if (!zone) {\n zone = new FixedOffsetZone(matches.Z);\n }\n specificOffset = matches.Z;\n }\n\n if (!isUndefined(matches.q)) {\n matches.M = (matches.q - 1) * 3 + 1;\n }\n\n if (!isUndefined(matches.h)) {\n if (matches.h < 12 && matches.a === 1) {\n matches.h += 12;\n } else if (matches.h === 12 && matches.a === 0) {\n matches.h = 0;\n }\n }\n\n if (matches.G === 0 && matches.y) {\n matches.y = -matches.y;\n }\n\n if (!isUndefined(matches.u)) {\n matches.S = parseMillis(matches.u);\n }\n\n const vals = Object.keys(matches).reduce((r, k) => {\n const f = toField(k);\n if (f) {\n r[f] = matches[k];\n }\n\n return r;\n }, {});\n\n return [vals, zone, specificOffset];\n}\n\nlet dummyDateTimeCache = null;\n\nfunction getDummyDateTime() {\n if (!dummyDateTimeCache) {\n dummyDateTimeCache = DateTime.fromMillis(1555555555555);\n }\n\n return dummyDateTimeCache;\n}\n\nfunction maybeExpandMacroToken(token, locale) {\n if (token.literal) {\n return token;\n }\n\n const formatOpts = Formatter.macroTokenToFormatOpts(token.val);\n const tokens = formatOptsToTokens(formatOpts, locale);\n\n if (tokens == null || tokens.includes(undefined)) {\n return token;\n }\n\n return tokens;\n}\n\nfunction expandMacroTokens(tokens, locale) {\n return Array.prototype.concat(...tokens.map((t) => maybeExpandMacroToken(t, locale)));\n}\n\n/**\n * @private\n */\n\nfunction explainFromTokens(locale, input, format) {\n const tokens = expandMacroTokens(Formatter.parseFormat(format), locale),\n units = tokens.map((t) => unitForToken(t, locale)),\n disqualifyingUnit = units.find((t) => t.invalidReason);\n\n if (disqualifyingUnit) {\n return { input, tokens, invalidReason: disqualifyingUnit.invalidReason };\n } else {\n const [regexString, handlers] = buildRegex(units),\n regex = RegExp(regexString, \"i\"),\n [rawMatches, matches] = match(input, regex, handlers),\n [result, zone, specificOffset] = matches\n ? dateTimeFromMatches(matches)\n : [null, null, undefined];\n if (hasOwnProperty(matches, \"a\") && hasOwnProperty(matches, \"H\")) {\n throw new ConflictingSpecificationError(\n \"Can't include meridiem when specifying 24-hour format\"\n );\n }\n return { input, tokens, regex, rawMatches, matches, result, zone, specificOffset };\n }\n}\n\nfunction parseFromTokens(locale, input, format) {\n const { result, zone, specificOffset, invalidReason } = explainFromTokens(locale, input, format);\n return [result, zone, specificOffset, invalidReason];\n}\n\nfunction formatOptsToTokens(formatOpts, locale) {\n if (!formatOpts) {\n return null;\n }\n\n const formatter = Formatter.create(locale, formatOpts);\n const parts = formatter.formatDateTimeParts(getDummyDateTime());\n return parts.map((p) => tokenForPart(p, locale, formatOpts));\n}\n\nconst nonLeapLadder = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334],\n leapLadder = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335];\n\nfunction unitOutOfRange(unit, value) {\n return new Invalid(\n \"unit out of range\",\n `you specified ${value} (of type ${typeof value}) as a ${unit}, which is invalid`\n );\n}\n\nfunction dayOfWeek(year, month, day) {\n const d = new Date(Date.UTC(year, month - 1, day));\n\n if (year < 100 && year >= 0) {\n d.setUTCFullYear(d.getUTCFullYear() - 1900);\n }\n\n const js = d.getUTCDay();\n\n return js === 0 ? 7 : js;\n}\n\nfunction computeOrdinal(year, month, day) {\n return day + (isLeapYear(year) ? leapLadder : nonLeapLadder)[month - 1];\n}\n\nfunction uncomputeOrdinal(year, ordinal) {\n const table = isLeapYear(year) ? leapLadder : nonLeapLadder,\n month0 = table.findIndex((i) => i < ordinal),\n day = ordinal - table[month0];\n return { month: month0 + 1, day };\n}\n\n/**\n * @private\n */\n\nfunction gregorianToWeek(gregObj) {\n const { year, month, day } = gregObj,\n ordinal = computeOrdinal(year, month, day),\n weekday = dayOfWeek(year, month, day);\n\n let weekNumber = Math.floor((ordinal - weekday + 10) / 7),\n weekYear;\n\n if (weekNumber < 1) {\n weekYear = year - 1;\n weekNumber = weeksInWeekYear(weekYear);\n } else if (weekNumber > weeksInWeekYear(year)) {\n weekYear = year + 1;\n weekNumber = 1;\n } else {\n weekYear = year;\n }\n\n return { weekYear, weekNumber, weekday, ...timeObject(gregObj) };\n}\n\nfunction weekToGregorian(weekData) {\n const { weekYear, weekNumber, weekday } = weekData,\n weekdayOfJan4 = dayOfWeek(weekYear, 1, 4),\n yearInDays = daysInYear(weekYear);\n\n let ordinal = weekNumber * 7 + weekday - weekdayOfJan4 - 3,\n year;\n\n if (ordinal < 1) {\n year = weekYear - 1;\n ordinal += daysInYear(year);\n } else if (ordinal > yearInDays) {\n year = weekYear + 1;\n ordinal -= daysInYear(weekYear);\n } else {\n year = weekYear;\n }\n\n const { month, day } = uncomputeOrdinal(year, ordinal);\n return { year, month, day, ...timeObject(weekData) };\n}\n\nfunction gregorianToOrdinal(gregData) {\n const { year, month, day } = gregData;\n const ordinal = computeOrdinal(year, month, day);\n return { year, ordinal, ...timeObject(gregData) };\n}\n\nfunction ordinalToGregorian(ordinalData) {\n const { year, ordinal } = ordinalData;\n const { month, day } = uncomputeOrdinal(year, ordinal);\n return { year, month, day, ...timeObject(ordinalData) };\n}\n\nfunction hasInvalidWeekData(obj) {\n const validYear = isInteger(obj.weekYear),\n validWeek = integerBetween(obj.weekNumber, 1, weeksInWeekYear(obj.weekYear)),\n validWeekday = integerBetween(obj.weekday, 1, 7);\n\n if (!validYear) {\n return unitOutOfRange(\"weekYear\", obj.weekYear);\n } else if (!validWeek) {\n return unitOutOfRange(\"week\", obj.week);\n } else if (!validWeekday) {\n return unitOutOfRange(\"weekday\", obj.weekday);\n } else return false;\n}\n\nfunction hasInvalidOrdinalData(obj) {\n const validYear = isInteger(obj.year),\n validOrdinal = integerBetween(obj.ordinal, 1, daysInYear(obj.year));\n\n if (!validYear) {\n return unitOutOfRange(\"year\", obj.year);\n } else if (!validOrdinal) {\n return unitOutOfRange(\"ordinal\", obj.ordinal);\n } else return false;\n}\n\nfunction hasInvalidGregorianData(obj) {\n const validYear = isInteger(obj.year),\n validMonth = integerBetween(obj.month, 1, 12),\n validDay = integerBetween(obj.day, 1, daysInMonth(obj.year, obj.month));\n\n if (!validYear) {\n return unitOutOfRange(\"year\", obj.year);\n } else if (!validMonth) {\n return unitOutOfRange(\"month\", obj.month);\n } else if (!validDay) {\n return unitOutOfRange(\"day\", obj.day);\n } else return false;\n}\n\nfunction hasInvalidTimeData(obj) {\n const { hour, minute, second, millisecond } = obj;\n const validHour =\n integerBetween(hour, 0, 23) ||\n (hour === 24 && minute === 0 && second === 0 && millisecond === 0),\n validMinute = integerBetween(minute, 0, 59),\n validSecond = integerBetween(second, 0, 59),\n validMillisecond = integerBetween(millisecond, 0, 999);\n\n if (!validHour) {\n return unitOutOfRange(\"hour\", hour);\n } else if (!validMinute) {\n return unitOutOfRange(\"minute\", minute);\n } else if (!validSecond) {\n return unitOutOfRange(\"second\", second);\n } else if (!validMillisecond) {\n return unitOutOfRange(\"millisecond\", millisecond);\n } else return false;\n}\n\nconst INVALID = \"Invalid DateTime\";\nconst MAX_DATE = 8.64e15;\n\nfunction unsupportedZone(zone) {\n return new Invalid(\"unsupported zone\", `the zone \"${zone.name}\" is not supported`);\n}\n\n// we cache week data on the DT object and this intermediates the cache\nfunction possiblyCachedWeekData(dt) {\n if (dt.weekData === null) {\n dt.weekData = gregorianToWeek(dt.c);\n }\n return dt.weekData;\n}\n\n// clone really means, \"make a new object with these modifications\". all \"setters\" really use this\n// to create a new object while only changing some of the properties\nfunction clone(inst, alts) {\n const current = {\n ts: inst.ts,\n zone: inst.zone,\n c: inst.c,\n o: inst.o,\n loc: inst.loc,\n invalid: inst.invalid,\n };\n return new DateTime({ ...current, ...alts, old: current });\n}\n\n// find the right offset a given local time. The o input is our guess, which determines which\n// offset we'll pick in ambiguous cases (e.g. there are two 3 AMs b/c Fallback DST)\nfunction fixOffset(localTS, o, tz) {\n // Our UTC time is just a guess because our offset is just a guess\n let utcGuess = localTS - o * 60 * 1000;\n\n // Test whether the zone matches the offset for this ts\n const o2 = tz.offset(utcGuess);\n\n // If so, offset didn't change and we're done\n if (o === o2) {\n return [utcGuess, o];\n }\n\n // If not, change the ts by the difference in the offset\n utcGuess -= (o2 - o) * 60 * 1000;\n\n // If that gives us the local time we want, we're done\n const o3 = tz.offset(utcGuess);\n if (o2 === o3) {\n return [utcGuess, o2];\n }\n\n // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\n}\n\n// convert an epoch timestamp into a calendar object with the given offset\nfunction tsToObj(ts, offset) {\n ts += offset * 60 * 1000;\n\n const d = new Date(ts);\n\n return {\n year: d.getUTCFullYear(),\n month: d.getUTCMonth() + 1,\n day: d.getUTCDate(),\n hour: d.getUTCHours(),\n minute: d.getUTCMinutes(),\n second: d.getUTCSeconds(),\n millisecond: d.getUTCMilliseconds(),\n };\n}\n\n// convert a calendar object to a epoch timestamp\nfunction objToTS(obj, offset, zone) {\n return fixOffset(objToLocalTS(obj), offset, zone);\n}\n\n// create a new DT instance by adding a duration, adjusting for DSTs\nfunction adjustTime(inst, dur) {\n const oPre = inst.o,\n year = inst.c.year + Math.trunc(dur.years),\n month = inst.c.month + Math.trunc(dur.months) + Math.trunc(dur.quarters) * 3,\n c = {\n ...inst.c,\n year,\n month,\n day:\n Math.min(inst.c.day, daysInMonth(year, month)) +\n Math.trunc(dur.days) +\n Math.trunc(dur.weeks) * 7,\n },\n millisToAdd = Duration.fromObject({\n years: dur.years - Math.trunc(dur.years),\n quarters: dur.quarters - Math.trunc(dur.quarters),\n months: dur.months - Math.trunc(dur.months),\n weeks: dur.weeks - Math.trunc(dur.weeks),\n days: dur.days - Math.trunc(dur.days),\n hours: dur.hours,\n minutes: dur.minutes,\n seconds: dur.seconds,\n milliseconds: dur.milliseconds,\n }).as(\"milliseconds\"),\n localTS = objToLocalTS(c);\n\n let [ts, o] = fixOffset(localTS, oPre, inst.zone);\n\n if (millisToAdd !== 0) {\n ts += millisToAdd;\n // that could have changed the offset by going over a DST, but we want to keep the ts the same\n o = inst.zone.offset(ts);\n }\n\n return { ts, o };\n}\n\n// helper useful in turning the results of parsing into real dates\n// by handling the zone options\nfunction parseDataToDateTime(parsed, parsedZone, opts, format, text, specificOffset) {\n const { setZone, zone } = opts;\n if (parsed && Object.keys(parsed).length !== 0) {\n const interpretationZone = parsedZone || zone,\n inst = DateTime.fromObject(parsed, {\n ...opts,\n zone: interpretationZone,\n specificOffset,\n });\n return setZone ? inst : inst.setZone(zone);\n } else {\n return DateTime.invalid(\n new Invalid(\"unparsable\", `the input \"${text}\" can't be parsed as ${format}`)\n );\n }\n}\n\n// if you want to output a technical format (e.g. RFC 2822), this helper\n// helps handle the details\nfunction toTechFormat(dt, format, allowZ = true) {\n return dt.isValid\n ? Formatter.create(Locale.create(\"en-US\"), {\n allowZ,\n forceSimple: true,\n }).formatDateTimeFromString(dt, format)\n : null;\n}\n\nfunction toISODate(o, extended) {\n const longFormat = o.c.year > 9999 || o.c.year < 0;\n let c = \"\";\n if (longFormat && o.c.year >= 0) c += \"+\";\n c += padStart(o.c.year, longFormat ? 6 : 4);\n\n if (extended) {\n c += \"-\";\n c += padStart(o.c.month);\n c += \"-\";\n c += padStart(o.c.day);\n } else {\n c += padStart(o.c.month);\n c += padStart(o.c.day);\n }\n return c;\n}\n\nfunction toISOTime(\n o,\n extended,\n suppressSeconds,\n suppressMilliseconds,\n includeOffset,\n extendedZone\n) {\n let c = padStart(o.c.hour);\n if (extended) {\n c += \":\";\n c += padStart(o.c.minute);\n if (o.c.second !== 0 || !suppressSeconds) {\n c += \":\";\n }\n } else {\n c += padStart(o.c.minute);\n }\n\n if (o.c.second !== 0 || !suppressSeconds) {\n c += padStart(o.c.second);\n\n if (o.c.millisecond !== 0 || !suppressMilliseconds) {\n c += \".\";\n c += padStart(o.c.millisecond, 3);\n }\n }\n\n if (includeOffset) {\n if (o.isOffsetFixed && o.offset === 0 && !extendedZone) {\n c += \"Z\";\n } else if (o.o < 0) {\n c += \"-\";\n c += padStart(Math.trunc(-o.o / 60));\n c += \":\";\n c += padStart(Math.trunc(-o.o % 60));\n } else {\n c += \"+\";\n c += padStart(Math.trunc(o.o / 60));\n c += \":\";\n c += padStart(Math.trunc(o.o % 60));\n }\n }\n\n if (extendedZone) {\n c += \"[\" + o.zone.ianaName + \"]\";\n }\n return c;\n}\n\n// defaults for unspecified units in the supported calendars\nconst defaultUnitValues = {\n month: 1,\n day: 1,\n hour: 0,\n minute: 0,\n second: 0,\n millisecond: 0,\n },\n defaultWeekUnitValues = {\n weekNumber: 1,\n weekday: 1,\n hour: 0,\n minute: 0,\n second: 0,\n millisecond: 0,\n },\n defaultOrdinalUnitValues = {\n ordinal: 1,\n hour: 0,\n minute: 0,\n second: 0,\n millisecond: 0,\n };\n\n// Units in the supported calendars, sorted by bigness\nconst orderedUnits = [\"year\", \"month\", \"day\", \"hour\", \"minute\", \"second\", \"millisecond\"],\n orderedWeekUnits = [\n \"weekYear\",\n \"weekNumber\",\n \"weekday\",\n \"hour\",\n \"minute\",\n \"second\",\n \"millisecond\",\n ],\n orderedOrdinalUnits = [\"year\", \"ordinal\", \"hour\", \"minute\", \"second\", \"millisecond\"];\n\n// standardize case and plurality in units\nfunction normalizeUnit(unit) {\n const normalized = {\n year: \"year\",\n years: \"year\",\n month: \"month\",\n months: \"month\",\n day: \"day\",\n days: \"day\",\n hour: \"hour\",\n hours: \"hour\",\n minute: \"minute\",\n minutes: \"minute\",\n quarter: \"quarter\",\n quarters: \"quarter\",\n second: \"second\",\n seconds: \"second\",\n millisecond: \"millisecond\",\n milliseconds: \"millisecond\",\n weekday: \"weekday\",\n weekdays: \"weekday\",\n weeknumber: \"weekNumber\",\n weeksnumber: \"weekNumber\",\n weeknumbers: \"weekNumber\",\n weekyear: \"weekYear\",\n weekyears: \"weekYear\",\n ordinal: \"ordinal\",\n }[unit.toLowerCase()];\n\n if (!normalized) throw new InvalidUnitError(unit);\n\n return normalized;\n}\n\n// this is a dumbed down version of fromObject() that runs about 60% faster\n// but doesn't do any validation, makes a bunch of assumptions about what units\n// are present, and so on.\nfunction quickDT(obj, opts) {\n const zone = normalizeZone(opts.zone, Settings.defaultZone),\n loc = Locale.fromObject(opts),\n tsNow = Settings.now();\n\n let ts, o;\n\n // assume we have the higher-order units\n if (!isUndefined(obj.year)) {\n for (const u of orderedUnits) {\n if (isUndefined(obj[u])) {\n obj[u] = defaultUnitValues[u];\n }\n }\n\n const invalid = hasInvalidGregorianData(obj) || hasInvalidTimeData(obj);\n if (invalid) {\n return DateTime.invalid(invalid);\n }\n\n const offsetProvis = zone.offset(tsNow);\n [ts, o] = objToTS(obj, offsetProvis, zone);\n } else {\n ts = tsNow;\n }\n\n return new DateTime({ ts, zone, loc, o });\n}\n\nfunction diffRelative(start, end, opts) {\n const round = isUndefined(opts.round) ? true : opts.round,\n format = (c, unit) => {\n c = roundTo(c, round || opts.calendary ? 0 : 2, true);\n const formatter = end.loc.clone(opts).relFormatter(opts);\n return formatter.format(c, unit);\n },\n differ = (unit) => {\n if (opts.calendary) {\n if (!end.hasSame(start, unit)) {\n return end.startOf(unit).diff(start.startOf(unit), unit).get(unit);\n } else return 0;\n } else {\n return end.diff(start, unit).get(unit);\n }\n };\n\n if (opts.unit) {\n return format(differ(opts.unit), opts.unit);\n }\n\n for (const unit of opts.units) {\n const count = differ(unit);\n if (Math.abs(count) >= 1) {\n return format(count, unit);\n }\n }\n return format(start > end ? -0 : 0, opts.units[opts.units.length - 1]);\n}\n\nfunction lastOpts(argList) {\n let opts = {},\n args;\n if (argList.length > 0 && typeof argList[argList.length - 1] === \"object\") {\n opts = argList[argList.length - 1];\n args = Array.from(argList).slice(0, argList.length - 1);\n } else {\n args = Array.from(argList);\n }\n return [opts, args];\n}\n\n/**\n * A DateTime is an immutable data structure representing a specific date and time and accompanying methods. It contains class and instance methods for creating, parsing, interrogating, transforming, and formatting them.\n *\n * A DateTime comprises of:\n * * A timestamp. Each DateTime instance refers to a specific millisecond of the Unix epoch.\n * * A time zone. Each instance is considered in the context of a specific zone (by default the local system's zone).\n * * Configuration properties that effect how output strings are formatted, such as `locale`, `numberingSystem`, and `outputCalendar`.\n *\n * Here is a brief overview of the most commonly used functionality it provides:\n *\n * * **Creation**: To create a DateTime from its components, use one of its factory class methods: {@link DateTime.local}, {@link DateTime.utc}, and (most flexibly) {@link DateTime.fromObject}. To create one from a standard string format, use {@link DateTime.fromISO}, {@link DateTime.fromHTTP}, and {@link DateTime.fromRFC2822}. To create one from a custom string format, use {@link DateTime.fromFormat}. To create one from a native JS date, use {@link DateTime.fromJSDate}.\n * * **Gregorian calendar and time**: To examine the Gregorian properties of a DateTime individually (i.e as opposed to collectively through {@link DateTime#toObject}), use the {@link DateTime#year}, {@link DateTime#month},\n * {@link DateTime#day}, {@link DateTime#hour}, {@link DateTime#minute}, {@link DateTime#second}, {@link DateTime#millisecond} accessors.\n * * **Week calendar**: For ISO week calendar attributes, see the {@link DateTime#weekYear}, {@link DateTime#weekNumber}, and {@link DateTime#weekday} accessors.\n * * **Configuration** See the {@link DateTime#locale} and {@link DateTime#numberingSystem} accessors.\n * * **Transformation**: To transform the DateTime into other DateTimes, use {@link DateTime#set}, {@link DateTime#reconfigure}, {@link DateTime#setZone}, {@link DateTime#setLocale}, {@link DateTime.plus}, {@link DateTime#minus}, {@link DateTime#endOf}, {@link DateTime#startOf}, {@link DateTime#toUTC}, and {@link DateTime#toLocal}.\n * * **Output**: To convert the DateTime to other representations, use the {@link DateTime#toRelative}, {@link DateTime#toRelativeCalendar}, {@link DateTime#toJSON}, {@link DateTime#toISO}, {@link DateTime#toHTTP}, {@link DateTime#toObject}, {@link DateTime#toRFC2822}, {@link DateTime#toString}, {@link DateTime#toLocaleString}, {@link DateTime#toFormat}, {@link DateTime#toMillis} and {@link DateTime#toJSDate}.\n *\n * There's plenty others documented below. In addition, for more information on subtler topics like internationalization, time zones, alternative calendars, validity, and so on, see the external documentation.\n */\nclass DateTime {\n /**\n * @access private\n */\n constructor(config) {\n const zone = config.zone || Settings.defaultZone;\n\n let invalid =\n config.invalid ||\n (Number.isNaN(config.ts) ? new Invalid(\"invalid input\") : null) ||\n (!zone.isValid ? unsupportedZone(zone) : null);\n /**\n * @access private\n */\n this.ts = isUndefined(config.ts) ? Settings.now() : config.ts;\n\n let c = null,\n o = null;\n if (!invalid) {\n const unchanged = config.old && config.old.ts === this.ts && config.old.zone.equals(zone);\n\n if (unchanged) {\n [c, o] = [config.old.c, config.old.o];\n } else {\n const ot = zone.offset(this.ts);\n c = tsToObj(this.ts, ot);\n invalid = Number.isNaN(c.year) ? new Invalid(\"invalid input\") : null;\n c = invalid ? null : c;\n o = invalid ? null : ot;\n }\n }\n\n /**\n * @access private\n */\n this._zone = zone;\n /**\n * @access private\n */\n this.loc = config.loc || Locale.create();\n /**\n * @access private\n */\n this.invalid = invalid;\n /**\n * @access private\n */\n this.weekData = null;\n /**\n * @access private\n */\n this.c = c;\n /**\n * @access private\n */\n this.o = o;\n /**\n * @access private\n */\n this.isLuxonDateTime = true;\n }\n\n // CONSTRUCT\n\n /**\n * Create a DateTime for the current instant, in the system's time zone.\n *\n * Use Settings to override these default values if needed.\n * @example DateTime.now().toISO() //~> now in the ISO format\n * @return {DateTime}\n */\n static now() {\n return new DateTime({});\n }\n\n /**\n * Create a local DateTime\n * @param {number} [year] - The calendar year. If omitted (as in, call `local()` with no arguments), the current time will be used\n * @param {number} [month=1] - The month, 1-indexed\n * @param {number} [day=1] - The day of the month, 1-indexed\n * @param {number} [hour=0] - The hour of the day, in 24-hour time\n * @param {number} [minute=0] - The minute of the hour, meaning a number between 0 and 59\n * @param {number} [second=0] - The second of the minute, meaning a number between 0 and 59\n * @param {number} [millisecond=0] - The millisecond of the second, meaning a number between 0 and 999\n * @example DateTime.local() //~> now\n * @example DateTime.local({ zone: \"America/New_York\" }) //~> now, in US east coast time\n * @example DateTime.local(2017) //~> 2017-01-01T00:00:00\n * @example DateTime.local(2017, 3) //~> 2017-03-01T00:00:00\n * @example DateTime.local(2017, 3, 12, { locale: \"fr\" }) //~> 2017-03-12T00:00:00, with a French locale\n * @example DateTime.local(2017, 3, 12, 5) //~> 2017-03-12T05:00:00\n * @example DateTime.local(2017, 3, 12, 5, { zone: \"utc\" }) //~> 2017-03-12T05:00:00, in UTC\n * @example DateTime.local(2017, 3, 12, 5, 45) //~> 2017-03-12T05:45:00\n * @example DateTime.local(2017, 3, 12, 5, 45, 10) //~> 2017-03-12T05:45:10\n * @example DateTime.local(2017, 3, 12, 5, 45, 10, 765) //~> 2017-03-12T05:45:10.765\n * @return {DateTime}\n */\n static local() {\n const [opts, args] = lastOpts(arguments),\n [year, month, day, hour, minute, second, millisecond] = args;\n return quickDT({ year, month, day, hour, minute, second, millisecond }, opts);\n }\n\n /**\n * Create a DateTime in UTC\n * @param {number} [year] - The calendar year. If omitted (as in, call `utc()` with no arguments), the current time will be used\n * @param {number} [month=1] - The month, 1-indexed\n * @param {number} [day=1] - The day of the month\n * @param {number} [hour=0] - The hour of the day, in 24-hour time\n * @param {number} [minute=0] - The minute of the hour, meaning a number between 0 and 59\n * @param {number} [second=0] - The second of the minute, meaning a number between 0 and 59\n * @param {number} [millisecond=0] - The millisecond of the second, meaning a number between 0 and 999\n * @param {Object} options - configuration options for the DateTime\n * @param {string} [options.locale] - a locale to set on the resulting DateTime instance\n * @param {string} [options.outputCalendar] - the output calendar to set on the resulting DateTime instance\n * @param {string} [options.numberingSystem] - the numbering system to set on the resulting DateTime instance\n * @example DateTime.utc() //~> now\n * @example DateTime.utc(2017) //~> 2017-01-01T00:00:00Z\n * @example DateTime.utc(2017, 3) //~> 2017-03-01T00:00:00Z\n * @example DateTime.utc(2017, 3, 12) //~> 2017-03-12T00:00:00Z\n * @example DateTime.utc(2017, 3, 12, 5) //~> 2017-03-12T05:00:00Z\n * @example DateTime.utc(2017, 3, 12, 5, 45) //~> 2017-03-12T05:45:00Z\n * @example DateTime.utc(2017, 3, 12, 5, 45, { locale: \"fr\" }) //~> 2017-03-12T05:45:00Z with a French locale\n * @example DateTime.utc(2017, 3, 12, 5, 45, 10) //~> 2017-03-12T05:45:10Z\n * @example DateTime.utc(2017, 3, 12, 5, 45, 10, 765, { locale: \"fr\" }) //~> 2017-03-12T05:45:10.765Z with a French locale\n * @return {DateTime}\n */\n static utc() {\n const [opts, args] = lastOpts(arguments),\n [year, month, day, hour, minute, second, millisecond] = args;\n\n opts.zone = FixedOffsetZone.utcInstance;\n return quickDT({ year, month, day, hour, minute, second, millisecond }, opts);\n }\n\n /**\n * Create a DateTime from a JavaScript Date object. Uses the default zone.\n * @param {Date} date - a JavaScript Date object\n * @param {Object} options - configuration options for the DateTime\n * @param {string|Zone} [options.zone='local'] - the zone to place the DateTime into\n * @return {DateTime}\n */\n static fromJSDate(date, options = {}) {\n const ts = isDate(date) ? date.valueOf() : NaN;\n if (Number.isNaN(ts)) {\n return DateTime.invalid(\"invalid input\");\n }\n\n const zoneToUse = normalizeZone(options.zone, Settings.defaultZone);\n if (!zoneToUse.isValid) {\n return DateTime.invalid(unsupportedZone(zoneToUse));\n }\n\n return new DateTime({\n ts: ts,\n zone: zoneToUse,\n loc: Locale.fromObject(options),\n });\n }\n\n /**\n * Create a DateTime from a number of milliseconds since the epoch (meaning since 1 January 1970 00:00:00 UTC). Uses the default zone.\n * @param {number} milliseconds - a number of milliseconds since 1970 UTC\n * @param {Object} options - configuration options for the DateTime\n * @param {string|Zone} [options.zone='local'] - the zone to place the DateTime into\n * @param {string} [options.locale] - a locale to set on the resulting DateTime instance\n * @param {string} options.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} options.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @return {DateTime}\n */\n static fromMillis(milliseconds, options = {}) {\n if (!isNumber(milliseconds)) {\n throw new InvalidArgumentError(\n `fromMillis requires a numerical input, but received a ${typeof milliseconds} with value ${milliseconds}`\n );\n } else if (milliseconds < -MAX_DATE || milliseconds > MAX_DATE) {\n // this isn't perfect because because we can still end up out of range because of additional shifting, but it's a start\n return DateTime.invalid(\"Timestamp out of range\");\n } else {\n return new DateTime({\n ts: milliseconds,\n zone: normalizeZone(options.zone, Settings.defaultZone),\n loc: Locale.fromObject(options),\n });\n }\n }\n\n /**\n * Create a DateTime from a number of seconds since the epoch (meaning since 1 January 1970 00:00:00 UTC). Uses the default zone.\n * @param {number} seconds - a number of seconds since 1970 UTC\n * @param {Object} options - configuration options for the DateTime\n * @param {string|Zone} [options.zone='local'] - the zone to place the DateTime into\n * @param {string} [options.locale] - a locale to set on the resulting DateTime instance\n * @param {string} options.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} options.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @return {DateTime}\n */\n static fromSeconds(seconds, options = {}) {\n if (!isNumber(seconds)) {\n throw new InvalidArgumentError(\"fromSeconds requires a numerical input\");\n } else {\n return new DateTime({\n ts: seconds * 1000,\n zone: normalizeZone(options.zone, Settings.defaultZone),\n loc: Locale.fromObject(options),\n });\n }\n }\n\n /**\n * Create a DateTime from a JavaScript object with keys like 'year' and 'hour' with reasonable defaults.\n * @param {Object} obj - the object to create the DateTime from\n * @param {number} obj.year - a year, such as 1987\n * @param {number} obj.month - a month, 1-12\n * @param {number} obj.day - a day of the month, 1-31, depending on the month\n * @param {number} obj.ordinal - day of the year, 1-365 or 366\n * @param {number} obj.weekYear - an ISO week year\n * @param {number} obj.weekNumber - an ISO week number, between 1 and 52 or 53, depending on the year\n * @param {number} obj.weekday - an ISO weekday, 1-7, where 1 is Monday and 7 is Sunday\n * @param {number} obj.hour - hour of the day, 0-23\n * @param {number} obj.minute - minute of the hour, 0-59\n * @param {number} obj.second - second of the minute, 0-59\n * @param {number} obj.millisecond - millisecond of the second, 0-999\n * @param {Object} opts - options for creating this DateTime\n * @param {string|Zone} [opts.zone='local'] - interpret the numbers in the context of a particular zone. Can take any value taken as the first argument to setZone()\n * @param {string} [opts.locale='system's locale'] - a locale to set on the resulting DateTime instance\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} opts.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @example DateTime.fromObject({ year: 1982, month: 5, day: 25}).toISODate() //=> '1982-05-25'\n * @example DateTime.fromObject({ year: 1982 }).toISODate() //=> '1982-01-01'\n * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }) //~> today at 10:26:06\n * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }, { zone: 'utc' }),\n * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }, { zone: 'local' })\n * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }, { zone: 'America/New_York' })\n * @example DateTime.fromObject({ weekYear: 2016, weekNumber: 2, weekday: 3 }).toISODate() //=> '2016-01-13'\n * @return {DateTime}\n */\n static fromObject(obj, opts = {}) {\n obj = obj || {};\n const zoneToUse = normalizeZone(opts.zone, Settings.defaultZone);\n if (!zoneToUse.isValid) {\n return DateTime.invalid(unsupportedZone(zoneToUse));\n }\n\n const tsNow = Settings.now(),\n offsetProvis = !isUndefined(opts.specificOffset)\n ? opts.specificOffset\n : zoneToUse.offset(tsNow),\n normalized = normalizeObject(obj, normalizeUnit),\n containsOrdinal = !isUndefined(normalized.ordinal),\n containsGregorYear = !isUndefined(normalized.year),\n containsGregorMD = !isUndefined(normalized.month) || !isUndefined(normalized.day),\n containsGregor = containsGregorYear || containsGregorMD,\n definiteWeekDef = normalized.weekYear || normalized.weekNumber,\n loc = Locale.fromObject(opts);\n\n // cases:\n // just a weekday -> this week's instance of that weekday, no worries\n // (gregorian data or ordinal) + (weekYear or weekNumber) -> error\n // (gregorian month or day) + ordinal -> error\n // otherwise just use weeks or ordinals or gregorian, depending on what's specified\n\n if ((containsGregor || containsOrdinal) && definiteWeekDef) {\n throw new ConflictingSpecificationError(\n \"Can't mix weekYear/weekNumber units with year/month/day or ordinals\"\n );\n }\n\n if (containsGregorMD && containsOrdinal) {\n throw new ConflictingSpecificationError(\"Can't mix ordinal dates with month/day\");\n }\n\n const useWeekData = definiteWeekDef || (normalized.weekday && !containsGregor);\n\n // configure ourselves to deal with gregorian dates or week stuff\n let units,\n defaultValues,\n objNow = tsToObj(tsNow, offsetProvis);\n if (useWeekData) {\n units = orderedWeekUnits;\n defaultValues = defaultWeekUnitValues;\n objNow = gregorianToWeek(objNow);\n } else if (containsOrdinal) {\n units = orderedOrdinalUnits;\n defaultValues = defaultOrdinalUnitValues;\n objNow = gregorianToOrdinal(objNow);\n } else {\n units = orderedUnits;\n defaultValues = defaultUnitValues;\n }\n\n // set default values for missing stuff\n let foundFirst = false;\n for (const u of units) {\n const v = normalized[u];\n if (!isUndefined(v)) {\n foundFirst = true;\n } else if (foundFirst) {\n normalized[u] = defaultValues[u];\n } else {\n normalized[u] = objNow[u];\n }\n }\n\n // make sure the values we have are in range\n const higherOrderInvalid = useWeekData\n ? hasInvalidWeekData(normalized)\n : containsOrdinal\n ? hasInvalidOrdinalData(normalized)\n : hasInvalidGregorianData(normalized),\n invalid = higherOrderInvalid || hasInvalidTimeData(normalized);\n\n if (invalid) {\n return DateTime.invalid(invalid);\n }\n\n // compute the actual time\n const gregorian = useWeekData\n ? weekToGregorian(normalized)\n : containsOrdinal\n ? ordinalToGregorian(normalized)\n : normalized,\n [tsFinal, offsetFinal] = objToTS(gregorian, offsetProvis, zoneToUse),\n inst = new DateTime({\n ts: tsFinal,\n zone: zoneToUse,\n o: offsetFinal,\n loc,\n });\n\n // gregorian data + weekday serves only to validate\n if (normalized.weekday && containsGregor && obj.weekday !== inst.weekday) {\n return DateTime.invalid(\n \"mismatched weekday\",\n `you can't specify both a weekday of ${normalized.weekday} and a date of ${inst.toISO()}`\n );\n }\n\n return inst;\n }\n\n /**\n * Create a DateTime from an ISO 8601 string\n * @param {string} text - the ISO string\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - use this zone if no offset is specified in the input string itself. Will also convert the time to this zone\n * @param {boolean} [opts.setZone=false] - override the zone with a fixed-offset zone specified in the string itself, if it specifies one\n * @param {string} [opts.locale='system's locale'] - a locale to set on the resulting DateTime instance\n * @param {string} [opts.outputCalendar] - the output calendar to set on the resulting DateTime instance\n * @param {string} [opts.numberingSystem] - the numbering system to set on the resulting DateTime instance\n * @example DateTime.fromISO('2016-05-25T09:08:34.123')\n * @example DateTime.fromISO('2016-05-25T09:08:34.123+06:00')\n * @example DateTime.fromISO('2016-05-25T09:08:34.123+06:00', {setZone: true})\n * @example DateTime.fromISO('2016-05-25T09:08:34.123', {zone: 'utc'})\n * @example DateTime.fromISO('2016-W05-4')\n * @return {DateTime}\n */\n static fromISO(text, opts = {}) {\n const [vals, parsedZone] = parseISODate(text);\n return parseDataToDateTime(vals, parsedZone, opts, \"ISO 8601\", text);\n }\n\n /**\n * Create a DateTime from an RFC 2822 string\n * @param {string} text - the RFC 2822 string\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - convert the time to this zone. Since the offset is always specified in the string itself, this has no effect on the interpretation of string, merely the zone the resulting DateTime is expressed in.\n * @param {boolean} [opts.setZone=false] - override the zone with a fixed-offset zone specified in the string itself, if it specifies one\n * @param {string} [opts.locale='system's locale'] - a locale to set on the resulting DateTime instance\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} opts.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @example DateTime.fromRFC2822('25 Nov 2016 13:23:12 GMT')\n * @example DateTime.fromRFC2822('Fri, 25 Nov 2016 13:23:12 +0600')\n * @example DateTime.fromRFC2822('25 Nov 2016 13:23 Z')\n * @return {DateTime}\n */\n static fromRFC2822(text, opts = {}) {\n const [vals, parsedZone] = parseRFC2822Date(text);\n return parseDataToDateTime(vals, parsedZone, opts, \"RFC 2822\", text);\n }\n\n /**\n * Create a DateTime from an HTTP header date\n * @see https://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1\n * @param {string} text - the HTTP header date\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - convert the time to this zone. Since HTTP dates are always in UTC, this has no effect on the interpretation of string, merely the zone the resulting DateTime is expressed in.\n * @param {boolean} [opts.setZone=false] - override the zone with the fixed-offset zone specified in the string. For HTTP dates, this is always UTC, so this option is equivalent to setting the `zone` option to 'utc', but this option is included for consistency with similar methods.\n * @param {string} [opts.locale='system's locale'] - a locale to set on the resulting DateTime instance\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} opts.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @example DateTime.fromHTTP('Sun, 06 Nov 1994 08:49:37 GMT')\n * @example DateTime.fromHTTP('Sunday, 06-Nov-94 08:49:37 GMT')\n * @example DateTime.fromHTTP('Sun Nov 6 08:49:37 1994')\n * @return {DateTime}\n */\n static fromHTTP(text, opts = {}) {\n const [vals, parsedZone] = parseHTTPDate(text);\n return parseDataToDateTime(vals, parsedZone, opts, \"HTTP\", opts);\n }\n\n /**\n * Create a DateTime from an input string and format string.\n * Defaults to en-US if no locale has been specified, regardless of the system's locale. For a table of tokens and their interpretations, see [here](https://moment.github.io/luxon/#/parsing?id=table-of-tokens).\n * @param {string} text - the string to parse\n * @param {string} fmt - the format the string is expected to be in (see the link below for the formats)\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - use this zone if no offset is specified in the input string itself. Will also convert the DateTime to this zone\n * @param {boolean} [opts.setZone=false] - override the zone with a zone specified in the string itself, if it specifies one\n * @param {string} [opts.locale='en-US'] - a locale string to use when parsing. Will also set the DateTime to this locale\n * @param {string} opts.numberingSystem - the numbering system to use when parsing. Will also set the resulting DateTime to this numbering system\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @return {DateTime}\n */\n static fromFormat(text, fmt, opts = {}) {\n if (isUndefined(text) || isUndefined(fmt)) {\n throw new InvalidArgumentError(\"fromFormat requires an input string and a format\");\n }\n\n const { locale = null, numberingSystem = null } = opts,\n localeToUse = Locale.fromOpts({\n locale,\n numberingSystem,\n defaultToEN: true,\n }),\n [vals, parsedZone, specificOffset, invalid] = parseFromTokens(localeToUse, text, fmt);\n if (invalid) {\n return DateTime.invalid(invalid);\n } else {\n return parseDataToDateTime(vals, parsedZone, opts, `format ${fmt}`, text, specificOffset);\n }\n }\n\n /**\n * @deprecated use fromFormat instead\n */\n static fromString(text, fmt, opts = {}) {\n return DateTime.fromFormat(text, fmt, opts);\n }\n\n /**\n * Create a DateTime from a SQL date, time, or datetime\n * Defaults to en-US if no locale has been specified, regardless of the system's locale\n * @param {string} text - the string to parse\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - use this zone if no offset is specified in the input string itself. Will also convert the DateTime to this zone\n * @param {boolean} [opts.setZone=false] - override the zone with a zone specified in the string itself, if it specifies one\n * @param {string} [opts.locale='en-US'] - a locale string to use when parsing. Will also set the DateTime to this locale\n * @param {string} opts.numberingSystem - the numbering system to use when parsing. Will also set the resulting DateTime to this numbering system\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @example DateTime.fromSQL('2017-05-15')\n * @example DateTime.fromSQL('2017-05-15 09:12:34')\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342')\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342+06:00')\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342 America/Los_Angeles')\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342 America/Los_Angeles', { setZone: true })\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342', { zone: 'America/Los_Angeles' })\n * @example DateTime.fromSQL('09:12:34.342')\n * @return {DateTime}\n */\n static fromSQL(text, opts = {}) {\n const [vals, parsedZone] = parseSQL(text);\n return parseDataToDateTime(vals, parsedZone, opts, \"SQL\", text);\n }\n\n /**\n * Create an invalid DateTime.\n * @param {DateTime} reason - simple string of why this DateTime is invalid. Should not contain parameters or anything else data-dependent\n * @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information\n * @return {DateTime}\n */\n static invalid(reason, explanation = null) {\n if (!reason) {\n throw new InvalidArgumentError(\"need to specify a reason the DateTime is invalid\");\n }\n\n const invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation);\n\n if (Settings.throwOnInvalid) {\n throw new InvalidDateTimeError(invalid);\n } else {\n return new DateTime({ invalid });\n }\n }\n\n /**\n * Check if an object is an instance of DateTime. Works across context boundaries\n * @param {object} o\n * @return {boolean}\n */\n static isDateTime(o) {\n return (o && o.isLuxonDateTime) || false;\n }\n\n /**\n * Produce the format string for a set of options\n * @param formatOpts\n * @param localeOpts\n * @returns {string}\n */\n static parseFormatForOpts(formatOpts, localeOpts = {}) {\n const tokenList = formatOptsToTokens(formatOpts, Locale.fromObject(localeOpts));\n return !tokenList ? null : tokenList.map((t) => (t ? t.val : null)).join(\"\");\n }\n\n /**\n * Produce the the fully expanded format token for the locale\n * Does NOT quote characters, so quoted tokens will not round trip correctly\n * @param fmt\n * @param localeOpts\n * @returns {string}\n */\n static expandFormat(fmt, localeOpts = {}) {\n const expanded = expandMacroTokens(Formatter.parseFormat(fmt), Locale.fromObject(localeOpts));\n return expanded.map((t) => t.val).join(\"\");\n }\n\n // INFO\n\n /**\n * Get the value of unit.\n * @param {string} unit - a unit such as 'minute' or 'day'\n * @example DateTime.local(2017, 7, 4).get('month'); //=> 7\n * @example DateTime.local(2017, 7, 4).get('day'); //=> 4\n * @return {number}\n */\n get(unit) {\n return this[unit];\n }\n\n /**\n * Returns whether the DateTime is valid. Invalid DateTimes occur when:\n * * The DateTime was created from invalid calendar information, such as the 13th month or February 30\n * * The DateTime was created by an operation on another invalid date\n * @type {boolean}\n */\n get isValid() {\n return this.invalid === null;\n }\n\n /**\n * Returns an error code if this DateTime is invalid, or null if the DateTime is valid\n * @type {string}\n */\n get invalidReason() {\n return this.invalid ? this.invalid.reason : null;\n }\n\n /**\n * Returns an explanation of why this DateTime became invalid, or null if the DateTime is valid\n * @type {string}\n */\n get invalidExplanation() {\n return this.invalid ? this.invalid.explanation : null;\n }\n\n /**\n * Get the locale of a DateTime, such 'en-GB'. The locale is used when formatting the DateTime\n *\n * @type {string}\n */\n get locale() {\n return this.isValid ? this.loc.locale : null;\n }\n\n /**\n * Get the numbering system of a DateTime, such 'beng'. The numbering system is used when formatting the DateTime\n *\n * @type {string}\n */\n get numberingSystem() {\n return this.isValid ? this.loc.numberingSystem : null;\n }\n\n /**\n * Get the output calendar of a DateTime, such 'islamic'. The output calendar is used when formatting the DateTime\n *\n * @type {string}\n */\n get outputCalendar() {\n return this.isValid ? this.loc.outputCalendar : null;\n }\n\n /**\n * Get the time zone associated with this DateTime.\n * @type {Zone}\n */\n get zone() {\n return this._zone;\n }\n\n /**\n * Get the name of the time zone.\n * @type {string}\n */\n get zoneName() {\n return this.isValid ? this.zone.name : null;\n }\n\n /**\n * Get the year\n * @example DateTime.local(2017, 5, 25).year //=> 2017\n * @type {number}\n */\n get year() {\n return this.isValid ? this.c.year : NaN;\n }\n\n /**\n * Get the quarter\n * @example DateTime.local(2017, 5, 25).quarter //=> 2\n * @type {number}\n */\n get quarter() {\n return this.isValid ? Math.ceil(this.c.month / 3) : NaN;\n }\n\n /**\n * Get the month (1-12).\n * @example DateTime.local(2017, 5, 25).month //=> 5\n * @type {number}\n */\n get month() {\n return this.isValid ? this.c.month : NaN;\n }\n\n /**\n * Get the day of the month (1-30ish).\n * @example DateTime.local(2017, 5, 25).day //=> 25\n * @type {number}\n */\n get day() {\n return this.isValid ? this.c.day : NaN;\n }\n\n /**\n * Get the hour of the day (0-23).\n * @example DateTime.local(2017, 5, 25, 9).hour //=> 9\n * @type {number}\n */\n get hour() {\n return this.isValid ? this.c.hour : NaN;\n }\n\n /**\n * Get the minute of the hour (0-59).\n * @example DateTime.local(2017, 5, 25, 9, 30).minute //=> 30\n * @type {number}\n */\n get minute() {\n return this.isValid ? this.c.minute : NaN;\n }\n\n /**\n * Get the second of the minute (0-59).\n * @example DateTime.local(2017, 5, 25, 9, 30, 52).second //=> 52\n * @type {number}\n */\n get second() {\n return this.isValid ? this.c.second : NaN;\n }\n\n /**\n * Get the millisecond of the second (0-999).\n * @example DateTime.local(2017, 5, 25, 9, 30, 52, 654).millisecond //=> 654\n * @type {number}\n */\n get millisecond() {\n return this.isValid ? this.c.millisecond : NaN;\n }\n\n /**\n * Get the week year\n * @see https://en.wikipedia.org/wiki/ISO_week_date\n * @example DateTime.local(2014, 12, 31).weekYear //=> 2015\n * @type {number}\n */\n get weekYear() {\n return this.isValid ? possiblyCachedWeekData(this).weekYear : NaN;\n }\n\n /**\n * Get the week number of the week year (1-52ish).\n * @see https://en.wikipedia.org/wiki/ISO_week_date\n * @example DateTime.local(2017, 5, 25).weekNumber //=> 21\n * @type {number}\n */\n get weekNumber() {\n return this.isValid ? possiblyCachedWeekData(this).weekNumber : NaN;\n }\n\n /**\n * Get the day of the week.\n * 1 is Monday and 7 is Sunday\n * @see https://en.wikipedia.org/wiki/ISO_week_date\n * @example DateTime.local(2014, 11, 31).weekday //=> 4\n * @type {number}\n */\n get weekday() {\n return this.isValid ? possiblyCachedWeekData(this).weekday : NaN;\n }\n\n /**\n * Get the ordinal (meaning the day of the year)\n * @example DateTime.local(2017, 5, 25).ordinal //=> 145\n * @type {number|DateTime}\n */\n get ordinal() {\n return this.isValid ? gregorianToOrdinal(this.c).ordinal : NaN;\n }\n\n /**\n * Get the human readable short month name, such as 'Oct'.\n * Defaults to the system's locale if no locale has been specified\n * @example DateTime.local(2017, 10, 30).monthShort //=> Oct\n * @type {string}\n */\n get monthShort() {\n return this.isValid ? Info.months(\"short\", { locObj: this.loc })[this.month - 1] : null;\n }\n\n /**\n * Get the human readable long month name, such as 'October'.\n * Defaults to the system's locale if no locale has been specified\n * @example DateTime.local(2017, 10, 30).monthLong //=> October\n * @type {string}\n */\n get monthLong() {\n return this.isValid ? Info.months(\"long\", { locObj: this.loc })[this.month - 1] : null;\n }\n\n /**\n * Get the human readable short weekday, such as 'Mon'.\n * Defaults to the system's locale if no locale has been specified\n * @example DateTime.local(2017, 10, 30).weekdayShort //=> Mon\n * @type {string}\n */\n get weekdayShort() {\n return this.isValid ? Info.weekdays(\"short\", { locObj: this.loc })[this.weekday - 1] : null;\n }\n\n /**\n * Get the human readable long weekday, such as 'Monday'.\n * Defaults to the system's locale if no locale has been specified\n * @example DateTime.local(2017, 10, 30).weekdayLong //=> Monday\n * @type {string}\n */\n get weekdayLong() {\n return this.isValid ? Info.weekdays(\"long\", { locObj: this.loc })[this.weekday - 1] : null;\n }\n\n /**\n * Get the UTC offset of this DateTime in minutes\n * @example DateTime.now().offset //=> -240\n * @example DateTime.utc().offset //=> 0\n * @type {number}\n */\n get offset() {\n return this.isValid ? +this.o : NaN;\n }\n\n /**\n * Get the short human name for the zone's current offset, for example \"EST\" or \"EDT\".\n * Defaults to the system's locale if no locale has been specified\n * @type {string}\n */\n get offsetNameShort() {\n if (this.isValid) {\n return this.zone.offsetName(this.ts, {\n format: \"short\",\n locale: this.locale,\n });\n } else {\n return null;\n }\n }\n\n /**\n * Get the long human name for the zone's current offset, for example \"Eastern Standard Time\" or \"Eastern Daylight Time\".\n * Defaults to the system's locale if no locale has been specified\n * @type {string}\n */\n get offsetNameLong() {\n if (this.isValid) {\n return this.zone.offsetName(this.ts, {\n format: \"long\",\n locale: this.locale,\n });\n } else {\n return null;\n }\n }\n\n /**\n * Get whether this zone's offset ever changes, as in a DST.\n * @type {boolean}\n */\n get isOffsetFixed() {\n return this.isValid ? this.zone.isUniversal : null;\n }\n\n /**\n * Get whether the DateTime is in a DST.\n * @type {boolean}\n */\n get isInDST() {\n if (this.isOffsetFixed) {\n return false;\n } else {\n return (\n this.offset > this.set({ month: 1, day: 1 }).offset ||\n this.offset > this.set({ month: 5 }).offset\n );\n }\n }\n\n /**\n * Returns true if this DateTime is in a leap year, false otherwise\n * @example DateTime.local(2016).isInLeapYear //=> true\n * @example DateTime.local(2013).isInLeapYear //=> false\n * @type {boolean}\n */\n get isInLeapYear() {\n return isLeapYear(this.year);\n }\n\n /**\n * Returns the number of days in this DateTime's month\n * @example DateTime.local(2016, 2).daysInMonth //=> 29\n * @example DateTime.local(2016, 3).daysInMonth //=> 31\n * @type {number}\n */\n get daysInMonth() {\n return daysInMonth(this.year, this.month);\n }\n\n /**\n * Returns the number of days in this DateTime's year\n * @example DateTime.local(2016).daysInYear //=> 366\n * @example DateTime.local(2013).daysInYear //=> 365\n * @type {number}\n */\n get daysInYear() {\n return this.isValid ? daysInYear(this.year) : NaN;\n }\n\n /**\n * Returns the number of weeks in this DateTime's year\n * @see https://en.wikipedia.org/wiki/ISO_week_date\n * @example DateTime.local(2004).weeksInWeekYear //=> 53\n * @example DateTime.local(2013).weeksInWeekYear //=> 52\n * @type {number}\n */\n get weeksInWeekYear() {\n return this.isValid ? weeksInWeekYear(this.weekYear) : NaN;\n }\n\n /**\n * Returns the resolved Intl options for this DateTime.\n * This is useful in understanding the behavior of formatting methods\n * @param {Object} opts - the same options as toLocaleString\n * @return {Object}\n */\n resolvedLocaleOptions(opts = {}) {\n const { locale, numberingSystem, calendar } = Formatter.create(\n this.loc.clone(opts),\n opts\n ).resolvedOptions(this);\n return { locale, numberingSystem, outputCalendar: calendar };\n }\n\n // TRANSFORM\n\n /**\n * \"Set\" the DateTime's zone to UTC. Returns a newly-constructed DateTime.\n *\n * Equivalent to {@link DateTime#setZone}('utc')\n * @param {number} [offset=0] - optionally, an offset from UTC in minutes\n * @param {Object} [opts={}] - options to pass to `setZone()`\n * @return {DateTime}\n */\n toUTC(offset = 0, opts = {}) {\n return this.setZone(FixedOffsetZone.instance(offset), opts);\n }\n\n /**\n * \"Set\" the DateTime's zone to the host's local zone. Returns a newly-constructed DateTime.\n *\n * Equivalent to `setZone('local')`\n * @return {DateTime}\n */\n toLocal() {\n return this.setZone(Settings.defaultZone);\n }\n\n /**\n * \"Set\" the DateTime's zone to specified zone. Returns a newly-constructed DateTime.\n *\n * By default, the setter keeps the underlying time the same (as in, the same timestamp), but the new instance will report different local times and consider DSTs when making computations, as with {@link DateTime#plus}. You may wish to use {@link DateTime#toLocal} and {@link DateTime#toUTC} which provide simple convenience wrappers for commonly used zones.\n * @param {string|Zone} [zone='local'] - a zone identifier. As a string, that can be any IANA zone supported by the host environment, or a fixed-offset name of the form 'UTC+3', or the strings 'local' or 'utc'. You may also supply an instance of a {@link DateTime#Zone} class.\n * @param {Object} opts - options\n * @param {boolean} [opts.keepLocalTime=false] - If true, adjust the underlying time so that the local time stays the same, but in the target zone. You should rarely need this.\n * @return {DateTime}\n */\n setZone(zone, { keepLocalTime = false, keepCalendarTime = false } = {}) {\n zone = normalizeZone(zone, Settings.defaultZone);\n if (zone.equals(this.zone)) {\n return this;\n } else if (!zone.isValid) {\n return DateTime.invalid(unsupportedZone(zone));\n } else {\n let newTS = this.ts;\n if (keepLocalTime || keepCalendarTime) {\n const offsetGuess = zone.offset(this.ts);\n const asObj = this.toObject();\n [newTS] = objToTS(asObj, offsetGuess, zone);\n }\n return clone(this, { ts: newTS, zone });\n }\n }\n\n /**\n * \"Set\" the locale, numberingSystem, or outputCalendar. Returns a newly-constructed DateTime.\n * @param {Object} properties - the properties to set\n * @example DateTime.local(2017, 5, 25).reconfigure({ locale: 'en-GB' })\n * @return {DateTime}\n */\n reconfigure({ locale, numberingSystem, outputCalendar } = {}) {\n const loc = this.loc.clone({ locale, numberingSystem, outputCalendar });\n return clone(this, { loc });\n }\n\n /**\n * \"Set\" the locale. Returns a newly-constructed DateTime.\n * Just a convenient alias for reconfigure({ locale })\n * @example DateTime.local(2017, 5, 25).setLocale('en-GB')\n * @return {DateTime}\n */\n setLocale(locale) {\n return this.reconfigure({ locale });\n }\n\n /**\n * \"Set\" the values of specified units. Returns a newly-constructed DateTime.\n * You can only set units with this method; for \"setting\" metadata, see {@link DateTime#reconfigure} and {@link DateTime#setZone}.\n * @param {Object} values - a mapping of units to numbers\n * @example dt.set({ year: 2017 })\n * @example dt.set({ hour: 8, minute: 30 })\n * @example dt.set({ weekday: 5 })\n * @example dt.set({ year: 2005, ordinal: 234 })\n * @return {DateTime}\n */\n set(values) {\n if (!this.isValid) return this;\n\n const normalized = normalizeObject(values, normalizeUnit),\n settingWeekStuff =\n !isUndefined(normalized.weekYear) ||\n !isUndefined(normalized.weekNumber) ||\n !isUndefined(normalized.weekday),\n containsOrdinal = !isUndefined(normalized.ordinal),\n containsGregorYear = !isUndefined(normalized.year),\n containsGregorMD = !isUndefined(normalized.month) || !isUndefined(normalized.day),\n containsGregor = containsGregorYear || containsGregorMD,\n definiteWeekDef = normalized.weekYear || normalized.weekNumber;\n\n if ((containsGregor || containsOrdinal) && definiteWeekDef) {\n throw new ConflictingSpecificationError(\n \"Can't mix weekYear/weekNumber units with year/month/day or ordinals\"\n );\n }\n\n if (containsGregorMD && containsOrdinal) {\n throw new ConflictingSpecificationError(\"Can't mix ordinal dates with month/day\");\n }\n\n let mixed;\n if (settingWeekStuff) {\n mixed = weekToGregorian({ ...gregorianToWeek(this.c), ...normalized });\n } else if (!isUndefined(normalized.ordinal)) {\n mixed = ordinalToGregorian({ ...gregorianToOrdinal(this.c), ...normalized });\n } else {\n mixed = { ...this.toObject(), ...normalized };\n\n // if we didn't set the day but we ended up on an overflow date,\n // use the last day of the right month\n if (isUndefined(normalized.day)) {\n mixed.day = Math.min(daysInMonth(mixed.year, mixed.month), mixed.day);\n }\n }\n\n const [ts, o] = objToTS(mixed, this.o, this.zone);\n return clone(this, { ts, o });\n }\n\n /**\n * Add a period of time to this DateTime and return the resulting DateTime\n *\n * Adding hours, minutes, seconds, or milliseconds increases the timestamp by the right number of milliseconds. Adding days, months, or years shifts the calendar, accounting for DSTs and leap years along the way. Thus, `dt.plus({ hours: 24 })` may result in a different time than `dt.plus({ days: 1 })` if there's a DST shift in between.\n * @param {Duration|Object|number} duration - The amount to add. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject()\n * @example DateTime.now().plus(123) //~> in 123 milliseconds\n * @example DateTime.now().plus({ minutes: 15 }) //~> in 15 minutes\n * @example DateTime.now().plus({ days: 1 }) //~> this time tomorrow\n * @example DateTime.now().plus({ days: -1 }) //~> this time yesterday\n * @example DateTime.now().plus({ hours: 3, minutes: 13 }) //~> in 3 hr, 13 min\n * @example DateTime.now().plus(Duration.fromObject({ hours: 3, minutes: 13 })) //~> in 3 hr, 13 min\n * @return {DateTime}\n */\n plus(duration) {\n if (!this.isValid) return this;\n const dur = Duration.fromDurationLike(duration);\n return clone(this, adjustTime(this, dur));\n }\n\n /**\n * Subtract a period of time to this DateTime and return the resulting DateTime\n * See {@link DateTime#plus}\n * @param {Duration|Object|number} duration - The amount to subtract. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject()\n @return {DateTime}\n */\n minus(duration) {\n if (!this.isValid) return this;\n const dur = Duration.fromDurationLike(duration).negate();\n return clone(this, adjustTime(this, dur));\n }\n\n /**\n * \"Set\" this DateTime to the beginning of a unit of time.\n * @param {string} unit - The unit to go to the beginning of. Can be 'year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second', or 'millisecond'.\n * @example DateTime.local(2014, 3, 3).startOf('month').toISODate(); //=> '2014-03-01'\n * @example DateTime.local(2014, 3, 3).startOf('year').toISODate(); //=> '2014-01-01'\n * @example DateTime.local(2014, 3, 3).startOf('week').toISODate(); //=> '2014-03-03', weeks always start on Mondays\n * @example DateTime.local(2014, 3, 3, 5, 30).startOf('day').toISOTime(); //=> '00:00.000-05:00'\n * @example DateTime.local(2014, 3, 3, 5, 30).startOf('hour').toISOTime(); //=> '05:00:00.000-05:00'\n * @return {DateTime}\n */\n startOf(unit) {\n if (!this.isValid) return this;\n const o = {},\n normalizedUnit = Duration.normalizeUnit(unit);\n switch (normalizedUnit) {\n case \"years\":\n o.month = 1;\n // falls through\n case \"quarters\":\n case \"months\":\n o.day = 1;\n // falls through\n case \"weeks\":\n case \"days\":\n o.hour = 0;\n // falls through\n case \"hours\":\n o.minute = 0;\n // falls through\n case \"minutes\":\n o.second = 0;\n // falls through\n case \"seconds\":\n o.millisecond = 0;\n break;\n // no default, invalid units throw in normalizeUnit()\n }\n\n if (normalizedUnit === \"weeks\") {\n o.weekday = 1;\n }\n\n if (normalizedUnit === \"quarters\") {\n const q = Math.ceil(this.month / 3);\n o.month = (q - 1) * 3 + 1;\n }\n\n return this.set(o);\n }\n\n /**\n * \"Set\" this DateTime to the end (meaning the last millisecond) of a unit of time\n * @param {string} unit - The unit to go to the end of. Can be 'year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second', or 'millisecond'.\n * @example DateTime.local(2014, 3, 3).endOf('month').toISO(); //=> '2014-03-31T23:59:59.999-05:00'\n * @example DateTime.local(2014, 3, 3).endOf('year').toISO(); //=> '2014-12-31T23:59:59.999-05:00'\n * @example DateTime.local(2014, 3, 3).endOf('week').toISO(); // => '2014-03-09T23:59:59.999-05:00', weeks start on Mondays\n * @example DateTime.local(2014, 3, 3, 5, 30).endOf('day').toISO(); //=> '2014-03-03T23:59:59.999-05:00'\n * @example DateTime.local(2014, 3, 3, 5, 30).endOf('hour').toISO(); //=> '2014-03-03T05:59:59.999-05:00'\n * @return {DateTime}\n */\n endOf(unit) {\n return this.isValid\n ? this.plus({ [unit]: 1 })\n .startOf(unit)\n .minus(1)\n : this;\n }\n\n // OUTPUT\n\n /**\n * Returns a string representation of this DateTime formatted according to the specified format string.\n * **You may not want this.** See {@link DateTime#toLocaleString} for a more flexible formatting tool. For a table of tokens and their interpretations, see [here](https://moment.github.io/luxon/#/formatting?id=table-of-tokens).\n * Defaults to en-US if no locale has been specified, regardless of the system's locale.\n * @param {string} fmt - the format string\n * @param {Object} opts - opts to override the configuration options on this DateTime\n * @example DateTime.now().toFormat('yyyy LLL dd') //=> '2017 Apr 22'\n * @example DateTime.now().setLocale('fr').toFormat('yyyy LLL dd') //=> '2017 avr. 22'\n * @example DateTime.now().toFormat('yyyy LLL dd', { locale: \"fr\" }) //=> '2017 avr. 22'\n * @example DateTime.now().toFormat(\"HH 'hours and' mm 'minutes'\") //=> '20 hours and 55 minutes'\n * @return {string}\n */\n toFormat(fmt, opts = {}) {\n return this.isValid\n ? Formatter.create(this.loc.redefaultToEN(opts)).formatDateTimeFromString(this, fmt)\n : INVALID;\n }\n\n /**\n * Returns a localized string representing this date. Accepts the same options as the Intl.DateTimeFormat constructor and any presets defined by Luxon, such as `DateTime.DATE_FULL` or `DateTime.TIME_SIMPLE`.\n * The exact behavior of this method is browser-specific, but in general it will return an appropriate representation\n * of the DateTime in the assigned locale.\n * Defaults to the system's locale if no locale has been specified\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat\n * @param formatOpts {Object} - Intl.DateTimeFormat constructor options and configuration options\n * @param {Object} opts - opts to override the configuration options on this DateTime\n * @example DateTime.now().toLocaleString(); //=> 4/20/2017\n * @example DateTime.now().setLocale('en-gb').toLocaleString(); //=> '20/04/2017'\n * @example DateTime.now().toLocaleString(DateTime.DATE_FULL); //=> 'April 20, 2017'\n * @example DateTime.now().toLocaleString(DateTime.DATE_FULL, { locale: 'fr' }); //=> '28 août 2022'\n * @example DateTime.now().toLocaleString(DateTime.TIME_SIMPLE); //=> '11:32 AM'\n * @example DateTime.now().toLocaleString(DateTime.DATETIME_SHORT); //=> '4/20/2017, 11:32 AM'\n * @example DateTime.now().toLocaleString({ weekday: 'long', month: 'long', day: '2-digit' }); //=> 'Thursday, April 20'\n * @example DateTime.now().toLocaleString({ weekday: 'short', month: 'short', day: '2-digit', hour: '2-digit', minute: '2-digit' }); //=> 'Thu, Apr 20, 11:27 AM'\n * @example DateTime.now().toLocaleString({ hour: '2-digit', minute: '2-digit', hourCycle: 'h23' }); //=> '11:32'\n * @return {string}\n */\n toLocaleString(formatOpts = DATE_SHORT, opts = {}) {\n return this.isValid\n ? Formatter.create(this.loc.clone(opts), formatOpts).formatDateTime(this)\n : INVALID;\n }\n\n /**\n * Returns an array of format \"parts\", meaning individual tokens along with metadata. This is allows callers to post-process individual sections of the formatted output.\n * Defaults to the system's locale if no locale has been specified\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat/formatToParts\n * @param opts {Object} - Intl.DateTimeFormat constructor options, same as `toLocaleString`.\n * @example DateTime.now().toLocaleParts(); //=> [\n * //=> { type: 'day', value: '25' },\n * //=> { type: 'literal', value: '/' },\n * //=> { type: 'month', value: '05' },\n * //=> { type: 'literal', value: '/' },\n * //=> { type: 'year', value: '1982' }\n * //=> ]\n */\n toLocaleParts(opts = {}) {\n return this.isValid\n ? Formatter.create(this.loc.clone(opts), opts).formatDateTimeParts(this)\n : [];\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this DateTime\n * @param {Object} opts - options\n * @param {boolean} [opts.suppressMilliseconds=false] - exclude milliseconds from the format if they're 0\n * @param {boolean} [opts.suppressSeconds=false] - exclude seconds from the format if they're 0\n * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00'\n * @param {boolean} [opts.extendedZone=false] - add the time zone format extension\n * @param {string} [opts.format='extended'] - choose between the basic and extended format\n * @example DateTime.utc(1983, 5, 25).toISO() //=> '1982-05-25T00:00:00.000Z'\n * @example DateTime.now().toISO() //=> '2017-04-22T20:47:05.335-04:00'\n * @example DateTime.now().toISO({ includeOffset: false }) //=> '2017-04-22T20:47:05.335'\n * @example DateTime.now().toISO({ format: 'basic' }) //=> '20170422T204705.335-0400'\n * @return {string}\n */\n toISO({\n format = \"extended\",\n suppressSeconds = false,\n suppressMilliseconds = false,\n includeOffset = true,\n extendedZone = false,\n } = {}) {\n if (!this.isValid) {\n return null;\n }\n\n const ext = format === \"extended\";\n\n let c = toISODate(this, ext);\n c += \"T\";\n c += toISOTime(this, ext, suppressSeconds, suppressMilliseconds, includeOffset, extendedZone);\n return c;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this DateTime's date component\n * @param {Object} opts - options\n * @param {string} [opts.format='extended'] - choose between the basic and extended format\n * @example DateTime.utc(1982, 5, 25).toISODate() //=> '1982-05-25'\n * @example DateTime.utc(1982, 5, 25).toISODate({ format: 'basic' }) //=> '19820525'\n * @return {string}\n */\n toISODate({ format = \"extended\" } = {}) {\n if (!this.isValid) {\n return null;\n }\n\n return toISODate(this, format === \"extended\");\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this DateTime's week date\n * @example DateTime.utc(1982, 5, 25).toISOWeekDate() //=> '1982-W21-2'\n * @return {string}\n */\n toISOWeekDate() {\n return toTechFormat(this, \"kkkk-'W'WW-c\");\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this DateTime's time component\n * @param {Object} opts - options\n * @param {boolean} [opts.suppressMilliseconds=false] - exclude milliseconds from the format if they're 0\n * @param {boolean} [opts.suppressSeconds=false] - exclude seconds from the format if they're 0\n * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00'\n * @param {boolean} [opts.extendedZone=true] - add the time zone format extension\n * @param {boolean} [opts.includePrefix=false] - include the `T` prefix\n * @param {string} [opts.format='extended'] - choose between the basic and extended format\n * @example DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime() //=> '07:34:19.361Z'\n * @example DateTime.utc().set({ hour: 7, minute: 34, seconds: 0, milliseconds: 0 }).toISOTime({ suppressSeconds: true }) //=> '07:34Z'\n * @example DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime({ format: 'basic' }) //=> '073419.361Z'\n * @example DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime({ includePrefix: true }) //=> 'T07:34:19.361Z'\n * @return {string}\n */\n toISOTime({\n suppressMilliseconds = false,\n suppressSeconds = false,\n includeOffset = true,\n includePrefix = false,\n extendedZone = false,\n format = \"extended\",\n } = {}) {\n if (!this.isValid) {\n return null;\n }\n\n let c = includePrefix ? \"T\" : \"\";\n return (\n c +\n toISOTime(\n this,\n format === \"extended\",\n suppressSeconds,\n suppressMilliseconds,\n includeOffset,\n extendedZone\n )\n );\n }\n\n /**\n * Returns an RFC 2822-compatible string representation of this DateTime\n * @example DateTime.utc(2014, 7, 13).toRFC2822() //=> 'Sun, 13 Jul 2014 00:00:00 +0000'\n * @example DateTime.local(2014, 7, 13).toRFC2822() //=> 'Sun, 13 Jul 2014 00:00:00 -0400'\n * @return {string}\n */\n toRFC2822() {\n return toTechFormat(this, \"EEE, dd LLL yyyy HH:mm:ss ZZZ\", false);\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for use in HTTP headers. The output is always expressed in GMT.\n * Specifically, the string conforms to RFC 1123.\n * @see https://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1\n * @example DateTime.utc(2014, 7, 13).toHTTP() //=> 'Sun, 13 Jul 2014 00:00:00 GMT'\n * @example DateTime.utc(2014, 7, 13, 19).toHTTP() //=> 'Sun, 13 Jul 2014 19:00:00 GMT'\n * @return {string}\n */\n toHTTP() {\n return toTechFormat(this.toUTC(), \"EEE, dd LLL yyyy HH:mm:ss 'GMT'\");\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for use in SQL Date\n * @example DateTime.utc(2014, 7, 13).toSQLDate() //=> '2014-07-13'\n * @return {string}\n */\n toSQLDate() {\n if (!this.isValid) {\n return null;\n }\n return toISODate(this, true);\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for use in SQL Time\n * @param {Object} opts - options\n * @param {boolean} [opts.includeZone=false] - include the zone, such as 'America/New_York'. Overrides includeOffset.\n * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00'\n * @param {boolean} [opts.includeOffsetSpace=true] - include the space between the time and the offset, such as '05:15:16.345 -04:00'\n * @example DateTime.utc().toSQL() //=> '05:15:16.345'\n * @example DateTime.now().toSQL() //=> '05:15:16.345 -04:00'\n * @example DateTime.now().toSQL({ includeOffset: false }) //=> '05:15:16.345'\n * @example DateTime.now().toSQL({ includeZone: false }) //=> '05:15:16.345 America/New_York'\n * @return {string}\n */\n toSQLTime({ includeOffset = true, includeZone = false, includeOffsetSpace = true } = {}) {\n let fmt = \"HH:mm:ss.SSS\";\n\n if (includeZone || includeOffset) {\n if (includeOffsetSpace) {\n fmt += \" \";\n }\n if (includeZone) {\n fmt += \"z\";\n } else if (includeOffset) {\n fmt += \"ZZ\";\n }\n }\n\n return toTechFormat(this, fmt, true);\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for use in SQL DateTime\n * @param {Object} opts - options\n * @param {boolean} [opts.includeZone=false] - include the zone, such as 'America/New_York'. Overrides includeOffset.\n * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00'\n * @param {boolean} [opts.includeOffsetSpace=true] - include the space between the time and the offset, such as '05:15:16.345 -04:00'\n * @example DateTime.utc(2014, 7, 13).toSQL() //=> '2014-07-13 00:00:00.000 Z'\n * @example DateTime.local(2014, 7, 13).toSQL() //=> '2014-07-13 00:00:00.000 -04:00'\n * @example DateTime.local(2014, 7, 13).toSQL({ includeOffset: false }) //=> '2014-07-13 00:00:00.000'\n * @example DateTime.local(2014, 7, 13).toSQL({ includeZone: true }) //=> '2014-07-13 00:00:00.000 America/New_York'\n * @return {string}\n */\n toSQL(opts = {}) {\n if (!this.isValid) {\n return null;\n }\n\n return `${this.toSQLDate()} ${this.toSQLTime(opts)}`;\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for debugging\n * @return {string}\n */\n toString() {\n return this.isValid ? this.toISO() : INVALID;\n }\n\n /**\n * Returns the epoch milliseconds of this DateTime. Alias of {@link DateTime#toMillis}\n * @return {number}\n */\n valueOf() {\n return this.toMillis();\n }\n\n /**\n * Returns the epoch milliseconds of this DateTime.\n * @return {number}\n */\n toMillis() {\n return this.isValid ? this.ts : NaN;\n }\n\n /**\n * Returns the epoch seconds of this DateTime.\n * @return {number}\n */\n toSeconds() {\n return this.isValid ? this.ts / 1000 : NaN;\n }\n\n /**\n * Returns the epoch seconds (as a whole number) of this DateTime.\n * @return {number}\n */\n toUnixInteger() {\n return this.isValid ? Math.floor(this.ts / 1000) : NaN;\n }\n\n /**\n * Returns an ISO 8601 representation of this DateTime appropriate for use in JSON.\n * @return {string}\n */\n toJSON() {\n return this.toISO();\n }\n\n /**\n * Returns a BSON serializable equivalent to this DateTime.\n * @return {Date}\n */\n toBSON() {\n return this.toJSDate();\n }\n\n /**\n * Returns a JavaScript object with this DateTime's year, month, day, and so on.\n * @param opts - options for generating the object\n * @param {boolean} [opts.includeConfig=false] - include configuration attributes in the output\n * @example DateTime.now().toObject() //=> { year: 2017, month: 4, day: 22, hour: 20, minute: 49, second: 42, millisecond: 268 }\n * @return {Object}\n */\n toObject(opts = {}) {\n if (!this.isValid) return {};\n\n const base = { ...this.c };\n\n if (opts.includeConfig) {\n base.outputCalendar = this.outputCalendar;\n base.numberingSystem = this.loc.numberingSystem;\n base.locale = this.loc.locale;\n }\n return base;\n }\n\n /**\n * Returns a JavaScript Date equivalent to this DateTime.\n * @return {Date}\n */\n toJSDate() {\n return new Date(this.isValid ? this.ts : NaN);\n }\n\n // COMPARE\n\n /**\n * Return the difference between two DateTimes as a Duration.\n * @param {DateTime} otherDateTime - the DateTime to compare this one to\n * @param {string|string[]} [unit=['milliseconds']] - the unit or array of units (such as 'hours' or 'days') to include in the duration.\n * @param {Object} opts - options that affect the creation of the Duration\n * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use\n * @example\n * var i1 = DateTime.fromISO('1982-05-25T09:45'),\n * i2 = DateTime.fromISO('1983-10-14T10:30');\n * i2.diff(i1).toObject() //=> { milliseconds: 43807500000 }\n * i2.diff(i1, 'hours').toObject() //=> { hours: 12168.75 }\n * i2.diff(i1, ['months', 'days']).toObject() //=> { months: 16, days: 19.03125 }\n * i2.diff(i1, ['months', 'days', 'hours']).toObject() //=> { months: 16, days: 19, hours: 0.75 }\n * @return {Duration}\n */\n diff(otherDateTime, unit = \"milliseconds\", opts = {}) {\n if (!this.isValid || !otherDateTime.isValid) {\n return Duration.invalid(\"created by diffing an invalid DateTime\");\n }\n\n const durOpts = { locale: this.locale, numberingSystem: this.numberingSystem, ...opts };\n\n const units = maybeArray(unit).map(Duration.normalizeUnit),\n otherIsLater = otherDateTime.valueOf() > this.valueOf(),\n earlier = otherIsLater ? this : otherDateTime,\n later = otherIsLater ? otherDateTime : this,\n diffed = diff(earlier, later, units, durOpts);\n\n return otherIsLater ? diffed.negate() : diffed;\n }\n\n /**\n * Return the difference between this DateTime and right now.\n * See {@link DateTime#diff}\n * @param {string|string[]} [unit=['milliseconds']] - the unit or units units (such as 'hours' or 'days') to include in the duration\n * @param {Object} opts - options that affect the creation of the Duration\n * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use\n * @return {Duration}\n */\n diffNow(unit = \"milliseconds\", opts = {}) {\n return this.diff(DateTime.now(), unit, opts);\n }\n\n /**\n * Return an Interval spanning between this DateTime and another DateTime\n * @param {DateTime} otherDateTime - the other end point of the Interval\n * @return {Interval}\n */\n until(otherDateTime) {\n return this.isValid ? Interval.fromDateTimes(this, otherDateTime) : this;\n }\n\n /**\n * Return whether this DateTime is in the same unit of time as another DateTime.\n * Higher-order units must also be identical for this function to return `true`.\n * Note that time zones are **ignored** in this comparison, which compares the **local** calendar time. Use {@link DateTime#setZone} to convert one of the dates if needed.\n * @param {DateTime} otherDateTime - the other DateTime\n * @param {string} unit - the unit of time to check sameness on\n * @example DateTime.now().hasSame(otherDT, 'day'); //~> true if otherDT is in the same current calendar day\n * @return {boolean}\n */\n hasSame(otherDateTime, unit) {\n if (!this.isValid) return false;\n\n const inputMs = otherDateTime.valueOf();\n const adjustedToZone = this.setZone(otherDateTime.zone, { keepLocalTime: true });\n return adjustedToZone.startOf(unit) <= inputMs && inputMs <= adjustedToZone.endOf(unit);\n }\n\n /**\n * Equality check\n * Two DateTimes are equal iff they represent the same millisecond, have the same zone and location, and are both valid.\n * To compare just the millisecond values, use `+dt1 === +dt2`.\n * @param {DateTime} other - the other DateTime\n * @return {boolean}\n */\n equals(other) {\n return (\n this.isValid &&\n other.isValid &&\n this.valueOf() === other.valueOf() &&\n this.zone.equals(other.zone) &&\n this.loc.equals(other.loc)\n );\n }\n\n /**\n * Returns a string representation of a this time relative to now, such as \"in two days\". Can only internationalize if your\n * platform supports Intl.RelativeTimeFormat. Rounds down by default.\n * @param {Object} options - options that affect the output\n * @param {DateTime} [options.base=DateTime.now()] - the DateTime to use as the basis to which this time is compared. Defaults to now.\n * @param {string} [options.style=\"long\"] - the style of units, must be \"long\", \"short\", or \"narrow\"\n * @param {string|string[]} options.unit - use a specific unit or array of units; if omitted, or an array, the method will pick the best unit. Use an array or one of \"years\", \"quarters\", \"months\", \"weeks\", \"days\", \"hours\", \"minutes\", or \"seconds\"\n * @param {boolean} [options.round=true] - whether to round the numbers in the output.\n * @param {number} [options.padding=0] - padding in milliseconds. This allows you to round up the result if it fits inside the threshold. Don't use in combination with {round: false} because the decimal output will include the padding.\n * @param {string} options.locale - override the locale of this DateTime\n * @param {string} options.numberingSystem - override the numberingSystem of this DateTime. The Intl system may choose not to honor this\n * @example DateTime.now().plus({ days: 1 }).toRelative() //=> \"in 1 day\"\n * @example DateTime.now().setLocale(\"es\").toRelative({ days: 1 }) //=> \"dentro de 1 día\"\n * @example DateTime.now().plus({ days: 1 }).toRelative({ locale: \"fr\" }) //=> \"dans 23 heures\"\n * @example DateTime.now().minus({ days: 2 }).toRelative() //=> \"2 days ago\"\n * @example DateTime.now().minus({ days: 2 }).toRelative({ unit: \"hours\" }) //=> \"48 hours ago\"\n * @example DateTime.now().minus({ hours: 36 }).toRelative({ round: false }) //=> \"1.5 days ago\"\n */\n toRelative(options = {}) {\n if (!this.isValid) return null;\n const base = options.base || DateTime.fromObject({}, { zone: this.zone }),\n padding = options.padding ? (this < base ? -options.padding : options.padding) : 0;\n let units = [\"years\", \"months\", \"days\", \"hours\", \"minutes\", \"seconds\"];\n let unit = options.unit;\n if (Array.isArray(options.unit)) {\n units = options.unit;\n unit = undefined;\n }\n return diffRelative(base, this.plus(padding), {\n ...options,\n numeric: \"always\",\n units,\n unit,\n });\n }\n\n /**\n * Returns a string representation of this date relative to today, such as \"yesterday\" or \"next month\".\n * Only internationalizes on platforms that supports Intl.RelativeTimeFormat.\n * @param {Object} options - options that affect the output\n * @param {DateTime} [options.base=DateTime.now()] - the DateTime to use as the basis to which this time is compared. Defaults to now.\n * @param {string} options.locale - override the locale of this DateTime\n * @param {string} options.unit - use a specific unit; if omitted, the method will pick the unit. Use one of \"years\", \"quarters\", \"months\", \"weeks\", or \"days\"\n * @param {string} options.numberingSystem - override the numberingSystem of this DateTime. The Intl system may choose not to honor this\n * @example DateTime.now().plus({ days: 1 }).toRelativeCalendar() //=> \"tomorrow\"\n * @example DateTime.now().setLocale(\"es\").plus({ days: 1 }).toRelative() //=> \"\"mañana\"\n * @example DateTime.now().plus({ days: 1 }).toRelativeCalendar({ locale: \"fr\" }) //=> \"demain\"\n * @example DateTime.now().minus({ days: 2 }).toRelativeCalendar() //=> \"2 days ago\"\n */\n toRelativeCalendar(options = {}) {\n if (!this.isValid) return null;\n\n return diffRelative(options.base || DateTime.fromObject({}, { zone: this.zone }), this, {\n ...options,\n numeric: \"auto\",\n units: [\"years\", \"months\", \"days\"],\n calendary: true,\n });\n }\n\n /**\n * Return the min of several date times\n * @param {...DateTime} dateTimes - the DateTimes from which to choose the minimum\n * @return {DateTime} the min DateTime, or undefined if called with no argument\n */\n static min(...dateTimes) {\n if (!dateTimes.every(DateTime.isDateTime)) {\n throw new InvalidArgumentError(\"min requires all arguments be DateTimes\");\n }\n return bestBy(dateTimes, (i) => i.valueOf(), Math.min);\n }\n\n /**\n * Return the max of several date times\n * @param {...DateTime} dateTimes - the DateTimes from which to choose the maximum\n * @return {DateTime} the max DateTime, or undefined if called with no argument\n */\n static max(...dateTimes) {\n if (!dateTimes.every(DateTime.isDateTime)) {\n throw new InvalidArgumentError(\"max requires all arguments be DateTimes\");\n }\n return bestBy(dateTimes, (i) => i.valueOf(), Math.max);\n }\n\n // MISC\n\n /**\n * Explain how a string would be parsed by fromFormat()\n * @param {string} text - the string to parse\n * @param {string} fmt - the format the string is expected to be in (see description)\n * @param {Object} options - options taken by fromFormat()\n * @return {Object}\n */\n static fromFormatExplain(text, fmt, options = {}) {\n const { locale = null, numberingSystem = null } = options,\n localeToUse = Locale.fromOpts({\n locale,\n numberingSystem,\n defaultToEN: true,\n });\n return explainFromTokens(localeToUse, text, fmt);\n }\n\n /**\n * @deprecated use fromFormatExplain instead\n */\n static fromStringExplain(text, fmt, options = {}) {\n return DateTime.fromFormatExplain(text, fmt, options);\n }\n\n // FORMAT PRESETS\n\n /**\n * {@link DateTime#toLocaleString} format like 10/14/1983\n * @type {Object}\n */\n static get DATE_SHORT() {\n return DATE_SHORT;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Oct 14, 1983'\n * @type {Object}\n */\n static get DATE_MED() {\n return DATE_MED;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Fri, Oct 14, 1983'\n * @type {Object}\n */\n static get DATE_MED_WITH_WEEKDAY() {\n return DATE_MED_WITH_WEEKDAY;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'October 14, 1983'\n * @type {Object}\n */\n static get DATE_FULL() {\n return DATE_FULL;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Tuesday, October 14, 1983'\n * @type {Object}\n */\n static get DATE_HUGE() {\n return DATE_HUGE;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get TIME_SIMPLE() {\n return TIME_SIMPLE;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get TIME_WITH_SECONDS() {\n return TIME_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 AM EDT'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get TIME_WITH_SHORT_OFFSET() {\n return TIME_WITH_SHORT_OFFSET;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 AM Eastern Daylight Time'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get TIME_WITH_LONG_OFFSET() {\n return TIME_WITH_LONG_OFFSET;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30', always 24-hour.\n * @type {Object}\n */\n static get TIME_24_SIMPLE() {\n return TIME_24_SIMPLE;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23', always 24-hour.\n * @type {Object}\n */\n static get TIME_24_WITH_SECONDS() {\n return TIME_24_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 EDT', always 24-hour.\n * @type {Object}\n */\n static get TIME_24_WITH_SHORT_OFFSET() {\n return TIME_24_WITH_SHORT_OFFSET;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 Eastern Daylight Time', always 24-hour.\n * @type {Object}\n */\n static get TIME_24_WITH_LONG_OFFSET() {\n return TIME_24_WITH_LONG_OFFSET;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '10/14/1983, 9:30 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_SHORT() {\n return DATETIME_SHORT;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '10/14/1983, 9:30:33 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_SHORT_WITH_SECONDS() {\n return DATETIME_SHORT_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Oct 14, 1983, 9:30 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_MED() {\n return DATETIME_MED;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Oct 14, 1983, 9:30:33 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_MED_WITH_SECONDS() {\n return DATETIME_MED_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Fri, 14 Oct 1983, 9:30 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_MED_WITH_WEEKDAY() {\n return DATETIME_MED_WITH_WEEKDAY;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'October 14, 1983, 9:30 AM EDT'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_FULL() {\n return DATETIME_FULL;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'October 14, 1983, 9:30:33 AM EDT'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_FULL_WITH_SECONDS() {\n return DATETIME_FULL_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Friday, October 14, 1983, 9:30 AM Eastern Daylight Time'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_HUGE() {\n return DATETIME_HUGE;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Friday, October 14, 1983, 9:30:33 AM Eastern Daylight Time'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_HUGE_WITH_SECONDS() {\n return DATETIME_HUGE_WITH_SECONDS;\n }\n}\n\n/**\n * @private\n */\nfunction friendlyDateTime(dateTimeish) {\n if (DateTime.isDateTime(dateTimeish)) {\n return dateTimeish;\n } else if (dateTimeish && dateTimeish.valueOf && isNumber(dateTimeish.valueOf())) {\n return DateTime.fromJSDate(dateTimeish);\n } else if (dateTimeish && typeof dateTimeish === \"object\") {\n return DateTime.fromObject(dateTimeish);\n } else {\n throw new InvalidArgumentError(\n `Unknown datetime argument: ${dateTimeish}, of type ${typeof dateTimeish}`\n );\n }\n}\n\nconst VERSION = \"3.1.0\";\n\nexport { DateTime, Duration, FixedOffsetZone, IANAZone, Info, Interval, InvalidZone, Settings, SystemZone, VERSION, Zone };\n//# sourceMappingURL=luxon.js.map\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","// startup\n// Load entry module and return exports\n__webpack_require__(\"./server/scripts/modules/currentweatherscroll.mjs\");\n// This entry module is referenced by other modules so it can't be inlined\n__webpack_require__(\"./server/scripts/modules/currentweather.mjs\");\n__webpack_require__(\"./server/scripts/modules/almanac.mjs\");\n__webpack_require__(\"./server/scripts/modules/icons.mjs\");\n__webpack_require__(\"./server/scripts/modules/extendedforecast.mjs\");\n__webpack_require__(\"./server/scripts/modules/hourly.mjs\");\n__webpack_require__(\"./server/scripts/modules/latestobservations.mjs\");\n__webpack_require__(\"./server/scripts/modules/localforecast.mjs\");\n__webpack_require__(\"./server/scripts/modules/radar.mjs\");\n__webpack_require__(\"./server/scripts/modules/regionalforecast.mjs\");\n__webpack_require__(\"./server/scripts/modules/travelforecast.mjs\");\n__webpack_require__(\"./server/scripts/modules/progress.mjs\");\nvar __webpack_exports__ = __webpack_require__(\"./server/scripts/index.mjs\");\n"],"names":["document","addEventListener","init","overrides","AutoSelectQuery","FullScreenOverride","cats","join","getElementById","e","target","select","registerRefreshData","LoadTwcData","btnNavigateMenuClick","btnNavigateRefreshClick","btnNavigateNextClick","btnNavigatePreviousClick","btnNavigatePlayClick","btnFullScreenClick","btnGetGpsClick","fullscreenElement","UpdateFullScreenNavigate","documentKeydown","preventDefault","$","devbridgeAutocomplete","serviceUrl","deferRequestBy","paramName","params","f","countryCode","category","maxSuggestions","dataType","transformResult","response","window","setTimeout","ac","suggestionsContainer","children","click","suggestions","map","i","value","text","data","magicKey","minChars","showNoSuggestionNotice","noSuggestionNotice","onSelect","suggestion","autocompleteOnSelect","this","width","on","TwcQuery","localStorage","getItem","txtAddress","blur","focus","TwcPlay","postMessage","innerHTML","removeItem","checked","swipeCallBack","async","elem","previousSuggestionValue","doRedirectToGeometry","loc","json","locations","feature","geometry","console","error","geom","latLon","lat","Math","round2","y","lon","x","setItem","ExitFullscreen","EnterFullScreen","isPlaying","element","requestMethod","requestFullScreen","webkitRequestFullScreen","mozRequestFullScreen","msRequestFullscreen","call","navigationUI","scrollTo","resize","title","exitFullscreen","webkitExitFullscreen","mozCancelFullScreen","msExitFullscreen","_latLon","stopAutoRefreshTimer","latLonReceived","direction","resetStatuses","NavigateFadeIntervalId","activeElement","classList","remove","add","clearTimeout","code","keyCode","which","Date","now","lastButton","body","decimals","Number","round","type","myMessage","message","navigator","geolocation","position","Promise","resolve","getCurrentPosition","latitude","longitude","coords","location","distance","status","responseJSONe","ZipCode","address","Postal","City","states","getTwoDigitCode","Region","CountryCode","Almanac","constructor","navId","elemId","super","backgroundImage0","loadImg","preloadImg","timing","totalScreens","_weatherParameters","getData","weatherParameters","sun","moon","calcSunMoonData","setStatus","getDataCallback","SunCalc","getTimes","DateTime","plus","days","toJSDate","moonDate","minus","phase","getMoonIllumination","iterations","lastPhase","push","getMoonTransition","length","threshold","phaseName","start","iteration","step","hours","minutes","seconds","milliseconds","test","testPhase","date","drawCanvas","info","Today","Tomorrow","querySelector","toLocaleString","weekday","sunrise","toLowerCase","sunset","MoonPhase","fill","month","day","icon","src","imageName","Phase","fillTemplate","daysContainer","append","finishDraw","static","getDataCallbacks","display","registerDisplay","getSun","bind","CurrentWeather","backgroundImage","observations","station","stationNum","stations","id","cors","limit","features","properties","temperature","windSpeed","textDescription","undefined","Error","stationIdentifier","getWeatherIconFromIconLink","parseData","Temperature","TemperatureUnit","DewPoint","dewpoint","Ceiling","cloudLayers","base","CeilingUnit","Visibility","visibility","VisibilityUnit","WindSpeed","WindDirection","directionToNSEW","windDirection","Pressure","barometricPressure","HeatIndex","heatIndex","WindChill","windChill","WindGust","windGust","WindUnit","Humidity","relativeHumidity","Icon","PressureDirection","TextConditions","pressureDiff","celsiusToFahrenheit","metersToFeet","kilometersToMiles","kphToMph","pascalToInHg","toFixed","temp","String","fromCharCode","Conditions","shortConditions","condition","wind","padEnd","toString","padStart","locationCleanup","name","substr","humidity","ceiling","pressure","area","_condition","replace","getCurrentWeather","degree","interval","screenIndex","incrementInterval","currentDisplay","okToDrawCurrentConditions","screens","drawScreen","drawCondition","elemForEach","setInterval","ExtendedForecast","forecast","units","responseJSON","parse","periods","fullForecast","dates","shift","startOf","destIndex","forEach","period","dayName","low","high","fDay","shortenExtendedForecastText","shortForecast","isDaytime","long","short","reduce","working","regex","conditions","split","indexOf","short1","short2","endsWith","result","slice","Day","dayContainer","Hourly","defaultActive","baseDelay","delay","forecastGridData","parseForecast","drawLongCanvas","expand","values","apparentTemperature","skyCover","weather","iceAccumulation","probabilityOfPrecipitation","snowfallAmount","icons","determineIcon","val","idx","startOfHour","sunTimes","overnight","Interval","tomorrowOvernight","hour","isNight","contains","getHourlyIcon","toMillis","item","startTime","validTime","endTime","Duration","shiftTo","list","startingHour","lines","index","fillValues","formattedHour","feelsLike","like","Array","showCanvas","screenIndexChange","baseCountChange","navBaseCount","count","offsetY","min","getBoundingClientRect","height","cities","city","getWeatherRegionalIconFromIconLink","link","_isNightTime","isNightTime","addPath","conditionName","match","log","thunder","snow","ice","fog","phenomenon","includes","LatestObservations","MaximumRegionalStations","regionalStations","Object","keys","StationInfo","key","sort","a","b","actualConditions","all","StationId","filter","sortedConditions","Name","shortenCurrentConditions","linesContainer","LocalForecast","rawData","getRawData","screenTexts","DayName","toUpperCase","Text","templates","forecastsElem","pageHeight","parentNode","newHeight","ceil","scrollHeight","style","calcNavTiming","top","detailedForecast","displays","progress","playing","AUTO_REFRESH_TIME_MS","AutoRefreshIntervalId","AutoRefreshCountMs","TwcAutoRefresh","autoRefreshChange","generateCheckboxes","handleNavButton","updateStatus","countLoadedCanvases","navTo","msg","command","firstFrame","AssignLastUpdate","acc","hideAllCanvases","hideCanvas","previous","Symbol","inProgress","next","previousFrame","nextFrame","lastFrame","displayNavMessage","loadDisplay","current","navNext","navPrev","firstDisplay","displayCount","totalDisplays","curIdx","currentDisplayIndex","wrap","refreshCheck","newDisplay","findIndex","isActive","setPlaying","newValue","playButton","button","getDisplay","widthZoomPercent","innerWidth","heightZoomPercent","innerHeight","scale","zoom","availableDisplays","checkboxes","d","generateCheckbox","registerProgress","_progress","populateWeatherParameters","state","stationId","radarId","zoneId","startAutoRefreshTimer","year","minute","second","timeZoneName","point","getPoint","observationStations","relativeLocation","forecastZone","radarStation","weatherOffice","cwa","timeZone","getWeather","AutoRefreshTimer","RemainingMs","dt","getMinutes","getSeconds","loadTwcData","clearInterval","callback","Progress","version","lineClick","loadedCount","progressCover","statusClass","line","links","dataset","container","loadedPercent","indexRaw","Radar","okToDrawCurrentDateTime","dopplerRadarImageMax","time","si","State","baseMap","baseUrls","toFormat","pngs","url","html","htmlIdx","xmlDoc","DOMParser","parseFromString","createElement","href","head","anchors","getElementsByTagName","urls","from","flat","offsetX","sourceXY","getXYFromLatitudeLongitudeMap","workingCanvas","workingContext","getContext","imageSmoothingEnabled","radarSourceXY","getXYFromLatitudeLongitudeDoppler","radarSourceX","radarSourceY","radarInfo","canvas","context","fetch","rewriteUrl","ok","statusText","blob","timeMatch","zone","setZone","headers","get","imgBlob","clearRect","drawImage","cropCanvas","cropContext","willReadFrequently","removeDopplerRadarImageNoise","mergeDopplerRadarImage","toDataURL","scrollArea","r","radar","times","timePadded","pos","RadarContext","RadarImageData","getImageData","R","G","B","A","putImageData","mapContext","radarContext","mapImageData","radarImageData","RegionalForecast","offsetXY","getXYFromLatitudeLongitude","minMaxLatLon","getMinMaxLatitudeLongitude","targetDistance","stationInfoArray","combinedCities","RegionalCities","regionalCities","minLat","maxLat","minLon","maxLon","targetDist","testCity","regionalData","observationPromise","getRegionalObservation","wfo","cityXY","getXYForCity","observation","regionalObservation","daytime","formatCity","buildForecast","Latitude","Longitude","OffsetX","OffsetY","getXYFromLatitudeLongitudeAK","getXYFromLatitudeLongitudeHI","X","Y","getMinMaxLatitudeLongitudeAK","getMinMaxLatitudeLongitudeHI","MaxLatitude","MinLongitude","getXYForCityAK","getXYForCityHI","titleTop","titleBottom","left","locationContainer","loading","loaded","failed","noData","disabled","TravelForecast","pagesFloat","TravelCities","pages","floor","extra","cityHeight","forecastPromises","todayShift","today","forecasts","lowString","highString","getTravelCitiesDayName","getLongCanvas","longCanvas","T","TD","exp","RelativeHumidity","RH","ADJUSTMENT","HI","sqrt","abs","V","Direction","x1","y1","x2","y2","m","_url","selector","querySelectorAll","fetchAsync","raw","responseType","_params","method","mode","corsUrl","URL","origin","protocol","hostname","searchParams","imgData","img","Image","onload","Blob","createObjectURL","cachedImages","wakeLock","noSleep","enable","controller","NoSleep","disable","input","Kph","Celsius","Kilometers","Meters","Pascal","defaultEnabled","gifs","loadingStatus","storeElemId","enabled","startNavCount","loadTemplates","savedStatus","checkbox","content","firstChild","checkboxChange","fxn","drawCurrentDateTime","dateTimeInterval","lastTime","lastDate","navCmd","resetNavBaseCount","offsetHeight","isEnabled","navBaseTime","updateScreenFromBaseCount","nextScreenIndex","screenIndexFromBaseCount","sendNavDisplayMessage","isArray","intermediateDelay","sum","fullDelay","calc","screenIndexes","newBaseCount","find","timingIndex","navInterval","template","className","node","cloneNode","templateNode","entries","LuxonError","InvalidDateTimeError","reason","toMessage","InvalidIntervalError","InvalidDurationError","ConflictingSpecificationError","InvalidUnitError","unit","InvalidArgumentError","ZoneIsAbstractError","n","s","l","DATE_SHORT","DATE_MED","DATE_MED_WITH_WEEKDAY","DATE_FULL","DATE_HUGE","TIME_SIMPLE","TIME_WITH_SECONDS","TIME_WITH_SHORT_OFFSET","TIME_WITH_LONG_OFFSET","TIME_24_SIMPLE","hourCycle","TIME_24_WITH_SECONDS","TIME_24_WITH_SHORT_OFFSET","TIME_24_WITH_LONG_OFFSET","DATETIME_SHORT","DATETIME_SHORT_WITH_SECONDS","DATETIME_MED","DATETIME_MED_WITH_SECONDS","DATETIME_MED_WITH_WEEKDAY","DATETIME_FULL","DATETIME_FULL_WITH_SECONDS","DATETIME_HUGE","DATETIME_HUGE_WITH_SECONDS","isUndefined","o","isNumber","isInteger","hasRelative","Intl","RelativeTimeFormat","bestBy","arr","by","compare","best","pair","hasOwnProperty","obj","prop","prototype","integerBetween","thing","bottom","padded","parseInteger","string","parseInt","parseFloating","parseFloat","parseMillis","fraction","roundTo","number","digits","towardZero","factor","trunc","isLeapYear","daysInYear","daysInMonth","modMonth","floorMod","objToLocalTS","UTC","millisecond","setUTCFullYear","getUTCFullYear","weeksInWeekYear","weekYear","p1","last","p2","untruncateYear","parseZoneInfo","ts","offsetFormat","locale","intlOpts","modified","parsed","DateTimeFormat","formatToParts","signedOffset","offHourStr","offMinuteStr","offHour","isNaN","offMin","is","asNumber","numericValue","normalizeObject","normalizer","normalized","u","v","formatOffset","offset","format","sign","RangeError","timeObject","k","pick","ianaRegex","monthsLong","monthsShort","monthsNarrow","months","weekdaysLong","weekdaysShort","weekdaysNarrow","weekdays","meridiems","erasLong","erasShort","erasNarrow","eras","stringifyTokens","splits","tokenToString","token","literal","macroTokenToFormatOpts","D","DD","DDD","DDDD","t","tt","ttt","tttt","TT","TTT","TTTT","ff","fff","ffff","F","FF","FFF","FFFF","Formatter","opts","fmt","currentFull","bracketed","c","charAt","formatOpts","systemLoc","formatWithSystemDefault","redefaultToSystem","dtFormatter","formatDateTime","formatDateTimeParts","resolvedOptions","num","p","forceSimple","padTo","numberFormatter","formatDateTimeFromString","knownEnglish","listingMode","useDateTimeFormatter","outputCalendar","extract","isOffsetFixed","allowZ","isValid","meridiem","meridiemForDateTime","standalone","monthForDateTime","weekdayForDateTime","maybeMacro","era","eraForDateTime","parseFormat","offsetName","zoneName","weekNumber","ordinal","quarter","formatDurationFromString","dur","tokenToField","tokens","realTokens","found","concat","lildur","mapped","Invalid","explanation","Zone","ianaName","isUniversal","equals","otherZone","singleton$1","SystemZone","instance","getTimezoneOffset","dtfCache","typeToPos","ianaZoneCache","IANAZone","isValidZone","valid","NaN","dtf","hour12","adOrBc","formatted","filled","partsOffset","exec","fMonth","fYear","fadOrBc","fHour","fMinute","fSecond","hackyOffset","asTS","over","singleton","FixedOffsetZone","utcInstance","fixed","InvalidZone","normalizeZone","defaultZone","lowered","parseSpecifier","create","throwOnInvalid","defaultLocale","defaultNumberingSystem","defaultOutputCalendar","Settings","numberingSystem","Locale","resetCache","intlLFCache","intlDTCache","getCachedDTF","locString","JSON","stringify","intlNumCache","intlRelCache","sysLocaleCache","listStuff","defaultOK","englishFn","intlFn","PolyNumberFormatter","intl","otherOpts","useGrouping","minimumIntegerDigits","inf","NumberFormat","getCachedINF","PolyDateFormatter","z","gmtOffset","offsetZ","fromMillis","PolyRelFormatter","isEnglish","rtf","cacheKeyOpts","getCachedRTF","numeric","narrow","years","quarters","weeks","lastable","isDay","isInPast","fmtValue","singular","lilUnits","fmtUnit","formatRelativeTime","defaultToEN","specifiedLocale","localeR","numberingSystemR","outputCalendarR","numbering","parsedLocale","parsedNumberingSystem","parsedOutputCalendar","localeStr","uIndex","options","smaller","substring","calendar","parseLocaleString","intlConfigString","weekdaysCache","monthsCache","meridiemCache","eraCache","fastNumbersCached","fastNumbers","startsWith","isActuallyEn","hasNoWeirdness","clone","alts","getOwnPropertyNames","redefaultToEN","formatStr","ms","utc","mapMonths","mapWeekdays","field","matching","relFormatter","listFormatter","ListFormat","getCachedLF","other","combineRegexes","regexes","full","source","RegExp","combineExtractors","extractors","mergedVals","mergedZone","cursor","ex","patterns","extractor","simpleParse","ret","offsetRegex","isoTimeBaseRegex","isoTimeRegex","isoTimeExtensionRegex","extractISOWeekData","extractISOOrdinalData","sqlTimeRegex","sqlTimeExtensionRegex","int","fallback","extractISOTime","extractISOOffset","local","fullOffset","extractIANAZone","isoTimeOnly","isoDuration","extractISODuration","yearStr","monthStr","weekStr","dayStr","hourStr","minuteStr","secondStr","millisecondsStr","hasNegativePrefix","negativeSeconds","maybeNegate","force","obsOffsets","GMT","EDT","EST","CDT","CST","MDT","MST","PDT","PST","fromStrings","weekdayStr","rfc2822","extractRFC2822","obsOffset","milOffset","rfc1123","rfc850","ascii","extractRFC1123Or850","extractASCII","isoYmdWithTimeExtensionRegex","isoWeekWithTimeExtensionRegex","isoOrdinalWithTimeExtensionRegex","isoTimeCombinedRegex","extractISOYmdTimeAndOffset","extractISOWeekTimeAndOffset","extractISOOrdinalDateAndTime","extractISOTimeAndOffset","extractISOTimeOnly","sqlYmdWithTimeExtensionRegex","sqlTimeCombinedRegex","extractISOTimeOffsetAndIANAZone","lowOrderMatrix","casualMatrix","daysInYearAccurate","daysInMonthAccurate","accurateMatrix","orderedUnits$1","reverseUnits","reverse","clone$1","clear","conf","conversionAccuracy","matrix","convert","fromMap","fromUnit","toMap","toUnit","conv","added","antiTrunc","config","accurate","invalid","isLuxonDuration","fromObject","normalizeUnit","durationLike","isDuration","parseISODuration","parseISOTimeOnly","week","fmtOpts","toHuman","unitDisplay","listStyle","toObject","toISO","toISOTime","millis","suppressMilliseconds","suppressSeconds","includePrefix","str","toJSON","as","valueOf","duration","fromDurationLike","negate","mapUnits","fn","set","reconfigure","normalize","vals","normalizeValues","rescale","newVals","removeZeroes","shiftToAll","built","accumulated","lastUnit","own","ak","down","negated","invalidReason","invalidExplanation","v1","v2","INVALID$1","end","isLuxonInterval","builtStart","friendlyDateTime","builtEnd","validateError","validateStartEnd","fromDateTimes","startIsValid","endIsValid","fromISO","after","before","toDuration","diff","hasSame","isEmpty","isAfter","dateTime","isBefore","splitAt","dateTimes","sorted","results","splitBy","divideEqually","numberOfParts","overlaps","abutsStart","abutsEnd","engulfs","intersection","union","intervals","final","sofar","currentCount","ends","merge","difference","xor","toISODate","dateFormat","separator","mapEndpoints","mapFn","Info","proto","locObj","relative","dayDiff","earlier","later","utcDayStart","toUTC","keepLocalTime","highWater","lowestOrder","differs","differ","delta","highOrderDiffs","remainingMillis","lowerOrderUnits","numberingSystems","arab","arabext","bali","beng","deva","fullwide","gujr","hanidec","khmr","knda","laoo","limb","mlym","mong","mymr","orya","tamldec","telu","thai","tibt","latn","numberingSystemsUTF16","hanidecChars","digitRegex","intUnit","post","deser","charCodeAt","search","max","parseDigits","spaceOrNBSP","spaceOrNBSPRegExp","fixListRegex","stripInsensitivities","oneOf","strings","startIndex","groups","h","simple","partTypeStyleToTokenVal","dayperiod","dayPeriod","dummyDateTimeCache","expandMacroTokens","formatOptsToTokens","maybeExpandMacroToken","explainFromTokens","one","two","three","four","six","oneOrTwo","oneToThree","oneToSix","oneToNine","twoToFour","fourToSix","unitate","unitForToken","disqualifyingUnit","regexString","handlers","buildRegex","rawMatches","matches","matchIndex","specificOffset","Z","q","M","S","toField","dateTimeFromMatches","part","tokenForPart","nonLeapLadder","leapLadder","unitOutOfRange","dayOfWeek","js","getUTCDay","computeOrdinal","uncomputeOrdinal","table","month0","gregorianToWeek","gregObj","weekToGregorian","weekData","weekdayOfJan4","yearInDays","gregorianToOrdinal","gregData","ordinalToGregorian","ordinalData","hasInvalidGregorianData","validYear","validMonth","validDay","hasInvalidTimeData","validHour","validMinute","validSecond","validMillisecond","INVALID","MAX_DATE","unsupportedZone","possiblyCachedWeekData","inst","old","fixOffset","localTS","tz","utcGuess","o2","o3","tsToObj","getUTCMonth","getUTCDate","getUTCHours","getUTCMinutes","getUTCSeconds","getUTCMilliseconds","objToTS","adjustTime","oPre","millisToAdd","parseDataToDateTime","parsedZone","interpretationZone","toTechFormat","extended","longFormat","includeOffset","extendedZone","defaultUnitValues","defaultWeekUnitValues","defaultOrdinalUnitValues","orderedUnits","orderedWeekUnits","orderedOrdinalUnits","weeknumber","weeksnumber","weeknumbers","weekyear","weekyears","quickDT","tsNow","offsetProvis","diffRelative","calendary","lastOpts","argList","args","ot","_zone","isLuxonDateTime","arguments","zoneToUse","containsOrdinal","containsGregorYear","containsGregorMD","containsGregor","definiteWeekDef","useWeekData","defaultValues","objNow","foundFirst","higherOrderInvalid","validWeek","validWeekday","hasInvalidWeekData","validOrdinal","hasInvalidOrdinalData","gregorian","tsFinal","offsetFinal","parseISODate","trim","preprocessRFC2822","parseRFC2822Date","parseHTTPDate","localeToUse","fromOpts","parseFromTokens","fromFormat","parseSQL","localeOpts","tokenList","monthShort","monthLong","weekdayShort","weekdayLong","offsetNameShort","offsetNameLong","isInDST","isInLeapYear","resolvedLocaleOptions","toLocal","keepCalendarTime","newTS","offsetGuess","asObj","setLocale","settingWeekStuff","mixed","normalizedUnit","endOf","toLocaleParts","ext","toISOWeekDate","toRFC2822","toHTTP","toSQLDate","toSQLTime","includeZone","includeOffsetSpace","toSQL","toSeconds","toUnixInteger","toBSON","includeConfig","otherDateTime","durOpts","otherIsLater","diffed","diffNow","until","inputMs","adjustedToZone","toRelative","padding","toRelativeCalendar","every","isDateTime","fromFormatExplain","dateTimeish","fromJSDate","VERSION","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","exports","module","__webpack_modules__","definition","defineProperty","enumerable","toStringTag"],"sourceRoot":""} \ No newline at end of file