-
Notifications
You must be signed in to change notification settings - Fork 13
/
bundle.js.map
1 lines (1 loc) · 80.8 KB
/
bundle.js.map
1
{"version":3,"file":"bundle.js","sources":["node_modules/d3-time/src/interval.js","node_modules/d3-time/src/duration.js","node_modules/d3-time/src/day.js","node_modules/d3-time/src/week.js","node_modules/d3-time/src/year.js","node_modules/d3-time/src/utcDay.js","node_modules/d3-time/src/utcWeek.js","node_modules/d3-time/src/utcYear.js","node_modules/d3-time-format/src/locale.js","node_modules/d3-time-format/src/defaultLocale.js","src/index.ts"],"sourcesContent":["var t0 = new Date,\n t1 = new Date;\n\nexport default function newInterval(floori, offseti, count, field) {\n\n function interval(date) {\n return floori(date = arguments.length === 0 ? new Date : new Date(+date)), date;\n }\n\n interval.floor = function(date) {\n return floori(date = new Date(+date)), date;\n };\n\n interval.ceil = function(date) {\n return floori(date = new Date(date - 1)), offseti(date, 1), floori(date), date;\n };\n\n interval.round = function(date) {\n var d0 = interval(date),\n d1 = interval.ceil(date);\n return date - d0 < d1 - date ? d0 : d1;\n };\n\n interval.offset = function(date, step) {\n return offseti(date = new Date(+date), step == null ? 1 : Math.floor(step)), date;\n };\n\n interval.range = function(start, stop, step) {\n var range = [], previous;\n start = interval.ceil(start);\n step = step == null ? 1 : Math.floor(step);\n if (!(start < stop) || !(step > 0)) return range; // also handles Invalid Date\n do range.push(previous = new Date(+start)), offseti(start, step), floori(start);\n while (previous < start && start < stop);\n return range;\n };\n\n interval.filter = function(test) {\n return newInterval(function(date) {\n if (date >= date) while (floori(date), !test(date)) date.setTime(date - 1);\n }, function(date, step) {\n if (date >= date) {\n if (step < 0) while (++step <= 0) {\n while (offseti(date, -1), !test(date)) {} // eslint-disable-line no-empty\n } else while (--step >= 0) {\n while (offseti(date, +1), !test(date)) {} // eslint-disable-line no-empty\n }\n }\n });\n };\n\n if (count) {\n interval.count = function(start, end) {\n t0.setTime(+start), t1.setTime(+end);\n floori(t0), floori(t1);\n return Math.floor(count(t0, t1));\n };\n\n interval.every = function(step) {\n step = Math.floor(step);\n return !isFinite(step) || !(step > 0) ? null\n : !(step > 1) ? interval\n : interval.filter(field\n ? function(d) { return field(d) % step === 0; }\n : function(d) { return interval.count(0, d) % step === 0; });\n };\n }\n\n return interval;\n}\n","export const durationSecond = 1000;\nexport const durationMinute = durationSecond * 60;\nexport const durationHour = durationMinute * 60;\nexport const durationDay = durationHour * 24;\nexport const durationWeek = durationDay * 7;\nexport const durationMonth = durationDay * 30;\nexport const durationYear = durationDay * 365;\n","import interval from \"./interval.js\";\nimport {durationDay, durationMinute} from \"./duration.js\";\n\nvar day = interval(\n date => date.setHours(0, 0, 0, 0),\n (date, step) => date.setDate(date.getDate() + step),\n (start, end) => (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute) / durationDay,\n date => date.getDate() - 1\n);\n\nexport default day;\nexport var days = day.range;\n","import interval from \"./interval.js\";\nimport {durationMinute, durationWeek} from \"./duration.js\";\n\nfunction weekday(i) {\n return interval(function(date) {\n date.setDate(date.getDate() - (date.getDay() + 7 - i) % 7);\n date.setHours(0, 0, 0, 0);\n }, function(date, step) {\n date.setDate(date.getDate() + step * 7);\n }, function(start, end) {\n return (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute) / durationWeek;\n });\n}\n\nexport var sunday = weekday(0);\nexport var monday = weekday(1);\nexport var tuesday = weekday(2);\nexport var wednesday = weekday(3);\nexport var thursday = weekday(4);\nexport var friday = weekday(5);\nexport var saturday = weekday(6);\n\nexport var sundays = sunday.range;\nexport var mondays = monday.range;\nexport var tuesdays = tuesday.range;\nexport var wednesdays = wednesday.range;\nexport var thursdays = thursday.range;\nexport var fridays = friday.range;\nexport var saturdays = saturday.range;\n","import interval from \"./interval.js\";\n\nvar year = interval(function(date) {\n date.setMonth(0, 1);\n date.setHours(0, 0, 0, 0);\n}, function(date, step) {\n date.setFullYear(date.getFullYear() + step);\n}, function(start, end) {\n return end.getFullYear() - start.getFullYear();\n}, function(date) {\n return date.getFullYear();\n});\n\n// An optimized implementation for this simple case.\nyear.every = function(k) {\n return !isFinite(k = Math.floor(k)) || !(k > 0) ? null : interval(function(date) {\n date.setFullYear(Math.floor(date.getFullYear() / k) * k);\n date.setMonth(0, 1);\n date.setHours(0, 0, 0, 0);\n }, function(date, step) {\n date.setFullYear(date.getFullYear() + step * k);\n });\n};\n\nexport default year;\nexport var years = year.range;\n","import interval from \"./interval.js\";\nimport {durationDay} from \"./duration.js\";\n\nvar utcDay = interval(function(date) {\n date.setUTCHours(0, 0, 0, 0);\n}, function(date, step) {\n date.setUTCDate(date.getUTCDate() + step);\n}, function(start, end) {\n return (end - start) / durationDay;\n}, function(date) {\n return date.getUTCDate() - 1;\n});\n\nexport default utcDay;\nexport var utcDays = utcDay.range;\n","import interval from \"./interval.js\";\nimport {durationWeek} from \"./duration.js\";\n\nfunction utcWeekday(i) {\n return interval(function(date) {\n date.setUTCDate(date.getUTCDate() - (date.getUTCDay() + 7 - i) % 7);\n date.setUTCHours(0, 0, 0, 0);\n }, function(date, step) {\n date.setUTCDate(date.getUTCDate() + step * 7);\n }, function(start, end) {\n return (end - start) / durationWeek;\n });\n}\n\nexport var utcSunday = utcWeekday(0);\nexport var utcMonday = utcWeekday(1);\nexport var utcTuesday = utcWeekday(2);\nexport var utcWednesday = utcWeekday(3);\nexport var utcThursday = utcWeekday(4);\nexport var utcFriday = utcWeekday(5);\nexport var utcSaturday = utcWeekday(6);\n\nexport var utcSundays = utcSunday.range;\nexport var utcMondays = utcMonday.range;\nexport var utcTuesdays = utcTuesday.range;\nexport var utcWednesdays = utcWednesday.range;\nexport var utcThursdays = utcThursday.range;\nexport var utcFridays = utcFriday.range;\nexport var utcSaturdays = utcSaturday.range;\n","import interval from \"./interval.js\";\n\nvar utcYear = interval(function(date) {\n date.setUTCMonth(0, 1);\n date.setUTCHours(0, 0, 0, 0);\n}, function(date, step) {\n date.setUTCFullYear(date.getUTCFullYear() + step);\n}, function(start, end) {\n return end.getUTCFullYear() - start.getUTCFullYear();\n}, function(date) {\n return date.getUTCFullYear();\n});\n\n// An optimized implementation for this simple case.\nutcYear.every = function(k) {\n return !isFinite(k = Math.floor(k)) || !(k > 0) ? null : interval(function(date) {\n date.setUTCFullYear(Math.floor(date.getUTCFullYear() / k) * k);\n date.setUTCMonth(0, 1);\n date.setUTCHours(0, 0, 0, 0);\n }, function(date, step) {\n date.setUTCFullYear(date.getUTCFullYear() + step * k);\n });\n};\n\nexport default utcYear;\nexport var utcYears = utcYear.range;\n","import {\n timeDay,\n timeSunday,\n timeMonday,\n timeThursday,\n timeYear,\n utcDay,\n utcSunday,\n utcMonday,\n utcThursday,\n utcYear\n} from \"d3-time\";\n\nfunction localDate(d) {\n if (0 <= d.y && d.y < 100) {\n var date = new Date(-1, d.m, d.d, d.H, d.M, d.S, d.L);\n date.setFullYear(d.y);\n return date;\n }\n return new Date(d.y, d.m, d.d, d.H, d.M, d.S, d.L);\n}\n\nfunction utcDate(d) {\n if (0 <= d.y && d.y < 100) {\n var date = new Date(Date.UTC(-1, d.m, d.d, d.H, d.M, d.S, d.L));\n date.setUTCFullYear(d.y);\n return date;\n }\n return new Date(Date.UTC(d.y, d.m, d.d, d.H, d.M, d.S, d.L));\n}\n\nfunction newDate(y, m, d) {\n return {y: y, m: m, d: d, H: 0, M: 0, S: 0, L: 0};\n}\n\nexport default function formatLocale(locale) {\n var locale_dateTime = locale.dateTime,\n locale_date = locale.date,\n locale_time = locale.time,\n locale_periods = locale.periods,\n locale_weekdays = locale.days,\n locale_shortWeekdays = locale.shortDays,\n locale_months = locale.months,\n locale_shortMonths = locale.shortMonths;\n\n var periodRe = formatRe(locale_periods),\n periodLookup = formatLookup(locale_periods),\n weekdayRe = formatRe(locale_weekdays),\n weekdayLookup = formatLookup(locale_weekdays),\n shortWeekdayRe = formatRe(locale_shortWeekdays),\n shortWeekdayLookup = formatLookup(locale_shortWeekdays),\n monthRe = formatRe(locale_months),\n monthLookup = formatLookup(locale_months),\n shortMonthRe = formatRe(locale_shortMonths),\n shortMonthLookup = formatLookup(locale_shortMonths);\n\n var formats = {\n \"a\": formatShortWeekday,\n \"A\": formatWeekday,\n \"b\": formatShortMonth,\n \"B\": formatMonth,\n \"c\": null,\n \"d\": formatDayOfMonth,\n \"e\": formatDayOfMonth,\n \"f\": formatMicroseconds,\n \"g\": formatYearISO,\n \"G\": formatFullYearISO,\n \"H\": formatHour24,\n \"I\": formatHour12,\n \"j\": formatDayOfYear,\n \"L\": formatMilliseconds,\n \"m\": formatMonthNumber,\n \"M\": formatMinutes,\n \"p\": formatPeriod,\n \"q\": formatQuarter,\n \"Q\": formatUnixTimestamp,\n \"s\": formatUnixTimestampSeconds,\n \"S\": formatSeconds,\n \"u\": formatWeekdayNumberMonday,\n \"U\": formatWeekNumberSunday,\n \"V\": formatWeekNumberISO,\n \"w\": formatWeekdayNumberSunday,\n \"W\": formatWeekNumberMonday,\n \"x\": null,\n \"X\": null,\n \"y\": formatYear,\n \"Y\": formatFullYear,\n \"Z\": formatZone,\n \"%\": formatLiteralPercent\n };\n\n var utcFormats = {\n \"a\": formatUTCShortWeekday,\n \"A\": formatUTCWeekday,\n \"b\": formatUTCShortMonth,\n \"B\": formatUTCMonth,\n \"c\": null,\n \"d\": formatUTCDayOfMonth,\n \"e\": formatUTCDayOfMonth,\n \"f\": formatUTCMicroseconds,\n \"g\": formatUTCYearISO,\n \"G\": formatUTCFullYearISO,\n \"H\": formatUTCHour24,\n \"I\": formatUTCHour12,\n \"j\": formatUTCDayOfYear,\n \"L\": formatUTCMilliseconds,\n \"m\": formatUTCMonthNumber,\n \"M\": formatUTCMinutes,\n \"p\": formatUTCPeriod,\n \"q\": formatUTCQuarter,\n \"Q\": formatUnixTimestamp,\n \"s\": formatUnixTimestampSeconds,\n \"S\": formatUTCSeconds,\n \"u\": formatUTCWeekdayNumberMonday,\n \"U\": formatUTCWeekNumberSunday,\n \"V\": formatUTCWeekNumberISO,\n \"w\": formatUTCWeekdayNumberSunday,\n \"W\": formatUTCWeekNumberMonday,\n \"x\": null,\n \"X\": null,\n \"y\": formatUTCYear,\n \"Y\": formatUTCFullYear,\n \"Z\": formatUTCZone,\n \"%\": formatLiteralPercent\n };\n\n var parses = {\n \"a\": parseShortWeekday,\n \"A\": parseWeekday,\n \"b\": parseShortMonth,\n \"B\": parseMonth,\n \"c\": parseLocaleDateTime,\n \"d\": parseDayOfMonth,\n \"e\": parseDayOfMonth,\n \"f\": parseMicroseconds,\n \"g\": parseYear,\n \"G\": parseFullYear,\n \"H\": parseHour24,\n \"I\": parseHour24,\n \"j\": parseDayOfYear,\n \"L\": parseMilliseconds,\n \"m\": parseMonthNumber,\n \"M\": parseMinutes,\n \"p\": parsePeriod,\n \"q\": parseQuarter,\n \"Q\": parseUnixTimestamp,\n \"s\": parseUnixTimestampSeconds,\n \"S\": parseSeconds,\n \"u\": parseWeekdayNumberMonday,\n \"U\": parseWeekNumberSunday,\n \"V\": parseWeekNumberISO,\n \"w\": parseWeekdayNumberSunday,\n \"W\": parseWeekNumberMonday,\n \"x\": parseLocaleDate,\n \"X\": parseLocaleTime,\n \"y\": parseYear,\n \"Y\": parseFullYear,\n \"Z\": parseZone,\n \"%\": parseLiteralPercent\n };\n\n // These recursive directive definitions must be deferred.\n formats.x = newFormat(locale_date, formats);\n formats.X = newFormat(locale_time, formats);\n formats.c = newFormat(locale_dateTime, formats);\n utcFormats.x = newFormat(locale_date, utcFormats);\n utcFormats.X = newFormat(locale_time, utcFormats);\n utcFormats.c = newFormat(locale_dateTime, utcFormats);\n\n function newFormat(specifier, formats) {\n return function(date) {\n var string = [],\n i = -1,\n j = 0,\n n = specifier.length,\n c,\n pad,\n format;\n\n if (!(date instanceof Date)) date = new Date(+date);\n\n while (++i < n) {\n if (specifier.charCodeAt(i) === 37) {\n string.push(specifier.slice(j, i));\n if ((pad = pads[c = specifier.charAt(++i)]) != null) c = specifier.charAt(++i);\n else pad = c === \"e\" ? \" \" : \"0\";\n if (format = formats[c]) c = format(date, pad);\n string.push(c);\n j = i + 1;\n }\n }\n\n string.push(specifier.slice(j, i));\n return string.join(\"\");\n };\n }\n\n function newParse(specifier, Z) {\n return function(string) {\n var d = newDate(1900, undefined, 1),\n i = parseSpecifier(d, specifier, string += \"\", 0),\n week, day;\n if (i != string.length) return null;\n\n // If a UNIX timestamp is specified, return it.\n if (\"Q\" in d) return new Date(d.Q);\n if (\"s\" in d) return new Date(d.s * 1000 + (\"L\" in d ? d.L : 0));\n\n // If this is utcParse, never use the local timezone.\n if (Z && !(\"Z\" in d)) d.Z = 0;\n\n // The am-pm flag is 0 for AM, and 1 for PM.\n if (\"p\" in d) d.H = d.H % 12 + d.p * 12;\n\n // If the month was not specified, inherit from the quarter.\n if (d.m === undefined) d.m = \"q\" in d ? d.q : 0;\n\n // Convert day-of-week and week-of-year to day-of-year.\n if (\"V\" in d) {\n if (d.V < 1 || d.V > 53) return null;\n if (!(\"w\" in d)) d.w = 1;\n if (\"Z\" in d) {\n week = utcDate(newDate(d.y, 0, 1)), day = week.getUTCDay();\n week = day > 4 || day === 0 ? utcMonday.ceil(week) : utcMonday(week);\n week = utcDay.offset(week, (d.V - 1) * 7);\n d.y = week.getUTCFullYear();\n d.m = week.getUTCMonth();\n d.d = week.getUTCDate() + (d.w + 6) % 7;\n } else {\n week = localDate(newDate(d.y, 0, 1)), day = week.getDay();\n week = day > 4 || day === 0 ? timeMonday.ceil(week) : timeMonday(week);\n week = timeDay.offset(week, (d.V - 1) * 7);\n d.y = week.getFullYear();\n d.m = week.getMonth();\n d.d = week.getDate() + (d.w + 6) % 7;\n }\n } else if (\"W\" in d || \"U\" in d) {\n if (!(\"w\" in d)) d.w = \"u\" in d ? d.u % 7 : \"W\" in d ? 1 : 0;\n day = \"Z\" in d ? utcDate(newDate(d.y, 0, 1)).getUTCDay() : localDate(newDate(d.y, 0, 1)).getDay();\n d.m = 0;\n d.d = \"W\" in d ? (d.w + 6) % 7 + d.W * 7 - (day + 5) % 7 : d.w + d.U * 7 - (day + 6) % 7;\n }\n\n // If a time zone is specified, all fields are interpreted as UTC and then\n // offset according to the specified time zone.\n if (\"Z\" in d) {\n d.H += d.Z / 100 | 0;\n d.M += d.Z % 100;\n return utcDate(d);\n }\n\n // Otherwise, all fields are in local time.\n return localDate(d);\n };\n }\n\n function parseSpecifier(d, specifier, string, j) {\n var i = 0,\n n = specifier.length,\n m = string.length,\n c,\n parse;\n\n while (i < n) {\n if (j >= m) return -1;\n c = specifier.charCodeAt(i++);\n if (c === 37) {\n c = specifier.charAt(i++);\n parse = parses[c in pads ? specifier.charAt(i++) : c];\n if (!parse || ((j = parse(d, string, j)) < 0)) return -1;\n } else if (c != string.charCodeAt(j++)) {\n return -1;\n }\n }\n\n return j;\n }\n\n function parsePeriod(d, string, i) {\n var n = periodRe.exec(string.slice(i));\n return n ? (d.p = periodLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;\n }\n\n function parseShortWeekday(d, string, i) {\n var n = shortWeekdayRe.exec(string.slice(i));\n return n ? (d.w = shortWeekdayLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;\n }\n\n function parseWeekday(d, string, i) {\n var n = weekdayRe.exec(string.slice(i));\n return n ? (d.w = weekdayLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;\n }\n\n function parseShortMonth(d, string, i) {\n var n = shortMonthRe.exec(string.slice(i));\n return n ? (d.m = shortMonthLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;\n }\n\n function parseMonth(d, string, i) {\n var n = monthRe.exec(string.slice(i));\n return n ? (d.m = monthLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;\n }\n\n function parseLocaleDateTime(d, string, i) {\n return parseSpecifier(d, locale_dateTime, string, i);\n }\n\n function parseLocaleDate(d, string, i) {\n return parseSpecifier(d, locale_date, string, i);\n }\n\n function parseLocaleTime(d, string, i) {\n return parseSpecifier(d, locale_time, string, i);\n }\n\n function formatShortWeekday(d) {\n return locale_shortWeekdays[d.getDay()];\n }\n\n function formatWeekday(d) {\n return locale_weekdays[d.getDay()];\n }\n\n function formatShortMonth(d) {\n return locale_shortMonths[d.getMonth()];\n }\n\n function formatMonth(d) {\n return locale_months[d.getMonth()];\n }\n\n function formatPeriod(d) {\n return locale_periods[+(d.getHours() >= 12)];\n }\n\n function formatQuarter(d) {\n return 1 + ~~(d.getMonth() / 3);\n }\n\n function formatUTCShortWeekday(d) {\n return locale_shortWeekdays[d.getUTCDay()];\n }\n\n function formatUTCWeekday(d) {\n return locale_weekdays[d.getUTCDay()];\n }\n\n function formatUTCShortMonth(d) {\n return locale_shortMonths[d.getUTCMonth()];\n }\n\n function formatUTCMonth(d) {\n return locale_months[d.getUTCMonth()];\n }\n\n function formatUTCPeriod(d) {\n return locale_periods[+(d.getUTCHours() >= 12)];\n }\n\n function formatUTCQuarter(d) {\n return 1 + ~~(d.getUTCMonth() / 3);\n }\n\n return {\n format: function(specifier) {\n var f = newFormat(specifier += \"\", formats);\n f.toString = function() { return specifier; };\n return f;\n },\n parse: function(specifier) {\n var p = newParse(specifier += \"\", false);\n p.toString = function() { return specifier; };\n return p;\n },\n utcFormat: function(specifier) {\n var f = newFormat(specifier += \"\", utcFormats);\n f.toString = function() { return specifier; };\n return f;\n },\n utcParse: function(specifier) {\n var p = newParse(specifier += \"\", true);\n p.toString = function() { return specifier; };\n return p;\n }\n };\n}\n\nvar pads = {\"-\": \"\", \"_\": \" \", \"0\": \"0\"},\n numberRe = /^\\s*\\d+/, // note: ignores next directive\n percentRe = /^%/,\n requoteRe = /[\\\\^$*+?|[\\]().{}]/g;\n\nfunction pad(value, fill, width) {\n var sign = value < 0 ? \"-\" : \"\",\n string = (sign ? -value : value) + \"\",\n length = string.length;\n return sign + (length < width ? new Array(width - length + 1).join(fill) + string : string);\n}\n\nfunction requote(s) {\n return s.replace(requoteRe, \"\\\\$&\");\n}\n\nfunction formatRe(names) {\n return new RegExp(\"^(?:\" + names.map(requote).join(\"|\") + \")\", \"i\");\n}\n\nfunction formatLookup(names) {\n return new Map(names.map((name, i) => [name.toLowerCase(), i]));\n}\n\nfunction parseWeekdayNumberSunday(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 1));\n return n ? (d.w = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseWeekdayNumberMonday(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 1));\n return n ? (d.u = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseWeekNumberSunday(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.U = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseWeekNumberISO(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.V = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseWeekNumberMonday(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.W = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseFullYear(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 4));\n return n ? (d.y = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseYear(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.y = +n[0] + (+n[0] > 68 ? 1900 : 2000), i + n[0].length) : -1;\n}\n\nfunction parseZone(d, string, i) {\n var n = /^(Z)|([+-]\\d\\d)(?::?(\\d\\d))?/.exec(string.slice(i, i + 6));\n return n ? (d.Z = n[1] ? 0 : -(n[2] + (n[3] || \"00\")), i + n[0].length) : -1;\n}\n\nfunction parseQuarter(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 1));\n return n ? (d.q = n[0] * 3 - 3, i + n[0].length) : -1;\n}\n\nfunction parseMonthNumber(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.m = n[0] - 1, i + n[0].length) : -1;\n}\n\nfunction parseDayOfMonth(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.d = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseDayOfYear(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 3));\n return n ? (d.m = 0, d.d = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseHour24(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.H = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseMinutes(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.M = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseSeconds(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.S = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseMilliseconds(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 3));\n return n ? (d.L = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseMicroseconds(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 6));\n return n ? (d.L = Math.floor(n[0] / 1000), i + n[0].length) : -1;\n}\n\nfunction parseLiteralPercent(d, string, i) {\n var n = percentRe.exec(string.slice(i, i + 1));\n return n ? i + n[0].length : -1;\n}\n\nfunction parseUnixTimestamp(d, string, i) {\n var n = numberRe.exec(string.slice(i));\n return n ? (d.Q = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseUnixTimestampSeconds(d, string, i) {\n var n = numberRe.exec(string.slice(i));\n return n ? (d.s = +n[0], i + n[0].length) : -1;\n}\n\nfunction formatDayOfMonth(d, p) {\n return pad(d.getDate(), p, 2);\n}\n\nfunction formatHour24(d, p) {\n return pad(d.getHours(), p, 2);\n}\n\nfunction formatHour12(d, p) {\n return pad(d.getHours() % 12 || 12, p, 2);\n}\n\nfunction formatDayOfYear(d, p) {\n return pad(1 + timeDay.count(timeYear(d), d), p, 3);\n}\n\nfunction formatMilliseconds(d, p) {\n return pad(d.getMilliseconds(), p, 3);\n}\n\nfunction formatMicroseconds(d, p) {\n return formatMilliseconds(d, p) + \"000\";\n}\n\nfunction formatMonthNumber(d, p) {\n return pad(d.getMonth() + 1, p, 2);\n}\n\nfunction formatMinutes(d, p) {\n return pad(d.getMinutes(), p, 2);\n}\n\nfunction formatSeconds(d, p) {\n return pad(d.getSeconds(), p, 2);\n}\n\nfunction formatWeekdayNumberMonday(d) {\n var day = d.getDay();\n return day === 0 ? 7 : day;\n}\n\nfunction formatWeekNumberSunday(d, p) {\n return pad(timeSunday.count(timeYear(d) - 1, d), p, 2);\n}\n\nfunction dISO(d) {\n var day = d.getDay();\n return (day >= 4 || day === 0) ? timeThursday(d) : timeThursday.ceil(d);\n}\n\nfunction formatWeekNumberISO(d, p) {\n d = dISO(d);\n return pad(timeThursday.count(timeYear(d), d) + (timeYear(d).getDay() === 4), p, 2);\n}\n\nfunction formatWeekdayNumberSunday(d) {\n return d.getDay();\n}\n\nfunction formatWeekNumberMonday(d, p) {\n return pad(timeMonday.count(timeYear(d) - 1, d), p, 2);\n}\n\nfunction formatYear(d, p) {\n return pad(d.getFullYear() % 100, p, 2);\n}\n\nfunction formatYearISO(d, p) {\n d = dISO(d);\n return pad(d.getFullYear() % 100, p, 2);\n}\n\nfunction formatFullYear(d, p) {\n return pad(d.getFullYear() % 10000, p, 4);\n}\n\nfunction formatFullYearISO(d, p) {\n var day = d.getDay();\n d = (day >= 4 || day === 0) ? timeThursday(d) : timeThursday.ceil(d);\n return pad(d.getFullYear() % 10000, p, 4);\n}\n\nfunction formatZone(d) {\n var z = d.getTimezoneOffset();\n return (z > 0 ? \"-\" : (z *= -1, \"+\"))\n + pad(z / 60 | 0, \"0\", 2)\n + pad(z % 60, \"0\", 2);\n}\n\nfunction formatUTCDayOfMonth(d, p) {\n return pad(d.getUTCDate(), p, 2);\n}\n\nfunction formatUTCHour24(d, p) {\n return pad(d.getUTCHours(), p, 2);\n}\n\nfunction formatUTCHour12(d, p) {\n return pad(d.getUTCHours() % 12 || 12, p, 2);\n}\n\nfunction formatUTCDayOfYear(d, p) {\n return pad(1 + utcDay.count(utcYear(d), d), p, 3);\n}\n\nfunction formatUTCMilliseconds(d, p) {\n return pad(d.getUTCMilliseconds(), p, 3);\n}\n\nfunction formatUTCMicroseconds(d, p) {\n return formatUTCMilliseconds(d, p) + \"000\";\n}\n\nfunction formatUTCMonthNumber(d, p) {\n return pad(d.getUTCMonth() + 1, p, 2);\n}\n\nfunction formatUTCMinutes(d, p) {\n return pad(d.getUTCMinutes(), p, 2);\n}\n\nfunction formatUTCSeconds(d, p) {\n return pad(d.getUTCSeconds(), p, 2);\n}\n\nfunction formatUTCWeekdayNumberMonday(d) {\n var dow = d.getUTCDay();\n return dow === 0 ? 7 : dow;\n}\n\nfunction formatUTCWeekNumberSunday(d, p) {\n return pad(utcSunday.count(utcYear(d) - 1, d), p, 2);\n}\n\nfunction UTCdISO(d) {\n var day = d.getUTCDay();\n return (day >= 4 || day === 0) ? utcThursday(d) : utcThursday.ceil(d);\n}\n\nfunction formatUTCWeekNumberISO(d, p) {\n d = UTCdISO(d);\n return pad(utcThursday.count(utcYear(d), d) + (utcYear(d).getUTCDay() === 4), p, 2);\n}\n\nfunction formatUTCWeekdayNumberSunday(d) {\n return d.getUTCDay();\n}\n\nfunction formatUTCWeekNumberMonday(d, p) {\n return pad(utcMonday.count(utcYear(d) - 1, d), p, 2);\n}\n\nfunction formatUTCYear(d, p) {\n return pad(d.getUTCFullYear() % 100, p, 2);\n}\n\nfunction formatUTCYearISO(d, p) {\n d = UTCdISO(d);\n return pad(d.getUTCFullYear() % 100, p, 2);\n}\n\nfunction formatUTCFullYear(d, p) {\n return pad(d.getUTCFullYear() % 10000, p, 4);\n}\n\nfunction formatUTCFullYearISO(d, p) {\n var day = d.getUTCDay();\n d = (day >= 4 || day === 0) ? utcThursday(d) : utcThursday.ceil(d);\n return pad(d.getUTCFullYear() % 10000, p, 4);\n}\n\nfunction formatUTCZone() {\n return \"+0000\";\n}\n\nfunction formatLiteralPercent() {\n return \"%\";\n}\n\nfunction formatUnixTimestamp(d) {\n return +d;\n}\n\nfunction formatUnixTimestampSeconds(d) {\n return Math.floor(+d / 1000);\n}\n","import formatLocale from \"./locale.js\";\n\nvar locale;\nexport var timeFormat;\nexport var timeParse;\nexport var utcFormat;\nexport var utcParse;\n\ndefaultLocale({\n dateTime: \"%x, %X\",\n date: \"%-m/%-d/%Y\",\n time: \"%-I:%M:%S %p\",\n periods: [\"AM\", \"PM\"],\n days: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"],\n shortDays: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"],\n months: [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"],\n shortMonths: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"]\n});\n\nexport default function defaultLocale(definition) {\n locale = formatLocale(definition);\n timeFormat = locale.format;\n timeParse = locale.parse;\n utcFormat = locale.utcFormat;\n utcParse = locale.utcParse;\n return locale;\n}\n","import { utcFormat, utcParse } from \"d3-time-format\";\n\n// base url for images\nconst HIMAWARI_BASE_URL = \"https://himawari8-dl.nict.go.jp/himawari8/img/\";\nconst DSCOVR_BASE_URL = \"https://epic.gsfc.nasa.gov/\";\n\nconst SLIDER_BASE_URL = \"https://rammb-slider.cira.colostate.edu/data/\";\n\n// links to online image explorers\nconst HIMAWARI_EXPLORER = \"https://himawari8.nict.go.jp/himawari8-image.htm?sI=D531106\";\nconst DSCOVR_EXPLORER = \"https://epic.gsfc.nasa.gov\";\nconst DSCOVR_EXPLORER_ENHANCED = DSCOVR_EXPLORER + \"/enhanced\";\nconst SLIDER_EXPLORER = \"https://rammb-slider.cira.colostate.edu/\";\nconst METEOSAT_EXPLORER = \"https://eumetview.eumetsat.int/static-images/\";\n\n// image types\nconst INFRARED = \"INFRARED_FULL\";\nconst VISIBLE_LIGHT = \"D531106\";\nconst DSCOVR_EPIC = \"EPIC\";\nconst DSCOVR_EPIC_ENHANCED = \"EPIC_ENHANCED\";\nconst GOES_16 = \"GOES_16\";\nconst GOES_16_NATURAL = \"GOES_16_NATURAL\";\nconst GOES_17 = \"GOES_17\";\nconst GOES_17_NATURAL = \"GOES_17_NATURAL\";\nconst METEOSAT = \"METEOSAT\";\nconst METEOSAT_IODC = \"METEOSAT_IODC\";\n\ntype ImageType = typeof INFRARED | typeof VISIBLE_LIGHT | typeof DSCOVR_EPIC |\n typeof DSCOVR_EPIC_ENHANCED | typeof GOES_16 | typeof GOES_16_NATURAL | typeof GOES_17 | typeof GOES_17_NATURAL |\n typeof METEOSAT | typeof METEOSAT_IODC;\n\nconst HIMAWARI_WIDTH = 550;\nconst HIMAWARI_BLOCK_SIZES = [1, 4, 8, 16, 20];\n\nconst SLIDER_WIDTH = 678;\nconst SLIDER_BLOCK_SIZES = [1, 2, 4, 8, 16];\n\nconst DSCOVR_WIDTH = 2048;\n\nconst METEOSAT_WIDTH = 3712;\nconst METEOSAT_HEIGHT = 3630; // cut off white bar, credit in options\n\nconst IMAGE_QUALITY = 0.95;\nconst RELOAD_INTERVAL = 1 * 60 * 1000; // 1 minutes\nconst RELOAD_TIME_INTERVAL = 10 * 1000; // 10 seconds\n\n// local storage keys\nconst IMAGE_DATA_KEY = \"imageData\";\nconst CACHED_DATE_KEY = \"cachedDate\";\nconst CACHED_IMAGE_TYPE_KEY = \"cachedImageType\";\n\n// unknown date\nconst UNKNOWN: Date = null;\n\nconst isExtension = window['browser'] && !!browser.storage;\n\nconst DEFAULT_OPTIONS: {animated: boolean; imageType: ImageType} = {\n animated: false,\n imageType: VISIBLE_LIGHT,\n};\n\ninterface Tile {\n x: number;\n y: number;\n url: string;\n}\n\n/**\n * Create a cached URL thanks to our friends at Google.\n * See https://gist.github.com/carlo/5379498\n *\n * Default caching is 5 days, in seconds\n */\nfunction getCachedUrl(url: string, cache = 5 * 24 * 60 * 60) {\n if (isExtension) {\n // don't use cache in the extension\n return url;\n } else {\n return `https://images1-focus-opensocial.googleusercontent.com/gadgets/proxy?url=${url}&container=focus&refresh=${cache}`;\n }\n}\n\n/**\n * Pads a number with trailing zeros and makes it a string.\n */\nfunction pad(num: string | number, size: number) {\n let s = num + \"\";\n while (s.length < size) {\n s = \"0\" + s;\n }\n return s;\n}\n\n/**\n * Returns an array of objects containing URLs and metadata\n * for Himawari 8 image tiles based on a given date.\n * Options:\n * - date: Date object\n * - type: boolean (default: visible light)\n * - blocks: alternative to zoom, how many images per row/column (default: 1)\n * Has to be a valid block number (1, 4, 8, 16, 20)\n *\n * @param {Object} options\n */\nfunction himawariURLs(options: {date: Date; type?: ImageType; blocks: number}) {\n const baseURL = HIMAWARI_BASE_URL + (options.type || VISIBLE_LIGHT);\n const date = options.date;\n\n // Define some image parameters\n const blocks = options.blocks;\n\n // compose URL\n const tilesURL = `${baseURL}/${blocks}d/${HIMAWARI_WIDTH}/${utcFormat(\"%Y/%m/%d/%H%M%S\")(date)}`;\n const tiles: Tile[] = [];\n\n for (let y = 0; y < blocks; y++) {\n for (let x = 0; x < blocks; x++) {\n const url = `${tilesURL}_${x}_${y}.png`;\n\n tiles.push({\n url: getCachedUrl(url),\n x,\n y,\n });\n }\n }\n\n return {\n blocks,\n date,\n tiles,\n };\n}\n\nfunction sliderURLs(options: {date: Date; type: ImageType; blocks: number; level: number}) {\n const date = options.date;\n\n const blocks = options.blocks;\n const level = options.level;\n\n const typePath = {\n GOES_16: \"geocolor\",\n GOES_16_NATURAL: \"natural_color\",\n GOES_17: \"geocolor\",\n GOES_17_NATURAL: \"natural_color\",\n }[options.type];\n\n const which = {\n GOES_16: 16,\n GOES_16_NATURAL: 16,\n GOES_17: 17,\n GOES_17_NATURAL: 17,\n }[options.type];\n\n const formattedDate = utcFormat(\"%Y/%m/%d\")(options.date);\n const formattedDateTime = utcFormat(\"%Y%m%d%H%M%S\")(options.date);\n\n const tilesURL = `${SLIDER_BASE_URL}imagery/${formattedDate}/goes-${which}---full_disk/${typePath}/${formattedDateTime}/`;\n const tiles: Tile[] = [];\n\n for (let y = 0; y < blocks; y++) {\n for (let x = 0; x < blocks; x++) {\n const url = `${tilesURL}${pad(level, 2)}/${pad(y, 3)}_${pad(x, 3)}.png`;\n\n tiles.push({\n url: getCachedUrl(url),\n x,\n y,\n });\n }\n }\n\n return {\n blocks,\n date,\n tiles,\n };\n}\n\n/**\n * Get the date of the latest Himawari image by making an Ajax request.\n * @param {string} imageType The type of image\n * @returns {date} The parsed date\n */\nasync function getLatestHimawariDate(imageType: ImageType) {\n const raw = await fetch(`https://himawari-8.appspot.com/latest${imageType === INFRARED ? \"?infrared=true\" : \"\"}`);\n const data: {date: string} = await raw.json();\n\n const latest = data.date;\n return utcParse(\"%Y-%m-%d %H:%M:%S\")(latest)\n}\n\nasync function getLatestDscovrDate(imageType: ImageType) {\n const raw = await fetch(`${DSCOVR_BASE_URL}api/${imageType === DSCOVR_EPIC_ENHANCED ? \"enhanced\" : \"natural\"}`);\n const data: {date: string; image: string}[] = await raw.json();\n\n if (data.length === 0) { return null; }\n\n const latest = data[data.length - 1];\n return {\n date: utcParse(\"%Y-%m-%d %H:%M:%S\")(latest.date),\n image: latest.image,\n }\n}\n\nasync function getLatestSliderDate(imageType: ImageType) {\n const which = {\n GOES_16: 16,\n GOES_16_NATURAL: 16,\n GOES_17: 17,\n GOES_17_NATURAL: 17,\n }[imageType];\n\n const raw = await fetch(`${SLIDER_BASE_URL}json/goes-${which}/full_disk/geocolor/latest_times.json`);\n const data: {timestamps_int: string[]} = await raw.json();\n\n return utcParse(\"%Y%m%d%H%M%S\")(data.timestamps_int[0]);\n}\n\nasync function getLatestMeteosatDate(imageType: ImageType) {\n const raw = await fetch(`https://meteosat-url.appspot.com/msg${imageType === METEOSAT_IODC ? \"iodc\" : \"\"}`);\n const data: {url: string; date: string} = await raw.json();\n\n return {\n date: utcParse(\"%Y-%m-%d %H:%M:%S\")(data.date),\n image: data.url,\n }\n}\n\n/**\n * Looks at the screen resolution and figures out a zoom level that returns images at a sufficient resolution.\n */\nfunction getOptimalNumberOfBlocks(width: number, sizes: number[]): {blocks: number; level: number} {\n const height = (document.getElementById(\"output\")!).clientHeight * window.devicePixelRatio;\n const minNumber = height / width;\n\n for (let level = 0; level < sizes.length; level++) {\n const blocks = sizes[level];\n if (blocks > minNumber) {\n return {blocks, level};\n }\n }\n\n const lastLevel = sizes.length - 1;\n return {blocks: sizes[lastLevel], level: lastLevel};\n}\n\n// the date that is currently loaded\nlet loadedDate: Date = null;\nlet loadedType: ImageType = null;\n\nfunction timeSince(date: Date) {\n const seconds = Math.floor(((new Date()).getTime() - date.getTime()) / 1000);\n\n let interval = Math.floor(seconds / 31536000);\n\n if (interval > 1) {\n return interval + \" years\";\n }\n interval = Math.floor(seconds / 2592000);\n if (interval > 1) {\n return interval + \" months\";\n }\n interval = Math.floor(seconds / 86400);\n if (interval > 1) {\n return interval + \" days\";\n }\n interval = Math.floor(seconds / 3600);\n if (interval > 1) {\n return interval + \" hours\";\n }\n interval = Math.floor(seconds / 60);\n if (interval > 1) {\n return interval + \" minutes\";\n }\n return Math.floor(seconds) + \" seconds\";\n}\n\nfunction updateTimeAgo(date: Date) {\n if (date === UNKNOWN) {\n document.getElementById(\"time\").innerHTML = \"\";\n } else {\n document.getElementById(\"time\").innerHTML = `<abbr title=\"${date}\">${timeSince(date)}</abbr> ago`;\n }\n}\n\n/*\n * Set the right class on the body so that we can have different css.\n */\nfunction setBodyClass(imageType: ImageType) {\n document.body.classList.remove(\"himawari\");\n document.body.classList.remove(\"dscovr\");\n document.body.classList.remove(\"goes\");\n document.body.classList.remove(\"goes16\");\n document.body.classList.remove(\"meteosat\");\n\n switch (imageType) {\n case INFRARED:\n case VISIBLE_LIGHT:\n document.body.classList.add(\"himawari\");\n break;\n case DSCOVR_EPIC:\n case DSCOVR_EPIC_ENHANCED:\n document.body.classList.add(\"dscovr\");\n break;\n case GOES_16:\n case GOES_16_NATURAL:\n case GOES_17:\n case GOES_17_NATURAL:\n document.body.classList.add(\"goes\");\n break;\n case METEOSAT:\n case METEOSAT_IODC:\n document.body.classList.add(\"meteosat\");\n break;\n default:\n console.warn(\"Unknown image type\", imageType);\n }\n}\n\nfunction updateStateAndUI(date: Date, imageType: ImageType) {\n updateTimeAgo(date);\n loadedDate = date;\n setBodyClass(imageType);\n loadedType = imageType;\n}\n\n/**\n * Cache the image.\n */\nfunction storeCanvas(date: Date, imageType: ImageType, quality = IMAGE_QUALITY) {\n // put date and image data in cache\n const canvas = document.getElementById(\"output\") as HTMLCanvasElement;\n const imageData = canvas.toDataURL(\"image/jpeg\", quality);\n try {\n localStorage.setItem(IMAGE_DATA_KEY, imageData);\n } catch {\n // try again with lower quality\n if (quality > 0.5) {\n quality -= 0.05;\n console.warn(`Couldn't store image. Trying again with lower image quality of ${quality}`);\n return storeCanvas(date, imageType, quality);\n }\n }\n localStorage.setItem(CACHED_DATE_KEY, date.toString());\n localStorage.setItem(CACHED_IMAGE_TYPE_KEY, imageType);\n}\n\n/**\n * Creates an image composed of tiles.\n * @param {Date object} date The date for which to load the data.\n */\nfunction setHimawariImages(date: Date, imageType: ImageType) {\n // no need to set images if we have up to date images and the image type has not changed\n if (loadedDate && date.getTime() === loadedDate.getTime() && loadedType === imageType) {\n return;\n }\n\n // if we haven't loaded images before, we want to show progress\n const initialLoad = !localStorage.getItem(CACHED_DATE_KEY);\n\n // immediately set the type and body class because we are not loading in the background\n if (initialLoad) {\n updateStateAndUI(date, imageType);\n }\n\n // get the URLs for all tiles\n const result = himawariURLs({\n blocks: getOptimalNumberOfBlocks(HIMAWARI_WIDTH, HIMAWARI_BLOCK_SIZES).blocks,\n date,\n type: imageType,\n });\n\n const pixels = result.blocks * HIMAWARI_WIDTH;\n\n const canvas = initialLoad ? document.getElementById(\"output\") as HTMLCanvasElement : document.createElement(\"canvas\");\n const ctx = canvas.getContext(\"2d\")!;\n ctx.canvas.width = pixels;\n ctx.canvas.height = pixels;\n\n // add image to canvas\n function addImage(tile: Tile) {\n return new Promise<void>((resolve) => {\n const img = new Image();\n img.setAttribute(\"crossOrigin\", \"anonymous\");\n img.onload = () => {\n ctx.drawImage(img, tile.x * HIMAWARI_WIDTH, tile.y * HIMAWARI_WIDTH, HIMAWARI_WIDTH, HIMAWARI_WIDTH);\n resolve();\n };\n img.src = tile.url;\n });\n }\n\n Promise.all(result.tiles.map(tile => addImage(tile)))\n .catch(error => {\n throw error;\n })\n .then(() => {\n if (!initialLoad) {\n // copy canvas into output in one step\n const output = document.getElementById(\"output\") as HTMLCanvasElement;\n const outCtx = output.getContext(\"2d\");\n outCtx.canvas.width = pixels;\n outCtx.canvas.height = pixels;\n outCtx.drawImage(canvas, 0, 0);\n }\n\n updateStateAndUI(date, imageType);\n\n storeCanvas(date, imageType);\n });\n}\n\nfunction setDscovrImage(latest: {date: Date; image: string}, imageType: ImageType) {\n // no need to set images if we have up to date images and the image type has not changed\n if (loadedDate && latest.date.getTime() === loadedDate.getTime() && loadedType === imageType) {\n return;\n }\n\n // if we haven't loaded images before, we want to show progress\n const initialLoad = !localStorage.getItem(CACHED_DATE_KEY);\n\n // immediately set the type and body class because we are not loading in the background\n if (initialLoad) {\n updateStateAndUI(latest.date, imageType);\n }\n\n const canvas = initialLoad ? document.getElementById(\"output\") as HTMLCanvasElement : document.createElement(\"canvas\");\n const ctx = canvas.getContext(\"2d\");\n ctx.canvas.width = DSCOVR_WIDTH;\n ctx.canvas.height = DSCOVR_WIDTH;\n\n const img = new Image();\n img.setAttribute(\"crossOrigin\", \"anonymous\");\n img.onload = () => {\n ctx.drawImage(img, 0, 0);\n\n if (!initialLoad) {\n // copy canvas into output in one step\n const output = document.getElementById(\"output\") as HTMLCanvasElement;\n const outCtx = output.getContext(\"2d\");\n outCtx.canvas.width = DSCOVR_WIDTH;\n outCtx.canvas.height = DSCOVR_WIDTH;\n outCtx.drawImage(canvas, 0, 0);\n }\n\n updateStateAndUI(latest.date, imageType);\n\n storeCanvas(latest.date, imageType);\n };\n\n const type = imageType === DSCOVR_EPIC_ENHANCED ? \"enhanced\" : \"natural\";\n const month = pad(latest.date.getMonth() + 1, 2);\n const date = pad(latest.date.getDate(), 2);\n img.src = getCachedUrl(`${DSCOVR_BASE_URL}archive/${type}/${latest.date.getFullYear()}/${month}/${date}/png/${latest.image}.png`);\n}\n\nfunction setSliderImages(date: Date, imageType: ImageType) {\n // no need to set images if we have up to date images and the image type has not changed\n if (loadedDate && date.getTime() === loadedDate.getTime() && loadedType === imageType) {\n return;\n }\n\n // if we haven't loaded images before, we want to show progress\n const initialLoad = !localStorage.getItem(CACHED_DATE_KEY);\n\n // immediately set the type and body class because we are not loading in the background\n if (initialLoad) {\n updateStateAndUI(date, imageType);\n }\n\n // get the URLs for all tiles\n const result = sliderURLs({\n date,\n type: imageType,\n ...getOptimalNumberOfBlocks(SLIDER_WIDTH, SLIDER_BLOCK_SIZES),\n });\n\n const pixels = result.blocks * SLIDER_WIDTH;\n\n const canvas = initialLoad ? document.getElementById(\"output\") as HTMLCanvasElement : document.createElement(\"canvas\");\n const ctx = canvas.getContext(\"2d\")!;\n ctx.canvas.width = pixels;\n ctx.canvas.height = pixels;\n\n // add image to canvas\n function addImage(tile: Tile) {\n return new Promise<void>((resolve) => {\n const img = new Image();\n img.setAttribute(\"crossOrigin\", \"anonymous\");\n img.onload = () => {\n ctx.drawImage(img, tile.x * SLIDER_WIDTH, tile.y * SLIDER_WIDTH, SLIDER_WIDTH, SLIDER_WIDTH);\n resolve();\n };\n img.src = tile.url;\n });\n }\n\n Promise.all(result.tiles.map(tile => addImage(tile)))\n .catch(error => {\n throw error;\n })\n .then(() => {\n if (!initialLoad) {\n // copy canvas into output in one step\n const output = document.getElementById(\"output\") as HTMLCanvasElement;\n const outCtx = output.getContext(\"2d\");\n outCtx.canvas.width = pixels;\n outCtx.canvas.height = pixels;\n outCtx.drawImage(canvas, 0, 0);\n }\n\n updateStateAndUI(date, imageType);\n\n storeCanvas(date, imageType);\n });\n}\n\nfunction setMeteosatImages(latest: {date: Date; image: string}, imageType: ImageType) {\n // no need to set images if we have up to date images and the image type has not changed\n if (loadedDate && latest.date.getTime() === loadedDate.getTime() && loadedType === imageType) {\n return;\n }\n\n // if we haven't loaded images before, we want to show progress\n const initialLoad = !localStorage.getItem(CACHED_DATE_KEY);\n\n // immediately set the type and body class because we are not loading in the background\n if (initialLoad) {\n updateStateAndUI(latest.date, imageType);\n }\n\n const canvas = initialLoad ? document.getElementById(\"output\") as HTMLCanvasElement : document.createElement(\"canvas\");\n const ctx = canvas.getContext(\"2d\");\n ctx.canvas.width = METEOSAT_WIDTH;\n ctx.canvas.height = METEOSAT_HEIGHT;\n\n const img = new Image();\n img.setAttribute(\"crossOrigin\", \"anonymous\");\n img.onload = () => {\n ctx.drawImage(img, 0, 0);\n\n if (!initialLoad) {\n // copy canvas into output in one step\n const output = document.getElementById(\"output\") as HTMLCanvasElement;\n const outCtx = output.getContext(\"2d\");\n outCtx.canvas.width = METEOSAT_WIDTH;\n outCtx.canvas.height = METEOSAT_HEIGHT;\n outCtx.drawImage(canvas, 0, 0);\n }\n\n updateStateAndUI(latest.date, imageType);\n\n storeCanvas(latest.date, imageType);\n };\n\n img.src = getCachedUrl(latest.image);\n}\n\n/* Load latest image(s) date and images for that date */\nasync function setLatestImage() {\n if (!navigator.onLine) {\n // browser is offline, no need to do this\n return;\n }\n\n if (isExtension) {\n document.title = \"New Tab\";\n\n const {imageType} = await browser.storage.sync.get(DEFAULT_OPTIONS)\n\n switch (imageType) {\n case DSCOVR_EPIC:\n case DSCOVR_EPIC_ENHANCED:\n setDscovrImage(await getLatestDscovrDate(imageType), imageType);\n break;\n case GOES_16:\n case GOES_16_NATURAL:\n case GOES_17:\n case GOES_17_NATURAL:\n setSliderImages(await getLatestSliderDate(imageType), imageType);\n break;\n case METEOSAT:\n case METEOSAT_IODC:\n setMeteosatImages(await getLatestMeteosatDate(imageType), imageType)\n break;\n case INFRARED:\n case VISIBLE_LIGHT:\n default:\n setHimawariImages(await getLatestHimawariDate(imageType), imageType)\n break;\n }\n } else {\n // if we are not in the extension, let's always load visible light\n setHimawariImages(await getLatestHimawariDate(VISIBLE_LIGHT), VISIBLE_LIGHT)\n }\n}\n\n/** Load image from local storage */\nfunction setCachedImage() {\n const canvas = document.getElementById(\"output\") as HTMLCanvasElement;\n const ctx = canvas.getContext(\"2d\");\n const date = new Date(localStorage.getItem(CACHED_DATE_KEY));\n\n const img = new Image();\n img.onload = () => {\n ctx.canvas.width = img.width;\n ctx.canvas.height = img.height;\n ctx.drawImage(img, 0, 0);\n\n updateStateAndUI(date, localStorage.getItem(CACHED_IMAGE_TYPE_KEY) as ImageType);\n };\n img.src = localStorage.getItem(IMAGE_DATA_KEY);\n}\n\n// check if there are new images form time to time\nwindow.setInterval(setLatestImage, RELOAD_INTERVAL);\n\n// also load a new image when we come back online\nwindow.addEventListener(\"online\", setLatestImage);\n\nfunction init() {\n // initial loading\n if (localStorage.getItem(CACHED_DATE_KEY)) {\n setCachedImage();\n }\n setLatestImage();\n}\n\n// enable or disable animation\nif (isExtension) {\n browser.storage.sync.get(DEFAULT_OPTIONS).then(options => {\n if (options.animated) {\n document.body.classList.add(\"animated\");\n } else {\n document.body.classList.remove(\"animated\");\n }\n init();\n });\n} else {\n init();\n}\n\n// update the time ago\nwindow.setInterval(() => {\n if (loadedDate) {\n updateTimeAgo(loadedDate);\n }\n}, RELOAD_TIME_INTERVAL);\n\n// hide some things if we are not an extension\nif (isExtension) {\n // when we are in an extension and the storage updates, try to load the new image\n browser.storage.onChanged.addListener(setLatestImage);\n\n document.body.classList.add(\"extension\");\n document.getElementById(\"go-to-options\").addEventListener(\"click\", () => {\n browser.runtime.openOptionsPage();\n });\n}\n\ndocument.getElementById(\"explore\").addEventListener(\"click\", () => {\n switch (loadedType) {\n case DSCOVR_EPIC:\n window.open(DSCOVR_EXPLORER, \"_self\");\n break;\n case DSCOVR_EPIC_ENHANCED:\n window.open(DSCOVR_EXPLORER_ENHANCED, \"_self\");\n break;\n case GOES_16:\n case GOES_16_NATURAL:\n case GOES_17:\n case GOES_17_NATURAL:\n window.open(SLIDER_EXPLORER, \"_self\");\n break;\n case INFRARED:\n case VISIBLE_LIGHT:\n window.open(HIMAWARI_EXPLORER, \"_self\");\n break;\n case METEOSAT:\n case METEOSAT_IODC:\n window.open(METEOSAT_EXPLORER, \"_self\");\n break;\n default:\n window.alert(\"No explorer found.\");\n break;\n }\n});\n"],"names":["t0","Date","t1","newInterval","floori","offseti","count","field","interval","date","arguments","length","floor","ceil","round","d0","d1","offset","step","Math","range","start","stop","previous","push","filter","test","setTime","end","every","isFinite","d","durationMinute","durationSecond","durationDay","durationHour","durationWeek","day","setHours","setDate","getDate","getTimezoneOffset","timeDay","weekday","i","getDay","sunday","monday","tuesday","wednesday","thursday","friday","saturday","year","setMonth","setFullYear","getFullYear","k","timeYear","utcDay","setUTCHours","setUTCDate","getUTCDate","utcDay$1","utcWeekday","getUTCDay","utcSunday","utcMonday","utcTuesday","utcWednesday","utcThursday","utcFriday","utcSaturday","utcYear","setUTCMonth","setUTCFullYear","getUTCFullYear","utcYear$1","localDate","y","m","H","M","S","L","utcDate","UTC","newDate","locale","utcFormat","utcParse","pads","_","numberRe","percentRe","requoteRe","pad","value","fill","width","sign","string","Array","join","requote","s","replace","formatRe","names","RegExp","map","formatLookup","Map","name","toLowerCase","parseWeekdayNumberSunday","n","exec","slice","w","parseWeekdayNumberMonday","u","parseWeekNumberSunday","U","parseWeekNumberISO","V","parseWeekNumberMonday","W","parseFullYear","parseYear","parseZone","Z","parseQuarter","q","parseMonthNumber","parseDayOfMonth","parseDayOfYear","parseHour24","parseMinutes","parseSeconds","parseMilliseconds","parseMicroseconds","parseLiteralPercent","parseUnixTimestamp","Q","parseUnixTimestampSeconds","formatDayOfMonth","p","formatHour24","getHours","formatHour12","formatDayOfYear","formatMilliseconds","getMilliseconds","formatMicroseconds","formatMonthNumber","getMonth","formatMinutes","getMinutes","formatSeconds","getSeconds","formatWeekdayNumberMonday","formatWeekNumberSunday","timeSunday","dISO","timeThursday","formatWeekNumberISO","formatWeekdayNumberSunday","formatWeekNumberMonday","timeMonday","formatYear","formatYearISO","formatFullYear","formatFullYearISO","formatZone","z","formatUTCDayOfMonth","formatUTCHour24","getUTCHours","formatUTCHour12","formatUTCDayOfYear","formatUTCMilliseconds","getUTCMilliseconds","formatUTCMicroseconds","formatUTCMonthNumber","getUTCMonth","formatUTCMinutes","getUTCMinutes","formatUTCSeconds","getUTCSeconds","formatUTCWeekdayNumberMonday","dow","formatUTCWeekNumberSunday","UTCdISO","formatUTCWeekNumberISO","formatUTCWeekdayNumberSunday","formatUTCWeekNumberMonday","formatUTCYear","formatUTCYearISO","formatUTCFullYear","formatUTCFullYearISO","formatUTCZone","formatLiteralPercent","formatUnixTimestamp","formatUnixTimestampSeconds","locale_dateTime","dateTime","locale_date","locale_time","time","locale_periods","periods","locale_weekdays","days","locale_shortWeekdays","shortDays","locale_months","months","locale_shortMonths","shortMonths","periodRe","periodLookup","weekdayRe","weekdayLookup","shortWeekdayRe","shortWeekdayLookup","monthRe","monthLookup","shortMonthRe","shortMonthLookup","formats","a","A","b","B","c","e","f","g","G","I","j","x","X","Y","utcFormats","parses","get","parseSpecifier","newFormat","specifier","format","charCodeAt","charAt","newParse","week","undefined","parse","toString","formatLocale","DSCOVR_BASE_URL","SLIDER_BASE_URL","DSCOVR_EXPLORER","DSCOVR_EXPLORER_ENHANCED","INFRARED","VISIBLE_LIGHT","DSCOVR_EPIC","DSCOVR_EPIC_ENHANCED","GOES_16","GOES_16_NATURAL","GOES_17","GOES_17_NATURAL","METEOSAT","METEOSAT_IODC","HIMAWARI_WIDTH","HIMAWARI_BLOCK_SIZES","SLIDER_WIDTH","SLIDER_BLOCK_SIZES","DSCOVR_WIDTH","IMAGE_DATA_KEY","CACHED_DATE_KEY","CACHED_IMAGE_TYPE_KEY","isExtension","window","browser","storage","DEFAULT_OPTIONS","animated","imageType","getCachedUrl","url","cache","num","size","async","getLatestHimawariDate","raw","fetch","latest","json","getOptimalNumberOfBlocks","sizes","minNumber","document","getElementById","clientHeight","devicePixelRatio","level","blocks","lastLevel","loadedDate","loadedType","updateTimeAgo","innerHTML","seconds","getTime","timeSince","updateStateAndUI","body","classList","remove","add","console","warn","setBodyClass","storeCanvas","quality","imageData","toDataURL","localStorage","setItem","setHimawariImages","initialLoad","getItem","result","options","baseURL","type","tilesURL","tiles","himawariURLs","pixels","canvas","createElement","ctx","getContext","height","Promise","all","tile","resolve","img","Image","setAttribute","onload","drawImage","src","addImage","catch","error","then","outCtx","setSliderImages","typePath","which","formattedDate","formattedDateTime","sliderURLs","setLatestImage","navigator","onLine","title","sync","month","image","setDscovrImage","data","getLatestDscovrDate","timestamps_int","getLatestSliderDate","setMeteosatImages","getLatestMeteosatDate","init","setCachedImage","setInterval","addEventListener","onChanged","addListener","runtime","openOptionsPage","open","alert"],"mappings":"yBAAA,IAAIA,EAAK,IAAIC,KACTC,EAAK,IAAID,KAEE,SAASE,EAAYC,EAAQC,EAASC,EAAOC,GAE1D,SAASC,EAASC,GAChB,OAAOL,EAAOK,EAA4B,IAArBC,UAAUC,OAAe,IAAIV,KAAO,IAAIA,MAAMQ,IAAQA,CAC5E,CA6DD,OA3DAD,EAASI,MAAQ,SAASH,GACxB,OAAOL,EAAOK,EAAO,IAAIR,MAAMQ,IAAQA,CAC3C,EAEED,EAASK,KAAO,SAASJ,GACvB,OAAOL,EAAOK,EAAO,IAAIR,KAAKQ,EAAO,IAAKJ,EAAQI,EAAM,GAAIL,EAAOK,GAAOA,CAC9E,EAEED,EAASM,MAAQ,SAASL,GACxB,IAAIM,EAAKP,EAASC,GACdO,EAAKR,EAASK,KAAKJ,GACvB,OAAOA,EAAOM,EAAKC,EAAKP,EAAOM,EAAKC,CACxC,EAEER,EAASS,OAAS,SAASR,EAAMS,GAC/B,OAAOb,EAAQI,EAAO,IAAIR,MAAMQ,GAAe,MAARS,EAAe,EAAIC,KAAKP,MAAMM,IAAQT,CACjF,EAEED,EAASY,MAAQ,SAASC,EAAOC,EAAMJ,GACrC,IAAgBK,EAAZH,EAAQ,GAGZ,GAFAC,EAAQb,EAASK,KAAKQ,GACtBH,EAAe,MAARA,EAAe,EAAIC,KAAKP,MAAM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