(function(){if(typeof window.spWeather.translators.OpenWeatherMap==="undefined"){window.spWeather.translators.OpenWeatherMap=(function(){function f(j){var k;if(j.weather>=200&&j.weather<=211){k="meteo_4.png"}else{if(j.weather>=212&&j.weather<=232){k="meteo_3.png"}else{if(j.weather>232&&j.weather<300){k="meteo_3.png";console.log("Weather code unknown:",j.weather)}}}return k}function i(j){var k;if(j.weather>=300&&j.weather<=310){k="meteo_9.png"}else{if(j.weather>=311&&j.weather<=321){k="meteo_11.png"}else{if(j.weather>300&&j.weather<400){k="meteo_11.png";console.log("Weather code unknown:",j.weather)}}}return k}function a(j){var k;if([500,501,520].includes(j.weather)){k="meteo_9.png"}else{if([502,503,504,521,522,531].includes(j.weather)){k="meteo_11.png"}else{if(j.weather===511){k="meteo_10.png"}else{if(j.weather>500&&j.weather<600){k="meteo_11.png";console.log("Weather code unknown:",j.weather)}}}}return k}function c(j){var k;if([600,620].includes(j.weather)){k="meteo_14.png"}else{if([601,621].includes(j.weather)){k="meteo_13.png"}else{if([602,622].includes(j.weather)){k="meteo_16.png"}else{if([611,612].includes(j.weather)){k="meteo_5.png"}else{if([615,616].includes(j.weather)){k="meteo_6.png"}else{if(j.weather>600&&j.weather<700){k="meteo_7.png";console.log("Weather code unknown:",j.weather)}}}}}}return k}function b(j){var k;if([701,711,721].includes(j.weather)){k="meteo_21.png"}else{if([741,751,761,762].includes(j.weather)){k="meteo_20.png"}else{if(j.weather===731){k="meteo_0.png"}else{if(j.weather===771){k="meteo_24.png"}else{if(j.weather===781){k="meteo_2.png"}else{if(j.weather>=700&&j.weather<800){k="meteo_21.png";console.log("Weather code unknown:",j.weather)}}}}}}return k}function e(j){var k;if(j.weather===800){k=j.icon.endsWith("d")?"meteo_32.png":"meteo_33.png"}return k}function h(j){var k;if(j.weather===801){k=j.icon.endsWith("d")?"meteo_30.png":"meteo_29.png"}else{if(j.weather===802||j.weather===803){k=j.icon.endsWith("d")?"meteo_28.png":"meteo_27.png"}else{if(j.weather===804){k="meteo_26.png"}else{if(j.weather>800){k="meteo_26.png";console.log("Weather code unknown:",j.weather)}}}}return k}function d(j){console.log("Weather code unknown:",j.weather);return"meteo_3200.png"}function g(k,j){return spWeather.iconBaseUrl+new SelectionPipeline({weather:k,icon:j}).either(f).or(i).or(a).or(c).or(b).or(e).or(h).or(d).get()}return{translate:function(m){var k=new spWeather.CityWeather(m.city.id,m.city.name);k.service="OpenWeatherMap";k.api="days per 3-hourly";for(var l=0;l<m.list.length;l++){console.log("FORCECAST "+l+": ",m.list[l]);var j={date:moment(m.list[l].dt_txt+"Z"),label:m.list[l].weather[0].main,description:m.list[l].weather[0].description,icon:g(m.list[l].weather[0].id,m.list[l].weather[0].icon),temperature:{min:Math.round(m.list[l].main.temp_min),max:Math.round(m.list[l].main.temp_max),unit:"Celcius"},pressure:m.list[l].main.pressure,humidity:m.list[l].main.humidity};k.forecasts.push(j)}return k}}})()}})();