(window.webpackJsonp=window.webpackJsonp||[]).push([[21],{71:function(e,t,n){"use strict";n.r(t);var o=n(0);function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,(a=o.key,r=void 0,r=function(e,t){if("object"!==i(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!==i(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(a,"string"),"symbol"===i(r)?r:String(r)),o)}var a,r}var r=function(){function e(){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),!o.a.isPhoneDevice()){this.init=this.init.bind(this);var t=this,n="".concat(o.a.getStaticPath(),"/js/vendor/momentTimezone-").concat("ff2e8611614e102b56518502a13ad722352981c4",".min.js");$.ajax({url:n,dataType:"script",cache:!1}).fail((function(e,t,n){o.a.l("fail")})).always((function(e,n,o){t.init()}))}}var t,n,i;return t=e,(n=[{key:"init",value:function(e){e=void 0!==e?e:o.a.$("body");var t=$(e).find(".o-weather-wrapper");$(t).length>0&&(this.initWeather(t,"o-weather-wrapper_loading"),this.initTime(t,"o-weather-wrapper_loading"))}},{key:"initTime",value:function(e,t){var n=window.coordinates.timezone,i=o.a.getMomentLocale(window.coordinates.lang);moment.locale(i),setInterval((function(){if(!o.a.isPhoneDevice()&&"function"==typeof o.a.getMoment().tz){var i=o.a.getMoment().tz(n);if(i){var a=i.format("h:mm a"),r=i.format("ddd DD / MM / YYYY");$(e).find(".a-weather-day__result").html(r),$(e).find(".o-weather-day").removeClass(t),$(e).find(".a-weather-hour__result").html(a),$(e).find(".o-weather-hour").removeClass(t),$(e).removeClass(t)}}}),1e3)}},{key:"initWeather",value:function(e,t){var n={appid:"ba938cb60f73ab2784e1e6935b055e29",lat:window.coordinates.latitude,lon:window.coordinates.longitude,cnt:1,lang:o.a.getMomentLocale(window.coordinates.lang),units:"metric"};$.ajax({url:window.location.protocol+"//"+window.location.host+"/forecast",method:"GET",data:n}).done((function(n){var o=n.list[0],i="--";$(e).find(".a-weather-temp__result_min").html(Math.round(o.temp.min)+"º"),$(e).find(".a-weather-temp__result_max").html(Math.round(o.temp.max)+"º"),$(e).find(".o-weather-temp").removeClass(t),$(e).find(".a-weather-icon__result").html(""+o.weather[0].main),o.weather[0].icon.indexOf("01")>=0?i+="clear":o.weather[0].icon.indexOf("02")>=0?i+="few-clouds":o.weather[0].icon.indexOf("03")>=0?i+="clouds":o.weather[0].icon.indexOf("04")>=0?i+="broken-clouds":o.weather[0].icon.indexOf("09")>=0?i+="shower-rain":o.weather[0].icon.indexOf("10")>=0?i+="rain":o.weather[0].icon.indexOf("11")>=0?i+="thunderstorm":o.weather[0].icon.indexOf("13")>=0?i+="snow":o.weather[0].icon.indexOf("50")>=0&&(i+="mist"),o.weather[0].icon.indexOf("d")>=0?i+="_day":o.weather[0].icon.indexOf("n")>=0&&(i+="_night"),$(e).find(".a-weather-icon__result").addClass(i),$(e).find(".o-weather-icon").removeClass(t),$(e).removeClass(t)})).fail((function(e,t,i){0!==e.status&&(o.a.isLocal()?console.error(new Error("Ajax error: "+t+", "+i)):console.error(new Error("Ajax error: "+t+", "+i+" || Ajax request: "+JSON.stringify(n)+" || Ajax response: status: "+e.status+", statusText: "+e.statusText+", responseText: "+e.responseText)))})).always((function(){}))}}])&&a(t.prototype,n),i&&a(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e}();t.default=r}}]);