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C,MAAO,EAA2B,cAEtC,UAAW,EAA2B,aACtC,KAAM,CACF,UAAW,EAA2B,iBACtC,MAAO,EAA2B,SAEtC,YAAa,EAA2B,sBACxC,KAAM,EAA2B,UAAW,MAAO,KAG3D,cAnNJ,eAA6B,EAAI,GAC7B,MAAM,EAAI,SAAS,eAAe,GAGlC,GAFA,EAAO,IAAQ,EAEL,OAAN,EAEA,YADA,QAAQ,MAAM,6EAA6E,MAI/F,MAAM,QAAY,EAAY,qDAAqD,EAAI,WAAW,EAAI,OAAO,GAE7G,IAAI,EAAgC,GAAhB,KAAK,SAEzB,MAAM,EAAa,EAAI,MAAM,MAAM,KAAK,IACpC,MAAM,EAAU,EAAK,MAAM,yBAE3B,GAAgB,OAAZ,EACA,OAAO,KAGX,MAAM,EAAQ,SAAS,EAAQ,GAAI,IAC7B,EAAO,EAAQ,GAErB,GAAiB,IAAM,GAAM,KAAK,UAClC,EAAgB,KAAK,IAAI,EAAG,GAM5B,MAAO,CAAC,OAAM,UAJI,EACZ,EACA,KAAK,IAAI,IAAM,EAAQ,KAAO,IAAK,QAAQ,GAEzB,IACzB,QAAO,GAAW,OAAN,IAET,EAAS,SAAS,cAAc,UACtC,EAAO,MAAM,MAAQ,OAErB,EAAE,YAAY,GAEd,MAAM,EAAS,CACX,KAAM,MACN,KAAM,CACF,OAAQ,EAAW,KAAK,GAAM,EAAE,OAChC,SAAU,CACN,CACI,MAAO,oBACP,KAAM,EAAW,KAAK,GAAM,EAAE,YAC9B,gBAAiB,aAI7B,QAAS,CACL,YAAY,EACZ,OAAQ,CACJ,EAAG,CACC,aAAa,EACb,aAAc,MAM9B,IAAI,MAAM,EAAQ,EACtB,EAuJH,CAtcD","file":"/npm/@uitgeverij-instruct/buienradar@1.3.0/src/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/@uitgeverij-instruct/buienradar@1.3.0/src/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","(function () {\n    const BUIENRADAR_API = 'https://data.buienradar.nl/2.0/feed/json';\n    const CITIES_API = 'https://files.instruct.nl/fundament/buienradar/cities.js';\n\n    const CACHE_MS = 300_000;\n\n    const LS_CACHE = 'nl.instruct.buienradar';\n\n    const ERROR_IMG = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAAAUUlEQVQoz2P4DwQMDP+JAWBlDCAKggiqBiMGZA5B1WAbMITwqEbSgEsPhiBeaWxGMOB0AA5H4nU0Ni9RroE0J5HmadKClbSIIy1pkJn4iE7eALWZVcf6S1ptAAAAAElFTkSuQmCC';\n\n    const POS_INSTRUCT = {lat: 52.071, lon: 4.763};\n\n    let data = null;\n    // noinspection JSMismatchedCollectionQueryUpdate\n    let cities = [];\n    let pos = POS_INSTRUCT;\n\n    async function cachedFetch(url, json = true) {\n        const now = +new Date();\n\n        let cache = {};\n\n        try {\n            cache = JSON.parse(localStorage.getItem(LS_CACHE)) || {};\n        } catch (e) {\n        }\n\n        for (let key in cache) {\n            if (now - cache[key].ts > CACHE_MS) {\n                delete cache[key];\n            }\n        }\n\n        if (typeof cache[url] === 'undefined') {\n            cache[url] = {\n                data: null,\n                ts: 0\n            };\n        }\n\n        if (now - cache[url].ts > CACHE_MS || cache[url].data === null) {\n            const res = await fetch(url, {credentials: 'omit'});\n            cache[url].data = json ? (await res.json()) : (await res.text());\n            cache[url].ts = now;\n        }\n\n        localStorage.setItem(LS_CACHE, JSON.stringify(cache));\n        return cache[url].data;\n    }\n\n    async function delay(ms) {\n        return new Promise((resolve) => {\n            setTimeout(resolve, ms);\n        });\n    }\n\n    async function load(callback) {\n        const script = document.createElement('script');\n        script.src = CITIES_API;\n        document.body.appendChild(script);\n\n        data = await cachedFetch(BUIENRADAR_API);\n\n        pos = await getLocation();\n\n        for (let i = 0; i < 20; i++) {\n            if (cities.length) {\n                break;\n            }\n            await delay(50);\n        }\n\n        callback.bind(window)();\n    }\n\n    async function getLocation() {\n        if (!navigator.geolocation) {\n            // Instruct B.V. :-)\n            return POS_INSTRUCT;\n        }\n\n        try {\n            const pos = await new Promise((resolve, reject) => {\n                navigator.geolocation.getCurrentPosition(resolve, reject);\n            });\n            return {lat: pos.coords.latitude, lon: pos.coords.longitude};\n        } catch (e) {\n            return POS_INSTRUCT;\n        }\n    }\n\n    function deg2rad(deg) {\n        return deg * (Math.PI / 180);\n    }\n\n    function getDistance(pos1, pos2) {\n        const R = 6371;\n\n        const dLat = deg2rad(pos2.lat - pos1.lat);\n        const dLon = deg2rad(pos2.lon - pos1.lon);\n\n        const a = Math.sin(dLat / 2) * Math.sin(dLat / 2) + Math.cos(deg2rad(pos1.lat)) * Math.cos(deg2rad(pos2.lat)) * Math.sin(dLon / 2) * Math.sin(dLon / 2);\n        const c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));\n        return R * c;\n    }\n\n    function getNearestWeatherStation(search) {\n        return data.actual.stationmeasurements.reduce(({nearest, distance}, station) => {\n            const stationPos = {lat: station.lat, lon: station.lon};\n            const stationDistance = getDistance(pos, stationPos);\n            if (stationDistance < distance && (typeof station[search] !== 'undefined')) {\n                return {nearest: station, distance: stationDistance};\n            } else {\n                return {nearest, distance};\n            }\n        }, {nearest: null, distance: Infinity}).nearest ?? null;\n    }\n\n    function renderer(resolver, attribute = 'textContent', errorValue = '-') {\n        return (id) => {\n            let value;\n            try {\n                value = resolver();\n            } catch (e) {\n                value = errorValue;\n            }\n\n            if (typeof id !== 'undefined' && id !== null) {\n                const element = document.getElementById(id);\n\n                if (element === null) {\n                    console.warn(`Je probeerde informatie weer te geven op een niet-bestaand element met ID ${id}!`);\n                } else {\n                    element[attribute] = value;\n                }\n            }\n\n            return value;\n        };\n    }\n\n    function rendererForNearestStation(property, attribute = 'textContent', errorValue = '-') {\n        return renderer(() => {\n            const station = getNearestWeatherStation(property);\n\n            if (!station) {\n                throw new Error('Dichtbij station niet gevonden!');\n            }\n\n            if (typeof station[property] !== 'undefined') {\n                return station[property];\n            }\n\n            throw new Error(`Geen station gevonden met eigenschap ${property}`);\n        }, attribute, errorValue);\n    }\n\n    function rendererForStation(property, attribute = 'textContent', errorValue = '-') {\n        return (stationId, id) => {\n            return renderer(() => {\n                const station = data.actual.stationmeasurements.find((s) => s.stationid === stationId);\n\n                if (!station) {\n                    throw new Error(`Station met ID ${stationId} bestaat niet`);\n                }\n\n                if (typeof station[property] !== 'undefined') {\n                    return station[property];\n                }\n\n                throw new Error(`Station ${stationId} heeft geen eigenschap ${property}`);\n            }, attribute, errorValue)(id);\n        };\n    }\n\n    function rendererForNestedProperty(nestedProperty, attribute = 'textContent', errorValue = '-') {\n        return renderer(nestedPropertyResolver(nestedProperty), attribute, errorValue);\n    }\n\n    function nestedPropertyResolver(nestedProperty) {\n        return () => {\n            const parts = nestedProperty.split('.');\n            let cursor = data;\n\n            for (let part of parts) {\n                if (cursor[part]) {\n                    cursor = cursor[part];\n                } else {\n                    throw new Error(`Eigenschap ${part} niet gevonden in cursor (query: ${nestedProperty})`);\n                }\n            }\n\n            return cursor;\n        };\n    }\n\n    function rendererForFiveDayForecast(property, attribute = 'textContent', errorValue = '-') {\n        return (id, day) => {\n            if (typeof day === 'undefined') {\n                day = id;\n                id = null;\n            }\n            return renderer(() => fiveDayForecastResolver(property)(day), attribute, errorValue)(id);\n        };\n    }\n\n    function fiveDayForecastResolver(property) {\n        return (day) => {\n            if (day < 1 || day > 5) {\n                throw new Error(`Dag ${day} is niet geldig`);\n            }\n\n            if (data.forecast.fivedayforecast.length !== 5) {\n                throw new Error('Onverwacht aantal voorspellingen in de vijfdaagse voorspelling');\n            }\n\n            const forecast = data.forecast.fivedayforecast[day - 1];\n\n            if (forecast && typeof forecast[property] !== 'undefined') {\n                return forecast[property];\n            }\n\n            throw new Error(`Eigenschap ${property} niet gevonden in voorspelling #${day}`);\n        };\n    }\n\n    function rendererForDate(resolver) {\n        return (id, date) => {\n            if (typeof date === 'undefined') {\n                date = id;\n                id = null;\n            }\n\n            if (Object.prototype.toString.call(date) !== '[object Date]') {\n                date = new Date(date);\n            }\n\n            return renderer(() => resolver(date))(id);\n        };\n    }\n\n    async function showRainChart(id, demo) {\n        const e = document.getElementById(id);\n        demo = demo || false;\n\n        if (e === null) {\n            console.error(`Je probeerde informatie weer te geven op een niet-bestaand element met ID ${id}!`);\n            return;\n        }\n\n        const res = await cachedFetch(`https://gpsgadget.buienradar.nl/data/raintext?lat=${pos.lat}&lon=${pos.lon}`, false);\n\n        let demoDatapoint = Math.random() * .5;\n\n        const dataPoints = res.split(\"\\n\").map((line) => {\n            const matches = line.match(/^(\\d{3})\\|(\\d\\d:\\d\\d)/);\n\n            if (matches === null) {\n                return null;\n            }\n\n            const value = parseInt(matches[1], 10);\n            const time = matches[2];\n\n            demoDatapoint += .5 * (0.5 - Math.random());\n            demoDatapoint = Math.max(0, demoDatapoint);\n\n            const mmPerHour = demo\n                ? demoDatapoint\n                : Math.pow(10, ((value - 109) / 32)).toFixed(1);\n\n            return {time, mmPerHour};\n        }).filter(v => v !== null);\n\n        const canvas = document.createElement('canvas');\n        canvas.style.width = '100%';\n\n        e.appendChild(canvas);\n\n        const config = {\n            type: 'bar',\n            data: {\n                labels: dataPoints.map((p) => p.time),\n                datasets: [\n                    {\n                        label: 'Neerslag (mm/uur)',\n                        data: dataPoints.map((p) => p.mmPerHour),\n                        backgroundColor: '#0064ff'\n                    }\n                ]\n            },\n            options: {\n                responsive: true,\n                scales: {\n                    y: {\n                        beginAtZero: true,\n                        suggestedMax: 1\n                    }\n                }\n            }\n        };\n\n        new Chart(canvas, config);\n    }\n\n    // noinspection JSUnusedGlobalSymbols\n    window.buienradar = {\n        __loadCityDatabase: function (data) {\n            cities = data;\n        },\n        load,\n        date: {\n            name: rendererForDate((date) => {\n                return ['zondag', 'maandag', 'dinsdag', 'woensdag', 'donderdag', 'vrijdag', 'zaterdag'][date.getDay()];\n            }),\n            date: rendererForDate((date) => {\n                const year = date.getFullYear();\n                const month = date.getMonth() + 1;\n                const day = date.getDate();\n\n                return `${year}-${month < 10 ? '0' : ''}${month}-${day < 10 ? '0' : ''}${day}`;\n            }),\n            dayMonth: rendererForDate((date) => {\n                const month = date.getMonth() + 1;\n                const day = date.getDate();\n\n                return `${day < 10 ? '0' : ''}${day}-${month < 10 ? '0' : ''}${month}`;\n            }),\n            time: rendererForDate((date) => {\n                const hour = date.getHours();\n                const minute = date.getMinutes();\n\n                return `${hour < 10 ? '0' : ''}${hour}:${minute < 10 ? '0' : ''}${minute}`;\n            })\n        },\n        buienradar: {\n            copyright: rendererForNestedProperty('buienradar.copyright'),\n            terms: rendererForNestedProperty('buienradar.terms'),\n        },\n        sunrise: nestedPropertyResolver('actual.sunrise'),\n        sunset: nestedPropertyResolver('actual.sunset'),\n        map: rendererForNestedProperty('actual.actualradarurl', 'src', ERROR_IMG),\n        currentLocation: {\n            cityName: renderer(() => {\n                return cities.reduce(({nearest, distance}, city) => {\n                    const [lat, lon, name] = city;\n                    const cityDistance = getDistance(pos, {lat, lon});\n\n                    if (cityDistance < distance) {\n                        return {nearest: name, distance: cityDistance};\n                    } else {\n                        return {nearest, distance};\n                    }\n                }, {nearest: null, distance: Infinity}).nearest ?? null;\n            }),\n            station: {\n                name: rendererForNearestStation('stationname'),\n                regio: rendererForNearestStation('regio'),\n            },\n            icon: rendererForNearestStation('iconurl', 'src', ERROR_IMG),\n            description: rendererForNearestStation('weatherdescription'),\n            temperature: {\n                actual: rendererForNearestStation('temperature'),\n                ground: rendererForNearestStation('groundtemperature'),\n                feel: rendererForNearestStation('feeltemperature'),\n            },\n            wind: {\n                direction: rendererForNearestStation('winddirection'),\n                directionDegrees: rendererForNearestStation('winddirectiondegrees'),\n                gusts: rendererForNearestStation('windgusts'),\n                speed: rendererForNearestStation('windspeed'),\n                speedBft: rendererForNearestStation('windspeedBft'),\n            },\n            airPressure: rendererForNearestStation('airpressure'),\n            visibility: rendererForNearestStation('visibility'),\n            humidity: rendererForNearestStation('humidity'),\n            sunPower: rendererForNearestStation('sunpower'),\n            rain: {\n                now: rendererForNearestStation('precipitation'),\n                last24Hours: rendererForNearestStation('rainFallLast24Hour'),\n                lastHour: rendererForNearestStation('rainFallLastHour'),\n            },\n\n        },\n        weatherStation: {\n            station: {\n                name: rendererForStation('stationname'),\n                regio: rendererForStation('regio'),\n            },\n            icon: rendererForStation('iconurl', 'src', ERROR_IMG),\n            description: rendererForStation('weatherdescription'),\n            temperature: {\n                actual: rendererForStation('temperature'),\n                ground: rendererForStation('groundtemperature'),\n                feel: rendererForStation('feeltemperature'),\n            },\n            wind: {\n                direction: rendererForStation('windidrection'),\n                directionDegrees: rendererForStation('winddirectiondegrees'),\n                gusts: rendererForStation('windgusts'),\n                speed: rendererForStation('windspeed'),\n                speedBft: rendererForStation('windspeedBft'),\n            },\n            airPressure: rendererForStation('airpressure'),\n            visibiliy: rendererForStation('visibility'),\n            humidity: rendererForStation('humidity'),\n            sunPower: rendererForStation('sunpower'),\n            rain: {\n                now: rendererForStation('precipitation'),\n                last24Hours: rendererForStation('rainFallLast24Hour'),\n                lastHour: rendererForStation('rainFallLastHour'),\n            },\n        },\n        forecast: {\n            report: {\n                published: nestedPropertyResolver('forecast.weatherreport.published'),\n                title: rendererForNestedProperty('forecast.weatherreport.title'),\n                summary: rendererForNestedProperty('forecast.weatherreport.summary'),\n                text: rendererForNestedProperty('forecast.weatherreport.text', 'innerHTML'),\n                author: rendererForNestedProperty('forecast.weatherreport.author'),\n                authorBio: rendererForNestedProperty('forecast.weatherreport.authorbio'),\n            },\n            shortTerm: {\n                start: nestedPropertyResolver('forecast.shortterm.startdate'),\n                end: nestedPropertyResolver('forecast.shortterm.enddate'),\n                forecast: rendererForNestedProperty('forecast.shortterm.forecast')\n            },\n            longTerm: {\n                start: nestedPropertyResolver('forecast.longterm.startdate'),\n                end: nestedPropertyResolver('forecast.longterm.enddate'),\n                forecast: rendererForNestedProperty('forecast.longterm.forecast')\n            },\n            fiveDays: {\n                date: fiveDayForecastResolver('day'),\n                temperature: {\n                    min: rendererForFiveDayForecast('mintemperatureMin'),\n                    max: rendererForFiveDayForecast('maxtemperatureMax'),\n                },\n                rain: {\n                    chance: rendererForFiveDayForecast('rainChance'),\n                    mmMin: rendererForFiveDayForecast('mmRainMin'),\n                    mmMax: rendererForFiveDayForecast('mmRainMax'),\n                },\n                sunChance: rendererForFiveDayForecast('sunChance'),\n                wind: {\n                    direction: rendererForFiveDayForecast('windDirection'),\n                    speed: rendererForFiveDayForecast('wind'),\n                },\n                description: rendererForFiveDayForecast('weatherdescription'),\n                icon: rendererForFiveDayForecast('iconurl', 'src', ERROR_IMG),\n            }\n        },\n        showRainChart\n    };\n})();"]}