{"version":3,"sources":["maints.js"],"names":["Pro2","Underscore","factory","f","$w","$inject","ResourceResource","$rc","DateString","scope","window","this","_scope","_window","prototype","getDateString","n","timeFormat","dateFormat","supportsLocales","Intl","DateTimeFormat","navigator","userLanguage","language","hour12","hour","minute","weekday","year","month","day","e","currentDate","Date","UTC","st","getUTCFullYear","getUTCMonth","getUTCDate","getUTCHours","cmt","setTime","getTime","radarTime","setSeconds","setMilliseconds","getMinutes","setMinutes","s","selectedResource","stepInMinutes","format","toLocaleTimeString","toLocaleDateString","ApplicationController","rc","underscore","dateString","resid","_this","_underscore","_resourceBoundaryPath","resources","query","selectResID","resID","_selectResource","download","mt","_download","cleanAll","_cleanAll","$on","_start","_reset","$promise","then","rs","rt","$","css","background","closeResAreaDlg","r","findWhere","id","fn","frameCount","_adjustMap","_drawResourceBoundary","settings","save","meteo","sf","keyScale","show","pbar","rebuild","animation","start","downloader","$broadcast","reset","hide","weatherOverlay","i","fr","w","o","p","sw","ne","x","y","z","map","getBounds","bounds","rb","google","maps","LatLngBounds","LatLng","rough","intersects","fitBounds","setMap","showBounds","path","lat","lon","Polygon","paths","strokeColor","strokeWeight","strokeOpacity","fillOpacity","zIndex","clickable","setOptions","ProgressBarController","_dateString","items","current","cached","failed","_rebuild","_show","_hide","_setCurrent","_setCached","_setFailed","click","_click","res","g","_getGroupSize","range","clickid","dStart","gStart","title","dEnd","angular","module","service","controller"],"mappings":"AACA,GAAIA,OACJ,SAAWA,GAIP,GAAIC,GAAc,WACd,QAASA,MAST,MAPAA,GAAWC,QAAU,WACjB,GAAIC,GAAI,SAAUC,GACd,MAAOA,GAAM,EAGjB,OADAD,GAAEE,SAAW,WACNF,GAEJF,IAEXD,GAAKC,WAAaA,GACnBD,OAASA,SAEZ,IAAIA,OACJ,SAAWA,GACP,GAAIM,GAAoB,WACpB,QAASA,MAST,MAPAA,GAAiBJ,QAAU,WACvB,GAAIC,GAAI,SAAUI,GACd,MAAOA,GAAI,wBAGf,OADAJ,GAAEE,SA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AUuI,MAAQ,WACpC1I,KAAKC,OAAOoF,MAAO,GAEvB6C,EAAsB/H,UAAUwI,YAAc,SAAU5C,GACpD/F,KAAKC,OAAOoI,QAAUtC,GAE1BmC,EAAsB/H,UAAUyI,WAAa,SAAU7C,GACnD/F,KAAKC,OAAOqI,OAAOvC,IAAK,GAE5BmC,EAAsB/H,UAAU0I,WAAa,SAAU9C,GACnD/F,KAAKC,OAAOsI,OAAOxC,IAAK,GAE5BmC,EAAsB/H,UAAU4I,OAAS,SAAUpE,GAC1C3E,KAAKC,OAAOsI,OAAO5D,IACpBa,UAAAA,QAAeb,IAGvBuD,EAAsBxI,SAAW,SAAU,aAAc,cAClDwI,IAEX7I,GAAK6I,sBAAwBA,GAC9B7I,OAASA,SAOZ,IAAIA,OACJ,SAAWA,GACPoK,QAAQC,OAAO,OAAQ,eAClBnK,QAAQ,aAAcF,EAAKC,WAAWC,WACtCA,QAAQ,WAAYF,EAAKM,iBAAiBJ,WAC1CoK,QAAQ,aAActK,EAAKQ,WAAWN,WACtCqK,WAAW,wBAAyBvK,EAAKuD,sBAAsBrD,WAC/DqK,WAAW,wBAAyBvK,EAAK6I,sBAAsB3I,YACrEF,OAASA","file":"maints.min.js","sourcesContent":["/// \nvar Pro2;\n(function (Pro2) {\n //\n // Underscore injection\n //\n var Underscore = (function () {\n function Underscore() {\n }\n Underscore.factory = function () {\n var f = function ($w) {\n return $w[\"_\"];\n };\n f.$inject = [\"$window\"];\n return f;\n };\n return Underscore;\n }());\n Pro2.Underscore = Underscore;\n})(Pro2 || (Pro2 = {}));\n/// \nvar Pro2;\n(function (Pro2) {\n var ResourceResource = (function () {\n function ResourceResource() {\n }\n ResourceResource.factory = function () {\n var f = function ($rc) {\n return $rc(\"config/resource.json\");\n };\n f.$inject = [\"$resource\"];\n return f;\n };\n return ResourceResource;\n }());\n Pro2.ResourceResource = ResourceResource;\n})(Pro2 || (Pro2 = {}));\n/// \n/// \n/// \nvar Pro2;\n(function (Pro2) {\n var DateString = (function () {\n function DateString(scope, window) {\n this._scope = scope;\n this._window = window;\n }\n DateString.factory = function () {\n return DateString;\n };\n DateString.prototype.getDateString = function (n) {\n var timeFormat;\n var dateFormat;\n var supportsLocales = true;\n try {\n timeFormat = new Intl.DateTimeFormat(this._window.navigator.userLanguage || this._window.navigator.language, { hour12: false, hour: \"2-digit\", minute: \"2-digit\" });\n dateFormat = new Intl.DateTimeFormat(this._window.navigator.userLanguage || this._window.navigator.language, { weekday: \"long\", year: \"numeric\", month: \"long\", day: \"numeric\" });\n }\n catch (e) {\n supportsLocales = false;\n }\n var currentDate = new Date(Date.UTC(st.getUTCFullYear(), st.getUTCMonth(), st.getUTCDate(), st.getUTCHours(), 0));\n switch (cmt) {\n case 64:\n currentDate.setTime(currentDate.getTime() + n * 3600 * 1000);\n break;\n case 128:\n var radarTime = new Date();\n radarTime.setSeconds(0);\n radarTime.setMilliseconds(0);\n radarTime.setTime(radarTime.getTime() - 60 * 60 * 4 * 1000);\n if (radarTime.getMinutes() < 30) {\n radarTime.setMinutes(0);\n }\n else {\n radarTime.setMinutes(30);\n }\n currentDate.setTime(radarTime.getTime() + n * 10 * 60 * 1000);\n break;\n default:\n var s = this._scope.selectedResource.stepInMinutes;\n currentDate.setTime(currentDate.getTime() + n * (s / 60) * 3600 * 1000 - (st.getUTCHours() % (s / 60)) * 3600 * 1000);\n break;\n }\n if (supportsLocales) {\n return timeFormat.format(currentDate) + \" \" + dateFormat.format(currentDate);\n }\n else {\n return currentDate.toLocaleTimeString(window.navigator.userLanguage || window.navigator.language, { hour12: false, hour: \"2-digit\", minute: \"2-digit\" }) + \" \" +\n currentDate.toLocaleDateString(window.navigator.userLanguage || window.navigator.language, { weekday: \"long\", year: \"numeric\", month: \"long\", day: \"numeric\" });\n }\n };\n DateString.$inject = [\"$rootScope\", \"$window\"];\n return DateString;\n }());\n Pro2.DateString = DateString;\n})(Pro2 || (Pro2 = {}));\n/// \n/// \n/// \n/// \nvar Pro2;\n(function (Pro2) {\n //\n // application controller\n //\n var ApplicationController = (function () {\n function ApplicationController(scope, rc, underscore, dateString, resid) {\n var _this = this;\n this._scope = scope;\n this._underscore = underscore;\n this._resourceBoundaryPath = null;\n this._scope.resources = rc.query();\n this._scope.selectResID = function (resID) { return _this._selectResource(resID); };\n this._scope.getDateString = function (n) { return dateString.getDateString(n); };\n this._scope.download = function (mt) { return _this._download(mt); };\n this._scope.cleanAll = function () { return _this._cleanAll(); };\n this._scope.$on(\"start\", function () { return _this._start(); });\n this._scope.$on(\"reset\", function () { return _this._reset(); });\n this._scope.resources.$promise.then(function () { return _this._selectResource(resid); });\n }\n ApplicationController.factory = function () {\n return ApplicationController;\n };\n ApplicationController.prototype._selectResource = function (resID) {\n this._cleanAll();\n if (rs != resID && rs != 3 && rs != 5 && rs != 9 && rs != 26) {\n rt = rs;\n }\n rs = resID;\n $(\"#resIDSelector\").css({\n background: \"url(pub/img/rc/\" + rs + \".png)\"\n });\n if (resID == 3) {\n $(\"#resIDSelector\").css({\n background: \"url(pub/img/rc/2.png)\"\n });\n }\n if (!(rs == 5 || rs == 3 || rs == 9 || rs == 26)) {\n closeResAreaDlg();\n }\n var r = this._underscore.findWhere(this._scope.resources, { id: resID });\n this._scope.selectedResource = r;\n // Ugly global!\n fn = r.frameCount;\n // switch to selected region\n this._adjustMap();\n // draw polilines\n this._drawResourceBoundary();\n // save settings\n settings.save();\n };\n ApplicationController.prototype._download = function (meteo) {\n if (meteo == 32) {\n this._selectResource(4);\n st = new Date();\n sf = (st.getUTCHours() < 7) ? (st.getUTCHours() + 24) : st.getUTCHours();\n cmt = 32;\n }\n else if (meteo == 128) {\n this._selectResource(26);\n sf = 0;\n cmt = 128;\n }\n else {\n st = new Date();\n if (meteo == 64) {\n this._selectResource(9);\n sf = (st.getUTCHours() < 7) ? st.getUTCHours() + 24 : st.getUTCHours();\n }\n else if (rs == 3 || rs == 5 || rs == 9 || rs == 26) {\n this._selectResource(rt);\n sf = (st.getUTCHours() < 7) ? ((st.getUTCHours() + 24) / 3) | 0 : (st.getUTCHours() / 3) | 0;\n }\n else {\n if (meteo == 129) {\n this._selectResource(2);\n meteo = 16;\n }\n var stepInMinutes = this._scope.selectedResource.stepInMinutes;\n sf = (st.getUTCHours() < 7) ? ((st.getUTCHours() + 24) / (stepInMinutes / 60)) | 0 : (st.getUTCHours() / (stepInMinutes / 60)) | 0;\n }\n cmt = meteo;\n }\n keyScale.show(cmt);\n pbar.rebuild();\n pbar.show();\n animation.start(sf);\n downloader.start(sf);\n this._scope.$broadcast(\"rebuild\");\n this._scope.$broadcast(\"start\");\n this._scope.$broadcast(\"pbar_show\");\n this._scope.$broadcast(\"pbar_setcurrent\", sf);\n };\n ApplicationController.prototype._cleanAll = function () {\n animation.reset();\n downloader.reset();\n keyScale.hide();\n pbar.hide();\n this._scope.$broadcast(\"pbar_hide\");\n if (weatherOverlay) {\n weatherOverlay.hide();\n }\n for (var i = 0; i < fn; ++i) {\n if (fr[i]) {\n fr[i] = { w: null, o: null, p: null, sw: null, ne: null, i: null, x: null, y: null, z: null };\n }\n }\n this._reset();\n };\n ApplicationController.prototype._adjustMap = function () {\n var r = this._scope.selectedResource;\n if (map && map.getBounds() && r && r.bounds) {\n var rb = new google.maps.LatLngBounds(new google.maps.LatLng(r.bounds.rough.s, r.bounds.rough.w), new google.maps.LatLng(r.bounds.rough.n, r.bounds.rough.e));\n if (!map.getBounds().intersects(rb)) {\n map.fitBounds(rb);\n }\n }\n };\n ApplicationController.prototype._drawResourceBoundary = function () {\n if (this._resourceBoundaryPath) {\n this._resourceBoundaryPath.setMap(null);\n }\n if (this._scope.selectedResource.showBounds && this._scope.selectedResource.bounds && this._scope.selectedResource.bounds.path) {\n var path = this._underscore.map(this._scope.selectedResource.bounds.path, function (p) {\n return new google.maps.LatLng(p.lat, p.lon);\n });\n this._resourceBoundaryPath = new google.maps.Polygon({\n paths: path,\n strokeColor: \"#FF0000\",\n strokeWeight: 1,\n strokeOpacity: 0.5,\n fillOpacity: 0.1,\n zIndex: 1,\n clickable: false\n });\n this._resourceBoundaryPath.setMap(map);\n }\n };\n ApplicationController.prototype._start = function () {\n if (this._resourceBoundaryPath) {\n this._resourceBoundaryPath.setOptions({ fillOpacity: 0 });\n }\n };\n ApplicationController.prototype._reset = function () {\n if (this._resourceBoundaryPath) {\n this._resourceBoundaryPath.setOptions({ fillOpacity: 0.1 });\n }\n };\n ApplicationController.$inject = [\"$rootScope\", \"Resource\", \"Underscore\", \"DateString\", \"resid\"];\n return ApplicationController;\n }());\n Pro2.ApplicationController = ApplicationController;\n})(Pro2 || (Pro2 = {}));\n/// \n/// \n/// \nvar Pro2;\n(function (Pro2) {\n var ProgressBarController = (function () {\n function ProgressBarController(scope, underscore, dateString) {\n var _this = this;\n this._scope = scope;\n this._underscore = underscore;\n this._dateString = dateString;\n this._scope.show = false;\n this._scope.items = null;\n this._scope.current = null;\n this._scope.cached = null;\n this._scope.failed = null;\n this._scope.$on(\"reset\", function () { return _this._reset(); });\n this._scope.$on(\"rebuild\", function () { return _this._rebuild(); });\n this._scope.$on(\"pbar_show\", function () { return _this._show(); });\n this._scope.$on(\"pbar_hide\", function () { return _this._hide(); });\n this._scope.$on(\"pbar_setcurrent\", function (e, i) { return _this._setCurrent(i); });\n this._scope.$on(\"pbar_setcached\", function (e, i) { return _this._setCached(i); });\n this._scope.$on(\"pbar_setfailed\", function (e, i) { return _this._setFailed(i); });\n this._scope.click = function (id) { return _this._click(id); };\n }\n ProgressBarController.factory = function () {\n return ProgressBarController;\n };\n ProgressBarController.prototype._reset = function () {\n this._scope.show = false;\n this._scope.items = null;\n this._scope.current = null;\n this._scope.cached = null;\n this._scope.failed = null;\n };\n ProgressBarController.prototype._rebuild = function () {\n var _this = this;\n var res = this._scope.selectedResource;\n var fn = res.frameCount;\n var s = res.stepInMinutes;\n var g = this._getGroupSize(s);\n this._scope.items = this._underscore.map(this._underscore.range(fn), function (i) {\n return {\n id: i,\n clickid: i,\n // the same thing\n // if it's NEXRAD - the special case\n // need some refactoring\n dStart: (res.id != 26)\n ? ((i * s) % (24 * 60) == 0)\n : (i % 6 == 0),\n gStart: (i * s) % g == 0,\n title: _this._dateString.getDateString(i - sf)\n };\n });\n // if it's NEXRAD - the special case\n // need some refactoring\n this._scope.dEnd = (res.id != 26)\n ? (((fn - 1) * s) % (24 * 60) == 0)\n : ((fn - 1) % 6 == 0);\n this._scope.cached = [];\n this._scope.failed = [];\n };\n ProgressBarController.prototype._getGroupSize = function (s) {\n // default grouping is none\n var g = s;\n // if step is less than hour then goup by hour\n if (s < 60)\n g = s;\n // if step is 1 hour - grouyp by 3 hours\n if (s == 60)\n g = 180;\n // if step is 2 hours then group by 4 hour\n if (s == 120)\n g = 240;\n return g;\n };\n ProgressBarController.prototype._show = function () {\n this._scope.show = true;\n };\n ProgressBarController.prototype._hide = function () {\n this._scope.show = false;\n };\n ProgressBarController.prototype._setCurrent = function (i) {\n this._scope.current = i;\n };\n ProgressBarController.prototype._setCached = function (i) {\n this._scope.cached[i] = true;\n };\n ProgressBarController.prototype._setFailed = function (i) {\n this._scope.failed[i] = true;\n };\n ProgressBarController.prototype._click = function (id) {\n if (!this._scope.failed[id]) {\n animation.goto(id);\n }\n };\n ProgressBarController.$inject = [\"$scope\", \"Underscore\", \"DateString\"];\n return ProgressBarController;\n }());\n Pro2.ProgressBarController = ProgressBarController;\n})(Pro2 || (Pro2 = {}));\n/// \n/// \n/// \n/// \n/// \n/// \nvar Pro2;\n(function (Pro2) {\n angular.module(\"app\", [\"ngResource\"])\n .factory(\"Underscore\", Pro2.Underscore.factory())\n .factory(\"Resource\", Pro2.ResourceResource.factory())\n .service(\"DateString\", Pro2.DateString.factory())\n .controller(\"ApplicationController\", Pro2.ApplicationController.factory())\n .controller(\"ProgressBarController\", Pro2.ProgressBarController.factory());\n})(Pro2 || (Pro2 = {}));\n"],"sourceRoot":"/source/"}