diff --git a/src/crack.ts b/src/crack.ts index 3575782..cf9a791 100644 --- a/src/crack.ts +++ b/src/crack.ts @@ -17,7 +17,7 @@ export default class Crack { start(x: number, y: number, angle: number) { this.x = x + .61 * Math.cos(angle * Math.PI / 180) this.y = y + .61 * Math.sin(angle * Math.PI / 180) - const flip = Math.random() < 0.5 + const flip = Math.random() > 0.5 this.angle = angle + (90 + Math.floor(Math.random() * 4.1 - 2)) * (flip ? -1 : 1) } diff --git a/src/launch.ts b/src/launch.ts index 88be0f0..40b5581 100644 --- a/src/launch.ts +++ b/src/launch.ts @@ -4,13 +4,11 @@ import Weather from "./weather" const ready = (func: () => void) => document.readyState !== "loading" ? func() : document.addEventListener("DOMContentLoaded", func) ready(() => { new Substrate(20) -}) -/* -let weather: Weather -navigator.geolocation.getCurrentPosition(position => { - weather = new Weather(position.coords.latitude, position.coords.longitude) -}, () => { - weather = new Weather() -}) - */ \ No newline at end of file + let weather: Weather + navigator.geolocation.getCurrentPosition(position => { + weather = new Weather(position.coords.latitude, position.coords.longitude) + }, () => { + weather = new Weather() + }) +}) \ No newline at end of file diff --git a/src/state.ts b/src/state.ts index 37988b2..bb85831 100644 --- a/src/state.ts +++ b/src/state.ts @@ -4,9 +4,20 @@ export default class State { readonly canvas: HTMLCanvasElement readonly maxCracks: number readonly grid: number[][] + readonly canvasColors = [ + "rgb(27 27 27 / 90%)", + "rgb(90 90 90 / 90%)", + "rgb(126 126 126 / 90%)", + "rgb(180 180 180 / 90%)", + "rgb(255 255 255 / 90%)", + "rgb(180 180 180 / 90%)", + "rgb(126 126 126 / 90%)", + "rgb(90 90 90 / 90%)" + ] colors: number[] seeds: {x: number, y: number}[] cracks: Crack[] + canvasIndex: number = 0 colorIndex: number = 0 constructor(colors: number[], maxCracks: number, canvas: HTMLCanvasElement) { @@ -30,7 +41,7 @@ export default class State { const height = this.canvas.height const width = this.canvas.width const context = this.canvas.getContext("2d") - context.fillStyle = "rgb(255 255 255 / 95%)" + context.fillStyle = this.canvasColors[this.canvasIndex++ % this.canvasColors.length] context.fillRect(0, 0, width, height) for (let x = 0; x < width; x++) { diff --git a/src/weather.ts b/src/weather.ts index f36280f..323ba19 100644 --- a/src/weather.ts +++ b/src/weather.ts @@ -1,21 +1,52 @@ import { fetchWeatherApi } from 'openmeteo' export default class Weather { + private readonly apiUrl = "https://api.open-meteo.com/v1/forecast" private readonly options: WeatherOptions + private readonly dailyVariables = ["temperature_2m_max", "temperature_2m_min", "sunrise", "sunset", "uv_index_max", "precipitation_sum", "precipitation_hours", "wind_speed_10m_max", "wind_gusts_10m_max", "wind_direction_10m_dominant"] + private readonly hourlyVariables = ["temperature_2m", "precipitation", "precipitation_probability"] + private readonly currentVariables = ["temperature_2m", "relative_humidity_2m", "apparent_temperature", "precipitation", "wind_speed_10m", "wind_gusts_10m", "wind_direction_10m"] + private lastFetched: LastFetched + current: CurrentWeather + hourly: HourlyWeather[] = [] + daily: DailyWeather[] = [] constructor(latitude?: number, longitude?: number) { - latitude ??= 47.61002138071677 - longitude ??= -122.17906310779568 + this.options = new WeatherOptions(latitude ?? 47.61002138071677, longitude ?? -122.17906310779568) - this.options = new WeatherOptions() - this.options = { ...this.options, latitude, longitude } - - this.getWeather(this.options) + const me = this + me.getWeather().then(() => { + }) } - async getWeather(options: WeatherOptions) { - const url = "https://api.open-meteo.com/v1/forecast" - const responses = await fetchWeatherApi(url, this.options) + async getWeather(): Promise { + const me = this + const parameters: any = { ...me.options } + + if (!me.lastFetched) { + parameters["daily"] = me.dailyVariables + parameters["hourly"] = me.hourlyVariables + parameters["current"] = me.currentVariables + me.lastFetched = new LastFetched() + } else { + // Reasonable-ish timers? + if (me.lastFetched.minutesSinceCurrent() > 15) { + parameters["current"] = me.currentVariables + me.lastFetched.current = new Date() + } + + if (me.lastFetched.hoursSinceHourly() > 3) { + parameters["hourly"] = me.hourlyVariables + me.lastFetched.hourly = new Date() + } + + if (me.lastFetched.hoursSinceDaily() > 8) { + parameters["daily"] = me.dailyVariables + me.lastFetched.daily = new Date() + } + } + + const responses = await fetchWeatherApi(me.apiUrl, parameters) for (const response of responses) { // Attributes for timezone and location @@ -73,6 +104,8 @@ export default class Weather { }, } + console.log(weatherData) + // `weatherData` now contains a simple structure with arrays for datetime and weather data for (let i = 0; i < weatherData.hourly.time.length; i++) { console.log( @@ -102,13 +135,73 @@ export default class Weather { } class WeatherOptions { - latitude: number - longitude: number - daily: string[] = ["temperature_2m_max", "temperature_2m_min", "sunrise", "sunset", "uv_index_max", "precipitation_sum", "precipitation_hours", "wind_speed_10m_max", "wind_gusts_10m_max", "wind_direction_10m_dominant"] - hourly: string[] = ["temperature_2m", "precipitation", "precipitation_probability"] - current: string[] = ["temperature_2m", "relative_humidity_2m", "apparent_temperature", "precipitation", "wind_speed_10m", "wind_gusts_10m", "wind_direction_10m"] - timezone: string = "America/Los_Angeles" - "wind_speed_unit": string = "mph" - "temperature_unit": string = "fahrenheit" - "precipitation_unit": string = "inch" + readonly latitude: number + readonly longitude: number + readonly timezone: string = "America/Los_Angeles" + "wind_speed_unit" = "mph" + "temperature_unit" = "fahrenheit" + "precipitation_unit" = "inch" + + constructor(latitude: number, longitude: number, timezone = "America/Los_Angeles") { + this.latitude = latitude + this.longitude = longitude + this.timezone = timezone + } +} + +class CurrentWeather { + time: Date + temperature: number + humidity: number + feelsLike: number + precipitation: number + windSpeed: number + windGusts: number + windDirection: number +} + +class DailyWeather { + hoursOfPrecipitation: number + totalPrecipitation: number + sunrise: Date + sunset: Date + maxTemperature: number + minTemperature: number + maxUV: number + prominentWindDirection: number + maxWindGusts: number + maxWindSpeed: number + asOf: Date +} + +class HourlyWeather { + time: Date + precipitation: number + precipitationProbability: number + temperature: number +} + +class LastFetched { + current: Date + hourly: Date + daily: Date + + constructor() { + const now = new Date() + this.current = now + this.hourly = now + this.daily = now + } + + minutesSinceCurrent(): number { + return 0 + } + + hoursSinceHourly(): number { + return 0 + } + + hoursSinceDaily(): number { + return 0 + } } \ No newline at end of file diff --git a/www/main.js b/www/main.js index 7edcd79..2944abb 100644 --- a/www/main.js +++ b/www/main.js @@ -2,6 +2,1712 @@ /******/ "use strict"; /******/ var __webpack_modules__ = ({ +/***/ "./node_modules/@openmeteo/sdk/aggregation.js": +/*!****************************************************!*\ + !*** ./node_modules/@openmeteo/sdk/aggregation.js ***! + \****************************************************/ +/***/ ((__unused_webpack_module, exports) => { + + +// automatically generated by the FlatBuffers compiler, do not modify +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.Aggregation = void 0; +/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */ +var Aggregation; +(function (Aggregation) { + Aggregation[Aggregation["none"] = 0] = "none"; + Aggregation[Aggregation["minimum"] = 1] = "minimum"; + Aggregation[Aggregation["maximum"] = 2] = "maximum"; + Aggregation[Aggregation["mean"] = 3] = "mean"; + Aggregation[Aggregation["p10"] = 4] = "p10"; + Aggregation[Aggregation["p25"] = 5] = "p25"; + Aggregation[Aggregation["median"] = 6] = "median"; + Aggregation[Aggregation["p75"] = 7] = "p75"; + Aggregation[Aggregation["p90"] = 8] = "p90"; + Aggregation[Aggregation["dominant"] = 9] = "dominant"; + Aggregation[Aggregation["sum"] = 10] = "sum"; + Aggregation[Aggregation["spread"] = 11] = "spread"; +})(Aggregation || (exports.Aggregation = Aggregation = {})); + + +/***/ }), + +/***/ "./node_modules/@openmeteo/sdk/model.js": +/*!**********************************************!*\ + !*** ./node_modules/@openmeteo/sdk/model.js ***! + \**********************************************/ +/***/ ((__unused_webpack_module, exports) => { + + +// automatically generated by the FlatBuffers compiler, do not modify +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.Model = void 0; +/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */ +var Model; +(function (Model) { + Model[Model["undefined"] = 0] = "undefined"; + Model[Model["best_match"] = 1] = "best_match"; + Model[Model["gfs_seamless"] = 2] = "gfs_seamless"; + Model[Model["gfs_global"] = 3] = "gfs_global"; + Model[Model["gfs_hrrr"] = 4] = "gfs_hrrr"; + Model[Model["meteofrance_seamless"] = 5] = "meteofrance_seamless"; + Model[Model["meteofrance_arpege_seamless"] = 6] = "meteofrance_arpege_seamless"; + Model[Model["meteofrance_arpege_world"] = 7] = "meteofrance_arpege_world"; + Model[Model["meteofrance_arpege_europe"] = 8] = "meteofrance_arpege_europe"; + Model[Model["meteofrance_arome_seamless"] = 9] = "meteofrance_arome_seamless"; + Model[Model["meteofrance_arome_france"] = 10] = "meteofrance_arome_france"; + Model[Model["meteofrance_arome_france_hd"] = 11] = "meteofrance_arome_france_hd"; + Model[Model["jma_seamless"] = 12] = "jma_seamless"; + Model[Model["jma_msm"] = 13] = "jma_msm"; + Model[Model["jms_gsm"] = 14] = "jms_gsm"; + Model[Model["jma_gsm"] = 15] = "jma_gsm"; + Model[Model["gem_seamless"] = 16] = "gem_seamless"; + Model[Model["gem_global"] = 17] = "gem_global"; + Model[Model["gem_regional"] = 18] = "gem_regional"; + Model[Model["gem_hrdps_continental"] = 19] = "gem_hrdps_continental"; + Model[Model["icon_seamless"] = 20] = "icon_seamless"; + Model[Model["icon_global"] = 21] = "icon_global"; + Model[Model["icon_eu"] = 22] = "icon_eu"; + Model[Model["icon_d2"] = 23] = "icon_d2"; + Model[Model["ecmwf_ifs04"] = 24] = "ecmwf_ifs04"; + Model[Model["metno_nordic"] = 25] = "metno_nordic"; + Model[Model["era5_seamless"] = 26] = "era5_seamless"; + Model[Model["era5"] = 27] = "era5"; + Model[Model["cerra"] = 28] = "cerra"; + Model[Model["era5_land"] = 29] = "era5_land"; + Model[Model["ecmwf_ifs"] = 30] = "ecmwf_ifs"; + Model[Model["gwam"] = 31] = "gwam"; + Model[Model["ewam"] = 32] = "ewam"; + Model[Model["glofas_seamless_v3"] = 33] = "glofas_seamless_v3"; + Model[Model["glofas_forecast_v3"] = 34] = "glofas_forecast_v3"; + Model[Model["glofas_consolidated_v3"] = 35] = "glofas_consolidated_v3"; + Model[Model["glofas_seamless_v4"] = 36] = "glofas_seamless_v4"; + Model[Model["glofas_forecast_v4"] = 37] = "glofas_forecast_v4"; + Model[Model["glofas_consolidated_v4"] = 38] = "glofas_consolidated_v4"; + Model[Model["gfs025"] = 39] = "gfs025"; + Model[Model["gfs05"] = 40] = "gfs05"; + Model[Model["CMCC_CM2_VHR4"] = 41] = "CMCC_CM2_VHR4"; + Model[Model["FGOALS_f3_H_highresSST"] = 42] = "FGOALS_f3_H_highresSST"; + Model[Model["FGOALS_f3_H"] = 43] = "FGOALS_f3_H"; + Model[Model["HiRAM_SIT_HR"] = 44] = "HiRAM_SIT_HR"; + Model[Model["MRI_AGCM3_2_S"] = 45] = "MRI_AGCM3_2_S"; + Model[Model["EC_Earth3P_HR"] = 46] = "EC_Earth3P_HR"; + Model[Model["MPI_ESM1_2_XR"] = 47] = "MPI_ESM1_2_XR"; + Model[Model["NICAM16_8S"] = 48] = "NICAM16_8S"; + Model[Model["cams_europe"] = 49] = "cams_europe"; + Model[Model["cams_global"] = 50] = "cams_global"; + Model[Model["cfsv2"] = 51] = "cfsv2"; + Model[Model["era5_ocean"] = 52] = "era5_ocean"; + Model[Model["cma_grapes_global"] = 53] = "cma_grapes_global"; + Model[Model["bom_access_global"] = 54] = "bom_access_global"; + Model[Model["bom_access_global_ensemble"] = 55] = "bom_access_global_ensemble"; + Model[Model["arpae_cosmo_seamless"] = 56] = "arpae_cosmo_seamless"; + Model[Model["arpae_cosmo_2i"] = 57] = "arpae_cosmo_2i"; + Model[Model["arpae_cosmo_2i_ruc"] = 58] = "arpae_cosmo_2i_ruc"; + Model[Model["arpae_cosmo_5m"] = 59] = "arpae_cosmo_5m"; + Model[Model["ecmwf_ifs025"] = 60] = "ecmwf_ifs025"; + Model[Model["ecmwf_aifs025"] = 61] = "ecmwf_aifs025"; + Model[Model["gfs013"] = 62] = "gfs013"; + Model[Model["gfs_graphcast025"] = 63] = "gfs_graphcast025"; + Model[Model["ecmwf_wam025"] = 64] = "ecmwf_wam025"; + Model[Model["meteofrance_wave"] = 65] = "meteofrance_wave"; + Model[Model["meteofrance_currents"] = 66] = "meteofrance_currents"; + Model[Model["ecmwf_wam025_ensemble"] = 67] = "ecmwf_wam025_ensemble"; + Model[Model["ncep_gfswave025"] = 68] = "ncep_gfswave025"; + Model[Model["ncep_gefswave025"] = 69] = "ncep_gefswave025"; + Model[Model["knmi_seamless"] = 70] = "knmi_seamless"; + Model[Model["knmi_harmonie_arome_europe"] = 71] = "knmi_harmonie_arome_europe"; + Model[Model["knmi_harmonie_arome_netherlands"] = 72] = "knmi_harmonie_arome_netherlands"; + Model[Model["dmi_seamless"] = 73] = "dmi_seamless"; + Model[Model["dmi_harmonie_arome_europe"] = 74] = "dmi_harmonie_arome_europe"; + Model[Model["metno_seamless"] = 75] = "metno_seamless"; + Model[Model["era5_ensemble"] = 76] = "era5_ensemble"; + Model[Model["ecmwf_ifs_analysis"] = 77] = "ecmwf_ifs_analysis"; + Model[Model["ecmwf_ifs_long_window"] = 78] = "ecmwf_ifs_long_window"; + Model[Model["ecmwf_ifs_analysis_long_window"] = 79] = "ecmwf_ifs_analysis_long_window"; + Model[Model["ukmo_global_deterministic_10km"] = 80] = "ukmo_global_deterministic_10km"; + Model[Model["ukmo_uk_deterministic_2km"] = 81] = "ukmo_uk_deterministic_2km"; + Model[Model["ukmo_seamless"] = 82] = "ukmo_seamless"; + Model[Model["ncep_gfswave016"] = 83] = "ncep_gfswave016"; + Model[Model["ncep_nbm_conus"] = 84] = "ncep_nbm_conus"; + Model[Model["ukmo_global_ensemble_20km"] = 85] = "ukmo_global_ensemble_20km"; + Model[Model["ecmwf_aifs025_single"] = 86] = "ecmwf_aifs025_single"; + Model[Model["jma_jaxa_himawari"] = 87] = "jma_jaxa_himawari"; + Model[Model["eumetsat_sarah3"] = 88] = "eumetsat_sarah3"; + Model[Model["eumetsat_lsa_saf_msg"] = 89] = "eumetsat_lsa_saf_msg"; + Model[Model["eumetsat_lsa_saf_iodc"] = 90] = "eumetsat_lsa_saf_iodc"; + Model[Model["satellite_radiation_seamless"] = 91] = "satellite_radiation_seamless"; + Model[Model["kma_gdps"] = 92] = "kma_gdps"; + Model[Model["kma_ldps"] = 93] = "kma_ldps"; + Model[Model["kma_seamless"] = 94] = "kma_seamless"; + Model[Model["italia_meteo_arpae_icon_2i"] = 95] = "italia_meteo_arpae_icon_2i"; +})(Model || (exports.Model = Model = {})); + + +/***/ }), + +/***/ "./node_modules/@openmeteo/sdk/unit.js": +/*!*********************************************!*\ + !*** ./node_modules/@openmeteo/sdk/unit.js ***! + \*********************************************/ +/***/ ((__unused_webpack_module, exports) => { + + +// automatically generated by the FlatBuffers compiler, do not modify +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.Unit = void 0; +/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */ +var Unit; +(function (Unit) { + Unit[Unit["undefined"] = 0] = "undefined"; + Unit[Unit["celsius"] = 1] = "celsius"; + Unit[Unit["centimetre"] = 2] = "centimetre"; + Unit[Unit["cubic_metre_per_cubic_metre"] = 3] = "cubic_metre_per_cubic_metre"; + Unit[Unit["cubic_metre_per_second"] = 4] = "cubic_metre_per_second"; + Unit[Unit["degree_direction"] = 5] = "degree_direction"; + Unit[Unit["dimensionless_integer"] = 6] = "dimensionless_integer"; + Unit[Unit["dimensionless"] = 7] = "dimensionless"; + Unit[Unit["european_air_quality_index"] = 8] = "european_air_quality_index"; + Unit[Unit["fahrenheit"] = 9] = "fahrenheit"; + Unit[Unit["feet"] = 10] = "feet"; + Unit[Unit["fraction"] = 11] = "fraction"; + Unit[Unit["gdd_celsius"] = 12] = "gdd_celsius"; + Unit[Unit["geopotential_metre"] = 13] = "geopotential_metre"; + Unit[Unit["grains_per_cubic_metre"] = 14] = "grains_per_cubic_metre"; + Unit[Unit["gram_per_kilogram"] = 15] = "gram_per_kilogram"; + Unit[Unit["hectopascal"] = 16] = "hectopascal"; + Unit[Unit["hours"] = 17] = "hours"; + Unit[Unit["inch"] = 18] = "inch"; + Unit[Unit["iso8601"] = 19] = "iso8601"; + Unit[Unit["joule_per_kilogram"] = 20] = "joule_per_kilogram"; + Unit[Unit["kelvin"] = 21] = "kelvin"; + Unit[Unit["kilopascal"] = 22] = "kilopascal"; + Unit[Unit["kilogram_per_square_metre"] = 23] = "kilogram_per_square_metre"; + Unit[Unit["kilometres_per_hour"] = 24] = "kilometres_per_hour"; + Unit[Unit["knots"] = 25] = "knots"; + Unit[Unit["megajoule_per_square_metre"] = 26] = "megajoule_per_square_metre"; + Unit[Unit["metre_per_second_not_unit_converted"] = 27] = "metre_per_second_not_unit_converted"; + Unit[Unit["metre_per_second"] = 28] = "metre_per_second"; + Unit[Unit["metre"] = 29] = "metre"; + Unit[Unit["micrograms_per_cubic_metre"] = 30] = "micrograms_per_cubic_metre"; + Unit[Unit["miles_per_hour"] = 31] = "miles_per_hour"; + Unit[Unit["millimetre"] = 32] = "millimetre"; + Unit[Unit["pascal"] = 33] = "pascal"; + Unit[Unit["per_second"] = 34] = "per_second"; + Unit[Unit["percentage"] = 35] = "percentage"; + Unit[Unit["seconds"] = 36] = "seconds"; + Unit[Unit["unix_time"] = 37] = "unix_time"; + Unit[Unit["us_air_quality_index"] = 38] = "us_air_quality_index"; + Unit[Unit["watt_per_square_metre"] = 39] = "watt_per_square_metre"; + Unit[Unit["wmo_code"] = 40] = "wmo_code"; + Unit[Unit["parts_per_million"] = 41] = "parts_per_million"; +})(Unit || (exports.Unit = Unit = {})); + + +/***/ }), + +/***/ "./node_modules/@openmeteo/sdk/variable-with-values.js": +/*!*************************************************************!*\ + !*** ./node_modules/@openmeteo/sdk/variable-with-values.js ***! + \*************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + +// automatically generated by the FlatBuffers compiler, do not modify +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.VariableWithValues = void 0; +/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */ +const flatbuffers = __importStar(__webpack_require__(/*! flatbuffers */ "./node_modules/flatbuffers/mjs/flatbuffers.js")); +const aggregation_js_1 = __webpack_require__(/*! ./aggregation.js */ "./node_modules/@openmeteo/sdk/aggregation.js"); +const unit_js_1 = __webpack_require__(/*! ./unit.js */ "./node_modules/@openmeteo/sdk/unit.js"); +const variable_js_1 = __webpack_require__(/*! ./variable.js */ "./node_modules/@openmeteo/sdk/variable.js"); +class VariableWithValues { + constructor() { + this.bb = null; + this.bb_pos = 0; + } + __init(i, bb) { + this.bb_pos = i; + this.bb = bb; + return this; + } + static getRootAsVariableWithValues(bb, obj) { + return (obj || new VariableWithValues()).__init(bb.readInt32(bb.position()) + bb.position(), bb); + } + static getSizePrefixedRootAsVariableWithValues(bb, obj) { + bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH); + return (obj || new VariableWithValues()).__init(bb.readInt32(bb.position()) + bb.position(), bb); + } + variable() { + const offset = this.bb.__offset(this.bb_pos, 4); + return offset ? this.bb.readUint8(this.bb_pos + offset) : variable_js_1.Variable.undefined; + } + unit() { + const offset = this.bb.__offset(this.bb_pos, 6); + return offset ? this.bb.readUint8(this.bb_pos + offset) : unit_js_1.Unit.undefined; + } + value() { + const offset = this.bb.__offset(this.bb_pos, 8); + return offset ? this.bb.readFloat32(this.bb_pos + offset) : 0.0; + } + values(index) { + const offset = this.bb.__offset(this.bb_pos, 10); + return offset ? this.bb.readFloat32(this.bb.__vector(this.bb_pos + offset) + index * 4) : 0; + } + valuesLength() { + const offset = this.bb.__offset(this.bb_pos, 10); + return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0; + } + valuesArray() { + const offset = this.bb.__offset(this.bb_pos, 10); + return offset ? new Float32Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset), this.bb.__vector_len(this.bb_pos + offset)) : null; + } + valuesInt64(index) { + const offset = this.bb.__offset(this.bb_pos, 12); + return offset ? this.bb.readInt64(this.bb.__vector(this.bb_pos + offset) + index * 8) : BigInt(0); + } + valuesInt64Length() { + const offset = this.bb.__offset(this.bb_pos, 12); + return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0; + } + altitude() { + const offset = this.bb.__offset(this.bb_pos, 14); + return offset ? this.bb.readInt16(this.bb_pos + offset) : 0; + } + aggregation() { + const offset = this.bb.__offset(this.bb_pos, 16); + return offset ? this.bb.readUint8(this.bb_pos + offset) : aggregation_js_1.Aggregation.none; + } + pressureLevel() { + const offset = this.bb.__offset(this.bb_pos, 18); + return offset ? this.bb.readInt16(this.bb_pos + offset) : 0; + } + depth() { + const offset = this.bb.__offset(this.bb_pos, 20); + return offset ? this.bb.readInt16(this.bb_pos + offset) : 0; + } + depthTo() { + const offset = this.bb.__offset(this.bb_pos, 22); + return offset ? this.bb.readInt16(this.bb_pos + offset) : 0; + } + ensembleMember() { + const offset = this.bb.__offset(this.bb_pos, 24); + return offset ? this.bb.readInt16(this.bb_pos + offset) : 0; + } + previousDay() { + const offset = this.bb.__offset(this.bb_pos, 26); + return offset ? this.bb.readInt16(this.bb_pos + offset) : 0; + } +} +exports.VariableWithValues = VariableWithValues; + + +/***/ }), + +/***/ "./node_modules/@openmeteo/sdk/variable.js": +/*!*************************************************!*\ + !*** ./node_modules/@openmeteo/sdk/variable.js ***! + \*************************************************/ +/***/ ((__unused_webpack_module, exports) => { + + +// automatically generated by the FlatBuffers compiler, do not modify +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.Variable = void 0; +/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */ +var Variable; +(function (Variable) { + Variable[Variable["undefined"] = 0] = "undefined"; + Variable[Variable["apparent_temperature"] = 1] = "apparent_temperature"; + Variable[Variable["cape"] = 2] = "cape"; + Variable[Variable["cloud_cover"] = 3] = "cloud_cover"; + Variable[Variable["cloud_cover_high"] = 4] = "cloud_cover_high"; + Variable[Variable["cloud_cover_low"] = 5] = "cloud_cover_low"; + Variable[Variable["cloud_cover_mid"] = 6] = "cloud_cover_mid"; + Variable[Variable["daylight_duration"] = 7] = "daylight_duration"; + Variable[Variable["dew_point"] = 8] = "dew_point"; + Variable[Variable["diffuse_radiation"] = 9] = "diffuse_radiation"; + Variable[Variable["diffuse_radiation_instant"] = 10] = "diffuse_radiation_instant"; + Variable[Variable["direct_normal_irradiance"] = 11] = "direct_normal_irradiance"; + Variable[Variable["direct_normal_irradiance_instant"] = 12] = "direct_normal_irradiance_instant"; + Variable[Variable["direct_radiation"] = 13] = "direct_radiation"; + Variable[Variable["direct_radiation_instant"] = 14] = "direct_radiation_instant"; + Variable[Variable["et0_fao_evapotranspiration"] = 15] = "et0_fao_evapotranspiration"; + Variable[Variable["evapotranspiration"] = 16] = "evapotranspiration"; + Variable[Variable["freezing_level_height"] = 17] = "freezing_level_height"; + Variable[Variable["growing_degree_days"] = 18] = "growing_degree_days"; + Variable[Variable["is_day"] = 19] = "is_day"; + Variable[Variable["latent_heat_flux"] = 20] = "latent_heat_flux"; + Variable[Variable["leaf_wetness_probability"] = 21] = "leaf_wetness_probability"; + Variable[Variable["lifted_index"] = 22] = "lifted_index"; + Variable[Variable["lightning_potential"] = 23] = "lightning_potential"; + Variable[Variable["precipitation"] = 24] = "precipitation"; + Variable[Variable["precipitation_hours"] = 25] = "precipitation_hours"; + Variable[Variable["precipitation_probability"] = 26] = "precipitation_probability"; + Variable[Variable["pressure_msl"] = 27] = "pressure_msl"; + Variable[Variable["rain"] = 28] = "rain"; + Variable[Variable["relative_humidity"] = 29] = "relative_humidity"; + Variable[Variable["runoff"] = 30] = "runoff"; + Variable[Variable["sensible_heat_flux"] = 31] = "sensible_heat_flux"; + Variable[Variable["shortwave_radiation"] = 32] = "shortwave_radiation"; + Variable[Variable["shortwave_radiation_instant"] = 33] = "shortwave_radiation_instant"; + Variable[Variable["showers"] = 34] = "showers"; + Variable[Variable["snow_depth"] = 35] = "snow_depth"; + Variable[Variable["snow_height"] = 36] = "snow_height"; + Variable[Variable["snowfall"] = 37] = "snowfall"; + Variable[Variable["snowfall_height"] = 38] = "snowfall_height"; + Variable[Variable["snowfall_water_equivalent"] = 39] = "snowfall_water_equivalent"; + Variable[Variable["sunrise"] = 40] = "sunrise"; + Variable[Variable["sunset"] = 41] = "sunset"; + Variable[Variable["soil_moisture"] = 42] = "soil_moisture"; + Variable[Variable["soil_moisture_index"] = 43] = "soil_moisture_index"; + Variable[Variable["soil_temperature"] = 44] = "soil_temperature"; + Variable[Variable["surface_pressure"] = 45] = "surface_pressure"; + Variable[Variable["surface_temperature"] = 46] = "surface_temperature"; + Variable[Variable["temperature"] = 47] = "temperature"; + Variable[Variable["terrestrial_radiation"] = 48] = "terrestrial_radiation"; + Variable[Variable["terrestrial_radiation_instant"] = 49] = "terrestrial_radiation_instant"; + Variable[Variable["total_column_integrated_water_vapour"] = 50] = "total_column_integrated_water_vapour"; + Variable[Variable["updraft"] = 51] = "updraft"; + Variable[Variable["uv_index"] = 52] = "uv_index"; + Variable[Variable["uv_index_clear_sky"] = 53] = "uv_index_clear_sky"; + Variable[Variable["vapour_pressure_deficit"] = 54] = "vapour_pressure_deficit"; + Variable[Variable["visibility"] = 55] = "visibility"; + Variable[Variable["weather_code"] = 56] = "weather_code"; + Variable[Variable["wind_direction"] = 57] = "wind_direction"; + Variable[Variable["wind_gusts"] = 58] = "wind_gusts"; + Variable[Variable["wind_speed"] = 59] = "wind_speed"; + Variable[Variable["vertical_velocity"] = 60] = "vertical_velocity"; + Variable[Variable["geopotential_height"] = 61] = "geopotential_height"; + Variable[Variable["wet_bulb_temperature"] = 62] = "wet_bulb_temperature"; + Variable[Variable["river_discharge"] = 63] = "river_discharge"; + Variable[Variable["wave_height"] = 64] = "wave_height"; + Variable[Variable["wave_period"] = 65] = "wave_period"; + Variable[Variable["wave_direction"] = 66] = "wave_direction"; + Variable[Variable["wind_wave_height"] = 67] = "wind_wave_height"; + Variable[Variable["wind_wave_period"] = 68] = "wind_wave_period"; + Variable[Variable["wind_wave_peak_period"] = 69] = "wind_wave_peak_period"; + Variable[Variable["wind_wave_direction"] = 70] = "wind_wave_direction"; + Variable[Variable["swell_wave_height"] = 71] = "swell_wave_height"; + Variable[Variable["swell_wave_period"] = 72] = "swell_wave_period"; + Variable[Variable["swell_wave_peak_period"] = 73] = "swell_wave_peak_period"; + Variable[Variable["swell_wave_direction"] = 74] = "swell_wave_direction"; + Variable[Variable["pm10"] = 75] = "pm10"; + Variable[Variable["pm2p5"] = 76] = "pm2p5"; + Variable[Variable["dust"] = 77] = "dust"; + Variable[Variable["aerosol_optical_depth"] = 78] = "aerosol_optical_depth"; + Variable[Variable["carbon_monoxide"] = 79] = "carbon_monoxide"; + Variable[Variable["nitrogen_dioxide"] = 80] = "nitrogen_dioxide"; + Variable[Variable["ammonia"] = 81] = "ammonia"; + Variable[Variable["ozone"] = 82] = "ozone"; + Variable[Variable["sulphur_dioxide"] = 83] = "sulphur_dioxide"; + Variable[Variable["alder_pollen"] = 84] = "alder_pollen"; + Variable[Variable["birch_pollen"] = 85] = "birch_pollen"; + Variable[Variable["grass_pollen"] = 86] = "grass_pollen"; + Variable[Variable["mugwort_pollen"] = 87] = "mugwort_pollen"; + Variable[Variable["olive_pollen"] = 88] = "olive_pollen"; + Variable[Variable["ragweed_pollen"] = 89] = "ragweed_pollen"; + Variable[Variable["european_aqi"] = 90] = "european_aqi"; + Variable[Variable["european_aqi_pm2p5"] = 91] = "european_aqi_pm2p5"; + Variable[Variable["european_aqi_pm10"] = 92] = "european_aqi_pm10"; + Variable[Variable["european_aqi_nitrogen_dioxide"] = 93] = "european_aqi_nitrogen_dioxide"; + Variable[Variable["european_aqi_ozone"] = 94] = "european_aqi_ozone"; + Variable[Variable["european_aqi_sulphur_dioxide"] = 95] = "european_aqi_sulphur_dioxide"; + Variable[Variable["us_aqi"] = 96] = "us_aqi"; + Variable[Variable["us_aqi_pm2p5"] = 97] = "us_aqi_pm2p5"; + Variable[Variable["us_aqi_pm10"] = 98] = "us_aqi_pm10"; + Variable[Variable["us_aqi_nitrogen_dioxide"] = 99] = "us_aqi_nitrogen_dioxide"; + Variable[Variable["us_aqi_ozone"] = 100] = "us_aqi_ozone"; + Variable[Variable["us_aqi_sulphur_dioxide"] = 101] = "us_aqi_sulphur_dioxide"; + Variable[Variable["us_aqi_carbon_monoxide"] = 102] = "us_aqi_carbon_monoxide"; + Variable[Variable["sunshine_duration"] = 103] = "sunshine_duration"; + Variable[Variable["convective_inhibition"] = 104] = "convective_inhibition"; + Variable[Variable["shortwave_radiation_clear_sky"] = 105] = "shortwave_radiation_clear_sky"; + Variable[Variable["global_tilted_irradiance"] = 106] = "global_tilted_irradiance"; + Variable[Variable["global_tilted_irradiance_instant"] = 107] = "global_tilted_irradiance_instant"; + Variable[Variable["ocean_current_velocity"] = 108] = "ocean_current_velocity"; + Variable[Variable["ocean_current_direction"] = 109] = "ocean_current_direction"; + Variable[Variable["cloud_base"] = 110] = "cloud_base"; + Variable[Variable["cloud_top"] = 111] = "cloud_top"; + Variable[Variable["mass_density"] = 112] = "mass_density"; + Variable[Variable["boundary_layer_height"] = 113] = "boundary_layer_height"; + Variable[Variable["formaldehyde"] = 114] = "formaldehyde"; + Variable[Variable["glyoxal"] = 115] = "glyoxal"; + Variable[Variable["non_methane_volatile_organic_compounds"] = 116] = "non_methane_volatile_organic_compounds"; + Variable[Variable["pm10_wildfires"] = 117] = "pm10_wildfires"; + Variable[Variable["peroxyacyl_nitrates"] = 118] = "peroxyacyl_nitrates"; + Variable[Variable["secondary_inorganic_aerosol"] = 119] = "secondary_inorganic_aerosol"; + Variable[Variable["residential_elementary_carbon"] = 120] = "residential_elementary_carbon"; + Variable[Variable["total_elementary_carbon"] = 121] = "total_elementary_carbon"; + Variable[Variable["pm2_5_total_organic_matter"] = 122] = "pm2_5_total_organic_matter"; + Variable[Variable["sea_salt_aerosol"] = 123] = "sea_salt_aerosol"; + Variable[Variable["nitrogen_monoxide"] = 124] = "nitrogen_monoxide"; + Variable[Variable["thunderstorm_probability"] = 125] = "thunderstorm_probability"; + Variable[Variable["rain_probability"] = 126] = "rain_probability"; + Variable[Variable["freezing_rain_probability"] = 127] = "freezing_rain_probability"; + Variable[Variable["ice_pellets_probability"] = 128] = "ice_pellets_probability"; + Variable[Variable["snowfall_probability"] = 129] = "snowfall_probability"; + Variable[Variable["carbon_dioxide"] = 130] = "carbon_dioxide"; + Variable[Variable["methane"] = 131] = "methane"; + Variable[Variable["sea_level_height_msl"] = 132] = "sea_level_height_msl"; + Variable[Variable["sea_surface_temperature"] = 133] = "sea_surface_temperature"; + Variable[Variable["invert_barometer_height"] = 134] = "invert_barometer_height"; + Variable[Variable["hail"] = 135] = "hail"; + Variable[Variable["albedo"] = 136] = "albedo"; + Variable[Variable["precipitation_type"] = 137] = "precipitation_type"; + Variable[Variable["convective_cloud_base"] = 138] = "convective_cloud_base"; + Variable[Variable["convective_cloud_top"] = 139] = "convective_cloud_top"; + Variable[Variable["snow_depth_water_equivalent"] = 140] = "snow_depth_water_equivalent"; + Variable[Variable["secondary_swell_wave_height"] = 141] = "secondary_swell_wave_height"; + Variable[Variable["secondary_swell_wave_period"] = 142] = "secondary_swell_wave_period"; + Variable[Variable["secondary_swell_wave_peak_period"] = 143] = "secondary_swell_wave_peak_period"; + Variable[Variable["secondary_swell_wave_direction"] = 144] = "secondary_swell_wave_direction"; + Variable[Variable["tertiary_swell_wave_height"] = 145] = "tertiary_swell_wave_height"; + Variable[Variable["tertiary_swell_wave_period"] = 146] = "tertiary_swell_wave_period"; + Variable[Variable["tertiary_swell_wave_peak_period"] = 147] = "tertiary_swell_wave_peak_period"; + Variable[Variable["tertiary_swell_wave_direction"] = 148] = "tertiary_swell_wave_direction"; +})(Variable || (exports.Variable = Variable = {})); + + +/***/ }), + +/***/ "./node_modules/@openmeteo/sdk/variables-with-time.js": +/*!************************************************************!*\ + !*** ./node_modules/@openmeteo/sdk/variables-with-time.js ***! + \************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + +// automatically generated by the FlatBuffers compiler, do not modify +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.VariablesWithTime = void 0; +/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */ +const flatbuffers = __importStar(__webpack_require__(/*! flatbuffers */ "./node_modules/flatbuffers/mjs/flatbuffers.js")); +const variable_with_values_js_1 = __webpack_require__(/*! ./variable-with-values.js */ "./node_modules/@openmeteo/sdk/variable-with-values.js"); +class VariablesWithTime { + constructor() { + this.bb = null; + this.bb_pos = 0; + } + __init(i, bb) { + this.bb_pos = i; + this.bb = bb; + return this; + } + static getRootAsVariablesWithTime(bb, obj) { + return (obj || new VariablesWithTime()).__init(bb.readInt32(bb.position()) + bb.position(), bb); + } + static getSizePrefixedRootAsVariablesWithTime(bb, obj) { + bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH); + return (obj || new VariablesWithTime()).__init(bb.readInt32(bb.position()) + bb.position(), bb); + } + time() { + const offset = this.bb.__offset(this.bb_pos, 4); + return offset ? this.bb.readInt64(this.bb_pos + offset) : BigInt('0'); + } + timeEnd() { + const offset = this.bb.__offset(this.bb_pos, 6); + return offset ? this.bb.readInt64(this.bb_pos + offset) : BigInt('0'); + } + interval() { + const offset = this.bb.__offset(this.bb_pos, 8); + return offset ? this.bb.readInt32(this.bb_pos + offset) : 0; + } + variables(index, obj) { + const offset = this.bb.__offset(this.bb_pos, 10); + return offset ? (obj || new variable_with_values_js_1.VariableWithValues()).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + offset) + index * 4), this.bb) : null; + } + variablesLength() { + const offset = this.bb.__offset(this.bb_pos, 10); + return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0; + } +} +exports.VariablesWithTime = VariablesWithTime; + + +/***/ }), + +/***/ "./node_modules/@openmeteo/sdk/weather-api-response.js": +/*!*************************************************************!*\ + !*** ./node_modules/@openmeteo/sdk/weather-api-response.js ***! + \*************************************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + +// automatically generated by the FlatBuffers compiler, do not modify +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.WeatherApiResponse = void 0; +/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */ +const flatbuffers = __importStar(__webpack_require__(/*! flatbuffers */ "./node_modules/flatbuffers/mjs/flatbuffers.js")); +const model_js_1 = __webpack_require__(/*! ./model.js */ "./node_modules/@openmeteo/sdk/model.js"); +const variables_with_time_js_1 = __webpack_require__(/*! ./variables-with-time.js */ "./node_modules/@openmeteo/sdk/variables-with-time.js"); +class WeatherApiResponse { + constructor() { + this.bb = null; + this.bb_pos = 0; + } + __init(i, bb) { + this.bb_pos = i; + this.bb = bb; + return this; + } + static getRootAsWeatherApiResponse(bb, obj) { + return (obj || new WeatherApiResponse()).__init(bb.readInt32(bb.position()) + bb.position(), bb); + } + static getSizePrefixedRootAsWeatherApiResponse(bb, obj) { + bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH); + return (obj || new WeatherApiResponse()).__init(bb.readInt32(bb.position()) + bb.position(), bb); + } + latitude() { + const offset = this.bb.__offset(this.bb_pos, 4); + return offset ? this.bb.readFloat32(this.bb_pos + offset) : 0.0; + } + longitude() { + const offset = this.bb.__offset(this.bb_pos, 6); + return offset ? this.bb.readFloat32(this.bb_pos + offset) : 0.0; + } + elevation() { + const offset = this.bb.__offset(this.bb_pos, 8); + return offset ? this.bb.readFloat32(this.bb_pos + offset) : 0.0; + } + generationTimeMilliseconds() { + const offset = this.bb.__offset(this.bb_pos, 10); + return offset ? this.bb.readFloat32(this.bb_pos + offset) : 0.0; + } + locationId() { + const offset = this.bb.__offset(this.bb_pos, 12); + return offset ? this.bb.readInt64(this.bb_pos + offset) : BigInt('0'); + } + model() { + const offset = this.bb.__offset(this.bb_pos, 14); + return offset ? this.bb.readUint8(this.bb_pos + offset) : model_js_1.Model.undefined; + } + utcOffsetSeconds() { + const offset = this.bb.__offset(this.bb_pos, 16); + return offset ? this.bb.readInt32(this.bb_pos + offset) : 0; + } + timezone(optionalEncoding) { + const offset = this.bb.__offset(this.bb_pos, 18); + return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null; + } + timezoneAbbreviation(optionalEncoding) { + const offset = this.bb.__offset(this.bb_pos, 20); + return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null; + } + current(obj) { + const offset = this.bb.__offset(this.bb_pos, 22); + return offset ? (obj || new variables_with_time_js_1.VariablesWithTime()).__init(this.bb.__indirect(this.bb_pos + offset), this.bb) : null; + } + daily(obj) { + const offset = this.bb.__offset(this.bb_pos, 24); + return offset ? (obj || new variables_with_time_js_1.VariablesWithTime()).__init(this.bb.__indirect(this.bb_pos + offset), this.bb) : null; + } + hourly(obj) { + const offset = this.bb.__offset(this.bb_pos, 26); + return offset ? (obj || new variables_with_time_js_1.VariablesWithTime()).__init(this.bb.__indirect(this.bb_pos + offset), this.bb) : null; + } + minutely15(obj) { + const offset = this.bb.__offset(this.bb_pos, 28); + return offset ? (obj || new variables_with_time_js_1.VariablesWithTime()).__init(this.bb.__indirect(this.bb_pos + offset), this.bb) : null; + } + sixHourly(obj) { + const offset = this.bb.__offset(this.bb_pos, 30); + return offset ? (obj || new variables_with_time_js_1.VariablesWithTime()).__init(this.bb.__indirect(this.bb_pos + offset), this.bb) : null; + } +} +exports.WeatherApiResponse = WeatherApiResponse; + + +/***/ }), + +/***/ "./node_modules/flatbuffers/mjs/builder.js": +/*!*************************************************!*\ + !*** ./node_modules/flatbuffers/mjs/builder.js ***! + \*************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ Builder: () => (/* binding */ Builder) +/* harmony export */ }); +/* harmony import */ var _byte_buffer_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./byte-buffer.js */ "./node_modules/flatbuffers/mjs/byte-buffer.js"); +/* harmony import */ var _constants_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./constants.js */ "./node_modules/flatbuffers/mjs/constants.js"); + + +class Builder { + /** + * Create a FlatBufferBuilder. + */ + constructor(opt_initial_size) { + /** Minimum alignment encountered so far. */ + this.minalign = 1; + /** The vtable for the current table. */ + this.vtable = null; + /** The amount of fields we're actually using. */ + this.vtable_in_use = 0; + /** Whether we are currently serializing a table. */ + this.isNested = false; + /** Starting offset of the current struct/table. */ + this.object_start = 0; + /** List of offsets of all vtables. */ + this.vtables = []; + /** For the current vector being built. */ + this.vector_num_elems = 0; + /** False omits default values from the serialized data */ + this.force_defaults = false; + this.string_maps = null; + this.text_encoder = new TextEncoder(); + let initial_size; + if (!opt_initial_size) { + initial_size = 1024; + } + else { + initial_size = opt_initial_size; + } + /** + * @type {ByteBuffer} + * @private + */ + this.bb = _byte_buffer_js__WEBPACK_IMPORTED_MODULE_0__.ByteBuffer.allocate(initial_size); + this.space = initial_size; + } + clear() { + this.bb.clear(); + this.space = this.bb.capacity(); + this.minalign = 1; + this.vtable = null; + this.vtable_in_use = 0; + this.isNested = false; + this.object_start = 0; + this.vtables = []; + this.vector_num_elems = 0; + this.force_defaults = false; + this.string_maps = null; + } + /** + * In order to save space, fields that are set to their default value + * don't get serialized into the buffer. Forcing defaults provides a + * way to manually disable this optimization. + * + * @param forceDefaults true always serializes default values + */ + forceDefaults(forceDefaults) { + this.force_defaults = forceDefaults; + } + /** + * Get the ByteBuffer representing the FlatBuffer. Only call this after you've + * called finish(). The actual data starts at the ByteBuffer's current position, + * not necessarily at 0. + */ + dataBuffer() { + return this.bb; + } + /** + * Get the bytes representing the FlatBuffer. Only call this after you've + * called finish(). + */ + asUint8Array() { + return this.bb.bytes().subarray(this.bb.position(), this.bb.position() + this.offset()); + } + /** + * Prepare to write an element of `size` after `additional_bytes` have been + * written, e.g. if you write a string, you need to align such the int length + * field is aligned to 4 bytes, and the string data follows it directly. If all + * you need to do is alignment, `additional_bytes` will be 0. + * + * @param size This is the of the new element to write + * @param additional_bytes The padding size + */ + prep(size, additional_bytes) { + // Track the biggest thing we've ever aligned to. + if (size > this.minalign) { + this.minalign = size; + } + // Find the amount of alignment needed such that `size` is properly + // aligned after `additional_bytes` + const align_size = ((~(this.bb.capacity() - this.space + additional_bytes)) + 1) & (size - 1); + // Reallocate the buffer if needed. + while (this.space < align_size + size + additional_bytes) { + const old_buf_size = this.bb.capacity(); + this.bb = Builder.growByteBuffer(this.bb); + this.space += this.bb.capacity() - old_buf_size; + } + this.pad(align_size); + } + pad(byte_size) { + for (let i = 0; i < byte_size; i++) { + this.bb.writeInt8(--this.space, 0); + } + } + writeInt8(value) { + this.bb.writeInt8(this.space -= 1, value); + } + writeInt16(value) { + this.bb.writeInt16(this.space -= 2, value); + } + writeInt32(value) { + this.bb.writeInt32(this.space -= 4, value); + } + writeInt64(value) { + this.bb.writeInt64(this.space -= 8, value); + } + writeFloat32(value) { + this.bb.writeFloat32(this.space -= 4, value); + } + writeFloat64(value) { + this.bb.writeFloat64(this.space -= 8, value); + } + /** + * Add an `int8` to the buffer, properly aligned, and grows the buffer (if necessary). + * @param value The `int8` to add the buffer. + */ + addInt8(value) { + this.prep(1, 0); + this.writeInt8(value); + } + /** + * Add an `int16` to the buffer, properly aligned, and grows the buffer (if necessary). + * @param value The `int16` to add the buffer. + */ + addInt16(value) { + this.prep(2, 0); + this.writeInt16(value); + } + /** + * Add an `int32` to the buffer, properly aligned, and grows the buffer (if necessary). + * @param value The `int32` to add the buffer. + */ + addInt32(value) { + this.prep(4, 0); + this.writeInt32(value); + } + /** + * Add an `int64` to the buffer, properly aligned, and grows the buffer (if necessary). + * @param value The `int64` to add the buffer. + */ + addInt64(value) { + this.prep(8, 0); + this.writeInt64(value); + } + /** + * Add a `float32` to the buffer, properly aligned, and grows the buffer (if necessary). + * @param value The `float32` to add the buffer. + */ + addFloat32(value) { + this.prep(4, 0); + this.writeFloat32(value); + } + /** + * Add a `float64` to the buffer, properly aligned, and grows the buffer (if necessary). + * @param value The `float64` to add the buffer. + */ + addFloat64(value) { + this.prep(8, 0); + this.writeFloat64(value); + } + addFieldInt8(voffset, value, defaultValue) { + if (this.force_defaults || value != defaultValue) { + this.addInt8(value); + this.slot(voffset); + } + } + addFieldInt16(voffset, value, defaultValue) { + if (this.force_defaults || value != defaultValue) { + this.addInt16(value); + this.slot(voffset); + } + } + addFieldInt32(voffset, value, defaultValue) { + if (this.force_defaults || value != defaultValue) { + this.addInt32(value); + this.slot(voffset); + } + } + addFieldInt64(voffset, value, defaultValue) { + if (this.force_defaults || value !== defaultValue) { + this.addInt64(value); + this.slot(voffset); + } + } + addFieldFloat32(voffset, value, defaultValue) { + if (this.force_defaults || value != defaultValue) { + this.addFloat32(value); + this.slot(voffset); + } + } + addFieldFloat64(voffset, value, defaultValue) { + if (this.force_defaults || value != defaultValue) { + this.addFloat64(value); + this.slot(voffset); + } + } + addFieldOffset(voffset, value, defaultValue) { + if (this.force_defaults || value != defaultValue) { + this.addOffset(value); + this.slot(voffset); + } + } + /** + * Structs are stored inline, so nothing additional is being added. `d` is always 0. + */ + addFieldStruct(voffset, value, defaultValue) { + if (value != defaultValue) { + this.nested(value); + this.slot(voffset); + } + } + /** + * Structures are always stored inline, they need to be created right + * where they're used. You'll get this assertion failure if you + * created it elsewhere. + */ + nested(obj) { + if (obj != this.offset()) { + throw new TypeError('FlatBuffers: struct must be serialized inline.'); + } + } + /** + * Should not be creating any other object, string or vector + * while an object is being constructed + */ + notNested() { + if (this.isNested) { + throw new TypeError('FlatBuffers: object serialization must not be nested.'); + } + } + /** + * Set the current vtable at `voffset` to the current location in the buffer. + */ + slot(voffset) { + if (this.vtable !== null) + this.vtable[voffset] = this.offset(); + } + /** + * @returns Offset relative to the end of the buffer. + */ + offset() { + return this.bb.capacity() - this.space; + } + /** + * Doubles the size of the backing ByteBuffer and copies the old data towards + * the end of the new buffer (since we build the buffer backwards). + * + * @param bb The current buffer with the existing data + * @returns A new byte buffer with the old data copied + * to it. The data is located at the end of the buffer. + * + * uint8Array.set() formally takes {Array|ArrayBufferView}, so to pass + * it a uint8Array we need to suppress the type check: + * @suppress {checkTypes} + */ + static growByteBuffer(bb) { + const old_buf_size = bb.capacity(); + // Ensure we don't grow beyond what fits in an int. + if (old_buf_size & 0xC0000000) { + throw new Error('FlatBuffers: cannot grow buffer beyond 2 gigabytes.'); + } + const new_buf_size = old_buf_size << 1; + const nbb = _byte_buffer_js__WEBPACK_IMPORTED_MODULE_0__.ByteBuffer.allocate(new_buf_size); + nbb.setPosition(new_buf_size - old_buf_size); + nbb.bytes().set(bb.bytes(), new_buf_size - old_buf_size); + return nbb; + } + /** + * Adds on offset, relative to where it will be written. + * + * @param offset The offset to add. + */ + addOffset(offset) { + this.prep(_constants_js__WEBPACK_IMPORTED_MODULE_1__.SIZEOF_INT, 0); // Ensure alignment is already done. + this.writeInt32(this.offset() - offset + _constants_js__WEBPACK_IMPORTED_MODULE_1__.SIZEOF_INT); + } + /** + * Start encoding a new object in the buffer. Users will not usually need to + * call this directly. The FlatBuffers compiler will generate helper methods + * that call this method internally. + */ + startObject(numfields) { + this.notNested(); + if (this.vtable == null) { + this.vtable = []; + } + this.vtable_in_use = numfields; + for (let i = 0; i < numfields; i++) { + this.vtable[i] = 0; // This will push additional elements as needed + } + this.isNested = true; + this.object_start = this.offset(); + } + /** + * Finish off writing the object that is under construction. + * + * @returns The offset to the object inside `dataBuffer` + */ + endObject() { + if (this.vtable == null || !this.isNested) { + throw new Error('FlatBuffers: endObject called without startObject'); + } + this.addInt32(0); + const vtableloc = this.offset(); + // Trim trailing zeroes. + let i = this.vtable_in_use - 1; + // eslint-disable-next-line no-empty + for (; i >= 0 && this.vtable[i] == 0; i--) { } + const trimmed_size = i + 1; + // Write out the current vtable. + for (; i >= 0; i--) { + // Offset relative to the start of the table. + this.addInt16(this.vtable[i] != 0 ? vtableloc - this.vtable[i] : 0); + } + const standard_fields = 2; // The fields below: + this.addInt16(vtableloc - this.object_start); + const len = (trimmed_size + standard_fields) * _constants_js__WEBPACK_IMPORTED_MODULE_1__.SIZEOF_SHORT; + this.addInt16(len); + // Search for an existing vtable that matches the current one. + let existing_vtable = 0; + const vt1 = this.space; + outer_loop: for (i = 0; i < this.vtables.length; i++) { + const vt2 = this.bb.capacity() - this.vtables[i]; + if (len == this.bb.readInt16(vt2)) { + for (let j = _constants_js__WEBPACK_IMPORTED_MODULE_1__.SIZEOF_SHORT; j < len; j += _constants_js__WEBPACK_IMPORTED_MODULE_1__.SIZEOF_SHORT) { + if (this.bb.readInt16(vt1 + j) != this.bb.readInt16(vt2 + j)) { + continue outer_loop; + } + } + existing_vtable = this.vtables[i]; + break; + } + } + if (existing_vtable) { + // Found a match: + // Remove the current vtable. + this.space = this.bb.capacity() - vtableloc; + // Point table to existing vtable. + this.bb.writeInt32(this.space, existing_vtable - vtableloc); + } + else { + // No match: + // Add the location of the current vtable to the list of vtables. + this.vtables.push(this.offset()); + // Point table to current vtable. + this.bb.writeInt32(this.bb.capacity() - vtableloc, this.offset() - vtableloc); + } + this.isNested = false; + return vtableloc; + } + /** + * Finalize a buffer, poiting to the given `root_table`. + */ + finish(root_table, opt_file_identifier, opt_size_prefix) { + const size_prefix = opt_size_prefix ? _constants_js__WEBPACK_IMPORTED_MODULE_1__.SIZE_PREFIX_LENGTH : 0; + if (opt_file_identifier) { + const file_identifier = opt_file_identifier; + this.prep(this.minalign, _constants_js__WEBPACK_IMPORTED_MODULE_1__.SIZEOF_INT + + _constants_js__WEBPACK_IMPORTED_MODULE_1__.FILE_IDENTIFIER_LENGTH + size_prefix); + if (file_identifier.length != _constants_js__WEBPACK_IMPORTED_MODULE_1__.FILE_IDENTIFIER_LENGTH) { + throw new TypeError('FlatBuffers: file identifier must be length ' + + _constants_js__WEBPACK_IMPORTED_MODULE_1__.FILE_IDENTIFIER_LENGTH); + } + for (let i = _constants_js__WEBPACK_IMPORTED_MODULE_1__.FILE_IDENTIFIER_LENGTH - 1; i >= 0; i--) { + this.writeInt8(file_identifier.charCodeAt(i)); + } + } + this.prep(this.minalign, _constants_js__WEBPACK_IMPORTED_MODULE_1__.SIZEOF_INT + size_prefix); + this.addOffset(root_table); + if (size_prefix) { + this.addInt32(this.bb.capacity() - this.space); + } + this.bb.setPosition(this.space); + } + /** + * Finalize a size prefixed buffer, pointing to the given `root_table`. + */ + finishSizePrefixed(root_table, opt_file_identifier) { + this.finish(root_table, opt_file_identifier, true); + } + /** + * This checks a required field has been set in a given table that has + * just been constructed. + */ + requiredField(table, field) { + const table_start = this.bb.capacity() - table; + const vtable_start = table_start - this.bb.readInt32(table_start); + const ok = field < this.bb.readInt16(vtable_start) && + this.bb.readInt16(vtable_start + field) != 0; + // If this fails, the caller will show what field needs to be set. + if (!ok) { + throw new TypeError('FlatBuffers: field ' + field + ' must be set'); + } + } + /** + * Start a new array/vector of objects. Users usually will not call + * this directly. The FlatBuffers compiler will create a start/end + * method for vector types in generated code. + * + * @param elem_size The size of each element in the array + * @param num_elems The number of elements in the array + * @param alignment The alignment of the array + */ + startVector(elem_size, num_elems, alignment) { + this.notNested(); + this.vector_num_elems = num_elems; + this.prep(_constants_js__WEBPACK_IMPORTED_MODULE_1__.SIZEOF_INT, elem_size * num_elems); + this.prep(alignment, elem_size * num_elems); // Just in case alignment > int. + } + /** + * Finish off the creation of an array and all its elements. The array must be + * created with `startVector`. + * + * @returns The offset at which the newly created array + * starts. + */ + endVector() { + this.writeInt32(this.vector_num_elems); + return this.offset(); + } + /** + * Encode the string `s` in the buffer using UTF-8. If the string passed has + * already been seen, we return the offset of the already written string + * + * @param s The string to encode + * @return The offset in the buffer where the encoded string starts + */ + createSharedString(s) { + if (!s) { + return 0; + } + if (!this.string_maps) { + this.string_maps = new Map(); + } + if (this.string_maps.has(s)) { + return this.string_maps.get(s); + } + const offset = this.createString(s); + this.string_maps.set(s, offset); + return offset; + } + /** + * Encode the string `s` in the buffer using UTF-8. If a Uint8Array is passed + * instead of a string, it is assumed to contain valid UTF-8 encoded data. + * + * @param s The string to encode + * @return The offset in the buffer where the encoded string starts + */ + createString(s) { + if (s === null || s === undefined) { + return 0; + } + let utf8; + if (s instanceof Uint8Array) { + utf8 = s; + } + else { + utf8 = this.text_encoder.encode(s); + } + this.addInt8(0); + this.startVector(1, utf8.length, 1); + this.bb.setPosition(this.space -= utf8.length); + this.bb.bytes().set(utf8, this.space); + return this.endVector(); + } + /** + * Create a byte vector. + * + * @param v The bytes to add + * @returns The offset in the buffer where the byte vector starts + */ + createByteVector(v) { + if (v === null || v === undefined) { + return 0; + } + this.startVector(1, v.length, 1); + this.bb.setPosition(this.space -= v.length); + this.bb.bytes().set(v, this.space); + return this.endVector(); + } + /** + * A helper function to pack an object + * + * @returns offset of obj + */ + createObjectOffset(obj) { + if (obj === null) { + return 0; + } + if (typeof obj === 'string') { + return this.createString(obj); + } + else { + return obj.pack(this); + } + } + /** + * A helper function to pack a list of object + * + * @returns list of offsets of each non null object + */ + createObjectOffsetList(list) { + const ret = []; + for (let i = 0; i < list.length; ++i) { + const val = list[i]; + if (val !== null) { + ret.push(this.createObjectOffset(val)); + } + else { + throw new TypeError('FlatBuffers: Argument for createObjectOffsetList cannot contain null.'); + } + } + return ret; + } + createStructOffsetList(list, startFunc) { + startFunc(this, list.length); + this.createObjectOffsetList(list.slice().reverse()); + return this.endVector(); + } +} + + +/***/ }), + +/***/ "./node_modules/flatbuffers/mjs/byte-buffer.js": +/*!*****************************************************!*\ + !*** ./node_modules/flatbuffers/mjs/byte-buffer.js ***! + \*****************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ ByteBuffer: () => (/* binding */ ByteBuffer) +/* harmony export */ }); +/* harmony import */ var _constants_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./constants.js */ "./node_modules/flatbuffers/mjs/constants.js"); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils.js */ "./node_modules/flatbuffers/mjs/utils.js"); +/* harmony import */ var _encoding_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./encoding.js */ "./node_modules/flatbuffers/mjs/encoding.js"); + + + +class ByteBuffer { + /** + * Create a new ByteBuffer with a given array of bytes (`Uint8Array`) + */ + constructor(bytes_) { + this.bytes_ = bytes_; + this.position_ = 0; + this.text_decoder_ = new TextDecoder(); + } + /** + * Create and allocate a new ByteBuffer with a given size. + */ + static allocate(byte_size) { + return new ByteBuffer(new Uint8Array(byte_size)); + } + clear() { + this.position_ = 0; + } + /** + * Get the underlying `Uint8Array`. + */ + bytes() { + return this.bytes_; + } + /** + * Get the buffer's position. + */ + position() { + return this.position_; + } + /** + * Set the buffer's position. + */ + setPosition(position) { + this.position_ = position; + } + /** + * Get the buffer's capacity. + */ + capacity() { + return this.bytes_.length; + } + readInt8(offset) { + return this.readUint8(offset) << 24 >> 24; + } + readUint8(offset) { + return this.bytes_[offset]; + } + readInt16(offset) { + return this.readUint16(offset) << 16 >> 16; + } + readUint16(offset) { + return this.bytes_[offset] | this.bytes_[offset + 1] << 8; + } + readInt32(offset) { + return this.bytes_[offset] | this.bytes_[offset + 1] << 8 | this.bytes_[offset + 2] << 16 | this.bytes_[offset + 3] << 24; + } + readUint32(offset) { + return this.readInt32(offset) >>> 0; + } + readInt64(offset) { + return BigInt.asIntN(64, BigInt(this.readUint32(offset)) + (BigInt(this.readUint32(offset + 4)) << BigInt(32))); + } + readUint64(offset) { + return BigInt.asUintN(64, BigInt(this.readUint32(offset)) + (BigInt(this.readUint32(offset + 4)) << BigInt(32))); + } + readFloat32(offset) { + _utils_js__WEBPACK_IMPORTED_MODULE_1__.int32[0] = this.readInt32(offset); + return _utils_js__WEBPACK_IMPORTED_MODULE_1__.float32[0]; + } + readFloat64(offset) { + _utils_js__WEBPACK_IMPORTED_MODULE_1__.int32[_utils_js__WEBPACK_IMPORTED_MODULE_1__.isLittleEndian ? 0 : 1] = this.readInt32(offset); + _utils_js__WEBPACK_IMPORTED_MODULE_1__.int32[_utils_js__WEBPACK_IMPORTED_MODULE_1__.isLittleEndian ? 1 : 0] = this.readInt32(offset + 4); + return _utils_js__WEBPACK_IMPORTED_MODULE_1__.float64[0]; + } + writeInt8(offset, value) { + this.bytes_[offset] = value; + } + writeUint8(offset, value) { + this.bytes_[offset] = value; + } + writeInt16(offset, value) { + this.bytes_[offset] = value; + this.bytes_[offset + 1] = value >> 8; + } + writeUint16(offset, value) { + this.bytes_[offset] = value; + this.bytes_[offset + 1] = value >> 8; + } + writeInt32(offset, value) { + this.bytes_[offset] = value; + this.bytes_[offset + 1] = value >> 8; + this.bytes_[offset + 2] = value >> 16; + this.bytes_[offset + 3] = value >> 24; + } + writeUint32(offset, value) { + this.bytes_[offset] = value; + this.bytes_[offset + 1] = value >> 8; + this.bytes_[offset + 2] = value >> 16; + this.bytes_[offset + 3] = value >> 24; + } + writeInt64(offset, value) { + this.writeInt32(offset, Number(BigInt.asIntN(32, value))); + this.writeInt32(offset + 4, Number(BigInt.asIntN(32, value >> BigInt(32)))); + } + writeUint64(offset, value) { + this.writeUint32(offset, Number(BigInt.asUintN(32, value))); + this.writeUint32(offset + 4, Number(BigInt.asUintN(32, value >> BigInt(32)))); + } + writeFloat32(offset, value) { + _utils_js__WEBPACK_IMPORTED_MODULE_1__.float32[0] = value; + this.writeInt32(offset, _utils_js__WEBPACK_IMPORTED_MODULE_1__.int32[0]); + } + writeFloat64(offset, value) { + _utils_js__WEBPACK_IMPORTED_MODULE_1__.float64[0] = value; + this.writeInt32(offset, _utils_js__WEBPACK_IMPORTED_MODULE_1__.int32[_utils_js__WEBPACK_IMPORTED_MODULE_1__.isLittleEndian ? 0 : 1]); + this.writeInt32(offset + 4, _utils_js__WEBPACK_IMPORTED_MODULE_1__.int32[_utils_js__WEBPACK_IMPORTED_MODULE_1__.isLittleEndian ? 1 : 0]); + } + /** + * Return the file identifier. Behavior is undefined for FlatBuffers whose + * schema does not include a file_identifier (likely points at padding or the + * start of a the root vtable). + */ + getBufferIdentifier() { + if (this.bytes_.length < this.position_ + _constants_js__WEBPACK_IMPORTED_MODULE_0__.SIZEOF_INT + + _constants_js__WEBPACK_IMPORTED_MODULE_0__.FILE_IDENTIFIER_LENGTH) { + throw new Error('FlatBuffers: ByteBuffer is too short to contain an identifier.'); + } + let result = ""; + for (let i = 0; i < _constants_js__WEBPACK_IMPORTED_MODULE_0__.FILE_IDENTIFIER_LENGTH; i++) { + result += String.fromCharCode(this.readInt8(this.position_ + _constants_js__WEBPACK_IMPORTED_MODULE_0__.SIZEOF_INT + i)); + } + return result; + } + /** + * Look up a field in the vtable, return an offset into the object, or 0 if the + * field is not present. + */ + __offset(bb_pos, vtable_offset) { + const vtable = bb_pos - this.readInt32(bb_pos); + return vtable_offset < this.readInt16(vtable) ? this.readInt16(vtable + vtable_offset) : 0; + } + /** + * Initialize any Table-derived type to point to the union at the given offset. + */ + __union(t, offset) { + t.bb_pos = offset + this.readInt32(offset); + t.bb = this; + return t; + } + /** + * Create a JavaScript string from UTF-8 data stored inside the FlatBuffer. + * This allocates a new string and converts to wide chars upon each access. + * + * To avoid the conversion to string, pass Encoding.UTF8_BYTES as the + * "optionalEncoding" argument. This is useful for avoiding conversion when + * the data will just be packaged back up in another FlatBuffer later on. + * + * @param offset + * @param opt_encoding Defaults to UTF16_STRING + */ + __string(offset, opt_encoding) { + offset += this.readInt32(offset); + const length = this.readInt32(offset); + offset += _constants_js__WEBPACK_IMPORTED_MODULE_0__.SIZEOF_INT; + const utf8bytes = this.bytes_.subarray(offset, offset + length); + if (opt_encoding === _encoding_js__WEBPACK_IMPORTED_MODULE_2__.Encoding.UTF8_BYTES) + return utf8bytes; + else + return this.text_decoder_.decode(utf8bytes); + } + /** + * Handle unions that can contain string as its member, if a Table-derived type then initialize it, + * if a string then return a new one + * + * WARNING: strings are immutable in JS so we can't change the string that the user gave us, this + * makes the behaviour of __union_with_string different compared to __union + */ + __union_with_string(o, offset) { + if (typeof o === 'string') { + return this.__string(offset); + } + return this.__union(o, offset); + } + /** + * Retrieve the relative offset stored at "offset" + */ + __indirect(offset) { + return offset + this.readInt32(offset); + } + /** + * Get the start of data of a vector whose offset is stored at "offset" in this object. + */ + __vector(offset) { + return offset + this.readInt32(offset) + _constants_js__WEBPACK_IMPORTED_MODULE_0__.SIZEOF_INT; // data starts after the length + } + /** + * Get the length of a vector whose offset is stored at "offset" in this object. + */ + __vector_len(offset) { + return this.readInt32(offset + this.readInt32(offset)); + } + __has_identifier(ident) { + if (ident.length != _constants_js__WEBPACK_IMPORTED_MODULE_0__.FILE_IDENTIFIER_LENGTH) { + throw new Error('FlatBuffers: file identifier must be length ' + + _constants_js__WEBPACK_IMPORTED_MODULE_0__.FILE_IDENTIFIER_LENGTH); + } + for (let i = 0; i < _constants_js__WEBPACK_IMPORTED_MODULE_0__.FILE_IDENTIFIER_LENGTH; i++) { + if (ident.charCodeAt(i) != this.readInt8(this.position() + _constants_js__WEBPACK_IMPORTED_MODULE_0__.SIZEOF_INT + i)) { + return false; + } + } + return true; + } + /** + * A helper function for generating list for obj api + */ + createScalarList(listAccessor, listLength) { + const ret = []; + for (let i = 0; i < listLength; ++i) { + const val = listAccessor(i); + if (val !== null) { + ret.push(val); + } + } + return ret; + } + /** + * A helper function for generating list for obj api + * @param listAccessor function that accepts an index and return data at that index + * @param listLength listLength + * @param res result list + */ + createObjList(listAccessor, listLength) { + const ret = []; + for (let i = 0; i < listLength; ++i) { + const val = listAccessor(i); + if (val !== null) { + ret.push(val.unpack()); + } + } + return ret; + } +} + + +/***/ }), + +/***/ "./node_modules/flatbuffers/mjs/constants.js": +/*!***************************************************!*\ + !*** ./node_modules/flatbuffers/mjs/constants.js ***! + \***************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ FILE_IDENTIFIER_LENGTH: () => (/* binding */ FILE_IDENTIFIER_LENGTH), +/* harmony export */ SIZEOF_INT: () => (/* binding */ SIZEOF_INT), +/* harmony export */ SIZEOF_SHORT: () => (/* binding */ SIZEOF_SHORT), +/* harmony export */ SIZE_PREFIX_LENGTH: () => (/* binding */ SIZE_PREFIX_LENGTH) +/* harmony export */ }); +const SIZEOF_SHORT = 2; +const SIZEOF_INT = 4; +const FILE_IDENTIFIER_LENGTH = 4; +const SIZE_PREFIX_LENGTH = 4; + + +/***/ }), + +/***/ "./node_modules/flatbuffers/mjs/encoding.js": +/*!**************************************************!*\ + !*** ./node_modules/flatbuffers/mjs/encoding.js ***! + \**************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ Encoding: () => (/* binding */ Encoding) +/* harmony export */ }); +var Encoding; +(function (Encoding) { + Encoding[Encoding["UTF8_BYTES"] = 1] = "UTF8_BYTES"; + Encoding[Encoding["UTF16_STRING"] = 2] = "UTF16_STRING"; +})(Encoding || (Encoding = {})); + + +/***/ }), + +/***/ "./node_modules/flatbuffers/mjs/flatbuffers.js": +/*!*****************************************************!*\ + !*** ./node_modules/flatbuffers/mjs/flatbuffers.js ***! + \*****************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ Builder: () => (/* reexport safe */ _builder_js__WEBPACK_IMPORTED_MODULE_3__.Builder), +/* harmony export */ ByteBuffer: () => (/* reexport safe */ _byte_buffer_js__WEBPACK_IMPORTED_MODULE_4__.ByteBuffer), +/* harmony export */ Encoding: () => (/* reexport safe */ _encoding_js__WEBPACK_IMPORTED_MODULE_2__.Encoding), +/* harmony export */ FILE_IDENTIFIER_LENGTH: () => (/* reexport safe */ _constants_js__WEBPACK_IMPORTED_MODULE_0__.FILE_IDENTIFIER_LENGTH), +/* harmony export */ SIZEOF_INT: () => (/* reexport safe */ _constants_js__WEBPACK_IMPORTED_MODULE_0__.SIZEOF_INT), +/* harmony export */ SIZEOF_SHORT: () => (/* reexport safe */ _constants_js__WEBPACK_IMPORTED_MODULE_0__.SIZEOF_SHORT), +/* harmony export */ SIZE_PREFIX_LENGTH: () => (/* reexport safe */ _constants_js__WEBPACK_IMPORTED_MODULE_0__.SIZE_PREFIX_LENGTH), +/* harmony export */ float32: () => (/* reexport safe */ _utils_js__WEBPACK_IMPORTED_MODULE_1__.float32), +/* harmony export */ float64: () => (/* reexport safe */ _utils_js__WEBPACK_IMPORTED_MODULE_1__.float64), +/* harmony export */ int32: () => (/* reexport safe */ _utils_js__WEBPACK_IMPORTED_MODULE_1__.int32), +/* harmony export */ isLittleEndian: () => (/* reexport safe */ _utils_js__WEBPACK_IMPORTED_MODULE_1__.isLittleEndian) +/* harmony export */ }); +/* harmony import */ var _constants_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./constants.js */ "./node_modules/flatbuffers/mjs/constants.js"); +/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils.js */ "./node_modules/flatbuffers/mjs/utils.js"); +/* harmony import */ var _encoding_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./encoding.js */ "./node_modules/flatbuffers/mjs/encoding.js"); +/* harmony import */ var _builder_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./builder.js */ "./node_modules/flatbuffers/mjs/builder.js"); +/* harmony import */ var _byte_buffer_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./byte-buffer.js */ "./node_modules/flatbuffers/mjs/byte-buffer.js"); + + + + + + + + + + +/***/ }), + +/***/ "./node_modules/flatbuffers/mjs/utils.js": +/*!***********************************************!*\ + !*** ./node_modules/flatbuffers/mjs/utils.js ***! + \***********************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ float32: () => (/* binding */ float32), +/* harmony export */ float64: () => (/* binding */ float64), +/* harmony export */ int32: () => (/* binding */ int32), +/* harmony export */ isLittleEndian: () => (/* binding */ isLittleEndian) +/* harmony export */ }); +const int32 = new Int32Array(2); +const float32 = new Float32Array(int32.buffer); +const float64 = new Float64Array(int32.buffer); +const isLittleEndian = new Uint16Array(new Uint8Array([1, 0]).buffer)[0] === 1; + + +/***/ }), + +/***/ "./node_modules/openmeteo/lib/index.js": +/*!*********************************************!*\ + !*** ./node_modules/openmeteo/lib/index.js ***! + \*********************************************/ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + + +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.fetchWeatherApi = fetchWeatherApi; +const flatbuffers_1 = __webpack_require__(/*! flatbuffers */ "./node_modules/flatbuffers/mjs/flatbuffers.js"); +const weather_api_response_1 = __webpack_require__(/*! @openmeteo/sdk/weather-api-response */ "./node_modules/@openmeteo/sdk/weather-api-response.js"); +const sleep = (ms) => new Promise(r => setTimeout(r, ms)); +function fetchRetried(url_1) { + return __awaiter(this, arguments, void 0, function* (url, retries = 3, backoffFactor = 0.5, backoffMax = 2, fetchOptions = {}) { + const statusToRetry = [500, 502, 504]; + const statusWithJsonError = [400, 429]; + let currentTry = 0; + let response = yield fetch(url, fetchOptions); + while (statusToRetry.includes(response.status)) { + currentTry++; + if (currentTry >= retries) { + throw new Error(response.statusText); + } + const sleepMs = Math.min(backoffFactor * Math.pow(2, currentTry), backoffMax) * 1000; + yield sleep(sleepMs); + response = yield fetch(url, fetchOptions); + } + if (statusWithJsonError.includes(response.status)) { + const json = yield response.json(); + if ('reason' in json) { + throw new Error(json.reason); + } + throw new Error(response.statusText); + } + return response; + }); +} +/** + * Retrieve data from the Open-Meteo weather API + * + * @param {string} url Server and endpoint. E.g. "https://api.open-meteo.com/v1/forecast" + * @param {any} params URL parameter as an object + * @param {number} [retries=3] Number of retries in case of an server error + * @param {number} [backoffFactor=0.2] Exponential backoff factor to increase wait time after each retry + * @param {number} [backoffMax=2] Maximum wait time between retries + * @param {RequestInit} [fetchOptions={}] Additional fetch options such as headers, signal, etc. + * @returns {Promise} + */ +function fetchWeatherApi(url_1, params_1) { + return __awaiter(this, arguments, void 0, function* (url, params, retries = 3, backoffFactor = 0.2, backoffMax = 2, fetchOptions = {}) { + const urlParams = new URLSearchParams(params); + urlParams.set('format', 'flatbuffers'); + const response = yield fetchRetried(`${url}?${urlParams.toString()}`, retries, backoffFactor, backoffMax, fetchOptions); + const fb = new flatbuffers_1.ByteBuffer(new Uint8Array(yield response.arrayBuffer())); + const results = []; + let pos = 0; + while (pos < fb.capacity()) { + fb.setPosition(pos); + const len = fb.readInt32(fb.position()); + results.push(weather_api_response_1.WeatherApiResponse.getSizePrefixedRootAsWeatherApiResponse(fb)); + pos += len + 4; + } + return results; + }); +} + + +/***/ }), + /***/ "./src/color-schemes.ts": /*!******************************!*\ !*** ./src/color-schemes.ts ***! @@ -176,7 +1882,7 @@ var Crack = /** @class */ (function () { Crack.prototype.start = function (x, y, angle) { this.x = x + .61 * Math.cos(angle * Math.PI / 180); this.y = y + .61 * Math.sin(angle * Math.PI / 180); - var flip = Math.random() < 0.5; + var flip = Math.random() > 0.5; this.angle = angle + (90 + Math.floor(Math.random() * 4.1 - 2)) * (flip ? -1 : 1); }; Crack.prototype.draw = function () { @@ -390,6 +2096,17 @@ __webpack_require__.r(__webpack_exports__); var State = /** @class */ (function () { function State(colors, maxCracks, canvas) { + this.canvasColors = [ + "rgb(27 27 27 / 90%)", + "rgb(90 90 90 / 90%)", + "rgb(126 126 126 / 90%)", + "rgb(180 180 180 / 90%)", + "rgb(255 255 255 / 90%)", + "rgb(180 180 180 / 90%)", + "rgb(126 126 126 / 90%)", + "rgb(90 90 90 / 90%)" + ]; + this.canvasIndex = 0; this.colorIndex = 0; this.canvas = canvas; this.maxCracks = maxCracks; @@ -409,7 +2126,7 @@ var State = /** @class */ (function () { var height = this.canvas.height; var width = this.canvas.width; var context = this.canvas.getContext("2d"); - context.fillStyle = "rgb(255 255 255 / 95%)"; + context.fillStyle = this.canvasColors[this.canvasIndex++ % this.canvasColors.length]; context.fillRect(0, 0, width, height); for (var x = 0; x < width; x++) { this.grid[x] = []; @@ -531,6 +2248,185 @@ var Substrate = /** @class */ (function () { /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Substrate); +/***/ }), + +/***/ "./src/weather.ts": +/*!************************!*\ + !*** ./src/weather.ts ***! + \************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var openmeteo__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! openmeteo */ "./node_modules/openmeteo/lib/index.js"); +/* harmony import */ var openmeteo__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(openmeteo__WEBPACK_IMPORTED_MODULE_0__); +var __assign = (undefined && undefined.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; +var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (undefined && undefined.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype); + return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (g && (g = 0, op[0] && (_ = 0)), _) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var __spreadArray = (undefined && undefined.__spreadArray) || function (to, from, pack) { + if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { + if (ar || !(i in from)) { + if (!ar) ar = Array.prototype.slice.call(from, 0, i); + ar[i] = from[i]; + } + } + return to.concat(ar || Array.prototype.slice.call(from)); +}; + +var Weather = /** @class */ (function () { + function Weather(latitude, longitude) { + latitude !== null && latitude !== void 0 ? latitude : (latitude = 47.61002138071677); + longitude !== null && longitude !== void 0 ? longitude : (longitude = -122.17906310779568); + this.options = new WeatherOptions(); + this.options = __assign(__assign({}, this.options), { latitude: latitude, longitude: longitude }); + this.getWeather().then(function () { + }); + } + Weather.prototype.getWeather = function () { + return __awaiter(this, void 0, void 0, function () { + var url, responses, _loop_1, _i, responses_1, response; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + url = "https://api.open-meteo.com/v1/forecast"; + return [4 /*yield*/, (0,openmeteo__WEBPACK_IMPORTED_MODULE_0__.fetchWeatherApi)(url, this.options)]; + case 1: + responses = _a.sent(); + _loop_1 = function (response) { + // Attributes for timezone and location + var utcOffsetSeconds = response.utcOffsetSeconds(); + var timezone = response.timezone(); + var timezoneAbbreviation = response.timezoneAbbreviation(); + var latitude = response.latitude(); + var longitude = response.longitude(); + var current = response.current(); + var hourly = response.hourly(); + var daily = response.daily(); + var sunrise = daily.variables(2); + var sunset = daily.variables(3); + // Note: The order of weather variables in the URL query and the indices below need to match! + var weatherData = { + current: { + time: new Date((Number(current.time()) + utcOffsetSeconds) * 1000), + temperature2m: current.variables(0).value(), + relativeHumidity2m: current.variables(1).value(), + apparentTemperature: current.variables(2).value(), + precipitation: current.variables(3).value(), + windSpeed10m: current.variables(4).value(), + windGusts10m: current.variables(5).value(), + windDirection10m: current.variables(6).value(), + }, + hourly: { + time: __spreadArray([], Array((Number(hourly.timeEnd()) - Number(hourly.time())) / hourly.interval()), true).map(function (_, i) { return new Date((Number(hourly.time()) + i * hourly.interval() + utcOffsetSeconds) * 1000); }), + temperature2m: hourly.variables(0).valuesArray(), + precipitation: hourly.variables(1).valuesArray(), + precipitationProbability: hourly.variables(2).valuesArray(), + }, + daily: { + time: __spreadArray([], Array((Number(daily.timeEnd()) - Number(daily.time())) / daily.interval()), true).map(function (_, i) { return new Date((Number(daily.time()) + i * daily.interval() + utcOffsetSeconds) * 1000); }), + temperature2mMax: daily.variables(0).valuesArray(), + temperature2mMin: daily.variables(1).valuesArray(), + sunrise: __spreadArray([], Array(sunrise.valuesInt64Length()), true).map(function (_, i) { return new Date((Number(sunrise.valuesInt64(i)) + utcOffsetSeconds) * 1000); }), + sunset: __spreadArray([], Array(sunset.valuesInt64Length()), true).map(function (_, i) { return new Date((Number(sunset.valuesInt64(i)) + utcOffsetSeconds) * 1000); }), + uvIndexMax: daily.variables(4).valuesArray(), + precipitationSum: daily.variables(5).valuesArray(), + precipitationHours: daily.variables(6).valuesArray(), + windSpeed10mMax: daily.variables(7).valuesArray(), + windGusts10mMax: daily.variables(8).valuesArray(), + windDirection10mDominant: daily.variables(9).valuesArray(), + }, + }; + console.log(weatherData); + // `weatherData` now contains a simple structure with arrays for datetime and weather data + for (var i = 0; i < weatherData.hourly.time.length; i++) { + console.log(weatherData.hourly.time[i].toISOString(), weatherData.hourly.temperature2m[i], weatherData.hourly.precipitation[i], weatherData.hourly.precipitationProbability[i]); + } + for (var i = 0; i < weatherData.daily.time.length; i++) { + console.log(weatherData.daily.time[i].toISOString(), weatherData.daily.temperature2mMax[i], weatherData.daily.temperature2mMin[i], weatherData.daily.sunrise[i].toISOString(), weatherData.daily.sunset[i].toISOString(), weatherData.daily.uvIndexMax[i], weatherData.daily.precipitationSum[i], weatherData.daily.precipitationHours[i], weatherData.daily.windSpeed10mMax[i], weatherData.daily.windGusts10mMax[i], weatherData.daily.windDirection10mDominant[i]); + } + }; + for (_i = 0, responses_1 = responses; _i < responses_1.length; _i++) { + response = responses_1[_i]; + _loop_1(response); + } + return [2 /*return*/]; + } + }); + }); + }; + return Weather; +}()); +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Weather); +var WeatherOptions = /** @class */ (function () { + function WeatherOptions() { + this.daily = ["temperature_2m_max", "temperature_2m_min", "sunrise", "sunset", "uv_index_max", "precipitation_sum", "precipitation_hours", "wind_speed_10m_max", "wind_gusts_10m_max", "wind_direction_10m_dominant"]; + this.hourly = ["temperature_2m", "precipitation", "precipitation_probability"]; + this.current = ["temperature_2m", "relative_humidity_2m", "apparent_temperature", "precipitation", "wind_speed_10m", "wind_gusts_10m", "wind_direction_10m"]; + this.timezone = "America/Los_Angeles"; + this["wind_speed_unit"] = "mph"; + this["temperature_unit"] = "fahrenheit"; + this["precipitation_unit"] = "inch"; + } + return WeatherOptions; +}()); +var WeatherData = /** @class */ (function () { + function WeatherData() { + } + return WeatherData; +}()); +var CurrentWeather = /** @class */ (function () { + function CurrentWeather() { + } + return CurrentWeather; +}()); + + /***/ }) /******/ }); @@ -553,13 +2449,25 @@ var Substrate = /** @class */ (function () { /******/ }; /******/ /******/ // Execute the module function -/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); +/******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /************************************************************************/ +/******/ /* webpack/runtime/compat get default export */ +/******/ (() => { +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = (module) => { +/******/ var getter = module && module.__esModule ? +/******/ () => (module['default']) : +/******/ () => (module); +/******/ __webpack_require__.d(getter, { a: getter }); +/******/ return getter; +/******/ }; +/******/ })(); +/******/ /******/ /* webpack/runtime/define property getters */ /******/ (() => { /******/ // define getter functions for harmony exports @@ -597,19 +2505,19 @@ var __webpack_exports__ = {}; \***********************/ __webpack_require__.r(__webpack_exports__); /* harmony import */ var _substrate__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./substrate */ "./src/substrate.ts"); +/* harmony import */ var _weather__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./weather */ "./src/weather.ts"); + var ready = function (func) { return document.readyState !== "loading" ? func() : document.addEventListener("DOMContentLoaded", func); }; ready(function () { new _substrate__WEBPACK_IMPORTED_MODULE_0__["default"](20); + var weather; + navigator.geolocation.getCurrentPosition(function (position) { + weather = new _weather__WEBPACK_IMPORTED_MODULE_1__["default"](position.coords.latitude, position.coords.longitude); + }, function () { + weather = new _weather__WEBPACK_IMPORTED_MODULE_1__["default"](); + }); }); -/* -let weather: Weather -navigator.geolocation.getCurrentPosition(position => { - weather = new Weather(position.coords.latitude, position.coords.longitude) -}, () => { - weather = new Weather() -}) - */ })(); diff --git a/www/main.js.map b/www/main.js.map index 9467eb4..875255b 100644 --- a/www/main.js.map +++ b/www/main.js.map @@ -1 +1 @@ -{"version":3,"file":"main.js","mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,iBAAiB,SAAI,IAAI,SAAI;AAC7B;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACuB;AACxB;AACA;AACA,uBAAuB,4CAAG;AAC1B;AACA;AACA,wDAAwD,4BAA4B;AACpF;AACA;AACA;AACA,CAAC;AACiB;AAClB;AACA;AACA;AACA;AACA,wBAAwB,4CAAG;AAC3B,wBAAwB,4CAAG;AAC3B,yBAAyB,4CAAG;AAC5B,yBAAyB,4CAAG;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACoB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,4CAAG;AACnB,gBAAgB,4CAAG;AACnB,gBAAgB,4CAAG;AACnB,gBAAgB,4CAAG;AACnB;AACA;AACA;AACA;AACA,CAAC;AACwB;AACzB;AACA;AACA;AACA;AACA,6BAA6B,4CAAG;AAChC;AACA;AACA,gBAAgB,4CAAG;AACnB,gBAAgB,4CAAG;AACnB;AACA;AACA;AACA;AACA,CAAC;AAC6B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,4CAAG;AACnB,gBAAgB,4CAAG;AACnB;AACA;AACA;AACA;AACA,CAAC;AACkB;AACnB;AACA;AACA;AACA;AACA,yBAAyB,4CAAG;AAC5B,6BAA6B,4CAAG;AAChC,mCAAmC,4CAAG;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACmB;AACpB;AACA;AACA;AACA;AACA,yBAAyB,4CAAG;AAC5B,wBAAwB,4CAAG;AAC3B,yBAAyB,4CAAG;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACiB;;;;;;;;;;;;;;;;AChIuB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,qDAAW;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,YAAY;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,iEAAe,KAAK,EAAC;;;;;;;;;;;;;;;;AC9CG;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,4CAAG;AAC9B;AACA;AACA,eAAe,4CAAG;AAClB;AACA;AACA,CAAC;AACD,iEAAe,GAAG,EAAC;;;;;;;;;;;;;;;AC7BnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,iEAAe,GAAG,EAAC;;;;;;;;;;;;;;;AC/CnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C;AAC1C;AACA,wBAAwB,YAAY;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,iEAAe,WAAW,EAAC;;;;;;;;;;;;;;;;ACxCC;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,WAAW;AACnC;AACA,4BAA4B,YAAY;AACxC;AACA;AACA;AACA,wBAAwB,OAAO;AAC/B;AACA;AACA;AACA,iCAAiC,8CAAK;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,8CAAK;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,iEAAe,KAAK,EAAC;;;;;;;;;;;;;;;;;ACvErB;AAC4B;AAC8E;AAC1G;AACA;AACA;AACA,yEAAyE;AACzE;AACA;AACA;AACA;AACA,yBAAyB,8CAAK;AAC9B;AACA;AACA;AACA;AACA;AACA,mDAAmD,gBAAgB;AACnE;AACA;AACA;AACA;AACA;AACA,kCAAkC,kDAAkD;AACpF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,yDAAa;AAC1C;AACA;AACA,6BAA6B,8DAAkB;AAC/C;AACA;AACA,6BAA6B,mDAAO;AACpC;AACA;AACA,6BAA6B,oDAAQ;AACrC;AACA;AACA,6BAA6B,kDAAM;AACnC;AACA;AACA,6BAA6B,qDAAS;AACtC;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,iEAAe,SAAS,EAAC;;;;;;;UCrDzB;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;;WCtBA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA;;;;;WCPA;;;;;WCAA;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D;;;;;;;;;;;;ACNoC;AACpC,8BAA8B;AAC9B;AACA,QAAQ,kDAAS;AACjB,CAAC;AACD;AACA;AACA;AACA;AACA,CAAC;AACD;AACA,CAAC;AACD","sources":["webpack:///./src/color-schemes.ts","webpack:///./src/crack.ts","webpack:///./src/hsl.ts","webpack:///./src/rgb.ts","webpack:///./src/sand-painter.ts","webpack:///./src/state.ts","webpack:///./src/substrate.ts","webpack:///webpack/bootstrap","webpack:///webpack/runtime/define property getters","webpack:///webpack/runtime/hasOwnProperty shorthand","webpack:///webpack/runtime/make namespace object","webpack:///./src/launch.ts"],"sourcesContent":["var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport HSL from \"./hsl\";\nvar Scheme = /** @class */ (function () {\n function Scheme(initial) {\n this.primary = HSL.fromHex(initial);\n }\n Scheme.prototype.toString = function () {\n var values = this.colors.map(function (color) { return color.toString(16); }).join(\",\");\n return \"\".concat(this.constructor.name, \": \").concat(values);\n };\n return Scheme;\n}());\nexport { Scheme };\nvar Analogous = /** @class */ (function (_super) {\n __extends(Analogous, _super);\n function Analogous(initial) {\n var _this = _super.call(this, initial) || this;\n var left1 = new HSL(_this.primary.hue - 30, _this.primary.saturation, _this.primary.lightness);\n var left2 = new HSL(_this.primary.hue - 15, _this.primary.saturation, _this.primary.lightness);\n var right1 = new HSL(_this.primary.hue + 15, _this.primary.saturation, _this.primary.lightness);\n var right2 = new HSL(_this.primary.hue + 30, _this.primary.saturation, _this.primary.lightness);\n _this.colors = [\n left1.toHex(),\n left2.toHex(),\n initial,\n right1.toHex(),\n right2.toHex()\n ];\n return _this;\n }\n return Analogous;\n}(Scheme));\nexport { Analogous };\nvar Monochromatic = /** @class */ (function (_super) {\n __extends(Monochromatic, _super);\n function Monochromatic(initial) {\n var _this = _super.call(this, initial) || this;\n var delta = _this.primary.lightness / 6;\n _this.colors = [\n initial,\n new HSL(_this.primary.hue, _this.primary.saturation, _this.primary.lightness - delta).toHex(),\n new HSL(_this.primary.hue, _this.primary.saturation, _this.primary.lightness - delta * 2).toHex(),\n new HSL(_this.primary.hue, _this.primary.saturation, _this.primary.lightness - delta * 3).toHex(),\n new HSL(_this.primary.hue, _this.primary.saturation, _this.primary.lightness - delta * 4).toHex()\n ];\n return _this;\n }\n return Monochromatic;\n}(Scheme));\nexport { Monochromatic };\nvar SplitComplementary = /** @class */ (function (_super) {\n __extends(SplitComplementary, _super);\n function SplitComplementary(initial) {\n var _this = _super.call(this, initial) || this;\n var complement = new HSL((_this.primary.hue + 180) % 360, _this.primary.saturation, _this.primary.lightness);\n _this.colors = [\n initial,\n new HSL(complement.hue - 30, complement.saturation, complement.lightness).toHex(),\n new HSL(complement.hue + 30, complement.saturation, complement.lightness).toHex()\n ];\n return _this;\n }\n return SplitComplementary;\n}(Scheme));\nexport { SplitComplementary };\nvar Triadic = /** @class */ (function (_super) {\n __extends(Triadic, _super);\n function Triadic(initial) {\n var _this = _super.call(this, initial) || this;\n _this.colors = [\n initial,\n new HSL(_this.primary.hue - 120, _this.primary.saturation, _this.primary.lightness).toHex(),\n new HSL(_this.primary.hue + 120, _this.primary.saturation, _this.primary.lightness).toHex()\n ];\n return _this;\n }\n return Triadic;\n}(Scheme));\nexport { Triadic };\nvar Tetradic = /** @class */ (function (_super) {\n __extends(Tetradic, _super);\n function Tetradic(initial) {\n var _this = _super.call(this, initial) || this;\n var second = new HSL(_this.primary.hue + 45, _this.primary.saturation, _this.primary.lightness);\n var complement = new HSL(_this.primary.hue + 180, _this.primary.saturation, _this.primary.lightness);\n var secondComplement = new HSL(second.hue + 180, _this.primary.saturation, _this.primary.lightness);\n _this.colors = [\n initial,\n second.toHex(),\n complement.toHex(),\n secondComplement.toHex()\n ];\n return _this;\n }\n return Tetradic;\n}(Scheme));\nexport { Tetradic };\nvar Square = /** @class */ (function (_super) {\n __extends(Square, _super);\n function Square(initial) {\n var _this = _super.call(this, initial) || this;\n var second = new HSL(_this.primary.hue + 90, _this.primary.saturation, _this.primary.lightness);\n var third = new HSL(_this.primary.hue + 180, _this.primary.saturation, _this.primary.lightness);\n var fourth = new HSL(second.hue + 270, _this.primary.saturation, _this.primary.lightness);\n _this.colors = [\n initial,\n second.toHex(),\n third.toHex(),\n fourth.toHex()\n ];\n return _this;\n }\n return Square;\n}(Scheme));\nexport { Square };\n","import SandPainter from \"./sand-painter\";\nvar Crack = /** @class */ (function () {\n function Crack(state, x, y, angle) {\n this.x = 0;\n this.y = 0;\n this.angle = 0;\n this.state = state;\n this.painter = new SandPainter(this);\n this.start(x, y, angle);\n }\n Crack.prototype.start = function (x, y, angle) {\n this.x = x + .61 * Math.cos(angle * Math.PI / 180);\n this.y = y + .61 * Math.sin(angle * Math.PI / 180);\n var flip = Math.random() < 0.5;\n this.angle = angle + (90 + Math.floor(Math.random() * 4.1 - 2)) * (flip ? -1 : 1);\n };\n Crack.prototype.draw = function () {\n this.x += .42 * Math.cos(this.angle * Math.PI / 180);\n this.y += .42 * Math.sin(this.angle * Math.PI / 180);\n var fuzzX = this.x + (Math.random() * .66 - .33);\n var fuzzY = this.y + (Math.random() * .66 - .33);\n var context = this.state.canvas.getContext(\"2d\");\n context.fillStyle = \"#000\";\n context.fillRect(fuzzX, fuzzY, 1, 1);\n this.painter.render();\n var x = Math.floor(this.x);\n var y = Math.floor(this.y);\n if (this.state.isWithinBoundary(x, y)) {\n var angle = this.state.grid[x][y];\n if (angle > 10000) {\n this.state.grid[x][y] = Math.floor(this.angle);\n this.state.seeds.push({ x: x, y: y });\n }\n else if (this.state.grid[x][y] != Math.floor(this.angle)) {\n var entry = this.state.getNewEntry();\n this.start(entry.x, entry.y, entry.angle);\n }\n }\n else {\n var entry = this.state.getNewEntry();\n this.start(entry.x, entry.y, entry.angle);\n this.state.addCrack();\n }\n };\n return Crack;\n}());\nexport default Crack;\n","import RGB from \"./rgb\";\nvar HSL = /** @class */ (function () {\n function HSL(hue, saturation, lightness) {\n this.hue = (hue + 360) % 360;\n this.saturation = saturation;\n this.lightness = lightness;\n }\n // https://en.wikipedia.org/wiki/HSL_and_HSV\n HSL.fromRgb = function (rgb) {\n var redValue = rgb.red / 255, greenValue = rgb.green / 255, blueValue = rgb.blue / 255, max = Math.max(redValue, greenValue, blueValue), min = Math.min(redValue, greenValue, blueValue), chroma = max - min, lightness = .5 * (max + min), saturation = 1 - (3 / (redValue + greenValue + blueValue)) * Math.min(redValue, greenValue, blueValue);\n var huePrime = 0;\n if (chroma != 0) {\n if (redValue == max)\n huePrime = ((greenValue - blueValue) / chroma) % 6;\n else if (greenValue == max)\n huePrime = ((blueValue - redValue) / chroma) + 2;\n else\n huePrime = ((redValue - greenValue) / chroma) + 4;\n }\n return new HSL(huePrime * 60, saturation, lightness);\n };\n HSL.fromHex = function (color) {\n return HSL.fromRgb(RGB.fromHex(color));\n };\n HSL.prototype.toHex = function () {\n return RGB.fromHsl(this).toHex();\n };\n return HSL;\n}());\nexport default HSL;\n","var RGB = /** @class */ (function () {\n function RGB(red, green, blue) {\n this.red = Math.floor(red < 0 ? 0 : red > 255 ? 255 : red);\n this.green = Math.floor(green < 0 ? 0 : green > 255 ? 255 : green);\n this.blue = Math.floor(blue < 0 ? 0 : blue > 255 ? 255 : blue);\n }\n RGB.prototype.toHex = function () {\n return (this.red << 16) + (this.green << 8) + this.blue;\n };\n // https://en.wikipedia.org/wiki/HSL_and_HSV\n RGB.fromHsl = function (hsl) {\n var red = 0, green = 0, blue = 0;\n var chroma = (1 - Math.abs(2 * hsl.lightness - 1)) * hsl.saturation, range = hsl.hue / 60, intermediate = chroma * (1 - Math.abs(range % 2 - 1)), match = hsl.lightness - chroma / 2;\n if (range >= 0 && range < 1) {\n red = chroma;\n green = intermediate;\n }\n else if (range >= 1 && range < 2) {\n red = intermediate;\n green = chroma;\n }\n else if (range >= 2 && range < 3) {\n green = chroma;\n blue = intermediate;\n }\n else if (range >= 3 && range < 4) {\n green = intermediate;\n blue = chroma;\n }\n else if (range >= 4 && range < 5) {\n red = intermediate;\n blue = chroma;\n }\n else if (range >= 5 && range < 6) {\n red = chroma;\n blue = intermediate;\n }\n return new RGB((red + match) * 255, (green + match) * 255, (blue + match) * 255);\n };\n RGB.fromHex = function (color) {\n var red = color >> 16;\n var green = (color - (red << 16)) >> 8;\n var blue = color - (red << 16) - (green << 8);\n return new RGB(red, green, blue);\n };\n return RGB;\n}());\nexport default RGB;\n","var SandPainter = /** @class */ (function () {\n function SandPainter(crack) {\n this.crack = crack;\n this.color = this.crack.state.getNextColor();\n this.gain = Math.random() / 10;\n }\n SandPainter.prototype.render = function () {\n var state = this.crack.state, x = this.crack.x, y = this.crack.y, angle = this.crack.angle;\n var open = true, endX = x, endY = y;\n while (open) {\n endX += .81 * Math.sin(angle * Math.PI / 180);\n endY -= .81 * Math.cos(angle * Math.PI / 180);\n var gridX = Math.floor(endX);\n var gridY = Math.floor(endY);\n if (state.isWithinBoundary(gridX, gridY)) {\n open = state.grid[gridX][gridY] > 10000;\n }\n else {\n open = false;\n }\n }\n this.gain += (Math.random() / 10 - .05);\n if (this.gain < 0)\n this.gain = 0;\n if (this.gain > 1)\n this.gain = 1;\n var grains = 64;\n var hex = this.color.toString(16);\n var w = this.gain / (grains - 1); // some kind of multiplier\n var context = state.canvas.getContext(\"2d\");\n for (var i = 0; i < grains; i++) {\n var alpha = Math.floor((.1 - i / (grains * 10)) * 255);\n var paintX = x + (endX - x) * Math.sin(Math.sin(i * w));\n var paintY = y + (endY - y) * Math.sin(Math.sin(i * w));\n context.fillStyle = \"#\".concat(hex.padStart(6, \"0\")).concat(alpha.toString(16).padStart(2, \"0\"));\n context.fillRect(paintX, paintY, 1, 1);\n }\n };\n return SandPainter;\n}());\nexport default SandPainter;\n","import Crack from \"./crack\";\nvar State = /** @class */ (function () {\n function State(colors, maxCracks, canvas) {\n this.colorIndex = 0;\n this.canvas = canvas;\n this.maxCracks = maxCracks;\n this.grid = [];\n this.colors = colors;\n this.cracks = [];\n this.seeds = [];\n this.init();\n }\n State.prototype.init = function (colors) {\n if (colors)\n this.colors = colors;\n this.cracks.length = 0;\n this.grid.length = 0;\n this.seeds.length = 0;\n this.colorIndex = 0;\n var height = this.canvas.height;\n var width = this.canvas.width;\n var context = this.canvas.getContext(\"2d\");\n context.fillStyle = \"rgb(255 255 255 / 95%)\";\n context.fillRect(0, 0, width, height);\n for (var x = 0; x < width; x++) {\n this.grid[x] = [];\n for (var y = 0; y < height; y++) {\n this.grid[x][y] = 10001;\n }\n }\n for (var i = 0; i < 3; i++) {\n var x = Math.floor(Math.random() * width);\n var y = Math.floor(Math.random() * height);\n var angle = Math.floor(Math.random() * 360);\n this.cracks.push(new Crack(this, x, y, angle));\n this.grid[x][y] = angle;\n }\n };\n State.prototype.addCrack = function () {\n if (this.cracks.length >= this.maxCracks)\n return;\n var _a = this.getNewEntry(), x = _a.x, y = _a.y, angle = _a.angle;\n this.cracks.push(new Crack(this, x, y, angle));\n };\n State.prototype.getNextColor = function () {\n return this.colors[this.colorIndex++ % this.colors.length];\n };\n State.prototype.isWithinBoundary = function (x, y) {\n return x >= 0 && x < this.canvas.width && y >= 0 && y < this.canvas.height;\n };\n State.prototype.getNewEntry = function () {\n if (!this.seeds.length) {\n var x = Math.floor(Math.random() * this.canvas.width);\n var y = Math.floor(Math.random() * this.canvas.height);\n var angle = this.grid[x][y];\n if (angle > 10000) {\n angle = Math.floor(Math.random() * 360);\n this.grid[x][y] = angle;\n }\n return { x: x, y: y, angle: angle };\n }\n var randomIndex = Math.floor(Math.random() * this.seeds.length);\n var entry = this.seeds.splice(randomIndex, 1)[0];\n return {\n x: entry.x,\n y: entry.y,\n angle: this.grid[entry.x][entry.y]\n };\n };\n return State;\n}());\nexport default State;\n","// TS attempt of http://www.complexification.net/gallery/machines/substrate/index.php by laniaung.me\nimport State from \"./state\";\nimport { Analogous, Monochromatic, SplitComplementary, Square, Tetradic, Triadic } from \"./color-schemes\";\nvar Substrate = /** @class */ (function () {\n function Substrate(maxCracks, colors) {\n if (!(colors === null || colors === void 0 ? void 0 : colors.length))\n colors = [0x3a1e3e, 0x7c2d3b, 0xb94f3c, 0xf4a462, 0xf9c54e]; // https://colormagic.app/palette/671eeb6c42273fc4c1bb1ac7\n var canvas = document.createElement(\"canvas\");\n canvas.width = document.body.clientWidth;\n canvas.height = document.body.clientHeight;\n document.body.appendChild(canvas);\n this.state = new State(colors, maxCracks, canvas);\n this.init();\n }\n Substrate.prototype.init = function () {\n var me = this;\n var draw = function () {\n for (var _i = 0, _a = me.state.cracks; _i < _a.length; _i++) {\n var crack = _a[_i];\n crack.draw();\n }\n requestAnimationFrame(draw);\n };\n setInterval(function () { return me.state.init(me.getRandomColorScheme()); }, 120 * 1000);\n draw();\n };\n Substrate.prototype.getRandomColorScheme = function () {\n var color = Math.floor(Math.random() * Math.pow(256, 3));\n var scheme;\n switch (Math.floor(Math.random() * 6)) {\n case 1:\n scheme = new Monochromatic(color);\n break;\n case 2:\n scheme = new SplitComplementary(color);\n break;\n case 3:\n scheme = new Triadic(color);\n break;\n case 4:\n scheme = new Tetradic(color);\n break;\n case 5:\n scheme = new Square(color);\n break;\n default:\n scheme = new Analogous(color);\n }\n console.info(scheme.toString());\n return scheme.colors;\n };\n return Substrate;\n}());\nexport default Substrate;\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};","import Substrate from \"./substrate\";\nvar ready = function (func) { return document.readyState !== \"loading\" ? func() : document.addEventListener(\"DOMContentLoaded\", func); };\nready(function () {\n new Substrate(20);\n});\n/*\nlet weather: Weather\nnavigator.geolocation.getCurrentPosition(position => {\n weather = new Weather(position.coords.latitude, position.coords.longitude)\n}, () => {\n weather = new Weather()\n})\n */ \n"],"names":[],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"main.js","mappings":";;;;;;;;;;AAAa;AACb;AACA,8CAA6C,EAAE,aAAa,EAAC;AAC7D,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,kBAAkB,mBAAmB,mBAAmB;;;;;;;;;;;ACnB5C;AACb;AACA,8CAA6C,EAAE,aAAa,EAAC;AAC7D,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,YAAY,aAAa,aAAa;;;;;;;;;;;ACvG1B;AACb;AACA,8CAA6C,EAAE,aAAa,EAAC;AAC7D,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,WAAW,YAAY,YAAY;;;;;;;;;;;ACjDvB;AACb;AACA;AACA;AACA;AACA;AACA,eAAe,oCAAoC;AACnD;AACA;AACA,CAAC;AACD;AACA;AACA,CAAC;AACD;AACA,0CAA0C,4BAA4B;AACtE,CAAC;AACD;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2DAA2D,cAAc;AACzE;AACA;AACA;AACA,CAAC;AACD,8CAA6C,EAAE,aAAa,EAAC;AAC7D,0BAA0B;AAC1B;AACA,iCAAiC,mBAAO,CAAC,kEAAa;AACtD,yBAAyB,mBAAO,CAAC,sEAAkB;AACnD,kBAAkB,mBAAO,CAAC,wDAAW;AACrC,sBAAsB,mBAAO,CAAC,gEAAe;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B;;;;;;;;;;;ACxHb;AACb;AACA,8CAA6C,EAAE,aAAa,EAAC;AAC7D,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,eAAe,gBAAgB,gBAAgB;;;;;;;;;;;AC5JnC;AACb;AACA;AACA;AACA;AACA;AACA,eAAe,oCAAoC;AACnD;AACA;AACA,CAAC;AACD;AACA;AACA,CAAC;AACD;AACA,0CAA0C,4BAA4B;AACtE,CAAC;AACD;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2DAA2D,cAAc;AACzE;AACA;AACA;AACA,CAAC;AACD,8CAA6C,EAAE,aAAa,EAAC;AAC7D,yBAAyB;AACzB;AACA,iCAAiC,mBAAO,CAAC,kEAAa;AACtD,kCAAkC,mBAAO,CAAC,wFAA2B;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;;;;;;;;;;;AC9EZ;AACb;AACA;AACA;AACA;AACA;AACA,eAAe,oCAAoC;AACnD;AACA;AACA,CAAC;AACD;AACA;AACA,CAAC;AACD;AACA,0CAA0C,4BAA4B;AACtE,CAAC;AACD;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2DAA2D,cAAc;AACzE;AACA;AACA;AACA,CAAC;AACD,8CAA6C,EAAE,aAAa,EAAC;AAC7D,0BAA0B;AAC1B;AACA,iCAAiC,mBAAO,CAAC,kEAAa;AACtD,mBAAmB,mBAAO,CAAC,0DAAY;AACvC,iCAAiC,mBAAO,CAAC,sFAA0B;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B;;;;;;;;;;;;;;;;;ACnHoB;AACwD;AAC/F;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA,kBAAkB,uDAAU;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,eAAe;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,8BAA8B;AACtE;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,uDAAU;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,qDAAU,MAAM;AAClC,iDAAiD,qDAAU;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,eAAe;AACvC,gCAAgC;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,+BAA+B;AAC9C;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA;AACA,mCAAmC;AACnC;AACA,uDAAuD,uDAAY;AACnE;AACA;AACA;AACA;AACA,gCAAgC,yBAAyB;AACzD;AACA;AACA,6BAA6B,uDAAY,EAAE,SAAS,KAAK,uDAAY;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,6DAAkB;AAChE;AACA;AACA,qCAAqC,qDAAU;AAC/C,gBAAgB,iEAAsB;AACtC,0CAA0C,iEAAsB;AAChE;AACA,oBAAoB,iEAAsB;AAC1C;AACA,yBAAyB,iEAAsB,MAAM,QAAQ;AAC7D;AACA;AACA;AACA,iCAAiC,qDAAU;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,qDAAU;AAC5B,qDAAqD;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,iBAAiB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;ACphBoE;AACC;AAC5B;AAClC;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,4CAAK;AACb,eAAe,8CAAO;AACtB;AACA;AACA,QAAQ,4CAAK,CAAC,qDAAc;AAC5B,QAAQ,4CAAK,CAAC,qDAAc;AAC5B,eAAe,8CAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,8CAAO;AACf,gCAAgC,4CAAK;AACrC;AACA;AACA,QAAQ,8CAAO;AACf,gCAAgC,4CAAK,CAAC,qDAAc;AACpD,oCAAoC,4CAAK,CAAC,qDAAc;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,qDAAU;AAC5D,YAAY,iEAAsB;AAClC;AACA;AACA;AACA,wBAAwB,IAAI,iEAAsB,EAAE;AACpD,yEAAyE,qDAAU;AACnF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,qDAAU;AAC5B;AACA,6BAA6B,kDAAQ;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,qDAAU,EAAE;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,iEAAsB;AAClD;AACA,gBAAgB,iEAAsB;AACtC;AACA,wBAAwB,IAAI,iEAAsB,EAAE;AACpD,uEAAuE,qDAAU;AACjF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,gBAAgB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,gBAAgB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;ACtPO;AACA;AACA;AACA;;;;;;;;;;;;;;;ACHA;AACP;AACA;AACA;AACA,CAAC,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACJiB;AACF;AACY;AACJ;AACiB;AAC5B;AACF;AACO;;;;;;;;;;;;;;;;;;ACPvC;AACA;AACA;AACA;;;;;;;;;;;ACHM;AACb;AACA,4BAA4B,+DAA+D,iBAAiB;AAC5G;AACA,oCAAoC,MAAM,+BAA+B,YAAY;AACrF,mCAAmC,MAAM,mCAAmC,YAAY;AACxF,gCAAgC;AAChC;AACA,KAAK;AACL;AACA,8CAA6C,EAAE,aAAa,EAAC;AAC7D,uBAAuB;AACvB,sBAAsB,mBAAO,CAAC,kEAAa;AAC3C,+BAA+B,mBAAO,CAAC,kGAAqC;AAC5E;AACA;AACA,iIAAiI;AACjI;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,KAAK;AAChB,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,aAAa,gBAAgB;AACxC,aAAa;AACb;AACA;AACA,yIAAyI;AACzI;AACA;AACA,+CAA+C,IAAI,GAAG,qBAAqB;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;;;;;;;;;;;;;;;;;;;;;ACnEA,iBAAiB,SAAI,IAAI,SAAI;AAC7B;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACuB;AACxB;AACA;AACA,uBAAuB,4CAAG;AAC1B;AACA;AACA,wDAAwD,4BAA4B;AACpF;AACA;AACA;AACA,CAAC;AACiB;AAClB;AACA;AACA;AACA;AACA,wBAAwB,4CAAG;AAC3B,wBAAwB,4CAAG;AAC3B,yBAAyB,4CAAG;AAC5B,yBAAyB,4CAAG;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACoB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,4CAAG;AACnB,gBAAgB,4CAAG;AACnB,gBAAgB,4CAAG;AACnB,gBAAgB,4CAAG;AACnB;AACA;AACA;AACA;AACA,CAAC;AACwB;AACzB;AACA;AACA;AACA;AACA,6BAA6B,4CAAG;AAChC;AACA;AACA,gBAAgB,4CAAG;AACnB,gBAAgB,4CAAG;AACnB;AACA;AACA;AACA;AACA,CAAC;AAC6B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,4CAAG;AACnB,gBAAgB,4CAAG;AACnB;AACA;AACA;AACA;AACA,CAAC;AACkB;AACnB;AACA;AACA;AACA;AACA,yBAAyB,4CAAG;AAC5B,6BAA6B,4CAAG;AAChC,mCAAmC,4CAAG;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACmB;AACpB;AACA;AACA;AACA;AACA,yBAAyB,4CAAG;AAC5B,wBAAwB,4CAAG;AAC3B,yBAAyB,4CAAG;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACiB;;;;;;;;;;;;;;;;AChIuB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,qDAAW;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,YAAY;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,iEAAe,KAAK,EAAC;;;;;;;;;;;;;;;;AC9CG;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,4CAAG;AAC9B;AACA;AACA,eAAe,4CAAG;AAClB;AACA;AACA,CAAC;AACD,iEAAe,GAAG,EAAC;;;;;;;;;;;;;;;AC7BnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,iEAAe,GAAG,EAAC;;;;;;;;;;;;;;;AC/CnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C;AAC1C;AACA,wBAAwB,YAAY;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,iEAAe,WAAW,EAAC;;;;;;;;;;;;;;;;ACxCC;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,WAAW;AACnC;AACA,4BAA4B,YAAY;AACxC;AACA;AACA;AACA,wBAAwB,OAAO;AAC/B;AACA;AACA;AACA,iCAAiC,8CAAK;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,8CAAK;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,iEAAe,KAAK,EAAC;;;;;;;;;;;;;;;;;AClFrB;AAC4B;AAC8E;AAC1G;AACA;AACA;AACA,yEAAyE;AACzE;AACA;AACA;AACA;AACA,yBAAyB,8CAAK;AAC9B;AACA;AACA;AACA;AACA;AACA,mDAAmD,gBAAgB;AACnE;AACA;AACA;AACA;AACA;AACA,kCAAkC,kDAAkD;AACpF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,yDAAa;AAC1C;AACA;AACA,6BAA6B,8DAAkB;AAC/C;AACA;AACA,6BAA6B,mDAAO;AACpC;AACA;AACA,6BAA6B,oDAAQ;AACrC;AACA;AACA,6BAA6B,kDAAM;AACnC;AACA;AACA,6BAA6B,qDAAS;AACtC;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,iEAAe,SAAS,EAAC;;;;;;;;;;;;;;;;;ACrDzB,gBAAgB,SAAI,IAAI,SAAI;AAC5B;AACA,iDAAiD,OAAO;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,SAAI,IAAI,SAAI;AAC7B,4BAA4B,+DAA+D,iBAAiB;AAC5G;AACA,oCAAoC,MAAM,+BAA+B,YAAY;AACrF,mCAAmC,MAAM,mCAAmC,YAAY;AACxF,gCAAgC;AAChC;AACA,KAAK;AACL;AACA,mBAAmB,SAAI,IAAI,SAAI;AAC/B,cAAc,6BAA6B,0BAA0B,cAAc,qBAAqB;AACxG,6IAA6I,cAAc;AAC3J,uBAAuB,sBAAsB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC;AACxC,mCAAmC,SAAS;AAC5C,mCAAmC,WAAW,UAAU;AACxD,0CAA0C,cAAc;AACxD;AACA,8GAA8G,OAAO;AACrH,iFAAiF,iBAAiB;AAClG,yDAAyD,gBAAgB,QAAQ;AACjF,+CAA+C,gBAAgB,gBAAgB;AAC/E;AACA,kCAAkC;AAClC;AACA;AACA,UAAU,YAAY,aAAa,SAAS,UAAU;AACtD,oCAAoC,SAAS;AAC7C;AACA;AACA,qBAAqB,SAAI,IAAI,SAAI;AACjC,6EAA6E,OAAO;AACpF;AACA;AACA;AACA;AACA;AACA;AACA;AAC4C;AAC5C;AACA;AACA;AACA;AACA;AACA,2CAA2C,mBAAmB,0CAA0C;AACxG;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,0DAAe;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC;AACjC;AACA,uKAAuK,6FAA6F;AACpQ;AACA;AACA;AACA,iCAAiC;AACjC;AACA,oKAAoK,2FAA2F;AAC/P;AACA;AACA,+HAA+H,8EAA8E;AAC7M,6HAA6H,6EAA6E;AAC1M;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC;AACjC;AACA;AACA;AACA,4CAA4C,oCAAoC;AAChF;AACA;AACA,4CAA4C,mCAAmC;AAC/E;AACA;AACA;AACA,8DAA8D,yBAAyB;AACvF;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA,CAAC;AACD,iEAAe,OAAO,EAAC;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA,CAAC;;;;;;;UClKD;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;;WCtBA;WACA;WACA;WACA;WACA;WACA,iCAAiC,WAAW;WAC5C;WACA;;;;;WCPA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA;;;;;WCPA;;;;;WCAA;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D;;;;;;;;;;;;;ACNoC;AACJ;AAChC,8BAA8B;AAC9B;AACA,QAAQ,kDAAS;AACjB;AACA;AACA,sBAAsB,gDAAO;AAC7B,KAAK;AACL,sBAAsB,gDAAO;AAC7B,KAAK;AACL,CAAC","sources":["webpack:///./node_modules/@openmeteo/sdk/aggregation.js","webpack:///./node_modules/@openmeteo/sdk/model.js","webpack:///./node_modules/@openmeteo/sdk/unit.js","webpack:///./node_modules/@openmeteo/sdk/variable-with-values.js","webpack:///./node_modules/@openmeteo/sdk/variable.js","webpack:///./node_modules/@openmeteo/sdk/variables-with-time.js","webpack:///./node_modules/@openmeteo/sdk/weather-api-response.js","webpack:///./node_modules/flatbuffers/mjs/builder.js","webpack:///./node_modules/flatbuffers/mjs/byte-buffer.js","webpack:///./node_modules/flatbuffers/mjs/constants.js","webpack:///./node_modules/flatbuffers/mjs/encoding.js","webpack:///./node_modules/flatbuffers/mjs/flatbuffers.js","webpack:///./node_modules/flatbuffers/mjs/utils.js","webpack:///./node_modules/openmeteo/lib/index.js","webpack:///./src/color-schemes.ts","webpack:///./src/crack.ts","webpack:///./src/hsl.ts","webpack:///./src/rgb.ts","webpack:///./src/sand-painter.ts","webpack:///./src/state.ts","webpack:///./src/substrate.ts","webpack:///./src/weather.ts","webpack:///webpack/bootstrap","webpack:///webpack/runtime/compat get default export","webpack:///webpack/runtime/define property getters","webpack:///webpack/runtime/hasOwnProperty shorthand","webpack:///webpack/runtime/make namespace object","webpack:///./src/launch.ts"],"sourcesContent":["\"use strict\";\n// automatically generated by the FlatBuffers compiler, do not modify\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Aggregation = void 0;\n/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */\nvar Aggregation;\n(function (Aggregation) {\n Aggregation[Aggregation[\"none\"] = 0] = \"none\";\n Aggregation[Aggregation[\"minimum\"] = 1] = \"minimum\";\n Aggregation[Aggregation[\"maximum\"] = 2] = \"maximum\";\n Aggregation[Aggregation[\"mean\"] = 3] = \"mean\";\n Aggregation[Aggregation[\"p10\"] = 4] = \"p10\";\n Aggregation[Aggregation[\"p25\"] = 5] = \"p25\";\n Aggregation[Aggregation[\"median\"] = 6] = \"median\";\n Aggregation[Aggregation[\"p75\"] = 7] = \"p75\";\n Aggregation[Aggregation[\"p90\"] = 8] = \"p90\";\n Aggregation[Aggregation[\"dominant\"] = 9] = \"dominant\";\n Aggregation[Aggregation[\"sum\"] = 10] = \"sum\";\n Aggregation[Aggregation[\"spread\"] = 11] = \"spread\";\n})(Aggregation || (exports.Aggregation = Aggregation = {}));\n","\"use strict\";\n// automatically generated by the FlatBuffers compiler, do not modify\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Model = void 0;\n/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */\nvar Model;\n(function (Model) {\n Model[Model[\"undefined\"] = 0] = \"undefined\";\n Model[Model[\"best_match\"] = 1] = \"best_match\";\n Model[Model[\"gfs_seamless\"] = 2] = \"gfs_seamless\";\n Model[Model[\"gfs_global\"] = 3] = \"gfs_global\";\n Model[Model[\"gfs_hrrr\"] = 4] = \"gfs_hrrr\";\n Model[Model[\"meteofrance_seamless\"] = 5] = \"meteofrance_seamless\";\n Model[Model[\"meteofrance_arpege_seamless\"] = 6] = \"meteofrance_arpege_seamless\";\n Model[Model[\"meteofrance_arpege_world\"] = 7] = \"meteofrance_arpege_world\";\n Model[Model[\"meteofrance_arpege_europe\"] = 8] = \"meteofrance_arpege_europe\";\n Model[Model[\"meteofrance_arome_seamless\"] = 9] = \"meteofrance_arome_seamless\";\n Model[Model[\"meteofrance_arome_france\"] = 10] = \"meteofrance_arome_france\";\n Model[Model[\"meteofrance_arome_france_hd\"] = 11] = \"meteofrance_arome_france_hd\";\n Model[Model[\"jma_seamless\"] = 12] = \"jma_seamless\";\n Model[Model[\"jma_msm\"] = 13] = \"jma_msm\";\n Model[Model[\"jms_gsm\"] = 14] = \"jms_gsm\";\n Model[Model[\"jma_gsm\"] = 15] = \"jma_gsm\";\n Model[Model[\"gem_seamless\"] = 16] = \"gem_seamless\";\n Model[Model[\"gem_global\"] = 17] = \"gem_global\";\n Model[Model[\"gem_regional\"] = 18] = \"gem_regional\";\n Model[Model[\"gem_hrdps_continental\"] = 19] = \"gem_hrdps_continental\";\n Model[Model[\"icon_seamless\"] = 20] = \"icon_seamless\";\n Model[Model[\"icon_global\"] = 21] = \"icon_global\";\n Model[Model[\"icon_eu\"] = 22] = \"icon_eu\";\n Model[Model[\"icon_d2\"] = 23] = \"icon_d2\";\n Model[Model[\"ecmwf_ifs04\"] = 24] = \"ecmwf_ifs04\";\n Model[Model[\"metno_nordic\"] = 25] = \"metno_nordic\";\n Model[Model[\"era5_seamless\"] = 26] = \"era5_seamless\";\n Model[Model[\"era5\"] = 27] = \"era5\";\n Model[Model[\"cerra\"] = 28] = \"cerra\";\n Model[Model[\"era5_land\"] = 29] = \"era5_land\";\n Model[Model[\"ecmwf_ifs\"] = 30] = \"ecmwf_ifs\";\n Model[Model[\"gwam\"] = 31] = \"gwam\";\n Model[Model[\"ewam\"] = 32] = \"ewam\";\n Model[Model[\"glofas_seamless_v3\"] = 33] = \"glofas_seamless_v3\";\n Model[Model[\"glofas_forecast_v3\"] = 34] = \"glofas_forecast_v3\";\n Model[Model[\"glofas_consolidated_v3\"] = 35] = \"glofas_consolidated_v3\";\n Model[Model[\"glofas_seamless_v4\"] = 36] = \"glofas_seamless_v4\";\n Model[Model[\"glofas_forecast_v4\"] = 37] = \"glofas_forecast_v4\";\n Model[Model[\"glofas_consolidated_v4\"] = 38] = \"glofas_consolidated_v4\";\n Model[Model[\"gfs025\"] = 39] = \"gfs025\";\n Model[Model[\"gfs05\"] = 40] = \"gfs05\";\n Model[Model[\"CMCC_CM2_VHR4\"] = 41] = \"CMCC_CM2_VHR4\";\n Model[Model[\"FGOALS_f3_H_highresSST\"] = 42] = \"FGOALS_f3_H_highresSST\";\n Model[Model[\"FGOALS_f3_H\"] = 43] = \"FGOALS_f3_H\";\n Model[Model[\"HiRAM_SIT_HR\"] = 44] = \"HiRAM_SIT_HR\";\n Model[Model[\"MRI_AGCM3_2_S\"] = 45] = \"MRI_AGCM3_2_S\";\n Model[Model[\"EC_Earth3P_HR\"] = 46] = \"EC_Earth3P_HR\";\n Model[Model[\"MPI_ESM1_2_XR\"] = 47] = \"MPI_ESM1_2_XR\";\n Model[Model[\"NICAM16_8S\"] = 48] = \"NICAM16_8S\";\n Model[Model[\"cams_europe\"] = 49] = \"cams_europe\";\n Model[Model[\"cams_global\"] = 50] = \"cams_global\";\n Model[Model[\"cfsv2\"] = 51] = \"cfsv2\";\n Model[Model[\"era5_ocean\"] = 52] = \"era5_ocean\";\n Model[Model[\"cma_grapes_global\"] = 53] = \"cma_grapes_global\";\n Model[Model[\"bom_access_global\"] = 54] = \"bom_access_global\";\n Model[Model[\"bom_access_global_ensemble\"] = 55] = \"bom_access_global_ensemble\";\n Model[Model[\"arpae_cosmo_seamless\"] = 56] = \"arpae_cosmo_seamless\";\n Model[Model[\"arpae_cosmo_2i\"] = 57] = \"arpae_cosmo_2i\";\n Model[Model[\"arpae_cosmo_2i_ruc\"] = 58] = \"arpae_cosmo_2i_ruc\";\n Model[Model[\"arpae_cosmo_5m\"] = 59] = \"arpae_cosmo_5m\";\n Model[Model[\"ecmwf_ifs025\"] = 60] = \"ecmwf_ifs025\";\n Model[Model[\"ecmwf_aifs025\"] = 61] = \"ecmwf_aifs025\";\n Model[Model[\"gfs013\"] = 62] = \"gfs013\";\n Model[Model[\"gfs_graphcast025\"] = 63] = \"gfs_graphcast025\";\n Model[Model[\"ecmwf_wam025\"] = 64] = \"ecmwf_wam025\";\n Model[Model[\"meteofrance_wave\"] = 65] = \"meteofrance_wave\";\n Model[Model[\"meteofrance_currents\"] = 66] = \"meteofrance_currents\";\n Model[Model[\"ecmwf_wam025_ensemble\"] = 67] = \"ecmwf_wam025_ensemble\";\n Model[Model[\"ncep_gfswave025\"] = 68] = \"ncep_gfswave025\";\n Model[Model[\"ncep_gefswave025\"] = 69] = \"ncep_gefswave025\";\n Model[Model[\"knmi_seamless\"] = 70] = \"knmi_seamless\";\n Model[Model[\"knmi_harmonie_arome_europe\"] = 71] = \"knmi_harmonie_arome_europe\";\n Model[Model[\"knmi_harmonie_arome_netherlands\"] = 72] = \"knmi_harmonie_arome_netherlands\";\n Model[Model[\"dmi_seamless\"] = 73] = \"dmi_seamless\";\n Model[Model[\"dmi_harmonie_arome_europe\"] = 74] = \"dmi_harmonie_arome_europe\";\n Model[Model[\"metno_seamless\"] = 75] = \"metno_seamless\";\n Model[Model[\"era5_ensemble\"] = 76] = \"era5_ensemble\";\n Model[Model[\"ecmwf_ifs_analysis\"] = 77] = \"ecmwf_ifs_analysis\";\n Model[Model[\"ecmwf_ifs_long_window\"] = 78] = \"ecmwf_ifs_long_window\";\n Model[Model[\"ecmwf_ifs_analysis_long_window\"] = 79] = \"ecmwf_ifs_analysis_long_window\";\n Model[Model[\"ukmo_global_deterministic_10km\"] = 80] = \"ukmo_global_deterministic_10km\";\n Model[Model[\"ukmo_uk_deterministic_2km\"] = 81] = \"ukmo_uk_deterministic_2km\";\n Model[Model[\"ukmo_seamless\"] = 82] = \"ukmo_seamless\";\n Model[Model[\"ncep_gfswave016\"] = 83] = \"ncep_gfswave016\";\n Model[Model[\"ncep_nbm_conus\"] = 84] = \"ncep_nbm_conus\";\n Model[Model[\"ukmo_global_ensemble_20km\"] = 85] = \"ukmo_global_ensemble_20km\";\n Model[Model[\"ecmwf_aifs025_single\"] = 86] = \"ecmwf_aifs025_single\";\n Model[Model[\"jma_jaxa_himawari\"] = 87] = \"jma_jaxa_himawari\";\n Model[Model[\"eumetsat_sarah3\"] = 88] = \"eumetsat_sarah3\";\n Model[Model[\"eumetsat_lsa_saf_msg\"] = 89] = \"eumetsat_lsa_saf_msg\";\n Model[Model[\"eumetsat_lsa_saf_iodc\"] = 90] = \"eumetsat_lsa_saf_iodc\";\n Model[Model[\"satellite_radiation_seamless\"] = 91] = \"satellite_radiation_seamless\";\n Model[Model[\"kma_gdps\"] = 92] = \"kma_gdps\";\n Model[Model[\"kma_ldps\"] = 93] = \"kma_ldps\";\n Model[Model[\"kma_seamless\"] = 94] = \"kma_seamless\";\n Model[Model[\"italia_meteo_arpae_icon_2i\"] = 95] = \"italia_meteo_arpae_icon_2i\";\n})(Model || (exports.Model = Model = {}));\n","\"use strict\";\n// automatically generated by the FlatBuffers compiler, do not modify\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Unit = void 0;\n/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */\nvar Unit;\n(function (Unit) {\n Unit[Unit[\"undefined\"] = 0] = \"undefined\";\n Unit[Unit[\"celsius\"] = 1] = \"celsius\";\n Unit[Unit[\"centimetre\"] = 2] = \"centimetre\";\n Unit[Unit[\"cubic_metre_per_cubic_metre\"] = 3] = \"cubic_metre_per_cubic_metre\";\n Unit[Unit[\"cubic_metre_per_second\"] = 4] = \"cubic_metre_per_second\";\n Unit[Unit[\"degree_direction\"] = 5] = \"degree_direction\";\n Unit[Unit[\"dimensionless_integer\"] = 6] = \"dimensionless_integer\";\n Unit[Unit[\"dimensionless\"] = 7] = \"dimensionless\";\n Unit[Unit[\"european_air_quality_index\"] = 8] = \"european_air_quality_index\";\n Unit[Unit[\"fahrenheit\"] = 9] = \"fahrenheit\";\n Unit[Unit[\"feet\"] = 10] = \"feet\";\n Unit[Unit[\"fraction\"] = 11] = \"fraction\";\n Unit[Unit[\"gdd_celsius\"] = 12] = \"gdd_celsius\";\n Unit[Unit[\"geopotential_metre\"] = 13] = \"geopotential_metre\";\n Unit[Unit[\"grains_per_cubic_metre\"] = 14] = \"grains_per_cubic_metre\";\n Unit[Unit[\"gram_per_kilogram\"] = 15] = \"gram_per_kilogram\";\n Unit[Unit[\"hectopascal\"] = 16] = \"hectopascal\";\n Unit[Unit[\"hours\"] = 17] = \"hours\";\n Unit[Unit[\"inch\"] = 18] = \"inch\";\n Unit[Unit[\"iso8601\"] = 19] = \"iso8601\";\n Unit[Unit[\"joule_per_kilogram\"] = 20] = \"joule_per_kilogram\";\n Unit[Unit[\"kelvin\"] = 21] = \"kelvin\";\n Unit[Unit[\"kilopascal\"] = 22] = \"kilopascal\";\n Unit[Unit[\"kilogram_per_square_metre\"] = 23] = \"kilogram_per_square_metre\";\n Unit[Unit[\"kilometres_per_hour\"] = 24] = \"kilometres_per_hour\";\n Unit[Unit[\"knots\"] = 25] = \"knots\";\n Unit[Unit[\"megajoule_per_square_metre\"] = 26] = \"megajoule_per_square_metre\";\n Unit[Unit[\"metre_per_second_not_unit_converted\"] = 27] = \"metre_per_second_not_unit_converted\";\n Unit[Unit[\"metre_per_second\"] = 28] = \"metre_per_second\";\n Unit[Unit[\"metre\"] = 29] = \"metre\";\n Unit[Unit[\"micrograms_per_cubic_metre\"] = 30] = \"micrograms_per_cubic_metre\";\n Unit[Unit[\"miles_per_hour\"] = 31] = \"miles_per_hour\";\n Unit[Unit[\"millimetre\"] = 32] = \"millimetre\";\n Unit[Unit[\"pascal\"] = 33] = \"pascal\";\n Unit[Unit[\"per_second\"] = 34] = \"per_second\";\n Unit[Unit[\"percentage\"] = 35] = \"percentage\";\n Unit[Unit[\"seconds\"] = 36] = \"seconds\";\n Unit[Unit[\"unix_time\"] = 37] = \"unix_time\";\n Unit[Unit[\"us_air_quality_index\"] = 38] = \"us_air_quality_index\";\n Unit[Unit[\"watt_per_square_metre\"] = 39] = \"watt_per_square_metre\";\n Unit[Unit[\"wmo_code\"] = 40] = \"wmo_code\";\n Unit[Unit[\"parts_per_million\"] = 41] = \"parts_per_million\";\n})(Unit || (exports.Unit = Unit = {}));\n","\"use strict\";\n// automatically generated by the FlatBuffers compiler, do not modify\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || (function () {\n var ownKeys = function(o) {\n ownKeys = Object.getOwnPropertyNames || function (o) {\n var ar = [];\n for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\n return ar;\n };\n return ownKeys(o);\n };\n return function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\n __setModuleDefault(result, mod);\n return result;\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.VariableWithValues = void 0;\n/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */\nconst flatbuffers = __importStar(require(\"flatbuffers\"));\nconst aggregation_js_1 = require(\"./aggregation.js\");\nconst unit_js_1 = require(\"./unit.js\");\nconst variable_js_1 = require(\"./variable.js\");\nclass VariableWithValues {\n constructor() {\n this.bb = null;\n this.bb_pos = 0;\n }\n __init(i, bb) {\n this.bb_pos = i;\n this.bb = bb;\n return this;\n }\n static getRootAsVariableWithValues(bb, obj) {\n return (obj || new VariableWithValues()).__init(bb.readInt32(bb.position()) + bb.position(), bb);\n }\n static getSizePrefixedRootAsVariableWithValues(bb, obj) {\n bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);\n return (obj || new VariableWithValues()).__init(bb.readInt32(bb.position()) + bb.position(), bb);\n }\n variable() {\n const offset = this.bb.__offset(this.bb_pos, 4);\n return offset ? this.bb.readUint8(this.bb_pos + offset) : variable_js_1.Variable.undefined;\n }\n unit() {\n const offset = this.bb.__offset(this.bb_pos, 6);\n return offset ? this.bb.readUint8(this.bb_pos + offset) : unit_js_1.Unit.undefined;\n }\n value() {\n const offset = this.bb.__offset(this.bb_pos, 8);\n return offset ? this.bb.readFloat32(this.bb_pos + offset) : 0.0;\n }\n values(index) {\n const offset = this.bb.__offset(this.bb_pos, 10);\n return offset ? this.bb.readFloat32(this.bb.__vector(this.bb_pos + offset) + index * 4) : 0;\n }\n valuesLength() {\n const offset = this.bb.__offset(this.bb_pos, 10);\n return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;\n }\n valuesArray() {\n const offset = this.bb.__offset(this.bb_pos, 10);\n return offset ? new Float32Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset), this.bb.__vector_len(this.bb_pos + offset)) : null;\n }\n valuesInt64(index) {\n const offset = this.bb.__offset(this.bb_pos, 12);\n return offset ? this.bb.readInt64(this.bb.__vector(this.bb_pos + offset) + index * 8) : BigInt(0);\n }\n valuesInt64Length() {\n const offset = this.bb.__offset(this.bb_pos, 12);\n return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;\n }\n altitude() {\n const offset = this.bb.__offset(this.bb_pos, 14);\n return offset ? this.bb.readInt16(this.bb_pos + offset) : 0;\n }\n aggregation() {\n const offset = this.bb.__offset(this.bb_pos, 16);\n return offset ? this.bb.readUint8(this.bb_pos + offset) : aggregation_js_1.Aggregation.none;\n }\n pressureLevel() {\n const offset = this.bb.__offset(this.bb_pos, 18);\n return offset ? this.bb.readInt16(this.bb_pos + offset) : 0;\n }\n depth() {\n const offset = this.bb.__offset(this.bb_pos, 20);\n return offset ? this.bb.readInt16(this.bb_pos + offset) : 0;\n }\n depthTo() {\n const offset = this.bb.__offset(this.bb_pos, 22);\n return offset ? this.bb.readInt16(this.bb_pos + offset) : 0;\n }\n ensembleMember() {\n const offset = this.bb.__offset(this.bb_pos, 24);\n return offset ? this.bb.readInt16(this.bb_pos + offset) : 0;\n }\n previousDay() {\n const offset = this.bb.__offset(this.bb_pos, 26);\n return offset ? this.bb.readInt16(this.bb_pos + offset) : 0;\n }\n}\nexports.VariableWithValues = VariableWithValues;\n","\"use strict\";\n// automatically generated by the FlatBuffers compiler, do not modify\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Variable = void 0;\n/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */\nvar Variable;\n(function (Variable) {\n Variable[Variable[\"undefined\"] = 0] = \"undefined\";\n Variable[Variable[\"apparent_temperature\"] = 1] = \"apparent_temperature\";\n Variable[Variable[\"cape\"] = 2] = \"cape\";\n Variable[Variable[\"cloud_cover\"] = 3] = \"cloud_cover\";\n Variable[Variable[\"cloud_cover_high\"] = 4] = \"cloud_cover_high\";\n Variable[Variable[\"cloud_cover_low\"] = 5] = \"cloud_cover_low\";\n Variable[Variable[\"cloud_cover_mid\"] = 6] = \"cloud_cover_mid\";\n Variable[Variable[\"daylight_duration\"] = 7] = \"daylight_duration\";\n Variable[Variable[\"dew_point\"] = 8] = \"dew_point\";\n Variable[Variable[\"diffuse_radiation\"] = 9] = \"diffuse_radiation\";\n Variable[Variable[\"diffuse_radiation_instant\"] = 10] = \"diffuse_radiation_instant\";\n Variable[Variable[\"direct_normal_irradiance\"] = 11] = \"direct_normal_irradiance\";\n Variable[Variable[\"direct_normal_irradiance_instant\"] = 12] = \"direct_normal_irradiance_instant\";\n Variable[Variable[\"direct_radiation\"] = 13] = \"direct_radiation\";\n Variable[Variable[\"direct_radiation_instant\"] = 14] = \"direct_radiation_instant\";\n Variable[Variable[\"et0_fao_evapotranspiration\"] = 15] = \"et0_fao_evapotranspiration\";\n Variable[Variable[\"evapotranspiration\"] = 16] = \"evapotranspiration\";\n Variable[Variable[\"freezing_level_height\"] = 17] = \"freezing_level_height\";\n Variable[Variable[\"growing_degree_days\"] = 18] = \"growing_degree_days\";\n Variable[Variable[\"is_day\"] = 19] = \"is_day\";\n Variable[Variable[\"latent_heat_flux\"] = 20] = \"latent_heat_flux\";\n Variable[Variable[\"leaf_wetness_probability\"] = 21] = \"leaf_wetness_probability\";\n Variable[Variable[\"lifted_index\"] = 22] = \"lifted_index\";\n Variable[Variable[\"lightning_potential\"] = 23] = \"lightning_potential\";\n Variable[Variable[\"precipitation\"] = 24] = \"precipitation\";\n Variable[Variable[\"precipitation_hours\"] = 25] = \"precipitation_hours\";\n Variable[Variable[\"precipitation_probability\"] = 26] = \"precipitation_probability\";\n Variable[Variable[\"pressure_msl\"] = 27] = \"pressure_msl\";\n Variable[Variable[\"rain\"] = 28] = \"rain\";\n Variable[Variable[\"relative_humidity\"] = 29] = \"relative_humidity\";\n Variable[Variable[\"runoff\"] = 30] = \"runoff\";\n Variable[Variable[\"sensible_heat_flux\"] = 31] = \"sensible_heat_flux\";\n Variable[Variable[\"shortwave_radiation\"] = 32] = \"shortwave_radiation\";\n Variable[Variable[\"shortwave_radiation_instant\"] = 33] = \"shortwave_radiation_instant\";\n Variable[Variable[\"showers\"] = 34] = \"showers\";\n Variable[Variable[\"snow_depth\"] = 35] = \"snow_depth\";\n Variable[Variable[\"snow_height\"] = 36] = \"snow_height\";\n Variable[Variable[\"snowfall\"] = 37] = \"snowfall\";\n Variable[Variable[\"snowfall_height\"] = 38] = \"snowfall_height\";\n Variable[Variable[\"snowfall_water_equivalent\"] = 39] = \"snowfall_water_equivalent\";\n Variable[Variable[\"sunrise\"] = 40] = \"sunrise\";\n Variable[Variable[\"sunset\"] = 41] = \"sunset\";\n Variable[Variable[\"soil_moisture\"] = 42] = \"soil_moisture\";\n Variable[Variable[\"soil_moisture_index\"] = 43] = \"soil_moisture_index\";\n Variable[Variable[\"soil_temperature\"] = 44] = \"soil_temperature\";\n Variable[Variable[\"surface_pressure\"] = 45] = \"surface_pressure\";\n Variable[Variable[\"surface_temperature\"] = 46] = \"surface_temperature\";\n Variable[Variable[\"temperature\"] = 47] = \"temperature\";\n Variable[Variable[\"terrestrial_radiation\"] = 48] = \"terrestrial_radiation\";\n Variable[Variable[\"terrestrial_radiation_instant\"] = 49] = \"terrestrial_radiation_instant\";\n Variable[Variable[\"total_column_integrated_water_vapour\"] = 50] = \"total_column_integrated_water_vapour\";\n Variable[Variable[\"updraft\"] = 51] = \"updraft\";\n Variable[Variable[\"uv_index\"] = 52] = \"uv_index\";\n Variable[Variable[\"uv_index_clear_sky\"] = 53] = \"uv_index_clear_sky\";\n Variable[Variable[\"vapour_pressure_deficit\"] = 54] = \"vapour_pressure_deficit\";\n Variable[Variable[\"visibility\"] = 55] = \"visibility\";\n Variable[Variable[\"weather_code\"] = 56] = \"weather_code\";\n Variable[Variable[\"wind_direction\"] = 57] = \"wind_direction\";\n Variable[Variable[\"wind_gusts\"] = 58] = \"wind_gusts\";\n Variable[Variable[\"wind_speed\"] = 59] = \"wind_speed\";\n Variable[Variable[\"vertical_velocity\"] = 60] = \"vertical_velocity\";\n Variable[Variable[\"geopotential_height\"] = 61] = \"geopotential_height\";\n Variable[Variable[\"wet_bulb_temperature\"] = 62] = \"wet_bulb_temperature\";\n Variable[Variable[\"river_discharge\"] = 63] = \"river_discharge\";\n Variable[Variable[\"wave_height\"] = 64] = \"wave_height\";\n Variable[Variable[\"wave_period\"] = 65] = \"wave_period\";\n Variable[Variable[\"wave_direction\"] = 66] = \"wave_direction\";\n Variable[Variable[\"wind_wave_height\"] = 67] = \"wind_wave_height\";\n Variable[Variable[\"wind_wave_period\"] = 68] = \"wind_wave_period\";\n Variable[Variable[\"wind_wave_peak_period\"] = 69] = \"wind_wave_peak_period\";\n Variable[Variable[\"wind_wave_direction\"] = 70] = \"wind_wave_direction\";\n Variable[Variable[\"swell_wave_height\"] = 71] = \"swell_wave_height\";\n Variable[Variable[\"swell_wave_period\"] = 72] = \"swell_wave_period\";\n Variable[Variable[\"swell_wave_peak_period\"] = 73] = \"swell_wave_peak_period\";\n Variable[Variable[\"swell_wave_direction\"] = 74] = \"swell_wave_direction\";\n Variable[Variable[\"pm10\"] = 75] = \"pm10\";\n Variable[Variable[\"pm2p5\"] = 76] = \"pm2p5\";\n Variable[Variable[\"dust\"] = 77] = \"dust\";\n Variable[Variable[\"aerosol_optical_depth\"] = 78] = \"aerosol_optical_depth\";\n Variable[Variable[\"carbon_monoxide\"] = 79] = \"carbon_monoxide\";\n Variable[Variable[\"nitrogen_dioxide\"] = 80] = \"nitrogen_dioxide\";\n Variable[Variable[\"ammonia\"] = 81] = \"ammonia\";\n Variable[Variable[\"ozone\"] = 82] = \"ozone\";\n Variable[Variable[\"sulphur_dioxide\"] = 83] = \"sulphur_dioxide\";\n Variable[Variable[\"alder_pollen\"] = 84] = \"alder_pollen\";\n Variable[Variable[\"birch_pollen\"] = 85] = \"birch_pollen\";\n Variable[Variable[\"grass_pollen\"] = 86] = \"grass_pollen\";\n Variable[Variable[\"mugwort_pollen\"] = 87] = \"mugwort_pollen\";\n Variable[Variable[\"olive_pollen\"] = 88] = \"olive_pollen\";\n Variable[Variable[\"ragweed_pollen\"] = 89] = \"ragweed_pollen\";\n Variable[Variable[\"european_aqi\"] = 90] = \"european_aqi\";\n Variable[Variable[\"european_aqi_pm2p5\"] = 91] = \"european_aqi_pm2p5\";\n Variable[Variable[\"european_aqi_pm10\"] = 92] = \"european_aqi_pm10\";\n Variable[Variable[\"european_aqi_nitrogen_dioxide\"] = 93] = \"european_aqi_nitrogen_dioxide\";\n Variable[Variable[\"european_aqi_ozone\"] = 94] = \"european_aqi_ozone\";\n Variable[Variable[\"european_aqi_sulphur_dioxide\"] = 95] = \"european_aqi_sulphur_dioxide\";\n Variable[Variable[\"us_aqi\"] = 96] = \"us_aqi\";\n Variable[Variable[\"us_aqi_pm2p5\"] = 97] = \"us_aqi_pm2p5\";\n Variable[Variable[\"us_aqi_pm10\"] = 98] = \"us_aqi_pm10\";\n Variable[Variable[\"us_aqi_nitrogen_dioxide\"] = 99] = \"us_aqi_nitrogen_dioxide\";\n Variable[Variable[\"us_aqi_ozone\"] = 100] = \"us_aqi_ozone\";\n Variable[Variable[\"us_aqi_sulphur_dioxide\"] = 101] = \"us_aqi_sulphur_dioxide\";\n Variable[Variable[\"us_aqi_carbon_monoxide\"] = 102] = \"us_aqi_carbon_monoxide\";\n Variable[Variable[\"sunshine_duration\"] = 103] = \"sunshine_duration\";\n Variable[Variable[\"convective_inhibition\"] = 104] = \"convective_inhibition\";\n Variable[Variable[\"shortwave_radiation_clear_sky\"] = 105] = \"shortwave_radiation_clear_sky\";\n Variable[Variable[\"global_tilted_irradiance\"] = 106] = \"global_tilted_irradiance\";\n Variable[Variable[\"global_tilted_irradiance_instant\"] = 107] = \"global_tilted_irradiance_instant\";\n Variable[Variable[\"ocean_current_velocity\"] = 108] = \"ocean_current_velocity\";\n Variable[Variable[\"ocean_current_direction\"] = 109] = \"ocean_current_direction\";\n Variable[Variable[\"cloud_base\"] = 110] = \"cloud_base\";\n Variable[Variable[\"cloud_top\"] = 111] = \"cloud_top\";\n Variable[Variable[\"mass_density\"] = 112] = \"mass_density\";\n Variable[Variable[\"boundary_layer_height\"] = 113] = \"boundary_layer_height\";\n Variable[Variable[\"formaldehyde\"] = 114] = \"formaldehyde\";\n Variable[Variable[\"glyoxal\"] = 115] = \"glyoxal\";\n Variable[Variable[\"non_methane_volatile_organic_compounds\"] = 116] = \"non_methane_volatile_organic_compounds\";\n Variable[Variable[\"pm10_wildfires\"] = 117] = \"pm10_wildfires\";\n Variable[Variable[\"peroxyacyl_nitrates\"] = 118] = \"peroxyacyl_nitrates\";\n Variable[Variable[\"secondary_inorganic_aerosol\"] = 119] = \"secondary_inorganic_aerosol\";\n Variable[Variable[\"residential_elementary_carbon\"] = 120] = \"residential_elementary_carbon\";\n Variable[Variable[\"total_elementary_carbon\"] = 121] = \"total_elementary_carbon\";\n Variable[Variable[\"pm2_5_total_organic_matter\"] = 122] = \"pm2_5_total_organic_matter\";\n Variable[Variable[\"sea_salt_aerosol\"] = 123] = \"sea_salt_aerosol\";\n Variable[Variable[\"nitrogen_monoxide\"] = 124] = \"nitrogen_monoxide\";\n Variable[Variable[\"thunderstorm_probability\"] = 125] = \"thunderstorm_probability\";\n Variable[Variable[\"rain_probability\"] = 126] = \"rain_probability\";\n Variable[Variable[\"freezing_rain_probability\"] = 127] = \"freezing_rain_probability\";\n Variable[Variable[\"ice_pellets_probability\"] = 128] = \"ice_pellets_probability\";\n Variable[Variable[\"snowfall_probability\"] = 129] = \"snowfall_probability\";\n Variable[Variable[\"carbon_dioxide\"] = 130] = \"carbon_dioxide\";\n Variable[Variable[\"methane\"] = 131] = \"methane\";\n Variable[Variable[\"sea_level_height_msl\"] = 132] = \"sea_level_height_msl\";\n Variable[Variable[\"sea_surface_temperature\"] = 133] = \"sea_surface_temperature\";\n Variable[Variable[\"invert_barometer_height\"] = 134] = \"invert_barometer_height\";\n Variable[Variable[\"hail\"] = 135] = \"hail\";\n Variable[Variable[\"albedo\"] = 136] = \"albedo\";\n Variable[Variable[\"precipitation_type\"] = 137] = \"precipitation_type\";\n Variable[Variable[\"convective_cloud_base\"] = 138] = \"convective_cloud_base\";\n Variable[Variable[\"convective_cloud_top\"] = 139] = \"convective_cloud_top\";\n Variable[Variable[\"snow_depth_water_equivalent\"] = 140] = \"snow_depth_water_equivalent\";\n Variable[Variable[\"secondary_swell_wave_height\"] = 141] = \"secondary_swell_wave_height\";\n Variable[Variable[\"secondary_swell_wave_period\"] = 142] = \"secondary_swell_wave_period\";\n Variable[Variable[\"secondary_swell_wave_peak_period\"] = 143] = \"secondary_swell_wave_peak_period\";\n Variable[Variable[\"secondary_swell_wave_direction\"] = 144] = \"secondary_swell_wave_direction\";\n Variable[Variable[\"tertiary_swell_wave_height\"] = 145] = \"tertiary_swell_wave_height\";\n Variable[Variable[\"tertiary_swell_wave_period\"] = 146] = \"tertiary_swell_wave_period\";\n Variable[Variable[\"tertiary_swell_wave_peak_period\"] = 147] = \"tertiary_swell_wave_peak_period\";\n Variable[Variable[\"tertiary_swell_wave_direction\"] = 148] = \"tertiary_swell_wave_direction\";\n})(Variable || (exports.Variable = Variable = {}));\n","\"use strict\";\n// automatically generated by the FlatBuffers compiler, do not modify\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || (function () {\n var ownKeys = function(o) {\n ownKeys = Object.getOwnPropertyNames || function (o) {\n var ar = [];\n for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\n return ar;\n };\n return ownKeys(o);\n };\n return function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\n __setModuleDefault(result, mod);\n return result;\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.VariablesWithTime = void 0;\n/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */\nconst flatbuffers = __importStar(require(\"flatbuffers\"));\nconst variable_with_values_js_1 = require(\"./variable-with-values.js\");\nclass VariablesWithTime {\n constructor() {\n this.bb = null;\n this.bb_pos = 0;\n }\n __init(i, bb) {\n this.bb_pos = i;\n this.bb = bb;\n return this;\n }\n static getRootAsVariablesWithTime(bb, obj) {\n return (obj || new VariablesWithTime()).__init(bb.readInt32(bb.position()) + bb.position(), bb);\n }\n static getSizePrefixedRootAsVariablesWithTime(bb, obj) {\n bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);\n return (obj || new VariablesWithTime()).__init(bb.readInt32(bb.position()) + bb.position(), bb);\n }\n time() {\n const offset = this.bb.__offset(this.bb_pos, 4);\n return offset ? this.bb.readInt64(this.bb_pos + offset) : BigInt('0');\n }\n timeEnd() {\n const offset = this.bb.__offset(this.bb_pos, 6);\n return offset ? this.bb.readInt64(this.bb_pos + offset) : BigInt('0');\n }\n interval() {\n const offset = this.bb.__offset(this.bb_pos, 8);\n return offset ? this.bb.readInt32(this.bb_pos + offset) : 0;\n }\n variables(index, obj) {\n const offset = this.bb.__offset(this.bb_pos, 10);\n return offset ? (obj || new variable_with_values_js_1.VariableWithValues()).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + offset) + index * 4), this.bb) : null;\n }\n variablesLength() {\n const offset = this.bb.__offset(this.bb_pos, 10);\n return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;\n }\n}\nexports.VariablesWithTime = VariablesWithTime;\n","\"use strict\";\n// automatically generated by the FlatBuffers compiler, do not modify\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || (function () {\n var ownKeys = function(o) {\n ownKeys = Object.getOwnPropertyNames || function (o) {\n var ar = [];\n for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\n return ar;\n };\n return ownKeys(o);\n };\n return function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\n __setModuleDefault(result, mod);\n return result;\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.WeatherApiResponse = void 0;\n/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */\nconst flatbuffers = __importStar(require(\"flatbuffers\"));\nconst model_js_1 = require(\"./model.js\");\nconst variables_with_time_js_1 = require(\"./variables-with-time.js\");\nclass WeatherApiResponse {\n constructor() {\n this.bb = null;\n this.bb_pos = 0;\n }\n __init(i, bb) {\n this.bb_pos = i;\n this.bb = bb;\n return this;\n }\n static getRootAsWeatherApiResponse(bb, obj) {\n return (obj || new WeatherApiResponse()).__init(bb.readInt32(bb.position()) + bb.position(), bb);\n }\n static getSizePrefixedRootAsWeatherApiResponse(bb, obj) {\n bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);\n return (obj || new WeatherApiResponse()).__init(bb.readInt32(bb.position()) + bb.position(), bb);\n }\n latitude() {\n const offset = this.bb.__offset(this.bb_pos, 4);\n return offset ? this.bb.readFloat32(this.bb_pos + offset) : 0.0;\n }\n longitude() {\n const offset = this.bb.__offset(this.bb_pos, 6);\n return offset ? this.bb.readFloat32(this.bb_pos + offset) : 0.0;\n }\n elevation() {\n const offset = this.bb.__offset(this.bb_pos, 8);\n return offset ? this.bb.readFloat32(this.bb_pos + offset) : 0.0;\n }\n generationTimeMilliseconds() {\n const offset = this.bb.__offset(this.bb_pos, 10);\n return offset ? this.bb.readFloat32(this.bb_pos + offset) : 0.0;\n }\n locationId() {\n const offset = this.bb.__offset(this.bb_pos, 12);\n return offset ? this.bb.readInt64(this.bb_pos + offset) : BigInt('0');\n }\n model() {\n const offset = this.bb.__offset(this.bb_pos, 14);\n return offset ? this.bb.readUint8(this.bb_pos + offset) : model_js_1.Model.undefined;\n }\n utcOffsetSeconds() {\n const offset = this.bb.__offset(this.bb_pos, 16);\n return offset ? this.bb.readInt32(this.bb_pos + offset) : 0;\n }\n timezone(optionalEncoding) {\n const offset = this.bb.__offset(this.bb_pos, 18);\n return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;\n }\n timezoneAbbreviation(optionalEncoding) {\n const offset = this.bb.__offset(this.bb_pos, 20);\n return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;\n }\n current(obj) {\n const offset = this.bb.__offset(this.bb_pos, 22);\n return offset ? (obj || new variables_with_time_js_1.VariablesWithTime()).__init(this.bb.__indirect(this.bb_pos + offset), this.bb) : null;\n }\n daily(obj) {\n const offset = this.bb.__offset(this.bb_pos, 24);\n return offset ? (obj || new variables_with_time_js_1.VariablesWithTime()).__init(this.bb.__indirect(this.bb_pos + offset), this.bb) : null;\n }\n hourly(obj) {\n const offset = this.bb.__offset(this.bb_pos, 26);\n return offset ? (obj || new variables_with_time_js_1.VariablesWithTime()).__init(this.bb.__indirect(this.bb_pos + offset), this.bb) : null;\n }\n minutely15(obj) {\n const offset = this.bb.__offset(this.bb_pos, 28);\n return offset ? (obj || new variables_with_time_js_1.VariablesWithTime()).__init(this.bb.__indirect(this.bb_pos + offset), this.bb) : null;\n }\n sixHourly(obj) {\n const offset = this.bb.__offset(this.bb_pos, 30);\n return offset ? (obj || new variables_with_time_js_1.VariablesWithTime()).__init(this.bb.__indirect(this.bb_pos + offset), this.bb) : null;\n }\n}\nexports.WeatherApiResponse = WeatherApiResponse;\n","import { ByteBuffer } from \"./byte-buffer.js\";\nimport { SIZEOF_SHORT, SIZE_PREFIX_LENGTH, SIZEOF_INT, FILE_IDENTIFIER_LENGTH } from \"./constants.js\";\nexport class Builder {\n /**\n * Create a FlatBufferBuilder.\n */\n constructor(opt_initial_size) {\n /** Minimum alignment encountered so far. */\n this.minalign = 1;\n /** The vtable for the current table. */\n this.vtable = null;\n /** The amount of fields we're actually using. */\n this.vtable_in_use = 0;\n /** Whether we are currently serializing a table. */\n this.isNested = false;\n /** Starting offset of the current struct/table. */\n this.object_start = 0;\n /** List of offsets of all vtables. */\n this.vtables = [];\n /** For the current vector being built. */\n this.vector_num_elems = 0;\n /** False omits default values from the serialized data */\n this.force_defaults = false;\n this.string_maps = null;\n this.text_encoder = new TextEncoder();\n let initial_size;\n if (!opt_initial_size) {\n initial_size = 1024;\n }\n else {\n initial_size = opt_initial_size;\n }\n /**\n * @type {ByteBuffer}\n * @private\n */\n this.bb = ByteBuffer.allocate(initial_size);\n this.space = initial_size;\n }\n clear() {\n this.bb.clear();\n this.space = this.bb.capacity();\n this.minalign = 1;\n this.vtable = null;\n this.vtable_in_use = 0;\n this.isNested = false;\n this.object_start = 0;\n this.vtables = [];\n this.vector_num_elems = 0;\n this.force_defaults = false;\n this.string_maps = null;\n }\n /**\n * In order to save space, fields that are set to their default value\n * don't get serialized into the buffer. Forcing defaults provides a\n * way to manually disable this optimization.\n *\n * @param forceDefaults true always serializes default values\n */\n forceDefaults(forceDefaults) {\n this.force_defaults = forceDefaults;\n }\n /**\n * Get the ByteBuffer representing the FlatBuffer. Only call this after you've\n * called finish(). The actual data starts at the ByteBuffer's current position,\n * not necessarily at 0.\n */\n dataBuffer() {\n return this.bb;\n }\n /**\n * Get the bytes representing the FlatBuffer. Only call this after you've\n * called finish().\n */\n asUint8Array() {\n return this.bb.bytes().subarray(this.bb.position(), this.bb.position() + this.offset());\n }\n /**\n * Prepare to write an element of `size` after `additional_bytes` have been\n * written, e.g. if you write a string, you need to align such the int length\n * field is aligned to 4 bytes, and the string data follows it directly. If all\n * you need to do is alignment, `additional_bytes` will be 0.\n *\n * @param size This is the of the new element to write\n * @param additional_bytes The padding size\n */\n prep(size, additional_bytes) {\n // Track the biggest thing we've ever aligned to.\n if (size > this.minalign) {\n this.minalign = size;\n }\n // Find the amount of alignment needed such that `size` is properly\n // aligned after `additional_bytes`\n const align_size = ((~(this.bb.capacity() - this.space + additional_bytes)) + 1) & (size - 1);\n // Reallocate the buffer if needed.\n while (this.space < align_size + size + additional_bytes) {\n const old_buf_size = this.bb.capacity();\n this.bb = Builder.growByteBuffer(this.bb);\n this.space += this.bb.capacity() - old_buf_size;\n }\n this.pad(align_size);\n }\n pad(byte_size) {\n for (let i = 0; i < byte_size; i++) {\n this.bb.writeInt8(--this.space, 0);\n }\n }\n writeInt8(value) {\n this.bb.writeInt8(this.space -= 1, value);\n }\n writeInt16(value) {\n this.bb.writeInt16(this.space -= 2, value);\n }\n writeInt32(value) {\n this.bb.writeInt32(this.space -= 4, value);\n }\n writeInt64(value) {\n this.bb.writeInt64(this.space -= 8, value);\n }\n writeFloat32(value) {\n this.bb.writeFloat32(this.space -= 4, value);\n }\n writeFloat64(value) {\n this.bb.writeFloat64(this.space -= 8, value);\n }\n /**\n * Add an `int8` to the buffer, properly aligned, and grows the buffer (if necessary).\n * @param value The `int8` to add the buffer.\n */\n addInt8(value) {\n this.prep(1, 0);\n this.writeInt8(value);\n }\n /**\n * Add an `int16` to the buffer, properly aligned, and grows the buffer (if necessary).\n * @param value The `int16` to add the buffer.\n */\n addInt16(value) {\n this.prep(2, 0);\n this.writeInt16(value);\n }\n /**\n * Add an `int32` to the buffer, properly aligned, and grows the buffer (if necessary).\n * @param value The `int32` to add the buffer.\n */\n addInt32(value) {\n this.prep(4, 0);\n this.writeInt32(value);\n }\n /**\n * Add an `int64` to the buffer, properly aligned, and grows the buffer (if necessary).\n * @param value The `int64` to add the buffer.\n */\n addInt64(value) {\n this.prep(8, 0);\n this.writeInt64(value);\n }\n /**\n * Add a `float32` to the buffer, properly aligned, and grows the buffer (if necessary).\n * @param value The `float32` to add the buffer.\n */\n addFloat32(value) {\n this.prep(4, 0);\n this.writeFloat32(value);\n }\n /**\n * Add a `float64` to the buffer, properly aligned, and grows the buffer (if necessary).\n * @param value The `float64` to add the buffer.\n */\n addFloat64(value) {\n this.prep(8, 0);\n this.writeFloat64(value);\n }\n addFieldInt8(voffset, value, defaultValue) {\n if (this.force_defaults || value != defaultValue) {\n this.addInt8(value);\n this.slot(voffset);\n }\n }\n addFieldInt16(voffset, value, defaultValue) {\n if (this.force_defaults || value != defaultValue) {\n this.addInt16(value);\n this.slot(voffset);\n }\n }\n addFieldInt32(voffset, value, defaultValue) {\n if (this.force_defaults || value != defaultValue) {\n this.addInt32(value);\n this.slot(voffset);\n }\n }\n addFieldInt64(voffset, value, defaultValue) {\n if (this.force_defaults || value !== defaultValue) {\n this.addInt64(value);\n this.slot(voffset);\n }\n }\n addFieldFloat32(voffset, value, defaultValue) {\n if (this.force_defaults || value != defaultValue) {\n this.addFloat32(value);\n this.slot(voffset);\n }\n }\n addFieldFloat64(voffset, value, defaultValue) {\n if (this.force_defaults || value != defaultValue) {\n this.addFloat64(value);\n this.slot(voffset);\n }\n }\n addFieldOffset(voffset, value, defaultValue) {\n if (this.force_defaults || value != defaultValue) {\n this.addOffset(value);\n this.slot(voffset);\n }\n }\n /**\n * Structs are stored inline, so nothing additional is being added. `d` is always 0.\n */\n addFieldStruct(voffset, value, defaultValue) {\n if (value != defaultValue) {\n this.nested(value);\n this.slot(voffset);\n }\n }\n /**\n * Structures are always stored inline, they need to be created right\n * where they're used. You'll get this assertion failure if you\n * created it elsewhere.\n */\n nested(obj) {\n if (obj != this.offset()) {\n throw new TypeError('FlatBuffers: struct must be serialized inline.');\n }\n }\n /**\n * Should not be creating any other object, string or vector\n * while an object is being constructed\n */\n notNested() {\n if (this.isNested) {\n throw new TypeError('FlatBuffers: object serialization must not be nested.');\n }\n }\n /**\n * Set the current vtable at `voffset` to the current location in the buffer.\n */\n slot(voffset) {\n if (this.vtable !== null)\n this.vtable[voffset] = this.offset();\n }\n /**\n * @returns Offset relative to the end of the buffer.\n */\n offset() {\n return this.bb.capacity() - this.space;\n }\n /**\n * Doubles the size of the backing ByteBuffer and copies the old data towards\n * the end of the new buffer (since we build the buffer backwards).\n *\n * @param bb The current buffer with the existing data\n * @returns A new byte buffer with the old data copied\n * to it. The data is located at the end of the buffer.\n *\n * uint8Array.set() formally takes {Array|ArrayBufferView}, so to pass\n * it a uint8Array we need to suppress the type check:\n * @suppress {checkTypes}\n */\n static growByteBuffer(bb) {\n const old_buf_size = bb.capacity();\n // Ensure we don't grow beyond what fits in an int.\n if (old_buf_size & 0xC0000000) {\n throw new Error('FlatBuffers: cannot grow buffer beyond 2 gigabytes.');\n }\n const new_buf_size = old_buf_size << 1;\n const nbb = ByteBuffer.allocate(new_buf_size);\n nbb.setPosition(new_buf_size - old_buf_size);\n nbb.bytes().set(bb.bytes(), new_buf_size - old_buf_size);\n return nbb;\n }\n /**\n * Adds on offset, relative to where it will be written.\n *\n * @param offset The offset to add.\n */\n addOffset(offset) {\n this.prep(SIZEOF_INT, 0); // Ensure alignment is already done.\n this.writeInt32(this.offset() - offset + SIZEOF_INT);\n }\n /**\n * Start encoding a new object in the buffer. Users will not usually need to\n * call this directly. The FlatBuffers compiler will generate helper methods\n * that call this method internally.\n */\n startObject(numfields) {\n this.notNested();\n if (this.vtable == null) {\n this.vtable = [];\n }\n this.vtable_in_use = numfields;\n for (let i = 0; i < numfields; i++) {\n this.vtable[i] = 0; // This will push additional elements as needed\n }\n this.isNested = true;\n this.object_start = this.offset();\n }\n /**\n * Finish off writing the object that is under construction.\n *\n * @returns The offset to the object inside `dataBuffer`\n */\n endObject() {\n if (this.vtable == null || !this.isNested) {\n throw new Error('FlatBuffers: endObject called without startObject');\n }\n this.addInt32(0);\n const vtableloc = this.offset();\n // Trim trailing zeroes.\n let i = this.vtable_in_use - 1;\n // eslint-disable-next-line no-empty\n for (; i >= 0 && this.vtable[i] == 0; i--) { }\n const trimmed_size = i + 1;\n // Write out the current vtable.\n for (; i >= 0; i--) {\n // Offset relative to the start of the table.\n this.addInt16(this.vtable[i] != 0 ? vtableloc - this.vtable[i] : 0);\n }\n const standard_fields = 2; // The fields below:\n this.addInt16(vtableloc - this.object_start);\n const len = (trimmed_size + standard_fields) * SIZEOF_SHORT;\n this.addInt16(len);\n // Search for an existing vtable that matches the current one.\n let existing_vtable = 0;\n const vt1 = this.space;\n outer_loop: for (i = 0; i < this.vtables.length; i++) {\n const vt2 = this.bb.capacity() - this.vtables[i];\n if (len == this.bb.readInt16(vt2)) {\n for (let j = SIZEOF_SHORT; j < len; j += SIZEOF_SHORT) {\n if (this.bb.readInt16(vt1 + j) != this.bb.readInt16(vt2 + j)) {\n continue outer_loop;\n }\n }\n existing_vtable = this.vtables[i];\n break;\n }\n }\n if (existing_vtable) {\n // Found a match:\n // Remove the current vtable.\n this.space = this.bb.capacity() - vtableloc;\n // Point table to existing vtable.\n this.bb.writeInt32(this.space, existing_vtable - vtableloc);\n }\n else {\n // No match:\n // Add the location of the current vtable to the list of vtables.\n this.vtables.push(this.offset());\n // Point table to current vtable.\n this.bb.writeInt32(this.bb.capacity() - vtableloc, this.offset() - vtableloc);\n }\n this.isNested = false;\n return vtableloc;\n }\n /**\n * Finalize a buffer, poiting to the given `root_table`.\n */\n finish(root_table, opt_file_identifier, opt_size_prefix) {\n const size_prefix = opt_size_prefix ? SIZE_PREFIX_LENGTH : 0;\n if (opt_file_identifier) {\n const file_identifier = opt_file_identifier;\n this.prep(this.minalign, SIZEOF_INT +\n FILE_IDENTIFIER_LENGTH + size_prefix);\n if (file_identifier.length != FILE_IDENTIFIER_LENGTH) {\n throw new TypeError('FlatBuffers: file identifier must be length ' +\n FILE_IDENTIFIER_LENGTH);\n }\n for (let i = FILE_IDENTIFIER_LENGTH - 1; i >= 0; i--) {\n this.writeInt8(file_identifier.charCodeAt(i));\n }\n }\n this.prep(this.minalign, SIZEOF_INT + size_prefix);\n this.addOffset(root_table);\n if (size_prefix) {\n this.addInt32(this.bb.capacity() - this.space);\n }\n this.bb.setPosition(this.space);\n }\n /**\n * Finalize a size prefixed buffer, pointing to the given `root_table`.\n */\n finishSizePrefixed(root_table, opt_file_identifier) {\n this.finish(root_table, opt_file_identifier, true);\n }\n /**\n * This checks a required field has been set in a given table that has\n * just been constructed.\n */\n requiredField(table, field) {\n const table_start = this.bb.capacity() - table;\n const vtable_start = table_start - this.bb.readInt32(table_start);\n const ok = field < this.bb.readInt16(vtable_start) &&\n this.bb.readInt16(vtable_start + field) != 0;\n // If this fails, the caller will show what field needs to be set.\n if (!ok) {\n throw new TypeError('FlatBuffers: field ' + field + ' must be set');\n }\n }\n /**\n * Start a new array/vector of objects. Users usually will not call\n * this directly. The FlatBuffers compiler will create a start/end\n * method for vector types in generated code.\n *\n * @param elem_size The size of each element in the array\n * @param num_elems The number of elements in the array\n * @param alignment The alignment of the array\n */\n startVector(elem_size, num_elems, alignment) {\n this.notNested();\n this.vector_num_elems = num_elems;\n this.prep(SIZEOF_INT, elem_size * num_elems);\n this.prep(alignment, elem_size * num_elems); // Just in case alignment > int.\n }\n /**\n * Finish off the creation of an array and all its elements. The array must be\n * created with `startVector`.\n *\n * @returns The offset at which the newly created array\n * starts.\n */\n endVector() {\n this.writeInt32(this.vector_num_elems);\n return this.offset();\n }\n /**\n * Encode the string `s` in the buffer using UTF-8. If the string passed has\n * already been seen, we return the offset of the already written string\n *\n * @param s The string to encode\n * @return The offset in the buffer where the encoded string starts\n */\n createSharedString(s) {\n if (!s) {\n return 0;\n }\n if (!this.string_maps) {\n this.string_maps = new Map();\n }\n if (this.string_maps.has(s)) {\n return this.string_maps.get(s);\n }\n const offset = this.createString(s);\n this.string_maps.set(s, offset);\n return offset;\n }\n /**\n * Encode the string `s` in the buffer using UTF-8. If a Uint8Array is passed\n * instead of a string, it is assumed to contain valid UTF-8 encoded data.\n *\n * @param s The string to encode\n * @return The offset in the buffer where the encoded string starts\n */\n createString(s) {\n if (s === null || s === undefined) {\n return 0;\n }\n let utf8;\n if (s instanceof Uint8Array) {\n utf8 = s;\n }\n else {\n utf8 = this.text_encoder.encode(s);\n }\n this.addInt8(0);\n this.startVector(1, utf8.length, 1);\n this.bb.setPosition(this.space -= utf8.length);\n this.bb.bytes().set(utf8, this.space);\n return this.endVector();\n }\n /**\n * Create a byte vector.\n *\n * @param v The bytes to add\n * @returns The offset in the buffer where the byte vector starts\n */\n createByteVector(v) {\n if (v === null || v === undefined) {\n return 0;\n }\n this.startVector(1, v.length, 1);\n this.bb.setPosition(this.space -= v.length);\n this.bb.bytes().set(v, this.space);\n return this.endVector();\n }\n /**\n * A helper function to pack an object\n *\n * @returns offset of obj\n */\n createObjectOffset(obj) {\n if (obj === null) {\n return 0;\n }\n if (typeof obj === 'string') {\n return this.createString(obj);\n }\n else {\n return obj.pack(this);\n }\n }\n /**\n * A helper function to pack a list of object\n *\n * @returns list of offsets of each non null object\n */\n createObjectOffsetList(list) {\n const ret = [];\n for (let i = 0; i < list.length; ++i) {\n const val = list[i];\n if (val !== null) {\n ret.push(this.createObjectOffset(val));\n }\n else {\n throw new TypeError('FlatBuffers: Argument for createObjectOffsetList cannot contain null.');\n }\n }\n return ret;\n }\n createStructOffsetList(list, startFunc) {\n startFunc(this, list.length);\n this.createObjectOffsetList(list.slice().reverse());\n return this.endVector();\n }\n}\n","import { FILE_IDENTIFIER_LENGTH, SIZEOF_INT } from \"./constants.js\";\nimport { int32, isLittleEndian, float32, float64 } from \"./utils.js\";\nimport { Encoding } from \"./encoding.js\";\nexport class ByteBuffer {\n /**\n * Create a new ByteBuffer with a given array of bytes (`Uint8Array`)\n */\n constructor(bytes_) {\n this.bytes_ = bytes_;\n this.position_ = 0;\n this.text_decoder_ = new TextDecoder();\n }\n /**\n * Create and allocate a new ByteBuffer with a given size.\n */\n static allocate(byte_size) {\n return new ByteBuffer(new Uint8Array(byte_size));\n }\n clear() {\n this.position_ = 0;\n }\n /**\n * Get the underlying `Uint8Array`.\n */\n bytes() {\n return this.bytes_;\n }\n /**\n * Get the buffer's position.\n */\n position() {\n return this.position_;\n }\n /**\n * Set the buffer's position.\n */\n setPosition(position) {\n this.position_ = position;\n }\n /**\n * Get the buffer's capacity.\n */\n capacity() {\n return this.bytes_.length;\n }\n readInt8(offset) {\n return this.readUint8(offset) << 24 >> 24;\n }\n readUint8(offset) {\n return this.bytes_[offset];\n }\n readInt16(offset) {\n return this.readUint16(offset) << 16 >> 16;\n }\n readUint16(offset) {\n return this.bytes_[offset] | this.bytes_[offset + 1] << 8;\n }\n readInt32(offset) {\n return this.bytes_[offset] | this.bytes_[offset + 1] << 8 | this.bytes_[offset + 2] << 16 | this.bytes_[offset + 3] << 24;\n }\n readUint32(offset) {\n return this.readInt32(offset) >>> 0;\n }\n readInt64(offset) {\n return BigInt.asIntN(64, BigInt(this.readUint32(offset)) + (BigInt(this.readUint32(offset + 4)) << BigInt(32)));\n }\n readUint64(offset) {\n return BigInt.asUintN(64, BigInt(this.readUint32(offset)) + (BigInt(this.readUint32(offset + 4)) << BigInt(32)));\n }\n readFloat32(offset) {\n int32[0] = this.readInt32(offset);\n return float32[0];\n }\n readFloat64(offset) {\n int32[isLittleEndian ? 0 : 1] = this.readInt32(offset);\n int32[isLittleEndian ? 1 : 0] = this.readInt32(offset + 4);\n return float64[0];\n }\n writeInt8(offset, value) {\n this.bytes_[offset] = value;\n }\n writeUint8(offset, value) {\n this.bytes_[offset] = value;\n }\n writeInt16(offset, value) {\n this.bytes_[offset] = value;\n this.bytes_[offset + 1] = value >> 8;\n }\n writeUint16(offset, value) {\n this.bytes_[offset] = value;\n this.bytes_[offset + 1] = value >> 8;\n }\n writeInt32(offset, value) {\n this.bytes_[offset] = value;\n this.bytes_[offset + 1] = value >> 8;\n this.bytes_[offset + 2] = value >> 16;\n this.bytes_[offset + 3] = value >> 24;\n }\n writeUint32(offset, value) {\n this.bytes_[offset] = value;\n this.bytes_[offset + 1] = value >> 8;\n this.bytes_[offset + 2] = value >> 16;\n this.bytes_[offset + 3] = value >> 24;\n }\n writeInt64(offset, value) {\n this.writeInt32(offset, Number(BigInt.asIntN(32, value)));\n this.writeInt32(offset + 4, Number(BigInt.asIntN(32, value >> BigInt(32))));\n }\n writeUint64(offset, value) {\n this.writeUint32(offset, Number(BigInt.asUintN(32, value)));\n this.writeUint32(offset + 4, Number(BigInt.asUintN(32, value >> BigInt(32))));\n }\n writeFloat32(offset, value) {\n float32[0] = value;\n this.writeInt32(offset, int32[0]);\n }\n writeFloat64(offset, value) {\n float64[0] = value;\n this.writeInt32(offset, int32[isLittleEndian ? 0 : 1]);\n this.writeInt32(offset + 4, int32[isLittleEndian ? 1 : 0]);\n }\n /**\n * Return the file identifier. Behavior is undefined for FlatBuffers whose\n * schema does not include a file_identifier (likely points at padding or the\n * start of a the root vtable).\n */\n getBufferIdentifier() {\n if (this.bytes_.length < this.position_ + SIZEOF_INT +\n FILE_IDENTIFIER_LENGTH) {\n throw new Error('FlatBuffers: ByteBuffer is too short to contain an identifier.');\n }\n let result = \"\";\n for (let i = 0; i < FILE_IDENTIFIER_LENGTH; i++) {\n result += String.fromCharCode(this.readInt8(this.position_ + SIZEOF_INT + i));\n }\n return result;\n }\n /**\n * Look up a field in the vtable, return an offset into the object, or 0 if the\n * field is not present.\n */\n __offset(bb_pos, vtable_offset) {\n const vtable = bb_pos - this.readInt32(bb_pos);\n return vtable_offset < this.readInt16(vtable) ? this.readInt16(vtable + vtable_offset) : 0;\n }\n /**\n * Initialize any Table-derived type to point to the union at the given offset.\n */\n __union(t, offset) {\n t.bb_pos = offset + this.readInt32(offset);\n t.bb = this;\n return t;\n }\n /**\n * Create a JavaScript string from UTF-8 data stored inside the FlatBuffer.\n * This allocates a new string and converts to wide chars upon each access.\n *\n * To avoid the conversion to string, pass Encoding.UTF8_BYTES as the\n * \"optionalEncoding\" argument. This is useful for avoiding conversion when\n * the data will just be packaged back up in another FlatBuffer later on.\n *\n * @param offset\n * @param opt_encoding Defaults to UTF16_STRING\n */\n __string(offset, opt_encoding) {\n offset += this.readInt32(offset);\n const length = this.readInt32(offset);\n offset += SIZEOF_INT;\n const utf8bytes = this.bytes_.subarray(offset, offset + length);\n if (opt_encoding === Encoding.UTF8_BYTES)\n return utf8bytes;\n else\n return this.text_decoder_.decode(utf8bytes);\n }\n /**\n * Handle unions that can contain string as its member, if a Table-derived type then initialize it,\n * if a string then return a new one\n *\n * WARNING: strings are immutable in JS so we can't change the string that the user gave us, this\n * makes the behaviour of __union_with_string different compared to __union\n */\n __union_with_string(o, offset) {\n if (typeof o === 'string') {\n return this.__string(offset);\n }\n return this.__union(o, offset);\n }\n /**\n * Retrieve the relative offset stored at \"offset\"\n */\n __indirect(offset) {\n return offset + this.readInt32(offset);\n }\n /**\n * Get the start of data of a vector whose offset is stored at \"offset\" in this object.\n */\n __vector(offset) {\n return offset + this.readInt32(offset) + SIZEOF_INT; // data starts after the length\n }\n /**\n * Get the length of a vector whose offset is stored at \"offset\" in this object.\n */\n __vector_len(offset) {\n return this.readInt32(offset + this.readInt32(offset));\n }\n __has_identifier(ident) {\n if (ident.length != FILE_IDENTIFIER_LENGTH) {\n throw new Error('FlatBuffers: file identifier must be length ' +\n FILE_IDENTIFIER_LENGTH);\n }\n for (let i = 0; i < FILE_IDENTIFIER_LENGTH; i++) {\n if (ident.charCodeAt(i) != this.readInt8(this.position() + SIZEOF_INT + i)) {\n return false;\n }\n }\n return true;\n }\n /**\n * A helper function for generating list for obj api\n */\n createScalarList(listAccessor, listLength) {\n const ret = [];\n for (let i = 0; i < listLength; ++i) {\n const val = listAccessor(i);\n if (val !== null) {\n ret.push(val);\n }\n }\n return ret;\n }\n /**\n * A helper function for generating list for obj api\n * @param listAccessor function that accepts an index and return data at that index\n * @param listLength listLength\n * @param res result list\n */\n createObjList(listAccessor, listLength) {\n const ret = [];\n for (let i = 0; i < listLength; ++i) {\n const val = listAccessor(i);\n if (val !== null) {\n ret.push(val.unpack());\n }\n }\n return ret;\n }\n}\n","export const SIZEOF_SHORT = 2;\nexport const SIZEOF_INT = 4;\nexport const FILE_IDENTIFIER_LENGTH = 4;\nexport const SIZE_PREFIX_LENGTH = 4;\n","export var Encoding;\n(function (Encoding) {\n Encoding[Encoding[\"UTF8_BYTES\"] = 1] = \"UTF8_BYTES\";\n Encoding[Encoding[\"UTF16_STRING\"] = 2] = \"UTF16_STRING\";\n})(Encoding || (Encoding = {}));\n","export { SIZEOF_SHORT } from './constants.js';\nexport { SIZEOF_INT } from './constants.js';\nexport { FILE_IDENTIFIER_LENGTH } from './constants.js';\nexport { SIZE_PREFIX_LENGTH } from './constants.js';\nexport { int32, float32, float64, isLittleEndian } from './utils.js';\nexport { Encoding } from './encoding.js';\nexport { Builder } from './builder.js';\nexport { ByteBuffer } from './byte-buffer.js';\n","export const int32 = new Int32Array(2);\nexport const float32 = new Float32Array(int32.buffer);\nexport const float64 = new Float64Array(int32.buffer);\nexport const isLittleEndian = new Uint16Array(new Uint8Array([1, 0]).buffer)[0] === 1;\n","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.fetchWeatherApi = fetchWeatherApi;\nconst flatbuffers_1 = require(\"flatbuffers\");\nconst weather_api_response_1 = require(\"@openmeteo/sdk/weather-api-response\");\nconst sleep = (ms) => new Promise(r => setTimeout(r, ms));\nfunction fetchRetried(url_1) {\n return __awaiter(this, arguments, void 0, function* (url, retries = 3, backoffFactor = 0.5, backoffMax = 2, fetchOptions = {}) {\n const statusToRetry = [500, 502, 504];\n const statusWithJsonError = [400, 429];\n let currentTry = 0;\n let response = yield fetch(url, fetchOptions);\n while (statusToRetry.includes(response.status)) {\n currentTry++;\n if (currentTry >= retries) {\n throw new Error(response.statusText);\n }\n const sleepMs = Math.min(backoffFactor * Math.pow(2, currentTry), backoffMax) * 1000;\n yield sleep(sleepMs);\n response = yield fetch(url, fetchOptions);\n }\n if (statusWithJsonError.includes(response.status)) {\n const json = yield response.json();\n if ('reason' in json) {\n throw new Error(json.reason);\n }\n throw new Error(response.statusText);\n }\n return response;\n });\n}\n/**\n * Retrieve data from the Open-Meteo weather API\n *\n * @param {string} url Server and endpoint. E.g. \"https://api.open-meteo.com/v1/forecast\"\n * @param {any} params URL parameter as an object\n * @param {number} [retries=3] Number of retries in case of an server error\n * @param {number} [backoffFactor=0.2] Exponential backoff factor to increase wait time after each retry\n * @param {number} [backoffMax=2] Maximum wait time between retries\n * @param {RequestInit} [fetchOptions={}] Additional fetch options such as headers, signal, etc.\n * @returns {Promise}\n */\nfunction fetchWeatherApi(url_1, params_1) {\n return __awaiter(this, arguments, void 0, function* (url, params, retries = 3, backoffFactor = 0.2, backoffMax = 2, fetchOptions = {}) {\n const urlParams = new URLSearchParams(params);\n urlParams.set('format', 'flatbuffers');\n const response = yield fetchRetried(`${url}?${urlParams.toString()}`, retries, backoffFactor, backoffMax, fetchOptions);\n const fb = new flatbuffers_1.ByteBuffer(new Uint8Array(yield response.arrayBuffer()));\n const results = [];\n let pos = 0;\n while (pos < fb.capacity()) {\n fb.setPosition(pos);\n const len = fb.readInt32(fb.position());\n results.push(weather_api_response_1.WeatherApiResponse.getSizePrefixedRootAsWeatherApiResponse(fb));\n pos += len + 4;\n }\n return results;\n });\n}\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport HSL from \"./hsl\";\nvar Scheme = /** @class */ (function () {\n function Scheme(initial) {\n this.primary = HSL.fromHex(initial);\n }\n Scheme.prototype.toString = function () {\n var values = this.colors.map(function (color) { return color.toString(16); }).join(\",\");\n return \"\".concat(this.constructor.name, \": \").concat(values);\n };\n return Scheme;\n}());\nexport { Scheme };\nvar Analogous = /** @class */ (function (_super) {\n __extends(Analogous, _super);\n function Analogous(initial) {\n var _this = _super.call(this, initial) || this;\n var left1 = new HSL(_this.primary.hue - 30, _this.primary.saturation, _this.primary.lightness);\n var left2 = new HSL(_this.primary.hue - 15, _this.primary.saturation, _this.primary.lightness);\n var right1 = new HSL(_this.primary.hue + 15, _this.primary.saturation, _this.primary.lightness);\n var right2 = new HSL(_this.primary.hue + 30, _this.primary.saturation, _this.primary.lightness);\n _this.colors = [\n left1.toHex(),\n left2.toHex(),\n initial,\n right1.toHex(),\n right2.toHex()\n ];\n return _this;\n }\n return Analogous;\n}(Scheme));\nexport { Analogous };\nvar Monochromatic = /** @class */ (function (_super) {\n __extends(Monochromatic, _super);\n function Monochromatic(initial) {\n var _this = _super.call(this, initial) || this;\n var delta = _this.primary.lightness / 6;\n _this.colors = [\n initial,\n new HSL(_this.primary.hue, _this.primary.saturation, _this.primary.lightness - delta).toHex(),\n new HSL(_this.primary.hue, _this.primary.saturation, _this.primary.lightness - delta * 2).toHex(),\n new HSL(_this.primary.hue, _this.primary.saturation, _this.primary.lightness - delta * 3).toHex(),\n new HSL(_this.primary.hue, _this.primary.saturation, _this.primary.lightness - delta * 4).toHex()\n ];\n return _this;\n }\n return Monochromatic;\n}(Scheme));\nexport { Monochromatic };\nvar SplitComplementary = /** @class */ (function (_super) {\n __extends(SplitComplementary, _super);\n function SplitComplementary(initial) {\n var _this = _super.call(this, initial) || this;\n var complement = new HSL((_this.primary.hue + 180) % 360, _this.primary.saturation, _this.primary.lightness);\n _this.colors = [\n initial,\n new HSL(complement.hue - 30, complement.saturation, complement.lightness).toHex(),\n new HSL(complement.hue + 30, complement.saturation, complement.lightness).toHex()\n ];\n return _this;\n }\n return SplitComplementary;\n}(Scheme));\nexport { SplitComplementary };\nvar Triadic = /** @class */ (function (_super) {\n __extends(Triadic, _super);\n function Triadic(initial) {\n var _this = _super.call(this, initial) || this;\n _this.colors = [\n initial,\n new HSL(_this.primary.hue - 120, _this.primary.saturation, _this.primary.lightness).toHex(),\n new HSL(_this.primary.hue + 120, _this.primary.saturation, _this.primary.lightness).toHex()\n ];\n return _this;\n }\n return Triadic;\n}(Scheme));\nexport { Triadic };\nvar Tetradic = /** @class */ (function (_super) {\n __extends(Tetradic, _super);\n function Tetradic(initial) {\n var _this = _super.call(this, initial) || this;\n var second = new HSL(_this.primary.hue + 45, _this.primary.saturation, _this.primary.lightness);\n var complement = new HSL(_this.primary.hue + 180, _this.primary.saturation, _this.primary.lightness);\n var secondComplement = new HSL(second.hue + 180, _this.primary.saturation, _this.primary.lightness);\n _this.colors = [\n initial,\n second.toHex(),\n complement.toHex(),\n secondComplement.toHex()\n ];\n return _this;\n }\n return Tetradic;\n}(Scheme));\nexport { Tetradic };\nvar Square = /** @class */ (function (_super) {\n __extends(Square, _super);\n function Square(initial) {\n var _this = _super.call(this, initial) || this;\n var second = new HSL(_this.primary.hue + 90, _this.primary.saturation, _this.primary.lightness);\n var third = new HSL(_this.primary.hue + 180, _this.primary.saturation, _this.primary.lightness);\n var fourth = new HSL(second.hue + 270, _this.primary.saturation, _this.primary.lightness);\n _this.colors = [\n initial,\n second.toHex(),\n third.toHex(),\n fourth.toHex()\n ];\n return _this;\n }\n return Square;\n}(Scheme));\nexport { Square };\n","import SandPainter from \"./sand-painter\";\nvar Crack = /** @class */ (function () {\n function Crack(state, x, y, angle) {\n this.x = 0;\n this.y = 0;\n this.angle = 0;\n this.state = state;\n this.painter = new SandPainter(this);\n this.start(x, y, angle);\n }\n Crack.prototype.start = function (x, y, angle) {\n this.x = x + .61 * Math.cos(angle * Math.PI / 180);\n this.y = y + .61 * Math.sin(angle * Math.PI / 180);\n var flip = Math.random() > 0.5;\n this.angle = angle + (90 + Math.floor(Math.random() * 4.1 - 2)) * (flip ? -1 : 1);\n };\n Crack.prototype.draw = function () {\n this.x += .42 * Math.cos(this.angle * Math.PI / 180);\n this.y += .42 * Math.sin(this.angle * Math.PI / 180);\n var fuzzX = this.x + (Math.random() * .66 - .33);\n var fuzzY = this.y + (Math.random() * .66 - .33);\n var context = this.state.canvas.getContext(\"2d\");\n context.fillStyle = \"#000\";\n context.fillRect(fuzzX, fuzzY, 1, 1);\n this.painter.render();\n var x = Math.floor(this.x);\n var y = Math.floor(this.y);\n if (this.state.isWithinBoundary(x, y)) {\n var angle = this.state.grid[x][y];\n if (angle > 10000) {\n this.state.grid[x][y] = Math.floor(this.angle);\n this.state.seeds.push({ x: x, y: y });\n }\n else if (this.state.grid[x][y] != Math.floor(this.angle)) {\n var entry = this.state.getNewEntry();\n this.start(entry.x, entry.y, entry.angle);\n }\n }\n else {\n var entry = this.state.getNewEntry();\n this.start(entry.x, entry.y, entry.angle);\n this.state.addCrack();\n }\n };\n return Crack;\n}());\nexport default Crack;\n","import RGB from \"./rgb\";\nvar HSL = /** @class */ (function () {\n function HSL(hue, saturation, lightness) {\n this.hue = (hue + 360) % 360;\n this.saturation = saturation;\n this.lightness = lightness;\n }\n // https://en.wikipedia.org/wiki/HSL_and_HSV\n HSL.fromRgb = function (rgb) {\n var redValue = rgb.red / 255, greenValue = rgb.green / 255, blueValue = rgb.blue / 255, max = Math.max(redValue, greenValue, blueValue), min = Math.min(redValue, greenValue, blueValue), chroma = max - min, lightness = .5 * (max + min), saturation = 1 - (3 / (redValue + greenValue + blueValue)) * Math.min(redValue, greenValue, blueValue);\n var huePrime = 0;\n if (chroma != 0) {\n if (redValue == max)\n huePrime = ((greenValue - blueValue) / chroma) % 6;\n else if (greenValue == max)\n huePrime = ((blueValue - redValue) / chroma) + 2;\n else\n huePrime = ((redValue - greenValue) / chroma) + 4;\n }\n return new HSL(huePrime * 60, saturation, lightness);\n };\n HSL.fromHex = function (color) {\n return HSL.fromRgb(RGB.fromHex(color));\n };\n HSL.prototype.toHex = function () {\n return RGB.fromHsl(this).toHex();\n };\n return HSL;\n}());\nexport default HSL;\n","var RGB = /** @class */ (function () {\n function RGB(red, green, blue) {\n this.red = Math.floor(red < 0 ? 0 : red > 255 ? 255 : red);\n this.green = Math.floor(green < 0 ? 0 : green > 255 ? 255 : green);\n this.blue = Math.floor(blue < 0 ? 0 : blue > 255 ? 255 : blue);\n }\n RGB.prototype.toHex = function () {\n return (this.red << 16) + (this.green << 8) + this.blue;\n };\n // https://en.wikipedia.org/wiki/HSL_and_HSV\n RGB.fromHsl = function (hsl) {\n var red = 0, green = 0, blue = 0;\n var chroma = (1 - Math.abs(2 * hsl.lightness - 1)) * hsl.saturation, range = hsl.hue / 60, intermediate = chroma * (1 - Math.abs(range % 2 - 1)), match = hsl.lightness - chroma / 2;\n if (range >= 0 && range < 1) {\n red = chroma;\n green = intermediate;\n }\n else if (range >= 1 && range < 2) {\n red = intermediate;\n green = chroma;\n }\n else if (range >= 2 && range < 3) {\n green = chroma;\n blue = intermediate;\n }\n else if (range >= 3 && range < 4) {\n green = intermediate;\n blue = chroma;\n }\n else if (range >= 4 && range < 5) {\n red = intermediate;\n blue = chroma;\n }\n else if (range >= 5 && range < 6) {\n red = chroma;\n blue = intermediate;\n }\n return new RGB((red + match) * 255, (green + match) * 255, (blue + match) * 255);\n };\n RGB.fromHex = function (color) {\n var red = color >> 16;\n var green = (color - (red << 16)) >> 8;\n var blue = color - (red << 16) - (green << 8);\n return new RGB(red, green, blue);\n };\n return RGB;\n}());\nexport default RGB;\n","var SandPainter = /** @class */ (function () {\n function SandPainter(crack) {\n this.crack = crack;\n this.color = this.crack.state.getNextColor();\n this.gain = Math.random() / 10;\n }\n SandPainter.prototype.render = function () {\n var state = this.crack.state, x = this.crack.x, y = this.crack.y, angle = this.crack.angle;\n var open = true, endX = x, endY = y;\n while (open) {\n endX += .81 * Math.sin(angle * Math.PI / 180);\n endY -= .81 * Math.cos(angle * Math.PI / 180);\n var gridX = Math.floor(endX);\n var gridY = Math.floor(endY);\n if (state.isWithinBoundary(gridX, gridY)) {\n open = state.grid[gridX][gridY] > 10000;\n }\n else {\n open = false;\n }\n }\n this.gain += (Math.random() / 10 - .05);\n if (this.gain < 0)\n this.gain = 0;\n if (this.gain > 1)\n this.gain = 1;\n var grains = 64;\n var hex = this.color.toString(16);\n var w = this.gain / (grains - 1); // some kind of multiplier\n var context = state.canvas.getContext(\"2d\");\n for (var i = 0; i < grains; i++) {\n var alpha = Math.floor((.1 - i / (grains * 10)) * 255);\n var paintX = x + (endX - x) * Math.sin(Math.sin(i * w));\n var paintY = y + (endY - y) * Math.sin(Math.sin(i * w));\n context.fillStyle = \"#\".concat(hex.padStart(6, \"0\")).concat(alpha.toString(16).padStart(2, \"0\"));\n context.fillRect(paintX, paintY, 1, 1);\n }\n };\n return SandPainter;\n}());\nexport default SandPainter;\n","import Crack from \"./crack\";\nvar State = /** @class */ (function () {\n function State(colors, maxCracks, canvas) {\n this.canvasColors = [\n \"rgb(27 27 27 / 90%)\",\n \"rgb(90 90 90 / 90%)\",\n \"rgb(126 126 126 / 90%)\",\n \"rgb(180 180 180 / 90%)\",\n \"rgb(255 255 255 / 90%)\",\n \"rgb(180 180 180 / 90%)\",\n \"rgb(126 126 126 / 90%)\",\n \"rgb(90 90 90 / 90%)\"\n ];\n this.canvasIndex = 0;\n this.colorIndex = 0;\n this.canvas = canvas;\n this.maxCracks = maxCracks;\n this.grid = [];\n this.colors = colors;\n this.cracks = [];\n this.seeds = [];\n this.init();\n }\n State.prototype.init = function (colors) {\n if (colors)\n this.colors = colors;\n this.cracks.length = 0;\n this.grid.length = 0;\n this.seeds.length = 0;\n this.colorIndex = 0;\n var height = this.canvas.height;\n var width = this.canvas.width;\n var context = this.canvas.getContext(\"2d\");\n context.fillStyle = this.canvasColors[this.canvasIndex++ % this.canvasColors.length];\n context.fillRect(0, 0, width, height);\n for (var x = 0; x < width; x++) {\n this.grid[x] = [];\n for (var y = 0; y < height; y++) {\n this.grid[x][y] = 10001;\n }\n }\n for (var i = 0; i < 3; i++) {\n var x = Math.floor(Math.random() * width);\n var y = Math.floor(Math.random() * height);\n var angle = Math.floor(Math.random() * 360);\n this.cracks.push(new Crack(this, x, y, angle));\n this.grid[x][y] = angle;\n }\n };\n State.prototype.addCrack = function () {\n if (this.cracks.length >= this.maxCracks)\n return;\n var _a = this.getNewEntry(), x = _a.x, y = _a.y, angle = _a.angle;\n this.cracks.push(new Crack(this, x, y, angle));\n };\n State.prototype.getNextColor = function () {\n return this.colors[this.colorIndex++ % this.colors.length];\n };\n State.prototype.isWithinBoundary = function (x, y) {\n return x >= 0 && x < this.canvas.width && y >= 0 && y < this.canvas.height;\n };\n State.prototype.getNewEntry = function () {\n if (!this.seeds.length) {\n var x = Math.floor(Math.random() * this.canvas.width);\n var y = Math.floor(Math.random() * this.canvas.height);\n var angle = this.grid[x][y];\n if (angle > 10000) {\n angle = Math.floor(Math.random() * 360);\n this.grid[x][y] = angle;\n }\n return { x: x, y: y, angle: angle };\n }\n var randomIndex = Math.floor(Math.random() * this.seeds.length);\n var entry = this.seeds.splice(randomIndex, 1)[0];\n return {\n x: entry.x,\n y: entry.y,\n angle: this.grid[entry.x][entry.y]\n };\n };\n return State;\n}());\nexport default State;\n","// TS attempt of http://www.complexification.net/gallery/machines/substrate/index.php by laniaung.me\nimport State from \"./state\";\nimport { Analogous, Monochromatic, SplitComplementary, Square, Tetradic, Triadic } from \"./color-schemes\";\nvar Substrate = /** @class */ (function () {\n function Substrate(maxCracks, colors) {\n if (!(colors === null || colors === void 0 ? void 0 : colors.length))\n colors = [0x3a1e3e, 0x7c2d3b, 0xb94f3c, 0xf4a462, 0xf9c54e]; // https://colormagic.app/palette/671eeb6c42273fc4c1bb1ac7\n var canvas = document.createElement(\"canvas\");\n canvas.width = document.body.clientWidth;\n canvas.height = document.body.clientHeight;\n document.body.appendChild(canvas);\n this.state = new State(colors, maxCracks, canvas);\n this.init();\n }\n Substrate.prototype.init = function () {\n var me = this;\n var draw = function () {\n for (var _i = 0, _a = me.state.cracks; _i < _a.length; _i++) {\n var crack = _a[_i];\n crack.draw();\n }\n requestAnimationFrame(draw);\n };\n setInterval(function () { return me.state.init(me.getRandomColorScheme()); }, 120 * 1000);\n draw();\n };\n Substrate.prototype.getRandomColorScheme = function () {\n var color = Math.floor(Math.random() * Math.pow(256, 3));\n var scheme;\n switch (Math.floor(Math.random() * 6)) {\n case 1:\n scheme = new Monochromatic(color);\n break;\n case 2:\n scheme = new SplitComplementary(color);\n break;\n case 3:\n scheme = new Triadic(color);\n break;\n case 4:\n scheme = new Tetradic(color);\n break;\n case 5:\n scheme = new Square(color);\n break;\n default:\n scheme = new Analogous(color);\n }\n console.info(scheme.toString());\n return scheme.colors;\n };\n return Substrate;\n}());\nexport default Substrate;\n","var __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nvar __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\nimport { fetchWeatherApi } from 'openmeteo';\nvar Weather = /** @class */ (function () {\n function Weather(latitude, longitude) {\n latitude !== null && latitude !== void 0 ? latitude : (latitude = 47.61002138071677);\n longitude !== null && longitude !== void 0 ? longitude : (longitude = -122.17906310779568);\n this.options = new WeatherOptions();\n this.options = __assign(__assign({}, this.options), { latitude: latitude, longitude: longitude });\n this.getWeather().then(function () {\n });\n }\n Weather.prototype.getWeather = function () {\n return __awaiter(this, void 0, void 0, function () {\n var url, responses, _loop_1, _i, responses_1, response;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n url = \"https://api.open-meteo.com/v1/forecast\";\n return [4 /*yield*/, fetchWeatherApi(url, this.options)];\n case 1:\n responses = _a.sent();\n _loop_1 = function (response) {\n // Attributes for timezone and location\n var utcOffsetSeconds = response.utcOffsetSeconds();\n var timezone = response.timezone();\n var timezoneAbbreviation = response.timezoneAbbreviation();\n var latitude = response.latitude();\n var longitude = response.longitude();\n var current = response.current();\n var hourly = response.hourly();\n var daily = response.daily();\n var sunrise = daily.variables(2);\n var sunset = daily.variables(3);\n // Note: The order of weather variables in the URL query and the indices below need to match!\n var weatherData = {\n current: {\n time: new Date((Number(current.time()) + utcOffsetSeconds) * 1000),\n temperature2m: current.variables(0).value(),\n relativeHumidity2m: current.variables(1).value(),\n apparentTemperature: current.variables(2).value(),\n precipitation: current.variables(3).value(),\n windSpeed10m: current.variables(4).value(),\n windGusts10m: current.variables(5).value(),\n windDirection10m: current.variables(6).value(),\n },\n hourly: {\n time: __spreadArray([], Array((Number(hourly.timeEnd()) - Number(hourly.time())) / hourly.interval()), true).map(function (_, i) { return new Date((Number(hourly.time()) + i * hourly.interval() + utcOffsetSeconds) * 1000); }),\n temperature2m: hourly.variables(0).valuesArray(),\n precipitation: hourly.variables(1).valuesArray(),\n precipitationProbability: hourly.variables(2).valuesArray(),\n },\n daily: {\n time: __spreadArray([], Array((Number(daily.timeEnd()) - Number(daily.time())) / daily.interval()), true).map(function (_, i) { return new Date((Number(daily.time()) + i * daily.interval() + utcOffsetSeconds) * 1000); }),\n temperature2mMax: daily.variables(0).valuesArray(),\n temperature2mMin: daily.variables(1).valuesArray(),\n sunrise: __spreadArray([], Array(sunrise.valuesInt64Length()), true).map(function (_, i) { return new Date((Number(sunrise.valuesInt64(i)) + utcOffsetSeconds) * 1000); }),\n sunset: __spreadArray([], Array(sunset.valuesInt64Length()), true).map(function (_, i) { return new Date((Number(sunset.valuesInt64(i)) + utcOffsetSeconds) * 1000); }),\n uvIndexMax: daily.variables(4).valuesArray(),\n precipitationSum: daily.variables(5).valuesArray(),\n precipitationHours: daily.variables(6).valuesArray(),\n windSpeed10mMax: daily.variables(7).valuesArray(),\n windGusts10mMax: daily.variables(8).valuesArray(),\n windDirection10mDominant: daily.variables(9).valuesArray(),\n },\n };\n console.log(weatherData);\n // `weatherData` now contains a simple structure with arrays for datetime and weather data\n for (var i = 0; i < weatherData.hourly.time.length; i++) {\n console.log(weatherData.hourly.time[i].toISOString(), weatherData.hourly.temperature2m[i], weatherData.hourly.precipitation[i], weatherData.hourly.precipitationProbability[i]);\n }\n for (var i = 0; i < weatherData.daily.time.length; i++) {\n console.log(weatherData.daily.time[i].toISOString(), weatherData.daily.temperature2mMax[i], weatherData.daily.temperature2mMin[i], weatherData.daily.sunrise[i].toISOString(), weatherData.daily.sunset[i].toISOString(), weatherData.daily.uvIndexMax[i], weatherData.daily.precipitationSum[i], weatherData.daily.precipitationHours[i], weatherData.daily.windSpeed10mMax[i], weatherData.daily.windGusts10mMax[i], weatherData.daily.windDirection10mDominant[i]);\n }\n };\n for (_i = 0, responses_1 = responses; _i < responses_1.length; _i++) {\n response = responses_1[_i];\n _loop_1(response);\n }\n return [2 /*return*/];\n }\n });\n });\n };\n return Weather;\n}());\nexport default Weather;\nvar WeatherOptions = /** @class */ (function () {\n function WeatherOptions() {\n this.daily = [\"temperature_2m_max\", \"temperature_2m_min\", \"sunrise\", \"sunset\", \"uv_index_max\", \"precipitation_sum\", \"precipitation_hours\", \"wind_speed_10m_max\", \"wind_gusts_10m_max\", \"wind_direction_10m_dominant\"];\n this.hourly = [\"temperature_2m\", \"precipitation\", \"precipitation_probability\"];\n this.current = [\"temperature_2m\", \"relative_humidity_2m\", \"apparent_temperature\", \"precipitation\", \"wind_speed_10m\", \"wind_gusts_10m\", \"wind_direction_10m\"];\n this.timezone = \"America/Los_Angeles\";\n this[\"wind_speed_unit\"] = \"mph\";\n this[\"temperature_unit\"] = \"fahrenheit\";\n this[\"precipitation_unit\"] = \"inch\";\n }\n return WeatherOptions;\n}());\nvar WeatherData = /** @class */ (function () {\n function WeatherData() {\n }\n return WeatherData;\n}());\nvar CurrentWeather = /** @class */ (function () {\n function CurrentWeather() {\n }\n return CurrentWeather;\n}());\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].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\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};","import Substrate from \"./substrate\";\nimport Weather from \"./weather\";\nvar ready = function (func) { return document.readyState !== \"loading\" ? func() : document.addEventListener(\"DOMContentLoaded\", func); };\nready(function () {\n new Substrate(20);\n var weather;\n navigator.geolocation.getCurrentPosition(function (position) {\n weather = new Weather(position.coords.latitude, position.coords.longitude);\n }, function () {\n weather = new Weather();\n });\n});\n"],"names":[],"sourceRoot":""} \ No newline at end of file