diff --git a/src/crack.ts b/src/crack.ts index 8a07422..bc9beb1 100644 --- a/src/crack.ts +++ b/src/crack.ts @@ -2,7 +2,6 @@ import SandPainter from "./sand-painter" import State from "./state" export default class Crack { - private static padding = .66 private x: number = 0 private y: number = 0 private angle: number = 0 @@ -10,29 +9,17 @@ export default class Crack { private state: State constructor(state: State) { - this.painter = new SandPainter(state) + this.painter = new SandPainter(state.getRandomColor()) this.state = state this.init() } init() { - let x = 0, y = 0, found = false, tries = 0 - while (!found && tries++ < 1000) { - x = Math.random() * this.state.width - y = Math.random() * this.state.height - found = this.state.crackGrid[y * this.state.height + x] < 10000 - } - - if (!found) { - console.warn("Unable to start crack due to timeout") - return - } - - const negative = Math.random() < 0.5 - let value = this.state.crackGrid[y * this.state.height + x] - - if (negative) value -= 90 + Math.floor(Math.random() * 4.1 - 2) - else value += 90 + Math.floor(Math.random() * 4.1 - 2) + const index = Math.floor(Math.random() * this.state.seeds.length) + const {x, y} = this.state.seeds.splice(index, 1)[0] + const flip = Math.random() < 0.5 + let angle = this.state.grid[x][y] + this.start(x, y, angle + (90 + Math.floor(Math.random() * 4.1 - 2)) * (flip ? -1 : 1)) } start(x: number, y: number, angle: number) { @@ -41,8 +28,30 @@ export default class Crack { this.angle = angle } - continue() { + draw() { this.x += .42 * Math.cos(this.angle * Math.PI / 180) this.y += .42 * Math.sin(this.angle * Math.PI / 180) + + const context = this.state.canvas.getContext("2d") + context.fillStyle = "#000" + context.fillRect(this.x, this.y, 1, 1) + + const x = Math.floor(this.x) + const y = Math.floor(this.y) + const height = this.state.canvas.height + const width = this.state.canvas.width + if (x >= 0 && x < width && y >= 0 && y < height) { + const seed = this.state.grid[x][y] + if (seed > 10000 || Math.abs(seed - this.angle) < 5) { + this.state.grid[x][y] = Math.floor(this.angle) + this.state.seeds.push({x, y}) + } else if (Math.abs(seed - this.angle) > 2) { + this.init() + this.state.addCrack() + } + } else { + this.init() + this.state.addCrack() + } } } \ No newline at end of file diff --git a/src/launch.ts b/src/launch.ts index b730bfc..88be0f0 100644 --- a/src/launch.ts +++ b/src/launch.ts @@ -1,10 +1,16 @@ import Substrate from "./substrate" import Weather from "./weather" -const background = new Substrate("substrate-canvas", 20) +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 +}) + */ \ No newline at end of file diff --git a/src/sand-painter.ts b/src/sand-painter.ts index 4d814f4..583450a 100644 --- a/src/sand-painter.ts +++ b/src/sand-painter.ts @@ -4,8 +4,12 @@ export default class SandPainter { private color: number private gain: number - constructor(state: State) { - this.color = state.getRandomColor() + constructor(color: number) { + this.color = color this.gain = Math.random() / 10 } + + render() { + + } } \ No newline at end of file diff --git a/src/state.ts b/src/state.ts index ed9e67d..cbf83aa 100644 --- a/src/state.ts +++ b/src/state.ts @@ -1,26 +1,51 @@ -export default class State { - colors: number[] - maxCracks: number - crackGrid: number[] - height: number - width: number +import Crack from "./crack" - constructor(colors: number[], maxCracks: number, height: number, width: number) { +export default class State { + readonly canvas: HTMLCanvasElement + readonly colors: number[] + readonly maxCracks: number + readonly grid: number[][] + seeds: {x: number, y: number}[] + cracks: Crack[] + + constructor(colors: number[], maxCracks: number, canvas: HTMLCanvasElement) { + this.canvas = canvas this.colors = colors this.maxCracks = maxCracks - this.height = height - this.width = width - this.crackGrid = [] + this.grid = [] + this.cracks = [] + + this.init() + } + + init() { + this.seeds = [] + const height = this.canvas.height + const width = this.canvas.width + const context = this.canvas.getContext("2d") + context.fillStyle = "rgb(255 255 255 / 95%)" + context.fillRect(0, 0, width, height) for (let x = 0; x < width; x++) { + if (!this.grid[x]) this.grid[x] = [] + for (let y = 0; y < height; y++) { - this.crackGrid[y * width + x] = 10000 + this.grid[x][y] = 10001 } } for (let i = 0; i < 16; i++) { - this.crackGrid[Math.floor(Math.random() * (height * width))] = Math.ceil(Math.random() * 360) + const x = Math.floor(Math.random() * width) + const y = Math.floor(Math.random() * height) + this.grid[x][y] = Math.floor(Math.random() * 360) + this.seeds.push({x, y}) } + + this.cracks = [new Crack(this), new Crack(this), new Crack(this)] + } + + addCrack() { + if (this.cracks.length < this.maxCracks) this.cracks.push(new Crack(this)) } getRandomColor(): number { diff --git a/src/styles.less b/src/styles.less index b1bd28c..64b9114 100644 --- a/src/styles.less +++ b/src/styles.less @@ -4,11 +4,4 @@ body { margin: 0; overflow: hidden; padding: 0; -} - -body { - canvas { - height: 100%; - width: 100%; - } } \ No newline at end of file diff --git a/src/substrate.ts b/src/substrate.ts index 8ae06df..49bb54e 100644 --- a/src/substrate.ts +++ b/src/substrate.ts @@ -2,27 +2,34 @@ import State from "./state" export default class Substrate { - private readonly canvas: HTMLCanvasElement private readonly state: State - constructor(id: string, maxCracks: number, colors?: number[]) { + constructor(maxCracks: number, colors?: number[]) { if (!colors?.length) colors = [ 0x3a1e3e, 0x7c2d3b, 0xb94f3c, 0xf4a462, 0xf9c54e ] // https://colormagic.app/palette/671eeb6c42273fc4c1bb1ac7 - let canvas = document.getElementById(id) as HTMLCanvasElement - if (!canvas) { - canvas = document.createElement("canvas") - document.body.appendChild(canvas) - } - - this.canvas = canvas - this.state = new State(colors, maxCracks, canvas.clientHeight, canvas.clientWidth) + const canvas = document.createElement("canvas") + canvas.width = document.body.clientWidth + canvas.height = document.body.clientHeight + document.body.appendChild(canvas) + this.state = new State(colors, maxCracks, canvas) this.init() } init() { - const context = this.canvas.getContext("2d") - context.fillStyle = "#fff" - context.fillRect(0, 0, this.canvas.width, this.canvas.height) + const me = this + let request: number + const draw = () => { + for (const crack of me.state.cracks) crack.draw() + request = requestAnimationFrame(draw) + } + + setInterval(() => { + cancelAnimationFrame(request) + me.state.init() + request = requestAnimationFrame(draw) + }, 60 * 1000) + + request = requestAnimationFrame(draw) } } \ No newline at end of file diff --git a/www/index.html b/www/index.html index 0b3ae12..36c31e6 100644 --- a/www/index.html +++ b/www/index.html @@ -6,7 +6,6 @@
- diff --git a/www/main.js b/www/main.js index 90dec4a..ba7a541 100644 --- a/www/main.js +++ b/www/main.js @@ -10,143 +10,13 @@ /******/ "use strict"; /******/ var __webpack_modules__ = ({ -/***/ "./node_modules/@openmeteo/sdk/aggregation.js": -/*!****************************************************!*\ - !*** ./node_modules/@openmeteo/sdk/aggregation.js ***! - \****************************************************/ -/***/ ((__unused_webpack_module, exports) => { - -eval("\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\n\n//# sourceURL=webpack:///./node_modules/@openmeteo/sdk/aggregation.js?"); - -/***/ }), - -/***/ "./node_modules/@openmeteo/sdk/model.js": -/*!**********************************************!*\ - !*** ./node_modules/@openmeteo/sdk/model.js ***! - \**********************************************/ -/***/ ((__unused_webpack_module, exports) => { - -eval("\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\n\n//# sourceURL=webpack:///./node_modules/@openmeteo/sdk/model.js?"); - -/***/ }), - -/***/ "./node_modules/@openmeteo/sdk/unit.js": -/*!*********************************************!*\ - !*** ./node_modules/@openmeteo/sdk/unit.js ***! - \*********************************************/ -/***/ ((__unused_webpack_module, exports) => { - -eval("\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\n\n//# sourceURL=webpack:///./node_modules/@openmeteo/sdk/unit.js?"); - -/***/ }), - -/***/ "./node_modules/@openmeteo/sdk/variable-with-values.js": -/*!*************************************************************!*\ - !*** ./node_modules/@openmeteo/sdk/variable-with-values.js ***! - \*************************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -eval("\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(__webpack_require__(/*! flatbuffers */ \"./node_modules/flatbuffers/mjs/flatbuffers.js\"));\nconst aggregation_js_1 = __webpack_require__(/*! ./aggregation.js */ \"./node_modules/@openmeteo/sdk/aggregation.js\");\nconst unit_js_1 = __webpack_require__(/*! ./unit.js */ \"./node_modules/@openmeteo/sdk/unit.js\");\nconst variable_js_1 = __webpack_require__(/*! ./variable.js */ \"./node_modules/@openmeteo/sdk/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\n\n//# sourceURL=webpack:///./node_modules/@openmeteo/sdk/variable-with-values.js?"); - -/***/ }), - -/***/ "./node_modules/@openmeteo/sdk/variable.js": -/*!*************************************************!*\ - !*** ./node_modules/@openmeteo/sdk/variable.js ***! - \*************************************************/ -/***/ ((__unused_webpack_module, exports) => { - -eval("\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\n\n//# sourceURL=webpack:///./node_modules/@openmeteo/sdk/variable.js?"); - -/***/ }), - -/***/ "./node_modules/@openmeteo/sdk/variables-with-time.js": -/*!************************************************************!*\ - !*** ./node_modules/@openmeteo/sdk/variables-with-time.js ***! - \************************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -eval("\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(__webpack_require__(/*! flatbuffers */ \"./node_modules/flatbuffers/mjs/flatbuffers.js\"));\nconst variable_with_values_js_1 = __webpack_require__(/*! ./variable-with-values.js */ \"./node_modules/@openmeteo/sdk/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\n\n//# sourceURL=webpack:///./node_modules/@openmeteo/sdk/variables-with-time.js?"); - -/***/ }), - -/***/ "./node_modules/@openmeteo/sdk/weather-api-response.js": -/*!*************************************************************!*\ - !*** ./node_modules/@openmeteo/sdk/weather-api-response.js ***! - \*************************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -eval("\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(__webpack_require__(/*! flatbuffers */ \"./node_modules/flatbuffers/mjs/flatbuffers.js\"));\nconst model_js_1 = __webpack_require__(/*! ./model.js */ \"./node_modules/@openmeteo/sdk/model.js\");\nconst variables_with_time_js_1 = __webpack_require__(/*! ./variables-with-time.js */ \"./node_modules/@openmeteo/sdk/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\n\n//# sourceURL=webpack:///./node_modules/@openmeteo/sdk/weather-api-response.js?"); - -/***/ }), - -/***/ "./node_modules/flatbuffers/mjs/builder.js": -/*!*************************************************!*\ - !*** ./node_modules/flatbuffers/mjs/builder.js ***! - \*************************************************/ +/***/ "./src/crack.ts": +/*!**********************!*\ + !*** ./src/crack.ts ***! + \**********************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Builder: () => (/* binding */ Builder)\n/* harmony export */ });\n/* harmony import */ var _byte_buffer_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./byte-buffer.js */ \"./node_modules/flatbuffers/mjs/byte-buffer.js\");\n/* harmony import */ var _constants_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./constants.js */ \"./node_modules/flatbuffers/mjs/constants.js\");\n\n\nclass 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 = _byte_buffer_js__WEBPACK_IMPORTED_MODULE_0__.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